diff --git a/README.md b/README.md index 679b501a..8019ef0b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ For direct use in a browser script: ```html - + diff --git a/build/README.md b/build/README.md index 679b501a..8019ef0b 100644 --- a/build/README.md +++ b/build/README.md @@ -31,7 +31,7 @@ For direct use in a browser script: ```html - + diff --git a/build/dist/node/purecloud-guest-chat-client.js b/build/dist/node/purecloud-guest-chat-client.js index c5c6723d..fce7cf67 100644 --- a/build/dist/node/purecloud-guest-chat-client.js +++ b/build/dist/node/purecloud-guest-chat-client.js @@ -19,6 +19,9 @@ var PureCloudRegionHosts = { ap_south_1: 'aps1.pure.cloud', us_east_2: 'use2.us-gov-pure.cloud', sa_east_1: 'sae1.pure.cloud', + me_central_1: 'mec1.pure.cloud', + ap_northeast_3: 'apne3.pure.cloud', + eu_central_2: 'euc2.pure.cloud', }; const logLevels = { @@ -378,7 +381,7 @@ class Configuration { /** * @module purecloud-guest-chat-client/ApiClient - * @version 13.8.0 + * @version 13.8.1 */ class ApiClient { /** @@ -972,7 +975,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 13.8.0 + * @version 13.8.1 */ /** @@ -1341,7 +1344,7 @@ class WebChatApi { * *

* @module purecloud-guest-chat-client/index - * @version 13.8.0 + * @version 13.8.1 */ class platformClient { constructor() { diff --git a/build/dist/web-amd/purecloud-guest-chat-client.js b/build/dist/web-amd/purecloud-guest-chat-client.js index 925ec890..7675bbc9 100644 --- a/build/dist/web-amd/purecloud-guest-chat-client.js +++ b/build/dist/web-amd/purecloud-guest-chat-client.js @@ -17,6 +17,9 @@ define(['axios'], (function (axios) { 'use strict'; ap_south_1: 'aps1.pure.cloud', us_east_2: 'use2.us-gov-pure.cloud', sa_east_1: 'sae1.pure.cloud', + me_central_1: 'mec1.pure.cloud', + ap_northeast_3: 'apne3.pure.cloud', + eu_central_2: 'euc2.pure.cloud', }; const logLevels = { @@ -376,7 +379,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * @module purecloud-guest-chat-client/ApiClient - * @version 13.8.0 + * @version 13.8.1 */ class ApiClient { /** @@ -970,7 +973,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 13.8.0 + * @version 13.8.1 */ /** @@ -1339,7 +1342,7 @@ ${this.formatValue('Status', statusCode)}${this.formatValue('Headers', this.form * *

* @module purecloud-guest-chat-client/index - * @version 13.8.0 + * @version 13.8.1 */ class platformClient { constructor() { diff --git a/build/dist/web-amd/purecloud-guest-chat-client.min.js b/build/dist/web-amd/purecloud-guest-chat-client.min.js index 9a421b18..080c4d90 100644 --- a/build/dist/web-amd/purecloud-guest-chat-client.min.js +++ b/build/dist/web-amd/purecloud-guest-chat-client.min.js @@ -1 +1 @@ -define(["axios"],function(e){"use strict";var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e),i={us_east_1:"mypurecloud.com",eu_west_1:"mypurecloud.ie",ap_southeast_2:"mypurecloud.com.au",ap_northeast_1:"mypurecloud.jp",eu_central_1:"mypurecloud.de",us_west_2:"usw2.pure.cloud",ca_central_1:"cac1.pure.cloud",ap_northeast_2:"apne2.pure.cloud",eu_west_2:"euw2.pure.cloud",ap_south_1:"aps1.pure.cloud",us_east_2:"use2.us-gov-pure.cloud",sa_east_1:"sae1.pure.cloud"};const s={levels:{none:0,error:1,debug:2,trace:3}},o={level:{LNone:"none",LError:"error",LDebug:"debug",LTrace:"trace"}},a={formats:{JSON:"json",TEXT:"text"}};class n{get logLevelEnum(){return o}get logFormatEnum(){return a}constructor(){this.log_level=o.level.LNone,this.log_format=a.formats.TEXT,this.log_to_console=!0,this.log_file_path,this.log_response_body=!1,this.log_request_body=!1,this.setLogger()}setLogger(){if("undefined"==typeof window){const e=require("winston");this.logger=e.createLogger({levels:s.levels,level:this.log_level}),this.log_file_path&&""!==this.log_file_path&&(this.log_format===a.formats.JSON?this.logger.add(new e.transports.File({format:e.format.json(),filename:this.log_file_path})):this.logger.add(new e.transports.File({format:e.format.combine(e.format(e=>(e.level=e.level.toUpperCase(),e))(),e.format.simple()),filename:this.log_file_path}))),this.log_to_console&&(this.log_format===a.formats.JSON?this.logger.add(new e.transports.Console({format:e.format.json()})):this.logger.add(new e.transports.Console({format:e.format.combine(e.format(e=>(e.level=e.level.toUpperCase(),e))(),e.format.simple())})))}}log(e,t,i,s,o,a,n,r){var l=this.formatLog(e,t,i,s,o,a,n,r);"undefined"!=typeof window?this.calculateLogLevel(e)>0&&!0===this.log_to_console&&(this.log_format===this.logFormatEnum.formats.JSON?console.log(l):console.log(`${e.toUpperCase()}: ${l}`)):this.logger.transports.length>0&&this.logger.log(e,l)}calculateLogLevel(e){switch(this.log_level){case this.logLevelEnum.level.LError:return e!==this.logLevelEnum.level.LError?-1:1;case this.logLevelEnum.level.LDebug:return e===this.logLevelEnum.level.LTrace?-1:1;case this.logLevelEnum.level.LTrace:return 1;default:return-1}}formatLog(e,t,i,s,o,n,r,l){var h;return o&&(o.Authorization="[REDACTED]"),this.log_request_body||(r=void 0),this.log_response_body||(l=void 0),this.log_format&&this.log_format===a.formats.JSON?(h={level:e,date:(new Date).toISOString(),method:i,url:decodeURIComponent(s),correlationId:n&&n["inin-correlation-id"]?n["inin-correlation-id"]:"",statusCode:t},o&&(h.requestHeaders=o),n&&(h.responseHeaders=n),r&&(h.requestBody=r),l&&(h.responseBody=l)):h=`${(new Date).toISOString()}\n=== REQUEST === \n${this.formatValue("URL",decodeURIComponent(s))}${this.formatValue("Method",i)}${this.formatValue("Headers",this.formatHeaderString(o))}${this.formatValue("Body",r?JSON.stringify(r,null,2):"")}\n=== RESPONSE ===\n${this.formatValue("Status",t)}${this.formatValue("Headers",this.formatHeaderString(n))}${this.formatValue("CorrelationId",n&&n["inin-correlation-id"]?n["inin-correlation-id"]:"")}${this.formatValue("Body",l?JSON.stringify(l,null,2):"")}`,h}formatHeaderString(e){var t="";if(!e)return t;for(const[i,s]of Object.entries(e))t+=`\n\t${i}: ${s}`;return t}formatValue(e,t){return t&&""!==t&&"{}"!==t?`${e}: ${t}\n`:""}getLogLevel(e){switch(e){case"error":return o.level.LError;case"debug":return o.level.LDebug;case"trace":return o.level.LTrace;default:return o.level.LNone}}getLogFormat(e){switch(e){case"json":return a.formats.JSON;default:return a.formats.TEXT}}}class r{get instance(){return r.instance}set instance(e){r.instance=e}constructor(){if(r.instance||(r.instance=this),"undefined"!=typeof window)this.configPath="";else{const e=require("os"),t=require("path");this.configPath=t.join(e.homedir(),".genesyscloudjavascript-guest","config")}this.live_reload_config=!0,this.host,this.environment,this.basePath,this.authUrl,this.config,this.logger=new n,this.setEnvironment(),this.liveLoadConfig()}liveLoadConfig(){if("undefined"!=typeof window)this.configPath="";else if(this.updateConfigFromFile(),this.live_reload_config&&!0===this.live_reload_config)try{const e=require("fs");e.watchFile(this.configPath,{persistent:!1},(t,i)=>{this.updateConfigFromFile(),this.live_reload_config||e.unwatchFile(this.configPath)})}catch(e){}}setConfigPath(e){e&&e!==this.configPath&&(this.configPath=e,this.liveLoadConfig())}updateConfigFromFile(){if("undefined"==typeof window){const i=require("configparser");try{var e=new i;e.read(this.configPath),this.config=e}catch(e){if(e.name&&"MissingSectionHeaderError"===e.name){var t=require("fs").readFileSync(this.configPath,"utf8");this.config={_sections:JSON.parse(t)}}}this.config&&this.updateConfigValues()}}updateConfigValues(){this.logger.log_level=this.logger.getLogLevel(this.getConfigString("logging","log_level")),this.logger.log_format=this.logger.getLogFormat(this.getConfigString("logging","log_format")),this.logger.log_to_console=void 0!==this.getConfigBoolean("logging","log_to_console")?this.getConfigBoolean("logging","log_to_console"):this.logger.log_to_console,this.logger.log_file_path=void 0!==this.getConfigString("logging","log_file_path")?this.getConfigString("logging","log_file_path"):this.logger.log_file_path,this.logger.log_response_body=void 0!==this.getConfigBoolean("logging","log_response_body")?this.getConfigBoolean("logging","log_response_body"):this.logger.log_response_body,this.logger.log_request_body=void 0!==this.getConfigBoolean("logging","log_request_body")?this.getConfigBoolean("logging","log_request_body"):this.logger.log_request_body,this.live_reload_config=void 0!==this.getConfigBoolean("general","live_reload_config")?this.getConfigBoolean("general","live_reload_config"):this.live_reload_config,this.host=void 0!==this.getConfigString("general","host")?this.getConfigString("general","host"):this.host,this.setEnvironment(),this.logger.setLogger()}setEnvironment(e){this.environment=e||(this.host?this.host:"mypurecloud.com"),this.environment=this.environment.replace(/\/+$/,""),this.environment.startsWith("https://")&&(this.environment=this.environment.substring(8)),this.environment.startsWith("http://")&&(this.environment=this.environment.substring(7)),this.environment.startsWith("api.")&&(this.environment=this.environment.substring(4)),this.basePath=`https://api.${this.environment}`,this.authUrl=`https://login.${this.environment}`}getConfigString(e,t){if(this.config._sections[e])return this.config._sections[e][t]}getConfigBoolean(e,t){if(this.config._sections[e]&&void 0!==this.config._sections[e][t])return"string"==typeof this.config._sections[e][t]?"true"===this.config._sections[e][t]:this.config._sections[e][t]}}class l{get instance(){return l.instance}set instance(e){l.instance=e}constructor(){l.instance||(l.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(e){this.hasLocalStorage=!1}this.config=new r,this.setEnvironment("https://api.mypurecloud.com"),this.authentications={"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization",apiKeyPrefix:"Bearer"},"PureCloud OAuth":{type:"oauth2"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud","undefined"!=typeof window&&(window.ApiClient=this)}setReturnExtendedResponses(e){this.returnExtended=e}setPersistSettings(e,t){this.persistSettings=e,this.settingsPrefix=t?t.replace(/\W+/g,"_"):"purecloud"}_saveSettings(e){try{if(this.authData.apiKey=e.apiKey,this.authentications["Guest Chat JWT"].apiKey=e.apiKey,e.state&&(this.authData.state=e.state),e.tokenExpiryTime&&(this.authData.tokenExpiryTime=e.tokenExpiryTime,this.authData.tokenExpiryTimeString=e.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;let t=JSON.parse(JSON.stringify(this.authData));delete t.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(t))}catch(e){console.error(e)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;const e=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.apiKey&&this.setJwt(this.authData.apiKey),this.authData.state=e}setEnvironment(e){this.config.setEnvironment(e)}_testTokenAccess(){return new Promise((e,t)=>{this._loadSettings(),this.authentications["Guest Chat JWT"].apiKey?this.callApi("/api/v2/authorization/permissions","GET",null,null,null,null,null,["Guest Chat JWT"],["application/json"],["application/json"]).then(()=>{e()}).catch(e=>{this._saveSettings({apiKey:void 0}),t(e)}):t(new Error("Token is not set"))})}setJwt(e){this._saveSettings({apiKey:e})}setStorageKey(e){this.storageKey=e,this.setJwt(this.authentications["Guest Chat JWT"].apiKey)}_buildAuthUrl(e,t){return t||(t={}),Object.keys(t).reduce((e,i)=>t[i]?`${e}&${i}=${t[i]}`:e,`${this.config.authUrl}/${e}?`)}paramToString(e){return e?e instanceof Date?e.toJSON():e.toString():""}serialize(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[encodeURIComponent(i)]=Array.isArray(e[i])?e[i].join(","):this.paramToString(e[i]));return t}addHeaders(e,...t){return e=e?Object.assign(e,...t):Object.assign(...t)}buildUrl(e,t){e.match(/^\//)||(e=`/${e}`);var i=this.config.basePath+e;return i=i.replace(/\{([\w-]+)\}/g,(e,i)=>{var s;return s=t.hasOwnProperty(i)?this.paramToString(t[i]):e,encodeURIComponent(s)})}isJsonMime(e){return Boolean(e&&e.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(e){for(var t=0;t{var i=this.authentications[t];switch(i.type){case"basic":(i.username||i.password)&&(e.auth={username:i.username||"",password:i.password||""});break;case"apiKey":if(i.apiKey){var s={};i.apiKeyPrefix?s[i.name]=`${i.apiKeyPrefix} ${i.apiKey}`:s[i.name]=i.apiKey,"header"===i.in?e.headers=this.addHeaders(e.headers,s):e.params=this.serialize(s)}break;case"oauth2":i.accessToken&&(e.headers=this.addHeaders(e.headers,{Authorization:`Bearer ${i.accessToken}`}));break;default:throw new Error(`Unknown authentication type: ${i.type}`)}})}callApi(e,i,s,o,a,n,r,l,h,u){var g=this.buildUrl(e,s),c={method:i,url:g,proxy:this.proxy,timeout:this.timeout,params:this.serialize(o)};this.applyAuthToRequest(c,l);const d=this.defaultHeaders,p=this.normalizeParams(a);c.headers=this.addHeaders(c.headers,d,p);var m=this.jsonPreferredMime(h);if(m?c.headers["Content-Type"]=m:c.headers["Content-Type"]||(c.headers["Content-Type"]="application/json"),"application/x-www-form-urlencoded"===m)c.data=this.normalizeParams(n);else if("multipart/form-data"==m){var f=this.normalizeParams(n);for(var v in f)if(f.hasOwnProperty(v)){var _=new FormData;_.set(v,f[v]),c.data=_}}else r&&(c.data=r);var b=this.jsonPreferredMime(u);return b&&(c.headers.Accept=b),new Promise((e,s)=>{t.default.request(c).then(t=>{var s=!0===this.returnExtended?{status:t.status,statusText:t.statusText,headers:t.headers,body:t.data,text:t.text,error:null}:t.data?t.data:t.text;this.config.logger.log("trace",t.status,i,g,c.headers,t.headers,r,void 0),this.config.logger.log("debug",t.status,i,g,c.headers,void 0,r,void 0),e(s)}).catch(e=>{var t=e;e.response&&(this.config.logger.log("error",e.response.status,i,g,c.headers,e.response.headers,r,e.response.data),t=!0===this.returnExtended?{status:e.response.status,statusText:e.response.statusText,headers:e.response.headers,body:e.response.data,text:e.response.text,error:e}:e.response.data?e.response.data:e.response.text),s(t)})})}}class h{constructor(e){this.apiClient=e||l.instance}deleteWebchatGuestConversationMember(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling deleteWebchatGuestConversationMember';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling deleteWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","DELETE",{conversationId:e,memberId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequest(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequest';if(void 0===t||null===t)throw'Missing the required parameter "mediaRequestId" when calling getWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","GET",{conversationId:e,mediaRequestId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequests(e){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequests';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests","GET",{conversationId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMember(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMember';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling getWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","GET",{conversationId:e,memberId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMembers(e,t){if(t=t||{},void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMembers';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members","GET",{conversationId:e},{pageSize:t.pageSize,pageNumber:t.pageNumber,excludeDisconnectedMembers:t.excludeDisconnectedMembers},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessage(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessage';if(void 0===t||null===t)throw'Missing the required parameter "messageId" when calling getWebchatGuestConversationMessage';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}","GET",{conversationId:e,messageId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessages(e,t){if(t=t||{},void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages","GET",{conversationId:e},{after:t.after,before:t.before,sortOrder:t.sortOrder,maxResults:t.maxResults},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}patchWebchatGuestConversationMediarequest(e,t,i){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling patchWebchatGuestConversationMediarequest';if(void 0===t||null===t)throw'Missing the required parameter "mediaRequestId" when calling patchWebchatGuestConversationMediarequest';if(void 0===i||null===i)throw'Missing the required parameter "body" when calling patchWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","PATCH",{conversationId:e,mediaRequestId:t},{},{},{},i,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberMessages(e,t,i){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberMessages';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberMessages';if(void 0===i||null===i)throw'Missing the required parameter "body" when calling postWebchatGuestConversationMemberMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages","POST",{conversationId:e,memberId:t},{},{},{},i,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberTyping(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberTyping';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberTyping';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing","POST",{conversationId:e,memberId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversations(e){if(void 0===e||null===e)throw'Missing the required parameter "body" when calling postWebchatGuestConversations';return this.apiClient.callApi("/api/v2/webchat/guest/conversations","POST",{},{},{},{},e,[],["application/json"],["application/json"])}}return new class{constructor(){this.ApiClient=new l,this.WebChatApi=h,this.PureCloudRegionHosts=i}}}); \ No newline at end of file +define(["axios"],function(e){"use strict";var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e),i={us_east_1:"mypurecloud.com",eu_west_1:"mypurecloud.ie",ap_southeast_2:"mypurecloud.com.au",ap_northeast_1:"mypurecloud.jp",eu_central_1:"mypurecloud.de",us_west_2:"usw2.pure.cloud",ca_central_1:"cac1.pure.cloud",ap_northeast_2:"apne2.pure.cloud",eu_west_2:"euw2.pure.cloud",ap_south_1:"aps1.pure.cloud",us_east_2:"use2.us-gov-pure.cloud",sa_east_1:"sae1.pure.cloud",me_central_1:"mec1.pure.cloud",ap_northeast_3:"apne3.pure.cloud",eu_central_2:"euc2.pure.cloud"};const s={levels:{none:0,error:1,debug:2,trace:3}},o={level:{LNone:"none",LError:"error",LDebug:"debug",LTrace:"trace"}},a={formats:{JSON:"json",TEXT:"text"}};class n{get logLevelEnum(){return o}get logFormatEnum(){return a}constructor(){this.log_level=o.level.LNone,this.log_format=a.formats.TEXT,this.log_to_console=!0,this.log_file_path,this.log_response_body=!1,this.log_request_body=!1,this.setLogger()}setLogger(){if("undefined"==typeof window){const e=require("winston");this.logger=e.createLogger({levels:s.levels,level:this.log_level}),this.log_file_path&&""!==this.log_file_path&&(this.log_format===a.formats.JSON?this.logger.add(new e.transports.File({format:e.format.json(),filename:this.log_file_path})):this.logger.add(new e.transports.File({format:e.format.combine(e.format(e=>(e.level=e.level.toUpperCase(),e))(),e.format.simple()),filename:this.log_file_path}))),this.log_to_console&&(this.log_format===a.formats.JSON?this.logger.add(new e.transports.Console({format:e.format.json()})):this.logger.add(new e.transports.Console({format:e.format.combine(e.format(e=>(e.level=e.level.toUpperCase(),e))(),e.format.simple())})))}}log(e,t,i,s,o,a,n,r){var l=this.formatLog(e,t,i,s,o,a,n,r);"undefined"!=typeof window?this.calculateLogLevel(e)>0&&!0===this.log_to_console&&(this.log_format===this.logFormatEnum.formats.JSON?console.log(l):console.log(`${e.toUpperCase()}: ${l}`)):this.logger.transports.length>0&&this.logger.log(e,l)}calculateLogLevel(e){switch(this.log_level){case this.logLevelEnum.level.LError:return e!==this.logLevelEnum.level.LError?-1:1;case this.logLevelEnum.level.LDebug:return e===this.logLevelEnum.level.LTrace?-1:1;case this.logLevelEnum.level.LTrace:return 1;default:return-1}}formatLog(e,t,i,s,o,n,r,l){var h;return o&&(o.Authorization="[REDACTED]"),this.log_request_body||(r=void 0),this.log_response_body||(l=void 0),this.log_format&&this.log_format===a.formats.JSON?(h={level:e,date:(new Date).toISOString(),method:i,url:decodeURIComponent(s),correlationId:n&&n["inin-correlation-id"]?n["inin-correlation-id"]:"",statusCode:t},o&&(h.requestHeaders=o),n&&(h.responseHeaders=n),r&&(h.requestBody=r),l&&(h.responseBody=l)):h=`${(new Date).toISOString()}\n=== REQUEST === \n${this.formatValue("URL",decodeURIComponent(s))}${this.formatValue("Method",i)}${this.formatValue("Headers",this.formatHeaderString(o))}${this.formatValue("Body",r?JSON.stringify(r,null,2):"")}\n=== RESPONSE ===\n${this.formatValue("Status",t)}${this.formatValue("Headers",this.formatHeaderString(n))}${this.formatValue("CorrelationId",n&&n["inin-correlation-id"]?n["inin-correlation-id"]:"")}${this.formatValue("Body",l?JSON.stringify(l,null,2):"")}`,h}formatHeaderString(e){var t="";if(!e)return t;for(const[i,s]of Object.entries(e))t+=`\n\t${i}: ${s}`;return t}formatValue(e,t){return t&&""!==t&&"{}"!==t?`${e}: ${t}\n`:""}getLogLevel(e){switch(e){case"error":return o.level.LError;case"debug":return o.level.LDebug;case"trace":return o.level.LTrace;default:return o.level.LNone}}getLogFormat(e){switch(e){case"json":return a.formats.JSON;default:return a.formats.TEXT}}}class r{get instance(){return r.instance}set instance(e){r.instance=e}constructor(){if(r.instance||(r.instance=this),"undefined"!=typeof window)this.configPath="";else{const e=require("os"),t=require("path");this.configPath=t.join(e.homedir(),".genesyscloudjavascript-guest","config")}this.live_reload_config=!0,this.host,this.environment,this.basePath,this.authUrl,this.config,this.logger=new n,this.setEnvironment(),this.liveLoadConfig()}liveLoadConfig(){if("undefined"!=typeof window)this.configPath="";else if(this.updateConfigFromFile(),this.live_reload_config&&!0===this.live_reload_config)try{const e=require("fs");e.watchFile(this.configPath,{persistent:!1},(t,i)=>{this.updateConfigFromFile(),this.live_reload_config||e.unwatchFile(this.configPath)})}catch(e){}}setConfigPath(e){e&&e!==this.configPath&&(this.configPath=e,this.liveLoadConfig())}updateConfigFromFile(){if("undefined"==typeof window){const i=require("configparser");try{var e=new i;e.read(this.configPath),this.config=e}catch(e){if(e.name&&"MissingSectionHeaderError"===e.name){var t=require("fs").readFileSync(this.configPath,"utf8");this.config={_sections:JSON.parse(t)}}}this.config&&this.updateConfigValues()}}updateConfigValues(){this.logger.log_level=this.logger.getLogLevel(this.getConfigString("logging","log_level")),this.logger.log_format=this.logger.getLogFormat(this.getConfigString("logging","log_format")),this.logger.log_to_console=void 0!==this.getConfigBoolean("logging","log_to_console")?this.getConfigBoolean("logging","log_to_console"):this.logger.log_to_console,this.logger.log_file_path=void 0!==this.getConfigString("logging","log_file_path")?this.getConfigString("logging","log_file_path"):this.logger.log_file_path,this.logger.log_response_body=void 0!==this.getConfigBoolean("logging","log_response_body")?this.getConfigBoolean("logging","log_response_body"):this.logger.log_response_body,this.logger.log_request_body=void 0!==this.getConfigBoolean("logging","log_request_body")?this.getConfigBoolean("logging","log_request_body"):this.logger.log_request_body,this.live_reload_config=void 0!==this.getConfigBoolean("general","live_reload_config")?this.getConfigBoolean("general","live_reload_config"):this.live_reload_config,this.host=void 0!==this.getConfigString("general","host")?this.getConfigString("general","host"):this.host,this.setEnvironment(),this.logger.setLogger()}setEnvironment(e){this.environment=e||(this.host?this.host:"mypurecloud.com"),this.environment=this.environment.replace(/\/+$/,""),this.environment.startsWith("https://")&&(this.environment=this.environment.substring(8)),this.environment.startsWith("http://")&&(this.environment=this.environment.substring(7)),this.environment.startsWith("api.")&&(this.environment=this.environment.substring(4)),this.basePath=`https://api.${this.environment}`,this.authUrl=`https://login.${this.environment}`}getConfigString(e,t){if(this.config._sections[e])return this.config._sections[e][t]}getConfigBoolean(e,t){if(this.config._sections[e]&&void 0!==this.config._sections[e][t])return"string"==typeof this.config._sections[e][t]?"true"===this.config._sections[e][t]:this.config._sections[e][t]}}class l{get instance(){return l.instance}set instance(e){l.instance=e}constructor(){l.instance||(l.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(e){this.hasLocalStorage=!1}this.config=new r,this.setEnvironment("https://api.mypurecloud.com"),this.authentications={"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization",apiKeyPrefix:"Bearer"},"PureCloud OAuth":{type:"oauth2"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud","undefined"!=typeof window&&(window.ApiClient=this)}setReturnExtendedResponses(e){this.returnExtended=e}setPersistSettings(e,t){this.persistSettings=e,this.settingsPrefix=t?t.replace(/\W+/g,"_"):"purecloud"}_saveSettings(e){try{if(this.authData.apiKey=e.apiKey,this.authentications["Guest Chat JWT"].apiKey=e.apiKey,e.state&&(this.authData.state=e.state),e.tokenExpiryTime&&(this.authData.tokenExpiryTime=e.tokenExpiryTime,this.authData.tokenExpiryTimeString=e.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;let t=JSON.parse(JSON.stringify(this.authData));delete t.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(t))}catch(e){console.error(e)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;const e=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.apiKey&&this.setJwt(this.authData.apiKey),this.authData.state=e}setEnvironment(e){this.config.setEnvironment(e)}_testTokenAccess(){return new Promise((e,t)=>{this._loadSettings(),this.authentications["Guest Chat JWT"].apiKey?this.callApi("/api/v2/authorization/permissions","GET",null,null,null,null,null,["Guest Chat JWT"],["application/json"],["application/json"]).then(()=>{e()}).catch(e=>{this._saveSettings({apiKey:void 0}),t(e)}):t(new Error("Token is not set"))})}setJwt(e){this._saveSettings({apiKey:e})}setStorageKey(e){this.storageKey=e,this.setJwt(this.authentications["Guest Chat JWT"].apiKey)}_buildAuthUrl(e,t){return t||(t={}),Object.keys(t).reduce((e,i)=>t[i]?`${e}&${i}=${t[i]}`:e,`${this.config.authUrl}/${e}?`)}paramToString(e){return e?e instanceof Date?e.toJSON():e.toString():""}serialize(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[encodeURIComponent(i)]=Array.isArray(e[i])?e[i].join(","):this.paramToString(e[i]));return t}addHeaders(e,...t){return e=e?Object.assign(e,...t):Object.assign(...t)}buildUrl(e,t){e.match(/^\//)||(e=`/${e}`);var i=this.config.basePath+e;return i=i.replace(/\{([\w-]+)\}/g,(e,i)=>{var s;return s=t.hasOwnProperty(i)?this.paramToString(t[i]):e,encodeURIComponent(s)})}isJsonMime(e){return Boolean(e&&e.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(e){for(var t=0;t{var i=this.authentications[t];switch(i.type){case"basic":(i.username||i.password)&&(e.auth={username:i.username||"",password:i.password||""});break;case"apiKey":if(i.apiKey){var s={};i.apiKeyPrefix?s[i.name]=`${i.apiKeyPrefix} ${i.apiKey}`:s[i.name]=i.apiKey,"header"===i.in?e.headers=this.addHeaders(e.headers,s):e.params=this.serialize(s)}break;case"oauth2":i.accessToken&&(e.headers=this.addHeaders(e.headers,{Authorization:`Bearer ${i.accessToken}`}));break;default:throw new Error(`Unknown authentication type: ${i.type}`)}})}callApi(e,i,s,o,a,n,r,l,h,u){var g=this.buildUrl(e,s),c={method:i,url:g,proxy:this.proxy,timeout:this.timeout,params:this.serialize(o)};this.applyAuthToRequest(c,l);const d=this.defaultHeaders,p=this.normalizeParams(a);c.headers=this.addHeaders(c.headers,d,p);var m=this.jsonPreferredMime(h);if(m?c.headers["Content-Type"]=m:c.headers["Content-Type"]||(c.headers["Content-Type"]="application/json"),"application/x-www-form-urlencoded"===m)c.data=this.normalizeParams(n);else if("multipart/form-data"==m){var f=this.normalizeParams(n);for(var v in f)if(f.hasOwnProperty(v)){var _=new FormData;_.set(v,f[v]),c.data=_}}else r&&(c.data=r);var b=this.jsonPreferredMime(u);return b&&(c.headers.Accept=b),new Promise((e,s)=>{t.default.request(c).then(t=>{var s=!0===this.returnExtended?{status:t.status,statusText:t.statusText,headers:t.headers,body:t.data,text:t.text,error:null}:t.data?t.data:t.text;this.config.logger.log("trace",t.status,i,g,c.headers,t.headers,r,void 0),this.config.logger.log("debug",t.status,i,g,c.headers,void 0,r,void 0),e(s)}).catch(e=>{var t=e;e.response&&(this.config.logger.log("error",e.response.status,i,g,c.headers,e.response.headers,r,e.response.data),t=!0===this.returnExtended?{status:e.response.status,statusText:e.response.statusText,headers:e.response.headers,body:e.response.data,text:e.response.text,error:e}:e.response.data?e.response.data:e.response.text),s(t)})})}}class h{constructor(e){this.apiClient=e||l.instance}deleteWebchatGuestConversationMember(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling deleteWebchatGuestConversationMember';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling deleteWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","DELETE",{conversationId:e,memberId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequest(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequest';if(void 0===t||null===t)throw'Missing the required parameter "mediaRequestId" when calling getWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","GET",{conversationId:e,mediaRequestId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequests(e){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequests';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests","GET",{conversationId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMember(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMember';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling getWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","GET",{conversationId:e,memberId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMembers(e,t){if(t=t||{},void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMembers';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members","GET",{conversationId:e},{pageSize:t.pageSize,pageNumber:t.pageNumber,excludeDisconnectedMembers:t.excludeDisconnectedMembers},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessage(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessage';if(void 0===t||null===t)throw'Missing the required parameter "messageId" when calling getWebchatGuestConversationMessage';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}","GET",{conversationId:e,messageId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessages(e,t){if(t=t||{},void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages","GET",{conversationId:e},{after:t.after,before:t.before,sortOrder:t.sortOrder,maxResults:t.maxResults},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}patchWebchatGuestConversationMediarequest(e,t,i){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling patchWebchatGuestConversationMediarequest';if(void 0===t||null===t)throw'Missing the required parameter "mediaRequestId" when calling patchWebchatGuestConversationMediarequest';if(void 0===i||null===i)throw'Missing the required parameter "body" when calling patchWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","PATCH",{conversationId:e,mediaRequestId:t},{},{},{},i,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberMessages(e,t,i){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberMessages';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberMessages';if(void 0===i||null===i)throw'Missing the required parameter "body" when calling postWebchatGuestConversationMemberMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages","POST",{conversationId:e,memberId:t},{},{},{},i,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberTyping(e,t){if(void 0===e||null===e)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberTyping';if(void 0===t||null===t)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberTyping';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing","POST",{conversationId:e,memberId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversations(e){if(void 0===e||null===e)throw'Missing the required parameter "body" when calling postWebchatGuestConversations';return this.apiClient.callApi("/api/v2/webchat/guest/conversations","POST",{},{},{},{},e,[],["application/json"],["application/json"])}}return new class{constructor(){this.ApiClient=new l,this.WebChatApi=h,this.PureCloudRegionHosts=i}}}); \ No newline at end of file diff --git a/build/dist/web-cjs/bundle.js b/build/dist/web-cjs/bundle.js index e4f10a2f..d26b3a25 100644 --- a/build/dist/web-cjs/bundle.js +++ b/build/dist/web-cjs/bundle.js @@ -19,6 +19,9 @@ var PureCloudRegionHosts = { ap_south_1: 'aps1.pure.cloud', us_east_2: 'use2.us-gov-pure.cloud', sa_east_1: 'sae1.pure.cloud', + me_central_1: 'mec1.pure.cloud', + ap_northeast_3: 'apne3.pure.cloud', + eu_central_2: 'euc2.pure.cloud', }; var global$1 = (typeof global !== "undefined" ? global : @@ -2255,7 +2258,7 @@ class Configuration { /** * @module purecloud-guest-chat-client/ApiClient - * @version 13.8.0 + * @version 13.8.1 */ class ApiClient { /** @@ -2842,7 +2845,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 13.8.0 + * @version 13.8.1 */ /** @@ -3211,7 +3214,7 @@ class WebChatApi { * *

* @module purecloud-guest-chat-client/index - * @version 13.8.0 + * @version 13.8.1 */ class platformClient { constructor() { diff --git a/build/dist/web-cjs/purecloud-guest-chat-client.js b/build/dist/web-cjs/purecloud-guest-chat-client.js index dd7ddb25..df3cf408 100644 --- a/build/dist/web-cjs/purecloud-guest-chat-client.js +++ b/build/dist/web-cjs/purecloud-guest-chat-client.js @@ -4991,6 +4991,9 @@ var PureCloudRegionHosts = { ap_south_1: 'aps1.pure.cloud', us_east_2: 'use2.us-gov-pure.cloud', sa_east_1: 'sae1.pure.cloud', + me_central_1: 'mec1.pure.cloud', + ap_northeast_3: 'apne3.pure.cloud', + eu_central_2: 'euc2.pure.cloud', }; var global$1 = (typeof global !== "undefined" ? global : @@ -7227,7 +7230,7 @@ class Configuration { /** * @module purecloud-guest-chat-client/ApiClient - * @version 13.8.0 + * @version 13.8.1 */ class ApiClient { /** @@ -7814,7 +7817,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 13.8.0 + * @version 13.8.1 */ /** @@ -8183,7 +8186,7 @@ class WebChatApi { * *

* @module purecloud-guest-chat-client/index - * @version 13.8.0 + * @version 13.8.1 */ class platformClient { constructor() { diff --git a/build/dist/web-cjs/purecloud-guest-chat-client.min.js b/build/dist/web-cjs/purecloud-guest-chat-client.min.js index 52146e4a..76fcf8fa 100644 --- a/build/dist/web-cjs/purecloud-guest-chat-client.min.js +++ b/build/dist/web-cjs/purecloud-guest-chat-client.min.js @@ -1 +1 @@ -require=function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s0?s-4:s;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){(function(e){(function(){"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function o(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|l(t,e),n=o(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(k(t,ArrayBuffer)||t&&k(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function l(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||k(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(i)return n?-1:j(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:d(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):d(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function d(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(k(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return e=+e,r>>>=0,o||U(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,o){return e=+e,r>>>=0,o||U(t,0,r,8),n.write(t,e,r,i,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),n.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),n.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),n.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),n.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function k(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":1,buffer:2,ieee754:3}],3:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=g,s/=256,f-=8);t[r+p-g]|=128*d}},{}],4:[function(t,e,r){r.endianness=function(){return"LE"},r.hostname=function(){return"undefined"!=typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n",r.homedir=function(){return"/"}},{}],5:[function(t,e,r){(function(t){(function(){"use strict";function r(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var i={resolve:function(){for(var e,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=t.cwd()),a=e),r(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var n=1;nf){if(47===e.charCodeAt(a+c))return e.slice(a+c+1);if(0===c)return e.slice(a+c)}else s>f&&(47===t.charCodeAt(n+c)?h=c:0===c&&(h=0));break}var l=t.charCodeAt(n+c);if(l!==e.charCodeAt(a+c))break;47===l&&(h=c)}var p="";for(c=n+h+1;c<=o;++c)c!==o&&47!==t.charCodeAt(c)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,i=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,u=-1;for(n=t.length-1;n>=0;--n){var f=t.charCodeAt(n);if(47===f){if(!s){i=n+1;break}}else-1===u&&(s=!1,u=n+1),a>=0&&(f===e.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){r(t);for(var e=-1,n=0,i=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===i&&(o=!1,i=a+1),46===u?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){n=a+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),o=47===i;o?(e.root="/",n=1):n=0;for(var s=-1,a=0,u=-1,f=!0,h=t.length-1,c=0;h>=n;--h)if(47!==(i=t.charCodeAt(h)))-1===u&&(f=!1,u=h+1),46===i?-1===s?s=h:1!==c&&(c=1):-1!==s&&(c=-1);else if(!f){a=h+1;break}return-1===s||-1===u||0===c||1===c&&s===u-1&&s===a+1?-1!==u&&(e.base=e.name=0===a&&o?t.slice(1,u):t.slice(a,u)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,u)):(e.name=t.slice(a,s),e.base=t.slice(a,u)),e.ext=t.slice(s,u)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}).call(this)}).call(this,t("_process"))},{_process:6}],6:[function(t,e,r){var n,i,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var f,h=[],c=!1,l=-1;function p(){c&&f&&(c=!1,f.length?h=f.concat(h):l=-1,h.length&&g())}function g(){if(!c){var t=u(p);c=!0;for(var e=h.length;e;){for(f=h,h=[];++l1)for(var r=1;r=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(t){c.headers[t]={}}),n.forEach(["post","put","patch"],function(t){c.headers[t]=n.merge(u)}),e.exports=c}).call(this)}).call(this,t("_process"))},{"../adapters/http":8,"../adapters/xhr":8,"../core/AxiosError":14,"../helpers/normalizeHeaderName":31,"../helpers/toFormData":36,"../utils":38,"./env/FormData":32,"./transitional":22,_process:6}],22:[function(t,e,r){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},{}],23:[function(t,e,r){e.exports={version:"0.27.2"}},{}],24:[function(t,e,r){"use strict";e.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}}),s):s}},{"./../utils":38}],34:[function(t,e,r){"use strict";e.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},{}],35:[function(t,e,r){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},{}],36:[function(t,e,r){(function(r){(function(){"use strict";var n=t("../utils");e.exports=function(t,e){e=e||new FormData;var i=[];function o(t){return null===t?"":n.isDate(t)?t.toISOString():n.isArrayBuffer(t)||n.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):r.from(t):t}return function t(r,s){if(n.isPlainObject(r)||n.isArray(r)){if(-1!==i.indexOf(r))throw Error("Circular reference detected in "+s);i.push(r),n.forEach(r,function(r,i){if(!n.isUndefined(r)){var a,u=s?s+"."+i:i;if(r&&!s&&"object"==typeof r)if(n.endsWith(i,"{}"))r=JSON.stringify(r);else if(n.endsWith(i,"[]")&&(a=n.toArray(r)))return void a.forEach(function(t){!n.isUndefined(t)&&e.append(u,o(t))});t(r,u)}}),i.pop()}else e.append(s,o(r))}(t),e}}).call(this)}).call(this,t("buffer").Buffer)},{"../utils":38,buffer:2}],37:[function(t,e,r){"use strict";var n=t("../env/data").version,i=t("../core/AxiosError"),o={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){o[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});var s={};o.transitional=function(t,e,r){function o(t,e){return"[Axios v"+n+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,n,a){if(!1===t)throw new i(o(n," has been removed"+(e?" in "+e:"")),i.ERR_DEPRECATED);return e&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,n,a)}},e.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),o=n.length;o-- >0;){var s=n[o],a=e[s];if(a){var u=t[s],f=void 0===u||a(u,s,t);if(!0!==f)throw new i("option "+s+" must be "+f,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},{"../core/AxiosError":14,"../env/data":23}],38:[function(t,e,r){"use strict";var n,i=t("./helpers/bind"),o=Object.prototype.toString,s=(n=Object.create(null),function(t){var e=o.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return s(e)===t}}function u(t){return Array.isArray(t)}function f(t){return void 0===t}var h=a("ArrayBuffer");function c(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==s(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var p=a("Date"),g=a("File"),d=a("Blob"),v=a("FileList");function m(t){return"[object Function]"===o.call(t)}var y=a("URLSearchParams");function w(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),u(t))for(var r=0,n=t.length;r0;)s[o=n[i]]||(e[o]=t[o],s[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:a,endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;var n=t.indexOf(e,r);return-1!==n&&n===r},toArray:function(t){if(!t)return null;var e=t.length;if(f(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r},isTypedArray:E,isFileList:v}},{"./helpers/bind":24}],platformClient:[function(t,e,r){(function(r,n){(function(){"use strict";var n=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t("axios")),i={us_east_1:"mypurecloud.com",eu_west_1:"mypurecloud.ie",ap_southeast_2:"mypurecloud.com.au",ap_northeast_1:"mypurecloud.jp",eu_central_1:"mypurecloud.de",us_west_2:"usw2.pure.cloud",ca_central_1:"cac1.pure.cloud",ap_northeast_2:"apne2.pure.cloud",eu_west_2:"euw2.pure.cloud",ap_south_1:"aps1.pure.cloud",us_east_2:"use2.us-gov-pure.cloud",sa_east_1:"sae1.pure.cloud"},o=void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,f=!1;function h(){f=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function l(t){var e;f||h();for(var r=t.length,n=r%3,i="",o=[],a=0,u=r-n;au?u:a+16383));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}function p(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)}function g(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=g,s/=256,f-=8);t[r+p-g]|=128*d}var d={}.toString,v=Array.isArray||function(t){return"[object Array]"==d.call(t)};function m(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,e){if(m()=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|t}function T(t){return!(null==t||!t._isBuffer)}function R(t,e){if(T(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return Q(t).length;e=(""+e).toLowerCase(),n=!0}}function S(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=w.from(e,n)),T(e))return 0===e.length?-1:B(t,e,r,n,i);if("number"==typeof e)return e&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):B(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?l(t):l(t.slice(e,r))}function D(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return D(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return q(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},w.prototype.equals=function(t){if(!T(t))throw new TypeError("Argument must be a Buffer");return this===t||0===w.compare(this,t)},w.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},w.prototype.compare=function(t,e,r,n,i){if(!T(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r),h=0;hi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return U(this,t,e,r);case"ascii":return P(this,t,e,r);case"latin1":case"binary":return I(this,t,e,r);case"base64":return L(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function Y(t,e,r,n,i,o){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function J(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function z(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function $(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,i){return i||$(t,0,r,4),g(t,e,r,n,23,4),r+4}function V(t,e,r,n,i){return i||$(t,0,r,8),g(t,e,r,n,52,8),r+8}w.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},w.prototype.readUInt8=function(t,e){return e||G(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,e){return e||G(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,e){return e||G(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,e){return e||G(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,e){return e||G(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||G(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},w.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||G(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},w.prototype.readInt8=function(t,e){return e||G(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,e){e||G(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},w.prototype.readInt16BE=function(t,e){e||G(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},w.prototype.readInt32LE=function(t,e){return e||G(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,e){return e||G(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,e){return e||G(t,4,this.length),p(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,e){return e||G(t,4,this.length),p(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,e){return e||G(t,8,this.length),p(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,e){return e||G(t,8,this.length),p(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Y(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},w.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},w.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):J(this,t,e,!0),e+2},w.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):J(this,t,e,!1),e+2},w.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},w.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},w.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},w.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},w.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},w.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):J(this,t,e,!0),e+2},w.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):J(this,t,e,!1),e+2},w.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},w.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},w.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},w.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},w.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},w.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},w.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!w.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return function(t){var e,r,n,i,o,s;f||h();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[c-2]?2:"="===t[c-1]?1:0,s=new u(3*c/4-o),n=o>0?c-4:c;var l=0;for(e=0,r=0;e>16&255,s[l++]=i>>8&255,s[l++]=255&i;return 2===o?(i=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,s[l++]=255&i):1===o&&(i=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,s[l++]=i>>8&255,s[l++]=255&i),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}const rt={level:{LNone:"none",LError:"error",LDebug:"debug",LTrace:"trace"}},nt={formats:{JSON:"json",TEXT:"text"}};class it{get logLevelEnum(){return rt}get logFormatEnum(){return nt}constructor(){this.log_level=rt.level.LNone,this.log_format=nt.formats.TEXT,this.log_to_console=!0,this.log_file_path,this.log_response_body=!1,this.log_request_body=!1,this.setLogger()}setLogger(){}log(t,e,r,n,i,o,s,a){var u=this.formatLog(t,e,r,n,i,o,s,a);"undefined"!=typeof window?this.calculateLogLevel(t)>0&&!0===this.log_to_console&&(this.log_format===this.logFormatEnum.formats.JSON?console.log(u):console.log(`${t.toUpperCase()}: ${u}`)):this.logger.transports.length>0&&this.logger.log(t,u)}calculateLogLevel(t){switch(this.log_level){case this.logLevelEnum.level.LError:return t!==this.logLevelEnum.level.LError?-1:1;case this.logLevelEnum.level.LDebug:return t===this.logLevelEnum.level.LTrace?-1:1;case this.logLevelEnum.level.LTrace:return 1;default:return-1}}formatLog(t,e,r,n,i,o,s,a){var u;return i&&(i.Authorization="[REDACTED]"),this.log_request_body||(s=void 0),this.log_response_body||(a=void 0),this.log_format&&this.log_format===nt.formats.JSON?(u={level:t,date:(new Date).toISOString(),method:r,url:decodeURIComponent(n),correlationId:o&&o["inin-correlation-id"]?o["inin-correlation-id"]:"",statusCode:e},i&&(u.requestHeaders=i),o&&(u.responseHeaders=o),s&&(u.requestBody=s),a&&(u.responseBody=a)):u=`${(new Date).toISOString()}\n=== REQUEST === \n${this.formatValue("URL",decodeURIComponent(n))}${this.formatValue("Method",r)}${this.formatValue("Headers",this.formatHeaderString(i))}${this.formatValue("Body",s?JSON.stringify(s,null,2):"")}\n=== RESPONSE ===\n${this.formatValue("Status",e)}${this.formatValue("Headers",this.formatHeaderString(o))}${this.formatValue("CorrelationId",o&&o["inin-correlation-id"]?o["inin-correlation-id"]:"")}${this.formatValue("Body",a?JSON.stringify(a,null,2):"")}`,u}formatHeaderString(t){var e="";if(!t)return e;for(const[r,n]of Object.entries(t))e+=`\n\t${r}: ${n}`;return e}formatValue(t,e){return e&&""!==e&&"{}"!==e?`${t}: ${e}\n`:""}getLogLevel(t){switch(t){case"error":return rt.level.LError;case"debug":return rt.level.LDebug;case"trace":return rt.level.LTrace;default:return rt.level.LNone}}getLogFormat(t){switch(t){case"json":return nt.formats.JSON;default:return nt.formats.TEXT}}}class ot{get instance(){return ot.instance}set instance(t){ot.instance=t}constructor(){if(ot.instance||(ot.instance=this),"undefined"!=typeof window)this.configPath="";else{const e=t("os"),r=t("path");this.configPath=r.join(e.homedir(),".genesyscloudjavascript-guest","config")}this.live_reload_config=!0,this.host,this.environment,this.basePath,this.authUrl,this.config,this.logger=new it,this.setEnvironment(),this.liveLoadConfig()}liveLoadConfig(){this.configPath=""}setConfigPath(t){t&&t!==this.configPath&&(this.configPath=t,this.liveLoadConfig())}updateConfigFromFile(){}updateConfigValues(){this.logger.log_level=this.logger.getLogLevel(this.getConfigString("logging","log_level")),this.logger.log_format=this.logger.getLogFormat(this.getConfigString("logging","log_format")),this.logger.log_to_console=void 0!==this.getConfigBoolean("logging","log_to_console")?this.getConfigBoolean("logging","log_to_console"):this.logger.log_to_console,this.logger.log_file_path=void 0!==this.getConfigString("logging","log_file_path")?this.getConfigString("logging","log_file_path"):this.logger.log_file_path,this.logger.log_response_body=void 0!==this.getConfigBoolean("logging","log_response_body")?this.getConfigBoolean("logging","log_response_body"):this.logger.log_response_body,this.logger.log_request_body=void 0!==this.getConfigBoolean("logging","log_request_body")?this.getConfigBoolean("logging","log_request_body"):this.logger.log_request_body,this.live_reload_config=void 0!==this.getConfigBoolean("general","live_reload_config")?this.getConfigBoolean("general","live_reload_config"):this.live_reload_config,this.host=void 0!==this.getConfigString("general","host")?this.getConfigString("general","host"):this.host,this.setEnvironment(),this.logger.setLogger()}setEnvironment(t){this.environment=t||(this.host?this.host:"mypurecloud.com"),this.environment=this.environment.replace(/\/+$/,""),this.environment.startsWith("https://")&&(this.environment=this.environment.substring(8)),this.environment.startsWith("http://")&&(this.environment=this.environment.substring(7)),this.environment.startsWith("api.")&&(this.environment=this.environment.substring(4)),this.basePath=`https://api.${this.environment}`,this.authUrl=`https://login.${this.environment}`}getConfigString(t,e){if(this.config._sections[t])return this.config._sections[t][e]}getConfigBoolean(t,e){if(this.config._sections[t]&&void 0!==this.config._sections[t][e])return"string"==typeof this.config._sections[t][e]?"true"===this.config._sections[t][e]:this.config._sections[t][e]}}class st{get instance(){return st.instance}set instance(t){st.instance=t}constructor(){st.instance||(st.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(t){this.hasLocalStorage=!1}this.config=new ot,this.setEnvironment("https://api.mypurecloud.com"),this.authentications={"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization",apiKeyPrefix:"Bearer"},"PureCloud OAuth":{type:"oauth2"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud","undefined"!=typeof window&&(window.ApiClient=this)}setReturnExtendedResponses(t){this.returnExtended=t}setPersistSettings(t,e){this.persistSettings=t,this.settingsPrefix=e?e.replace(/\W+/g,"_"):"purecloud"}_saveSettings(t){try{if(this.authData.apiKey=t.apiKey,this.authentications["Guest Chat JWT"].apiKey=t.apiKey,t.state&&(this.authData.state=t.state),t.tokenExpiryTime&&(this.authData.tokenExpiryTime=t.tokenExpiryTime,this.authData.tokenExpiryTimeString=t.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;let e=JSON.parse(JSON.stringify(this.authData));delete e.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(e))}catch(t){console.error(t)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;const t=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.apiKey&&this.setJwt(this.authData.apiKey),this.authData.state=t}setEnvironment(t){this.config.setEnvironment(t)}_testTokenAccess(){return new Promise((t,e)=>{this._loadSettings(),this.authentications["Guest Chat JWT"].apiKey?this.callApi("/api/v2/authorization/permissions","GET",null,null,null,null,null,["Guest Chat JWT"],["application/json"],["application/json"]).then(()=>{t()}).catch(t=>{this._saveSettings({apiKey:void 0}),e(t)}):e(new Error("Token is not set"))})}setJwt(t){this._saveSettings({apiKey:t})}setStorageKey(t){this.storageKey=t,this.setJwt(this.authentications["Guest Chat JWT"].apiKey)}_buildAuthUrl(t,e){return e||(e={}),Object.keys(e).reduce((t,r)=>e[r]?`${t}&${r}=${e[r]}`:t,`${this.config.authUrl}/${t}?`)}paramToString(t){return t?t instanceof Date?t.toJSON():t.toString():""}serialize(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[encodeURIComponent(r)]=Array.isArray(t[r])?t[r].join(","):this.paramToString(t[r]));return e}addHeaders(t,...e){return t=t?Object.assign(t,...e):Object.assign(...e)}buildUrl(t,e){t.match(/^\//)||(t=`/${t}`);var r=this.config.basePath+t;return r=r.replace(/\{([\w-]+)\}/g,(t,r)=>{var n;return n=e.hasOwnProperty(r)?this.paramToString(e[r]):t,encodeURIComponent(n)})}isJsonMime(t){return Boolean(t&&t.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(t){for(var e=0;e{var r=this.authentications[e];switch(r.type){case"basic":(r.username||r.password)&&(t.auth={username:r.username||"",password:r.password||""});break;case"apiKey":if(r.apiKey){var n={};r.apiKeyPrefix?n[r.name]=`${r.apiKeyPrefix} ${r.apiKey}`:n[r.name]=r.apiKey,"header"===r.in?t.headers=this.addHeaders(t.headers,n):t.params=this.serialize(n)}break;case"oauth2":r.accessToken&&(t.headers=this.addHeaders(t.headers,{Authorization:`Bearer ${r.accessToken}`}));break;default:throw new Error(`Unknown authentication type: ${r.type}`)}})}callApi(t,e,r,i,o,s,a,u,f,h){var c=this.buildUrl(t,r),l={method:e,url:c,proxy:this.proxy,timeout:this.timeout,params:this.serialize(i)};this.applyAuthToRequest(l,u);const p=this.defaultHeaders,g=this.normalizeParams(o);l.headers=this.addHeaders(l.headers,p,g);var d=this.jsonPreferredMime(f);if(d?l.headers["Content-Type"]=d:l.headers["Content-Type"]||(l.headers["Content-Type"]="application/json"),"application/x-www-form-urlencoded"===d)l.data=this.normalizeParams(s);else if("multipart/form-data"==d){var v=this.normalizeParams(s);for(var m in v)if(v.hasOwnProperty(m)){var y=new FormData;y.set(m,v[m]),l.data=y}}else a&&(l.data=a);var w=this.jsonPreferredMime(h);return w&&(l.headers.Accept=w),new Promise((t,r)=>{n.default.request(l).then(r=>{var n=!0===this.returnExtended?{status:r.status,statusText:r.statusText,headers:r.headers,body:r.data,text:r.text,error:null}:r.data?r.data:r.text;this.config.logger.log("trace",r.status,e,c,l.headers,r.headers,a,void 0),this.config.logger.log("debug",r.status,e,c,l.headers,void 0,a,void 0),t(n)}).catch(t=>{var n=t;t.response&&(this.config.logger.log("error",t.response.status,e,c,l.headers,t.response.headers,a,t.response.data),n=!0===this.returnExtended?{status:t.response.status,statusText:t.response.statusText,headers:t.response.headers,body:t.response.data,text:t.response.text,error:t}:t.response.data?t.response.data:t.response.text),r(n)})})}}class at{constructor(t){this.apiClient=t||st.instance}deleteWebchatGuestConversationMember(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling deleteWebchatGuestConversationMember';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling deleteWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","DELETE",{conversationId:t,memberId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequest(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequest';if(void 0===e||null===e)throw'Missing the required parameter "mediaRequestId" when calling getWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","GET",{conversationId:t,mediaRequestId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequests(t){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequests';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests","GET",{conversationId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMember(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMember';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling getWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","GET",{conversationId:t,memberId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMembers(t,e){if(e=e||{},void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMembers';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members","GET",{conversationId:t},{pageSize:e.pageSize,pageNumber:e.pageNumber,excludeDisconnectedMembers:e.excludeDisconnectedMembers},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessage(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessage';if(void 0===e||null===e)throw'Missing the required parameter "messageId" when calling getWebchatGuestConversationMessage';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}","GET",{conversationId:t,messageId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessages(t,e){if(e=e||{},void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages","GET",{conversationId:t},{after:e.after,before:e.before,sortOrder:e.sortOrder,maxResults:e.maxResults},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}patchWebchatGuestConversationMediarequest(t,e,r){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling patchWebchatGuestConversationMediarequest';if(void 0===e||null===e)throw'Missing the required parameter "mediaRequestId" when calling patchWebchatGuestConversationMediarequest';if(void 0===r||null===r)throw'Missing the required parameter "body" when calling patchWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","PATCH",{conversationId:t,mediaRequestId:e},{},{},{},r,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberMessages(t,e,r){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberMessages';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberMessages';if(void 0===r||null===r)throw'Missing the required parameter "body" when calling postWebchatGuestConversationMemberMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages","POST",{conversationId:t,memberId:e},{},{},{},r,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberTyping(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberTyping';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberTyping';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing","POST",{conversationId:t,memberId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversations(t){if(void 0===t||null===t)throw'Missing the required parameter "body" when calling postWebchatGuestConversations';return this.apiClient.callApi("/api/v2/webchat/guest/conversations","POST",{},{},{},{},t,[],["application/json"],["application/json"])}}var ut=new class{constructor(){this.ApiClient=new st,this.WebChatApi=at,this.PureCloudRegionHosts=i}};e.exports=ut}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{axios:7,buffer:2,os:4,path:5}]},{},[]); \ No newline at end of file +require=function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s0?s-4:s;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){(function(e){(function(){"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function o(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|l(t,e),n=o(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(k(t,ArrayBuffer)||t&&k(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function l(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||k(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(i)return n?-1:j(t).length;e=(""+e).toLowerCase(),i=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:d(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):d(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function d(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),""},s.prototype.compare=function(t,e,r,n,i){if(k(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function U(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,o){return e=+e,r>>>=0,o||U(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,o){return e=+e,r>>>=0,o||U(t,0,r,8),n.write(t,e,r,i,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),n.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),n.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),n.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(t,8,this.length),n.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function k(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function q(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":1,buffer:2,ieee754:3}],3:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=g,s/=256,f-=8);t[r+p-g]|=128*d}},{}],4:[function(t,e,r){r.endianness=function(){return"LE"},r.hostname=function(){return"undefined"!=typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n",r.homedir=function(){return"/"}},{}],5:[function(t,e,r){(function(t){(function(){"use strict";function r(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var i={resolve:function(){for(var e,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=t.cwd()),a=e),r(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var n=1;nf){if(47===e.charCodeAt(a+c))return e.slice(a+c+1);if(0===c)return e.slice(a+c)}else s>f&&(47===t.charCodeAt(n+c)?h=c:0===c&&(h=0));break}var l=t.charCodeAt(n+c);if(l!==e.charCodeAt(a+c))break;47===l&&(h=c)}var p="";for(c=n+h+1;c<=o;++c)c!==o&&47!==t.charCodeAt(c)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,i=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,u=-1;for(n=t.length-1;n>=0;--n){var f=t.charCodeAt(n);if(47===f){if(!s){i=n+1;break}}else-1===u&&(s=!1,u=n+1),a>=0&&(f===e.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){r(t);for(var e=-1,n=0,i=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===i&&(o=!1,i=a+1),46===u?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){n=a+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),o=47===i;o?(e.root="/",n=1):n=0;for(var s=-1,a=0,u=-1,f=!0,h=t.length-1,c=0;h>=n;--h)if(47!==(i=t.charCodeAt(h)))-1===u&&(f=!1,u=h+1),46===i?-1===s?s=h:1!==c&&(c=1):-1!==s&&(c=-1);else if(!f){a=h+1;break}return-1===s||-1===u||0===c||1===c&&s===u-1&&s===a+1?-1!==u&&(e.base=e.name=0===a&&o?t.slice(1,u):t.slice(a,u)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,u)):(e.name=t.slice(a,s),e.base=t.slice(a,u)),e.ext=t.slice(s,u)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}).call(this)}).call(this,t("_process"))},{_process:6}],6:[function(t,e,r){var n,i,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var f,h=[],c=!1,l=-1;function p(){c&&f&&(c=!1,f.length?h=f.concat(h):l=-1,h.length&&g())}function g(){if(!c){var t=u(p);c=!0;for(var e=h.length;e;){for(f=h,h=[];++l1)for(var r=1;r=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(t){c.headers[t]={}}),n.forEach(["post","put","patch"],function(t){c.headers[t]=n.merge(u)}),e.exports=c}).call(this)}).call(this,t("_process"))},{"../adapters/http":8,"../adapters/xhr":8,"../core/AxiosError":14,"../helpers/normalizeHeaderName":31,"../helpers/toFormData":36,"../utils":38,"./env/FormData":32,"./transitional":22,_process:6}],22:[function(t,e,r){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},{}],23:[function(t,e,r){e.exports={version:"0.27.2"}},{}],24:[function(t,e,r){"use strict";e.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}}),s):s}},{"./../utils":38}],34:[function(t,e,r){"use strict";e.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}},{}],35:[function(t,e,r){"use strict";e.exports=function(t){return function(e){return t.apply(null,e)}}},{}],36:[function(t,e,r){(function(r){(function(){"use strict";var n=t("../utils");e.exports=function(t,e){e=e||new FormData;var i=[];function o(t){return null===t?"":n.isDate(t)?t.toISOString():n.isArrayBuffer(t)||n.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):r.from(t):t}return function t(r,s){if(n.isPlainObject(r)||n.isArray(r)){if(-1!==i.indexOf(r))throw Error("Circular reference detected in "+s);i.push(r),n.forEach(r,function(r,i){if(!n.isUndefined(r)){var a,u=s?s+"."+i:i;if(r&&!s&&"object"==typeof r)if(n.endsWith(i,"{}"))r=JSON.stringify(r);else if(n.endsWith(i,"[]")&&(a=n.toArray(r)))return void a.forEach(function(t){!n.isUndefined(t)&&e.append(u,o(t))});t(r,u)}}),i.pop()}else e.append(s,o(r))}(t),e}}).call(this)}).call(this,t("buffer").Buffer)},{"../utils":38,buffer:2}],37:[function(t,e,r){"use strict";var n=t("../env/data").version,i=t("../core/AxiosError"),o={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){o[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});var s={};o.transitional=function(t,e,r){function o(t,e){return"[Axios v"+n+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,n,a){if(!1===t)throw new i(o(n," has been removed"+(e?" in "+e:"")),i.ERR_DEPRECATED);return e&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,n,a)}},e.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),o=n.length;o-- >0;){var s=n[o],a=e[s];if(a){var u=t[s],f=void 0===u||a(u,s,t);if(!0!==f)throw new i("option "+s+" must be "+f,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+s,i.ERR_BAD_OPTION)}},validators:o}},{"../core/AxiosError":14,"../env/data":23}],38:[function(t,e,r){"use strict";var n,i=t("./helpers/bind"),o=Object.prototype.toString,s=(n=Object.create(null),function(t){var e=o.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())});function a(t){return t=t.toLowerCase(),function(e){return s(e)===t}}function u(t){return Array.isArray(t)}function f(t){return void 0===t}var h=a("ArrayBuffer");function c(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==s(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}var p=a("Date"),g=a("File"),d=a("Blob"),v=a("FileList");function m(t){return"[object Function]"===o.call(t)}var y=a("URLSearchParams");function w(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),u(t))for(var r=0,n=t.length;r0;)s[o=n[i]]||(e[o]=t[o],s[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:a,endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;var n=t.indexOf(e,r);return-1!==n&&n===r},toArray:function(t){if(!t)return null;var e=t.length;if(f(e))return null;for(var r=new Array(e);e-- >0;)r[e]=t[e];return r},isTypedArray:E,isFileList:v}},{"./helpers/bind":24}],platformClient:[function(t,e,r){(function(r,n){(function(){"use strict";var n=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t("axios")),i={us_east_1:"mypurecloud.com",eu_west_1:"mypurecloud.ie",ap_southeast_2:"mypurecloud.com.au",ap_northeast_1:"mypurecloud.jp",eu_central_1:"mypurecloud.de",us_west_2:"usw2.pure.cloud",ca_central_1:"cac1.pure.cloud",ap_northeast_2:"apne2.pure.cloud",eu_west_2:"euw2.pure.cloud",ap_south_1:"aps1.pure.cloud",us_east_2:"use2.us-gov-pure.cloud",sa_east_1:"sae1.pure.cloud",me_central_1:"mec1.pure.cloud",ap_northeast_3:"apne3.pure.cloud",eu_central_2:"euc2.pure.cloud"},o=void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},s=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,f=!1;function h(){f=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}function l(t){var e;f||h();for(var r=t.length,n=r%3,i="",o=[],a=0,u=r-n;au?u:a+16383));return 1===n?(e=t[r-1],i+=s[e>>2],i+=s[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=s[e>>10],i+=s[e>>4&63],i+=s[e<<2&63],i+="="),o.push(i),o.join("")}function p(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)}function g(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=g,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=g,s/=256,f-=8);t[r+p-g]|=128*d}var d={}.toString,v=Array.isArray||function(t){return"[object Array]"==d.call(t)};function m(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,e){if(m()=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|t}function T(t){return!(null==t||!t._isBuffer)}function R(t,e){if(T(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return Q(t).length;e=(""+e).toLowerCase(),n=!0}}function S(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=w.from(e,n)),T(e))return 0===e.length?-1:B(t,e,r,n,i);if("number"==typeof e)return e&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):B(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?l(t):l(t.slice(e,r))}function D(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=N)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return F(this,e,r);case"utf8":case"utf-8":return D(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return q(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},w.prototype.equals=function(t){if(!T(t))throw new TypeError("Argument must be a Buffer");return this===t||0===w.compare(this,t)},w.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),""},w.prototype.compare=function(t,e,r,n,i){if(!T(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r),h=0;hi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return U(this,t,e,r);case"ascii":return P(this,t,e,r);case"latin1":case"binary":return I(this,t,e,r);case"base64":return L(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var N=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function Y(t,e,r,n,i,o){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function J(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function z(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function $(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(t,e,r,n,i){return i||$(t,0,r,4),g(t,e,r,n,23,4),r+4}function V(t,e,r,n,i){return i||$(t,0,r,8),g(t,e,r,n,52,8),r+8}w.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},w.prototype.readUInt8=function(t,e){return e||G(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,e){return e||G(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,e){return e||G(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,e){return e||G(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,e){return e||G(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||G(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},w.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||G(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},w.prototype.readInt8=function(t,e){return e||G(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,e){e||G(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},w.prototype.readInt16BE=function(t,e){e||G(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},w.prototype.readInt32LE=function(t,e){return e||G(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,e){return e||G(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,e){return e||G(t,4,this.length),p(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,e){return e||G(t,4,this.length),p(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,e){return e||G(t,8,this.length),p(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,e){return e||G(t,8,this.length),p(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||Y(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},w.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},w.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):J(this,t,e,!0),e+2},w.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):J(this,t,e,!1),e+2},w.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},w.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},w.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},w.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);Y(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},w.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},w.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):J(this,t,e,!0),e+2},w.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):J(this,t,e,!1),e+2},w.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},w.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||Y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},w.prototype.writeFloatLE=function(t,e,r){return H(this,t,e,!0,r)},w.prototype.writeFloatBE=function(t,e,r){return H(this,t,e,!1,r)},w.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},w.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},w.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!w.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Z(t){return function(t){var e,r,n,i,o,s;f||h();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[c-2]?2:"="===t[c-1]?1:0,s=new u(3*c/4-o),n=o>0?c-4:c;var l=0;for(e=0,r=0;e>16&255,s[l++]=i>>8&255,s[l++]=255&i;return 2===o?(i=a[t.charCodeAt(e)]<<2|a[t.charCodeAt(e+1)]>>4,s[l++]=255&i):1===o&&(i=a[t.charCodeAt(e)]<<10|a[t.charCodeAt(e+1)]<<4|a[t.charCodeAt(e+2)]>>2,s[l++]=i>>8&255,s[l++]=255&i),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}const rt={level:{LNone:"none",LError:"error",LDebug:"debug",LTrace:"trace"}},nt={formats:{JSON:"json",TEXT:"text"}};class it{get logLevelEnum(){return rt}get logFormatEnum(){return nt}constructor(){this.log_level=rt.level.LNone,this.log_format=nt.formats.TEXT,this.log_to_console=!0,this.log_file_path,this.log_response_body=!1,this.log_request_body=!1,this.setLogger()}setLogger(){}log(t,e,r,n,i,o,s,a){var u=this.formatLog(t,e,r,n,i,o,s,a);"undefined"!=typeof window?this.calculateLogLevel(t)>0&&!0===this.log_to_console&&(this.log_format===this.logFormatEnum.formats.JSON?console.log(u):console.log(`${t.toUpperCase()}: ${u}`)):this.logger.transports.length>0&&this.logger.log(t,u)}calculateLogLevel(t){switch(this.log_level){case this.logLevelEnum.level.LError:return t!==this.logLevelEnum.level.LError?-1:1;case this.logLevelEnum.level.LDebug:return t===this.logLevelEnum.level.LTrace?-1:1;case this.logLevelEnum.level.LTrace:return 1;default:return-1}}formatLog(t,e,r,n,i,o,s,a){var u;return i&&(i.Authorization="[REDACTED]"),this.log_request_body||(s=void 0),this.log_response_body||(a=void 0),this.log_format&&this.log_format===nt.formats.JSON?(u={level:t,date:(new Date).toISOString(),method:r,url:decodeURIComponent(n),correlationId:o&&o["inin-correlation-id"]?o["inin-correlation-id"]:"",statusCode:e},i&&(u.requestHeaders=i),o&&(u.responseHeaders=o),s&&(u.requestBody=s),a&&(u.responseBody=a)):u=`${(new Date).toISOString()}\n=== REQUEST === \n${this.formatValue("URL",decodeURIComponent(n))}${this.formatValue("Method",r)}${this.formatValue("Headers",this.formatHeaderString(i))}${this.formatValue("Body",s?JSON.stringify(s,null,2):"")}\n=== RESPONSE ===\n${this.formatValue("Status",e)}${this.formatValue("Headers",this.formatHeaderString(o))}${this.formatValue("CorrelationId",o&&o["inin-correlation-id"]?o["inin-correlation-id"]:"")}${this.formatValue("Body",a?JSON.stringify(a,null,2):"")}`,u}formatHeaderString(t){var e="";if(!t)return e;for(const[r,n]of Object.entries(t))e+=`\n\t${r}: ${n}`;return e}formatValue(t,e){return e&&""!==e&&"{}"!==e?`${t}: ${e}\n`:""}getLogLevel(t){switch(t){case"error":return rt.level.LError;case"debug":return rt.level.LDebug;case"trace":return rt.level.LTrace;default:return rt.level.LNone}}getLogFormat(t){switch(t){case"json":return nt.formats.JSON;default:return nt.formats.TEXT}}}class ot{get instance(){return ot.instance}set instance(t){ot.instance=t}constructor(){if(ot.instance||(ot.instance=this),"undefined"!=typeof window)this.configPath="";else{const e=t("os"),r=t("path");this.configPath=r.join(e.homedir(),".genesyscloudjavascript-guest","config")}this.live_reload_config=!0,this.host,this.environment,this.basePath,this.authUrl,this.config,this.logger=new it,this.setEnvironment(),this.liveLoadConfig()}liveLoadConfig(){this.configPath=""}setConfigPath(t){t&&t!==this.configPath&&(this.configPath=t,this.liveLoadConfig())}updateConfigFromFile(){}updateConfigValues(){this.logger.log_level=this.logger.getLogLevel(this.getConfigString("logging","log_level")),this.logger.log_format=this.logger.getLogFormat(this.getConfigString("logging","log_format")),this.logger.log_to_console=void 0!==this.getConfigBoolean("logging","log_to_console")?this.getConfigBoolean("logging","log_to_console"):this.logger.log_to_console,this.logger.log_file_path=void 0!==this.getConfigString("logging","log_file_path")?this.getConfigString("logging","log_file_path"):this.logger.log_file_path,this.logger.log_response_body=void 0!==this.getConfigBoolean("logging","log_response_body")?this.getConfigBoolean("logging","log_response_body"):this.logger.log_response_body,this.logger.log_request_body=void 0!==this.getConfigBoolean("logging","log_request_body")?this.getConfigBoolean("logging","log_request_body"):this.logger.log_request_body,this.live_reload_config=void 0!==this.getConfigBoolean("general","live_reload_config")?this.getConfigBoolean("general","live_reload_config"):this.live_reload_config,this.host=void 0!==this.getConfigString("general","host")?this.getConfigString("general","host"):this.host,this.setEnvironment(),this.logger.setLogger()}setEnvironment(t){this.environment=t||(this.host?this.host:"mypurecloud.com"),this.environment=this.environment.replace(/\/+$/,""),this.environment.startsWith("https://")&&(this.environment=this.environment.substring(8)),this.environment.startsWith("http://")&&(this.environment=this.environment.substring(7)),this.environment.startsWith("api.")&&(this.environment=this.environment.substring(4)),this.basePath=`https://api.${this.environment}`,this.authUrl=`https://login.${this.environment}`}getConfigString(t,e){if(this.config._sections[t])return this.config._sections[t][e]}getConfigBoolean(t,e){if(this.config._sections[t]&&void 0!==this.config._sections[t][e])return"string"==typeof this.config._sections[t][e]?"true"===this.config._sections[t][e]:this.config._sections[t][e]}}class st{get instance(){return st.instance}set instance(t){st.instance=t}constructor(){st.instance||(st.instance=this),this.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"};try{localStorage.setItem("purecloud_local_storage_test","purecloud_local_storage_test"),localStorage.removeItem("purecloud_local_storage_test"),this.hasLocalStorage=!0}catch(t){this.hasLocalStorage=!1}this.config=new ot,this.setEnvironment("https://api.mypurecloud.com"),this.authentications={"Guest Chat JWT":{type:"apiKey",in:"header",name:"Authorization",apiKeyPrefix:"Bearer"},"PureCloud OAuth":{type:"oauth2"}},this.defaultHeaders={},this.timeout=16e3,this.authData={},this.settingsPrefix="purecloud","undefined"!=typeof window&&(window.ApiClient=this)}setReturnExtendedResponses(t){this.returnExtended=t}setPersistSettings(t,e){this.persistSettings=t,this.settingsPrefix=e?e.replace(/\W+/g,"_"):"purecloud"}_saveSettings(t){try{if(this.authData.apiKey=t.apiKey,this.authentications["Guest Chat JWT"].apiKey=t.apiKey,t.state&&(this.authData.state=t.state),t.tokenExpiryTime&&(this.authData.tokenExpiryTime=t.tokenExpiryTime,this.authData.tokenExpiryTimeString=t.tokenExpiryTimeString),!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;let e=JSON.parse(JSON.stringify(this.authData));delete e.state,localStorage.setItem(`${this.settingsPrefix}_auth_data`,JSON.stringify(e))}catch(t){console.error(t)}}_loadSettings(){if(!0!==this.persistSettings)return;if(!this.hasLocalStorage)return;const t=this.authData.state;this.authData=localStorage.getItem(`${this.settingsPrefix}_auth_data`),this.authData?this.authData=JSON.parse(this.authData):this.authData={},this.authData.apiKey&&this.setJwt(this.authData.apiKey),this.authData.state=t}setEnvironment(t){this.config.setEnvironment(t)}_testTokenAccess(){return new Promise((t,e)=>{this._loadSettings(),this.authentications["Guest Chat JWT"].apiKey?this.callApi("/api/v2/authorization/permissions","GET",null,null,null,null,null,["Guest Chat JWT"],["application/json"],["application/json"]).then(()=>{t()}).catch(t=>{this._saveSettings({apiKey:void 0}),e(t)}):e(new Error("Token is not set"))})}setJwt(t){this._saveSettings({apiKey:t})}setStorageKey(t){this.storageKey=t,this.setJwt(this.authentications["Guest Chat JWT"].apiKey)}_buildAuthUrl(t,e){return e||(e={}),Object.keys(e).reduce((t,r)=>e[r]?`${t}&${r}=${e[r]}`:t,`${this.config.authUrl}/${t}?`)}paramToString(t){return t?t instanceof Date?t.toJSON():t.toString():""}serialize(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[encodeURIComponent(r)]=Array.isArray(t[r])?t[r].join(","):this.paramToString(t[r]));return e}addHeaders(t,...e){return t=t?Object.assign(t,...e):Object.assign(...e)}buildUrl(t,e){t.match(/^\//)||(t=`/${t}`);var r=this.config.basePath+t;return r=r.replace(/\{([\w-]+)\}/g,(t,r)=>{var n;return n=e.hasOwnProperty(r)?this.paramToString(e[r]):t,encodeURIComponent(n)})}isJsonMime(t){return Boolean(t&&t.match(/^application\/json(;.*)?$/i))}jsonPreferredMime(t){for(var e=0;e{var r=this.authentications[e];switch(r.type){case"basic":(r.username||r.password)&&(t.auth={username:r.username||"",password:r.password||""});break;case"apiKey":if(r.apiKey){var n={};r.apiKeyPrefix?n[r.name]=`${r.apiKeyPrefix} ${r.apiKey}`:n[r.name]=r.apiKey,"header"===r.in?t.headers=this.addHeaders(t.headers,n):t.params=this.serialize(n)}break;case"oauth2":r.accessToken&&(t.headers=this.addHeaders(t.headers,{Authorization:`Bearer ${r.accessToken}`}));break;default:throw new Error(`Unknown authentication type: ${r.type}`)}})}callApi(t,e,r,i,o,s,a,u,f,h){var c=this.buildUrl(t,r),l={method:e,url:c,proxy:this.proxy,timeout:this.timeout,params:this.serialize(i)};this.applyAuthToRequest(l,u);const p=this.defaultHeaders,g=this.normalizeParams(o);l.headers=this.addHeaders(l.headers,p,g);var d=this.jsonPreferredMime(f);if(d?l.headers["Content-Type"]=d:l.headers["Content-Type"]||(l.headers["Content-Type"]="application/json"),"application/x-www-form-urlencoded"===d)l.data=this.normalizeParams(s);else if("multipart/form-data"==d){var v=this.normalizeParams(s);for(var m in v)if(v.hasOwnProperty(m)){var y=new FormData;y.set(m,v[m]),l.data=y}}else a&&(l.data=a);var w=this.jsonPreferredMime(h);return w&&(l.headers.Accept=w),new Promise((t,r)=>{n.default.request(l).then(r=>{var n=!0===this.returnExtended?{status:r.status,statusText:r.statusText,headers:r.headers,body:r.data,text:r.text,error:null}:r.data?r.data:r.text;this.config.logger.log("trace",r.status,e,c,l.headers,r.headers,a,void 0),this.config.logger.log("debug",r.status,e,c,l.headers,void 0,a,void 0),t(n)}).catch(t=>{var n=t;t.response&&(this.config.logger.log("error",t.response.status,e,c,l.headers,t.response.headers,a,t.response.data),n=!0===this.returnExtended?{status:t.response.status,statusText:t.response.statusText,headers:t.response.headers,body:t.response.data,text:t.response.text,error:t}:t.response.data?t.response.data:t.response.text),r(n)})})}}class at{constructor(t){this.apiClient=t||st.instance}deleteWebchatGuestConversationMember(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling deleteWebchatGuestConversationMember';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling deleteWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","DELETE",{conversationId:t,memberId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequest(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequest';if(void 0===e||null===e)throw'Missing the required parameter "mediaRequestId" when calling getWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","GET",{conversationId:t,mediaRequestId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMediarequests(t){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMediarequests';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests","GET",{conversationId:t},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMember(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMember';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling getWebchatGuestConversationMember';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}","GET",{conversationId:t,memberId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMembers(t,e){if(e=e||{},void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMembers';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members","GET",{conversationId:t},{pageSize:e.pageSize,pageNumber:e.pageNumber,excludeDisconnectedMembers:e.excludeDisconnectedMembers},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessage(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessage';if(void 0===e||null===e)throw'Missing the required parameter "messageId" when calling getWebchatGuestConversationMessage';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}","GET",{conversationId:t,messageId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}getWebchatGuestConversationMessages(t,e){if(e=e||{},void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling getWebchatGuestConversationMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/messages","GET",{conversationId:t},{after:e.after,before:e.before,sortOrder:e.sortOrder,maxResults:e.maxResults},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}patchWebchatGuestConversationMediarequest(t,e,r){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling patchWebchatGuestConversationMediarequest';if(void 0===e||null===e)throw'Missing the required parameter "mediaRequestId" when calling patchWebchatGuestConversationMediarequest';if(void 0===r||null===r)throw'Missing the required parameter "body" when calling patchWebchatGuestConversationMediarequest';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}","PATCH",{conversationId:t,mediaRequestId:e},{},{},{},r,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberMessages(t,e,r){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberMessages';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberMessages';if(void 0===r||null===r)throw'Missing the required parameter "body" when calling postWebchatGuestConversationMemberMessages';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages","POST",{conversationId:t,memberId:e},{},{},{},r,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversationMemberTyping(t,e){if(void 0===t||null===t)throw'Missing the required parameter "conversationId" when calling postWebchatGuestConversationMemberTyping';if(void 0===e||null===e)throw'Missing the required parameter "memberId" when calling postWebchatGuestConversationMemberTyping';return this.apiClient.callApi("/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing","POST",{conversationId:t,memberId:e},{},{},{},null,["Guest Chat JWT"],["application/json"],["application/json"])}postWebchatGuestConversations(t){if(void 0===t||null===t)throw'Missing the required parameter "body" when calling postWebchatGuestConversations';return this.apiClient.callApi("/api/v2/webchat/guest/conversations","POST",{},{},{},{},t,[],["application/json"],["application/json"])}}var ut=new class{constructor(){this.ApiClient=new st,this.WebChatApi=at,this.PureCloudRegionHosts=i}};e.exports=ut}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{axios:7,buffer:2,os:4,path:5}]},{},[]); \ No newline at end of file diff --git a/build/docs/index.md b/build/docs/index.md index 679b501a..8019ef0b 100644 --- a/build/docs/index.md +++ b/build/docs/index.md @@ -31,7 +31,7 @@ For direct use in a browser script: ```html - + diff --git a/build/docs/releaseNotes.md b/build/docs/releaseNotes.md index 98039436..e7739ec4 100644 --- a/build/docs/releaseNotes.md +++ b/build/docs/releaseNotes.md @@ -1,4 +1,4 @@ -Platform API version: 7567 +Platform API version: 7660 @@ -6,11 +6,7 @@ Platform API version: 7567 # Major Changes (0 changes) -# Minor Changes (1 change) - -**Limit** (1 change) - -* Enum value employee.engagement was added to property namespace +# Minor Changes (0 changes) # Point Changes (0 changes) diff --git a/build/node_modules/.package-lock.json b/build/node_modules/.package-lock.json index 14915ada..7da347ae 100644 --- a/build/node_modules/.package-lock.json +++ b/build/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "purecloud-guest-chat-client", - "version": "13.8.0", + "version": "13.8.1", "lockfileVersion": 3, "requires": true, "packages": { @@ -140,9 +140,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", - "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "version": "20.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.6.tgz", + "integrity": "sha512-+EOokTnksGVgip2PbYbr3xnR7kZigh4LbybAfBAw5BpnQ+FqBYUsvCEjYd70IXKlbohQ64mzEYmMtlWUY8q//Q==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1016,9 +1016,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -1413,9 +1413,9 @@ } }, "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", + "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", "dev": true }, "node_modules/kuler": { @@ -1878,45 +1878,36 @@ } }, "node_modules/nise": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz", - "integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.7.tgz", + "integrity": "sha512-wWtNUhkT7k58uvWTB/Gy26eA/EJKtPZFVAhEilN5UYVmmGRYOURbejRUyKm0Uu9XVEW7K5nBOZfR8VMB4QR2RQ==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0", - "@sinonjs/fake-timers": "^10.0.2", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/text-encoding": "^0.7.2", + "just-extend": "^6.2.0", + "path-to-regexp": "^6.2.1" } }, "node_modules/nise/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0" } }, - "node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2023,13 +2014,10 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "dependencies": { - "isarray": "0.0.1" - } + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==", + "dev": true }, "node_modules/pbkdf2": { "version": "3.1.2", diff --git a/build/node_modules/@types/node/README.md b/build/node_modules/@types/node/README.md index 0a22e008..daedb7d6 100644 --- a/build/node_modules/@types/node/README.md +++ b/build/node_modules/@types/node/README.md @@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/). Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. ### Additional Details - * Last updated: Thu, 07 Dec 2023 07:07:09 GMT + * Last updated: Wed, 24 Jan 2024 06:08:24 GMT * Dependencies: [undici-types](https://npmjs.com/package/undici-types) # Credits diff --git a/build/node_modules/@types/node/buffer.d.ts b/build/node_modules/@types/node/buffer.d.ts index 1ee5c013..2fa2e745 100644 --- a/build/node_modules/@types/node/buffer.d.ts +++ b/build/node_modules/@types/node/buffer.d.ts @@ -564,7 +564,7 @@ declare module "buffer" { * * The `Buffer` module pre-allocates an internal `Buffer` instance of * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * and `Buffer.concat()` only when `size` is less than`Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). * * Use of this pre-allocated internal memory pool is a key difference between * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. diff --git a/build/node_modules/@types/node/crypto.d.ts b/build/node_modules/@types/node/crypto.d.ts index 2f2038e0..7509b762 100644 --- a/build/node_modules/@types/node/crypto.d.ts +++ b/build/node_modules/@types/node/crypto.d.ts @@ -100,6 +100,8 @@ declare module "crypto" { const OPENSSL_VERSION_NUMBER: number; /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ const SSL_OP_ALL: number; + /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ + const SSL_OP_ALLOW_NO_DHE_KEX: number; /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ @@ -116,15 +118,29 @@ declare module "crypto" { const SSL_OP_LEGACY_SERVER_CONNECT: number; /** Instructs OpenSSL to disable support for SSL/TLS compression. */ const SSL_OP_NO_COMPRESSION: number; + /** Instructs OpenSSL to disable encrypt-then-MAC. */ + const SSL_OP_NO_ENCRYPT_THEN_MAC: number; const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to disable renegotiation. */ + const SSL_OP_NO_RENEGOTIATION: number; /** Instructs OpenSSL to always start a new session when performing renegotiation. */ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + /** Instructs OpenSSL to turn off SSL v2 */ const SSL_OP_NO_SSLv2: number; + /** Instructs OpenSSL to turn off SSL v3 */ const SSL_OP_NO_SSLv3: number; + /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ const SSL_OP_NO_TICKET: number; + /** Instructs OpenSSL to turn off TLS v1 */ const SSL_OP_NO_TLSv1: number; + /** Instructs OpenSSL to turn off TLS v1.1 */ const SSL_OP_NO_TLSv1_1: number; + /** Instructs OpenSSL to turn off TLS v1.2 */ const SSL_OP_NO_TLSv1_2: number; + /** Instructs OpenSSL to turn off TLS v1.3 */ + const SSL_OP_NO_TLSv1_3: number; + /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ + const SSL_OP_PRIORITIZE_CHACHA: number; /** Instructs OpenSSL to disable version rollback attack detection. */ const SSL_OP_TLS_ROLLBACK_BUG: number; const ENGINE_METHOD_RSA: number; @@ -363,7 +379,7 @@ declare module "crypto" { * @since v13.1.0 * @param options `stream.transform` options */ - copy(options?: stream.TransformOptions): Hash; + copy(options?: HashOptions): Hash; /** * Updates the hash content with the given `data`, the encoding of which * is given in `inputEncoding`. @@ -637,6 +653,13 @@ declare module "crypto" { export(options: KeyExportOptions<"pem">): string | Buffer; export(options?: KeyExportOptions<"der">): Buffer; export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * Returns `true` or `false` depending on whether the keys have exactly the same + * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). + * @since v17.7.0, v16.15.0 + * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. + */ + equals(otherKeyObject: KeyObject): boolean; /** * For secret keys, this property represents the size of the key in bytes. This * property is `undefined` for asymmetric keys. @@ -2475,6 +2498,10 @@ declare module "crypto" { * Name of the curve to use */ namedCurve: string; + /** + * Must be `'named'` or `'explicit'`. Default: `'named'`. + */ + paramEncoding?: "explicit" | "named" | undefined; } interface RSAKeyPairKeyObjectOptions { /** @@ -2585,11 +2612,7 @@ declare module "crypto" { type: "pkcs8"; }; } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; + interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { publicKeyEncoding: { type: "pkcs1" | "spki"; format: PubF; diff --git a/build/node_modules/@types/node/dgram.d.ts b/build/node_modules/@types/node/dgram.d.ts index 692e547f..0b86ae73 100644 --- a/build/node_modules/@types/node/dgram.d.ts +++ b/build/node_modules/@types/node/dgram.d.ts @@ -227,6 +227,16 @@ declare module "dgram" { * @return the `SO_SNDBUF` socket send buffer size in bytes. */ getSendBufferSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of bytes queued for sending. + */ + getSendQueueSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of send requests currently in the queue awaiting to be processed. + */ + getSendQueueCount(): number; /** * By default, binding a socket will cause it to block the Node.js process from * exiting as long as the socket is open. The `socket.unref()` method can be used diff --git a/build/node_modules/@types/node/diagnostics_channel.d.ts b/build/node_modules/@types/node/diagnostics_channel.d.ts index b02f5917..cd4bd71b 100644 --- a/build/node_modules/@types/node/diagnostics_channel.d.ts +++ b/build/node_modules/@types/node/diagnostics_channel.d.ts @@ -23,6 +23,7 @@ * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) */ declare module "diagnostics_channel" { + import { AsyncLocalStorage } from "node:async_hooks"; /** * Check if there are active subscribers to the named channel. This is helpful if * the message you want to send might be expensive to prepare. @@ -95,6 +96,36 @@ declare module "diagnostics_channel" { * @return `true` if the handler was found, `false` otherwise. */ function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; + /** + * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing + * channels will be created in the form of `tracing:${name}:${eventType}` where`eventType` corresponds to the types of `TracingChannel Channels`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); + * + * // or... + * + * const channelsByCollection = diagnostics_channel.tracingChannel({ + * start: diagnostics_channel.channel('tracing:my-channel:start'), + * end: diagnostics_channel.channel('tracing:my-channel:end'), + * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), + * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), + * error: diagnostics_channel.channel('tracing:my-channel:error'), + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` + * @return Collection of channels to trace with + */ + function tracingChannel< + StoreType = unknown, + ContextType extends object = StoreType extends object ? StoreType : object, + >( + nameOrChannels: string | TracingChannelCollection, + ): TracingChannel; /** * The class `Channel` represents an individual named channel within the data * pipeline. It is used to track subscribers and to publish messages when there @@ -104,7 +135,7 @@ declare module "diagnostics_channel" { * with `new Channel(name)` is not supported. * @since v15.1.0, v14.17.0 */ - class Channel { + class Channel { readonly name: string | symbol; /** * Check if there are active subscribers to this channel. This is helpful if @@ -184,6 +215,329 @@ declare module "diagnostics_channel" { * @return `true` if the handler was found, `false` otherwise. */ unsubscribe(onMessage: ChannelListener): void; + /** + * When `channel.runStores(context, ...)` is called, the given context data + * will be applied to any store bound to the channel. If the store has already been + * bound the previous `transform` function will be replaced with the new one. + * The `transform` function may be omitted to set the given context data as the + * context directly. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (data) => { + * return { data }; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to which to bind the context data + * @param transform Transform context data before setting the store context + */ + bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; + /** + * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store); + * channel.unbindStore(store); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to unbind from the channel. + * @return `true` if the store was found, `false` otherwise. + */ + unbindStore(store: any): void; + /** + * Applies the given data to any AsyncLocalStorage instances bound to the channel + * for the duration of the given function, then publishes to the channel within + * the scope of that data is applied to the stores. + * + * If a transform function was given to `channel.bindStore(store)` it will be + * applied to transform the message data before it becomes the context value for + * the store. The prior storage context is accessible from within the transform + * function in cases where context linking is required. + * + * The context applied to the store should be accessible in any async code which + * continues from execution which began during the given function, however + * there are some situations in which `context loss` may occur. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (message) => { + * const parent = store.getStore(); + * return new Span(message, parent); + * }); + * channel.runStores({ some: 'message' }, () => { + * store.getStore(); // Span({ some: 'message' }) + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param context Message to send to subscribers and bind to stores + * @param fn Handler to run within the entered storage context + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runStores(): void; + } + interface TracingChannelSubscribers { + start: (message: ContextType) => void; + end: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncStart: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncEnd: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + error: ( + message: ContextType & { + error: unknown; + }, + ) => void; + } + interface TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + } + /** + * The class `TracingChannel` is a collection of `TracingChannel Channels` which + * together express a single traceable action. It is used to formalize and + * simplify the process of producing events for tracing application flow.{@link tracingChannel} is used to construct a`TracingChannel`. As with `Channel` it is recommended to create and reuse a + * single `TracingChannel` at the top-level of the file rather than creating them + * dynamically. + * @since v19.9.0 + * @experimental + */ + class TracingChannel implements TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + /** + * Helper to subscribe a collection of functions to the corresponding channels. + * This is the same as calling `channel.subscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.subscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + */ + subscribe(subscribers: TracingChannelSubscribers): void; + /** + * Helper to unsubscribe a collection of functions from the corresponding channels. + * This is the same as calling `channel.unsubscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.unsubscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. + */ + unsubscribe(subscribers: TracingChannelSubscribers): void; + /** + * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. + * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceSync(() => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Function to wrap a trace around + * @param context Shared object to correlate events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceSync( + fn: (this: ThisArg, ...args: Args) => any, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): void; + /** + * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also + * produce an `error event` if the given function throws an error or the + * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.tracePromise(async () => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Promise-returning function to wrap a trace around + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return Chained from promise returned by the given function + */ + tracePromise( + fn: (this: ThisArg, ...args: Args) => Promise, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): void; + /** + * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or + * the returned + * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * The `position` will be -1 by default to indicate the final argument should + * be used as the callback. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceCallback((arg1, callback) => { + * // Do something + * callback(null, 'result'); + * }, 1, { + * some: 'thing', + * }, thisArg, arg1, callback); + * ``` + * + * The callback will also be run with `channel.runStores(context, ...)` which + * enables context loss recovery in some cases. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * const myStore = new AsyncLocalStorage(); + * + * // The start channel sets the initial store data to something + * // and stores that store data value on the trace context object + * channels.start.bindStore(myStore, (data) => { + * const span = new Span(data); + * data.span = span; + * return span; + * }); + * + * // Then asyncStart can restore from that data it stored previously + * channels.asyncStart.bindStore(myStore, (data) => { + * return data.span; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn callback using function to wrap a trace around + * @param position Zero-indexed argument position of expected callback + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceCallback any>( + fn: Fn, + position: number | undefined, + context: ContextType | undefined, + thisArg: any, + ...args: Parameters + ): void; } } declare module "node:diagnostics_channel" { diff --git a/build/node_modules/@types/node/fs.d.ts b/build/node_modules/@types/node/fs.d.ts index f98453a5..5cbca12f 100644 --- a/build/node_modules/@types/node/fs.d.ts +++ b/build/node_modules/@types/node/fs.d.ts @@ -281,7 +281,7 @@ declare module "fs" { * Asynchronously close the directory's underlying resource handle. * Subsequent reads will result in errors. * - * A promise is returned that will be resolved after the resource has been + * A promise is returned that will be fulfilled after the resource has been * closed. * @since v12.12.0 */ @@ -296,7 +296,7 @@ declare module "fs" { /** * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null`if there are no more directory entries to read. * * Directory entries returned by this function are in no particular order as * provided by the operating system's underlying directory mechanisms. @@ -354,31 +354,51 @@ declare module "fs" { * @since v0.5.8 */ close(): void; + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.FSWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.FSWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; /** * events.EventEmitter * 1. change - * 2. error + * 2. close + * 3. error */ addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "error", listener: (error: Error) => void): this; addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; on(event: string, listener: (...args: any[]) => void): this; on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "error", listener: (error: Error) => void): this; on(event: "close", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; once(event: string, listener: (...args: any[]) => void): this; once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "error", listener: (error: Error) => void): this; once(event: "close", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; } /** * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. diff --git a/build/node_modules/@types/node/globals.d.ts b/build/node_modules/@types/node/globals.d.ts index 72d1860f..5f250062 100644 --- a/build/node_modules/@types/node/globals.d.ts +++ b/build/node_modules/@types/node/globals.d.ts @@ -234,6 +234,32 @@ declare global { * Is this a constructor call? */ isConstructor(): boolean; + + /** + * is this an async call (i.e. await, Promise.all(), or Promise.any())? + */ + isAsync(): boolean; + + /** + * is this an async call to Promise.all()? + */ + isPromiseAll(): boolean; + + /** + * returns the index of the promise element that was followed in + * Promise.all() or Promise.any() for async stack traces, or null + * if the CallSite is not an async + */ + getPromiseIndex(): number | null; + + getScriptNameOrSourceURL(): string; + getScriptHash(): string; + + getEnclosingColumnNumber(): number; + getEnclosingLineNumber(): number; + getPosition(): number; + + toString(): string; } interface ErrnoException extends Error { diff --git a/build/node_modules/@types/node/http.d.ts b/build/node_modules/@types/node/http.d.ts index 9b2c3c2c..710fe594 100644 --- a/build/node_modules/@types/node/http.d.ts +++ b/build/node_modules/@types/node/http.d.ts @@ -9,12 +9,12 @@ * * HTTP message headers are represented by an object like this: * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'example.com', - * 'accept': '*' } + * ```json + * { "content-length": "123", + * "content-type": "text/plain", + * "connection": "keep-alive", + * "host": "example.com", + * "accept": "*" } * ``` * * Keys are lowercased. Values are not modified. @@ -1814,7 +1814,6 @@ declare module "http" { * * It is not necessary to use this method before passing headers to an HTTP request * or response. The HTTP module will automatically validate such headers. - * Examples: * * Example: * diff --git a/build/node_modules/@types/node/module.d.ts b/build/node_modules/@types/node/module.d.ts index 68d59c77..c38a9b80 100644 --- a/build/node_modules/@types/node/module.d.ts +++ b/build/node_modules/@types/node/module.d.ts @@ -276,6 +276,20 @@ declare module "module" { } global { interface ImportMeta { + /** + * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. + * **Caveat:** only present on `file:` modules. + */ + dirname: string; + /** + * The full absolute path and filename of the current module, with symlinks resolved. + * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. + * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. + */ + filename: string; + /** + * The absolute `file:` URL of the module. + */ url: string; /** * Provides a module-relative resolution function scoped to each module, returning diff --git a/build/node_modules/@types/node/package.json b/build/node_modules/@types/node/package.json index 35f7a4a0..21ee8507 100644 --- a/build/node_modules/@types/node/package.json +++ b/build/node_modules/@types/node/package.json @@ -1,6 +1,6 @@ { "name": "@types/node", - "version": "20.10.4", + "version": "20.11.6", "description": "TypeScript definitions for node", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -224,7 +224,7 @@ "dependencies": { "undici-types": "~5.26.4" }, - "typesPublisherContentHash": "70306276c79ea3801d82ca605703455f07ca61a9ef7d05f547ee2671f6bc5712", + "typesPublisherContentHash": "4672df994f41fe8261bb8674f0ae453a191329e23938a5bf005572caa3a878fc", "typeScriptVersion": "4.6", "nonNpm": true } \ No newline at end of file diff --git a/build/node_modules/@types/node/perf_hooks.d.ts b/build/node_modules/@types/node/perf_hooks.d.ts index b369bb69..c0ce852a 100644 --- a/build/node_modules/@types/node/perf_hooks.d.ts +++ b/build/node_modules/@types/node/perf_hooks.d.ts @@ -314,13 +314,15 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 81.465639, - * * duration: 0 + * * duration: 0, + * * detail: null * * }, * * PerformanceEntry { * * name: 'meow', * * entryType: 'mark', * * startTime: 81.860064, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -355,7 +357,8 @@ declare module "perf_hooks" { * * name: 'meow', * * entryType: 'mark', * * startTime: 98.545991, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -368,7 +371,8 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 63.518931, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -404,13 +408,15 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 55.897834, - * * duration: 0 + * * duration: 0, + * * detail: null * * }, * * PerformanceEntry { * * name: 'meow', * * entryType: 'mark', * * startTime: 56.350146, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * diff --git a/build/node_modules/@types/node/process.d.ts b/build/node_modules/@types/node/process.d.ts index 0e274737..d22308f6 100644 --- a/build/node_modules/@types/node/process.d.ts +++ b/build/node_modules/@types/node/process.d.ts @@ -903,9 +903,14 @@ declare module "process" { */ readonly sourceMapsEnabled: boolean; /** - * This function enables or disables the Source Map v3 support for stack traces. - * It provides same features as launching Node.js process with commandline options --enable-source-maps. - * @since v16.6.0 + * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for + * stack traces. + * + * It provides same features as launching Node.js process with commandline options`--enable-source-maps`. + * + * Only source maps in JavaScript files that are loaded after source maps has been + * enabled will be parsed and loaded. + * @since v16.6.0, v14.18.0 * @experimental */ setSourceMapsEnabled(value: boolean): void; @@ -1311,6 +1316,23 @@ declare module "process" { */ uptime(): number; hrtime: HRTime; + /** + * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. + * If no IPC channel exists, this property is undefined. + * @since v7.1.0 + */ + channel?: { + /** + * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before. + * @since v7.1.0 + */ + ref(): void; + /** + * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open. + * @since v7.1.0 + */ + unref(): void; + }; /** * If Node.js is spawned with an IPC channel, the `process.send()` method can be * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. diff --git a/build/node_modules/@types/node/querystring.d.ts b/build/node_modules/@types/node/querystring.d.ts index 54ecc967..b36ea2c1 100644 --- a/build/node_modules/@types/node/querystring.d.ts +++ b/build/node_modules/@types/node/querystring.d.ts @@ -74,10 +74,10 @@ declare module "querystring" { * * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: * - * ```js + * ```json * { - * foo: 'bar', - * abc: ['xyz', '123'] + * "foo": "bar", + * "abc": ["xyz", "123"] * } * ``` * diff --git a/build/node_modules/@types/node/stream/web.d.ts b/build/node_modules/@types/node/stream/web.d.ts index 0d916137..361594df 100644 --- a/build/node_modules/@types/node/stream/web.d.ts +++ b/build/node_modules/@types/node/stream/web.d.ts @@ -342,7 +342,23 @@ declare module "stream/web" { } const TextDecoderStream: { prototype: TextDecoderStream; - new(label?: string, options?: TextDecoderOptions): TextDecoderStream; + new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; + }; + interface CompressionStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const CompressionStream: { + prototype: CompressionStream; + new(format: string): CompressionStream; + }; + interface DecompressionStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const DecompressionStream: { + prototype: DecompressionStream; + new(format: string): DecompressionStream; }; } declare module "node:stream/web" { diff --git a/build/node_modules/@types/node/test.d.ts b/build/node_modules/@types/node/test.d.ts index 44b6a964..149c9e0b 100644 --- a/build/node_modules/@types/node/test.d.ts +++ b/build/node_modules/@types/node/test.d.ts @@ -82,6 +82,11 @@ declare module "node:test" { import { Readable } from "node:stream"; import { AsyncResource } from "node:async_hooks"; /** + * **Note:**`shard` is used to horizontally parallelize test running across + * machines or processes, ideal for large-scale executions across varied + * environments. It's incompatible with `watch` mode, tailored for rapid + * code iteration by automatically rerunning tests on file changes. + * * ```js * import { tap } from 'node:test/reporters'; * import { run } from 'node:test'; @@ -1007,12 +1012,20 @@ declare module "node:test" { */ restore(): void; } - type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout"; + type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; + + interface MockTimersOptions { + apis: Timer[]; + now?: number | Date; + } /** * Mocking timers is a technique commonly used in software testing to simulate and * control the behavior of timers, such as `setInterval` and `setTimeout`, * without actually waiting for the specified time intervals. * + * The MockTimers API also allows for mocking of the `Date` constructor and + * `setImmediate`/`clearImmediate` functions. + * * The `MockTracker` provides a top-level `timers` export * which is a `MockTimers` instance. * @since v20.4.0 @@ -1025,24 +1038,66 @@ declare module "node:test" { * **Note:** When you enable mocking for a specific timer, its associated * clear function will also be implicitly mocked. * - * Example usage: + * **Note:** Mocking `Date` will affect the behavior of the mocked timers + * as they use the same internal clock. + * + * Example usage without setting initial time: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); + * ``` + * + * The above example enables mocking for the `Date` constructor, `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, + * `setInterval` and `clearInterval` functions from `node:timers`,`node:timers/promises`, and `globalThis` will be mocked. + * + * Example usage with initial time set * * ```js * import { mock } from 'node:test'; - * mock.timers.enable(['setInterval']); + * mock.timers.enable({ apis: ['Date'], now: 1000 }); * ``` * - * The above example enables mocking for the `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * Example usage with initial Date object as time set + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['Date'], now: new Date() }); + * ``` * * Alternatively, if you call `mock.timers.enable()` without any parameters: * - * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. + * + * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, * and `globalThis` will be mocked. + * The `Date` constructor from `globalThis` will be mocked. + * + * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date object. It can either be a positive integer, or another Date object. * @since v20.4.0 */ - enable(timers?: Timer[]): void; + enable(options?: MockTimersOptions): void; + /** + * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. + * Note: This method will execute any mocked timers that are in the past from the new time. + * In the below example we are setting a new time for the mocked date. + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * test('sets the time of a date object', (context) => { + * // Optionally choose what to mock + * context.mock.timers.enable({ apis: ['Date'], now: 100 }); + * assert.strictEqual(Date.now(), 100); + * // Advance in time will also advance the date + * context.mock.timers.setTime(1000); + * context.mock.timers.tick(200); + * assert.strictEqual(Date.now(), 1200); + * }); + * ``` + */ + setTime(time: number): void; /** * This function restores the default behavior of all mocks that were previously * created by this `MockTimers` instance and disassociates the mocks @@ -1076,7 +1131,7 @@ declare module "node:test" { * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { * const fn = context.mock.fn(); * - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout'] }); * * setTimeout(fn, 9999); * @@ -1097,7 +1152,7 @@ declare module "node:test" { * * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { * const fn = context.mock.fn(); - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout'] }); * const nineSecs = 9000; * setTimeout(fn, nineSecs); * @@ -1109,11 +1164,35 @@ declare module "node:test" { * assert.strictEqual(fn.mock.callCount(), 1); * }); * ``` + * + * Advancing time using `.tick` will also advance the time for any `Date` object + * created after the mock was enabled (if `Date` was also set to be mocked). + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * assert.strictEqual(Date.now(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * assert.strictEqual(fn.mock.callCount(), 1); + * assert.strictEqual(Date.now(), 9999); + * }); + * ``` * @since v20.4.0 */ tick(milliseconds: number): void; /** - * Triggers all pending mocked timers immediately. + * Triggers all pending mocked timers immediately. If the `Date` object is also + * mocked, it will also advance the `Date` object to the furthest timer's time. * * The example below triggers all pending timers immediately, * causing them to execute without any delay. @@ -1123,7 +1202,7 @@ declare module "node:test" { * import { test } from 'node:test'; * * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); * const results = []; * setTimeout(() => results.push(1), 9999); * @@ -1135,8 +1214,9 @@ declare module "node:test" { * assert.deepStrictEqual(results, []); * * context.mock.timers.runAll(); - * * assert.deepStrictEqual(results, [3, 2, 1]); + * // The Date object is also advanced to the furthest timer's time + * assert.strictEqual(Date.now(), 9999); * }); * ``` * @@ -1343,7 +1423,7 @@ interface TestDequeue extends TestLocationInfo { * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) */ declare module "node:test/reporters" { - import { Transform } from "node:stream"; + import { Transform, TransformOptions } from "node:stream"; type TestEvent = | { type: "test:diagnostic"; data: DiagnosticData } @@ -1378,5 +1458,8 @@ declare module "node:test/reporters" { * The `junit` reporter outputs test results in a jUnit XML format */ function junit(source: TestEventGenerator): AsyncGenerator; - export { dot, junit, Spec as spec, tap, TestEvent }; + class Lcov extends Transform { + constructor(opts?: TransformOptions); + } + export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; } diff --git a/build/node_modules/@types/node/ts4.8/buffer.d.ts b/build/node_modules/@types/node/ts4.8/buffer.d.ts index 1ee5c013..2fa2e745 100644 --- a/build/node_modules/@types/node/ts4.8/buffer.d.ts +++ b/build/node_modules/@types/node/ts4.8/buffer.d.ts @@ -564,7 +564,7 @@ declare module "buffer" { * * The `Buffer` module pre-allocates an internal `Buffer` instance of * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, - * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * and `Buffer.concat()` only when `size` is less than`Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two). * * Use of this pre-allocated internal memory pool is a key difference between * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. diff --git a/build/node_modules/@types/node/ts4.8/crypto.d.ts b/build/node_modules/@types/node/ts4.8/crypto.d.ts index a540d91f..f3926811 100644 --- a/build/node_modules/@types/node/ts4.8/crypto.d.ts +++ b/build/node_modules/@types/node/ts4.8/crypto.d.ts @@ -100,6 +100,8 @@ declare module "crypto" { const OPENSSL_VERSION_NUMBER: number; /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ const SSL_OP_ALL: number; + /** Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode for TLS v1.3 */ + const SSL_OP_ALLOW_NO_DHE_KEX: number; /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ @@ -116,15 +118,29 @@ declare module "crypto" { const SSL_OP_LEGACY_SERVER_CONNECT: number; /** Instructs OpenSSL to disable support for SSL/TLS compression. */ const SSL_OP_NO_COMPRESSION: number; + /** Instructs OpenSSL to disable encrypt-then-MAC. */ + const SSL_OP_NO_ENCRYPT_THEN_MAC: number; const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to disable renegotiation. */ + const SSL_OP_NO_RENEGOTIATION: number; /** Instructs OpenSSL to always start a new session when performing renegotiation. */ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + /** Instructs OpenSSL to turn off SSL v2 */ const SSL_OP_NO_SSLv2: number; + /** Instructs OpenSSL to turn off SSL v3 */ const SSL_OP_NO_SSLv3: number; + /** Instructs OpenSSL to disable use of RFC4507bis tickets. */ const SSL_OP_NO_TICKET: number; + /** Instructs OpenSSL to turn off TLS v1 */ const SSL_OP_NO_TLSv1: number; + /** Instructs OpenSSL to turn off TLS v1.1 */ const SSL_OP_NO_TLSv1_1: number; + /** Instructs OpenSSL to turn off TLS v1.2 */ const SSL_OP_NO_TLSv1_2: number; + /** Instructs OpenSSL to turn off TLS v1.3 */ + const SSL_OP_NO_TLSv1_3: number; + /** Instructs OpenSSL server to prioritize ChaCha20-Poly1305 when the client does. This option has no effect if `SSL_OP_CIPHER_SERVER_PREFERENCE` is not enabled. */ + const SSL_OP_PRIORITIZE_CHACHA: number; /** Instructs OpenSSL to disable version rollback attack detection. */ const SSL_OP_TLS_ROLLBACK_BUG: number; const ENGINE_METHOD_RSA: number; @@ -363,7 +379,7 @@ declare module "crypto" { * @since v13.1.0 * @param options `stream.transform` options */ - copy(options?: stream.TransformOptions): Hash; + copy(options?: HashOptions): Hash; /** * Updates the hash content with the given `data`, the encoding of which * is given in `inputEncoding`. @@ -637,6 +653,13 @@ declare module "crypto" { export(options: KeyExportOptions<"pem">): string | Buffer; export(options?: KeyExportOptions<"der">): Buffer; export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * Returns `true` or `false` depending on whether the keys have exactly the same + * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack). + * @since v17.7.0, v16.15.0 + * @param otherKeyObject A `KeyObject` with which to compare `keyObject`. + */ + equals(otherKeyObject: KeyObject): boolean; /** * For secret keys, this property represents the size of the key in bytes. This * property is `undefined` for asymmetric keys. @@ -2475,6 +2498,10 @@ declare module "crypto" { * Name of the curve to use */ namedCurve: string; + /** + * Must be `'named'` or `'explicit'`. Default: `'named'`. + */ + paramEncoding?: "explicit" | "named" | undefined; } interface RSAKeyPairKeyObjectOptions { /** @@ -2585,11 +2612,7 @@ declare module "crypto" { type: "pkcs8"; }; } - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; + interface ECKeyPairOptions extends ECKeyPairKeyObjectOptions { publicKeyEncoding: { type: "pkcs1" | "spki"; format: PubF; diff --git a/build/node_modules/@types/node/ts4.8/dgram.d.ts b/build/node_modules/@types/node/ts4.8/dgram.d.ts index 692e547f..0b86ae73 100644 --- a/build/node_modules/@types/node/ts4.8/dgram.d.ts +++ b/build/node_modules/@types/node/ts4.8/dgram.d.ts @@ -227,6 +227,16 @@ declare module "dgram" { * @return the `SO_SNDBUF` socket send buffer size in bytes. */ getSendBufferSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of bytes queued for sending. + */ + getSendQueueSize(): number; + /** + * @since v18.8.0, v16.19.0 + * @return Number of send requests currently in the queue awaiting to be processed. + */ + getSendQueueCount(): number; /** * By default, binding a socket will cause it to block the Node.js process from * exiting as long as the socket is open. The `socket.unref()` method can be used diff --git a/build/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/build/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts index b02f5917..cd4bd71b 100644 --- a/build/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +++ b/build/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts @@ -23,6 +23,7 @@ * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) */ declare module "diagnostics_channel" { + import { AsyncLocalStorage } from "node:async_hooks"; /** * Check if there are active subscribers to the named channel. This is helpful if * the message you want to send might be expensive to prepare. @@ -95,6 +96,36 @@ declare module "diagnostics_channel" { * @return `true` if the handler was found, `false` otherwise. */ function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; + /** + * Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing + * channels will be created in the form of `tracing:${name}:${eventType}` where`eventType` corresponds to the types of `TracingChannel Channels`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channelsByName = diagnostics_channel.tracingChannel('my-channel'); + * + * // or... + * + * const channelsByCollection = diagnostics_channel.tracingChannel({ + * start: diagnostics_channel.channel('tracing:my-channel:start'), + * end: diagnostics_channel.channel('tracing:my-channel:end'), + * asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'), + * asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'), + * error: diagnostics_channel.channel('tracing:my-channel:error'), + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param nameOrChannels Channel name or object containing all the `TracingChannel Channels` + * @return Collection of channels to trace with + */ + function tracingChannel< + StoreType = unknown, + ContextType extends object = StoreType extends object ? StoreType : object, + >( + nameOrChannels: string | TracingChannelCollection, + ): TracingChannel; /** * The class `Channel` represents an individual named channel within the data * pipeline. It is used to track subscribers and to publish messages when there @@ -104,7 +135,7 @@ declare module "diagnostics_channel" { * with `new Channel(name)` is not supported. * @since v15.1.0, v14.17.0 */ - class Channel { + class Channel { readonly name: string | symbol; /** * Check if there are active subscribers to this channel. This is helpful if @@ -184,6 +215,329 @@ declare module "diagnostics_channel" { * @return `true` if the handler was found, `false` otherwise. */ unsubscribe(onMessage: ChannelListener): void; + /** + * When `channel.runStores(context, ...)` is called, the given context data + * will be applied to any store bound to the channel. If the store has already been + * bound the previous `transform` function will be replaced with the new one. + * The `transform` function may be omitted to set the given context data as the + * context directly. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (data) => { + * return { data }; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to which to bind the context data + * @param transform Transform context data before setting the store context + */ + bindStore(store: AsyncLocalStorage, transform?: (context: ContextType) => StoreType): void; + /** + * Remove a message handler previously registered to this channel with `channel.bindStore(store)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store); + * channel.unbindStore(store); + * ``` + * @since v19.9.0 + * @experimental + * @param store The store to unbind from the channel. + * @return `true` if the store was found, `false` otherwise. + */ + unbindStore(store: any): void; + /** + * Applies the given data to any AsyncLocalStorage instances bound to the channel + * for the duration of the given function, then publishes to the channel within + * the scope of that data is applied to the stores. + * + * If a transform function was given to `channel.bindStore(store)` it will be + * applied to transform the message data before it becomes the context value for + * the store. The prior storage context is accessible from within the transform + * function in cases where context linking is required. + * + * The context applied to the store should be accessible in any async code which + * continues from execution which began during the given function, however + * there are some situations in which `context loss` may occur. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const store = new AsyncLocalStorage(); + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.bindStore(store, (message) => { + * const parent = store.getStore(); + * return new Span(message, parent); + * }); + * channel.runStores({ some: 'message' }, () => { + * store.getStore(); // Span({ some: 'message' }) + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param context Message to send to subscribers and bind to stores + * @param fn Handler to run within the entered storage context + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runStores(): void; + } + interface TracingChannelSubscribers { + start: (message: ContextType) => void; + end: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncStart: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + asyncEnd: ( + message: ContextType & { + error?: unknown; + result?: unknown; + }, + ) => void; + error: ( + message: ContextType & { + error: unknown; + }, + ) => void; + } + interface TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + } + /** + * The class `TracingChannel` is a collection of `TracingChannel Channels` which + * together express a single traceable action. It is used to formalize and + * simplify the process of producing events for tracing application flow.{@link tracingChannel} is used to construct a`TracingChannel`. As with `Channel` it is recommended to create and reuse a + * single `TracingChannel` at the top-level of the file rather than creating them + * dynamically. + * @since v19.9.0 + * @experimental + */ + class TracingChannel implements TracingChannelCollection { + start: Channel; + end: Channel; + asyncStart: Channel; + asyncEnd: Channel; + error: Channel; + /** + * Helper to subscribe a collection of functions to the corresponding channels. + * This is the same as calling `channel.subscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.subscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + */ + subscribe(subscribers: TracingChannelSubscribers): void; + /** + * Helper to unsubscribe a collection of functions from the corresponding channels. + * This is the same as calling `channel.unsubscribe(onMessage)` on each channel + * individually. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.unsubscribe({ + * start(message) { + * // Handle start message + * }, + * end(message) { + * // Handle end message + * }, + * asyncStart(message) { + * // Handle asyncStart message + * }, + * asyncEnd(message) { + * // Handle asyncEnd message + * }, + * error(message) { + * // Handle error message + * }, + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param subscribers Set of `TracingChannel Channels` subscribers + * @return `true` if all handlers were successfully unsubscribed, and `false` otherwise. + */ + unsubscribe(subscribers: TracingChannelSubscribers): void; + /** + * Trace a synchronous function call. This will always produce a `start event` and `end event` around the execution and may produce an `error event` if the given function throws an error. + * This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceSync(() => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Function to wrap a trace around + * @param context Shared object to correlate events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceSync( + fn: (this: ThisArg, ...args: Args) => any, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): void; + /** + * Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also + * produce an `error event` if the given function throws an error or the + * returned promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.tracePromise(async () => { + * // Do something + * }, { + * some: 'thing', + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn Promise-returning function to wrap a trace around + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return Chained from promise returned by the given function + */ + tracePromise( + fn: (this: ThisArg, ...args: Args) => Promise, + context?: ContextType, + thisArg?: ThisArg, + ...args: Args + ): void; + /** + * Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the + * function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or + * the returned + * promise rejects. This will run the given function using `channel.runStores(context, ...)` on the `start` channel which ensures all + * events should have any bound stores set to match this trace context. + * + * The `position` will be -1 by default to indicate the final argument should + * be used as the callback. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * + * channels.traceCallback((arg1, callback) => { + * // Do something + * callback(null, 'result'); + * }, 1, { + * some: 'thing', + * }, thisArg, arg1, callback); + * ``` + * + * The callback will also be run with `channel.runStores(context, ...)` which + * enables context loss recovery in some cases. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const channels = diagnostics_channel.tracingChannel('my-channel'); + * const myStore = new AsyncLocalStorage(); + * + * // The start channel sets the initial store data to something + * // and stores that store data value on the trace context object + * channels.start.bindStore(myStore, (data) => { + * const span = new Span(data); + * data.span = span; + * return span; + * }); + * + * // Then asyncStart can restore from that data it stored previously + * channels.asyncStart.bindStore(myStore, (data) => { + * return data.span; + * }); + * ``` + * @since v19.9.0 + * @experimental + * @param fn callback using function to wrap a trace around + * @param position Zero-indexed argument position of expected callback + * @param context Shared object to correlate trace events through + * @param thisArg The receiver to be used for the function call + * @param args Optional arguments to pass to the function + * @return The return value of the given function + */ + traceCallback any>( + fn: Fn, + position: number | undefined, + context: ContextType | undefined, + thisArg: any, + ...args: Parameters + ): void; } } declare module "node:diagnostics_channel" { diff --git a/build/node_modules/@types/node/ts4.8/fs.d.ts b/build/node_modules/@types/node/ts4.8/fs.d.ts index f98453a5..5cbca12f 100644 --- a/build/node_modules/@types/node/ts4.8/fs.d.ts +++ b/build/node_modules/@types/node/ts4.8/fs.d.ts @@ -281,7 +281,7 @@ declare module "fs" { * Asynchronously close the directory's underlying resource handle. * Subsequent reads will result in errors. * - * A promise is returned that will be resolved after the resource has been + * A promise is returned that will be fulfilled after the resource has been * closed. * @since v12.12.0 */ @@ -296,7 +296,7 @@ declare module "fs" { /** * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * A promise is returned that will be fulfilled with an `fs.Dirent`, or `null`if there are no more directory entries to read. * * Directory entries returned by this function are in no particular order as * provided by the operating system's underlying directory mechanisms. @@ -354,31 +354,51 @@ declare module "fs" { * @since v0.5.8 */ close(): void; + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.FSWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.FSWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.FSWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.FSWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; /** * events.EventEmitter * 1. change - * 2. error + * 2. close + * 3. error */ addListener(event: string, listener: (...args: any[]) => void): this; addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "error", listener: (error: Error) => void): this; addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; on(event: string, listener: (...args: any[]) => void): this; on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "error", listener: (error: Error) => void): this; on(event: "close", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; once(event: string, listener: (...args: any[]) => void): this; once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "error", listener: (error: Error) => void): this; once(event: "close", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; prependListener(event: string, listener: (...args: any[]) => void): this; prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; prependOnceListener(event: string, listener: (...args: any[]) => void): this; prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; } /** * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. diff --git a/build/node_modules/@types/node/ts4.8/globals.d.ts b/build/node_modules/@types/node/ts4.8/globals.d.ts index 72d1860f..5f250062 100644 --- a/build/node_modules/@types/node/ts4.8/globals.d.ts +++ b/build/node_modules/@types/node/ts4.8/globals.d.ts @@ -234,6 +234,32 @@ declare global { * Is this a constructor call? */ isConstructor(): boolean; + + /** + * is this an async call (i.e. await, Promise.all(), or Promise.any())? + */ + isAsync(): boolean; + + /** + * is this an async call to Promise.all()? + */ + isPromiseAll(): boolean; + + /** + * returns the index of the promise element that was followed in + * Promise.all() or Promise.any() for async stack traces, or null + * if the CallSite is not an async + */ + getPromiseIndex(): number | null; + + getScriptNameOrSourceURL(): string; + getScriptHash(): string; + + getEnclosingColumnNumber(): number; + getEnclosingLineNumber(): number; + getPosition(): number; + + toString(): string; } interface ErrnoException extends Error { diff --git a/build/node_modules/@types/node/ts4.8/http.d.ts b/build/node_modules/@types/node/ts4.8/http.d.ts index 9b2c3c2c..710fe594 100644 --- a/build/node_modules/@types/node/ts4.8/http.d.ts +++ b/build/node_modules/@types/node/ts4.8/http.d.ts @@ -9,12 +9,12 @@ * * HTTP message headers are represented by an object like this: * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'example.com', - * 'accept': '*' } + * ```json + * { "content-length": "123", + * "content-type": "text/plain", + * "connection": "keep-alive", + * "host": "example.com", + * "accept": "*" } * ``` * * Keys are lowercased. Values are not modified. @@ -1814,7 +1814,6 @@ declare module "http" { * * It is not necessary to use this method before passing headers to an HTTP request * or response. The HTTP module will automatically validate such headers. - * Examples: * * Example: * diff --git a/build/node_modules/@types/node/ts4.8/module.d.ts b/build/node_modules/@types/node/ts4.8/module.d.ts index 68d59c77..c38a9b80 100644 --- a/build/node_modules/@types/node/ts4.8/module.d.ts +++ b/build/node_modules/@types/node/ts4.8/module.d.ts @@ -276,6 +276,20 @@ declare module "module" { } global { interface ImportMeta { + /** + * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. + * **Caveat:** only present on `file:` modules. + */ + dirname: string; + /** + * The full absolute path and filename of the current module, with symlinks resolved. + * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. + * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. + */ + filename: string; + /** + * The absolute `file:` URL of the module. + */ url: string; /** * Provides a module-relative resolution function scoped to each module, returning diff --git a/build/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/build/node_modules/@types/node/ts4.8/perf_hooks.d.ts index 0e16e581..c0ce852a 100644 --- a/build/node_modules/@types/node/ts4.8/perf_hooks.d.ts +++ b/build/node_modules/@types/node/ts4.8/perf_hooks.d.ts @@ -31,7 +31,7 @@ */ declare module "perf_hooks" { import { AsyncResource } from "node:async_hooks"; - type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http"; + type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net"; interface NodeGCPerformanceDetail { /** * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies @@ -314,13 +314,15 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 81.465639, - * * duration: 0 + * * duration: 0, + * * detail: null * * }, * * PerformanceEntry { * * name: 'meow', * * entryType: 'mark', * * startTime: 81.860064, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -355,7 +357,8 @@ declare module "perf_hooks" { * * name: 'meow', * * entryType: 'mark', * * startTime: 98.545991, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -368,7 +371,8 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 63.518931, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * @@ -404,13 +408,15 @@ declare module "perf_hooks" { * * name: 'test', * * entryType: 'mark', * * startTime: 55.897834, - * * duration: 0 + * * duration: 0, + * * detail: null * * }, * * PerformanceEntry { * * name: 'meow', * * entryType: 'mark', * * startTime: 56.350146, - * * duration: 0 + * * duration: 0, + * * detail: null * * } * * ] * diff --git a/build/node_modules/@types/node/ts4.8/process.d.ts b/build/node_modules/@types/node/ts4.8/process.d.ts index 0e274737..d22308f6 100644 --- a/build/node_modules/@types/node/ts4.8/process.d.ts +++ b/build/node_modules/@types/node/ts4.8/process.d.ts @@ -903,9 +903,14 @@ declare module "process" { */ readonly sourceMapsEnabled: boolean; /** - * This function enables or disables the Source Map v3 support for stack traces. - * It provides same features as launching Node.js process with commandline options --enable-source-maps. - * @since v16.6.0 + * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for + * stack traces. + * + * It provides same features as launching Node.js process with commandline options`--enable-source-maps`. + * + * Only source maps in JavaScript files that are loaded after source maps has been + * enabled will be parsed and loaded. + * @since v16.6.0, v14.18.0 * @experimental */ setSourceMapsEnabled(value: boolean): void; @@ -1311,6 +1316,23 @@ declare module "process" { */ uptime(): number; hrtime: HRTime; + /** + * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel. + * If no IPC channel exists, this property is undefined. + * @since v7.1.0 + */ + channel?: { + /** + * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before. + * @since v7.1.0 + */ + ref(): void; + /** + * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open. + * @since v7.1.0 + */ + unref(): void; + }; /** * If Node.js is spawned with an IPC channel, the `process.send()` method can be * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. diff --git a/build/node_modules/@types/node/ts4.8/querystring.d.ts b/build/node_modules/@types/node/ts4.8/querystring.d.ts index 54ecc967..b36ea2c1 100644 --- a/build/node_modules/@types/node/ts4.8/querystring.d.ts +++ b/build/node_modules/@types/node/ts4.8/querystring.d.ts @@ -74,10 +74,10 @@ declare module "querystring" { * * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: * - * ```js + * ```json * { - * foo: 'bar', - * abc: ['xyz', '123'] + * "foo": "bar", + * "abc": ["xyz", "123"] * } * ``` * diff --git a/build/node_modules/@types/node/ts4.8/stream/web.d.ts b/build/node_modules/@types/node/ts4.8/stream/web.d.ts index 0d916137..361594df 100644 --- a/build/node_modules/@types/node/ts4.8/stream/web.d.ts +++ b/build/node_modules/@types/node/ts4.8/stream/web.d.ts @@ -342,7 +342,23 @@ declare module "stream/web" { } const TextDecoderStream: { prototype: TextDecoderStream; - new(label?: string, options?: TextDecoderOptions): TextDecoderStream; + new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream; + }; + interface CompressionStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const CompressionStream: { + prototype: CompressionStream; + new(format: string): CompressionStream; + }; + interface DecompressionStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const DecompressionStream: { + prototype: DecompressionStream; + new(format: string): DecompressionStream; }; } declare module "node:stream/web" { diff --git a/build/node_modules/@types/node/ts4.8/test.d.ts b/build/node_modules/@types/node/ts4.8/test.d.ts index 44b6a964..149c9e0b 100644 --- a/build/node_modules/@types/node/ts4.8/test.d.ts +++ b/build/node_modules/@types/node/ts4.8/test.d.ts @@ -82,6 +82,11 @@ declare module "node:test" { import { Readable } from "node:stream"; import { AsyncResource } from "node:async_hooks"; /** + * **Note:**`shard` is used to horizontally parallelize test running across + * machines or processes, ideal for large-scale executions across varied + * environments. It's incompatible with `watch` mode, tailored for rapid + * code iteration by automatically rerunning tests on file changes. + * * ```js * import { tap } from 'node:test/reporters'; * import { run } from 'node:test'; @@ -1007,12 +1012,20 @@ declare module "node:test" { */ restore(): void; } - type Timer = "setInterval" | "clearInterval" | "setTimeout" | "clearTimeout"; + type Timer = "setInterval" | "setTimeout" | "setImmediate" | "Date"; + + interface MockTimersOptions { + apis: Timer[]; + now?: number | Date; + } /** * Mocking timers is a technique commonly used in software testing to simulate and * control the behavior of timers, such as `setInterval` and `setTimeout`, * without actually waiting for the specified time intervals. * + * The MockTimers API also allows for mocking of the `Date` constructor and + * `setImmediate`/`clearImmediate` functions. + * * The `MockTracker` provides a top-level `timers` export * which is a `MockTimers` instance. * @since v20.4.0 @@ -1025,24 +1038,66 @@ declare module "node:test" { * **Note:** When you enable mocking for a specific timer, its associated * clear function will also be implicitly mocked. * - * Example usage: + * **Note:** Mocking `Date` will affect the behavior of the mocked timers + * as they use the same internal clock. + * + * Example usage without setting initial time: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['setInterval', 'Date'], now: 1234 }); + * ``` + * + * The above example enables mocking for the `Date` constructor, `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `Date` constructor from `globalThis`, + * `setInterval` and `clearInterval` functions from `node:timers`,`node:timers/promises`, and `globalThis` will be mocked. + * + * Example usage with initial time set * * ```js * import { mock } from 'node:test'; - * mock.timers.enable(['setInterval']); + * mock.timers.enable({ apis: ['Date'], now: 1000 }); * ``` * - * The above example enables mocking for the `setInterval` timer and - * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * Example usage with initial Date object as time set + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable({ apis: ['Date'], now: new Date() }); + * ``` * * Alternatively, if you call `mock.timers.enable()` without any parameters: * - * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) - * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * All timers (`'setInterval'`, `'clearInterval'`, `'Date'`, `'setImmediate'`, `'clearImmediate'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. + * + * The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout` functions from `node:timers`, `node:timers/promises`, * and `globalThis` will be mocked. + * The `Date` constructor from `globalThis` will be mocked. + * + * If there is no initial epoch set, the initial date will be based on 0 in the Unix epoch. This is `January 1st, 1970, 00:00:00 UTC`. You can set an initial date by passing a now property to the `.enable()` method. This value will be used as the initial date for the mocked Date object. It can either be a positive integer, or another Date object. * @since v20.4.0 */ - enable(timers?: Timer[]): void; + enable(options?: MockTimersOptions): void; + /** + * You can use the `.setTime()` method to manually move the mocked date to another time. This method only accepts a positive integer. + * Note: This method will execute any mocked timers that are in the past from the new time. + * In the below example we are setting a new time for the mocked date. + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * test('sets the time of a date object', (context) => { + * // Optionally choose what to mock + * context.mock.timers.enable({ apis: ['Date'], now: 100 }); + * assert.strictEqual(Date.now(), 100); + * // Advance in time will also advance the date + * context.mock.timers.setTime(1000); + * context.mock.timers.tick(200); + * assert.strictEqual(Date.now(), 1200); + * }); + * ``` + */ + setTime(time: number): void; /** * This function restores the default behavior of all mocks that were previously * created by this `MockTimers` instance and disassociates the mocks @@ -1076,7 +1131,7 @@ declare module "node:test" { * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { * const fn = context.mock.fn(); * - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout'] }); * * setTimeout(fn, 9999); * @@ -1097,7 +1152,7 @@ declare module "node:test" { * * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { * const fn = context.mock.fn(); - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout'] }); * const nineSecs = 9000; * setTimeout(fn, nineSecs); * @@ -1109,11 +1164,35 @@ declare module "node:test" { * assert.strictEqual(fn.mock.callCount(), 1); * }); * ``` + * + * Advancing time using `.tick` will also advance the time for any `Date` object + * created after the mock was enabled (if `Date` was also set to be mocked). + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * assert.strictEqual(Date.now(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * assert.strictEqual(fn.mock.callCount(), 1); + * assert.strictEqual(Date.now(), 9999); + * }); + * ``` * @since v20.4.0 */ tick(milliseconds: number): void; /** - * Triggers all pending mocked timers immediately. + * Triggers all pending mocked timers immediately. If the `Date` object is also + * mocked, it will also advance the `Date` object to the furthest timer's time. * * The example below triggers all pending timers immediately, * causing them to execute without any delay. @@ -1123,7 +1202,7 @@ declare module "node:test" { * import { test } from 'node:test'; * * test('runAll functions following the given order', (context) => { - * context.mock.timers.enable(['setTimeout']); + * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); * const results = []; * setTimeout(() => results.push(1), 9999); * @@ -1135,8 +1214,9 @@ declare module "node:test" { * assert.deepStrictEqual(results, []); * * context.mock.timers.runAll(); - * * assert.deepStrictEqual(results, [3, 2, 1]); + * // The Date object is also advanced to the furthest timer's time + * assert.strictEqual(Date.now(), 9999); * }); * ``` * @@ -1343,7 +1423,7 @@ interface TestDequeue extends TestLocationInfo { * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) */ declare module "node:test/reporters" { - import { Transform } from "node:stream"; + import { Transform, TransformOptions } from "node:stream"; type TestEvent = | { type: "test:diagnostic"; data: DiagnosticData } @@ -1378,5 +1458,8 @@ declare module "node:test/reporters" { * The `junit` reporter outputs test results in a jUnit XML format */ function junit(source: TestEventGenerator): AsyncGenerator; - export { dot, junit, Spec as spec, tap, TestEvent }; + class Lcov extends Transform { + constructor(opts?: TransformOptions); + } + export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; } diff --git a/build/node_modules/@types/node/ts4.8/wasi.d.ts b/build/node_modules/@types/node/ts4.8/wasi.d.ts index caaf6095..337c0741 100644 --- a/build/node_modules/@types/node/ts4.8/wasi.d.ts +++ b/build/node_modules/@types/node/ts4.8/wasi.d.ts @@ -1,6 +1,11 @@ /** - * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the - * underlying operating system via a collection of POSIX-like functions. + * **The `node:wasi` module does not currently provide the** + * **comprehensive file system security properties provided by some WASI runtimes.** + * **Full support for secure file system sandboxing may or may not be implemented in** + * **future. In the mean time, do not rely on it to run untrusted code.** + * + * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives WebAssembly applications access to the underlying + * operating system via a collection of POSIX-like functions. * * ```js * import { readFile } from 'node:fs/promises'; @@ -12,7 +17,7 @@ * args: argv, * env, * preopens: { - * '/sandbox': '/some/real/path/that/wasm/can/access', + * '/local': '/some/real/path/that/wasm/can/access', * }, * }); * @@ -117,8 +122,7 @@ declare module "wasi" { /** * The `WASI` class provides the WASI system call API and additional convenience * methods for working with WASI-based applications. Each `WASI` instance - * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and - * sandbox directory structure configured explicitly. + * represents a distinct environment. * @since v13.3.0, v12.16.0 */ class WASI { diff --git a/build/node_modules/@types/node/wasi.d.ts b/build/node_modules/@types/node/wasi.d.ts index caaf6095..337c0741 100644 --- a/build/node_modules/@types/node/wasi.d.ts +++ b/build/node_modules/@types/node/wasi.d.ts @@ -1,6 +1,11 @@ /** - * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the - * underlying operating system via a collection of POSIX-like functions. + * **The `node:wasi` module does not currently provide the** + * **comprehensive file system security properties provided by some WASI runtimes.** + * **Full support for secure file system sandboxing may or may not be implemented in** + * **future. In the mean time, do not rely on it to run untrusted code.** + * + * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives WebAssembly applications access to the underlying + * operating system via a collection of POSIX-like functions. * * ```js * import { readFile } from 'node:fs/promises'; @@ -12,7 +17,7 @@ * args: argv, * env, * preopens: { - * '/sandbox': '/some/real/path/that/wasm/can/access', + * '/local': '/some/real/path/that/wasm/can/access', * }, * }); * @@ -117,8 +122,7 @@ declare module "wasi" { /** * The `WASI` class provides the WASI system call API and additional convenience * methods for working with WASI-based applications. Each `WASI` instance - * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and - * sandbox directory structure configured explicitly. + * represents a distinct environment. * @since v13.3.0, v12.16.0 */ class WASI { diff --git a/build/node_modules/follow-redirects/index.js b/build/node_modules/follow-redirects/index.js index 057c6b1e..f58b9334 100644 --- a/build/node_modules/follow-redirects/index.js +++ b/build/node_modules/follow-redirects/index.js @@ -6,6 +6,30 @@ var Writable = require("stream").Writable; var assert = require("assert"); var debug = require("./debug"); +// Whether to use the native URL object or the legacy url module +var useNativeURL = false; +try { + assert(new URL()); +} +catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; +} + +// URL fields to preserve in copy operations +var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash", +]; + // Create handlers that pass events from native requests var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; var eventHandlers = Object.create(null); @@ -15,19 +39,20 @@ events.forEach(function (event) { }; }); +// Error types with codes var InvalidUrlError = createErrorType( "ERR_INVALID_URL", "Invalid URL", TypeError ); -// Error types with codes var RedirectionError = createErrorType( "ERR_FR_REDIRECTION_FAILURE", "Redirected request failed" ); var TooManyRedirectsError = createErrorType( "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" + "Maximum number of redirects exceeded", + RedirectionError ); var MaxBodyLengthExceededError = createErrorType( "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", @@ -62,7 +87,13 @@ function RedirectableRequest(options, responseCallback) { // React to responses of native requests var self = this; this._onNativeResponse = function (response) { - self._processResponse(response); + try { + self._processResponse(response); + } + catch (cause) { + self.emit("error", cause instanceof RedirectionError ? + cause : new RedirectionError({ cause: cause })); + } }; // Perform the first request @@ -280,8 +311,7 @@ RedirectableRequest.prototype._performRequest = function () { var protocol = this._options.protocol; var nativeProtocol = this._options.nativeProtocols[protocol]; if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; + throw new TypeError("Unsupported protocol " + protocol); } // If specified, use the agent corresponding to the protocol @@ -380,8 +410,7 @@ RedirectableRequest.prototype._processResponse = function (response) { // RFC7231§6.4: A client SHOULD detect and intervene // in cyclical redirections (i.e., "infinite" redirection loops). if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; + throw new TooManyRedirectsError(); } // Store the request headers if applicable @@ -415,33 +444,23 @@ RedirectableRequest.prototype._processResponse = function (response) { var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); + var currentUrlParts = parseUrl(this._currentUrl); var currentHost = currentHostHeader || currentUrlParts.host; var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - return; - } - // Create the redirected request - debug("redirecting to", redirectUrl); + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); + spreadUrlObject(redirectUrl, this._options); // Drop confidential headers when redirecting to a less secure protocol // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { + if (redirectUrl.protocol !== currentUrlParts.protocol && + redirectUrl.protocol !== "https:" || + redirectUrl.host !== currentHost && + !isSubdomain(redirectUrl.host, currentHost)) { removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); } @@ -456,23 +475,12 @@ RedirectableRequest.prototype._processResponse = function (response) { method: method, headers: requestHeaders, }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); - } - catch (err) { - this.emit("error", err); - return; - } + beforeRedirect(this._options, responseDetails, requestDetails); this._sanitizeOptions(this._options); } // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError({ cause: cause })); - } + this._performRequest(); }; // Wraps the key/value object of protocols with redirect functionality @@ -492,27 +500,16 @@ function wrap(protocols) { // Executes a request, following redirects function request(input, options, callback) { - // Parse parameters - if (isString(input)) { - var parsed; - try { - parsed = urlToOptions(new URL(input)); - } - catch (err) { - /* istanbul ignore next */ - parsed = url.parse(input); - } - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - input = parsed; + // Parse parameters, ensuring that input is an object + if (isURL(input)) { + input = spreadUrlObject(input); } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); + else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); } else { callback = options; - options = input; + options = validateUrl(input); input = { protocol: protocol }; } if (isFunction(options)) { @@ -551,27 +548,57 @@ function wrap(protocols) { return exports; } -/* istanbul ignore next */ function noop() { /* empty */ } -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); +function parseUrl(input) { + var parsed; + /* istanbul ignore else */ + if (useNativeURL) { + parsed = new URL(input); + } + else { + // Ensure the URL is valid and absolute + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + } + return parsed; +} + +function resolveUrl(relative, base) { + /* istanbul ignore next */ + return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); +} + +function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); } - return options; + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; +} + +function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; + } + + // Fix IPv6 hostname + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + // Ensure port is a number + if (spread.port !== "") { + spread.port = Number(spread.port); + } + // Concatenate path + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; + + return spread; } function removeMatchingHeaders(regex, headers) { @@ -597,8 +624,16 @@ function createErrorType(code, message, baseClass) { // Attach constructor and set default properties CustomError.prototype = new (baseClass || Error)(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false, + }, + name: { + value: "Error [" + code + "]", + enumerable: false, + }, + }); return CustomError; } @@ -628,6 +663,10 @@ function isBuffer(value) { return typeof value === "object" && ("length" in value); } +function isURL(value) { + return URL && value instanceof URL; +} + // Exports module.exports = wrap({ http: http, https: https }); module.exports.wrap = wrap; diff --git a/build/node_modules/follow-redirects/package.json b/build/node_modules/follow-redirects/package.json index eb90372d..9b87663e 100644 --- a/build/node_modules/follow-redirects/package.json +++ b/build/node_modules/follow-redirects/package.json @@ -1,6 +1,6 @@ { "name": "follow-redirects", - "version": "1.15.3", + "version": "1.15.5", "description": "HTTP and HTTPS modules that follow redirects.", "license": "MIT", "main": "index.js", diff --git a/build/node_modules/just-extend/CHANGELOG.md b/build/node_modules/just-extend/CHANGELOG.md new file mode 100644 index 00000000..34ff3598 --- /dev/null +++ b/build/node_modules/just-extend/CHANGELOG.md @@ -0,0 +1,19 @@ +# just-extend + +## 6.2.0 + +### Minor Changes + +- Rename node module .js -> .cjs + +## 6.1.1 + +### Patch Changes + +- fix: reorder exports to set default last #488 + +## 6.1.0 + +### Minor Changes + +- package.json updates to fix #467 and #483 diff --git a/build/node_modules/just-extend/README.md b/build/node_modules/just-extend/README.md index 52dd1347..22ceb390 100644 --- a/build/node_modules/just-extend/README.md +++ b/build/node_modules/just-extend/README.md @@ -1,9 +1,21 @@ + + + ## just-extend -Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing. +Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion. -[Try it now](http://anguscroll.com/just/just-extend) +[`🍦 Try it`](https://anguscroll.com/just/just-extend) + +```shell +npm install just-extend +``` +```shell +yarn add just-extend +``` + +Extend an object ```js import extend from 'just-extend'; diff --git a/build/node_modules/just-extend/index.js b/build/node_modules/just-extend/index.cjs similarity index 100% rename from build/node_modules/just-extend/index.js rename to build/node_modules/just-extend/index.cjs diff --git a/build/node_modules/just-extend/index.d.ts b/build/node_modules/just-extend/index.d.ts index cea7e54f..85a234f5 100644 --- a/build/node_modules/just-extend/index.d.ts +++ b/build/node_modules/just-extend/index.d.ts @@ -1,4 +1,4 @@ // Definitions by: Peter Safranek declare function extend(obj1: object, ...objn: any[]): object; declare function extend(deep: boolean, obj1: object, ...objn: any[]): object; -export = extend; \ No newline at end of file +export default extend; diff --git a/build/node_modules/just-extend/index.mjs b/build/node_modules/just-extend/index.mjs new file mode 100644 index 00000000..617e3be0 --- /dev/null +++ b/build/node_modules/just-extend/index.mjs @@ -0,0 +1,74 @@ +var objectExtend = extend; + +/* + var obj = {a: 3, b: 5}; + extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} + obj; // {a: 4, b: 5, c: 8} + + var obj = {a: 3, b: 5}; + extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8} + obj; // {a: 3, b: 5} + + var arr = [1, 2, 3]; + var obj = {a: 3, b: 5}; + extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} + arr.push(4); + obj; // {a: 3, b: 5, c: [1, 2, 3, 4]} + + var arr = [1, 2, 3]; + var obj = {a: 3, b: 5}; + extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]} + arr.push(4); + obj; // {a: 3, b: 5, c: [1, 2, 3]} + + extend({a: 4, b: 5}); // {a: 4, b: 5} + extend({a: 4, b: 5}, 3); {a: 4, b: 5} + extend({a: 4, b: 5}, true); {a: 4, b: 5} + extend('hello', {a: 4, b: 5}); // throws + extend(3, {a: 4, b: 5}); // throws +*/ + +function extend(/* [deep], obj1, obj2, [objn] */) { + var args = [].slice.call(arguments); + var deep = false; + if (typeof args[0] == 'boolean') { + deep = args.shift(); + } + var result = args[0]; + if (isUnextendable(result)) { + throw new Error('extendee must be an object'); + } + var extenders = args.slice(1); + var len = extenders.length; + for (var i = 0; i < len; i++) { + var extender = extenders[i]; + for (var key in extender) { + if (Object.prototype.hasOwnProperty.call(extender, key)) { + var value = extender[key]; + if (deep && isCloneable(value)) { + var base = Array.isArray(value) ? [] : {}; + result[key] = extend( + true, + Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key]) + ? result[key] + : base, + value + ); + } else { + result[key] = value; + } + } + } + } + return result; +} + +function isCloneable(obj) { + return Array.isArray(obj) || {}.toString.call(obj) == '[object Object]'; +} + +function isUnextendable(val) { + return !val || (typeof val != 'object' && typeof val != 'function'); +} + +export {objectExtend as default}; diff --git a/build/node_modules/just-extend/index.tests.ts b/build/node_modules/just-extend/index.tests.ts index df85e6da..40dc0ff2 100644 --- a/build/node_modules/just-extend/index.tests.ts +++ b/build/node_modules/just-extend/index.tests.ts @@ -1,42 +1,42 @@ -import extend = require("./index"); +import extend from './index' // OK // Pass single `object`. -extend({}); -extend([]); -extend(() => {}); +extend({}); +extend([]); +extend(() => {}); // Pass single `object`, then `any`. -extend({}, 0); -extend({}, ""); -extend({}, false); -extend({}, null); -extend({}, undefined); -extend({}, {}); -extend({}, []); -extend({}, () => {}); +extend({}, 0); +extend({}, ""); +extend({}, false); +extend({}, null); +extend({}, undefined); +extend({}, {}); +extend({}, []); +extend({}, () => {}); // Pass variadic args. -extend({}, 0, "", false, null, undefined, {}, [], () => {}); +extend({}, 0, "", false, null, undefined, {}, [], () => {}); // Pass `boolean`, then single `object`. -extend(true, {}); -extend(true, []); -extend(true, () => {}); +extend(true, {}); +extend(true, []); +extend(true, () => {}); // Pass `boolean`, single `object`, then `any`. -extend(true, {}, 0); -extend(true, {}, ""); -extend(true, {}, false); -extend(true, {}, null); -extend(true, {}, undefined); -extend(true, {}, {}); -extend(true, {}, []); -extend(true, {}, () => {}); +extend(true, {}, 0); +extend(true, {}, ""); +extend(true, {}, false); +extend(true, {}, null); +extend(true, {}, undefined); +extend(true, {}, {}); +extend(true, {}, []); +extend(true, {}, () => {}); // Pass `boolean`, then variadic args. -extend(true, {}, 0, "", false, null, undefined, {}, [], () => {}); +extend(true, {}, 0, "", false, null, undefined, {}, [], () => {}); // Not OK diff --git a/build/node_modules/just-extend/package.json b/build/node_modules/just-extend/package.json index 2b4fa014..fd5c1f13 100644 --- a/build/node_modules/just-extend/package.json +++ b/build/node_modules/just-extend/package.json @@ -1,11 +1,21 @@ { "name": "just-extend", - "version": "4.2.1", + "version": "6.2.0", "description": "extend an object", - "main": "index.js", + "type": "module", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs", + "import": "./index.mjs" + }, + "./package.json": "./package.json" + }, + "main": "index.cjs", "types": "index.d.ts", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "rollup -c" }, "repository": "https://github.com/angus-c/just", "keywords": [ diff --git a/build/node_modules/just-extend/rollup.config.js b/build/node_modules/just-extend/rollup.config.js new file mode 100644 index 00000000..fb9d24a3 --- /dev/null +++ b/build/node_modules/just-extend/rollup.config.js @@ -0,0 +1,3 @@ +const createRollupConfig = require('../../config/createRollupConfig'); + +module.exports = createRollupConfig(__dirname); diff --git a/build/node_modules/nise/lib/configure-logger/index.js b/build/node_modules/nise/lib/configure-logger/index.js index db96bdb5..6046f18a 100644 --- a/build/node_modules/nise/lib/configure-logger/index.js +++ b/build/node_modules/nise/lib/configure-logger/index.js @@ -11,7 +11,7 @@ function configureLogger(config) { // Function which prints errors. if (!config.hasOwnProperty("logger")) { // eslint-disable-next-line no-empty-function - config.logger = function() {}; + config.logger = function () {}; } // When set to true, any errors logged will be thrown immediately; // If set to false, the errors will be thrown in separate execution frame. @@ -28,7 +28,7 @@ function configureLogger(config) { var err = { name: e.name || label, message: e.message || e.toString(), - stack: e.stack + stack: e.stack, }; function throwLoggedError() { diff --git a/build/node_modules/nise/lib/event/event-target.js b/build/node_modules/nise/lib/event/event-target.js index c5a4ff5b..68ed4a7a 100644 --- a/build/node_modules/nise/lib/event/event-target.js +++ b/build/node_modules/nise/lib/event/event-target.js @@ -5,22 +5,22 @@ function flattenOptions(options) { return { capture: Boolean(options), once: false, - passive: false + passive: false, }; } return { capture: Boolean(options.capture), once: Boolean(options.once), - passive: Boolean(options.passive) + passive: Boolean(options.passive), }; } function not(fn) { - return function() { + return function () { return !fn.apply(this, arguments); }; } function hasListenerFilter(listener, capture) { - return function(listenerSpec) { + return function (listenerSpec) { return ( listenerSpec.capture === capture && listenerSpec.listener === listener @@ -33,7 +33,7 @@ var EventTarget = { addEventListener: function addEventListener( event, listener, - providedOptions + providedOptions, ) { // 3. Let capture, passive, and once be the result of flattening more options. // Flatten property before executing step 2, @@ -59,13 +59,13 @@ var EventTarget = { // callback, capture is capture, passive is passive, and once is once. if ( !this.eventListeners[event].some( - hasListenerFilter(listener, options.capture) + hasListenerFilter(listener, options.capture), ) ) { this.eventListeners[event].push({ listener: listener, capture: options.capture, - once: options.once + once: options.once, }); } }, @@ -74,7 +74,7 @@ var EventTarget = { removeEventListener: function removeEventListener( event, listener, - providedOptions + providedOptions, ) { if (!this.eventListeners || !this.eventListeners[event]) { return; @@ -88,7 +88,7 @@ var EventTarget = { // and capture is capture, then set that event listener’s // removed to true and remove it from the associated list of event listeners. this.eventListeners[event] = this.eventListeners[event].filter( - not(hasListenerFilter(listener, options.capture)) + not(hasListenerFilter(listener, options.capture)), ); }, @@ -103,10 +103,10 @@ var EventTarget = { // Remove listeners, that should be dispatched once // before running dispatch loop to avoid nested dispatch issues - self.eventListeners[type] = listeners.filter(function(listenerSpec) { + self.eventListeners[type] = listeners.filter(function (listenerSpec) { return !listenerSpec.once; }); - listeners.forEach(function(listenerSpec) { + listeners.forEach(function (listenerSpec) { var listener = listenerSpec.listener; if (typeof listener === "function") { listener.call(self, event); @@ -116,7 +116,7 @@ var EventTarget = { }); return Boolean(event.defaultPrevented); - } + }, }; module.exports = EventTarget; diff --git a/build/node_modules/nise/lib/event/event.js b/build/node_modules/nise/lib/event/event.js index f321b337..4d4a8342 100644 --- a/build/node_modules/nise/lib/event/event.js +++ b/build/node_modules/nise/lib/event/event.js @@ -5,7 +5,7 @@ function Event(type, bubbles, cancelable, target) { } Event.prototype = { - initEvent: function(type, bubbles, cancelable, target) { + initEvent: function (type, bubbles, cancelable, target) { this.type = type; this.bubbles = bubbles; this.cancelable = cancelable; @@ -14,11 +14,11 @@ Event.prototype = { }, // eslint-disable-next-line no-empty-function - stopPropagation: function() {}, + stopPropagation: function () {}, - preventDefault: function() { + preventDefault: function () { this.defaultPrevented = true; - } + }, }; module.exports = Event; diff --git a/build/node_modules/nise/lib/event/index.js b/build/node_modules/nise/lib/event/index.js index d275f550..16391fb7 100644 --- a/build/node_modules/nise/lib/event/index.js +++ b/build/node_modules/nise/lib/event/index.js @@ -4,5 +4,5 @@ module.exports = { Event: require("./event"), ProgressEvent: require("./progress-event"), CustomEvent: require("./custom-event"), - EventTarget: require("./event-target") + EventTarget: require("./event-target"), }; diff --git a/build/node_modules/nise/lib/fake-server/fake-server-with-clock.js b/build/node_modules/nise/lib/fake-server/fake-server-with-clock.js index 915f9151..f3ca856c 100644 --- a/build/node_modules/nise/lib/fake-server/fake-server-with-clock.js +++ b/build/node_modules/nise/lib/fake-server/fake-server-with-clock.js @@ -23,19 +23,19 @@ fakeServerWithClock.addRequest = function addRequest(xhr) { var clockSetInterval = this.clock.setInterval; var server = this; - this.clock.setTimeout = function(fn, timeout) { + this.clock.setTimeout = function (fn, timeout) { server.longestTimeout = Math.max( timeout, - server.longestTimeout || 0 + server.longestTimeout || 0, ); return clockSetTimeout.apply(this, arguments); }; - this.clock.setInterval = function(fn, timeout) { + this.clock.setInterval = function (fn, timeout) { server.longestTimeout = Math.max( timeout, - server.longestTimeout || 0 + server.longestTimeout || 0, ); return clockSetInterval.apply(this, arguments); diff --git a/build/node_modules/nise/lib/fake-server/index.js b/build/node_modules/nise/lib/fake-server/index.js index e4ee4d9a..737e58d5 100644 --- a/build/node_modules/nise/lib/fake-server/index.js +++ b/build/node_modules/nise/lib/fake-server/index.js @@ -4,7 +4,7 @@ var fakeXhr = require("../fake-xhr"); var push = [].push; var log = require("./log"); var configureLogError = require("../configure-logger"); -var pathToRegexp = require("path-to-regexp"); +var pathToRegexp = require("path-to-regexp").pathToRegexp; var supportsArrayBuffer = typeof ArrayBuffer !== "undefined"; @@ -18,11 +18,11 @@ function responseArray(handler) { if (typeof response[2] !== "string") { if (!supportsArrayBuffer) { throw new TypeError( - `Fake server response body should be a string, but was ${typeof response[2]}` + `Fake server response body should be a string, but was ${typeof response[2]}`, ); } else if (!(response[2] instanceof ArrayBuffer)) { throw new TypeError( - `Fake server response body should be a string or ArrayBuffer, but was ${typeof response[2]}` + `Fake server response body should be a string or ArrayBuffer, but was ${typeof response[2]}`, ); } } @@ -34,7 +34,7 @@ function getDefaultWindowLocation() { var winloc = { hostname: "localhost", port: process.env.PORT || 80, - protocol: "http:" + protocol: "http:", }; winloc.host = winloc.hostname + @@ -94,7 +94,7 @@ function match(response, request) { var args = [request].concat( ru && typeof ru.exec === "function" ? ru.exec(requestUrl).slice(1) - : [] + : [], ); return response.response.apply(response, args); } @@ -122,7 +122,7 @@ function incrementRequestCount() { } var fakeServer = { - create: function(config) { + create: function (config) { var server = Object.create(this); server.configure(config); this.xhr = fakeXhr.useFakeXMLHttpRequest(); @@ -131,8 +131,8 @@ var fakeServer = { server.queue = []; server.responses = []; - this.xhr.onCreate = function(xhrObj) { - xhrObj.unsafeHeadersEnabled = function() { + this.xhr.onCreate = function (xhrObj) { + xhrObj.unsafeHeadersEnabled = function () { return !(server.unsafeHeadersEnabled === false); }; server.addRequest(xhrObj); @@ -141,7 +141,7 @@ var fakeServer = { return server; }, - configure: function(config) { + configure: function (config) { var self = this; var allowlist = { autoRespond: true, @@ -149,13 +149,13 @@ var fakeServer = { respondImmediately: true, fakeHTTPMethods: true, logger: true, - unsafeHeadersEnabled: true + unsafeHeadersEnabled: true, }; // eslint-disable-next-line no-param-reassign config = config || {}; - Object.keys(config).forEach(function(setting) { + Object.keys(config).forEach(function (setting) { if (setting in allowlist) { self[setting] = config[setting]; } @@ -170,13 +170,13 @@ var fakeServer = { incrementRequestCount.call(this); - xhrObj.onSend = function() { + xhrObj.onSend = function () { server.handleRequest(this); if (server.respondImmediately) { server.respond(); } else if (server.autoRespond && !server.responding) { - setTimeout(function() { + setTimeout(function () { server.responding = false; server.respond(); }, server.autoRespondAfter || 10); @@ -189,7 +189,7 @@ var fakeServer = { getHTTPMethod: function getHTTPMethod(request) { if (this.fakeHTTPMethods && /post/i.test(request.method)) { var matches = (request.requestBody || "").match( - /_method=([^\b;]+)/ + /_method=([^\b;]+)/, ); return matches ? matches[1] : request.method; } @@ -205,7 +205,7 @@ var fakeServer = { } }, - logger: function() { + logger: function () { // no-op; override via configure() }, @@ -236,17 +236,27 @@ var fakeServer = { } // Escape port number to prevent "named" parameters in 'path-to-regexp' module - if (typeof url === "string" && url !== "" && /:[0-9]+\//.test(url)) { - var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/); - // eslint-disable-next-line no-param-reassign - url = `${m[1]}\\:${m[2]}`; + if (typeof url === "string" && url !== "") { + if (/:[0-9]+\//.test(url)) { + var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/); + // eslint-disable-next-line no-param-reassign + url = `${m[1]}\\:${m[2]}`; + } + if (/:\/\//.test(url)) { + // eslint-disable-next-line no-param-reassign + url = url.replace("://", "\\://"); + } + if (/\*/.test(url)) { + // eslint-disable-next-line no-param-reassign + url = url.replace(/\/\*/g, "/(.*)"); + } } push.call(this.responses, { method: method, url: typeof url === "string" && url !== "" ? pathToRegexp(url) : url, - response: typeof body === "function" ? body : responseArray(body) + response: typeof body === "function" ? body : responseArray(body), }); }, @@ -259,7 +269,7 @@ var fakeServer = { var requests = queue.splice(0, queue.length); var self = this; - requests.forEach(function(request) { + requests.forEach(function (request) { self.processRequest(request); }); }, @@ -324,10 +334,18 @@ var fakeServer = { resetHistory: function resetHistory() { this.requests.length = this.requestCount = 0; - this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false; - - this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null; - } + this.requestedOnce = + this.requestedTwice = + this.requestedThrice = + this.requested = + false; + + this.firstRequest = + this.secondRequest = + this.thirdRequest = + this.lastRequest = + null; + }, }; module.exports = fakeServer; diff --git a/build/node_modules/nise/lib/fake-xhr/blob.js b/build/node_modules/nise/lib/fake-xhr/blob.js index e02b6bb4..878c2130 100644 --- a/build/node_modules/nise/lib/fake-xhr/blob.js +++ b/build/node_modules/nise/lib/fake-xhr/blob.js @@ -1,6 +1,6 @@ "use strict"; -exports.isSupported = (function() { +exports.isSupported = (function () { try { return Boolean(new Blob()); } catch (e) { diff --git a/build/node_modules/nise/lib/fake-xhr/index.js b/build/node_modules/nise/lib/fake-xhr/index.js index eb8eb38d..b52fea35 100644 --- a/build/node_modules/nise/lib/fake-xhr/index.js +++ b/build/node_modules/nise/lib/fake-xhr/index.js @@ -23,7 +23,7 @@ function getWorkingXHR(globalScope) { var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined"; if (supportsActiveX) { - return function() { + return function () { return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0"); }; } @@ -54,7 +54,7 @@ var unsafeHeaders = { "Transfer-Encoding": true, Upgrade: true, "User-Agent": true, - Via: true + Via: true, }; function EventTargetHandler() { @@ -66,11 +66,11 @@ function EventTargetHandler() { "error", "load", "timeout", - "loadend" + "loadend", ]; function addEventListener(eventName) { - self.addEventListener(eventName, function(event) { + self.addEventListener(eventName, function (event) { var listener = self[`on${eventName}`]; if (listener && typeof listener === "function") { @@ -91,7 +91,7 @@ function normalizeHeaderValue(value) { } function getHeader(headers, header) { - var foundHeader = Object.keys(headers).filter(function(h) { + var foundHeader = Object.keys(headers).filter(function (h) { return h.toLowerCase() === header.toLowerCase(); }); @@ -109,7 +109,7 @@ function verifyResponseBodyType(body, responseType) { if (responseType === "arraybuffer") { if (!isString && !(body instanceof ArrayBuffer)) { error = new Error( - `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.` + `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.`, ); error.name = "InvalidBodyException"; } @@ -121,13 +121,13 @@ function verifyResponseBodyType(body, responseType) { !(body instanceof Blob) ) { error = new Error( - `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.` + `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.`, ); error.name = "InvalidBodyException"; } } else if (!isString) { error = new Error( - `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.` + `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.`, ); error.name = "InvalidBodyException"; } @@ -220,7 +220,7 @@ function fakeXMLHttpRequestFor(globalScope) { } // largest arity in XHR is 5 - XHR#open - var apply = function(obj, method, args) { + var apply = function (obj, method, args) { switch (args.length) { case 0: return obj[method](); @@ -254,14 +254,14 @@ function fakeXMLHttpRequestFor(globalScope) { "getAllResponseHeaders", "addEventListener", "overrideMimeType", - "removeEventListener" - ].forEach(function(method) { - fakeXhr[method] = function() { + "removeEventListener", + ].forEach(function (method) { + fakeXhr[method] = function () { return apply(xhr, method, arguments); }; }); - fakeXhr.send = function() { + fakeXhr.send = function () { // Ref: https://xhr.spec.whatwg.org/#the-responsetype-attribute if (xhr.responseType !== fakeXhr.responseType) { xhr.responseType = fakeXhr.responseType; @@ -269,13 +269,13 @@ function fakeXMLHttpRequestFor(globalScope) { return apply(xhr, "send", arguments); }; - var copyAttrs = function(args) { - args.forEach(function(attr) { + var copyAttrs = function (args) { + args.forEach(function (attr) { fakeXhr[attr] = xhr[attr]; }); }; - var stateChangeStart = function() { + var stateChangeStart = function () { fakeXhr.readyState = xhr.readyState; if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) { copyAttrs(["status", "statusText"]); @@ -294,12 +294,12 @@ function fakeXMLHttpRequestFor(globalScope) { } }; - var stateChangeEnd = function() { + var stateChangeEnd = function () { if (fakeXhr.onreadystatechange) { // eslint-disable-next-line no-useless-call fakeXhr.onreadystatechange.call(fakeXhr, { target: fakeXhr, - currentTarget: fakeXhr + currentTarget: fakeXhr, }); } }; @@ -312,12 +312,12 @@ function fakeXMLHttpRequestFor(globalScope) { if (xhr.addEventListener) { xhr.addEventListener("readystatechange", stateChangeStart); - Object.keys(fakeXhr.eventListeners).forEach(function(event) { + Object.keys(fakeXhr.eventListeners).forEach(function (event) { /*eslint-disable no-loop-func*/ - fakeXhr.eventListeners[event].forEach(function(handler) { + fakeXhr.eventListeners[event].forEach(function (handler) { xhr.addEventListener(event, handler.listener, { capture: handler.capture, - once: handler.once + once: handler.once, }); }); /*eslint-enable no-loop-func*/ @@ -436,7 +436,7 @@ function fakeXMLHttpRequestFor(globalScope) { return result.getElementsByTagNameNS( parsererrorNS, - "parsererror" + "parsererror", ).length ? null : result; @@ -495,7 +495,7 @@ function fakeXMLHttpRequestFor(globalScope) { 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", - 505: "HTTP Version Not Supported" + 505: "HTTP Version Not Supported", }; extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, { @@ -513,7 +513,7 @@ function fakeXMLHttpRequestFor(globalScope) { if (FakeXMLHttpRequest.useFilters === true) { var xhrArgs = arguments; - var defake = FakeXMLHttpRequest.filters.some(function(filter) { + var defake = FakeXMLHttpRequest.filters.some(function (filter) { return filter.apply(this, xhrArgs); }); if (defake) { @@ -531,7 +531,7 @@ function fakeXMLHttpRequestFor(globalScope) { "readystatechange", false, false, - this + this, ); if (typeof this.onreadystatechange === "function") { try { @@ -559,25 +559,29 @@ function fakeXMLHttpRequestFor(globalScope) { if (supportsProgress) { this.upload.dispatchEvent( - new sinonEvent.ProgressEvent("progress", progress, this) + new sinonEvent.ProgressEvent( + "progress", + progress, + this, + ), ); this.upload.dispatchEvent( - new sinonEvent.ProgressEvent(event, progress, this) + new sinonEvent.ProgressEvent(event, progress, this), ); this.upload.dispatchEvent( - new sinonEvent.ProgressEvent("loadend", progress, this) + new sinonEvent.ProgressEvent("loadend", progress, this), ); } this.dispatchEvent( - new sinonEvent.ProgressEvent("progress", progress, this) + new sinonEvent.ProgressEvent("progress", progress, this), ); this.dispatchEvent( - new sinonEvent.ProgressEvent(event, progress, this) + new sinonEvent.ProgressEvent(event, progress, this), ); this.dispatchEvent(readyStateChangeEvent); this.dispatchEvent( - new sinonEvent.ProgressEvent("loadend", progress, this) + new sinonEvent.ProgressEvent("loadend", progress, this), ); } }, @@ -586,7 +590,7 @@ function fakeXMLHttpRequestFor(globalScope) { setRequestHeader: function setRequestHeader(header, value) { if (typeof value !== "string") { throw new TypeError( - `By RFC7230, section 3.2.4, header values should be strings. Got ${typeof value}` + `By RFC7230, section 3.2.4, header values should be strings. Got ${typeof value}`, ); } verifyState(this); @@ -603,7 +607,7 @@ function fakeXMLHttpRequestFor(globalScope) { ) { throw new Error( // eslint-disable-next-line quotes - `Refused to set unsafe header "${header}"` + `Refused to set unsafe header "${header}"`, ); } @@ -632,7 +636,7 @@ function fakeXMLHttpRequestFor(globalScope) { var responseHeaders = (this.responseHeaders = {}); - Object.keys(headers).forEach(function(header) { + Object.keys(headers).forEach(function (header) { responseHeaders[header] = headers[header]; }); @@ -650,13 +654,12 @@ function fakeXMLHttpRequestFor(globalScope) { if (!/^(head)$/i.test(this.method)) { var contentType = getHeader( this.requestHeaders, - "Content-Type" + "Content-Type", ); if (this.requestHeaders[contentType]) { var value = this.requestHeaders[contentType].split(";"); - this.requestHeaders[ - contentType - ] = `${value[0]};charset=utf-8`; + this.requestHeaders[contentType] = + `${value[0]};charset=utf-8`; } else if (supportsFormData && !(data instanceof FormData)) { this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8"; @@ -687,7 +690,7 @@ function fakeXMLHttpRequestFor(globalScope) { // is in flight, so we must check anytime the end user forces a clock tick to make // sure timeout hasn't changed. // https://xhr.spec.whatwg.org/#dfnReturnLink-2 - var clearIntervalId = setInterval(function() { + var clearIntervalId = setInterval(function () { // Check if the readyState has been reset or is done. If this is the case, there // should be no timeout. This will also prevent aborted requests and // fakeServerWithClock from triggering unnecessary responses. @@ -709,7 +712,7 @@ function fakeXMLHttpRequestFor(globalScope) { } this.dispatchEvent( - new sinonEvent.Event("loadstart", false, false, this) + new sinonEvent.Event("loadstart", false, false, this), ); }, @@ -719,7 +722,7 @@ function fakeXMLHttpRequestFor(globalScope) { this.readyState = FakeXMLHttpRequest.UNSENT; }, - error: function() { + error: function () { clearResponse(this); this.errorFlag = true; this.requestHeaders = {}; @@ -758,7 +761,7 @@ function fakeXMLHttpRequestFor(globalScope) { var responseHeaders = this.responseHeaders; var headers = Object.keys(responseHeaders) .filter(excludeSetCookie2Header) - .reduce(function(prev, header) { + .reduce(function (prev, header) { var value = responseHeaders[header]; return `${prev}${header}: ${value}\r\n`; @@ -788,7 +791,7 @@ function fakeXMLHttpRequestFor(globalScope) { if (isTextResponse) { this.responseText = this.response += body.substring( index, - index + chunkSize + index + chunkSize, ); } index += chunkSize; @@ -798,7 +801,7 @@ function fakeXMLHttpRequestFor(globalScope) { this.response = convertResponseBody( this.responseType, contentType, - body + body, ); if (isTextResponse) { this.responseText = this.response; @@ -811,7 +814,7 @@ function fakeXMLHttpRequestFor(globalScope) { isXmlContentType(contentType) ) { this.responseXML = FakeXMLHttpRequest.parseXML( - this.responseText + this.responseText, ); } this.readyStateChange(FakeXMLHttpRequest.DONE); @@ -831,8 +834,8 @@ function fakeXMLHttpRequestFor(globalScope) { new sinonEvent.ProgressEvent( "progress", progressEventRaw, - this.upload - ) + this.upload, + ), ); } }, @@ -843,8 +846,8 @@ function fakeXMLHttpRequestFor(globalScope) { new sinonEvent.ProgressEvent( "progress", progressEventRaw, - this - ) + this, + ), ); } }, @@ -852,7 +855,7 @@ function fakeXMLHttpRequestFor(globalScope) { uploadError: function uploadError(error) { if (supportsCustomEvent) { this.upload.dispatchEvent( - new sinonEvent.CustomEvent("error", { detail: error }) + new sinonEvent.CustomEvent("error", { detail: error }), ); } }, @@ -862,7 +865,7 @@ function fakeXMLHttpRequestFor(globalScope) { throw new Error("INVALID_STATE_ERR"); } this.overriddenMimeType = type; - } + }, }); var states = { @@ -870,7 +873,7 @@ function fakeXMLHttpRequestFor(globalScope) { OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, - DONE: 4 + DONE: 4, }; extend(FakeXMLHttpRequest, states); @@ -915,10 +918,10 @@ function fakeXMLHttpRequestFor(globalScope) { return { xhr: sinonXhr, FakeXMLHttpRequest: FakeXMLHttpRequest, - useFakeXMLHttpRequest: useFakeXMLHttpRequest + useFakeXMLHttpRequest: useFakeXMLHttpRequest, }; } module.exports = extend(fakeXMLHttpRequestFor(globalObject), { - fakeXMLHttpRequestFor: fakeXMLHttpRequestFor + fakeXMLHttpRequestFor: fakeXMLHttpRequestFor, }); diff --git a/build/node_modules/nise/lib/index.js b/build/node_modules/nise/lib/index.js index 5fdae0d1..64de094c 100644 --- a/build/node_modules/nise/lib/index.js +++ b/build/node_modules/nise/lib/index.js @@ -3,5 +3,5 @@ module.exports = { fakeServer: require("./fake-server"), fakeServerWithClock: require("./fake-server/fake-server-with-clock"), - fakeXhr: require("./fake-xhr") + fakeXhr: require("./fake-xhr"), }; diff --git a/build/node_modules/nise/nise.js b/build/node_modules/nise/nise.js index af85c421..78b7ffb5 100644 --- a/build/node_modules/nise/nise.js +++ b/build/node_modules/nise/nise.js @@ -12,7 +12,7 @@ function configureLogger(config) { // Function which prints errors. if (!config.hasOwnProperty("logger")) { // eslint-disable-next-line no-empty-function - config.logger = function() {}; + config.logger = function () {}; } // When set to true, any errors logged will be thrown immediately; // If set to false, the errors will be thrown in separate execution frame. @@ -29,7 +29,7 @@ function configureLogger(config) { var err = { name: e.name || label, message: e.message || e.toString(), - stack: e.stack + stack: e.stack, }; function throwLoggedError() { @@ -77,22 +77,22 @@ function flattenOptions(options) { return { capture: Boolean(options), once: false, - passive: false + passive: false, }; } return { capture: Boolean(options.capture), once: Boolean(options.once), - passive: Boolean(options.passive) + passive: Boolean(options.passive), }; } function not(fn) { - return function() { + return function () { return !fn.apply(this, arguments); }; } function hasListenerFilter(listener, capture) { - return function(listenerSpec) { + return function (listenerSpec) { return ( listenerSpec.capture === capture && listenerSpec.listener === listener @@ -105,7 +105,7 @@ var EventTarget = { addEventListener: function addEventListener( event, listener, - providedOptions + providedOptions, ) { // 3. Let capture, passive, and once be the result of flattening more options. // Flatten property before executing step 2, @@ -131,13 +131,13 @@ var EventTarget = { // callback, capture is capture, passive is passive, and once is once. if ( !this.eventListeners[event].some( - hasListenerFilter(listener, options.capture) + hasListenerFilter(listener, options.capture), ) ) { this.eventListeners[event].push({ listener: listener, capture: options.capture, - once: options.once + once: options.once, }); } }, @@ -146,7 +146,7 @@ var EventTarget = { removeEventListener: function removeEventListener( event, listener, - providedOptions + providedOptions, ) { if (!this.eventListeners || !this.eventListeners[event]) { return; @@ -160,7 +160,7 @@ var EventTarget = { // and capture is capture, then set that event listener’s // removed to true and remove it from the associated list of event listeners. this.eventListeners[event] = this.eventListeners[event].filter( - not(hasListenerFilter(listener, options.capture)) + not(hasListenerFilter(listener, options.capture)), ); }, @@ -175,10 +175,10 @@ var EventTarget = { // Remove listeners, that should be dispatched once // before running dispatch loop to avoid nested dispatch issues - self.eventListeners[type] = listeners.filter(function(listenerSpec) { + self.eventListeners[type] = listeners.filter(function (listenerSpec) { return !listenerSpec.once; }); - listeners.forEach(function(listenerSpec) { + listeners.forEach(function (listenerSpec) { var listener = listenerSpec.listener; if (typeof listener === "function") { listener.call(self, event); @@ -188,7 +188,7 @@ var EventTarget = { }); return Boolean(event.defaultPrevented); - } + }, }; module.exports = EventTarget; @@ -201,7 +201,7 @@ function Event(type, bubbles, cancelable, target) { } Event.prototype = { - initEvent: function(type, bubbles, cancelable, target) { + initEvent: function (type, bubbles, cancelable, target) { this.type = type; this.bubbles = bubbles; this.cancelable = cancelable; @@ -210,11 +210,11 @@ Event.prototype = { }, // eslint-disable-next-line no-empty-function - stopPropagation: function() {}, + stopPropagation: function () {}, - preventDefault: function() { + preventDefault: function () { this.defaultPrevented = true; - } + }, }; module.exports = Event; @@ -226,7 +226,7 @@ module.exports = { Event: require("./event"), ProgressEvent: require("./progress-event"), CustomEvent: require("./custom-event"), - EventTarget: require("./event-target") + EventTarget: require("./event-target"), }; },{"./custom-event":2,"./event":4,"./event-target":3,"./progress-event":6}],6:[function(require,module,exports){ @@ -279,19 +279,19 @@ fakeServerWithClock.addRequest = function addRequest(xhr) { var clockSetInterval = this.clock.setInterval; var server = this; - this.clock.setTimeout = function(fn, timeout) { + this.clock.setTimeout = function (fn, timeout) { server.longestTimeout = Math.max( timeout, - server.longestTimeout || 0 + server.longestTimeout || 0, ); return clockSetTimeout.apply(this, arguments); }; - this.clock.setInterval = function(fn, timeout) { + this.clock.setInterval = function (fn, timeout) { server.longestTimeout = Math.max( timeout, - server.longestTimeout || 0 + server.longestTimeout || 0, ); return clockSetInterval.apply(this, arguments); @@ -335,7 +335,7 @@ var fakeXhr = require("../fake-xhr"); var push = [].push; var log = require("./log"); var configureLogError = require("../configure-logger"); -var pathToRegexp = require("path-to-regexp"); +var pathToRegexp = require("path-to-regexp").pathToRegexp; var supportsArrayBuffer = typeof ArrayBuffer !== "undefined"; @@ -349,11 +349,11 @@ function responseArray(handler) { if (typeof response[2] !== "string") { if (!supportsArrayBuffer) { throw new TypeError( - `Fake server response body should be a string, but was ${typeof response[2]}` + `Fake server response body should be a string, but was ${typeof response[2]}`, ); } else if (!(response[2] instanceof ArrayBuffer)) { throw new TypeError( - `Fake server response body should be a string or ArrayBuffer, but was ${typeof response[2]}` + `Fake server response body should be a string or ArrayBuffer, but was ${typeof response[2]}`, ); } } @@ -365,7 +365,7 @@ function getDefaultWindowLocation() { var winloc = { hostname: "localhost", port: process.env.PORT || 80, - protocol: "http:" + protocol: "http:", }; winloc.host = winloc.hostname + @@ -425,7 +425,7 @@ function match(response, request) { var args = [request].concat( ru && typeof ru.exec === "function" ? ru.exec(requestUrl).slice(1) - : [] + : [], ); return response.response.apply(response, args); } @@ -453,7 +453,7 @@ function incrementRequestCount() { } var fakeServer = { - create: function(config) { + create: function (config) { var server = Object.create(this); server.configure(config); this.xhr = fakeXhr.useFakeXMLHttpRequest(); @@ -462,8 +462,8 @@ var fakeServer = { server.queue = []; server.responses = []; - this.xhr.onCreate = function(xhrObj) { - xhrObj.unsafeHeadersEnabled = function() { + this.xhr.onCreate = function (xhrObj) { + xhrObj.unsafeHeadersEnabled = function () { return !(server.unsafeHeadersEnabled === false); }; server.addRequest(xhrObj); @@ -472,7 +472,7 @@ var fakeServer = { return server; }, - configure: function(config) { + configure: function (config) { var self = this; var allowlist = { autoRespond: true, @@ -480,13 +480,13 @@ var fakeServer = { respondImmediately: true, fakeHTTPMethods: true, logger: true, - unsafeHeadersEnabled: true + unsafeHeadersEnabled: true, }; // eslint-disable-next-line no-param-reassign config = config || {}; - Object.keys(config).forEach(function(setting) { + Object.keys(config).forEach(function (setting) { if (setting in allowlist) { self[setting] = config[setting]; } @@ -501,13 +501,13 @@ var fakeServer = { incrementRequestCount.call(this); - xhrObj.onSend = function() { + xhrObj.onSend = function () { server.handleRequest(this); if (server.respondImmediately) { server.respond(); } else if (server.autoRespond && !server.responding) { - setTimeout(function() { + setTimeout(function () { server.responding = false; server.respond(); }, server.autoRespondAfter || 10); @@ -520,7 +520,7 @@ var fakeServer = { getHTTPMethod: function getHTTPMethod(request) { if (this.fakeHTTPMethods && /post/i.test(request.method)) { var matches = (request.requestBody || "").match( - /_method=([^\b;]+)/ + /_method=([^\b;]+)/, ); return matches ? matches[1] : request.method; } @@ -536,7 +536,7 @@ var fakeServer = { } }, - logger: function() { + logger: function () { // no-op; override via configure() }, @@ -567,17 +567,27 @@ var fakeServer = { } // Escape port number to prevent "named" parameters in 'path-to-regexp' module - if (typeof url === "string" && url !== "" && /:[0-9]+\//.test(url)) { - var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/); - // eslint-disable-next-line no-param-reassign - url = `${m[1]}\\:${m[2]}`; + if (typeof url === "string" && url !== "") { + if (/:[0-9]+\//.test(url)) { + var m = url.match(/^(https?:\/\/.*?):([0-9]+\/.*)$/); + // eslint-disable-next-line no-param-reassign + url = `${m[1]}\\:${m[2]}`; + } + if (/:\/\//.test(url)) { + // eslint-disable-next-line no-param-reassign + url = url.replace("://", "\\://"); + } + if (/\*/.test(url)) { + // eslint-disable-next-line no-param-reassign + url = url.replace(/\/\*/g, "/(.*)"); + } } push.call(this.responses, { method: method, url: typeof url === "string" && url !== "" ? pathToRegexp(url) : url, - response: typeof body === "function" ? body : responseArray(body) + response: typeof body === "function" ? body : responseArray(body), }); }, @@ -590,7 +600,7 @@ var fakeServer = { var requests = queue.splice(0, queue.length); var self = this; - requests.forEach(function(request) { + requests.forEach(function (request) { self.processRequest(request); }); }, @@ -655,15 +665,23 @@ var fakeServer = { resetHistory: function resetHistory() { this.requests.length = this.requestCount = 0; - this.requestedOnce = this.requestedTwice = this.requestedThrice = this.requested = false; - - this.firstRequest = this.secondRequest = this.thirdRequest = this.lastRequest = null; - } + this.requestedOnce = + this.requestedTwice = + this.requestedThrice = + this.requested = + false; + + this.firstRequest = + this.secondRequest = + this.thirdRequest = + this.lastRequest = + null; + }, }; module.exports = fakeServer; -},{"../configure-logger":1,"../fake-xhr":11,"./log":9,"path-to-regexp":38}],9:[function(require,module,exports){ +},{"../configure-logger":1,"../fake-xhr":11,"./log":9,"path-to-regexp":54}],9:[function(require,module,exports){ "use strict"; var inspect = require("util").inspect; @@ -681,10 +699,10 @@ function log(response, request) { module.exports = log; -},{"util":42}],10:[function(require,module,exports){ +},{"util":60}],10:[function(require,module,exports){ "use strict"; -exports.isSupported = (function() { +exports.isSupported = (function () { try { return Boolean(new Blob()); } catch (e) { @@ -718,7 +736,7 @@ function getWorkingXHR(globalScope) { var supportsActiveX = typeof globalScope.ActiveXObject !== "undefined"; if (supportsActiveX) { - return function() { + return function () { return new globalScope.ActiveXObject("MSXML2.XMLHTTP.3.0"); }; } @@ -749,7 +767,7 @@ var unsafeHeaders = { "Transfer-Encoding": true, Upgrade: true, "User-Agent": true, - Via: true + Via: true, }; function EventTargetHandler() { @@ -761,11 +779,11 @@ function EventTargetHandler() { "error", "load", "timeout", - "loadend" + "loadend", ]; function addEventListener(eventName) { - self.addEventListener(eventName, function(event) { + self.addEventListener(eventName, function (event) { var listener = self[`on${eventName}`]; if (listener && typeof listener === "function") { @@ -786,7 +804,7 @@ function normalizeHeaderValue(value) { } function getHeader(headers, header) { - var foundHeader = Object.keys(headers).filter(function(h) { + var foundHeader = Object.keys(headers).filter(function (h) { return h.toLowerCase() === header.toLowerCase(); }); @@ -804,7 +822,7 @@ function verifyResponseBodyType(body, responseType) { if (responseType === "arraybuffer") { if (!isString && !(body instanceof ArrayBuffer)) { error = new Error( - `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.` + `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string or ArrayBuffer.`, ); error.name = "InvalidBodyException"; } @@ -816,13 +834,13 @@ function verifyResponseBodyType(body, responseType) { !(body instanceof Blob) ) { error = new Error( - `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.` + `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string, ArrayBuffer, or Blob.`, ); error.name = "InvalidBodyException"; } } else if (!isString) { error = new Error( - `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.` + `Attempted to respond to fake XMLHttpRequest with ${body}, which is not a string.`, ); error.name = "InvalidBodyException"; } @@ -915,7 +933,7 @@ function fakeXMLHttpRequestFor(globalScope) { } // largest arity in XHR is 5 - XHR#open - var apply = function(obj, method, args) { + var apply = function (obj, method, args) { switch (args.length) { case 0: return obj[method](); @@ -949,14 +967,14 @@ function fakeXMLHttpRequestFor(globalScope) { "getAllResponseHeaders", "addEventListener", "overrideMimeType", - "removeEventListener" - ].forEach(function(method) { - fakeXhr[method] = function() { + "removeEventListener", + ].forEach(function (method) { + fakeXhr[method] = function () { return apply(xhr, method, arguments); }; }); - fakeXhr.send = function() { + fakeXhr.send = function () { // Ref: https://xhr.spec.whatwg.org/#the-responsetype-attribute if (xhr.responseType !== fakeXhr.responseType) { xhr.responseType = fakeXhr.responseType; @@ -964,13 +982,13 @@ function fakeXMLHttpRequestFor(globalScope) { return apply(xhr, "send", arguments); }; - var copyAttrs = function(args) { - args.forEach(function(attr) { + var copyAttrs = function (args) { + args.forEach(function (attr) { fakeXhr[attr] = xhr[attr]; }); }; - var stateChangeStart = function() { + var stateChangeStart = function () { fakeXhr.readyState = xhr.readyState; if (xhr.readyState >= FakeXMLHttpRequest.HEADERS_RECEIVED) { copyAttrs(["status", "statusText"]); @@ -989,12 +1007,12 @@ function fakeXMLHttpRequestFor(globalScope) { } }; - var stateChangeEnd = function() { + var stateChangeEnd = function () { if (fakeXhr.onreadystatechange) { // eslint-disable-next-line no-useless-call fakeXhr.onreadystatechange.call(fakeXhr, { target: fakeXhr, - currentTarget: fakeXhr + currentTarget: fakeXhr, }); } }; @@ -1007,12 +1025,12 @@ function fakeXMLHttpRequestFor(globalScope) { if (xhr.addEventListener) { xhr.addEventListener("readystatechange", stateChangeStart); - Object.keys(fakeXhr.eventListeners).forEach(function(event) { + Object.keys(fakeXhr.eventListeners).forEach(function (event) { /*eslint-disable no-loop-func*/ - fakeXhr.eventListeners[event].forEach(function(handler) { + fakeXhr.eventListeners[event].forEach(function (handler) { xhr.addEventListener(event, handler.listener, { capture: handler.capture, - once: handler.once + once: handler.once, }); }); /*eslint-enable no-loop-func*/ @@ -1131,7 +1149,7 @@ function fakeXMLHttpRequestFor(globalScope) { return result.getElementsByTagNameNS( parsererrorNS, - "parsererror" + "parsererror", ).length ? null : result; @@ -1190,7 +1208,7 @@ function fakeXMLHttpRequestFor(globalScope) { 502: "Bad Gateway", 503: "Service Unavailable", 504: "Gateway Timeout", - 505: "HTTP Version Not Supported" + 505: "HTTP Version Not Supported", }; extend(FakeXMLHttpRequest.prototype, sinonEvent.EventTarget, { @@ -1208,7 +1226,7 @@ function fakeXMLHttpRequestFor(globalScope) { if (FakeXMLHttpRequest.useFilters === true) { var xhrArgs = arguments; - var defake = FakeXMLHttpRequest.filters.some(function(filter) { + var defake = FakeXMLHttpRequest.filters.some(function (filter) { return filter.apply(this, xhrArgs); }); if (defake) { @@ -1226,7 +1244,7 @@ function fakeXMLHttpRequestFor(globalScope) { "readystatechange", false, false, - this + this, ); if (typeof this.onreadystatechange === "function") { try { @@ -1254,25 +1272,29 @@ function fakeXMLHttpRequestFor(globalScope) { if (supportsProgress) { this.upload.dispatchEvent( - new sinonEvent.ProgressEvent("progress", progress, this) + new sinonEvent.ProgressEvent( + "progress", + progress, + this, + ), ); this.upload.dispatchEvent( - new sinonEvent.ProgressEvent(event, progress, this) + new sinonEvent.ProgressEvent(event, progress, this), ); this.upload.dispatchEvent( - new sinonEvent.ProgressEvent("loadend", progress, this) + new sinonEvent.ProgressEvent("loadend", progress, this), ); } this.dispatchEvent( - new sinonEvent.ProgressEvent("progress", progress, this) + new sinonEvent.ProgressEvent("progress", progress, this), ); this.dispatchEvent( - new sinonEvent.ProgressEvent(event, progress, this) + new sinonEvent.ProgressEvent(event, progress, this), ); this.dispatchEvent(readyStateChangeEvent); this.dispatchEvent( - new sinonEvent.ProgressEvent("loadend", progress, this) + new sinonEvent.ProgressEvent("loadend", progress, this), ); } }, @@ -1281,7 +1303,7 @@ function fakeXMLHttpRequestFor(globalScope) { setRequestHeader: function setRequestHeader(header, value) { if (typeof value !== "string") { throw new TypeError( - `By RFC7230, section 3.2.4, header values should be strings. Got ${typeof value}` + `By RFC7230, section 3.2.4, header values should be strings. Got ${typeof value}`, ); } verifyState(this); @@ -1298,7 +1320,7 @@ function fakeXMLHttpRequestFor(globalScope) { ) { throw new Error( // eslint-disable-next-line quotes - `Refused to set unsafe header "${header}"` + `Refused to set unsafe header "${header}"`, ); } @@ -1327,7 +1349,7 @@ function fakeXMLHttpRequestFor(globalScope) { var responseHeaders = (this.responseHeaders = {}); - Object.keys(headers).forEach(function(header) { + Object.keys(headers).forEach(function (header) { responseHeaders[header] = headers[header]; }); @@ -1345,13 +1367,12 @@ function fakeXMLHttpRequestFor(globalScope) { if (!/^(head)$/i.test(this.method)) { var contentType = getHeader( this.requestHeaders, - "Content-Type" + "Content-Type", ); if (this.requestHeaders[contentType]) { var value = this.requestHeaders[contentType].split(";"); - this.requestHeaders[ - contentType - ] = `${value[0]};charset=utf-8`; + this.requestHeaders[contentType] = + `${value[0]};charset=utf-8`; } else if (supportsFormData && !(data instanceof FormData)) { this.requestHeaders["Content-Type"] = "text/plain;charset=utf-8"; @@ -1382,7 +1403,7 @@ function fakeXMLHttpRequestFor(globalScope) { // is in flight, so we must check anytime the end user forces a clock tick to make // sure timeout hasn't changed. // https://xhr.spec.whatwg.org/#dfnReturnLink-2 - var clearIntervalId = setInterval(function() { + var clearIntervalId = setInterval(function () { // Check if the readyState has been reset or is done. If this is the case, there // should be no timeout. This will also prevent aborted requests and // fakeServerWithClock from triggering unnecessary responses. @@ -1404,7 +1425,7 @@ function fakeXMLHttpRequestFor(globalScope) { } this.dispatchEvent( - new sinonEvent.Event("loadstart", false, false, this) + new sinonEvent.Event("loadstart", false, false, this), ); }, @@ -1414,7 +1435,7 @@ function fakeXMLHttpRequestFor(globalScope) { this.readyState = FakeXMLHttpRequest.UNSENT; }, - error: function() { + error: function () { clearResponse(this); this.errorFlag = true; this.requestHeaders = {}; @@ -1453,7 +1474,7 @@ function fakeXMLHttpRequestFor(globalScope) { var responseHeaders = this.responseHeaders; var headers = Object.keys(responseHeaders) .filter(excludeSetCookie2Header) - .reduce(function(prev, header) { + .reduce(function (prev, header) { var value = responseHeaders[header]; return `${prev}${header}: ${value}\r\n`; @@ -1483,7 +1504,7 @@ function fakeXMLHttpRequestFor(globalScope) { if (isTextResponse) { this.responseText = this.response += body.substring( index, - index + chunkSize + index + chunkSize, ); } index += chunkSize; @@ -1493,7 +1514,7 @@ function fakeXMLHttpRequestFor(globalScope) { this.response = convertResponseBody( this.responseType, contentType, - body + body, ); if (isTextResponse) { this.responseText = this.response; @@ -1506,7 +1527,7 @@ function fakeXMLHttpRequestFor(globalScope) { isXmlContentType(contentType) ) { this.responseXML = FakeXMLHttpRequest.parseXML( - this.responseText + this.responseText, ); } this.readyStateChange(FakeXMLHttpRequest.DONE); @@ -1526,8 +1547,8 @@ function fakeXMLHttpRequestFor(globalScope) { new sinonEvent.ProgressEvent( "progress", progressEventRaw, - this.upload - ) + this.upload, + ), ); } }, @@ -1538,8 +1559,8 @@ function fakeXMLHttpRequestFor(globalScope) { new sinonEvent.ProgressEvent( "progress", progressEventRaw, - this - ) + this, + ), ); } }, @@ -1547,7 +1568,7 @@ function fakeXMLHttpRequestFor(globalScope) { uploadError: function uploadError(error) { if (supportsCustomEvent) { this.upload.dispatchEvent( - new sinonEvent.CustomEvent("error", { detail: error }) + new sinonEvent.CustomEvent("error", { detail: error }), ); } }, @@ -1557,7 +1578,7 @@ function fakeXMLHttpRequestFor(globalScope) { throw new Error("INVALID_STATE_ERR"); } this.overriddenMimeType = type; - } + }, }); var states = { @@ -1565,7 +1586,7 @@ function fakeXMLHttpRequestFor(globalScope) { OPENED: 1, HEADERS_RECEIVED: 2, LOADING: 3, - DONE: 4 + DONE: 4, }; extend(FakeXMLHttpRequest, states); @@ -1610,21 +1631,21 @@ function fakeXMLHttpRequestFor(globalScope) { return { xhr: sinonXhr, FakeXMLHttpRequest: FakeXMLHttpRequest, - useFakeXMLHttpRequest: useFakeXMLHttpRequest + useFakeXMLHttpRequest: useFakeXMLHttpRequest, }; } module.exports = extend(fakeXMLHttpRequestFor(globalObject), { - fakeXMLHttpRequestFor: fakeXMLHttpRequestFor + fakeXMLHttpRequestFor: fakeXMLHttpRequestFor, }); -},{"../configure-logger":1,"../event":5,"./blob":10,"@sinonjs/commons":19,"@sinonjs/text-encoding":33,"just-extend":37}],12:[function(require,module,exports){ +},{"../configure-logger":1,"../event":5,"./blob":10,"@sinonjs/commons":19,"@sinonjs/text-encoding":33,"just-extend":53}],12:[function(require,module,exports){ "use strict"; module.exports = { fakeServer: require("./fake-server"), fakeServerWithClock: require("./fake-server/fake-server-with-clock"), - fakeXhr: require("./fake-xhr") + fakeXhr: require("./fake-xhr"), }; },{"./fake-server":8,"./fake-server/fake-server-with-clock":7,"./fake-xhr":11}],13:[function(require,module,exports){ @@ -2045,7 +2066,7 @@ module.exports = function typeOf(value) { return type(value).toLowerCase(); }; -},{"type-detect":39}],31:[function(require,module,exports){ +},{"type-detect":57}],31:[function(require,module,exports){ "use strict"; /** @@ -2068,6 +2089,14 @@ module.exports = valueToString; "use strict"; const globalObject = require("@sinonjs/commons").global; +let timersModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } +} /** * @typedef {object} IdleDeadline @@ -2087,14 +2116,14 @@ const globalObject = require("@sinonjs/commons").global; /** * @callback NextTick * @param {VoidVarArgsFunc} callback - the callback to run - * @param {...*} arguments - optional arguments to call the callback with + * @param {...*} args - optional arguments to call the callback with * @returns {void} */ /** * @callback SetImmediate * @param {VoidVarArgsFunc} callback - the callback to run - * @param {...*} arguments - optional arguments to call the callback with + * @param {...*} args - optional arguments to call the callback with * @returns {NodeImmediate} */ @@ -2146,11 +2175,13 @@ const globalObject = require("@sinonjs/commons").global; * @property {function(): Promise} runToLastAsync * @property {function(): void} reset * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump * @property {Performance} performance * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) * @property {function(): void} uninstall Uninstall the clock. * @property {Function[]} methods - the methods that are faked * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods */ /* eslint-enable jsdoc/require-property-description */ @@ -2200,8 +2231,6 @@ const globalObject = require("@sinonjs/commons").global; * @returns {FakeTimers} */ function withGlobal(_global) { - const userAgent = _global.navigator && _global.navigator.userAgent; - const isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1; const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs const NOOP = function () { @@ -2243,29 +2272,12 @@ function withGlobal(_global) { typeof _global.cancelIdleCallback === "function"; const setImmediatePresent = _global.setImmediate && typeof _global.setImmediate === "function"; - - // Make properties writable in IE, as per - // https://www.adequatelygood.com/Replacing-setTimeout-Globally.html - /* eslint-disable no-self-assign */ - if (isRunningInIE) { - _global.setTimeout = _global.setTimeout; - _global.clearTimeout = _global.clearTimeout; - _global.setInterval = _global.setInterval; - _global.clearInterval = _global.clearInterval; - _global.Date = _global.Date; - } - - // setImmediate is not a standard function - // avoid adding the prop to the window object if not present - if (setImmediatePresent) { - _global.setImmediate = _global.setImmediate; - _global.clearImmediate = _global.clearImmediate; - } - /* eslint-enable no-self-assign */ + const intlPresent = _global.Intl && typeof _global.Intl === "object"; _global.clearTimeout(timeoutResult); const NativeDate = _global.Date; + const NativeIntl = _global.Intl; let uniqueTimerId = idCounterStart; /** @@ -2320,7 +2332,7 @@ function withGlobal(_global) { if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { throw new Error( - "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits" + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", ); } @@ -2389,7 +2401,7 @@ function withGlobal(_global) { */ function getInfiniteLoopError(clock, job) { const infiniteLoopError = new Error( - `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!` + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, ); if (!job.error) { @@ -2399,13 +2411,13 @@ function withGlobal(_global) { // pattern never matched in Node const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; let clockMethodPattern = new RegExp( - String(Object.keys(clock).join("|")) + String(Object.keys(clock).join("|")), ); if (addTimerReturnsObject) { // node.js environment clockMethodPattern = new RegExp( - `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+` + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, ); } @@ -2539,7 +2551,7 @@ function withGlobal(_global) { date, hour, minute, - second + second, ); default: return new NativeDate( @@ -2549,7 +2561,7 @@ function withGlobal(_global) { hour, minute, second, - ms + ms, ); } } @@ -2557,6 +2569,55 @@ function withGlobal(_global) { return mirrorDateProperties(ClockDate, NativeDate); } + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. + */ + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); + + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; + + return ClockIntl; + } + //eslint-disable-next-line jsdoc/require-jsdoc function enqueueJob(clock, job) { // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob @@ -2601,7 +2662,7 @@ function withGlobal(_global) { throw new TypeError( `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ timer.func - } of type ${typeof timer.func}` + } of type ${typeof timer.func}`, ); } } @@ -2884,7 +2945,7 @@ function withGlobal(_global) { } warnOnce( `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + - "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`." + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", ); } @@ -2901,7 +2962,7 @@ function withGlobal(_global) { const clear = getClearHandler(ttype); const schedule = getScheduleHandler(timer.type); throw new Error( - `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()` + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, ); } } @@ -2926,7 +2987,7 @@ function withGlobal(_global) { } else if (method === "performance") { const originalPerfDescriptor = Object.getOwnPropertyDescriptor( clock, - `_${method}` + `_${method}`, ); if ( originalPerfDescriptor && @@ -2936,7 +2997,7 @@ function withGlobal(_global) { Object.defineProperty( _global, method, - originalPerfDescriptor + originalPerfDescriptor, ); } else if (originalPerfDescriptor.configurable) { _global[method] = clock[`_${method}`]; @@ -2952,6 +3013,12 @@ function withGlobal(_global) { } } } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } } if (config.shouldAdvanceTime === true) { @@ -2978,17 +3045,19 @@ function withGlobal(_global) { function hijackMethod(target, method, clock) { clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( target, - method + method, ); clock[`_${method}`] = target[method]; if (method === "Date") { const date = mirrorDateProperties(clock[method], target[method]); target[method] = date; + } else if (method === "Intl") { + target[method] = clock[method]; } else if (method === "performance") { const originalPerfDescriptor = Object.getOwnPropertyDescriptor( target, - method + method, ); // JSDOM has a read only performance field so we have to save/copy it differently if ( @@ -2999,12 +3068,12 @@ function withGlobal(_global) { Object.defineProperty( clock, `_${method}`, - originalPerfDescriptor + originalPerfDescriptor, ); const perfDescriptor = Object.getOwnPropertyDescriptor( clock, - method + method, ); Object.defineProperty(target, method, perfDescriptor); } else { @@ -3017,7 +3086,7 @@ function withGlobal(_global) { Object.defineProperties( target[method], - Object.getOwnPropertyDescriptors(clock[method]) + Object.getOwnPropertyDescriptors(clock[method]), ); } @@ -3039,6 +3108,7 @@ function withGlobal(_global) { * @property {setInterval} setInterval * @property {clearInterval} clearInterval * @property {Date} Date + * @property {Intl} Intl * @property {SetImmediate=} setImmediate * @property {function(NodeImmediate): void=} clearImmediate * @property {function(number[]):number[]=} hrtime @@ -3097,6 +3167,10 @@ function withGlobal(_global) { timers.cancelIdleCallback = _global.cancelIdleCallback; } + if (intlPresent) { + timers.Intl = _global.Intl; + } + const originalSetTimeout = _global.setImmediate || _global.setTimeout; /** @@ -3115,7 +3189,7 @@ function withGlobal(_global) { if (NativeDate === undefined) { throw new Error( "The global scope doesn't have a `Date` object" + - " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)" + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", ); } @@ -3144,7 +3218,7 @@ function withGlobal(_global) { if (Array.isArray(prev)) { if (prev[1] > 1e9) { throw new TypeError( - "Number of nanoseconds can't exceed a billion" + "Number of nanoseconds can't exceed a billion", ); } @@ -3162,6 +3236,17 @@ function withGlobal(_global) { return [secsSinceStart, remainderInNanos]; } + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ function fakePerformanceNow() { const hrt = hrtime(); const millis = hrt[0] * 1000 + hrt[1] / 1e6; @@ -3175,9 +3260,14 @@ function withGlobal(_global) { }; } + if (intlPresent) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + clock.requestIdleCallback = function requestIdleCallback( func, - timeout + timeout, ) { let timeToNextIdlePeriod = 0; @@ -3213,7 +3303,7 @@ function withGlobal(_global) { clock.setTimeout[utilPromisify.custom] = function promisifiedSetTimeout(timeout, arg) { return new _global.Promise(function setTimeoutExecutor( - resolve + resolve, ) { addTimer(clock, { func: resolve, @@ -3274,7 +3364,7 @@ function withGlobal(_global) { args: [arg], immediate: true, }); - } + }, ); }; } @@ -3576,6 +3666,8 @@ function withGlobal(_global) { function doRun() { originalSetTimeout(function () { try { + runJobs(clock); + let numTimers; if (i < clock.loopLimit) { if (!clock.timers) { @@ -3585,7 +3677,7 @@ function withGlobal(_global) { } numTimers = Object.keys( - clock.timers + clock.timers, ).length; if (numTimers === 0) { resetIsNearInfiniteLimit(); @@ -3631,6 +3723,7 @@ function withGlobal(_global) { try { const timer = lastTimer(clock); if (!timer) { + runJobs(clock); resolve(clock.now); } @@ -3672,6 +3765,25 @@ function withGlobal(_global) { } }; + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.jump = function jump(tickValue) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + + for (const timer of Object.values(clock.timers)) { + if (clock.now + ms > timer.callAt) { + timer.callAt = clock.now + ms; + } + } + clock.tick(ms); + }; + if (performancePresent) { clock.performance = Object.create(null); clock.performance.now = fakePerformanceNow; @@ -3699,8 +3811,8 @@ function withGlobal(_global) { ) { throw new TypeError( `FakeTimers.install called with ${String( - config - )} install requires an object parameter` + config, + )} install requires an object parameter`, ); } @@ -3708,7 +3820,7 @@ function withGlobal(_global) { // Timers are already faked; this is a problem. // Make the user reset timers before continuing. throw new TypeError( - "Can't install fake timers twice on the same global object." + "Can't install fake timers twice on the same global object.", ); } @@ -3721,7 +3833,7 @@ function withGlobal(_global) { if (config.target) { throw new TypeError( - "config.target is no longer supported. Use `withGlobal(target)` instead." + "config.target is no longer supported. Use `withGlobal(target)` instead.", ); } @@ -3746,23 +3858,23 @@ function withGlobal(_global) { const intervalTick = doIntervalTick.bind( null, clock, - config.advanceTimeDelta + config.advanceTimeDelta, ); const intervalId = _global.setInterval( intervalTick, - config.advanceTimeDelta + config.advanceTimeDelta, ); clock.attachedInterval = intervalId; } if (clock.methods.includes("performance")) { const proto = (() => { - if (hasPerformancePrototype) { - return _global.Performance.prototype; - } if (hasPerformanceConstructorPrototype) { return _global.performance.constructor.prototype; } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } })(); if (proto) { Object.getOwnPropertyNames(proto).forEach(function (name) { @@ -3776,11 +3888,13 @@ function withGlobal(_global) { } else if ((config.toFake || []).includes("performance")) { // user explicitly tried to fake performance when not present throw new ReferenceError( - "non-existent performance object cannot be faked" + "non-existent performance object cannot be faked", ); } } - + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } for (i = 0, l = clock.methods.length; i < l; i++) { const nameOfMethodToReplace = clock.methods[i]; if (nameOfMethodToReplace === "hrtime") { @@ -3800,6 +3914,18 @@ function withGlobal(_global) { } else { hijackMethod(_global, nameOfMethodToReplace, clock); } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } } return clock; @@ -3833,7 +3959,7 @@ exports.createClock = defaultImplementation.createClock; exports.install = defaultImplementation.install; exports.withGlobal = withGlobal; -},{"@sinonjs/commons":19,"util":42}],33:[function(require,module,exports){ +},{"@sinonjs/commons":19,"timers":56,"util":60}],33:[function(require,module,exports){ // This is free and unencumbered software released into the public domain. // See LICENSE.md for more information. @@ -7207,11 +7333,897 @@ module.exports = { // is `undefined`, take a pure object instead }(this || {})); },{"./encoding-indexes.js":34}],36:[function(require,module,exports){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; +'use strict'; + +var possibleNames = [ + 'BigInt64Array', + 'BigUint64Array', + 'Float32Array', + 'Float64Array', + 'Int16Array', + 'Int32Array', + 'Int8Array', + 'Uint16Array', + 'Uint32Array', + 'Uint8Array', + 'Uint8ClampedArray' +]; + +var g = typeof globalThis === 'undefined' ? global : globalThis; + +module.exports = function availableTypedArrays() { + var out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + out[out.length] = possibleNames[i]; + } + } + return out; }; },{}],37:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; + +},{"./":38,"get-intrinsic":42}],38:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); +var GetIntrinsic = require('get-intrinsic'); + +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $max = GetIntrinsic('%Math.max%'); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind(originalFunction) { + var func = $reflectApply(bind, $call, arguments); + if ($gOPD && $defineProperty) { + var desc = $gOPD(func, 'length'); + if (desc.configurable) { + // original length, plus the receiver, minus any additional arguments (after the receiver) + $defineProperty( + func, + 'length', + { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } + ); + } + } + return func; +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} + +},{"function-bind":41,"get-intrinsic":42}],39:[function(require,module,exports){ +'use strict'; + +var isCallable = require('is-callable'); + +var toStr = Object.prototype.toString; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var forEachArray = function forEachArray(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } + } +}; + +var forEachString = function forEachString(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + // no such thing as a sparse string. + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } +}; + +var forEachObject = function forEachObject(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); + } + } + } +}; + +var forEach = function forEach(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError('iterator must be a function'); + } + + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + + if (toStr.call(list) === '[object Array]') { + forEachArray(list, iterator, receiver); + } else if (typeof list === 'string') { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } +}; + +module.exports = forEach; + +},{"is-callable":50}],40:[function(require,module,exports){ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + +},{}],41:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; + +},{"./implementation":40}],42:[function(require,module,exports){ +'use strict'; + +var undefined; + +var $SyntaxError = SyntaxError; +var $Function = Function; +var $TypeError = TypeError; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var needsEval = {}; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': Object, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%ReferenceError%': ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet +}; + +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen) { + value = getProto(gen.prototype); + } + } + + INTRINSICS[name] = value; + + return value; +}; + +var LEGACY_ALIASES = { + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = require('function-bind'); +var hasOwn = require('has'); +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); +var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ( + ( + (first === '"' || first === "'" || first === '`') + || (last === '"' || last === "'" || last === '`') + ) + && first !== last + ) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; + +},{"function-bind":41,"has":47,"has-symbols":44}],43:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + +},{"get-intrinsic":42}],44:[function(require,module,exports){ +'use strict'; + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = require('./shams'); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + +},{"./shams":45}],45:[function(require,module,exports){ +'use strict'; + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + +},{}],46:[function(require,module,exports){ +'use strict'; + +var hasSymbols = require('has-symbols/shams'); + +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; + +},{"has-symbols/shams":45}],47:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); + +},{"function-bind":41}],48:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + +},{}],49:[function(require,module,exports){ +'use strict'; + +var hasToStringTag = require('has-tostringtag/shams')(); +var callBound = require('call-bind/callBound'); + +var $toString = callBound('Object.prototype.toString'); + +var isStandardArguments = function isArguments(value) { + if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) { + return false; + } + return $toString(value) === '[object Arguments]'; +}; + +var isLegacyArguments = function isArguments(value) { + if (isStandardArguments(value)) { + return true; + } + return value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + $toString(value) !== '[object Array]' && + $toString(value.callee) === '[object Function]'; +}; + +var supportsStandardArguments = (function () { + return isStandardArguments(arguments); +}()); + +isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests + +module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; + +},{"call-bind/callBound":37,"has-tostringtag/shams":46}],50:[function(require,module,exports){ +'use strict'; + +var fnToStr = Function.prototype.toString; +var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; +var badArrayLike; +var isCallableMarker; +if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { + try { + badArrayLike = Object.defineProperty({}, 'length', { + get: function () { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + // eslint-disable-next-line no-throw-literal + reflectApply(function () { throw 42; }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } +} else { + reflectApply = null; +} + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; +/* globals document: false */ +var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {}; + +module.exports = reflectApply + ? function isCallable(value) { + if (value === documentDotAll) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { return false; } + } + return !isES6ClassFn(value); + } + : function isCallable(value) { + if (value === documentDotAll) { return true; } + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + return strClass === fnClass || strClass === genClass; + }; + +},{}],51:[function(require,module,exports){ +'use strict'; + +var toStr = Object.prototype.toString; +var fnToStr = Function.prototype.toString; +var isFnRegex = /^\s*(?:function)?\*/; +var hasToStringTag = require('has-tostringtag/shams')(); +var getProto = Object.getPrototypeOf; +var getGeneratorFunc = function () { // eslint-disable-line consistent-return + if (!hasToStringTag) { + return false; + } + try { + return Function('return function*() {}')(); + } catch (e) { + } +}; +var GeneratorFunction; + +module.exports = function isGeneratorFunction(fn) { + if (typeof fn !== 'function') { + return false; + } + if (isFnRegex.test(fnToStr.call(fn))) { + return true; + } + if (!hasToStringTag) { + var str = toStr.call(fn); + return str === '[object GeneratorFunction]'; + } + if (!getProto) { + return false; + } + if (typeof GeneratorFunction === 'undefined') { + var generatorFunc = getGeneratorFunc(); + GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; + } + return getProto(fn) === GeneratorFunction; +}; + +},{"has-tostringtag/shams":46}],52:[function(require,module,exports){ +'use strict'; + +var forEach = require('for-each'); +var availableTypedArrays = require('available-typed-arrays'); +var callBound = require('call-bind/callBound'); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = require('has-tostringtag/shams')(); +var gOPD = require('gopd'); + +var g = typeof globalThis === 'undefined' ? global : globalThis; +var typedArrays = availableTypedArrays(); + +var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; +}; +var $slice = callBound('String.prototype.slice'); +var toStrTags = {}; +var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); +if (hasToStringTag && gOPD && getPrototypeOf) { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + toStrTags[typedArray] = descriptor.get; + } + }); +} + +var tryTypedArrays = function tryAllTypedArrays(value) { + var anyTrue = false; + forEach(toStrTags, function (getter, typedArray) { + if (!anyTrue) { + try { + anyTrue = getter.call(value) === typedArray; + } catch (e) { /**/ } + } + }); + return anyTrue; +}; + +module.exports = function isTypedArray(value) { + if (!value || typeof value !== 'object') { return false; } + if (!hasToStringTag || !(Symbol.toStringTag in value)) { + var tag = $slice($toString(value), 8, -1); + return $indexOf(typedArrays, tag) > -1; + } + if (!gOPD) { return false; } + return tryTypedArrays(value); +}; + +},{"available-typed-arrays":36,"call-bind/callBound":37,"for-each":39,"gopd":43,"has-tostringtag/shams":46}],53:[function(require,module,exports){ module.exports = extend; /* @@ -7285,435 +8297,681 @@ function isUnextendable(val) { return !val || (typeof val != 'object' && typeof val != 'function'); } -},{}],38:[function(require,module,exports){ -var isarray = require('isarray') - -/** - * Expose `pathToRegexp`. - */ -module.exports = pathToRegexp -module.exports.parse = parse -module.exports.compile = compile -module.exports.tokensToFunction = tokensToFunction -module.exports.tokensToRegExp = tokensToRegExp - +},{}],54:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pathToRegexp = exports.tokensToRegexp = exports.regexpToFunction = exports.match = exports.tokensToFunction = exports.compile = exports.parse = void 0; /** - * The main path matching regexp utility. - * - * @type {RegExp} + * Tokenize input string. */ -var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g') - +function lexer(str) { + var tokens = []; + var i = 0; + while (i < str.length) { + var char = str[i]; + if (char === "*" || char === "+" || char === "?") { + tokens.push({ type: "MODIFIER", index: i, value: str[i++] }); + continue; + } + if (char === "\\") { + tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] }); + continue; + } + if (char === "{") { + tokens.push({ type: "OPEN", index: i, value: str[i++] }); + continue; + } + if (char === "}") { + tokens.push({ type: "CLOSE", index: i, value: str[i++] }); + continue; + } + if (char === ":") { + var name = ""; + var j = i + 1; + while (j < str.length) { + var code = str.charCodeAt(j); + if ( + // `0-9` + (code >= 48 && code <= 57) || + // `A-Z` + (code >= 65 && code <= 90) || + // `a-z` + (code >= 97 && code <= 122) || + // `_` + code === 95) { + name += str[j++]; + continue; + } + break; + } + if (!name) + throw new TypeError("Missing parameter name at ".concat(i)); + tokens.push({ type: "NAME", index: i, value: name }); + i = j; + continue; + } + if (char === "(") { + var count = 1; + var pattern = ""; + var j = i + 1; + if (str[j] === "?") { + throw new TypeError("Pattern cannot start with \"?\" at ".concat(j)); + } + while (j < str.length) { + if (str[j] === "\\") { + pattern += str[j++] + str[j++]; + continue; + } + if (str[j] === ")") { + count--; + if (count === 0) { + j++; + break; + } + } + else if (str[j] === "(") { + count++; + if (str[j + 1] !== "?") { + throw new TypeError("Capturing groups are not allowed at ".concat(j)); + } + } + pattern += str[j++]; + } + if (count) + throw new TypeError("Unbalanced pattern at ".concat(i)); + if (!pattern) + throw new TypeError("Missing pattern at ".concat(i)); + tokens.push({ type: "PATTERN", index: i, value: pattern }); + i = j; + continue; + } + tokens.push({ type: "CHAR", index: i, value: str[i++] }); + } + tokens.push({ type: "END", index: i, value: "" }); + return tokens; +} /** * Parse a string for the raw tokens. - * - * @param {string} str - * @param {Object=} options - * @return {!Array} */ -function parse (str, options) { - var tokens = [] - var key = 0 - var index = 0 - var path = '' - var defaultDelimiter = options && options.delimiter || '/' - var res - - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0] - var escaped = res[1] - var offset = res.index - path += str.slice(index, offset) - index = offset + m.length - - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1] - continue - } - - var next = str[index] - var prefix = res[2] - var name = res[3] - var capture = res[4] - var group = res[5] - var modifier = res[6] - var asterisk = res[7] - - // Push the current path onto the tokens. - if (path) { - tokens.push(path) - path = '' - } - - var partial = prefix != null && next != null && next !== prefix - var repeat = modifier === '+' || modifier === '*' - var optional = modifier === '?' || modifier === '*' - var delimiter = res[2] || defaultDelimiter - var pattern = capture || group - - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - partial: partial, - asterisk: !!asterisk, - pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') - }) - } - - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index) - } - - // If the path exists, push it onto the end. - if (path) { - tokens.push(path) - } - - return tokens +function parse(str, options) { + if (options === void 0) { options = {}; } + var tokens = lexer(str); + var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a; + var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?"); + var result = []; + var key = 0; + var i = 0; + var path = ""; + var tryConsume = function (type) { + if (i < tokens.length && tokens[i].type === type) + return tokens[i++].value; + }; + var mustConsume = function (type) { + var value = tryConsume(type); + if (value !== undefined) + return value; + var _a = tokens[i], nextType = _a.type, index = _a.index; + throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); + }; + var consumeText = function () { + var result = ""; + var value; + while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) { + result += value; + } + return result; + }; + while (i < tokens.length) { + var char = tryConsume("CHAR"); + var name = tryConsume("NAME"); + var pattern = tryConsume("PATTERN"); + if (name || pattern) { + var prefix = char || ""; + if (prefixes.indexOf(prefix) === -1) { + path += prefix; + prefix = ""; + } + if (path) { + result.push(path); + path = ""; + } + result.push({ + name: name || key++, + prefix: prefix, + suffix: "", + pattern: pattern || defaultPattern, + modifier: tryConsume("MODIFIER") || "", + }); + continue; + } + var value = char || tryConsume("ESCAPED_CHAR"); + if (value) { + path += value; + continue; + } + if (path) { + result.push(path); + path = ""; + } + var open = tryConsume("OPEN"); + if (open) { + var prefix = consumeText(); + var name_1 = tryConsume("NAME") || ""; + var pattern_1 = tryConsume("PATTERN") || ""; + var suffix = consumeText(); + mustConsume("CLOSE"); + result.push({ + name: name_1 || (pattern_1 ? key++ : ""), + pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1, + prefix: prefix, + suffix: suffix, + modifier: tryConsume("MODIFIER") || "", + }); + continue; + } + mustConsume("END"); + } + return result; } - +exports.parse = parse; /** * Compile a string to a template function for the path. - * - * @param {string} str - * @param {Object=} options - * @return {!function(Object=, Object=)} - */ -function compile (str, options) { - return tokensToFunction(parse(str, options), options) -} - -/** - * Prettier encoding of URI path segments. - * - * @param {string} - * @return {string} */ -function encodeURIComponentPretty (str) { - return encodeURI(str).replace(/[\/?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) +function compile(str, options) { + return tokensToFunction(parse(str, options), options); } - -/** - * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. - * - * @param {string} - * @return {string} - */ -function encodeAsterisk (str) { - return encodeURI(str).replace(/[?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} - +exports.compile = compile; /** * Expose a method for transforming tokens into the path function. */ -function tokensToFunction (tokens, options) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length) - - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)) - } - } - - return function (obj, opts) { - var path = '' - var data = obj || {} - var options = opts || {} - var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] - - if (typeof token === 'string') { - path += token - - continue - } - - var value = data[token.name] - var segment - - if (value == null) { - if (token.optional) { - // Prepend partial segment prefixes. - if (token.partial) { - path += token.prefix - } - - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } - - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') - } - - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } +function tokensToFunction(tokens, options) { + if (options === void 0) { options = {}; } + var reFlags = flags(options); + var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; + // Compile all the tokens into regexps. + var matches = tokens.map(function (token) { + if (typeof token === "object") { + return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags); } - - for (var j = 0; j < value.length; j++) { - segment = encode(value[j]) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') - } - - path += (j === 0 ? token.prefix : token.delimiter) + segment + }); + return function (data) { + var path = ""; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (typeof token === "string") { + path += token; + continue; + } + var value = data ? data[token.name] : undefined; + var optional = token.modifier === "?" || token.modifier === "*"; + var repeat = token.modifier === "*" || token.modifier === "+"; + if (Array.isArray(value)) { + if (!repeat) { + throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array")); + } + if (value.length === 0) { + if (optional) + continue; + throw new TypeError("Expected \"".concat(token.name, "\" to not be empty")); + } + for (var j = 0; j < value.length; j++) { + var segment = encode(value[j], token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); + } + path += token.prefix + segment + token.suffix; + } + continue; + } + if (typeof value === "string" || typeof value === "number") { + var segment = encode(String(value), token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); + } + path += token.prefix + segment + token.suffix; + continue; + } + if (optional) + continue; + var typeOfMessage = repeat ? "an array" : "a string"; + throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage)); } - - continue - } - - segment = token.asterisk ? encodeAsterisk(value) : encode(value) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += token.prefix + segment - } - - return path - } + return path; + }; } - +exports.tokensToFunction = tokensToFunction; /** - * Escape a regular expression string. - * - * @param {string} str - * @return {string} + * Create path match function from `path-to-regexp` spec. */ -function escapeString (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') +function match(str, options) { + var keys = []; + var re = pathToRegexp(str, keys, options); + return regexpToFunction(re, keys, options); } - +exports.match = match; /** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {string} group - * @return {string} + * Create a path match function from `path-to-regexp` output. */ -function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') +function regexpToFunction(re, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a; + return function (pathname) { + var m = re.exec(pathname); + if (!m) + return false; + var path = m[0], index = m.index; + var params = Object.create(null); + var _loop_1 = function (i) { + if (m[i] === undefined) + return "continue"; + var key = keys[i - 1]; + if (key.modifier === "*" || key.modifier === "+") { + params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) { + return decode(value, key); + }); + } + else { + params[key.name] = decode(m[i], key); + } + }; + for (var i = 1; i < m.length; i++) { + _loop_1(i); + } + return { path: path, index: index, params: params }; + }; } - +exports.regexpToFunction = regexpToFunction; /** - * Attach the keys as a property of the regexp. - * - * @param {!RegExp} re - * @param {Array} keys - * @return {!RegExp} + * Escape a regular expression string. */ -function attachKeys (re, keys) { - re.keys = keys - return re +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); } - /** * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {string} */ -function flags (options) { - return options && options.sensitive ? '' : 'i' +function flags(options) { + return options && options.sensitive ? "" : "i"; } - /** * Pull out keys from a regexp. - * - * @param {!RegExp} path - * @param {!Array} keys - * @return {!RegExp} */ -function regexpToRegexp (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g) - - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - partial: false, - asterisk: false, - pattern: null - }) +function regexpToRegexp(path, keys) { + if (!keys) + return path; + var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; + var index = 0; + var execResult = groupsRegex.exec(path.source); + while (execResult) { + keys.push({ + // Use parenthesized substring match if available, index otherwise + name: execResult[1] || index++, + prefix: "", + suffix: "", + modifier: "", + pattern: "", + }); + execResult = groupsRegex.exec(path.source); } - } - - return attachKeys(path, keys) + return path; } - /** * Transform an array into a regexp. - * - * @param {!Array} path - * @param {Array} keys - * @param {!Object} options - * @return {!RegExp} */ -function arrayToRegexp (path, keys, options) { - var parts = [] - - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp(path[i], keys, options).source) - } - - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) - - return attachKeys(regexp, keys) +function arrayToRegexp(paths, keys, options) { + var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; }); + return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options)); } - /** * Create a path regexp from string input. - * - * @param {string} path - * @param {!Array} keys - * @param {!Object} options - * @return {!RegExp} */ -function stringToRegexp (path, keys, options) { - return tokensToRegExp(parse(path, options), keys, options) +function stringToRegexp(path, keys, options) { + return tokensToRegexp(parse(path, options), keys, options); } - /** * Expose a function for taking tokens and returning a RegExp. + */ +function tokensToRegexp(tokens, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f; + var endsWithRe = "[".concat(escapeString(endsWith), "]|$"); + var delimiterRe = "[".concat(escapeString(delimiter), "]"); + var route = start ? "^" : ""; + // Iterate over the tokens and create our regexp string. + for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { + var token = tokens_1[_i]; + if (typeof token === "string") { + route += escapeString(encode(token)); + } + else { + var prefix = escapeString(encode(token.prefix)); + var suffix = escapeString(encode(token.suffix)); + if (token.pattern) { + if (keys) + keys.push(token); + if (prefix || suffix) { + if (token.modifier === "+" || token.modifier === "*") { + var mod = token.modifier === "*" ? "?" : ""; + route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod); + } + else { + route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier); + } + } + else { + if (token.modifier === "+" || token.modifier === "*") { + route += "((?:".concat(token.pattern, ")").concat(token.modifier, ")"); + } + else { + route += "(".concat(token.pattern, ")").concat(token.modifier); + } + } + } + else { + route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier); + } + } + } + if (end) { + if (!strict) + route += "".concat(delimiterRe, "?"); + route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); + } + else { + var endToken = tokens[tokens.length - 1]; + var isEndDelimited = typeof endToken === "string" + ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 + : endToken === undefined; + if (!strict) { + route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); + } + if (!isEndDelimited) { + route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); + } + } + return new RegExp(route, flags(options)); +} +exports.tokensToRegexp = tokensToRegexp; +/** + * Normalize the given path string, returning a regular expression. * - * @param {!Array} tokens - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. */ -function tokensToRegExp (tokens, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } +function pathToRegexp(path, keys, options) { + if (path instanceof RegExp) + return regexpToRegexp(path, keys); + if (Array.isArray(path)) + return arrayToRegexp(path, keys, options); + return stringToRegexp(path, keys, options); +} +exports.pathToRegexp = pathToRegexp; - options = options || {} +},{}],55:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; - var strict = options.strict - var end = options.end !== false - var route = '' +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] +var cachedSetTimeout; +var cachedClearTimeout; - if (typeof token === 'string') { - route += escapeString(token) - } else { - var prefix = escapeString(token.prefix) - var capture = '(?:' + token.pattern + ')' +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } - keys.push(token) - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*' - } +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } - if (token.optional) { - if (!token.partial) { - capture = '(?:' + prefix + '(' + capture + '))?' - } else { - capture = prefix + '(' + capture + ')?' + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } } - } else { - capture = prefix + '(' + capture + ')' - } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} - route += capture +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } } - } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; - var delimiter = escapeString(options.delimiter || '/') - var endsWithDelimiter = route.slice(-delimiter.length) === delimiter +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' - } +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; - if (end) { - route += '$' - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' - } +},{}],56:[function(require,module,exports){ +var nextTick = require('process/browser.js').nextTick; +var apply = Function.prototype.apply; +var slice = Array.prototype.slice; +var immediateIds = {}; +var nextImmediateId = 0; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { timeout.close(); }; - return attachKeys(new RegExp('^' + route, flags(options)), keys) +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; } +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(window, this._id); +}; -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(string|RegExp|Array)} path - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function pathToRegexp (path, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; - options = options || {} +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; - if (path instanceof RegExp) { - return regexpToRegexp(path, /** @type {!Array} */ (keys)) - } +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); - if (isarray(path)) { - return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); } +}; - return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) -} +// That's not how node.js implements it but the exposed api is the same. +exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + + immediateIds[id] = true; + + nextTick(function onNextTick() { + if (immediateIds[id]) { + // fn.call() is faster so we optimize for the common use-case + // @see http://jsperf.com/call-apply-segu + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + // Prevent ids from leaking + exports.clearImmediate(id); + } + }); -},{"isarray":36}],39:[function(require,module,exports){ + return id; +}; + +exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { + delete immediateIds[id]; +}; +},{"process/browser.js":55}],57:[function(require,module,exports){ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -8103,39 +9361,350 @@ return typeDetect; }))); -},{}],40:[function(require,module,exports){ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} - -},{}],41:[function(require,module,exports){ +},{}],58:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],42:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ +// Currently in sync with Node.js lib/internal/util/types.js +// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 + +'use strict'; + +var isArgumentsObject = require('is-arguments'); +var isGeneratorFunction = require('is-generator-function'); +var whichTypedArray = require('which-typed-array'); +var isTypedArray = require('is-typed-array'); + +function uncurryThis(f) { + return f.call.bind(f); +} + +var BigIntSupported = typeof BigInt !== 'undefined'; +var SymbolSupported = typeof Symbol !== 'undefined'; + +var ObjectToString = uncurryThis(Object.prototype.toString); + +var numberValue = uncurryThis(Number.prototype.valueOf); +var stringValue = uncurryThis(String.prototype.valueOf); +var booleanValue = uncurryThis(Boolean.prototype.valueOf); + +if (BigIntSupported) { + var bigIntValue = uncurryThis(BigInt.prototype.valueOf); +} + +if (SymbolSupported) { + var symbolValue = uncurryThis(Symbol.prototype.valueOf); +} + +function checkBoxedPrimitive(value, prototypeValueOf) { + if (typeof value !== 'object') { + return false; + } + try { + prototypeValueOf(value); + return true; + } catch(e) { + return false; + } +} + +exports.isArgumentsObject = isArgumentsObject; +exports.isGeneratorFunction = isGeneratorFunction; +exports.isTypedArray = isTypedArray; + +// Taken from here and modified for better browser support +// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js +function isPromise(input) { + return ( + ( + typeof Promise !== 'undefined' && + input instanceof Promise + ) || + ( + input !== null && + typeof input === 'object' && + typeof input.then === 'function' && + typeof input.catch === 'function' + ) + ); +} +exports.isPromise = isPromise; + +function isArrayBufferView(value) { + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + return ArrayBuffer.isView(value); + } + + return ( + isTypedArray(value) || + isDataView(value) + ); +} +exports.isArrayBufferView = isArrayBufferView; + + +function isUint8Array(value) { + return whichTypedArray(value) === 'Uint8Array'; +} +exports.isUint8Array = isUint8Array; + +function isUint8ClampedArray(value) { + return whichTypedArray(value) === 'Uint8ClampedArray'; +} +exports.isUint8ClampedArray = isUint8ClampedArray; + +function isUint16Array(value) { + return whichTypedArray(value) === 'Uint16Array'; +} +exports.isUint16Array = isUint16Array; + +function isUint32Array(value) { + return whichTypedArray(value) === 'Uint32Array'; +} +exports.isUint32Array = isUint32Array; + +function isInt8Array(value) { + return whichTypedArray(value) === 'Int8Array'; +} +exports.isInt8Array = isInt8Array; + +function isInt16Array(value) { + return whichTypedArray(value) === 'Int16Array'; +} +exports.isInt16Array = isInt16Array; + +function isInt32Array(value) { + return whichTypedArray(value) === 'Int32Array'; +} +exports.isInt32Array = isInt32Array; + +function isFloat32Array(value) { + return whichTypedArray(value) === 'Float32Array'; +} +exports.isFloat32Array = isFloat32Array; + +function isFloat64Array(value) { + return whichTypedArray(value) === 'Float64Array'; +} +exports.isFloat64Array = isFloat64Array; + +function isBigInt64Array(value) { + return whichTypedArray(value) === 'BigInt64Array'; +} +exports.isBigInt64Array = isBigInt64Array; + +function isBigUint64Array(value) { + return whichTypedArray(value) === 'BigUint64Array'; +} +exports.isBigUint64Array = isBigUint64Array; + +function isMapToString(value) { + return ObjectToString(value) === '[object Map]'; +} +isMapToString.working = ( + typeof Map !== 'undefined' && + isMapToString(new Map()) +); + +function isMap(value) { + if (typeof Map === 'undefined') { + return false; + } + + return isMapToString.working + ? isMapToString(value) + : value instanceof Map; +} +exports.isMap = isMap; + +function isSetToString(value) { + return ObjectToString(value) === '[object Set]'; +} +isSetToString.working = ( + typeof Set !== 'undefined' && + isSetToString(new Set()) +); +function isSet(value) { + if (typeof Set === 'undefined') { + return false; + } + + return isSetToString.working + ? isSetToString(value) + : value instanceof Set; +} +exports.isSet = isSet; + +function isWeakMapToString(value) { + return ObjectToString(value) === '[object WeakMap]'; +} +isWeakMapToString.working = ( + typeof WeakMap !== 'undefined' && + isWeakMapToString(new WeakMap()) +); +function isWeakMap(value) { + if (typeof WeakMap === 'undefined') { + return false; + } + + return isWeakMapToString.working + ? isWeakMapToString(value) + : value instanceof WeakMap; +} +exports.isWeakMap = isWeakMap; + +function isWeakSetToString(value) { + return ObjectToString(value) === '[object WeakSet]'; +} +isWeakSetToString.working = ( + typeof WeakSet !== 'undefined' && + isWeakSetToString(new WeakSet()) +); +function isWeakSet(value) { + return isWeakSetToString(value); +} +exports.isWeakSet = isWeakSet; + +function isArrayBufferToString(value) { + return ObjectToString(value) === '[object ArrayBuffer]'; +} +isArrayBufferToString.working = ( + typeof ArrayBuffer !== 'undefined' && + isArrayBufferToString(new ArrayBuffer()) +); +function isArrayBuffer(value) { + if (typeof ArrayBuffer === 'undefined') { + return false; + } + + return isArrayBufferToString.working + ? isArrayBufferToString(value) + : value instanceof ArrayBuffer; +} +exports.isArrayBuffer = isArrayBuffer; + +function isDataViewToString(value) { + return ObjectToString(value) === '[object DataView]'; +} +isDataViewToString.working = ( + typeof ArrayBuffer !== 'undefined' && + typeof DataView !== 'undefined' && + isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) +); +function isDataView(value) { + if (typeof DataView === 'undefined') { + return false; + } + + return isDataViewToString.working + ? isDataViewToString(value) + : value instanceof DataView; +} +exports.isDataView = isDataView; + +// Store a copy of SharedArrayBuffer in case it's deleted elsewhere +var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; +function isSharedArrayBufferToString(value) { + return ObjectToString(value) === '[object SharedArrayBuffer]'; +} +function isSharedArrayBuffer(value) { + if (typeof SharedArrayBufferCopy === 'undefined') { + return false; + } + + if (typeof isSharedArrayBufferToString.working === 'undefined') { + isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + } + + return isSharedArrayBufferToString.working + ? isSharedArrayBufferToString(value) + : value instanceof SharedArrayBufferCopy; +} +exports.isSharedArrayBuffer = isSharedArrayBuffer; + +function isAsyncFunction(value) { + return ObjectToString(value) === '[object AsyncFunction]'; +} +exports.isAsyncFunction = isAsyncFunction; + +function isMapIterator(value) { + return ObjectToString(value) === '[object Map Iterator]'; +} +exports.isMapIterator = isMapIterator; + +function isSetIterator(value) { + return ObjectToString(value) === '[object Set Iterator]'; +} +exports.isSetIterator = isSetIterator; + +function isGeneratorObject(value) { + return ObjectToString(value) === '[object Generator]'; +} +exports.isGeneratorObject = isGeneratorObject; + +function isWebAssemblyCompiledModule(value) { + return ObjectToString(value) === '[object WebAssembly.Module]'; +} +exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; + +function isNumberObject(value) { + return checkBoxedPrimitive(value, numberValue); +} +exports.isNumberObject = isNumberObject; + +function isStringObject(value) { + return checkBoxedPrimitive(value, stringValue); +} +exports.isStringObject = isStringObject; + +function isBooleanObject(value) { + return checkBoxedPrimitive(value, booleanValue); +} +exports.isBooleanObject = isBooleanObject; + +function isBigIntObject(value) { + return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); +} +exports.isBigIntObject = isBigIntObject; + +function isSymbolObject(value) { + return SymbolSupported && checkBoxedPrimitive(value, symbolValue); +} +exports.isSymbolObject = isSymbolObject; + +function isBoxedPrimitive(value) { + return ( + isNumberObject(value) || + isStringObject(value) || + isBooleanObject(value) || + isBigIntObject(value) || + isSymbolObject(value) + ); +} +exports.isBoxedPrimitive = isBoxedPrimitive; + +function isAnyArrayBuffer(value) { + return typeof Uint8Array !== 'undefined' && ( + isArrayBuffer(value) || + isSharedArrayBuffer(value) + ); +} +exports.isAnyArrayBuffer = isAnyArrayBuffer; + +['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { + Object.defineProperty(exports, method, { + enumerable: false, + value: function() { + throw new Error(method + ' is not supported in userland'); + } + }); +}); + +},{"is-arguments":49,"is-generator-function":51,"is-typed-array":52,"which-typed-array":61}],60:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -8157,6 +9726,16 @@ module.exports = function isBuffer(arg) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || + function getOwnPropertyDescriptors(obj) { + var keys = Object.keys(obj); + var descriptors = {}; + for (var i = 0; i < keys.length; i++) { + descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); + } + return descriptors; + }; + var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { @@ -8201,17 +9780,17 @@ exports.format = function(f) { // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { + if (typeof process !== 'undefined' && process.noDeprecation === true) { + return fn; + } + // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { + if (typeof process === 'undefined') { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } - if (process.noDeprecation === true) { - return fn; - } - var warned = false; function deprecated() { if (!warned) { @@ -8232,13 +9811,20 @@ exports.deprecate = function(fn, msg) { var debugs = {}; -var debugEnviron; +var debugEnvRegex = /^$/; + +if (process.env.NODE_DEBUG) { + var debugEnv = process.env.NODE_DEBUG; + debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') + .replace(/\*/g, '.*') + .replace(/,/g, '$|^') + .toUpperCase(); + debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); +} exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = process.env.NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + if (debugEnvRegex.test(set)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); @@ -8531,7 +10117,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; - }).join('\n').substr(2); + }).join('\n').slice(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; @@ -8548,7 +10134,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); + name = name.slice(1, -1); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") @@ -8585,6 +10171,8 @@ function reduceToSingleString(output, base, braces) { // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. +exports.types = require('./support/types'); + function isArray(ar) { return Array.isArray(ar); } @@ -8629,6 +10217,7 @@ function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; +exports.types.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; @@ -8639,12 +10228,14 @@ function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; +exports.types.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; +exports.types.isNativeError = isError; function isFunction(arg) { return typeof arg === 'function'; @@ -8723,5 +10314,169 @@ function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -},{"./support/isBuffer":41,"inherits":40}]},{},[12])(12) +var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; + +exports.promisify = function promisify(original) { + if (typeof original !== 'function') + throw new TypeError('The "original" argument must be of type Function'); + + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + var fn = original[kCustomPromisifiedSymbol]; + if (typeof fn !== 'function') { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return fn; + } + + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function (resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + }); + + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + args.push(function (err, value) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value); + } + }); + + try { + original.apply(this, args); + } catch (err) { + promiseReject(err); + } + + return promise; + } + + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + + if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, enumerable: false, writable: false, configurable: true + }); + return Object.defineProperties( + fn, + getOwnPropertyDescriptors(original) + ); +} + +exports.promisify.custom = kCustomPromisifiedSymbol + +function callbackifyOnRejected(reason, cb) { + // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). + // Because `null` is a special error value in callbacks which means "no error + // occurred", we error-wrap so the callback consumer can distinguish between + // "the promise rejected with null" or "the promise fulfilled with undefined". + if (!reason) { + var newReason = new Error('Promise was rejected with a falsy value'); + newReason.reason = reason; + reason = newReason; + } + return cb(reason); +} + +function callbackify(original) { + if (typeof original !== 'function') { + throw new TypeError('The "original" argument must be of type Function'); + } + + // We DO NOT return the promise as it gives the user a false sense that + // the promise is actually somehow related to the callback's execution + // and that the callback throwing will reject the promise. + function callbackified() { + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + var maybeCb = args.pop(); + if (typeof maybeCb !== 'function') { + throw new TypeError('The last argument must be of type Function'); + } + var self = this; + var cb = function() { + return maybeCb.apply(self, arguments); + }; + // In true node style we process the callback on `nextTick` with all the + // implications (stack, `uncaughtException`, `async_hooks`) + original.apply(this, args) + .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) }, + function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); + } + + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties(callbackified, + getOwnPropertyDescriptors(original)); + return callbackified; +} +exports.callbackify = callbackify; + +},{"./support/isBuffer":58,"./support/types":59,"inherits":48}],61:[function(require,module,exports){ +'use strict'; + +var forEach = require('for-each'); +var availableTypedArrays = require('available-typed-arrays'); +var callBound = require('call-bind/callBound'); +var gOPD = require('gopd'); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var g = typeof globalThis === 'undefined' ? global : globalThis; +var typedArrays = availableTypedArrays(); + +var $slice = callBound('String.prototype.slice'); +var toStrTags = {}; +var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof'); +if (hasToStringTag && gOPD && getPrototypeOf) { + forEach(typedArrays, function (typedArray) { + if (typeof g[typedArray] === 'function') { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + toStrTags[typedArray] = descriptor.get; + } + } + }); +} + +var tryTypedArrays = function tryAllTypedArrays(value) { + var foundName = false; + forEach(toStrTags, function (getter, typedArray) { + if (!foundName) { + try { + var name = getter.call(value); + if (name === typedArray) { + foundName = name; + } + } catch (e) {} + } + }); + return foundName; +}; + +var isTypedArray = require('is-typed-array'); + +module.exports = function whichTypedArray(value) { + if (!isTypedArray(value)) { return false; } + if (!hasToStringTag || !(Symbol.toStringTag in value)) { return $slice($toString(value), 8, -1); } + return tryTypedArrays(value); +}; + +},{"available-typed-arrays":36,"call-bind/callBound":37,"for-each":39,"gopd":43,"has-tostringtag/shams":46,"is-typed-array":52}]},{},[12])(12) }); diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js index 4edb67fa..cdbbb3f2 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/called-in-order.js @@ -33,7 +33,6 @@ function checkAdjacentCalls(callMap, spy, index, spies) { /** * A Sinon proxy object (fake, spy, stub) - * * @typedef {object} SinonProxy * @property {Function} calledBefore - A method that determines if this proxy was called before another one * @property {string} id - Some id @@ -42,7 +41,6 @@ function checkAdjacentCalls(callMap, spy, index, spies) { /** * Returns true when the spies have been called in the order they were supplied in - * * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments * @returns {boolean} true when spies are called in order, false otherwise */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js index bcd26bae..a125e53d 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/class-name.js @@ -1,27 +1,13 @@ "use strict"; -var functionName = require("./function-name"); - /** * Returns a display name for a value from a constructor - * * @param {object} value A value to examine * @returns {(string|null)} A string or null */ function className(value) { - return ( - (value.constructor && value.constructor.name) || - // The next branch is for IE11 support only: - // Because the name property is not set on the prototype - // of the Function object, we finally try to grab the - // name from its definition. This will never be reached - // in node, so we are not able to test this properly. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name - (typeof value.constructor === "function" && - /* istanbul ignore next */ - functionName(value.constructor)) || - null - ); + const name = value.constructor && value.constructor.name; + return name || null; } module.exports = className; diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js index 42227254..9957f79c 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/deprecated.js @@ -4,7 +4,6 @@ /** * Returns a function that will invoke the supplied function and print a * deprecation warning to the console each time it is called. - * * @param {Function} func * @param {string} msg * @returns {Function} @@ -23,7 +22,6 @@ exports.wrap = function (func, msg) { /** * Returns a string which can be supplied to `wrap()` to notify the user that a * particular part of the sinon API has been deprecated. - * * @param {string} packageName * @param {string} funcName * @returns {string} @@ -34,7 +32,6 @@ exports.defaultMsg = function (packageName, funcName) { /** * Prints a warning on the console, when it exists - * * @param {string} msg * @returns {undefined} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js index 00bf304e..91b8419a 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/every.js @@ -3,7 +3,6 @@ /** * Returns true when fn returns true for all members of obj. * This is an every implementation that works for all iterables - * * @param {object} obj * @param {Function} fn * @returns {boolean} diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js index 199b04e0..2ecf981d 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/function-name.js @@ -2,7 +2,6 @@ /** * Returns a display name for a function - * * @param {Function} func * @returns {string} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js index 51715a27..ac5edb3f 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/global.js @@ -2,7 +2,6 @@ /** * A reference to the global object - * * @type {object} globalObject */ var globalObject; diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js index c3d47edf..26826cbd 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/order-by-first-call.js @@ -18,14 +18,12 @@ function comparator(a, b) { /** * A Sinon proxy object (fake, spy, stub) - * * @typedef {object} SinonProxy * @property {Function} getCall - A method that can return the first call */ /** * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call - * * @param {SinonProxy[] | SinonProxy} spies * @returns {SinonProxy[]} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js index eb7a189b..d77ab4a6 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js @@ -3,11 +3,9 @@ /** * Is true when the environment causes an error to be thrown for accessing the * __proto__ property. - * * This is necessary in order to support `node --disable-proto=throw`. * * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto - * * @type {boolean} */ let throwsOnProto; diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js index 97a0bb9c..40b92151 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/type-of.js @@ -4,7 +4,6 @@ var type = require("type-detect"); /** * Returns the lower-case result of running type from type-detect on the value - * * @param {*} value * @returns {string} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js index fb14782b..303f6571 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/lib/value-to-string.js @@ -2,7 +2,6 @@ /** * Returns a string representation of the value - * * @param {*} value * @returns {string} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/package.json b/build/node_modules/nise/node_modules/@sinonjs/commons/package.json index 9b68bf26..97610454 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/package.json +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/package.json @@ -1,6 +1,6 @@ { "name": "@sinonjs/commons", - "version": "2.0.0", + "version": "3.0.1", "description": "Simple functions shared among the sinon end user libraries", "main": "lib/index.js", "types": "./types/index.d.ts", diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts b/build/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts index 1a4508be..ad528871 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/types/called-in-order.d.ts @@ -1,7 +1,6 @@ export = calledInOrder; /** * A Sinon proxy object (fake, spy, stub) - * * @typedef {object} SinonProxy * @property {Function} calledBefore - A method that determines if this proxy was called before another one * @property {string} id - Some id @@ -9,7 +8,6 @@ export = calledInOrder; */ /** * Returns true when the spies have been called in the order they were supplied in - * * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments * @returns {boolean} true when spies are called in order, false otherwise */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts b/build/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts index df3687b9..58d8284b 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/types/class-name.d.ts @@ -1,7 +1,6 @@ export = className; /** * Returns a display name for a value from a constructor - * * @param {object} value A value to examine * @returns {(string|null)} A string or null */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts b/build/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts index 0f54a635..20c67841 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/types/global.d.ts @@ -1,7 +1,6 @@ export = globalObject; /** * A reference to the global object - * * @type {object} globalObject */ declare var globalObject: object; diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts b/build/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts index a9a6037d..834c7a52 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts @@ -1,13 +1,11 @@ export = orderByFirstCall; /** * A Sinon proxy object (fake, spy, stub) - * * @typedef {object} SinonProxy * @property {Function} getCall - A method that can return the first call */ /** * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call - * * @param {SinonProxy[] | SinonProxy} spies * @returns {SinonProxy[]} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts b/build/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts index 6cc97f4a..2ec7145c 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts @@ -2,11 +2,9 @@ export = throwsOnProto; /** * Is true when the environment causes an error to be thrown for accessing the * __proto__ property. - * * This is necessary in order to support `node --disable-proto=throw`. * * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto - * * @type {boolean} */ declare let throwsOnProto: boolean; diff --git a/build/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts b/build/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts index 19b086cd..827caf81 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts +++ b/build/node_modules/nise/node_modules/@sinonjs/commons/types/value-to-string.d.ts @@ -1,7 +1,6 @@ export = valueToString; /** * Returns a string representation of the value - * * @param {*} value * @returns {string} */ diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md index 049f0672..6bdcb920 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md +++ b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/README.md @@ -43,7 +43,7 @@ var clock = FakeTimers.createClock(); clock.setTimeout(function () { console.log( - "The poblano is a mild chili pepper originating in the state of Puebla, Mexico." + "The poblano is a mild chili pepper originating in the state of Puebla, Mexico.", ); }, 15); @@ -67,6 +67,7 @@ clock instance, not the browser's internals. Calling `install` with no arguments achieves this. You can call `uninstall` later to restore things as they were again. +Note that in NodeJS also the [timers](https://nodejs.org/api/timers.html) module will receive fake timers when using global scope. ```js // In the browser distribution, a global `FakeTimers` is already available @@ -146,7 +147,9 @@ The `loopLimit` argument sets the maximum number of timers that will be run when ### `var clock = FakeTimers.install([config])` -Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). The following configuration options are available +Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). +Note that in NodeJS also the [timers](https://nodejs.org/api/timers.html) module will receive fake timers when using global scope. +The following configuration options are available | Parameter | Type | Default | Description | | -------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/LICENSE b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/LICENSE deleted file mode 100644 index 5a77f0a2..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2018, Sinon.JS -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/README.md b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/README.md deleted file mode 100644 index 9c420ba5..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# commons - -[![CircleCI](https://circleci.com/gh/sinonjs/commons.svg?style=svg)](https://circleci.com/gh/sinonjs/commons) -[![codecov](https://codecov.io/gh/sinonjs/commons/branch/master/graph/badge.svg)](https://codecov.io/gh/sinonjs/commons) -Contributor Covenant - -Simple functions shared among the sinon end user libraries - -## Rules - -- Follows the [Sinon.JS compatibility](https://github.com/sinonjs/sinon/blob/master/CONTRIBUTING.md#compatibility) -- 100% test coverage -- Code formatted using [Prettier](https://prettier.io) -- No side effects welcome! (only pure functions) -- No platform specific functions -- One export per file (any bundler can do tree shaking) diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.js deleted file mode 100644 index 4edb67fa..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -var every = require("./prototypes/array").every; - -/** - * @private - */ -function hasCallsLeft(callMap, spy) { - if (callMap[spy.id] === undefined) { - callMap[spy.id] = 0; - } - - return callMap[spy.id] < spy.callCount; -} - -/** - * @private - */ -function checkAdjacentCalls(callMap, spy, index, spies) { - var calledBeforeNext = true; - - if (index !== spies.length - 1) { - calledBeforeNext = spy.calledBefore(spies[index + 1]); - } - - if (hasCallsLeft(callMap, spy) && calledBeforeNext) { - callMap[spy.id] += 1; - return true; - } - - return false; -} - -/** - * A Sinon proxy object (fake, spy, stub) - * - * @typedef {object} SinonProxy - * @property {Function} calledBefore - A method that determines if this proxy was called before another one - * @property {string} id - Some id - * @property {number} callCount - Number of times this proxy has been called - */ - -/** - * Returns true when the spies have been called in the order they were supplied in - * - * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments - * @returns {boolean} true when spies are called in order, false otherwise - */ -function calledInOrder(spies) { - var callMap = {}; - // eslint-disable-next-line no-underscore-dangle - var _spies = arguments.length > 1 ? arguments : spies; - - return every(_spies, checkAdjacentCalls.bind(null, callMap)); -} - -module.exports = calledInOrder; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.test.js deleted file mode 100644 index 5fe66118..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/called-in-order.test.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var calledInOrder = require("./called-in-order"); -var sinon = require("@sinonjs/referee-sinon").sinon; - -var testObject1 = { - someFunction: function () { - return; - }, -}; -var testObject2 = { - otherFunction: function () { - return; - }, -}; -var testObject3 = { - thirdFunction: function () { - return; - }, -}; - -function testMethod() { - testObject1.someFunction(); - testObject2.otherFunction(); - testObject2.otherFunction(); - testObject2.otherFunction(); - testObject3.thirdFunction(); -} - -describe("calledInOrder", function () { - beforeEach(function () { - sinon.stub(testObject1, "someFunction"); - sinon.stub(testObject2, "otherFunction"); - sinon.stub(testObject3, "thirdFunction"); - testMethod(); - }); - afterEach(function () { - testObject1.someFunction.restore(); - testObject2.otherFunction.restore(); - testObject3.thirdFunction.restore(); - }); - - describe("given single array argument", function () { - describe("when stubs were called in expected order", function () { - it("returns true", function () { - assert.isTrue( - calledInOrder([ - testObject1.someFunction, - testObject2.otherFunction, - ]) - ); - assert.isTrue( - calledInOrder([ - testObject1.someFunction, - testObject2.otherFunction, - testObject2.otherFunction, - testObject3.thirdFunction, - ]) - ); - }); - }); - - describe("when stubs were called in unexpected order", function () { - it("returns false", function () { - assert.isFalse( - calledInOrder([ - testObject2.otherFunction, - testObject1.someFunction, - ]) - ); - assert.isFalse( - calledInOrder([ - testObject2.otherFunction, - testObject1.someFunction, - testObject1.someFunction, - testObject3.thirdFunction, - ]) - ); - }); - }); - }); - - describe("given multiple arguments", function () { - describe("when stubs were called in expected order", function () { - it("returns true", function () { - assert.isTrue( - calledInOrder( - testObject1.someFunction, - testObject2.otherFunction - ) - ); - assert.isTrue( - calledInOrder( - testObject1.someFunction, - testObject2.otherFunction, - testObject3.thirdFunction - ) - ); - }); - }); - - describe("when stubs were called in unexpected order", function () { - it("returns false", function () { - assert.isFalse( - calledInOrder( - testObject2.otherFunction, - testObject1.someFunction - ) - ); - assert.isFalse( - calledInOrder( - testObject2.otherFunction, - testObject1.someFunction, - testObject3.thirdFunction - ) - ); - }); - }); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.js deleted file mode 100644 index bcd26bae..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -var functionName = require("./function-name"); - -/** - * Returns a display name for a value from a constructor - * - * @param {object} value A value to examine - * @returns {(string|null)} A string or null - */ -function className(value) { - return ( - (value.constructor && value.constructor.name) || - // The next branch is for IE11 support only: - // Because the name property is not set on the prototype - // of the Function object, we finally try to grab the - // name from its definition. This will never be reached - // in node, so we are not able to test this properly. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name - (typeof value.constructor === "function" && - /* istanbul ignore next */ - functionName(value.constructor)) || - null - ); -} - -module.exports = className; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.test.js deleted file mode 100644 index 994f21b8..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/class-name.test.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -/* eslint-disable no-empty-function */ - -var assert = require("@sinonjs/referee").assert; -var className = require("./class-name"); - -describe("className", function () { - it("returns the class name of an instance", function () { - // Because eslint-config-sinon disables es6, we can't - // use a class definition here - // https://github.com/sinonjs/eslint-config-sinon/blob/master/index.js - // var instance = new (class TestClass {})(); - var instance = new (function TestClass() {})(); - var name = className(instance); - assert.equals(name, "TestClass"); - }); - - it("returns 'Object' for {}", function () { - var name = className({}); - assert.equals(name, "Object"); - }); - - it("returns null for an object that has no prototype", function () { - var obj = Object.create(null); - var name = className(obj); - assert.equals(name, null); - }); - - it("returns null for an object whose prototype was mangled", function () { - // This is what Node v6 and v7 do for objects returned by querystring.parse() - function MangledObject() {} - MangledObject.prototype = Object.create(null); - var obj = new MangledObject(); - var name = className(obj); - assert.equals(name, null); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.js deleted file mode 100644 index 42227254..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.js +++ /dev/null @@ -1,51 +0,0 @@ -/* eslint-disable no-console */ -"use strict"; - -/** - * Returns a function that will invoke the supplied function and print a - * deprecation warning to the console each time it is called. - * - * @param {Function} func - * @param {string} msg - * @returns {Function} - */ -exports.wrap = function (func, msg) { - var wrapped = function () { - exports.printWarning(msg); - return func.apply(this, arguments); - }; - if (func.prototype) { - wrapped.prototype = func.prototype; - } - return wrapped; -}; - -/** - * Returns a string which can be supplied to `wrap()` to notify the user that a - * particular part of the sinon API has been deprecated. - * - * @param {string} packageName - * @param {string} funcName - * @returns {string} - */ -exports.defaultMsg = function (packageName, funcName) { - return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`; -}; - -/** - * Prints a warning on the console, when it exists - * - * @param {string} msg - * @returns {undefined} - */ -exports.printWarning = function (msg) { - /* istanbul ignore next */ - if (typeof process === "object" && process.emitWarning) { - // Emit Warnings in Node - process.emitWarning(msg); - } else if (console.info) { - console.info(msg); - } else { - console.log(msg); - } -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.test.js deleted file mode 100644 index 275d8b1c..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/deprecated.test.js +++ /dev/null @@ -1,101 +0,0 @@ -/* eslint-disable no-console */ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var sinon = require("@sinonjs/referee-sinon").sinon; - -var deprecated = require("./deprecated"); - -var msg = "test"; - -describe("deprecated", function () { - describe("defaultMsg", function () { - it("should return a string", function () { - assert.equals( - deprecated.defaultMsg("sinon", "someFunc"), - "sinon.someFunc is deprecated and will be removed from the public API in a future version of sinon." - ); - }); - }); - - describe("printWarning", function () { - beforeEach(function () { - sinon.replace(process, "emitWarning", sinon.fake()); - }); - - afterEach(sinon.restore); - - describe("when `process.emitWarning` is defined", function () { - it("should call process.emitWarning with a msg", function () { - deprecated.printWarning(msg); - assert.calledOnceWith(process.emitWarning, msg); - }); - }); - - describe("when `process.emitWarning` is undefined", function () { - beforeEach(function () { - sinon.replace(console, "info", sinon.fake()); - sinon.replace(console, "log", sinon.fake()); - process.emitWarning = undefined; - }); - - afterEach(sinon.restore); - - describe("when `console.info` is defined", function () { - it("should call `console.info` with a message", function () { - deprecated.printWarning(msg); - assert.calledOnceWith(console.info, msg); - }); - }); - - describe("when `console.info` is undefined", function () { - it("should call `console.log` with a message", function () { - console.info = undefined; - deprecated.printWarning(msg); - assert.calledOnceWith(console.log, msg); - }); - }); - }); - }); - - describe("wrap", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - var method = sinon.fake(); - var wrapped; - - beforeEach(function () { - wrapped = deprecated.wrap(method, msg); - }); - - it("should return a wrapper function", function () { - assert.match(wrapped, sinon.match.func); - }); - - it("should assign the prototype of the passed method", function () { - assert.equals(method.prototype, wrapped.prototype); - }); - - context("when the passed method has falsy prototype", function () { - it("should not be assigned to the wrapped method", function () { - method.prototype = null; - wrapped = deprecated.wrap(method, msg); - assert.match(wrapped.prototype, sinon.match.object); - }); - }); - - context("when invoking the wrapped function", function () { - before(function () { - sinon.replace(deprecated, "printWarning", sinon.fake()); - wrapped({}); - }); - - it("should call `printWarning` before invoking", function () { - assert.calledOnceWith(deprecated.printWarning, msg); - }); - - it("should invoke the passed method with the given arguments", function () { - assert.calledOnceWith(method, {}); - }); - }); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.js deleted file mode 100644 index 00bf304e..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -/** - * Returns true when fn returns true for all members of obj. - * This is an every implementation that works for all iterables - * - * @param {object} obj - * @param {Function} fn - * @returns {boolean} - */ -module.exports = function every(obj, fn) { - var pass = true; - - try { - // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods - obj.forEach(function () { - if (!fn.apply(this, arguments)) { - // Throwing an error is the only way to break `forEach` - throw new Error(); - } - }); - } catch (e) { - pass = false; - } - - return pass; -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.test.js deleted file mode 100644 index e054a14d..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/every.test.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var sinon = require("@sinonjs/referee-sinon").sinon; -var every = require("./every"); - -describe("util/core/every", function () { - it("returns true when the callback function returns true for every element in an iterable", function () { - var obj = [true, true, true, true]; - var allTrue = every(obj, function (val) { - return val; - }); - - assert(allTrue); - }); - - it("returns false when the callback function returns false for any element in an iterable", function () { - var obj = [true, true, true, false]; - var result = every(obj, function (val) { - return val; - }); - - assert.isFalse(result); - }); - - it("calls the given callback once for each item in an iterable until it returns false", function () { - var iterableOne = [true, true, true, true]; - var iterableTwo = [true, true, false, true]; - var callback = sinon.spy(function (val) { - return val; - }); - - every(iterableOne, callback); - assert.equals(callback.callCount, 4); - - callback.resetHistory(); - - every(iterableTwo, callback); - assert.equals(callback.callCount, 3); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.js deleted file mode 100644 index 199b04e0..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; - -/** - * Returns a display name for a function - * - * @param {Function} func - * @returns {string} - */ -module.exports = function functionName(func) { - if (!func) { - return ""; - } - - try { - return ( - func.displayName || - func.name || - // Use function decomposition as a last resort to get function - // name. Does not rely on function decomposition to work - if it - // doesn't debugging will be slightly less informative - // (i.e. toString will say 'spy' rather than 'myFunc'). - (String(func).match(/function ([^\s(]+)/) || [])[1] - ); - } catch (e) { - // Stringify may fail and we might get an exception, as a last-last - // resort fall back to empty string. - return ""; - } -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.test.js deleted file mode 100644 index 0798b4e7..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/function-name.test.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; - -var jsc = require("jsverify"); -var refute = require("@sinonjs/referee-sinon").refute; - -var functionName = require("./function-name"); - -describe("function-name", function () { - it("should return empty string if func is falsy", function () { - jsc.assertForall("falsy", function (fn) { - return functionName(fn) === ""; - }); - }); - - it("should use displayName by default", function () { - jsc.assertForall("nestring", function (displayName) { - var fn = { displayName: displayName }; - - return functionName(fn) === fn.displayName; - }); - }); - - it("should use name if displayName is not available", function () { - jsc.assertForall("nestring", function (name) { - var fn = { name: name }; - - return functionName(fn) === fn.name; - }); - }); - - it("should fallback to string parsing", function () { - jsc.assertForall("nat", function (naturalNumber) { - var name = `fn${naturalNumber}`; - var fn = { - toString: function () { - return `\nfunction ${name}`; - }, - }; - - return functionName(fn) === name; - }); - }); - - it("should not fail when a name cannot be found", function () { - refute.exception(function () { - var fn = { - toString: function () { - return "\nfunction ("; - }, - }; - - functionName(fn); - }); - }); - - it("should not fail when toString is undefined", function () { - refute.exception(function () { - functionName(Object.create(null)); - }); - }); - - it("should not fail when toString throws", function () { - refute.exception(function () { - var fn; - try { - // eslint-disable-next-line no-eval - fn = eval("(function*() {})")().constructor; - } catch (e) { - // env doesn't support generators - return; - } - - functionName(fn); - }); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.js deleted file mode 100644 index 51715a27..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -/** - * A reference to the global object - * - * @type {object} globalObject - */ -var globalObject; - -/* istanbul ignore else */ -if (typeof global !== "undefined") { - // Node - globalObject = global; -} else if (typeof window !== "undefined") { - // Browser - globalObject = window; -} else { - // WebWorker - globalObject = self; -} - -module.exports = globalObject; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.test.js deleted file mode 100644 index 4fa73ebc..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/global.test.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var globalObject = require("./global"); - -describe("global", function () { - before(function () { - if (typeof global === "undefined") { - this.skip(); - } - }); - - it("is same as global", function () { - assert.same(globalObject, global); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.js deleted file mode 100644 index 870df32c..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -module.exports = { - global: require("./global"), - calledInOrder: require("./called-in-order"), - className: require("./class-name"), - deprecated: require("./deprecated"), - every: require("./every"), - functionName: require("./function-name"), - orderByFirstCall: require("./order-by-first-call"), - prototypes: require("./prototypes"), - typeOf: require("./type-of"), - valueToString: require("./value-to-string"), -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.test.js deleted file mode 100644 index e79aa7ee..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/index.test.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var index = require("./index"); - -var expectedMethods = [ - "calledInOrder", - "className", - "every", - "functionName", - "orderByFirstCall", - "typeOf", - "valueToString", -]; -var expectedObjectProperties = ["deprecated", "prototypes"]; - -describe("package", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - expectedMethods.forEach(function (name) { - it(`should export a method named ${name}`, function () { - assert.isFunction(index[name]); - }); - }); - - // eslint-disable-next-line mocha/no-setup-in-describe - expectedObjectProperties.forEach(function (name) { - it(`should export an object property named ${name}`, function () { - assert.isObject(index[name]); - }); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.js deleted file mode 100644 index c3d47edf..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; - -var sort = require("./prototypes/array").sort; -var slice = require("./prototypes/array").slice; - -/** - * @private - */ -function comparator(a, b) { - // uuid, won't ever be equal - var aCall = a.getCall(0); - var bCall = b.getCall(0); - var aId = (aCall && aCall.callId) || -1; - var bId = (bCall && bCall.callId) || -1; - - return aId < bId ? -1 : 1; -} - -/** - * A Sinon proxy object (fake, spy, stub) - * - * @typedef {object} SinonProxy - * @property {Function} getCall - A method that can return the first call - */ - -/** - * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call - * - * @param {SinonProxy[] | SinonProxy} spies - * @returns {SinonProxy[]} - */ -function orderByFirstCall(spies) { - return sort(slice(spies), comparator); -} - -module.exports = orderByFirstCall; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js deleted file mode 100644 index cbc71beb..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var knuthShuffle = require("knuth-shuffle").knuthShuffle; -var sinon = require("@sinonjs/referee-sinon").sinon; -var orderByFirstCall = require("./order-by-first-call"); - -describe("orderByFirstCall", function () { - it("should order an Array of spies by the callId of the first call, ascending", function () { - // create an array of spies - var spies = [ - sinon.spy(), - sinon.spy(), - sinon.spy(), - sinon.spy(), - sinon.spy(), - sinon.spy(), - ]; - - // call all the spies - spies.forEach(function (spy) { - spy(); - }); - - // add a few uncalled spies - spies.push(sinon.spy()); - spies.push(sinon.spy()); - - // randomise the order of the spies - knuthShuffle(spies); - - var sortedSpies = orderByFirstCall(spies); - - assert.equals(sortedSpies.length, spies.length); - - var orderedByFirstCall = sortedSpies.every(function (spy, index) { - if (index + 1 === sortedSpies.length) { - return true; - } - var nextSpy = sortedSpies[index + 1]; - - // uncalled spies should be ordered first - if (!spy.called) { - return true; - } - - return spy.calledImmediatelyBefore(nextSpy); - }); - - assert.isTrue(orderedByFirstCall); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/README.md b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/README.md deleted file mode 100644 index c3d92fe8..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Prototypes - -The functions in this folder are to be use for keeping cached references to the built-in prototypes, so that people can't inadvertently break the library by making mistakes in userland. - -See https://github.com/sinonjs/sinon/pull/1523 - -## Without cached references - -```js -// in userland, the library user needs to replace the filter method on -// Array.prototype -var array = [1, 2, 3]; -sinon.replace(array, "filter", sinon.fake.returns(2)); - -// in a sinon module, the library author needs to use the filter method -var someArray = ["a", "b", 42, "c"]; -var answer = filter(someArray, function (v) { - return v === 42; -}); - -console.log(answer); -// => 2 -``` - -## With cached references - -```js -// in userland, the library user needs to replace the filter method on -// Array.prototype -var array = [1, 2, 3]; -sinon.replace(array, "filter", sinon.fake.returns(2)); - -// in a sinon module, the library author needs to use the filter method -// get a reference to the original Array.prototype.filter -var filter = require("@sinonjs/commons").prototypes.array.filter; -var someArray = ["a", "b", 42, "c"]; -var answer = filter(someArray, function (v) { - return v === 42; -}); - -console.log(answer); -// => 42 -``` diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/array.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/array.js deleted file mode 100644 index 381a032a..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/array.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var copyPrototype = require("./copy-prototype-methods"); - -module.exports = copyPrototype(Array.prototype); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js deleted file mode 100644 index 38549c19..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; - -var call = Function.call; -var throwsOnProto = require("./throws-on-proto"); - -var disallowedProperties = [ - // ignore size because it throws from Map - "size", - "caller", - "callee", - "arguments", -]; - -// This branch is covered when tests are run with `--disable-proto=throw`, -// however we can test both branches at the same time, so this is ignored -/* istanbul ignore next */ -if (throwsOnProto) { - disallowedProperties.push("__proto__"); -} - -module.exports = function copyPrototypeMethods(prototype) { - // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods - return Object.getOwnPropertyNames(prototype).reduce(function ( - result, - name - ) { - if (disallowedProperties.includes(name)) { - return result; - } - - if (typeof prototype[name] !== "function") { - return result; - } - - result[name] = call.bind(prototype[name]); - - return result; - }, - Object.create(null)); -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js deleted file mode 100644 index 31de7cd3..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -var refute = require("@sinonjs/referee-sinon").refute; -var copyPrototypeMethods = require("./copy-prototype-methods"); - -describe("copyPrototypeMethods", function () { - it("does not throw for Map", function () { - refute.exception(function () { - copyPrototypeMethods(Map.prototype); - }); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/function.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/function.js deleted file mode 100644 index a75c25d8..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/function.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var copyPrototype = require("./copy-prototype-methods"); - -module.exports = copyPrototype(Function.prototype); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.js deleted file mode 100644 index ab766bf8..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -module.exports = { - array: require("./array"), - function: require("./function"), - map: require("./map"), - object: require("./object"), - set: require("./set"), - string: require("./string"), -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.test.js deleted file mode 100644 index 2b3c2625..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/index.test.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; - -var arrayProto = require("./index").array; -var functionProto = require("./index").function; -var mapProto = require("./index").map; -var objectProto = require("./index").object; -var setProto = require("./index").set; -var stringProto = require("./index").string; -var throwsOnProto = require("./throws-on-proto"); - -describe("prototypes", function () { - describe(".array", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - verifyProperties(arrayProto, Array); - }); - describe(".function", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - verifyProperties(functionProto, Function); - }); - describe(".map", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - verifyProperties(mapProto, Map); - }); - describe(".object", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - verifyProperties(objectProto, Object); - }); - describe(".set", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - verifyProperties(setProto, Set); - }); - describe(".string", function () { - // eslint-disable-next-line mocha/no-setup-in-describe - verifyProperties(stringProto, String); - }); -}); - -function verifyProperties(p, origin) { - var disallowedProperties = ["size", "caller", "callee", "arguments"]; - if (throwsOnProto) { - disallowedProperties.push("__proto__"); - } - - it("should have all the methods of the origin prototype", function () { - var methodNames = Object.getOwnPropertyNames(origin.prototype).filter( - function (name) { - if (disallowedProperties.includes(name)) { - return false; - } - - return typeof origin.prototype[name] === "function"; - } - ); - - methodNames.forEach(function (name) { - assert.isTrue(Object.prototype.hasOwnProperty.call(p, name), name); - }); - }); -} diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/map.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/map.js deleted file mode 100644 index 91ec65e2..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/map.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var copyPrototype = require("./copy-prototype-methods"); - -module.exports = copyPrototype(Map.prototype); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/object.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/object.js deleted file mode 100644 index eab7faa8..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/object.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var copyPrototype = require("./copy-prototype-methods"); - -module.exports = copyPrototype(Object.prototype); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/set.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/set.js deleted file mode 100644 index 7495c3b9..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/set.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var copyPrototype = require("./copy-prototype-methods"); - -module.exports = copyPrototype(Set.prototype); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/string.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/string.js deleted file mode 100644 index 3917fe9b..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/string.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -var copyPrototype = require("./copy-prototype-methods"); - -module.exports = copyPrototype(String.prototype); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js deleted file mode 100644 index eb7a189b..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -/** - * Is true when the environment causes an error to be thrown for accessing the - * __proto__ property. - * - * This is necessary in order to support `node --disable-proto=throw`. - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto - * - * @type {boolean} - */ -let throwsOnProto; -try { - const object = {}; - // eslint-disable-next-line no-proto, no-unused-expressions - object.__proto__; - throwsOnProto = false; -} catch (_) { - // This branch is covered when tests are run with `--disable-proto=throw`, - // however we can test both branches at the same time, so this is ignored - /* istanbul ignore next */ - throwsOnProto = true; -} - -module.exports = throwsOnProto; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.js deleted file mode 100644 index 97a0bb9c..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -var type = require("type-detect"); - -/** - * Returns the lower-case result of running type from type-detect on the value - * - * @param {*} value - * @returns {string} - */ -module.exports = function typeOf(value) { - return type(value).toLowerCase(); -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.test.js deleted file mode 100644 index ba377b94..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/type-of.test.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var typeOf = require("./type-of"); - -describe("typeOf", function () { - it("returns boolean", function () { - assert.equals(typeOf(false), "boolean"); - }); - - it("returns string", function () { - assert.equals(typeOf("Sinon.JS"), "string"); - }); - - it("returns number", function () { - assert.equals(typeOf(123), "number"); - }); - - it("returns object", function () { - assert.equals(typeOf({}), "object"); - }); - - it("returns function", function () { - assert.equals( - typeOf(function () { - return undefined; - }), - "function" - ); - }); - - it("returns undefined", function () { - assert.equals(typeOf(undefined), "undefined"); - }); - - it("returns null", function () { - assert.equals(typeOf(null), "null"); - }); - - it("returns array", function () { - assert.equals(typeOf([]), "array"); - }); - - it("returns regexp", function () { - assert.equals(typeOf(/.*/), "regexp"); - }); - - it("returns date", function () { - assert.equals(typeOf(new Date()), "date"); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.js deleted file mode 100644 index fb14782b..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -/** - * Returns a string representation of the value - * - * @param {*} value - * @returns {string} - */ -function valueToString(value) { - if (value && value.toString) { - // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods - return value.toString(); - } - return String(value); -} - -module.exports = valueToString; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.test.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.test.js deleted file mode 100644 index 64564471..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/lib/value-to-string.test.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -var assert = require("@sinonjs/referee-sinon").assert; -var valueToString = require("./value-to-string"); - -describe("util/core/valueToString", function () { - it("returns string representation of an object", function () { - var obj = {}; - - assert.equals(valueToString(obj), obj.toString()); - }); - - it("returns 'null' for literal null'", function () { - assert.equals(valueToString(null), "null"); - }); - - it("returns 'undefined' for literal undefined", function () { - assert.equals(valueToString(undefined), "undefined"); - }); -}); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/package.json b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/package.json deleted file mode 100644 index 2f80d025..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "@sinonjs/commons", - "version": "3.0.0", - "description": "Simple functions shared among the sinon end user libraries", - "main": "lib/index.js", - "types": "./types/index.d.ts", - "scripts": { - "build": "rm -rf types && tsc", - "lint": "eslint .", - "precommit": "lint-staged", - "test": "mocha --recursive -R dot \"lib/**/*.test.js\"", - "test-check-coverage": "npm run test-coverage && nyc check-coverage --branches 100 --functions 100 --lines 100", - "test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test", - "prepublishOnly": "npm run build", - "prettier:check": "prettier --check '**/*.{js,css,md}'", - "prettier:write": "prettier --write '**/*.{js,css,md}'", - "preversion": "npm run test-check-coverage", - "version": "changes --commits --footer", - "postversion": "git push --follow-tags && npm publish", - "prepare": "husky install" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sinonjs/commons.git" - }, - "files": [ - "lib", - "types" - ], - "author": "", - "license": "BSD-3-Clause", - "bugs": { - "url": "https://github.com/sinonjs/commons/issues" - }, - "homepage": "https://github.com/sinonjs/commons#readme", - "lint-staged": { - "*.{js,css,md}": "prettier --check", - "*.js": "eslint" - }, - "devDependencies": { - "@sinonjs/eslint-config": "^4.0.6", - "@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0", - "@sinonjs/referee-sinon": "^10.1.0", - "@studio/changes": "^2.2.0", - "husky": "^6.0.0", - "jsverify": "0.8.4", - "knuth-shuffle": "^1.0.8", - "lint-staged": "^13.0.3", - "mocha": "^10.1.0", - "nyc": "^15.1.0", - "prettier": "^2.7.1", - "typescript": "^4.8.4" - }, - "dependencies": { - "type-detect": "4.0.8" - } -} diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/called-in-order.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/called-in-order.d.ts deleted file mode 100644 index 1a4508be..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/called-in-order.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -export = calledInOrder; -/** - * A Sinon proxy object (fake, spy, stub) - * - * @typedef {object} SinonProxy - * @property {Function} calledBefore - A method that determines if this proxy was called before another one - * @property {string} id - Some id - * @property {number} callCount - Number of times this proxy has been called - */ -/** - * Returns true when the spies have been called in the order they were supplied in - * - * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments - * @returns {boolean} true when spies are called in order, false otherwise - */ -declare function calledInOrder(spies: SinonProxy[] | SinonProxy, ...args: any[]): boolean; -declare namespace calledInOrder { - export { SinonProxy }; -} -/** - * A Sinon proxy object (fake, spy, stub) - */ -type SinonProxy = { - /** - * - A method that determines if this proxy was called before another one - */ - calledBefore: Function; - /** - * - Some id - */ - id: string; - /** - * - Number of times this proxy has been called - */ - callCount: number; -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/class-name.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/class-name.d.ts deleted file mode 100644 index df3687b9..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/class-name.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export = className; -/** - * Returns a display name for a value from a constructor - * - * @param {object} value A value to examine - * @returns {(string|null)} A string or null - */ -declare function className(value: object): (string | null); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/deprecated.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/deprecated.d.ts deleted file mode 100644 index 81a35bf8..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/deprecated.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function wrap(func: Function, msg: string): Function; -export function defaultMsg(packageName: string, funcName: string): string; -export function printWarning(msg: string): undefined; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/every.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/every.d.ts deleted file mode 100644 index bcfa64e0..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/every.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function _exports(obj: object, fn: Function): boolean; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/function-name.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/function-name.d.ts deleted file mode 100644 index f27d519a..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/function-name.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function _exports(func: Function): string; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/global.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/global.d.ts deleted file mode 100644 index 0f54a635..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/global.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export = globalObject; -/** - * A reference to the global object - * - * @type {object} globalObject - */ -declare var globalObject: object; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/index.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/index.d.ts deleted file mode 100644 index 7d675b18..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export const global: any; -export const calledInOrder: typeof import("./called-in-order"); -export const className: typeof import("./class-name"); -export const deprecated: typeof import("./deprecated"); -export const every: (obj: any, fn: Function) => boolean; -export const functionName: (func: Function) => string; -export const orderByFirstCall: typeof import("./order-by-first-call"); -export const prototypes: { - array: any; - function: any; - map: any; - object: any; - set: any; - string: any; -}; -export const typeOf: (value: any) => string; -export const valueToString: typeof import("./value-to-string"); diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts deleted file mode 100644 index a9a6037d..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export = orderByFirstCall; -/** - * A Sinon proxy object (fake, spy, stub) - * - * @typedef {object} SinonProxy - * @property {Function} getCall - A method that can return the first call - */ -/** - * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call - * - * @param {SinonProxy[] | SinonProxy} spies - * @returns {SinonProxy[]} - */ -declare function orderByFirstCall(spies: SinonProxy[] | SinonProxy): SinonProxy[]; -declare namespace orderByFirstCall { - export { SinonProxy }; -} -/** - * A Sinon proxy object (fake, spy, stub) - */ -type SinonProxy = { - /** - * - A method that can return the first call - */ - getCall: Function; -}; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/array.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/array.d.ts deleted file mode 100644 index 1cce6350..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/array.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts deleted file mode 100644 index 1479b93c..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function _exports(prototype: any): any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/function.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/function.d.ts deleted file mode 100644 index 1cce6350..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/function.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/index.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/index.d.ts deleted file mode 100644 index 0026d6c2..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare const array: any; -declare const _function: any; -export { _function as function }; -export declare const map: any; -export declare const object: any; -export declare const set: any; -export declare const string: any; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/map.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/map.d.ts deleted file mode 100644 index 1cce6350..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/map.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/object.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/object.d.ts deleted file mode 100644 index 1cce6350..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/object.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/set.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/set.d.ts deleted file mode 100644 index 1cce6350..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/set.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/string.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/string.d.ts deleted file mode 100644 index 1cce6350..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/string.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _exports: any; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts deleted file mode 100644 index 6cc97f4a..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export = throwsOnProto; -/** - * Is true when the environment causes an error to be thrown for accessing the - * __proto__ property. - * - * This is necessary in order to support `node --disable-proto=throw`. - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto - * - * @type {boolean} - */ -declare let throwsOnProto: boolean; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/type-of.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/type-of.d.ts deleted file mode 100644 index fc72887c..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/type-of.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function _exports(value: any): string; -export = _exports; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/value-to-string.d.ts b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/value-to-string.d.ts deleted file mode 100644 index 19b086cd..00000000 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons/types/value-to-string.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export = valueToString; -/** - * Returns a string representation of the value - * - * @param {*} value - * @returns {string} - */ -declare function valueToString(value: any): string; diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json index fdb18926..51b8565c 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json +++ b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/package.json @@ -1,7 +1,7 @@ { "name": "@sinonjs/fake-timers", "description": "Fake JavaScript timers", - "version": "10.3.0", + "version": "11.2.2", "homepage": "https://github.com/sinonjs/fake-timers", "author": "Christian Johansen", "repository": { @@ -39,12 +39,12 @@ "@sinonjs/eslint-config": "^4.1.0", "@sinonjs/referee-sinon": "11.0.0", "husky": "^8.0.3", - "jsdom": "22.0.0", - "lint-staged": "13.2.2", + "jsdom": "22.1.0", + "lint-staged": "15.0.1", "mocha": "10.2.0", "mochify": "9.2.0", "nyc": "15.1.0", - "prettier": "2.8.8" + "prettier": "3.0.3" }, "main": "./src/fake-timers-src.js", "dependencies": { diff --git a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js index 607d91fb..0ce72178 100644 --- a/build/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js +++ b/build/node_modules/nise/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js @@ -1,6 +1,14 @@ "use strict"; const globalObject = require("@sinonjs/commons").global; +let timersModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } +} /** * @typedef {object} IdleDeadline @@ -20,14 +28,14 @@ const globalObject = require("@sinonjs/commons").global; /** * @callback NextTick * @param {VoidVarArgsFunc} callback - the callback to run - * @param {...*} arguments - optional arguments to call the callback with + * @param {...*} args - optional arguments to call the callback with * @returns {void} */ /** * @callback SetImmediate * @param {VoidVarArgsFunc} callback - the callback to run - * @param {...*} arguments - optional arguments to call the callback with + * @param {...*} args - optional arguments to call the callback with * @returns {NodeImmediate} */ @@ -85,6 +93,7 @@ const globalObject = require("@sinonjs/commons").global; * @property {function(): void} uninstall Uninstall the clock. * @property {Function[]} methods - the methods that are faked * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods */ /* eslint-enable jsdoc/require-property-description */ @@ -134,8 +143,6 @@ const globalObject = require("@sinonjs/commons").global; * @returns {FakeTimers} */ function withGlobal(_global) { - const userAgent = _global.navigator && _global.navigator.userAgent; - const isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1; const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs const NOOP = function () { @@ -177,29 +184,12 @@ function withGlobal(_global) { typeof _global.cancelIdleCallback === "function"; const setImmediatePresent = _global.setImmediate && typeof _global.setImmediate === "function"; - - // Make properties writable in IE, as per - // https://www.adequatelygood.com/Replacing-setTimeout-Globally.html - /* eslint-disable no-self-assign */ - if (isRunningInIE) { - _global.setTimeout = _global.setTimeout; - _global.clearTimeout = _global.clearTimeout; - _global.setInterval = _global.setInterval; - _global.clearInterval = _global.clearInterval; - _global.Date = _global.Date; - } - - // setImmediate is not a standard function - // avoid adding the prop to the window object if not present - if (setImmediatePresent) { - _global.setImmediate = _global.setImmediate; - _global.clearImmediate = _global.clearImmediate; - } - /* eslint-enable no-self-assign */ + const intlPresent = _global.Intl && typeof _global.Intl === "object"; _global.clearTimeout(timeoutResult); const NativeDate = _global.Date; + const NativeIntl = _global.Intl; let uniqueTimerId = idCounterStart; /** @@ -254,7 +244,7 @@ function withGlobal(_global) { if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { throw new Error( - "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits" + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", ); } @@ -323,7 +313,7 @@ function withGlobal(_global) { */ function getInfiniteLoopError(clock, job) { const infiniteLoopError = new Error( - `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!` + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, ); if (!job.error) { @@ -333,13 +323,13 @@ function withGlobal(_global) { // pattern never matched in Node const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; let clockMethodPattern = new RegExp( - String(Object.keys(clock).join("|")) + String(Object.keys(clock).join("|")), ); if (addTimerReturnsObject) { // node.js environment clockMethodPattern = new RegExp( - `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+` + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, ); } @@ -473,7 +463,7 @@ function withGlobal(_global) { date, hour, minute, - second + second, ); default: return new NativeDate( @@ -483,7 +473,7 @@ function withGlobal(_global) { hour, minute, second, - ms + ms, ); } } @@ -491,6 +481,55 @@ function withGlobal(_global) { return mirrorDateProperties(ClockDate, NativeDate); } + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. + */ + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); + + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; + + return ClockIntl; + } + //eslint-disable-next-line jsdoc/require-jsdoc function enqueueJob(clock, job) { // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob @@ -535,7 +574,7 @@ function withGlobal(_global) { throw new TypeError( `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ timer.func - } of type ${typeof timer.func}` + } of type ${typeof timer.func}`, ); } } @@ -818,7 +857,7 @@ function withGlobal(_global) { } warnOnce( `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + - "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`." + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", ); } @@ -835,7 +874,7 @@ function withGlobal(_global) { const clear = getClearHandler(ttype); const schedule = getScheduleHandler(timer.type); throw new Error( - `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()` + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, ); } } @@ -860,7 +899,7 @@ function withGlobal(_global) { } else if (method === "performance") { const originalPerfDescriptor = Object.getOwnPropertyDescriptor( clock, - `_${method}` + `_${method}`, ); if ( originalPerfDescriptor && @@ -870,7 +909,7 @@ function withGlobal(_global) { Object.defineProperty( _global, method, - originalPerfDescriptor + originalPerfDescriptor, ); } else if (originalPerfDescriptor.configurable) { _global[method] = clock[`_${method}`]; @@ -886,6 +925,12 @@ function withGlobal(_global) { } } } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } } if (config.shouldAdvanceTime === true) { @@ -912,17 +957,19 @@ function withGlobal(_global) { function hijackMethod(target, method, clock) { clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( target, - method + method, ); clock[`_${method}`] = target[method]; if (method === "Date") { const date = mirrorDateProperties(clock[method], target[method]); target[method] = date; + } else if (method === "Intl") { + target[method] = clock[method]; } else if (method === "performance") { const originalPerfDescriptor = Object.getOwnPropertyDescriptor( target, - method + method, ); // JSDOM has a read only performance field so we have to save/copy it differently if ( @@ -933,12 +980,12 @@ function withGlobal(_global) { Object.defineProperty( clock, `_${method}`, - originalPerfDescriptor + originalPerfDescriptor, ); const perfDescriptor = Object.getOwnPropertyDescriptor( clock, - method + method, ); Object.defineProperty(target, method, perfDescriptor); } else { @@ -951,7 +998,7 @@ function withGlobal(_global) { Object.defineProperties( target[method], - Object.getOwnPropertyDescriptors(clock[method]) + Object.getOwnPropertyDescriptors(clock[method]), ); } @@ -973,6 +1020,7 @@ function withGlobal(_global) { * @property {setInterval} setInterval * @property {clearInterval} clearInterval * @property {Date} Date + * @property {Intl} Intl * @property {SetImmediate=} setImmediate * @property {function(NodeImmediate): void=} clearImmediate * @property {function(number[]):number[]=} hrtime @@ -1031,6 +1079,10 @@ function withGlobal(_global) { timers.cancelIdleCallback = _global.cancelIdleCallback; } + if (intlPresent) { + timers.Intl = _global.Intl; + } + const originalSetTimeout = _global.setImmediate || _global.setTimeout; /** @@ -1049,7 +1101,7 @@ function withGlobal(_global) { if (NativeDate === undefined) { throw new Error( "The global scope doesn't have a `Date` object" + - " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)" + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", ); } @@ -1078,7 +1130,7 @@ function withGlobal(_global) { if (Array.isArray(prev)) { if (prev[1] > 1e9) { throw new TypeError( - "Number of nanoseconds can't exceed a billion" + "Number of nanoseconds can't exceed a billion", ); } @@ -1096,6 +1148,17 @@ function withGlobal(_global) { return [secsSinceStart, remainderInNanos]; } + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ function fakePerformanceNow() { const hrt = hrtime(); const millis = hrt[0] * 1000 + hrt[1] / 1e6; @@ -1109,9 +1172,14 @@ function withGlobal(_global) { }; } + if (intlPresent) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + clock.requestIdleCallback = function requestIdleCallback( func, - timeout + timeout, ) { let timeToNextIdlePeriod = 0; @@ -1147,7 +1215,7 @@ function withGlobal(_global) { clock.setTimeout[utilPromisify.custom] = function promisifiedSetTimeout(timeout, arg) { return new _global.Promise(function setTimeoutExecutor( - resolve + resolve, ) { addTimer(clock, { func: resolve, @@ -1208,7 +1276,7 @@ function withGlobal(_global) { args: [arg], immediate: true, }); - } + }, ); }; } @@ -1510,6 +1578,8 @@ function withGlobal(_global) { function doRun() { originalSetTimeout(function () { try { + runJobs(clock); + let numTimers; if (i < clock.loopLimit) { if (!clock.timers) { @@ -1519,7 +1589,7 @@ function withGlobal(_global) { } numTimers = Object.keys( - clock.timers + clock.timers, ).length; if (numTimers === 0) { resetIsNearInfiniteLimit(); @@ -1565,6 +1635,7 @@ function withGlobal(_global) { try { const timer = lastTimer(clock); if (!timer) { + runJobs(clock); resolve(clock.now); } @@ -1652,8 +1723,8 @@ function withGlobal(_global) { ) { throw new TypeError( `FakeTimers.install called with ${String( - config - )} install requires an object parameter` + config, + )} install requires an object parameter`, ); } @@ -1661,7 +1732,7 @@ function withGlobal(_global) { // Timers are already faked; this is a problem. // Make the user reset timers before continuing. throw new TypeError( - "Can't install fake timers twice on the same global object." + "Can't install fake timers twice on the same global object.", ); } @@ -1674,7 +1745,7 @@ function withGlobal(_global) { if (config.target) { throw new TypeError( - "config.target is no longer supported. Use `withGlobal(target)` instead." + "config.target is no longer supported. Use `withGlobal(target)` instead.", ); } @@ -1699,23 +1770,23 @@ function withGlobal(_global) { const intervalTick = doIntervalTick.bind( null, clock, - config.advanceTimeDelta + config.advanceTimeDelta, ); const intervalId = _global.setInterval( intervalTick, - config.advanceTimeDelta + config.advanceTimeDelta, ); clock.attachedInterval = intervalId; } if (clock.methods.includes("performance")) { const proto = (() => { - if (hasPerformancePrototype) { - return _global.Performance.prototype; - } if (hasPerformanceConstructorPrototype) { return _global.performance.constructor.prototype; } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } })(); if (proto) { Object.getOwnPropertyNames(proto).forEach(function (name) { @@ -1729,11 +1800,13 @@ function withGlobal(_global) { } else if ((config.toFake || []).includes("performance")) { // user explicitly tried to fake performance when not present throw new ReferenceError( - "non-existent performance object cannot be faked" + "non-existent performance object cannot be faked", ); } } - + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } for (i = 0, l = clock.methods.length; i < l; i++) { const nameOfMethodToReplace = clock.methods[i]; if (nameOfMethodToReplace === "hrtime") { @@ -1753,6 +1826,18 @@ function withGlobal(_global) { } else { hijackMethod(_global, nameOfMethodToReplace, clock); } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } } return clock; diff --git a/build/node_modules/nise/package.json b/build/node_modules/nise/package.json index 6e018176..36ccf4aa 100644 --- a/build/node_modules/nise/package.json +++ b/build/node_modules/nise/package.json @@ -1,6 +1,6 @@ { "name": "nise", - "version": "5.1.5", + "version": "5.1.7", "description": "Fake XHR and server", "keywords": [ "test", @@ -46,28 +46,28 @@ "!lib/**/*.test.js" ], "devDependencies": { - "@sinonjs/eslint-config": "^4.0.5", - "@sinonjs/referee": "^9.1.1", - "browserify": "^16.2.3", - "husky": "^4.2.1", - "jsdom": "^16.2.0", + "@sinonjs/eslint-config": "^5.0.2", + "@sinonjs/referee": "^11.0.0", + "browserify": "^17.0.0", + "husky": "^4.3.8", + "jsdom": "^23", "jsdom-global": "3.0.2", - "lint-staged": "^10.5.3", - "mocha": "^10.1.0", + "lint-staged": "^15.2.0", + "mocha": "^10.2.0", "mochify": "^9.2.0", - "nyc": "^15.0.0", - "prettier": "^1.19.1", + "nyc": "^15.1.0", + "prettier": "^3.1.1", "proxyquire": "^2.1.3", - "proxyquire-universal": "^2.1.0", + "proxyquire-universal": "^3.0.1", "proxyquireify": "^3.2.1", - "sinon": ">=9" + "sinon": ">=17" }, "dependencies": { - "@sinonjs/commons": "^2.0.0", - "@sinonjs/fake-timers": "^10.0.2", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/text-encoding": "^0.7.2", + "just-extend": "^6.2.0", + "path-to-regexp": "^6.2.1" }, "lint-staged": { "*.{js,css,md}": "prettier --check", diff --git a/build/node_modules/path-to-regexp/History.md b/build/node_modules/path-to-regexp/History.md deleted file mode 100644 index abe4a659..00000000 --- a/build/node_modules/path-to-regexp/History.md +++ /dev/null @@ -1,158 +0,0 @@ -1.7.0 / 2016-11-08 -================== - - * Allow a `delimiter` option to be passed in with `tokensToRegExp` which will be used for "non-ending" token match situations - -1.6.0 / 2016-10-03 -================== - - * Populate `RegExp.keys` when using the `tokensToRegExp` method (making it consistent with the main export) - * Allow a `delimiter` option to be passed in with `parse` - * Updated TypeScript definition with `Keys` and `Options` updated - -1.5.3 / 2016-06-15 -================== - - * Add `\\` to the ignore character group to avoid backtracking on mismatched parens - -1.5.2 / 2016-06-15 -================== - - * Escape `\\` in string segments of regexp - -1.5.1 / 2016-06-08 -================== - - * Add `index.d.ts` to NPM package - -1.5.0 / 2016-05-20 -================== - - * Handle partial token segments (better) - * Allow compile to handle asterisk token segments - -1.4.0 / 2016-05-18 -================== - - * Handle RegExp unions in path matching groups - -1.3.0 / 2016-05-08 -================== - - * Clarify README language and named parameter token support - * Support advanced Closure Compiler with type annotations - * Add pretty paths options to compiled function output - * Add TypeScript definition to project - * Improved prefix handling with non-complete segment parameters (E.g. `/:foo?-bar`) - -1.2.1 / 2015-08-17 -================== - - * Encode values before validation with path compilation function - * More examples of using compilation in README - -1.2.0 / 2015-05-20 -================== - - * Add support for matching an asterisk (`*`) as an unnamed match everything group (`(.*)`) - -1.1.1 / 2015-05-11 -================== - - * Expose methods for working with path tokens - -1.1.0 / 2015-05-09 -================== - - * Expose the parser implementation to consumers - * Implement a compiler function to generate valid strings - * Huge refactor of tests to be more DRY and cover new parse and compile functions - * Use chai in tests - * Add .editorconfig - -1.0.3 / 2015-01-17 -================== - - * Optimised function runtime - * Added `files` to `package.json` - -1.0.2 / 2014-12-17 -================== - - * Use `Array.isArray` shim - * Remove ES5 incompatible code - * Fixed repository path - * Added new readme badges - -1.0.1 / 2014-08-27 -================== - - * Ensure installation works correctly on 0.8 - -1.0.0 / 2014-08-17 -================== - - * No more API changes - -0.2.5 / 2014-08-07 -================== - - * Allow keys parameter to be omitted - -0.2.4 / 2014-08-02 -================== - - * Code coverage badge - * Updated readme - * Attach keys to the generated regexp - -0.2.3 / 2014-07-09 -================== - - * Add MIT license - -0.2.2 / 2014-07-06 -================== - - * A passed in trailing slash in non-strict mode will become optional - * In non-end mode, the optional trailing slash will only match at the end - -0.2.1 / 2014-06-11 -================== - - * Fixed a major capturing group regexp regression - -0.2.0 / 2014-06-09 -================== - - * Improved support for arrays - * Improved support for regexps - * Better support for non-ending strict mode matches with a trailing slash - * Travis CI support - * Block using regexp special characters in the path - * Removed support for the asterisk to match all - * New support for parameter suffixes - `*`, `+` and `?` - * Updated readme - * Provide delimiter information with keys array - -0.1.2 / 2014-03-10 -================== - - * Move testing dependencies to `devDependencies` - -0.1.1 / 2014-03-10 -================== - - * Match entire substring with `options.end` - * Properly handle ending and non-ending matches - -0.1.0 / 2014-03-06 -================== - - * Add `options.end` - -0.0.2 / 2013-02-10 -================== - - * Update to match current express - * Add .license property to component.json diff --git a/build/node_modules/path-to-regexp/Readme.md b/build/node_modules/path-to-regexp/Readme.md index 379ecf4b..b40f8cea 100644 --- a/build/node_modules/path-to-regexp/Readme.md +++ b/build/node_modules/path-to-regexp/Readme.md @@ -1,13 +1,12 @@ # Path-to-RegExp -> Turn an Express-style path string such as `/user/:name` into a regular expression. +> Turn a path string such as `/user/:name` into a regular expression. [![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Dependency Status][david-image]][david-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] [![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] ## Installation @@ -18,240 +17,337 @@ npm install path-to-regexp --save ## Usage ```javascript -var pathToRegexp = require('path-to-regexp') +const { pathToRegexp, match, parse, compile } = require("path-to-regexp"); -// pathToRegexp(path, keys, options) -// pathToRegexp.parse(path) -// pathToRegexp.compile(path) +// pathToRegexp(path, keys?, options?) +// match(path) +// parse(path) +// compile(path) ``` -- **path** An Express-style string, an array of strings, or a regular expression. -- **keys** An array to be populated with the keys found in the path. -- **options** - - **sensitive** When `true` the route will be case sensitive. (default: `false`) - - **strict** When `false` the trailing slash is optional. (default: `false`) - - **end** When `false` the path will match at the beginning. (default: `true`) - - **delimiter** Set the default delimiter for repeat parameters. (default: `'/'`) +### Path to regexp + +The `pathToRegexp` function will return a regular expression object based on the provided `path` argument. It accepts the following arguments: + +- **path** A string, array of strings, or a regular expression. +- **keys** _(optional)_ An array to populate with keys found in the path. +- **options** _(optional)_ + - **sensitive** When `true` the regexp will be case sensitive. (default: `false`) + - **strict** When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`) + - **end** When `true` the regexp will match to the end of the string. (default: `true`) + - **start** When `true` the regexp will match from the beginning of the string. (default: `true`) + - **delimiter** The default delimiter for segments, e.g. `[^/#?]` for `:named` patterns. (default: `'/#?'`) + - **endsWith** Optional character, or list of characters, to treat as "end" characters. + - **encode** A function to encode strings before inserting into `RegExp`. (default: `x => x`) + - **prefixes** List of characters to automatically consider prefixes when parsing. (default: `./`) ```javascript -var keys = [] -var re = pathToRegexp('/foo/:bar', keys) -// re = /^\/foo\/([^\/]+?)\/?$/i -// keys = [{ name: 'bar', prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '[^\\/]+?' }] +const keys = []; +const regexp = pathToRegexp("/foo/:bar", keys); +// regexp = /^\/foo(?:\/([^\/#\?]+?))[\/#\?]?$/i +// keys = [{ name: 'bar', prefix: '/', suffix: '', pattern: '[^\\/#\\?]+?', modifier: '' }] ``` -**Please note:** The `RegExp` returned by `path-to-regexp` is intended for use with pathnames or hostnames. It can not handle the query strings or fragments of a URL. +**Please note:** The `RegExp` returned by `path-to-regexp` is intended for ordered data (e.g. pathnames, hostnames). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc). When using paths that contain query strings, you need to escape the question mark (`?`) to ensure it does not flag the parameter as [optional](#optional). ### Parameters -The path string can be used to define parameters and populate the keys. +The path argument is used to define parameters and populate keys. #### Named Parameters -Named parameters are defined by prefixing a colon to the parameter name (`:foo`). By default, the parameter will match until the following path segment. +Named parameters are defined by prefixing a colon to the parameter name (`:foo`). ```js -var re = pathToRegexp('/:foo/:bar', keys) +const regexp = pathToRegexp("/:foo/:bar"); // keys = [{ name: 'foo', prefix: '/', ... }, { name: 'bar', prefix: '/', ... }] -re.exec('/test/route') -//=> ['/test/route', 'test', 'route'] +regexp.exec("/test/route"); +//=> [ '/test/route', 'test', 'route', index: 0, input: '/test/route', groups: undefined ] +``` + +**Please note:** Parameter names must use "word characters" (`[A-Za-z0-9_]`). + +##### Custom Matching Parameters + +Parameters can have a custom regexp, which overrides the default match (`[^/]+`). For example, you can match digits or names in a path: + +```js +const regexpNumbers = pathToRegexp("/icon-:foo(\\d+).png"); +// keys = [{ name: 'foo', ... }] + +regexpNumbers.exec("/icon-123.png"); +//=> ['/icon-123.png', '123'] + +regexpNumbers.exec("/icon-abc.png"); +//=> null + +const regexpWord = pathToRegexp("/(user|u)"); +// keys = [{ name: 0, ... }] + +regexpWord.exec("/u"); +//=> ['/u', 'u'] + +regexpWord.exec("/users"); +//=> null +``` + +**Tip:** Backslashes need to be escaped with another backslash in JavaScript strings. + +##### Custom Prefix and Suffix + +Parameters can be wrapped in `{}` to create custom prefixes or suffixes for your segment: + +```js +const regexp = pathToRegexp("/:attr1?{-:attr2}?{-:attr3}?"); + +regexp.exec("/test"); +// => ['/test', 'test', undefined, undefined] + +regexp.exec("/test-test"); +// => ['/test', 'test', 'test', undefined] ``` -**Please note:** Named parameters must be made up of "word characters" (`[A-Za-z0-9_]`). +#### Unnamed Parameters + +It is possible to write an unnamed parameter that only consists of a regexp. It works the same the named parameter, except it will be numerically indexed: ```js -var re = pathToRegexp('/(apple-)?icon-:res(\\d+).png', keys) -// keys = [{ name: 0, prefix: '/', ... }, { name: 'res', prefix: '', ... }] +const regexp = pathToRegexp("/:foo/(.*)"); +// keys = [{ name: 'foo', ... }, { name: 0, ... }] -re.exec('/icon-76.png') -//=> ['/icon-76.png', undefined, '76'] +regexp.exec("/test/route"); +//=> [ '/test/route', 'test', 'route', index: 0, input: '/test/route', groups: undefined ] ``` -#### Modified Parameters +#### Modifiers + +Modifiers must be placed after the parameter (e.g. `/:foo?`, `/(test)?`, `/:foo(test)?`, or `{-:foo(test)}?`). ##### Optional -Parameters can be suffixed with a question mark (`?`) to make the parameter optional. This will also make the prefix optional. +Parameters can be suffixed with a question mark (`?`) to make the parameter optional. ```js -var re = pathToRegexp('/:foo/:bar?', keys) -// keys = [{ name: 'foo', ... }, { name: 'bar', delimiter: '/', optional: true, repeat: false }] +const regexp = pathToRegexp("/:foo/:bar?"); +// keys = [{ name: 'foo', ... }, { name: 'bar', prefix: '/', modifier: '?' }] -re.exec('/test') -//=> ['/test', 'test', undefined] +regexp.exec("/test"); +//=> [ '/test', 'test', undefined, index: 0, input: '/test', groups: undefined ] -re.exec('/test/route') -//=> ['/test', 'test', 'route'] +regexp.exec("/test/route"); +//=> [ '/test/route', 'test', 'route', index: 0, input: '/test/route', groups: undefined ] +``` + +**Tip:** The prefix is also optional, escape the prefix `\/` to make it required. + +When dealing with query strings, escape the question mark (`?`) so it doesn't mark the parameter as optional. Handling unordered data is outside the scope of this library. + +```js +const regexp = pathToRegexp("/search/:tableName\\?useIndex=true&term=amazing"); + +regexp.exec("/search/people?useIndex=true&term=amazing"); +//=> [ '/search/people?useIndex=true&term=amazing', 'people', index: 0, input: '/search/people?useIndex=true&term=amazing', groups: undefined ] + +// This library does not handle query strings in different orders +regexp.exec("/search/people?term=amazing&useIndex=true"); +//=> null ``` ##### Zero or more -Parameters can be suffixed with an asterisk (`*`) to denote a zero or more parameter matches. The prefix is taken into account for each match. +Parameters can be suffixed with an asterisk (`*`) to denote a zero or more parameter matches. ```js -var re = pathToRegexp('/:foo*', keys) -// keys = [{ name: 'foo', delimiter: '/', optional: true, repeat: true }] +const regexp = pathToRegexp("/:foo*"); +// keys = [{ name: 'foo', prefix: '/', modifier: '*' }] -re.exec('/') -//=> ['/', undefined] +regexp.exec("/"); +//=> [ '/', undefined, index: 0, input: '/', groups: undefined ] -re.exec('/bar/baz') -//=> ['/bar/baz', 'bar/baz'] +regexp.exec("/bar/baz"); +//=> [ '/bar/baz', 'bar/baz', index: 0, input: '/bar/baz', groups: undefined ] ``` ##### One or more -Parameters can be suffixed with a plus sign (`+`) to denote a one or more parameter matches. The prefix is taken into account for each match. +Parameters can be suffixed with a plus sign (`+`) to denote a one or more parameter matches. ```js -var re = pathToRegexp('/:foo+', keys) -// keys = [{ name: 'foo', delimiter: '/', optional: false, repeat: true }] +const regexp = pathToRegexp("/:foo+"); +// keys = [{ name: 'foo', prefix: '/', modifier: '+' }] -re.exec('/') +regexp.exec("/"); //=> null -re.exec('/bar/baz') -//=> ['/bar/baz', 'bar/baz'] +regexp.exec("/bar/baz"); +//=> [ '/bar/baz','bar/baz', index: 0, input: '/bar/baz', groups: undefined ] ``` -#### Custom Match Parameters +### Match -All parameters can be provided a custom regexp, which overrides the default (`[^\/]+`). +The `match` function will return a function for transforming paths into parameters: ```js -var re = pathToRegexp('/:foo(\\d+)', keys) -// keys = [{ name: 'foo', ... }] +// Make sure you consistently `decode` segments. +const fn = match("/user/:id", { decode: decodeURIComponent }); -re.exec('/123') -//=> ['/123', '123'] - -re.exec('/abc') -//=> null +fn("/user/123"); //=> { path: '/user/123', index: 0, params: { id: '123' } } +fn("/invalid"); //=> false +fn("/user/caf%C3%A9"); //=> { path: '/user/caf%C3%A9', index: 0, params: { id: 'café' } } ``` -**Please note:** Backslashes need to be escaped with another backslash in strings. +The `match` function can be used to custom match named parameters. For example, this can be used to whitelist a small number of valid paths: -#### Unnamed Parameters +```js +const urlMatch = match("/users/:id/:tab(home|photos|bio)", { + decode: decodeURIComponent, +}); -It is possible to write an unnamed parameter that only consists of a matching group. It works the same as a named parameter, except it will be numerically indexed. +urlMatch("/users/1234/photos"); +//=> { path: '/users/1234/photos', index: 0, params: { id: '1234', tab: 'photos' } } -```js -var re = pathToRegexp('/:foo/(.*)', keys) -// keys = [{ name: 'foo', ... }, { name: 0, ... }] +urlMatch("/users/1234/bio"); +//=> { path: '/users/1234/bio', index: 0, params: { id: '1234', tab: 'bio' } } -re.exec('/test/route') -//=> ['/test/route', 'test', 'route'] +urlMatch("/users/1234/otherstuff"); +//=> false ``` -#### Asterisk +#### Process Pathname -An asterisk can be used for matching everything. It is equivalent to an unnamed matching group of `(.*)`. +You should make sure variations of the same path match the expected `path`. Here's one possible solution using `encode`: ```js -var re = pathToRegexp('/foo/*', keys) -// keys = [{ name: '0', ... }] +const fn = match("/café", { encode: encodeURI }); + +fn("/caf%C3%A9"); //=> { path: '/caf%C3%A9', index: 0, params: {} } +``` + +**Note:** [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) encodes paths, so `/café` would be normalized to `/caf%C3%A9` and match in the above example. -re.exec('/foo/bar/baz') -//=> ['/foo/bar/baz', 'bar/baz'] +##### Alternative Using Normalize + +Sometimes you won't have already normalized paths to use, so you could normalize it yourself before matching: + +```js +/** + * Normalize a pathname for matching, replaces multiple slashes with a single + * slash and normalizes unicode characters to "NFC". When using this method, + * `decode` should be an identity function so you don't decode strings twice. + */ +function normalizePathname(pathname: string) { + return ( + decodeURI(pathname) + // Replaces repeated slashes in the URL. + .replace(/\/+/g, "/") + // Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize + // Note: Missing native IE support, may want to skip this step. + .normalize() + ); +} + +// Two possible ways of writing `/café`: +const re = pathToRegexp("/caf\u00E9"); +const input = encodeURI("/cafe\u0301"); + +re.test(input); //=> false +re.test(normalizePathname(input)); //=> true ``` ### Parse -The parse function is exposed via `pathToRegexp.parse`. This will return an array of strings and keys. +The `parse` function will return a list of strings and keys from a path string: ```js -var tokens = pathToRegexp.parse('/route/:foo/(.*)') +const tokens = parse("/route/:foo/(.*)"); -console.log(tokens[0]) +console.log(tokens[0]); //=> "/route" -console.log(tokens[1]) -//=> { name: 'foo', prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '[^\\/]+?' } +console.log(tokens[1]); +//=> { name: 'foo', prefix: '/', suffix: '', pattern: '[^\\/#\\?]+?', modifier: '' } -console.log(tokens[2]) -//=> { name: 0, prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '.*' } +console.log(tokens[2]); +//=> { name: 0, prefix: '/', suffix: '', pattern: '.*', modifier: '' } ``` -**Note:** This method only works with Express-style strings. +**Note:** This method only works with strings. ### Compile ("Reverse" Path-To-RegExp) -Path-To-RegExp exposes a compile function for transforming an Express-style path into a valid path. +The `compile` function will return a function for transforming parameters into a valid path: ```js -var toPath = pathToRegexp.compile('/user/:id') +// Make sure you encode your path segments consistently. +const toPath = compile("/user/:id", { encode: encodeURIComponent }); -toPath({ id: 123 }) //=> "/user/123" -toPath({ id: 'café' }) //=> "/user/caf%C3%A9" -toPath({ id: '/' }) //=> "/user/%2F" +toPath({ id: 123 }); //=> "/user/123" +toPath({ id: "café" }); //=> "/user/caf%C3%A9" +toPath({ id: "/" }); //=> "/user/%2F" -toPath({ id: ':' }) //=> "/user/%3A" -toPath({ id: ':' }, { pretty: true }) //=> "/user/:" +toPath({ id: ":/" }); //=> "/user/%3A%2F" -var toPathRepeated = pathToRegexp.compile('/:segment+') +// Without `encode`, you need to make sure inputs are encoded correctly. +const toPathRaw = compile("/user/:id"); -toPathRepeated({ segment: 'foo' }) //=> "/foo" -toPathRepeated({ segment: ['a', 'b', 'c'] }) //=> "/a/b/c" +toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F" +toPathRaw({ id: ":/" }, { validate: false }); //=> "/user/:/" -var toPathRegexp = pathToRegexp.compile('/user/:id(\\d+)') +const toPathRepeated = compile("/:segment+"); -toPathRegexp({ id: 123 }) //=> "/user/123" -toPathRegexp({ id: '123' }) //=> "/user/123" -toPathRegexp({ id: 'abc' }) //=> Throws `TypeError`. +toPathRepeated({ segment: "foo" }); //=> "/foo" +toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c" + +const toPathRegexp = compile("/user/:id(\\d+)"); + +toPathRegexp({ id: 123 }); //=> "/user/123" +toPathRegexp({ id: "123" }); //=> "/user/123" +toPathRegexp({ id: "abc" }); //=> Throws `TypeError`. +toPathRegexp({ id: "abc" }, { validate: false }); //=> "/user/abc" ``` -**Note:** The generated function will throw on invalid input. It will do all necessary checks to ensure the generated path is valid. This method only works with strings. +**Note:** The generated function will throw on invalid input. ### Working with Tokens -Path-To-RegExp exposes the two functions used internally that accept an array of tokens. +Path-To-RegExp exposes the two functions used internally that accept an array of tokens: -* `pathToRegexp.tokensToRegExp(tokens, options)` Transform an array of tokens into a matching regular expression. -* `pathToRegexp.tokensToFunction(tokens)` Transform an array of tokens into a path generator function. +- `tokensToRegexp(tokens, keys?, options?)` Transform an array of tokens into a matching regular expression. +- `tokensToFunction(tokens)` Transform an array of tokens into a path generator function. #### Token Information -* `name` The name of the token (`string` for named or `number` for index) -* `prefix` The prefix character for the segment (`/` or `.`) -* `delimiter` The delimiter for the segment (same as prefix or `/`) -* `optional` Indicates the token is optional (`boolean`) -* `repeat` Indicates the token is repeated (`boolean`) -* `partial` Indicates this token is a partial path segment (`boolean`) -* `pattern` The RegExp used to match this token (`string`) -* `asterisk` Indicates the token is an `*` match (`boolean`) +- `name` The name of the token (`string` for named or `number` for unnamed index) +- `prefix` The prefix string for the segment (e.g. `"/"`) +- `suffix` The suffix string for the segment (e.g. `""`) +- `pattern` The RegExp used to match this token (`string`) +- `modifier` The modifier character used for the segment (e.g. `?`) ## Compatibility with Express <= 4.x Path-To-RegExp breaks compatibility with Express <= `4.x`: -* No longer a direct conversion to a RegExp with sugar on top - it's a path matcher with named and unnamed matching groups - * It's unlikely you previously abused this feature, it's rare and you could always use a RegExp instead -* All matching RegExp special characters can be used in a matching group. E.g. `/:user(.*)` - * Other RegExp features are not support - no nested matching groups, non-capturing groups or look aheads -* Parameters have suffixes that augment meaning - `*`, `+` and `?`. E.g. `/:user*` - -## TypeScript - -Includes a [`.d.ts`](index.d.ts) file for TypeScript users. +- RegExp special characters can only be used in a parameter + - Express.js 4.x supported `RegExp` special characters regardless of position - this is considered a bug +- Parameters have suffixes that augment meaning - `*`, `+` and `?`. E.g. `/:user*` +- No wildcard asterisk (`*`) - use parameters instead (`(.*)` or `:splat*`) ## Live Demo -You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/). +You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.io/express-route-tester/). ## License MIT -[npm-image]: https://img.shields.io/npm/v/path-to-regexp.svg?style=flat +[npm-image]: https://img.shields.io/npm/v/path-to-regexp [npm-url]: https://npmjs.org/package/path-to-regexp -[travis-image]: https://img.shields.io/travis/pillarjs/path-to-regexp.svg?style=flat -[travis-url]: https://travis-ci.org/pillarjs/path-to-regexp -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/path-to-regexp.svg?style=flat -[coveralls-url]: https://coveralls.io/r/pillarjs/path-to-regexp?branch=master -[david-image]: http://img.shields.io/david/pillarjs/path-to-regexp.svg?style=flat -[david-url]: https://david-dm.org/pillarjs/path-to-regexp +[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp +[downloads-url]: https://npmjs.org/package/path-to-regexp +[build-image]: https://img.shields.io/github/workflow/status/pillarjs/path-to-regexp/CI/master +[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp +[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp [license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat [license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/path-to-regexp.svg?style=flat -[downloads-url]: https://npmjs.org/package/path-to-regexp diff --git a/build/node_modules/path-to-regexp/dist.es2015/index.js b/build/node_modules/path-to-regexp/dist.es2015/index.js new file mode 100644 index 00000000..f891c1b9 --- /dev/null +++ b/build/node_modules/path-to-regexp/dist.es2015/index.js @@ -0,0 +1,400 @@ +/** + * Tokenize input string. + */ +function lexer(str) { + var tokens = []; + var i = 0; + while (i < str.length) { + var char = str[i]; + if (char === "*" || char === "+" || char === "?") { + tokens.push({ type: "MODIFIER", index: i, value: str[i++] }); + continue; + } + if (char === "\\") { + tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] }); + continue; + } + if (char === "{") { + tokens.push({ type: "OPEN", index: i, value: str[i++] }); + continue; + } + if (char === "}") { + tokens.push({ type: "CLOSE", index: i, value: str[i++] }); + continue; + } + if (char === ":") { + var name = ""; + var j = i + 1; + while (j < str.length) { + var code = str.charCodeAt(j); + if ( + // `0-9` + (code >= 48 && code <= 57) || + // `A-Z` + (code >= 65 && code <= 90) || + // `a-z` + (code >= 97 && code <= 122) || + // `_` + code === 95) { + name += str[j++]; + continue; + } + break; + } + if (!name) + throw new TypeError("Missing parameter name at ".concat(i)); + tokens.push({ type: "NAME", index: i, value: name }); + i = j; + continue; + } + if (char === "(") { + var count = 1; + var pattern = ""; + var j = i + 1; + if (str[j] === "?") { + throw new TypeError("Pattern cannot start with \"?\" at ".concat(j)); + } + while (j < str.length) { + if (str[j] === "\\") { + pattern += str[j++] + str[j++]; + continue; + } + if (str[j] === ")") { + count--; + if (count === 0) { + j++; + break; + } + } + else if (str[j] === "(") { + count++; + if (str[j + 1] !== "?") { + throw new TypeError("Capturing groups are not allowed at ".concat(j)); + } + } + pattern += str[j++]; + } + if (count) + throw new TypeError("Unbalanced pattern at ".concat(i)); + if (!pattern) + throw new TypeError("Missing pattern at ".concat(i)); + tokens.push({ type: "PATTERN", index: i, value: pattern }); + i = j; + continue; + } + tokens.push({ type: "CHAR", index: i, value: str[i++] }); + } + tokens.push({ type: "END", index: i, value: "" }); + return tokens; +} +/** + * Parse a string for the raw tokens. + */ +export function parse(str, options) { + if (options === void 0) { options = {}; } + var tokens = lexer(str); + var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a; + var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?"); + var result = []; + var key = 0; + var i = 0; + var path = ""; + var tryConsume = function (type) { + if (i < tokens.length && tokens[i].type === type) + return tokens[i++].value; + }; + var mustConsume = function (type) { + var value = tryConsume(type); + if (value !== undefined) + return value; + var _a = tokens[i], nextType = _a.type, index = _a.index; + throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); + }; + var consumeText = function () { + var result = ""; + var value; + while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) { + result += value; + } + return result; + }; + while (i < tokens.length) { + var char = tryConsume("CHAR"); + var name = tryConsume("NAME"); + var pattern = tryConsume("PATTERN"); + if (name || pattern) { + var prefix = char || ""; + if (prefixes.indexOf(prefix) === -1) { + path += prefix; + prefix = ""; + } + if (path) { + result.push(path); + path = ""; + } + result.push({ + name: name || key++, + prefix: prefix, + suffix: "", + pattern: pattern || defaultPattern, + modifier: tryConsume("MODIFIER") || "", + }); + continue; + } + var value = char || tryConsume("ESCAPED_CHAR"); + if (value) { + path += value; + continue; + } + if (path) { + result.push(path); + path = ""; + } + var open = tryConsume("OPEN"); + if (open) { + var prefix = consumeText(); + var name_1 = tryConsume("NAME") || ""; + var pattern_1 = tryConsume("PATTERN") || ""; + var suffix = consumeText(); + mustConsume("CLOSE"); + result.push({ + name: name_1 || (pattern_1 ? key++ : ""), + pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1, + prefix: prefix, + suffix: suffix, + modifier: tryConsume("MODIFIER") || "", + }); + continue; + } + mustConsume("END"); + } + return result; +} +/** + * Compile a string to a template function for the path. + */ +export function compile(str, options) { + return tokensToFunction(parse(str, options), options); +} +/** + * Expose a method for transforming tokens into the path function. + */ +export function tokensToFunction(tokens, options) { + if (options === void 0) { options = {}; } + var reFlags = flags(options); + var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; + // Compile all the tokens into regexps. + var matches = tokens.map(function (token) { + if (typeof token === "object") { + return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags); + } + }); + return function (data) { + var path = ""; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (typeof token === "string") { + path += token; + continue; + } + var value = data ? data[token.name] : undefined; + var optional = token.modifier === "?" || token.modifier === "*"; + var repeat = token.modifier === "*" || token.modifier === "+"; + if (Array.isArray(value)) { + if (!repeat) { + throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array")); + } + if (value.length === 0) { + if (optional) + continue; + throw new TypeError("Expected \"".concat(token.name, "\" to not be empty")); + } + for (var j = 0; j < value.length; j++) { + var segment = encode(value[j], token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); + } + path += token.prefix + segment + token.suffix; + } + continue; + } + if (typeof value === "string" || typeof value === "number") { + var segment = encode(String(value), token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); + } + path += token.prefix + segment + token.suffix; + continue; + } + if (optional) + continue; + var typeOfMessage = repeat ? "an array" : "a string"; + throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage)); + } + return path; + }; +} +/** + * Create path match function from `path-to-regexp` spec. + */ +export function match(str, options) { + var keys = []; + var re = pathToRegexp(str, keys, options); + return regexpToFunction(re, keys, options); +} +/** + * Create a path match function from `path-to-regexp` output. + */ +export function regexpToFunction(re, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a; + return function (pathname) { + var m = re.exec(pathname); + if (!m) + return false; + var path = m[0], index = m.index; + var params = Object.create(null); + var _loop_1 = function (i) { + if (m[i] === undefined) + return "continue"; + var key = keys[i - 1]; + if (key.modifier === "*" || key.modifier === "+") { + params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) { + return decode(value, key); + }); + } + else { + params[key.name] = decode(m[i], key); + } + }; + for (var i = 1; i < m.length; i++) { + _loop_1(i); + } + return { path: path, index: index, params: params }; + }; +} +/** + * Escape a regular expression string. + */ +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); +} +/** + * Get the flags for a regexp from the options. + */ +function flags(options) { + return options && options.sensitive ? "" : "i"; +} +/** + * Pull out keys from a regexp. + */ +function regexpToRegexp(path, keys) { + if (!keys) + return path; + var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; + var index = 0; + var execResult = groupsRegex.exec(path.source); + while (execResult) { + keys.push({ + // Use parenthesized substring match if available, index otherwise + name: execResult[1] || index++, + prefix: "", + suffix: "", + modifier: "", + pattern: "", + }); + execResult = groupsRegex.exec(path.source); + } + return path; +} +/** + * Transform an array into a regexp. + */ +function arrayToRegexp(paths, keys, options) { + var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; }); + return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options)); +} +/** + * Create a path regexp from string input. + */ +function stringToRegexp(path, keys, options) { + return tokensToRegexp(parse(path, options), keys, options); +} +/** + * Expose a function for taking tokens and returning a RegExp. + */ +export function tokensToRegexp(tokens, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f; + var endsWithRe = "[".concat(escapeString(endsWith), "]|$"); + var delimiterRe = "[".concat(escapeString(delimiter), "]"); + var route = start ? "^" : ""; + // Iterate over the tokens and create our regexp string. + for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { + var token = tokens_1[_i]; + if (typeof token === "string") { + route += escapeString(encode(token)); + } + else { + var prefix = escapeString(encode(token.prefix)); + var suffix = escapeString(encode(token.suffix)); + if (token.pattern) { + if (keys) + keys.push(token); + if (prefix || suffix) { + if (token.modifier === "+" || token.modifier === "*") { + var mod = token.modifier === "*" ? "?" : ""; + route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod); + } + else { + route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier); + } + } + else { + if (token.modifier === "+" || token.modifier === "*") { + route += "((?:".concat(token.pattern, ")").concat(token.modifier, ")"); + } + else { + route += "(".concat(token.pattern, ")").concat(token.modifier); + } + } + } + else { + route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier); + } + } + } + if (end) { + if (!strict) + route += "".concat(delimiterRe, "?"); + route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); + } + else { + var endToken = tokens[tokens.length - 1]; + var isEndDelimited = typeof endToken === "string" + ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 + : endToken === undefined; + if (!strict) { + route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); + } + if (!isEndDelimited) { + route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); + } + } + return new RegExp(route, flags(options)); +} +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + */ +export function pathToRegexp(path, keys, options) { + if (path instanceof RegExp) + return regexpToRegexp(path, keys); + if (Array.isArray(path)) + return arrayToRegexp(path, keys, options); + return stringToRegexp(path, keys, options); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/node_modules/path-to-regexp/dist.es2015/index.js.map b/build/node_modules/path-to-regexp/dist.es2015/index.js.map new file mode 100644 index 00000000..7d2fc720 --- /dev/null +++ b/build/node_modules/path-to-regexp/dist.es2015/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,SAAS,KAAK,CAAC,GAAW;IACxB,IAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;QACrB,IAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;YAChD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC7D,SAAS;SACV;QAED,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACnE,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACzD,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC1D,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEd,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACrB,IAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAE/B;gBACE,QAAQ;gBACR,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC1B,QAAQ;oBACR,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC1B,QAAQ;oBACR,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,GAAG,CAAC;oBAC3B,MAAM;oBACN,IAAI,KAAK,EAAE,EACX;oBACA,IAAI,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;oBACjB,SAAS;iBACV;gBAED,MAAM;aACP;YAED,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI,SAAS,CAAC,oCAA6B,CAAC,CAAE,CAAC,CAAC;YAEjE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrD,CAAC,GAAG,CAAC,CAAC;YACN,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEd,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;gBAClB,MAAM,IAAI,SAAS,CAAC,6CAAoC,CAAC,CAAE,CAAC,CAAC;aAC9D;YAED,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACrB,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;oBACnB,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;oBAC/B,SAAS;iBACV;gBAED,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBAClB,KAAK,EAAE,CAAC;oBACR,IAAI,KAAK,KAAK,CAAC,EAAE;wBACf,CAAC,EAAE,CAAC;wBACJ,MAAM;qBACP;iBACF;qBAAM,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACzB,KAAK,EAAE,CAAC;oBACR,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;wBACtB,MAAM,IAAI,SAAS,CAAC,8CAAuC,CAAC,CAAE,CAAC,CAAC;qBACjE;iBACF;gBAED,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;aACrB;YAED,IAAI,KAAK;gBAAE,MAAM,IAAI,SAAS,CAAC,gCAAyB,CAAC,CAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,SAAS,CAAC,6BAAsB,CAAC,CAAE,CAAC,CAAC;YAE7D,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC,GAAG,CAAC,CAAC;YACN,SAAS;SACV;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KAC1D;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC;AAChB,CAAC;AAaD;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,GAAW,EAAE,OAA0B;IAA1B,wBAAA,EAAA,YAA0B;IAC3D,IAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,IAAA,KAAoB,OAAO,SAAZ,EAAf,QAAQ,mBAAG,IAAI,KAAA,CAAa;IACpC,IAAM,cAAc,GAAG,YAAK,YAAY,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,QAAK,CAAC;IAC1E,IAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,IAAM,UAAU,GAAG,UAAC,IAAsB;QACxC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC,CAAC;IAEF,IAAM,WAAW,GAAG,UAAC,IAAsB;QACzC,IAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAChC,IAAA,KAA4B,MAAM,CAAC,CAAC,CAAC,EAA7B,QAAQ,UAAA,EAAE,KAAK,WAAc,CAAC;QAC5C,MAAM,IAAI,SAAS,CAAC,qBAAc,QAAQ,iBAAO,KAAK,wBAAc,IAAI,CAAE,CAAC,CAAC;IAC9E,CAAC,CAAC;IAEF,IAAM,WAAW,GAAG;QAClB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,KAAyB,CAAC;QAC9B,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC;SACjB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;QACxB,IAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,IAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,IAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;QAEtC,IAAI,IAAI,IAAI,OAAO,EAAE;YACnB,IAAI,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YAExB,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;gBACnC,IAAI,IAAI,MAAM,CAAC;gBACf,MAAM,GAAG,EAAE,CAAC;aACb;YAED,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,IAAI,GAAG,EAAE,CAAC;aACX;YAED,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,IAAI,IAAI,GAAG,EAAE;gBACnB,MAAM,QAAA;gBACN,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,OAAO,IAAI,cAAc;gBAClC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE;aACvC,CAAC,CAAC;YACH,SAAS;SACV;QAED,IAAM,KAAK,GAAG,IAAI,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC;QACjD,IAAI,KAAK,EAAE;YACT,IAAI,IAAI,KAAK,CAAC;YACd,SAAS;SACV;QAED,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,IAAI,GAAG,EAAE,CAAC;SACX;QAED,IAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,IAAI,EAAE;YACR,IAAM,MAAM,GAAG,WAAW,EAAE,CAAC;YAC7B,IAAM,MAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACtC,IAAM,SAAO,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAM,MAAM,GAAG,WAAW,EAAE,CAAC;YAE7B,WAAW,CAAC,OAAO,CAAC,CAAC;YAErB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,MAAI,IAAI,CAAC,SAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,MAAI,IAAI,CAAC,SAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAO;gBACpD,MAAM,QAAA;gBACN,MAAM,QAAA;gBACN,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE;aACvC,CAAC,CAAC;YACH,SAAS;SACV;QAED,WAAW,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAiBD;;GAEG;AACH,MAAM,UAAU,OAAO,CACrB,GAAW,EACX,OAAgD;IAEhD,OAAO,gBAAgB,CAAI,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAID;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAe,EACf,OAAqC;IAArC,wBAAA,EAAA,YAAqC;IAErC,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,IAAA,KAA+C,OAAO,OAA7B,EAAzB,MAAM,mBAAG,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC,KAAA,EAAE,KAAoB,OAAO,SAAZ,EAAf,QAAQ,mBAAG,IAAI,KAAA,CAAa;IAE/D,uCAAuC;IACvC,IAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK;QAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,IAAI,MAAM,CAAC,cAAO,KAAK,CAAC,OAAO,OAAI,EAAE,OAAO,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAC,IAA4C;QAClD,IAAI,IAAI,GAAG,EAAE,CAAC;QAEd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAExB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,IAAI,IAAI,KAAK,CAAC;gBACd,SAAS;aACV;YAED,IAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAClD,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC;YAClE,IAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC;YAEhE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxB,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,IAAI,SAAS,CACjB,qBAAa,KAAK,CAAC,IAAI,uCAAmC,CAC3D,CAAC;iBACH;gBAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;oBACtB,IAAI,QAAQ;wBAAE,SAAS;oBAEvB,MAAM,IAAI,SAAS,CAAC,qBAAa,KAAK,CAAC,IAAI,uBAAmB,CAAC,CAAC;iBACjE;gBAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACrC,IAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;oBAExC,IAAI,QAAQ,IAAI,CAAE,OAAO,CAAC,CAAC,CAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;wBACrD,MAAM,IAAI,SAAS,CACjB,yBAAiB,KAAK,CAAC,IAAI,2BAAe,KAAK,CAAC,OAAO,2BAAe,OAAO,OAAG,CACjF,CAAC;qBACH;oBAED,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;iBAC/C;gBAED,SAAS;aACV;YAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC1D,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;gBAE7C,IAAI,QAAQ,IAAI,CAAE,OAAO,CAAC,CAAC,CAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrD,MAAM,IAAI,SAAS,CACjB,qBAAa,KAAK,CAAC,IAAI,2BAAe,KAAK,CAAC,OAAO,2BAAe,OAAO,OAAG,CAC7E,CAAC;iBACH;gBAED,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC9C,SAAS;aACV;YAED,IAAI,QAAQ;gBAAE,SAAS;YAEvB,IAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;YACvD,MAAM,IAAI,SAAS,CAAC,qBAAa,KAAK,CAAC,IAAI,sBAAW,aAAa,CAAE,CAAC,CAAC;SACxE;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AA8BD;;GAEG;AACH,MAAM,UAAU,KAAK,CACnB,GAAS,EACT,OAAwE;IAExE,IAAM,IAAI,GAAU,EAAE,CAAC;IACvB,IAAM,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,gBAAgB,CAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,EAAU,EACV,IAAW,EACX,OAAqC;IAArC,wBAAA,EAAA,YAAqC;IAE7B,IAAA,KAA8B,OAAO,OAAZ,EAAzB,MAAM,mBAAG,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC,KAAA,CAAa;IAE9C,OAAO,UAAU,QAAgB;QAC/B,IAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAEb,IAAG,IAAI,GAAY,CAAC,GAAb,EAAE,KAAK,GAAK,CAAC,MAAN,CAAO;QAC7B,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gCAE1B,CAAC;YACR,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS;kCAAW;YAEjC,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAExB,IAAI,GAAG,CAAC,QAAQ,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,KAAK,GAAG,EAAE;gBAChD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK;oBAC/D,OAAO,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;aACtC;;QAXH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;oBAAxB,CAAC;SAYT;QAED,OAAO,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,OAAiC;IAC9C,OAAO,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACjD,CAAC;AAkBD;;GAEG;AACH,SAAS,cAAc,CAAC,IAAY,EAAE,IAAY;IAChD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,IAAM,WAAW,GAAG,yBAAyB,CAAC;IAE9C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,UAAU,EAAE;QACjB,IAAI,CAAC,IAAI,CAAC;YACR,kEAAkE;YAClE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE;YAC9B,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QACH,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC5C;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CACpB,KAA6B,EAC7B,IAAY,EACZ,OAA8C;IAE9C,IAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,MAAM,EAAxC,CAAwC,CAAC,CAAC;IAC5E,OAAO,IAAI,MAAM,CAAC,aAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CACrB,IAAY,EACZ,IAAY,EACZ,OAA8C;IAE9C,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC;AAiCD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAe,EACf,IAAY,EACZ,OAAmC;IAAnC,wBAAA,EAAA,YAAmC;IAGjC,IAAA,KAME,OAAO,OANK,EAAd,MAAM,mBAAG,KAAK,KAAA,EACd,KAKE,OAAO,MALG,EAAZ,KAAK,mBAAG,IAAI,KAAA,EACZ,KAIE,OAAO,IAJC,EAAV,GAAG,mBAAG,IAAI,KAAA,EACV,KAGE,OAAO,OAHgB,EAAzB,MAAM,mBAAG,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC,KAAA,EACzB,KAEE,OAAO,UAFQ,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,KACE,OAAO,SADI,EAAb,QAAQ,mBAAG,EAAE,KAAA,CACH;IACZ,IAAM,UAAU,GAAG,WAAI,YAAY,CAAC,QAAQ,CAAC,QAAK,CAAC;IACnD,IAAM,WAAW,GAAG,WAAI,YAAY,CAAC,SAAS,CAAC,MAAG,CAAC;IACnD,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAE7B,wDAAwD;IACxD,KAAoB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,EAAE;QAAvB,IAAM,KAAK,eAAA;QACd,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC;aAAM;YACL,IAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAClD,IAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAElD,IAAI,KAAK,CAAC,OAAO,EAAE;gBACjB,IAAI,IAAI;oBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE3B,IAAI,MAAM,IAAI,MAAM,EAAE;oBACpB,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,EAAE;wBACpD,IAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC9C,KAAK,IAAI,aAAM,MAAM,iBAAO,KAAK,CAAC,OAAO,iBAAO,MAAM,SAAG,MAAM,gBAAM,KAAK,CAAC,OAAO,iBAAO,MAAM,cAAI,GAAG,CAAE,CAAC;qBAC1G;yBAAM;wBACL,KAAK,IAAI,aAAM,MAAM,cAAI,KAAK,CAAC,OAAO,cAAI,MAAM,cAAI,KAAK,CAAC,QAAQ,CAAE,CAAC;qBACtE;iBACF;qBAAM;oBACL,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,EAAE;wBACpD,KAAK,IAAI,cAAO,KAAK,CAAC,OAAO,cAAI,KAAK,CAAC,QAAQ,MAAG,CAAC;qBACpD;yBAAM;wBACL,KAAK,IAAI,WAAI,KAAK,CAAC,OAAO,cAAI,KAAK,CAAC,QAAQ,CAAE,CAAC;qBAChD;iBACF;aACF;iBAAM;gBACL,KAAK,IAAI,aAAM,MAAM,SAAG,MAAM,cAAI,KAAK,CAAC,QAAQ,CAAE,CAAC;aACpD;SACF;KACF;IAED,IAAI,GAAG,EAAE;QACP,IAAI,CAAC,MAAM;YAAE,KAAK,IAAI,UAAG,WAAW,MAAG,CAAC;QAExC,KAAK,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,aAAM,UAAU,MAAG,CAAC;KACxD;SAAM;QACL,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAM,cAAc,GAClB,OAAO,QAAQ,KAAK,QAAQ;YAC1B,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACzD,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC;QAE7B,IAAI,CAAC,MAAM,EAAE;YACX,KAAK,IAAI,aAAM,WAAW,gBAAM,UAAU,QAAK,CAAC;SACjD;QAED,IAAI,CAAC,cAAc,EAAE;YACnB,KAAK,IAAI,aAAM,WAAW,cAAI,UAAU,MAAG,CAAC;SAC7C;KACF;IAED,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3C,CAAC;AAOD;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAU,EACV,IAAY,EACZ,OAA8C;IAE9C,IAAI,IAAI,YAAY,MAAM;QAAE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/**\n * Tokenizer results.\n */\ninterface LexToken {\n type:\n | \"OPEN\"\n | \"CLOSE\"\n | \"PATTERN\"\n | \"NAME\"\n | \"CHAR\"\n | \"ESCAPED_CHAR\"\n | \"MODIFIER\"\n | \"END\";\n index: number;\n value: string;\n}\n\n/**\n * Tokenize input string.\n */\nfunction lexer(str: string): LexToken[] {\n const tokens: LexToken[] = [];\n let i = 0;\n\n while (i < str.length) {\n const char = str[i];\n\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \":\") {\n let name = \"\";\n let j = i + 1;\n\n while (j < str.length) {\n const code = str.charCodeAt(j);\n\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95\n ) {\n name += str[j++];\n continue;\n }\n\n break;\n }\n\n if (!name) throw new TypeError(`Missing parameter name at ${i}`);\n\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n\n if (char === \"(\") {\n let count = 1;\n let pattern = \"\";\n let j = i + 1;\n\n if (str[j] === \"?\") {\n throw new TypeError(`Pattern cannot start with \"?\" at ${j}`);\n }\n\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n } else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(`Capturing groups are not allowed at ${j}`);\n }\n }\n\n pattern += str[j++];\n }\n\n if (count) throw new TypeError(`Unbalanced pattern at ${i}`);\n if (!pattern) throw new TypeError(`Missing pattern at ${i}`);\n\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n\n tokens.push({ type: \"END\", index: i, value: \"\" });\n\n return tokens;\n}\n\nexport interface ParseOptions {\n /**\n * Set the default delimiter for repeat parameters. (default: `'/'`)\n */\n delimiter?: string;\n /**\n * List of characters to automatically consider prefixes when parsing.\n */\n prefixes?: string;\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): Token[] {\n const tokens = lexer(str);\n const { prefixes = \"./\" } = options;\n const defaultPattern = `[^${escapeString(options.delimiter || \"/#?\")}]+?`;\n const result: Token[] = [];\n let key = 0;\n let i = 0;\n let path = \"\";\n\n const tryConsume = (type: LexToken[\"type\"]): string | undefined => {\n if (i < tokens.length && tokens[i].type === type) return tokens[i++].value;\n };\n\n const mustConsume = (type: LexToken[\"type\"]): string => {\n const value = tryConsume(type);\n if (value !== undefined) return value;\n const { type: nextType, index } = tokens[i];\n throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`);\n };\n\n const consumeText = (): string => {\n let result = \"\";\n let value: string | undefined;\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n\n while (i < tokens.length) {\n const char = tryConsume(\"CHAR\");\n const name = tryConsume(\"NAME\");\n const pattern = tryConsume(\"PATTERN\");\n\n if (name || pattern) {\n let prefix = char || \"\";\n\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n\n if (path) {\n result.push(path);\n path = \"\";\n }\n\n result.push({\n name: name || key++,\n prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n\n const value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n\n if (path) {\n result.push(path);\n path = \"\";\n }\n\n const open = tryConsume(\"OPEN\");\n if (open) {\n const prefix = consumeText();\n const name = tryConsume(\"NAME\") || \"\";\n const pattern = tryConsume(\"PATTERN\") || \"\";\n const suffix = consumeText();\n\n mustConsume(\"CLOSE\");\n\n result.push({\n name: name || (pattern ? key++ : \"\"),\n pattern: name && !pattern ? defaultPattern : pattern,\n prefix,\n suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n\n mustConsume(\"END\");\n }\n\n return result;\n}\n\nexport interface TokensToFunctionOptions {\n /**\n * When `true` the regexp will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * Function for encoding input strings for output.\n */\n encode?: (value: string, token: Key) => string;\n /**\n * When `false` the function can produce an invalid (unmatched) path. (default: `true`)\n */\n validate?: boolean;\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

(\n str: string,\n options?: ParseOptions & TokensToFunctionOptions\n) {\n return tokensToFunction

(parse(str, options), options);\n}\n\nexport type PathFunction

= (data?: P) => string;\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction

(\n tokens: Token[],\n options: TokensToFunctionOptions = {}\n): PathFunction

{\n const reFlags = flags(options);\n const { encode = (x: string) => x, validate = true } = options;\n\n // Compile all the tokens into regexps.\n const matches = tokens.map((token) => {\n if (typeof token === \"object\") {\n return new RegExp(`^(?:${token.pattern})$`, reFlags);\n }\n });\n\n return (data: Record | null | undefined) => {\n let path = \"\";\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n\n const value = data ? data[token.name] : undefined;\n const optional = token.modifier === \"?\" || token.modifier === \"*\";\n const repeat = token.modifier === \"*\" || token.modifier === \"+\";\n\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\n `Expected \"${token.name}\" to not repeat, but got an array`\n );\n }\n\n if (value.length === 0) {\n if (optional) continue;\n\n throw new TypeError(`Expected \"${token.name}\" to not be empty`);\n }\n\n for (let j = 0; j < value.length; j++) {\n const segment = encode(value[j], token);\n\n if (validate && !(matches[i] as RegExp).test(segment)) {\n throw new TypeError(\n `Expected all \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`\n );\n }\n\n path += token.prefix + segment + token.suffix;\n }\n\n continue;\n }\n\n if (typeof value === \"string\" || typeof value === \"number\") {\n const segment = encode(String(value), token);\n\n if (validate && !(matches[i] as RegExp).test(segment)) {\n throw new TypeError(\n `Expected \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`\n );\n }\n\n path += token.prefix + segment + token.suffix;\n continue;\n }\n\n if (optional) continue;\n\n const typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(`Expected \"${token.name}\" to be ${typeOfMessage}`);\n }\n\n return path;\n };\n}\n\nexport interface RegexpToFunctionOptions {\n /**\n * Function for decoding strings for params.\n */\n decode?: (value: string, token: Key) => string;\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

{\n path: string;\n index: number;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

= false | MatchResult

;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

= (\n path: string\n) => Match

;\n\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match

(\n str: Path,\n options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions\n) {\n const keys: Key[] = [];\n const re = pathToRegexp(str, keys, options);\n return regexpToFunction

(re, keys, options);\n}\n\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction

(\n re: RegExp,\n keys: Key[],\n options: RegexpToFunctionOptions = {}\n): MatchFunction

{\n const { decode = (x: string) => x } = options;\n\n return function (pathname: string) {\n const m = re.exec(pathname);\n if (!m) return false;\n\n const { 0: path, index } = m;\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map((value) => {\n return decode(value, key);\n });\n } else {\n params[key.name] = decode(m[i], key);\n }\n }\n\n return { path, index, params };\n };\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str: string) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options?: { sensitive?: boolean }) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n\n/**\n * Metadata about a key.\n */\nexport interface Key {\n name: string | number;\n prefix: string;\n suffix: string;\n pattern: string;\n modifier: string;\n}\n\n/**\n * A token is a string (nothing special) or key metadata (capture group).\n */\nexport type Token = string | Key;\n\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path: RegExp, keys?: Key[]): RegExp {\n if (!keys) return path;\n\n const groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n\n let index = 0;\n let execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n\n return path;\n}\n\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(\n paths: Array,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n): RegExp {\n const parts = paths.map((path) => pathToRegexp(path, keys, options).source);\n return new RegExp(`(?:${parts.join(\"|\")})`, flags(options));\n}\n\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(\n path: string,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n\nexport interface TokensToRegexpOptions {\n /**\n * When `true` the regexp will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`)\n */\n strict?: boolean;\n /**\n * When `true` the regexp will match to the end of the string. (default: `true`)\n */\n end?: boolean;\n /**\n * When `true` the regexp will match from the beginning of the string. (default: `true`)\n */\n start?: boolean;\n /**\n * Sets the final character for non-ending optimistic matches. (default: `/`)\n */\n delimiter?: string;\n /**\n * List of characters that can also be \"end\" characters.\n */\n endsWith?: string;\n /**\n * Encode path tokens for use in the `RegExp`.\n */\n encode?: (value: string) => string;\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nexport function tokensToRegexp(\n tokens: Token[],\n keys?: Key[],\n options: TokensToRegexpOptions = {}\n) {\n const {\n strict = false,\n start = true,\n end = true,\n encode = (x: string) => x,\n delimiter = \"/#?\",\n endsWith = \"\",\n } = options;\n const endsWithRe = `[${escapeString(endsWith)}]|$`;\n const delimiterRe = `[${escapeString(delimiter)}]`;\n let route = start ? \"^\" : \"\";\n\n // Iterate over the tokens and create our regexp string.\n for (const token of tokens) {\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n } else {\n const prefix = escapeString(encode(token.prefix));\n const suffix = escapeString(encode(token.suffix));\n\n if (token.pattern) {\n if (keys) keys.push(token);\n\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n const mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += `(?:${prefix}((?:${token.pattern})(?:${suffix}${prefix}(?:${token.pattern}))*)${suffix})${mod}`;\n } else {\n route += `(?:${prefix}(${token.pattern})${suffix})${token.modifier}`;\n }\n } else {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n route += `((?:${token.pattern})${token.modifier})`;\n } else {\n route += `(${token.pattern})${token.modifier}`;\n }\n }\n } else {\n route += `(?:${prefix}${suffix})${token.modifier}`;\n }\n }\n }\n\n if (end) {\n if (!strict) route += `${delimiterRe}?`;\n\n route += !options.endsWith ? \"$\" : `(?=${endsWithRe})`;\n } else {\n const endToken = tokens[tokens.length - 1];\n const isEndDelimited =\n typeof endToken === \"string\"\n ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1\n : endToken === undefined;\n\n if (!strict) {\n route += `(?:${delimiterRe}(?=${endsWithRe}))?`;\n }\n\n if (!isEndDelimited) {\n route += `(?=${delimiterRe}|${endsWithRe})`;\n }\n }\n\n return new RegExp(route, flags(options));\n}\n\n/**\n * Supported `path-to-regexp` input types.\n */\nexport type Path = string | RegExp | Array;\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nexport function pathToRegexp(\n path: Path,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n) {\n if (path instanceof RegExp) return regexpToRegexp(path, keys);\n if (Array.isArray(path)) return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\n"]} \ No newline at end of file diff --git a/build/node_modules/path-to-regexp/dist/index.d.ts b/build/node_modules/path-to-regexp/dist/index.d.ts new file mode 100644 index 00000000..77aa0047 --- /dev/null +++ b/build/node_modules/path-to-regexp/dist/index.d.ts @@ -0,0 +1,127 @@ +export interface ParseOptions { + /** + * Set the default delimiter for repeat parameters. (default: `'/'`) + */ + delimiter?: string; + /** + * List of characters to automatically consider prefixes when parsing. + */ + prefixes?: string; +} +/** + * Parse a string for the raw tokens. + */ +export declare function parse(str: string, options?: ParseOptions): Token[]; +export interface TokensToFunctionOptions { + /** + * When `true` the regexp will be case sensitive. (default: `false`) + */ + sensitive?: boolean; + /** + * Function for encoding input strings for output. + */ + encode?: (value: string, token: Key) => string; + /** + * When `false` the function can produce an invalid (unmatched) path. (default: `true`) + */ + validate?: boolean; +} +/** + * Compile a string to a template function for the path. + */ +export declare function compile

(str: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction

; +export declare type PathFunction

= (data?: P) => string; +/** + * Expose a method for transforming tokens into the path function. + */ +export declare function tokensToFunction

(tokens: Token[], options?: TokensToFunctionOptions): PathFunction

; +export interface RegexpToFunctionOptions { + /** + * Function for decoding strings for params. + */ + decode?: (value: string, token: Key) => string; +} +/** + * A match result contains data about the path match. + */ +export interface MatchResult

{ + path: string; + index: number; + params: P; +} +/** + * A match is either `false` (no match) or a match result. + */ +export declare type Match

= false | MatchResult

; +/** + * The match function takes a string and returns whether it matched the path. + */ +export declare type MatchFunction

= (path: string) => Match

; +/** + * Create path match function from `path-to-regexp` spec. + */ +export declare function match

(str: Path, options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions): MatchFunction

; +/** + * Create a path match function from `path-to-regexp` output. + */ +export declare function regexpToFunction

(re: RegExp, keys: Key[], options?: RegexpToFunctionOptions): MatchFunction

; +/** + * Metadata about a key. + */ +export interface Key { + name: string | number; + prefix: string; + suffix: string; + pattern: string; + modifier: string; +} +/** + * A token is a string (nothing special) or key metadata (capture group). + */ +export declare type Token = string | Key; +export interface TokensToRegexpOptions { + /** + * When `true` the regexp will be case sensitive. (default: `false`) + */ + sensitive?: boolean; + /** + * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`) + */ + strict?: boolean; + /** + * When `true` the regexp will match to the end of the string. (default: `true`) + */ + end?: boolean; + /** + * When `true` the regexp will match from the beginning of the string. (default: `true`) + */ + start?: boolean; + /** + * Sets the final character for non-ending optimistic matches. (default: `/`) + */ + delimiter?: string; + /** + * List of characters that can also be "end" characters. + */ + endsWith?: string; + /** + * Encode path tokens for use in the `RegExp`. + */ + encode?: (value: string) => string; +} +/** + * Expose a function for taking tokens and returning a RegExp. + */ +export declare function tokensToRegexp(tokens: Token[], keys?: Key[], options?: TokensToRegexpOptions): RegExp; +/** + * Supported `path-to-regexp` input types. + */ +export declare type Path = string | RegExp | Array; +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + */ +export declare function pathToRegexp(path: Path, keys?: Key[], options?: TokensToRegexpOptions & ParseOptions): RegExp; diff --git a/build/node_modules/path-to-regexp/dist/index.js b/build/node_modules/path-to-regexp/dist/index.js new file mode 100644 index 00000000..a512e460 --- /dev/null +++ b/build/node_modules/path-to-regexp/dist/index.js @@ -0,0 +1,410 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pathToRegexp = exports.tokensToRegexp = exports.regexpToFunction = exports.match = exports.tokensToFunction = exports.compile = exports.parse = void 0; +/** + * Tokenize input string. + */ +function lexer(str) { + var tokens = []; + var i = 0; + while (i < str.length) { + var char = str[i]; + if (char === "*" || char === "+" || char === "?") { + tokens.push({ type: "MODIFIER", index: i, value: str[i++] }); + continue; + } + if (char === "\\") { + tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] }); + continue; + } + if (char === "{") { + tokens.push({ type: "OPEN", index: i, value: str[i++] }); + continue; + } + if (char === "}") { + tokens.push({ type: "CLOSE", index: i, value: str[i++] }); + continue; + } + if (char === ":") { + var name = ""; + var j = i + 1; + while (j < str.length) { + var code = str.charCodeAt(j); + if ( + // `0-9` + (code >= 48 && code <= 57) || + // `A-Z` + (code >= 65 && code <= 90) || + // `a-z` + (code >= 97 && code <= 122) || + // `_` + code === 95) { + name += str[j++]; + continue; + } + break; + } + if (!name) + throw new TypeError("Missing parameter name at ".concat(i)); + tokens.push({ type: "NAME", index: i, value: name }); + i = j; + continue; + } + if (char === "(") { + var count = 1; + var pattern = ""; + var j = i + 1; + if (str[j] === "?") { + throw new TypeError("Pattern cannot start with \"?\" at ".concat(j)); + } + while (j < str.length) { + if (str[j] === "\\") { + pattern += str[j++] + str[j++]; + continue; + } + if (str[j] === ")") { + count--; + if (count === 0) { + j++; + break; + } + } + else if (str[j] === "(") { + count++; + if (str[j + 1] !== "?") { + throw new TypeError("Capturing groups are not allowed at ".concat(j)); + } + } + pattern += str[j++]; + } + if (count) + throw new TypeError("Unbalanced pattern at ".concat(i)); + if (!pattern) + throw new TypeError("Missing pattern at ".concat(i)); + tokens.push({ type: "PATTERN", index: i, value: pattern }); + i = j; + continue; + } + tokens.push({ type: "CHAR", index: i, value: str[i++] }); + } + tokens.push({ type: "END", index: i, value: "" }); + return tokens; +} +/** + * Parse a string for the raw tokens. + */ +function parse(str, options) { + if (options === void 0) { options = {}; } + var tokens = lexer(str); + var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a; + var defaultPattern = "[^".concat(escapeString(options.delimiter || "/#?"), "]+?"); + var result = []; + var key = 0; + var i = 0; + var path = ""; + var tryConsume = function (type) { + if (i < tokens.length && tokens[i].type === type) + return tokens[i++].value; + }; + var mustConsume = function (type) { + var value = tryConsume(type); + if (value !== undefined) + return value; + var _a = tokens[i], nextType = _a.type, index = _a.index; + throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index, ", expected ").concat(type)); + }; + var consumeText = function () { + var result = ""; + var value; + while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) { + result += value; + } + return result; + }; + while (i < tokens.length) { + var char = tryConsume("CHAR"); + var name = tryConsume("NAME"); + var pattern = tryConsume("PATTERN"); + if (name || pattern) { + var prefix = char || ""; + if (prefixes.indexOf(prefix) === -1) { + path += prefix; + prefix = ""; + } + if (path) { + result.push(path); + path = ""; + } + result.push({ + name: name || key++, + prefix: prefix, + suffix: "", + pattern: pattern || defaultPattern, + modifier: tryConsume("MODIFIER") || "", + }); + continue; + } + var value = char || tryConsume("ESCAPED_CHAR"); + if (value) { + path += value; + continue; + } + if (path) { + result.push(path); + path = ""; + } + var open = tryConsume("OPEN"); + if (open) { + var prefix = consumeText(); + var name_1 = tryConsume("NAME") || ""; + var pattern_1 = tryConsume("PATTERN") || ""; + var suffix = consumeText(); + mustConsume("CLOSE"); + result.push({ + name: name_1 || (pattern_1 ? key++ : ""), + pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1, + prefix: prefix, + suffix: suffix, + modifier: tryConsume("MODIFIER") || "", + }); + continue; + } + mustConsume("END"); + } + return result; +} +exports.parse = parse; +/** + * Compile a string to a template function for the path. + */ +function compile(str, options) { + return tokensToFunction(parse(str, options), options); +} +exports.compile = compile; +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction(tokens, options) { + if (options === void 0) { options = {}; } + var reFlags = flags(options); + var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; + // Compile all the tokens into regexps. + var matches = tokens.map(function (token) { + if (typeof token === "object") { + return new RegExp("^(?:".concat(token.pattern, ")$"), reFlags); + } + }); + return function (data) { + var path = ""; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (typeof token === "string") { + path += token; + continue; + } + var value = data ? data[token.name] : undefined; + var optional = token.modifier === "?" || token.modifier === "*"; + var repeat = token.modifier === "*" || token.modifier === "+"; + if (Array.isArray(value)) { + if (!repeat) { + throw new TypeError("Expected \"".concat(token.name, "\" to not repeat, but got an array")); + } + if (value.length === 0) { + if (optional) + continue; + throw new TypeError("Expected \"".concat(token.name, "\" to not be empty")); + } + for (var j = 0; j < value.length; j++) { + var segment = encode(value[j], token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected all \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); + } + path += token.prefix + segment + token.suffix; + } + continue; + } + if (typeof value === "string" || typeof value === "number") { + var segment = encode(String(value), token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected \"".concat(token.name, "\" to match \"").concat(token.pattern, "\", but got \"").concat(segment, "\"")); + } + path += token.prefix + segment + token.suffix; + continue; + } + if (optional) + continue; + var typeOfMessage = repeat ? "an array" : "a string"; + throw new TypeError("Expected \"".concat(token.name, "\" to be ").concat(typeOfMessage)); + } + return path; + }; +} +exports.tokensToFunction = tokensToFunction; +/** + * Create path match function from `path-to-regexp` spec. + */ +function match(str, options) { + var keys = []; + var re = pathToRegexp(str, keys, options); + return regexpToFunction(re, keys, options); +} +exports.match = match; +/** + * Create a path match function from `path-to-regexp` output. + */ +function regexpToFunction(re, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a; + return function (pathname) { + var m = re.exec(pathname); + if (!m) + return false; + var path = m[0], index = m.index; + var params = Object.create(null); + var _loop_1 = function (i) { + if (m[i] === undefined) + return "continue"; + var key = keys[i - 1]; + if (key.modifier === "*" || key.modifier === "+") { + params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) { + return decode(value, key); + }); + } + else { + params[key.name] = decode(m[i], key); + } + }; + for (var i = 1; i < m.length; i++) { + _loop_1(i); + } + return { path: path, index: index, params: params }; + }; +} +exports.regexpToFunction = regexpToFunction; +/** + * Escape a regular expression string. + */ +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); +} +/** + * Get the flags for a regexp from the options. + */ +function flags(options) { + return options && options.sensitive ? "" : "i"; +} +/** + * Pull out keys from a regexp. + */ +function regexpToRegexp(path, keys) { + if (!keys) + return path; + var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; + var index = 0; + var execResult = groupsRegex.exec(path.source); + while (execResult) { + keys.push({ + // Use parenthesized substring match if available, index otherwise + name: execResult[1] || index++, + prefix: "", + suffix: "", + modifier: "", + pattern: "", + }); + execResult = groupsRegex.exec(path.source); + } + return path; +} +/** + * Transform an array into a regexp. + */ +function arrayToRegexp(paths, keys, options) { + var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; }); + return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options)); +} +/** + * Create a path regexp from string input. + */ +function stringToRegexp(path, keys, options) { + return tokensToRegexp(parse(path, options), keys, options); +} +/** + * Expose a function for taking tokens and returning a RegExp. + */ +function tokensToRegexp(tokens, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? "/#?" : _e, _f = options.endsWith, endsWith = _f === void 0 ? "" : _f; + var endsWithRe = "[".concat(escapeString(endsWith), "]|$"); + var delimiterRe = "[".concat(escapeString(delimiter), "]"); + var route = start ? "^" : ""; + // Iterate over the tokens and create our regexp string. + for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { + var token = tokens_1[_i]; + if (typeof token === "string") { + route += escapeString(encode(token)); + } + else { + var prefix = escapeString(encode(token.prefix)); + var suffix = escapeString(encode(token.suffix)); + if (token.pattern) { + if (keys) + keys.push(token); + if (prefix || suffix) { + if (token.modifier === "+" || token.modifier === "*") { + var mod = token.modifier === "*" ? "?" : ""; + route += "(?:".concat(prefix, "((?:").concat(token.pattern, ")(?:").concat(suffix).concat(prefix, "(?:").concat(token.pattern, "))*)").concat(suffix, ")").concat(mod); + } + else { + route += "(?:".concat(prefix, "(").concat(token.pattern, ")").concat(suffix, ")").concat(token.modifier); + } + } + else { + if (token.modifier === "+" || token.modifier === "*") { + route += "((?:".concat(token.pattern, ")").concat(token.modifier, ")"); + } + else { + route += "(".concat(token.pattern, ")").concat(token.modifier); + } + } + } + else { + route += "(?:".concat(prefix).concat(suffix, ")").concat(token.modifier); + } + } + } + if (end) { + if (!strict) + route += "".concat(delimiterRe, "?"); + route += !options.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); + } + else { + var endToken = tokens[tokens.length - 1]; + var isEndDelimited = typeof endToken === "string" + ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 + : endToken === undefined; + if (!strict) { + route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); + } + if (!isEndDelimited) { + route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); + } + } + return new RegExp(route, flags(options)); +} +exports.tokensToRegexp = tokensToRegexp; +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + */ +function pathToRegexp(path, keys, options) { + if (path instanceof RegExp) + return regexpToRegexp(path, keys); + if (Array.isArray(path)) + return arrayToRegexp(path, keys, options); + return stringToRegexp(path, keys, options); +} +exports.pathToRegexp = pathToRegexp; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/node_modules/path-to-regexp/dist/index.js.map b/build/node_modules/path-to-regexp/dist/index.js.map new file mode 100644 index 00000000..47694e1f --- /dev/null +++ b/build/node_modules/path-to-regexp/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAiBA;;GAEG;AACH,SAAS,KAAK,CAAC,GAAW;IACxB,IAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;QACrB,IAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;YAChD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC7D,SAAS;SACV;QAED,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACnE,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACzD,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC1D,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEd,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACrB,IAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBAE/B;gBACE,QAAQ;gBACR,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC1B,QAAQ;oBACR,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;oBAC1B,QAAQ;oBACR,CAAC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,GAAG,CAAC;oBAC3B,MAAM;oBACN,IAAI,KAAK,EAAE,EACX;oBACA,IAAI,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;oBACjB,SAAS;iBACV;gBAED,MAAM;aACP;YAED,IAAI,CAAC,IAAI;gBAAE,MAAM,IAAI,SAAS,CAAC,oCAA6B,CAAC,CAAE,CAAC,CAAC;YAEjE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACrD,CAAC,GAAG,CAAC,CAAC;YACN,SAAS;SACV;QAED,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEd,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;gBAClB,MAAM,IAAI,SAAS,CAAC,6CAAoC,CAAC,CAAE,CAAC,CAAC;aAC9D;YAED,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACrB,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;oBACnB,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;oBAC/B,SAAS;iBACV;gBAED,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBAClB,KAAK,EAAE,CAAC;oBACR,IAAI,KAAK,KAAK,CAAC,EAAE;wBACf,CAAC,EAAE,CAAC;wBACJ,MAAM;qBACP;iBACF;qBAAM,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACzB,KAAK,EAAE,CAAC;oBACR,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;wBACtB,MAAM,IAAI,SAAS,CAAC,8CAAuC,CAAC,CAAE,CAAC,CAAC;qBACjE;iBACF;gBAED,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;aACrB;YAED,IAAI,KAAK;gBAAE,MAAM,IAAI,SAAS,CAAC,gCAAyB,CAAC,CAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,SAAS,CAAC,6BAAsB,CAAC,CAAE,CAAC,CAAC;YAE7D,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC,GAAG,CAAC,CAAC;YACN,SAAS;SACV;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KAC1D;IAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC;AAChB,CAAC;AAaD;;GAEG;AACH,SAAgB,KAAK,CAAC,GAAW,EAAE,OAA0B;IAA1B,wBAAA,EAAA,YAA0B;IAC3D,IAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,IAAA,KAAoB,OAAO,SAAZ,EAAf,QAAQ,mBAAG,IAAI,KAAA,CAAa;IACpC,IAAM,cAAc,GAAG,YAAK,YAAY,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,QAAK,CAAC;IAC1E,IAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,IAAI,IAAI,GAAG,EAAE,CAAC;IAEd,IAAM,UAAU,GAAG,UAAC,IAAsB;QACxC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC;IAC7E,CAAC,CAAC;IAEF,IAAM,WAAW,GAAG,UAAC,IAAsB;QACzC,IAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAChC,IAAA,KAA4B,MAAM,CAAC,CAAC,CAAC,EAA7B,QAAQ,UAAA,EAAE,KAAK,WAAc,CAAC;QAC5C,MAAM,IAAI,SAAS,CAAC,qBAAc,QAAQ,iBAAO,KAAK,wBAAc,IAAI,CAAE,CAAC,CAAC;IAC9E,CAAC,CAAC;IAEF,IAAM,WAAW,GAAG;QAClB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,KAAyB,CAAC;QAC9B,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC;SACjB;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;QACxB,IAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,IAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,IAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;QAEtC,IAAI,IAAI,IAAI,OAAO,EAAE;YACnB,IAAI,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YAExB,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;gBACnC,IAAI,IAAI,MAAM,CAAC;gBACf,MAAM,GAAG,EAAE,CAAC;aACb;YAED,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,IAAI,GAAG,EAAE,CAAC;aACX;YAED,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,IAAI,IAAI,GAAG,EAAE;gBACnB,MAAM,QAAA;gBACN,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,OAAO,IAAI,cAAc;gBAClC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE;aACvC,CAAC,CAAC;YACH,SAAS;SACV;QAED,IAAM,KAAK,GAAG,IAAI,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC;QACjD,IAAI,KAAK,EAAE;YACT,IAAI,IAAI,KAAK,CAAC;YACd,SAAS;SACV;QAED,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClB,IAAI,GAAG,EAAE,CAAC;SACX;QAED,IAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,IAAI,EAAE;YACR,IAAM,MAAM,GAAG,WAAW,EAAE,CAAC;YAC7B,IAAM,MAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACtC,IAAM,SAAO,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAM,MAAM,GAAG,WAAW,EAAE,CAAC;YAE7B,WAAW,CAAC,OAAO,CAAC,CAAC;YAErB,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,MAAI,IAAI,CAAC,SAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpC,OAAO,EAAE,MAAI,IAAI,CAAC,SAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAO;gBACpD,MAAM,QAAA;gBACN,MAAM,QAAA;gBACN,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE;aACvC,CAAC,CAAC;YACH,SAAS;SACV;QAED,WAAW,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA3FD,sBA2FC;AAiBD;;GAEG;AACH,SAAgB,OAAO,CACrB,GAAW,EACX,OAAgD;IAEhD,OAAO,gBAAgB,CAAI,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AALD,0BAKC;AAID;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,MAAe,EACf,OAAqC;IAArC,wBAAA,EAAA,YAAqC;IAErC,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,IAAA,KAA+C,OAAO,OAA7B,EAAzB,MAAM,mBAAG,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC,KAAA,EAAE,KAAoB,OAAO,SAAZ,EAAf,QAAQ,mBAAG,IAAI,KAAA,CAAa;IAE/D,uCAAuC;IACvC,IAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK;QAC/B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,IAAI,MAAM,CAAC,cAAO,KAAK,CAAC,OAAO,OAAI,EAAE,OAAO,CAAC,CAAC;SACtD;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAC,IAA4C;QAClD,IAAI,IAAI,GAAG,EAAE,CAAC;QAEd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAExB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,IAAI,IAAI,KAAK,CAAC;gBACd,SAAS;aACV;YAED,IAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAClD,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC;YAClE,IAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC;YAEhE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxB,IAAI,CAAC,MAAM,EAAE;oBACX,MAAM,IAAI,SAAS,CACjB,qBAAa,KAAK,CAAC,IAAI,uCAAmC,CAC3D,CAAC;iBACH;gBAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;oBACtB,IAAI,QAAQ;wBAAE,SAAS;oBAEvB,MAAM,IAAI,SAAS,CAAC,qBAAa,KAAK,CAAC,IAAI,uBAAmB,CAAC,CAAC;iBACjE;gBAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACrC,IAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;oBAExC,IAAI,QAAQ,IAAI,CAAE,OAAO,CAAC,CAAC,CAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;wBACrD,MAAM,IAAI,SAAS,CACjB,yBAAiB,KAAK,CAAC,IAAI,2BAAe,KAAK,CAAC,OAAO,2BAAe,OAAO,OAAG,CACjF,CAAC;qBACH;oBAED,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;iBAC/C;gBAED,SAAS;aACV;YAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC1D,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;gBAE7C,IAAI,QAAQ,IAAI,CAAE,OAAO,CAAC,CAAC,CAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrD,MAAM,IAAI,SAAS,CACjB,qBAAa,KAAK,CAAC,IAAI,2BAAe,KAAK,CAAC,OAAO,2BAAe,OAAO,OAAG,CAC7E,CAAC;iBACH;gBAED,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC9C,SAAS;aACV;YAED,IAAI,QAAQ;gBAAE,SAAS;YAEvB,IAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC;YACvD,MAAM,IAAI,SAAS,CAAC,qBAAa,KAAK,CAAC,IAAI,sBAAW,aAAa,CAAE,CAAC,CAAC;SACxE;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AA9ED,4CA8EC;AA8BD;;GAEG;AACH,SAAgB,KAAK,CACnB,GAAS,EACT,OAAwE;IAExE,IAAM,IAAI,GAAU,EAAE,CAAC;IACvB,IAAM,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5C,OAAO,gBAAgB,CAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAPD,sBAOC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,EAAU,EACV,IAAW,EACX,OAAqC;IAArC,wBAAA,EAAA,YAAqC;IAE7B,IAAA,KAA8B,OAAO,OAAZ,EAAzB,MAAM,mBAAG,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC,KAAA,CAAa;IAE9C,OAAO,UAAU,QAAgB;QAC/B,IAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAEb,IAAG,IAAI,GAAY,CAAC,GAAb,EAAE,KAAK,GAAK,CAAC,MAAN,CAAO;QAC7B,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gCAE1B,CAAC;YACR,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS;kCAAW;YAEjC,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAExB,IAAI,GAAG,CAAC,QAAQ,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,KAAK,GAAG,EAAE;gBAChD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK;oBAC/D,OAAO,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;aACtC;;QAXH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;oBAAxB,CAAC;SAYT;QAED,OAAO,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AA9BD,4CA8BC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,OAAiC;IAC9C,OAAO,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACjD,CAAC;AAkBD;;GAEG;AACH,SAAS,cAAc,CAAC,IAAY,EAAE,IAAY;IAChD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,IAAM,WAAW,GAAG,yBAAyB,CAAC;IAE9C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,UAAU,EAAE;QACjB,IAAI,CAAC,IAAI,CAAC;YACR,kEAAkE;YAClE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE;YAC9B,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QACH,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC5C;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CACpB,KAA6B,EAC7B,IAAY,EACZ,OAA8C;IAE9C,IAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,MAAM,EAAxC,CAAwC,CAAC,CAAC;IAC5E,OAAO,IAAI,MAAM,CAAC,aAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CACrB,IAAY,EACZ,IAAY,EACZ,OAA8C;IAE9C,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC;AAiCD;;GAEG;AACH,SAAgB,cAAc,CAC5B,MAAe,EACf,IAAY,EACZ,OAAmC;IAAnC,wBAAA,EAAA,YAAmC;IAGjC,IAAA,KAME,OAAO,OANK,EAAd,MAAM,mBAAG,KAAK,KAAA,EACd,KAKE,OAAO,MALG,EAAZ,KAAK,mBAAG,IAAI,KAAA,EACZ,KAIE,OAAO,IAJC,EAAV,GAAG,mBAAG,IAAI,KAAA,EACV,KAGE,OAAO,OAHgB,EAAzB,MAAM,mBAAG,UAAC,CAAS,IAAK,OAAA,CAAC,EAAD,CAAC,KAAA,EACzB,KAEE,OAAO,UAFQ,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,KACE,OAAO,SADI,EAAb,QAAQ,mBAAG,EAAE,KAAA,CACH;IACZ,IAAM,UAAU,GAAG,WAAI,YAAY,CAAC,QAAQ,CAAC,QAAK,CAAC;IACnD,IAAM,WAAW,GAAG,WAAI,YAAY,CAAC,SAAS,CAAC,MAAG,CAAC;IACnD,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAE7B,wDAAwD;IACxD,KAAoB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM,EAAE;QAAvB,IAAM,KAAK,eAAA;QACd,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC;aAAM;YACL,IAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAClD,IAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YAElD,IAAI,KAAK,CAAC,OAAO,EAAE;gBACjB,IAAI,IAAI;oBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE3B,IAAI,MAAM,IAAI,MAAM,EAAE;oBACpB,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,EAAE;wBACpD,IAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC9C,KAAK,IAAI,aAAM,MAAM,iBAAO,KAAK,CAAC,OAAO,iBAAO,MAAM,SAAG,MAAM,gBAAM,KAAK,CAAC,OAAO,iBAAO,MAAM,cAAI,GAAG,CAAE,CAAC;qBAC1G;yBAAM;wBACL,KAAK,IAAI,aAAM,MAAM,cAAI,KAAK,CAAC,OAAO,cAAI,MAAM,cAAI,KAAK,CAAC,QAAQ,CAAE,CAAC;qBACtE;iBACF;qBAAM;oBACL,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,KAAK,GAAG,EAAE;wBACpD,KAAK,IAAI,cAAO,KAAK,CAAC,OAAO,cAAI,KAAK,CAAC,QAAQ,MAAG,CAAC;qBACpD;yBAAM;wBACL,KAAK,IAAI,WAAI,KAAK,CAAC,OAAO,cAAI,KAAK,CAAC,QAAQ,CAAE,CAAC;qBAChD;iBACF;aACF;iBAAM;gBACL,KAAK,IAAI,aAAM,MAAM,SAAG,MAAM,cAAI,KAAK,CAAC,QAAQ,CAAE,CAAC;aACpD;SACF;KACF;IAED,IAAI,GAAG,EAAE;QACP,IAAI,CAAC,MAAM;YAAE,KAAK,IAAI,UAAG,WAAW,MAAG,CAAC;QAExC,KAAK,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,aAAM,UAAU,MAAG,CAAC;KACxD;SAAM;QACL,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAM,cAAc,GAClB,OAAO,QAAQ,KAAK,QAAQ;YAC1B,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACzD,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC;QAE7B,IAAI,CAAC,MAAM,EAAE;YACX,KAAK,IAAI,aAAM,WAAW,gBAAM,UAAU,QAAK,CAAC;SACjD;QAED,IAAI,CAAC,cAAc,EAAE;YACnB,KAAK,IAAI,aAAM,WAAW,cAAI,UAAU,MAAG,CAAC;SAC7C;KACF;IAED,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3C,CAAC;AArED,wCAqEC;AAOD;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,IAAU,EACV,IAAY,EACZ,OAA8C;IAE9C,IAAI,IAAI,YAAY,MAAM;QAAE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AARD,oCAQC","sourcesContent":["/**\n * Tokenizer results.\n */\ninterface LexToken {\n type:\n | \"OPEN\"\n | \"CLOSE\"\n | \"PATTERN\"\n | \"NAME\"\n | \"CHAR\"\n | \"ESCAPED_CHAR\"\n | \"MODIFIER\"\n | \"END\";\n index: number;\n value: string;\n}\n\n/**\n * Tokenize input string.\n */\nfunction lexer(str: string): LexToken[] {\n const tokens: LexToken[] = [];\n let i = 0;\n\n while (i < str.length) {\n const char = str[i];\n\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \":\") {\n let name = \"\";\n let j = i + 1;\n\n while (j < str.length) {\n const code = str.charCodeAt(j);\n\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95\n ) {\n name += str[j++];\n continue;\n }\n\n break;\n }\n\n if (!name) throw new TypeError(`Missing parameter name at ${i}`);\n\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n\n if (char === \"(\") {\n let count = 1;\n let pattern = \"\";\n let j = i + 1;\n\n if (str[j] === \"?\") {\n throw new TypeError(`Pattern cannot start with \"?\" at ${j}`);\n }\n\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n } else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(`Capturing groups are not allowed at ${j}`);\n }\n }\n\n pattern += str[j++];\n }\n\n if (count) throw new TypeError(`Unbalanced pattern at ${i}`);\n if (!pattern) throw new TypeError(`Missing pattern at ${i}`);\n\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n\n tokens.push({ type: \"END\", index: i, value: \"\" });\n\n return tokens;\n}\n\nexport interface ParseOptions {\n /**\n * Set the default delimiter for repeat parameters. (default: `'/'`)\n */\n delimiter?: string;\n /**\n * List of characters to automatically consider prefixes when parsing.\n */\n prefixes?: string;\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): Token[] {\n const tokens = lexer(str);\n const { prefixes = \"./\" } = options;\n const defaultPattern = `[^${escapeString(options.delimiter || \"/#?\")}]+?`;\n const result: Token[] = [];\n let key = 0;\n let i = 0;\n let path = \"\";\n\n const tryConsume = (type: LexToken[\"type\"]): string | undefined => {\n if (i < tokens.length && tokens[i].type === type) return tokens[i++].value;\n };\n\n const mustConsume = (type: LexToken[\"type\"]): string => {\n const value = tryConsume(type);\n if (value !== undefined) return value;\n const { type: nextType, index } = tokens[i];\n throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`);\n };\n\n const consumeText = (): string => {\n let result = \"\";\n let value: string | undefined;\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n\n while (i < tokens.length) {\n const char = tryConsume(\"CHAR\");\n const name = tryConsume(\"NAME\");\n const pattern = tryConsume(\"PATTERN\");\n\n if (name || pattern) {\n let prefix = char || \"\";\n\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n\n if (path) {\n result.push(path);\n path = \"\";\n }\n\n result.push({\n name: name || key++,\n prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n\n const value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n\n if (path) {\n result.push(path);\n path = \"\";\n }\n\n const open = tryConsume(\"OPEN\");\n if (open) {\n const prefix = consumeText();\n const name = tryConsume(\"NAME\") || \"\";\n const pattern = tryConsume(\"PATTERN\") || \"\";\n const suffix = consumeText();\n\n mustConsume(\"CLOSE\");\n\n result.push({\n name: name || (pattern ? key++ : \"\"),\n pattern: name && !pattern ? defaultPattern : pattern,\n prefix,\n suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n\n mustConsume(\"END\");\n }\n\n return result;\n}\n\nexport interface TokensToFunctionOptions {\n /**\n * When `true` the regexp will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * Function for encoding input strings for output.\n */\n encode?: (value: string, token: Key) => string;\n /**\n * When `false` the function can produce an invalid (unmatched) path. (default: `true`)\n */\n validate?: boolean;\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

(\n str: string,\n options?: ParseOptions & TokensToFunctionOptions\n) {\n return tokensToFunction

(parse(str, options), options);\n}\n\nexport type PathFunction

= (data?: P) => string;\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction

(\n tokens: Token[],\n options: TokensToFunctionOptions = {}\n): PathFunction

{\n const reFlags = flags(options);\n const { encode = (x: string) => x, validate = true } = options;\n\n // Compile all the tokens into regexps.\n const matches = tokens.map((token) => {\n if (typeof token === \"object\") {\n return new RegExp(`^(?:${token.pattern})$`, reFlags);\n }\n });\n\n return (data: Record | null | undefined) => {\n let path = \"\";\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n\n const value = data ? data[token.name] : undefined;\n const optional = token.modifier === \"?\" || token.modifier === \"*\";\n const repeat = token.modifier === \"*\" || token.modifier === \"+\";\n\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\n `Expected \"${token.name}\" to not repeat, but got an array`\n );\n }\n\n if (value.length === 0) {\n if (optional) continue;\n\n throw new TypeError(`Expected \"${token.name}\" to not be empty`);\n }\n\n for (let j = 0; j < value.length; j++) {\n const segment = encode(value[j], token);\n\n if (validate && !(matches[i] as RegExp).test(segment)) {\n throw new TypeError(\n `Expected all \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`\n );\n }\n\n path += token.prefix + segment + token.suffix;\n }\n\n continue;\n }\n\n if (typeof value === \"string\" || typeof value === \"number\") {\n const segment = encode(String(value), token);\n\n if (validate && !(matches[i] as RegExp).test(segment)) {\n throw new TypeError(\n `Expected \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`\n );\n }\n\n path += token.prefix + segment + token.suffix;\n continue;\n }\n\n if (optional) continue;\n\n const typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(`Expected \"${token.name}\" to be ${typeOfMessage}`);\n }\n\n return path;\n };\n}\n\nexport interface RegexpToFunctionOptions {\n /**\n * Function for decoding strings for params.\n */\n decode?: (value: string, token: Key) => string;\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

{\n path: string;\n index: number;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

= false | MatchResult

;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

= (\n path: string\n) => Match

;\n\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match

(\n str: Path,\n options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions\n) {\n const keys: Key[] = [];\n const re = pathToRegexp(str, keys, options);\n return regexpToFunction

(re, keys, options);\n}\n\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction

(\n re: RegExp,\n keys: Key[],\n options: RegexpToFunctionOptions = {}\n): MatchFunction

{\n const { decode = (x: string) => x } = options;\n\n return function (pathname: string) {\n const m = re.exec(pathname);\n if (!m) return false;\n\n const { 0: path, index } = m;\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map((value) => {\n return decode(value, key);\n });\n } else {\n params[key.name] = decode(m[i], key);\n }\n }\n\n return { path, index, params };\n };\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str: string) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options?: { sensitive?: boolean }) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n\n/**\n * Metadata about a key.\n */\nexport interface Key {\n name: string | number;\n prefix: string;\n suffix: string;\n pattern: string;\n modifier: string;\n}\n\n/**\n * A token is a string (nothing special) or key metadata (capture group).\n */\nexport type Token = string | Key;\n\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path: RegExp, keys?: Key[]): RegExp {\n if (!keys) return path;\n\n const groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n\n let index = 0;\n let execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n\n return path;\n}\n\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(\n paths: Array,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n): RegExp {\n const parts = paths.map((path) => pathToRegexp(path, keys, options).source);\n return new RegExp(`(?:${parts.join(\"|\")})`, flags(options));\n}\n\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(\n path: string,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n\nexport interface TokensToRegexpOptions {\n /**\n * When `true` the regexp will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`)\n */\n strict?: boolean;\n /**\n * When `true` the regexp will match to the end of the string. (default: `true`)\n */\n end?: boolean;\n /**\n * When `true` the regexp will match from the beginning of the string. (default: `true`)\n */\n start?: boolean;\n /**\n * Sets the final character for non-ending optimistic matches. (default: `/`)\n */\n delimiter?: string;\n /**\n * List of characters that can also be \"end\" characters.\n */\n endsWith?: string;\n /**\n * Encode path tokens for use in the `RegExp`.\n */\n encode?: (value: string) => string;\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nexport function tokensToRegexp(\n tokens: Token[],\n keys?: Key[],\n options: TokensToRegexpOptions = {}\n) {\n const {\n strict = false,\n start = true,\n end = true,\n encode = (x: string) => x,\n delimiter = \"/#?\",\n endsWith = \"\",\n } = options;\n const endsWithRe = `[${escapeString(endsWith)}]|$`;\n const delimiterRe = `[${escapeString(delimiter)}]`;\n let route = start ? \"^\" : \"\";\n\n // Iterate over the tokens and create our regexp string.\n for (const token of tokens) {\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n } else {\n const prefix = escapeString(encode(token.prefix));\n const suffix = escapeString(encode(token.suffix));\n\n if (token.pattern) {\n if (keys) keys.push(token);\n\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n const mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += `(?:${prefix}((?:${token.pattern})(?:${suffix}${prefix}(?:${token.pattern}))*)${suffix})${mod}`;\n } else {\n route += `(?:${prefix}(${token.pattern})${suffix})${token.modifier}`;\n }\n } else {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n route += `((?:${token.pattern})${token.modifier})`;\n } else {\n route += `(${token.pattern})${token.modifier}`;\n }\n }\n } else {\n route += `(?:${prefix}${suffix})${token.modifier}`;\n }\n }\n }\n\n if (end) {\n if (!strict) route += `${delimiterRe}?`;\n\n route += !options.endsWith ? \"$\" : `(?=${endsWithRe})`;\n } else {\n const endToken = tokens[tokens.length - 1];\n const isEndDelimited =\n typeof endToken === \"string\"\n ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1\n : endToken === undefined;\n\n if (!strict) {\n route += `(?:${delimiterRe}(?=${endsWithRe}))?`;\n }\n\n if (!isEndDelimited) {\n route += `(?=${delimiterRe}|${endsWithRe})`;\n }\n }\n\n return new RegExp(route, flags(options));\n}\n\n/**\n * Supported `path-to-regexp` input types.\n */\nexport type Path = string | RegExp | Array;\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nexport function pathToRegexp(\n path: Path,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n) {\n if (path instanceof RegExp) return regexpToRegexp(path, keys);\n if (Array.isArray(path)) return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\n"]} \ No newline at end of file diff --git a/build/node_modules/path-to-regexp/index.d.ts b/build/node_modules/path-to-regexp/index.d.ts deleted file mode 100644 index 4a1f65c5..00000000 --- a/build/node_modules/path-to-regexp/index.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -declare function pathToRegexp (path: pathToRegexp.Path, options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): pathToRegexp.PathRegExp; -declare function pathToRegexp (path: pathToRegexp.Path, keys?: pathToRegexp.Key[], options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): pathToRegexp.PathRegExp; - -declare namespace pathToRegexp { - export interface PathRegExp extends RegExp { - // An array to be populated with the keys found in the path. - keys: Key[]; - } - - export interface RegExpOptions { - /** - * When `true` the route will be case sensitive. (default: `false`) - */ - sensitive?: boolean; - /** - * When `false` the trailing slash is optional. (default: `false`) - */ - strict?: boolean; - /** - * When `false` the path will match at the beginning. (default: `true`) - */ - end?: boolean; - /** - * Sets the final character for non-ending optimistic matches. (default: `/`) - */ - delimiter?: string; - } - - export interface ParseOptions { - /** - * Set the default delimiter for repeat parameters. (default: `'/'`) - */ - delimiter?: string; - } - - export interface TokensToFunctionOptions { - /** - * When `true` the regexp will be case sensitive. (default: `false`) - */ - sensitive?: boolean; - } - - /** - * Parse an Express-style path into an array of tokens. - */ - export function parse (path: string, options?: ParseOptions): Token[]; - - /** - * Transforming an Express-style path into a valid path. - */ - export function compile (path: string, options?: ParseOptions & TokensToFunctionOptions): PathFunction; - - /** - * Transform an array of tokens into a path generator function. - */ - export function tokensToFunction (tokens: Token[], options?: TokensToFunctionOptions): PathFunction; - - /** - * Transform an array of tokens into a matching regular expression. - */ - export function tokensToRegExp (tokens: Token[], options?: RegExpOptions): PathRegExp; - export function tokensToRegExp (tokens: Token[], keys?: Key[], options?: RegExpOptions): PathRegExp; - - export interface Key { - name: string | number; - prefix: string; - delimiter: string; - optional: boolean; - repeat: boolean; - pattern: string; - partial: boolean; - asterisk: boolean; - } - - interface PathFunctionOptions { - pretty?: boolean; - } - - export type Token = string | Key; - export type Path = string | RegExp | Array; - export type PathFunction = (data?: Object, options?: PathFunctionOptions) => string; -} - -export = pathToRegexp; diff --git a/build/node_modules/path-to-regexp/index.js b/build/node_modules/path-to-regexp/index.js deleted file mode 100644 index e485afec..00000000 --- a/build/node_modules/path-to-regexp/index.js +++ /dev/null @@ -1,426 +0,0 @@ -var isarray = require('isarray') - -/** - * Expose `pathToRegexp`. - */ -module.exports = pathToRegexp -module.exports.parse = parse -module.exports.compile = compile -module.exports.tokensToFunction = tokensToFunction -module.exports.tokensToRegExp = tokensToRegExp - -/** - * The main path matching regexp utility. - * - * @type {RegExp} - */ -var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g') - -/** - * Parse a string for the raw tokens. - * - * @param {string} str - * @param {Object=} options - * @return {!Array} - */ -function parse (str, options) { - var tokens = [] - var key = 0 - var index = 0 - var path = '' - var defaultDelimiter = options && options.delimiter || '/' - var res - - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0] - var escaped = res[1] - var offset = res.index - path += str.slice(index, offset) - index = offset + m.length - - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1] - continue - } - - var next = str[index] - var prefix = res[2] - var name = res[3] - var capture = res[4] - var group = res[5] - var modifier = res[6] - var asterisk = res[7] - - // Push the current path onto the tokens. - if (path) { - tokens.push(path) - path = '' - } - - var partial = prefix != null && next != null && next !== prefix - var repeat = modifier === '+' || modifier === '*' - var optional = modifier === '?' || modifier === '*' - var delimiter = res[2] || defaultDelimiter - var pattern = capture || group - - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - partial: partial, - asterisk: !!asterisk, - pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') - }) - } - - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index) - } - - // If the path exists, push it onto the end. - if (path) { - tokens.push(path) - } - - return tokens -} - -/** - * Compile a string to a template function for the path. - * - * @param {string} str - * @param {Object=} options - * @return {!function(Object=, Object=)} - */ -function compile (str, options) { - return tokensToFunction(parse(str, options), options) -} - -/** - * Prettier encoding of URI path segments. - * - * @param {string} - * @return {string} - */ -function encodeURIComponentPretty (str) { - return encodeURI(str).replace(/[\/?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} - -/** - * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. - * - * @param {string} - * @return {string} - */ -function encodeAsterisk (str) { - return encodeURI(str).replace(/[?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} - -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction (tokens, options) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length) - - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)) - } - } - - return function (obj, opts) { - var path = '' - var data = obj || {} - var options = opts || {} - var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] - - if (typeof token === 'string') { - path += token - - continue - } - - var value = data[token.name] - var segment - - if (value == null) { - if (token.optional) { - // Prepend partial segment prefixes. - if (token.partial) { - path += token.prefix - } - - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } - - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') - } - - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } - } - - for (var j = 0; j < value.length; j++) { - segment = encode(value[j]) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') - } - - path += (j === 0 ? token.prefix : token.delimiter) + segment - } - - continue - } - - segment = token.asterisk ? encodeAsterisk(value) : encode(value) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += token.prefix + segment - } - - return path - } -} - -/** - * Escape a regular expression string. - * - * @param {string} str - * @return {string} - */ -function escapeString (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') -} - -/** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {string} group - * @return {string} - */ -function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') -} - -/** - * Attach the keys as a property of the regexp. - * - * @param {!RegExp} re - * @param {Array} keys - * @return {!RegExp} - */ -function attachKeys (re, keys) { - re.keys = keys - return re -} - -/** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {string} - */ -function flags (options) { - return options && options.sensitive ? '' : 'i' -} - -/** - * Pull out keys from a regexp. - * - * @param {!RegExp} path - * @param {!Array} keys - * @return {!RegExp} - */ -function regexpToRegexp (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g) - - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - partial: false, - asterisk: false, - pattern: null - }) - } - } - - return attachKeys(path, keys) -} - -/** - * Transform an array into a regexp. - * - * @param {!Array} path - * @param {Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function arrayToRegexp (path, keys, options) { - var parts = [] - - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp(path[i], keys, options).source) - } - - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) - - return attachKeys(regexp, keys) -} - -/** - * Create a path regexp from string input. - * - * @param {string} path - * @param {!Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function stringToRegexp (path, keys, options) { - return tokensToRegExp(parse(path, options), keys, options) -} - -/** - * Expose a function for taking tokens and returning a RegExp. - * - * @param {!Array} tokens - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function tokensToRegExp (tokens, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } - - options = options || {} - - var strict = options.strict - var end = options.end !== false - var route = '' - - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] - - if (typeof token === 'string') { - route += escapeString(token) - } else { - var prefix = escapeString(token.prefix) - var capture = '(?:' + token.pattern + ')' - - keys.push(token) - - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*' - } - - if (token.optional) { - if (!token.partial) { - capture = '(?:' + prefix + '(' + capture + '))?' - } else { - capture = prefix + '(' + capture + ')?' - } - } else { - capture = prefix + '(' + capture + ')' - } - - route += capture - } - } - - var delimiter = escapeString(options.delimiter || '/') - var endsWithDelimiter = route.slice(-delimiter.length) === delimiter - - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' - } - - if (end) { - route += '$' - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' - } - - return attachKeys(new RegExp('^' + route, flags(options)), keys) -} - -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(string|RegExp|Array)} path - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function pathToRegexp (path, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } - - options = options || {} - - if (path instanceof RegExp) { - return regexpToRegexp(path, /** @type {!Array} */ (keys)) - } - - if (isarray(path)) { - return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) - } - - return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) -} diff --git a/build/node_modules/path-to-regexp/package.json b/build/node_modules/path-to-regexp/package.json index 4d1a36be..39d5bc90 100644 --- a/build/node_modules/path-to-regexp/package.json +++ b/build/node_modules/path-to-regexp/package.json @@ -1,47 +1,62 @@ { "name": "path-to-regexp", + "version": "6.2.1", + "publishConfig": { + "access": "public" + }, "description": "Express style path to RegExp utility", - "version": "1.8.0", - "main": "index.js", - "typings": "index.d.ts", - "files": [ - "index.js", - "index.d.ts", - "LICENSE" - ], + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/path-to-regexp.git" + }, + "main": "dist/index.js", + "module": "dist.es2015/index.js", "scripts": { - "lint": "standard", - "test-spec": "mocha --require ts-node/register -R spec --bail test.ts", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require ts-node/register -R spec test.ts", - "prepublish": "typings install", - "test": "npm run lint && npm run test-cov" + "build": "ts-scripts build", + "format": "ts-scripts format", + "lint": "ts-scripts lint", + "prepare": "ts-scripts install && npm run build", + "size": "size-limit", + "specs": "ts-scripts specs", + "test": "ts-scripts test && npm run size" }, + "files": [ + "dist.es2015/", + "dist/" + ], "keywords": [ "express", "regexp", "route", "routing" ], - "component": { - "scripts": { - "path-to-regexp": "index.js" - } - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/pillarjs/path-to-regexp.git" - }, "devDependencies": { - "chai": "^2.3.0", - "istanbul": "~0.3.0", - "mocha": "~2.2.4", - "standard": "~3.7.3", - "ts-node": "^0.5.5", - "typescript": "^1.8.7", - "typings": "^1.0.4" + "@borderless/ts-scripts": "^0.8.0", + "@size-limit/preset-small-lib": "^7.0.8", + "@types/jest": "^27.4.0", + "@types/node": "^17.0.17", + "@types/semver": "^7.3.1", + "semver": "^7.3.5", + "size-limit": "^7.0.8", + "typescript": "^4.5.5" }, - "dependencies": { - "isarray": "0.0.1" + "typings": "dist/index.d.ts", + "sideEffects": false, + "size-limit": [ + { + "path": "dist.es2015/index.js", + "limit": "2.1 kB" + } + ], + "ts-scripts": { + "dist": [ + "dist", + "dist.es2015" + ], + "project": [ + "tsconfig.build.json", + "tsconfig.es2015.json" + ] } } diff --git a/build/package-lock.json b/build/package-lock.json index bcf2fd9b..f9664db8 100644 --- a/build/package-lock.json +++ b/build/package-lock.json @@ -1,12 +1,12 @@ { "name": "purecloud-guest-chat-client", - "version": "13.8.0", + "version": "13.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "purecloud-guest-chat-client", - "version": "13.8.0", + "version": "13.8.1", "license": "MIT", "dependencies": { "axios": "^0.27.2", @@ -161,9 +161,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", - "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "version": "20.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.6.tgz", + "integrity": "sha512-+EOokTnksGVgip2PbYbr3xnR7kZigh4LbybAfBAw5BpnQ+FqBYUsvCEjYd70IXKlbohQ64mzEYmMtlWUY8q//Q==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1037,9 +1037,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "funding": [ { "type": "individual", @@ -1448,9 +1448,9 @@ } }, "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", + "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", "dev": true }, "node_modules/kuler": { @@ -1913,45 +1913,36 @@ } }, "node_modules/nise": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.5.tgz", - "integrity": "sha512-VJuPIfUFaXNRzETTQEEItTOP8Y171ijr+JLq42wHes3DiryR8vT+1TXQW/Rx8JNUhyYYWyIvjXTU6dOhJcs9Nw==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.7.tgz", + "integrity": "sha512-wWtNUhkT7k58uvWTB/Gy26eA/EJKtPZFVAhEilN5UYVmmGRYOURbejRUyKm0Uu9XVEW7K5nBOZfR8VMB4QR2RQ==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0", - "@sinonjs/fake-timers": "^10.0.2", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^11.2.2", + "@sinonjs/text-encoding": "^0.7.2", + "just-extend": "^6.2.0", + "path-to-regexp": "^6.2.1" } }, "node_modules/nise/node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz", + "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==", "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0" } }, - "node_modules/nise/node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", - "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2058,13 +2049,10 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "dependencies": { - "isarray": "0.0.1" - } + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.1.tgz", + "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==", + "dev": true }, "node_modules/pbkdf2": { "version": "3.1.2", diff --git a/build/package.json b/build/package.json index 770f469e..1cff0b7d 100644 --- a/build/package.json +++ b/build/package.json @@ -1,6 +1,6 @@ { "name": "purecloud-guest-chat-client", - "version": "13.8.0", + "version": "13.8.1", "description": "A JavaScript library to interface with the PureCloud Platform API", "license": "MIT", "main": "dist/node/purecloud-guest-chat-client.js", diff --git a/build/src/purecloud-guest-chat-client/ApiClient.js b/build/src/purecloud-guest-chat-client/ApiClient.js index 8027cf4e..87a6f2f6 100644 --- a/build/src/purecloud-guest-chat-client/ApiClient.js +++ b/build/src/purecloud-guest-chat-client/ApiClient.js @@ -3,7 +3,7 @@ import Configuration from './configuration.js'; /** * @module purecloud-guest-chat-client/ApiClient - * @version 13.8.0 + * @version 13.8.1 */ class ApiClient { /** diff --git a/build/src/purecloud-guest-chat-client/PureCloudRegionHosts.js b/build/src/purecloud-guest-chat-client/PureCloudRegionHosts.js index c29d3a6a..77ba0ed8 100644 --- a/build/src/purecloud-guest-chat-client/PureCloudRegionHosts.js +++ b/build/src/purecloud-guest-chat-client/PureCloudRegionHosts.js @@ -11,4 +11,7 @@ export default { ap_south_1: 'aps1.pure.cloud', us_east_2: 'use2.us-gov-pure.cloud', sa_east_1: 'sae1.pure.cloud', + me_central_1: 'mec1.pure.cloud', + ap_northeast_3: 'apne3.pure.cloud', + eu_central_2: 'euc2.pure.cloud', }; diff --git a/build/src/purecloud-guest-chat-client/api/WebChatApi.js b/build/src/purecloud-guest-chat-client/api/WebChatApi.js index 1f1b64a5..0ceb1cb8 100644 --- a/build/src/purecloud-guest-chat-client/api/WebChatApi.js +++ b/build/src/purecloud-guest-chat-client/api/WebChatApi.js @@ -5,7 +5,7 @@ class WebChatApi { /** * WebChat service. * @module purecloud-guest-chat-client/api/WebChatApi - * @version 13.8.0 + * @version 13.8.1 */ /** diff --git a/build/src/purecloud-guest-chat-client/index.js b/build/src/purecloud-guest-chat-client/index.js index 23b280f3..0586d72e 100644 --- a/build/src/purecloud-guest-chat-client/index.js +++ b/build/src/purecloud-guest-chat-client/index.js @@ -32,7 +32,7 @@ import WebChatApi from './api/WebChatApi.js'; * *

* @module purecloud-guest-chat-client/index - * @version 13.8.0 + * @version 13.8.1 */ class platformClient { constructor() { diff --git a/releaseNotes.md b/releaseNotes.md index 98039436..e7739ec4 100644 --- a/releaseNotes.md +++ b/releaseNotes.md @@ -1,4 +1,4 @@ -Platform API version: 7567 +Platform API version: 7660 @@ -6,11 +6,7 @@ Platform API version: 7567 # Major Changes (0 changes) -# Minor Changes (1 change) - -**Limit** (1 change) - -* Enum value employee.engagement was added to property namespace +# Minor Changes (0 changes) # Point Changes (0 changes) diff --git a/swagger.json b/swagger.json index 613b9533..03475b64 100644 --- a/swagger.json +++ b/swagger.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"description":"With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.","version":"v2","title":"PureCloud Platform API","termsOfService":"https://help.mypurecloud.com/articles/terms-and-conditions/","contact":{"name":"PureCloud Developer Evangelists","url":"https://developer.genesys.cloud","email":"DeveloperEvangelists@genesys.com"},"license":{"name":"UNLICENSED","url":"https://help.mypurecloud.com/articles/terms-and-conditions/"}},"host":"api.mypurecloud.com","tags":[{"name":"Events","description":"Events","externalDocs":{"description":"Events Documentation","url":"https://developer.genesys.cloud/api/rest/v2/events/"}},{"name":"Authorization","description":"Roles and permissions","externalDocs":{"description":"Authorization Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/authorization/"}},{"name":"OAuth","description":"OAuth clients, providers","externalDocs":{"description":"OAuth Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/oauth/"}},{"name":"Objects","description":"Access-controlled objects in the platform","externalDocs":{"description":"authorization docs","url":"https://developer.mypurecloud.com/api/rest/v2/authorization/"}},{"name":"Tokens","description":"Authentication Tokens","externalDocs":{"description":"Tokens Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/tokens/"}},{"name":"Agent UI","description":"Agent UI settings and configuration"},{"name":"Alerting","description":"Rules and alerts","externalDocs":{"description":"Alerting Documentation","url":"https://developer.genesys.cloud/notificationsalerts/alerting/alerting-apis"}},{"name":"Analytics","description":"Analytics querying and reporting.","externalDocs":{"description":"Analytics Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/analytics/analytics-apis"}},{"name":"Architect","description":"Flows, Prompts, IVR schedules, Dependency Tracking","externalDocs":{"description":"Architect Documentation","url":"https://developer.genesys.cloud/routing/architect/"}},{"name":"Agent Assistants","description":"Manage virtual agent assistants."},{"name":"Audit","description":"","externalDocs":{"description":"Audit Documentation","url":"https://developer.genesys.cloud/platform/audit/"}},{"name":"Badges","description":"Badges stats"},{"name":"Billing","description":"","externalDocs":{"description":"billing Documentation","url":"https://developer.genesys.cloud/billing/"}},{"name":"Bots","description":"Chatbot Interactions"},{"name":"Bridge","description":""},{"name":"Callbacks","description":""},{"name":"Calls","description":""},{"name":"Carrier Services","description":""},{"name":"Chat","description":""},{"name":"Coaching","description":"Schedule and manage coaching appointments","externalDocs":{"description":"Coaching","url":"https://developer.genesys.cloud/routing/conversations/coaching-apis"}},{"name":"Cobrowse","description":""},{"name":"Compliance","description":""},{"name":"Configuration","description":"","externalDocs":{"description":"Configuration Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Content Management","description":"","externalDocs":{"description":"Content Management Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/contentmanagement/contentmanagement-apis"}},{"name":"Conversations","description":"","externalDocs":{"description":"Conversations Documentation","url":"https://developer.genesys.cloud/routing/conversations/conversations-apis"}},{"name":"Data Extensions","description":"Data extensions","externalDocs":{"description":"Data Extensions","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Data Privacy","description":"Data privacy masking rules","externalDocs":{"description":"Data Privacy","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Dialog Engine","description":"Dialog Engine","externalDocs":{"description":"Dialog Engine documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Directory Proxy","description":"Search, Suggest, and people"},{"name":"Docs","description":"Swagger documentation definitions"},{"name":"Downloads","description":"Download file","externalDocs":{"description":"Downloads Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Emails","description":""},{"name":"External Contacts","description":"External Organizations, contacts, notes and relationships","externalDocs":{"description":"External Contacts","url":"https://developer.genesys.cloud/commdigital/externalcontacts/externalcontacts-apis"}},{"name":"Fax","description":"","externalDocs":{"description":"Fax Documentation","url":"https://developer.genesys.cloud/commdigital/fax/"}},{"name":"Flows","description":"IVR Flows","externalDocs":{"description":"Flow Aggregates Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/analytics/aggregate/flow-query"}},{"name":"Gamification","description":"Gamification, Scorecard, and leaderboard","externalDocs":{"description":"Gamification Documentation","url":"https://developer.genesys.cloud/useragentman/gamification/"}},{"name":"General Data Protection Regulation","description":"Working with General Data Protection Regulation (GDPR) requests","externalDocs":{"description":"GDPR Documentation","url":"https://developer.genesys.cloud/gdprprivacy/"}},{"name":"Geolocation","description":"","externalDocs":{"description":"Geolocation Documentation","url":"https://developer.genesys.cloud/platform/geolocation-apis"}},{"name":"Greetings","description":"","externalDocs":{"description":"Greetings Documentation","url":"https://developer.genesys.cloud/commdigital/greetings/"}},{"name":"Groups","description":"Groups, members","externalDocs":{"description":"Groups Documentation","url":"https://developer.genesys.cloud/useragentman/groups/"}},{"name":"Identity Provider","description":"Identity providers","externalDocs":{"description":"Identity Providers Documentation","url":"https://developer.genesys.cloud/authorization/oauth-apis/identityprovider/"}},{"name":"Infrastructure as Code","description":"Accelerated infrastructure configuration via reusable modules","externalDocs":{"description":"Infrastructure as Code Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Integrations","description":"","externalDocs":{"description":"Integrations Documentation","url":"https://developer.genesys.cloud/platform/integrations/"}},{"name":"Journey","description":"Predictive Engagement, Customer Journey","externalDocs":{"description":"Journey documentation","url":"https://developer.genesys.cloud/commdigital/digital/webmessaging/journey/journey-apis"}},{"name":"Languages","description":"Available languages","externalDocs":{"description":"Languages Documentation","url":"https://developer.genesys.cloud/organization/languages-apis"}},{"name":"Knowledge","description":"Knowledge administration and search"},{"name":"Language Understanding","description":"Language Understanding","externalDocs":{"description":"Language Understanding documentation","url":"https://developer.genesys.cloud/organization/languageunderstanding/languageunderstanding-apis"}},{"name":"Learning","description":"Manage learning modules"},{"name":"Licensing","description":""},{"name":"License","description":"Per-user platform license assignments","externalDocs":{"description":"License Documentation","url":"https://developer.genesys.cloud/organization/license-apis"}},{"name":"Locations","description":"Physical locations","externalDocs":{"description":"Locations Documentation","url":"https://developer.genesys.cloud/telephony/locations-apis"}},{"name":"Marketplace","description":"Marketplace listing management"},{"name":"Data Action Metrics","description":"Metrics about data actions"},{"name":"Log Capture","description":"Browser Log Capture"},{"name":"Meeting","description":"","externalDocs":{"description":"Meeting Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Messaging","description":"Messaging","externalDocs":{"description":"Messaging Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Mobile Devices","description":"Devices","externalDocs":{"description":"Devices Documentation","url":"https://developer.genesys.cloud/organization/mobiledevices-apis"}},{"name":"Notifications","description":"Channels, subscriptions, topics, mobile push registration","externalDocs":{"description":"Notifications Documentation","url":"https://developer.genesys.cloud/notificationsalerts/notifications/notifications-apis"}},{"name":"Onboarding","description":"Onboarding"},{"name":"Operational Events","description":"Operational events"},{"name":"Organization","description":"Organization","externalDocs":{"description":"Organization Documentation","url":"https://developer.genesys.cloud/organization/organization/"}},{"name":"Organization Authorization","description":"Organization Authorization","externalDocs":{"description":"Organization Authorization Documentation","url":"https://developer.genesys.cloud/authorization/oauth-apis/organizationauthorization-apis"}},{"name":"Outbound","description":"","externalDocs":{"description":"Outbound Documentation","url":"https://developer.genesys.cloud/routing/outbound/"}},{"name":"Presence","description":"User and organization presences","externalDocs":{"description":"Presence Documentation","url":"https://developer.genesys.cloud/useragentman/presence/"}},{"name":"Process Automation","description":"Work items, flows, triggers"},{"name":"Quality","description":"Evaluations, calibrations","externalDocs":{"description":"Quality Management Documentation","url":"https://developer.genesys.cloud/useragentman/quality/"}},{"name":"Recording","description":"Recordings, policies, annotations, orphans","externalDocs":{"description":"Recording Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/recording/"}},{"name":"Response Management","description":"Responses, library, Response Assets, query","externalDocs":{"description":"Response Management Documentation","url":"https://developer.genesys.cloud/organization/responsemanagement-apis"}},{"name":"Routing","description":"Queues, wrapup codes, skills, email & sms config, predictive routing","externalDocs":{"description":"Routing Documentation","url":"https://developer.genesys.cloud/routing/routing/"}},{"name":"SCIM","description":"System for Cross-domain Identity Management","externalDocs":{"description":"System for Cross-domain Identity Management: Definitions, Overview, Concepts, and Requirements","url":"https://developer.genesys.cloud/useragentman/scim/scim-apis"}},{"name":"Screen Recording","description":"Screen recording with background assistant"},{"name":"Scripts","description":"Agent-facing scripts for interactions","externalDocs":{"description":"Scripts Documentation","url":"https://developer.genesys.cloud/routing/scripts/"}},{"name":"Search","description":"Search aggregate, users, groups","externalDocs":{"description":"Search Documentation","url":"https://developer.genesys.cloud/organization/search/"}},{"name":"Settings","description":"Persist settings"},{"name":"SignedData","description":"Package data in signed JWTs"},{"name":"Socialize","description":"Gets, sets and updates entity data for the Socialize service"},{"name":"Speech & Text Analytics","description":""},{"name":"Stations","description":"Stations","externalDocs":{"description":"Stations Documentation","url":"https://developer.genesys.cloud/telephony/stations-apis"}},{"name":"Suggest","description":"Search suggest user, group, locations"},{"name":"Teams","description":"Teams, members","externalDocs":{"description":"Teams Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Telephony","description":"Telephony providers and configuration","externalDocs":{"description":"Telephony Documentation","url":"https://developer.genesys.cloud/telephony/telephony-apis"}},{"name":"Telephony Providers Edge","description":"Edge phones, trunks, lines.","externalDocs":{"description":"telephony provider edge","url":"https://developer.genesys.cloud/telephony/telephony-apis"}},{"name":"Test Automation","description":"Internal Testing Tool for managing Testing Data"},{"name":"Textbots","description":"Chatbot Interactions"},{"name":"Uploads","description":"Presigned url generator for uploading files","externalDocs":{"description":"Upload Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/uploads/uploads-apis"}},{"name":"User Recordings","description":"Summary, media","externalDocs":{"description":"User Recordings Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/recording/userrecordings-apis"}},{"name":"Users","description":"Me, routing, roles","externalDocs":{"description":"Users Documentation","url":"https://developer.genesys.cloud/useragentman/users/"}},{"name":"Utilities","description":"","externalDocs":{"description":"Utilities Documentation","url":"https://developer.genesys.cloud/organization/utilities-apis"}},{"name":"Videos","description":""},{"name":"Voicemail","description":"Mailbox, messages, policy","externalDocs":{"description":"Voicemail Documentation","url":"https://developer.genesys.cloud/commdigital/voicemail/"}},{"name":"WebChat","description":"WebChat deployments","externalDocs":{"description":"WebChat Deployment Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webchat/webchat-apis"}},{"name":"WebMessaging","description":"Web messaging","externalDocs":{"description":"Web Messaging Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webmessaging/webmessaging-apis"}},{"name":"Widgets","description":"Widget deployments","externalDocs":{"description":"Widget Deployment Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webchat/widgets-apis"}},{"name":"Usage","description":"View organizational level usage data","externalDocs":{"description":"Usage Documentation","url":"https://developer.genesys.cloud/platform/usage-apis"}},{"name":"Workforce Management","description":"Adherence, Schedules, Forecasts, Intraday Monitoring, Time Off Requests, Configuration","externalDocs":{"description":"Workforce Management Documentation","url":"https://developer.genesys.cloud/useragentman/workforcemanagement/"}},{"name":"Voicebots","description":"Voicebot Interactions"},{"name":"Web Deployments","description":"Web Deployments","externalDocs":{"description":"Web Deployments Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webchat/webdeployments-apis"}},{"name":"Task Management","description":"Task Management"}],"schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/api/v2/webchat/guest/conversations":{"post":{"tags":["WebChat"],"summary":"Create an ACD chat conversation from an external customer.","description":"This endpoint will create a new ACD Chat conversation under the specified Chat Deployment.\n The conversation will begin with a guest member in it (with a role=CUSTOMER) according to the customer information that is supplied. If the guest member is authenticated, the 'memberAuthToken' field should include his JWT as generated by the 'POST /api/v2/signeddata' resource; if the guest member is anonymous (and the Deployment permits it) this field can be omitted.\n The returned data includes the IDs of the conversation created, along with a newly-create JWT token that you can supply to all future endpoints as authentication to perform operations against that conversation. After successfully creating a conversation, you should connect a websocket to the event stream named in the 'eventStreamUri' field of the response; the conversation is not routed until the event stream is attached.","operationId":"postWebchatGuestConversations","produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"CreateConversationRequest","required":true,"schema":{"$ref":"#/definitions/CreateWebChatConversationRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/CreateWebChatConversationResponse"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.notnull.createconversationrequest.journeycontext.customer":"The customer may not be null.","chat.error.notnull.createconversationrequest.journeycontext.triggeringaction.actionmapversion":"The actionmapversion property may not be null.","chat.error.invalid.queue":"The specified queue is not valid.","chat.error.notnull.createconversationrequest.journeycontext.triggeringaction.actionid":"The actionid property may not be null.","bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.notnull.createconversationrequest.journeycontext.customer.customerid":"The customerid property may not be null.","constraint.validation":"%s","chat.error.notnull.createconversationrequest.memberinfo.displayname":"The displayname property may not be null.","chat.error.notnull.createconversationrequest.routingtarget":"The routingtarget property may not be null.","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","chat.error.notnull.createconversationrequest.journeycontext.customer.customeridtype":"The customeridtype property may not be null.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s","chat.deployment.require.auth":"The deployment requires the customer member to be authenticated.","chat.error.notnull.createconversationrequest.journeycontext.customersession.sessionid":"The sessionid property may not be null.","chat.error.notnull.createconversationrequest.journeycontext.customersession.sessionidtype":"The sessionidtype property may not be null.","chat.deployment.bad.auth":"The customer member authentication has failed.","chat.error.notnull.createconversationrequest.journeycontext.triggeringaction.actionmapid":"The actionmapid property may not be null.","chat.error.createconversationrequest.routingtarget":"The routing target is not valid.","invalid.property":"Value [%s] is not a valid property for object [%s]","chat.deployment.disabled":"The web chat deployment is currently disabled.","chat.error.pattern.createconversationrequest.deploymentid":"The deploymentid property may not be null.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.invalid.flow":"Invalid chat flow","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.bad.request":"Error occurred due to invalid request."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"origin.not.allowed":"Not allowed to create an ACD chat conversation from an external customer.","missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"caht.error":"Error performing chat conversation operation.","internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.service.timeout":"Chat service timeout error.","authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"x-purecloud-method-name":"postWebchatGuestConversations"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}":{"get":{"tags":["WebChat"],"summary":"Get a media request in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The media request was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequest"},"patch":{"tags":["WebChat"],"summary":"Update a media request in the conversation, setting the state to ACCEPTED/DECLINED/ERRORED","description":"","operationId":"patchWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"},{"in":"body","name":"body","description":"Request","required":true,"schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The media request was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"patchWebchatGuestConversationMediarequest"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests":{"get":{"tags":["WebChat"],"summary":"Get all media requests to the guest in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequests","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequestEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequests"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation member","description":"","operationId":"getWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfo"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The web chat conversation member was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation operation."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMember"},"delete":{"tags":["WebChat"],"summary":"Remove a member from a chat conversation","description":"","operationId":"deleteWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"204":{"description":"Operation was successful."},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","chat.error.member.state":"The conversation member is in a state which does not permit this action."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation operation"}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"deleteWebchatGuestConversationMember"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages":{"post":{"tags":["WebChat"],"summary":"Send a message in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"},{"in":"body","name":"body","description":"Message","required":true,"schema":{"$ref":"#/definitions/CreateWebChatMessageRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.notnull.createconversationmessagerequest.body":"The request body may not be null.","bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","invalid.property":"Value [%s] is not a valid property for object [%s]","chat.error.member.state":"The conversation member is in a state which does not permit this action.","chat.error.bad.request":"Error occurred due to invalid request.","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation messages operation."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberMessages"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing":{"post":{"tags":["WebChat"],"summary":"Send a typing-indicator in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberTyping","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatTyping"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","invalid.property":"Value [%s] is not a valid property for object [%s]","chat.error.member.state":"The conversation member is in a state which does not permit this action.","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.internal":"Internal chat error","internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation typing operation."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberTyping"}},"/api/v2/webchat/guest/conversations/{conversationId}/members":{"get":{"tags":["WebChat"],"summary":"Get the members of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMembers","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"pageSize","in":"query","description":"The number of entries to return per page, or omitted for the default.","required":false,"type":"integer","default":25,"format":"int32"},{"name":"pageNumber","in":"query","description":"The page number to return, or omitted for the first page.","required":false,"type":"integer","default":1,"format":"int32"},{"name":"excludeDisconnectedMembers","in":"query","description":"If true, the results will not contain members who have a DISCONNECTED state.","required":false,"type":"boolean","default":false}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfoEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMembers"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation message","description":"","operationId":"getWebchatGuestConversationMessage","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"messageId","in":"path","description":"messageId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The web chat conversation message was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessage"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages":{"get":{"tags":["WebChat"],"summary":"Get the messages of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"after","in":"query","description":"If available, get the messages chronologically after the id of this message","required":false,"type":"string"},{"name":"before","in":"query","description":"If available, get the messages chronologically before the id of this message","required":false,"type":"string"},{"name":"sortOrder","in":"query","description":"Sort order","required":false,"type":"string","default":"ascending","enum":["ascending","descending"]},{"name":"maxResults","in":"query","description":"Limit the returned number of messages, up to a maximum of 100","required":false,"type":"integer","default":100,"format":"int32"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessageEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessages"}}},"securityDefinitions":{"PureCloud OAuth":{"type":"oauth2","authorizationUrl":"https://login.mypurecloud.com/authorize","flow":"implicit","scopes":{"all":"All the scopes"}},"Guest Chat JWT":{"type":"apiKey","name":"Authorization","in":"header"}},"definitions":{"CreateWebChatConversationRequest":{"type":"object","required":["deploymentId","memberInfo","organizationId","routingTarget"],"properties":{"organizationId":{"type":"string","description":"The organization identifier."},"deploymentId":{"type":"string","description":"The web chat Deployment ID which contains the appropriate settings for this chat conversation."},"routingTarget":{"description":"The routing information to use for the new chat conversation.","$ref":"#/definitions/WebChatRoutingTarget"},"memberInfo":{"description":"The guest member info to use for the new chat conversation.","$ref":"#/definitions/GuestMemberInfo"},"memberAuthToken":{"type":"string","description":"If the guest member is an authenticated member (ie, not anonymous) his JWT is provided here. The token will have been previously generated with the \"POST /api/v2/signeddata\" resource."},"journeyContext":{"description":"A subset of the Journey System's data relevant to this conversation/session request (for external linkage and internal usage/context).","$ref":"#/definitions/JourneyContext"}}},"WebChatRoutingTarget":{"type":"object","required":["targetAddress","targetType"],"properties":{"targetType":{"type":"string","description":"The target type of the routing target, such as 'QUEUE'.","enum":["QUEUE"]},"targetAddress":{"type":"string","description":"The target of the route, in the format appropriate given the 'targetType'."},"skills":{"type":"array","description":"The list of skill names to use for routing.","items":{"type":"string"}},"language":{"type":"string","description":"The language name to use for routing."},"priority":{"type":"integer","format":"int64","description":"The priority to assign to the conversation for routing."}}},"GuestMemberInfo":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string","description":"The display name to use for the guest member in the conversation."},"firstName":{"type":"string","description":"The first name to use for the guest member in the conversation."},"lastName":{"type":"string","description":"The last name to use for the guest member in the conversation."},"email":{"type":"string","description":"The email address to use for the guest member in the conversation."},"phoneNumber":{"type":"string","description":"The phone number to use for the guest member in the conversation."},"avatarImageUrl":{"type":"string","format":"uri","description":"The URL to the avatar image to use for the guest member in the conversation, if any."},"customFields":{"type":"object","description":"Any custom fields of information, in key-value format, to attach to the guest member in the conversation.","additionalProperties":{"type":"string"}}}},"JourneyContext":{"type":"object","required":["customer"],"properties":{"customer":{"description":"A subset of the Journey System's customer data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomer"},"customerSession":{"description":"A subset of the Journey System's tracked customer session data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomerSession"},"triggeringAction":{"description":"A subset of the Journey System's action data relevant to a part of a conversation (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyAction"}}},"JourneyCustomer":{"type":"object","required":["id","idType"],"properties":{"id":{"type":"string","description":"An ID of a customer within the Journey System at a point-in-time. Note that a customer entity can have multiple customerIds based on the stitching process. Depending on the context within the PureCloud conversation, this may or may not be mutable."},"idType":{"type":"string","description":"The type of the customerId within the Journey System (e.g. cookie)."}}},"JourneyCustomerSession":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","description":"An ID of a Customer/User's session within the Journey System at a point-in-time"},"type":{"type":"string","description":"The type of the Customer/User's session within the Journey System (e.g. web, app)"}}},"JourneyAction":{"type":"object","required":["actionMap","id"],"properties":{"id":{"type":"string","description":"The ID of an action from the Journey System (an action is spawned from an actionMap)"},"actionMap":{"description":"Details about the action map from the Journey System which triggered this action","$ref":"#/definitions/JourneyActionMap"}}},"JourneyActionMap":{"type":"object","required":["id","version"],"properties":{"id":{"type":"string","description":"The ID of the actionMap in the Journey System which triggered this action"},"version":{"type":"integer","format":"int32","description":"The version number of the actionMap in the Journey System at the time this action was triggered"}}},"CreateWebChatConversationResponse":{"type":"object","properties":{"id":{"type":"string","description":"Chat Conversation identifier"},"jwt":{"type":"string","description":"The JWT that you can use to identify subsequent calls on this conversation"},"eventStreamUri":{"type":"string","format":"uri","description":"The URI which provides the conversation event stream."},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"}}},"WebChatMemberInfo":{"type":"object","required":["role"],"properties":{"id":{"type":"string","description":"The communicationId of this member."},"displayName":{"type":"string","description":"The display name of the member."},"firstName":{"type":"string","description":"The first name of the member."},"lastName":{"type":"string","description":"The last name of the member."},"email":{"type":"string","description":"The email address of the member."},"phoneNumber":{"type":"string","description":"The phone number of the member."},"avatarImageUrl":{"type":"string","format":"uri","description":"The url to the avatar image of the member."},"role":{"type":"string","description":"The role of the member, one of [agent, customer, acd, workflow]","enum":["AGENT","CUSTOMER","WORKFLOW","ACD"]},"joinDate":{"type":"string","format":"date-time","description":"The time the member joined the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z"},"leaveDate":{"type":"string","format":"date-time","description":"The time the member left the conversation, or null if the member is still active in the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z"},"authenticatedGuest":{"type":"boolean","description":"If true, the guest member is an authenticated guest."},"customFields":{"type":"object","description":"Any custom fields of information pertaining to this member.","additionalProperties":{"type":"string"}},"state":{"type":"string","description":"The connection state of this member.","enum":["CONNECTED","DISCONNECTED","ALERTING"]}}},"ErrorBody":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer","format":"int32"},"entityId":{"type":"string"},"entityName":{"type":"string"},"messageWithParams":{"type":"string"},"messageParams":{"type":"object","additionalProperties":{"type":"string"}},"contextId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/definitions/Detail"}},"errors":{"type":"array","items":{"$ref":"#/definitions/ErrorBody"}},"limit":{"$ref":"#/definitions/Limit"}}},"Detail":{"type":"object","properties":{"errorCode":{"type":"string"},"fieldName":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"}}},"Limit":{"type":"object","properties":{"key":{"type":"string"},"namespace":{"type":"string","enum":["audit","auth.api","authorization","automation.testing","bots","bots.voice","callback","cobrowse","content.management","conversation","dataactions","datatables","directory","email","employee.engagement","event.orchestration","external.contacts","gcv","gdpr","groups","historical.adherence","infrastructureascode","integrations","intent.miner","journey","knowledge","language.understanding","learning","limit.registry","marketplace","media.communications","messaging","notifications","onboarding","outbound","platform.api","predictive.routing","presence","quality","recording","response.management","routing","scim","search","secondary.automation.testing","skills","speech.and.text.analytics","speech.integration","supportability","task.management","telephony.configuration","usage","users","web.deployments","web.messaging","webchat","webhooks","workforce.management","agent.assistant","analytics.alerting","analytics","analytics.realtime","analytics.reporting.settings","architect","audiohook"]},"value":{"type":"integer","format":"int64"}}},"WebChatGuestMediaRequest":{"type":"object","required":["state","types"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"types":{"type":"array","description":"The types of media being requested.","items":{"type":"string","enum":["COBROWSE","SCREENSHARE"]}},"state":{"type":"string","description":"The state of the media request, one of PENDING|ACCEPTED|DECLINED|TIMEDOUT|CANCELLED|ERRORED.","enum":["PENDING","ACCEPTED","DECLINED","TIMEDOUT","CANCELLED","ERRORED"]},"communicationId":{"type":"string","description":"The ID of the new media communication, if applicable."},"securityKey":{"type":"string","description":"The security information related to a media request."},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}},"description":"Object representing the guest model of a media request of a chat conversation."},"WebChatGuestMediaRequestEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}}},"CreateWebChatMessageRequest":{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The message body. Note that message bodies are limited to 4,000 characters."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice","member-join","member-leave","media-request"]}}},"WebChatMessage":{"type":"object","required":["body","bodyType","conversation","sender","timestamp"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"body":{"type":"string","description":"The message body."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice","member-join","member-leave","media-request"]},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatConversation":{"type":"object","properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatTyping":{"type":"object","required":["conversation","id","sender","timestamp"],"properties":{"id":{"type":"string","description":"The event identifier of this typing indicator event (useful to guard against event re-delivery"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"}}},"WebChatMemberInfoEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMemberInfo"}},"pageSize":{"type":"integer","format":"int32"},"pageNumber":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"},"firstUri":{"type":"string","format":"uri"},"nextUri":{"type":"string","format":"uri"},"previousUri":{"type":"string","format":"uri"},"lastUri":{"type":"string","format":"uri"},"selfUri":{"type":"string","format":"uri"},"pageCount":{"type":"integer","format":"int32"}}},"WebChatMessageEntityList":{"type":"object","properties":{"pageSize":{"type":"integer","format":"int32"},"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMessage"}},"previousPage":{"type":"string"},"next":{"type":"string"},"selfUri":{"type":"string","format":"uri"}}}},"responses":{"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"}}},"externalDocs":{"description":"PureCloud API Documentation","url":"https://developer.genesys.cloud"}} \ No newline at end of file +{"swagger":"2.0","info":{"description":"With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.","version":"v2","title":"PureCloud Platform API","termsOfService":"https://help.mypurecloud.com/articles/terms-and-conditions/","contact":{"name":"PureCloud Developer Evangelists","url":"https://developer.genesys.cloud","email":"DeveloperEvangelists@genesys.com"},"license":{"name":"UNLICENSED","url":"https://help.mypurecloud.com/articles/terms-and-conditions/"}},"host":"api.mypurecloud.com","tags":[{"name":"Events","description":"Events","externalDocs":{"description":"Events Documentation","url":"https://developer.genesys.cloud/api/rest/v2/events/"}},{"name":"Authorization","description":"Roles and permissions","externalDocs":{"description":"Authorization Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/authorization/"}},{"name":"OAuth","description":"OAuth clients, providers","externalDocs":{"description":"OAuth Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/oauth/"}},{"name":"Objects","description":"Access-controlled objects in the platform","externalDocs":{"description":"authorization docs","url":"https://developer.mypurecloud.com/api/rest/v2/authorization/"}},{"name":"Tokens","description":"Authentication Tokens","externalDocs":{"description":"Tokens Documentation","url":"https://developer.mypurecloud.com/api/rest/v2/tokens/"}},{"name":"Agent UI","description":"Agent UI settings and configuration"},{"name":"Alerting","description":"Rules and alerts","externalDocs":{"description":"Alerting Documentation","url":"https://developer.genesys.cloud/notificationsalerts/alerting/alerting-apis"}},{"name":"Analytics","description":"Analytics querying and reporting.","externalDocs":{"description":"Analytics Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/analytics/analytics-apis"}},{"name":"Architect","description":"Flows, Prompts, IVR schedules, Dependency Tracking","externalDocs":{"description":"Architect Documentation","url":"https://developer.genesys.cloud/routing/architect/"}},{"name":"Agent Assistants","description":"Manage virtual agent assistants."},{"name":"Audit","description":"","externalDocs":{"description":"Audit Documentation","url":"https://developer.genesys.cloud/platform/audit/"}},{"name":"Badges","description":"Badges stats"},{"name":"Billing","description":"","externalDocs":{"description":"billing Documentation","url":"https://developer.genesys.cloud/billing/"}},{"name":"Bots","description":"Chatbot Interactions"},{"name":"Bridge","description":""},{"name":"Callbacks","description":""},{"name":"Calls","description":""},{"name":"Carrier Services","description":""},{"name":"Chat","description":""},{"name":"Coaching","description":"Schedule and manage coaching appointments","externalDocs":{"description":"Coaching","url":"https://developer.genesys.cloud/routing/conversations/coaching-apis"}},{"name":"Cobrowse","description":""},{"name":"Compliance","description":""},{"name":"Configuration","description":"","externalDocs":{"description":"Configuration Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Content Management","description":"","externalDocs":{"description":"Content Management Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/contentmanagement/contentmanagement-apis"}},{"name":"Conversations","description":"","externalDocs":{"description":"Conversations Documentation","url":"https://developer.genesys.cloud/routing/conversations/conversations-apis"}},{"name":"Data Extensions","description":"Data extensions","externalDocs":{"description":"Data Extensions","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Data Privacy","description":"Data privacy masking rules","externalDocs":{"description":"Data Privacy","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Dialog Engine","description":"Dialog Engine","externalDocs":{"description":"Dialog Engine documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Directory Proxy","description":"Search, Suggest, and people"},{"name":"Docs","description":"Swagger documentation definitions"},{"name":"Downloads","description":"Download file","externalDocs":{"description":"Downloads Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Emails","description":""},{"name":"External Contacts","description":"External Organizations, contacts, notes and relationships","externalDocs":{"description":"External Contacts","url":"https://developer.genesys.cloud/commdigital/externalcontacts/externalcontacts-apis"}},{"name":"Fax","description":"","externalDocs":{"description":"Fax Documentation","url":"https://developer.genesys.cloud/commdigital/fax/"}},{"name":"Flows","description":"IVR Flows","externalDocs":{"description":"Flow Aggregates Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/analytics/aggregate/flow-query"}},{"name":"Gamification","description":"Gamification, Scorecard, and leaderboard","externalDocs":{"description":"Gamification Documentation","url":"https://developer.genesys.cloud/useragentman/gamification/"}},{"name":"General Data Protection Regulation","description":"Working with General Data Protection Regulation (GDPR) requests","externalDocs":{"description":"GDPR Documentation","url":"https://developer.genesys.cloud/gdprprivacy/"}},{"name":"Geolocation","description":"","externalDocs":{"description":"Geolocation Documentation","url":"https://developer.genesys.cloud/platform/geolocation-apis"}},{"name":"Greetings","description":"","externalDocs":{"description":"Greetings Documentation","url":"https://developer.genesys.cloud/commdigital/greetings/"}},{"name":"Groups","description":"Groups, members","externalDocs":{"description":"Groups Documentation","url":"https://developer.genesys.cloud/useragentman/groups/"}},{"name":"Identity Provider","description":"Identity providers","externalDocs":{"description":"Identity Providers Documentation","url":"https://developer.genesys.cloud/authorization/oauth-apis/identityprovider/"}},{"name":"Infrastructure as Code","description":"Accelerated infrastructure configuration via reusable modules","externalDocs":{"description":"Infrastructure as Code Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Integrations","description":"","externalDocs":{"description":"Integrations Documentation","url":"https://developer.genesys.cloud/platform/integrations/"}},{"name":"Journey","description":"Predictive Engagement, Customer Journey","externalDocs":{"description":"Journey documentation","url":"https://developer.genesys.cloud/commdigital/digital/webmessaging/journey/journey-apis"}},{"name":"Languages","description":"Available languages","externalDocs":{"description":"Languages Documentation","url":"https://developer.genesys.cloud/organization/languages-apis"}},{"name":"Knowledge","description":"Knowledge administration and search"},{"name":"Language Understanding","description":"Language Understanding","externalDocs":{"description":"Language Understanding documentation","url":"https://developer.genesys.cloud/organization/languageunderstanding/languageunderstanding-apis"}},{"name":"Learning","description":"Manage learning modules"},{"name":"Licensing","description":""},{"name":"License","description":"Per-user platform license assignments","externalDocs":{"description":"License Documentation","url":"https://developer.genesys.cloud/organization/license-apis"}},{"name":"Locations","description":"Physical locations","externalDocs":{"description":"Locations Documentation","url":"https://developer.genesys.cloud/telephony/locations-apis"}},{"name":"Marketplace","description":"Marketplace listing management"},{"name":"Data Action Metrics","description":"Metrics about data actions"},{"name":"Log Capture","description":"Browser Log Capture"},{"name":"Meeting","description":"","externalDocs":{"description":"Meeting Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Messaging","description":"Messaging","externalDocs":{"description":"Messaging Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Mobile Devices","description":"Devices","externalDocs":{"description":"Devices Documentation","url":"https://developer.genesys.cloud/organization/mobiledevices-apis"}},{"name":"Notifications","description":"Channels, subscriptions, topics, mobile push registration","externalDocs":{"description":"Notifications Documentation","url":"https://developer.genesys.cloud/notificationsalerts/notifications/notifications-apis"}},{"name":"Onboarding","description":"Onboarding"},{"name":"Operational Events","description":"Operational events"},{"name":"Organization","description":"Organization","externalDocs":{"description":"Organization Documentation","url":"https://developer.genesys.cloud/organization/organization/"}},{"name":"Organization Authorization","description":"Organization Authorization","externalDocs":{"description":"Organization Authorization Documentation","url":"https://developer.genesys.cloud/authorization/oauth-apis/organizationauthorization-apis"}},{"name":"Outbound","description":"","externalDocs":{"description":"Outbound Documentation","url":"https://developer.genesys.cloud/routing/outbound/"}},{"name":"Presence","description":"User and organization presences","externalDocs":{"description":"Presence Documentation","url":"https://developer.genesys.cloud/useragentman/presence/"}},{"name":"Process Automation","description":"Work items, flows, triggers"},{"name":"Quality","description":"Evaluations, calibrations","externalDocs":{"description":"Quality Management Documentation","url":"https://developer.genesys.cloud/useragentman/quality/"}},{"name":"Recording","description":"Recordings, policies, annotations, orphans","externalDocs":{"description":"Recording Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/recording/"}},{"name":"Response Management","description":"Responses, library, Response Assets, query","externalDocs":{"description":"Response Management Documentation","url":"https://developer.genesys.cloud/organization/responsemanagement-apis"}},{"name":"Routing","description":"Queues, wrapup codes, skills, email & sms config, predictive routing","externalDocs":{"description":"Routing Documentation","url":"https://developer.genesys.cloud/routing/routing/"}},{"name":"SCIM","description":"System for Cross-domain Identity Management","externalDocs":{"description":"System for Cross-domain Identity Management: Definitions, Overview, Concepts, and Requirements","url":"https://developer.genesys.cloud/useragentman/scim/scim-apis"}},{"name":"Screen Recording","description":"Screen recording with background assistant"},{"name":"Scripts","description":"Agent-facing scripts for interactions","externalDocs":{"description":"Scripts Documentation","url":"https://developer.genesys.cloud/routing/scripts/"}},{"name":"Search","description":"Search aggregate, users, groups","externalDocs":{"description":"Search Documentation","url":"https://developer.genesys.cloud/organization/search/"}},{"name":"Settings","description":"Persist settings"},{"name":"SignedData","description":"Package data in signed JWTs"},{"name":"Socialize","description":"Gets, sets and updates entity data for the Socialize service"},{"name":"Speech & Text Analytics","description":""},{"name":"Stations","description":"Stations","externalDocs":{"description":"Stations Documentation","url":"https://developer.genesys.cloud/telephony/stations-apis"}},{"name":"Suggest","description":"Search suggest user, group, locations"},{"name":"Teams","description":"Teams, members","externalDocs":{"description":"Teams Documentation","url":"https://developer.genesys.cloud/devapps/api-explorer"}},{"name":"Telephony","description":"Telephony providers and configuration","externalDocs":{"description":"Telephony Documentation","url":"https://developer.genesys.cloud/telephony/telephony-apis"}},{"name":"Telephony Providers Edge","description":"Edge phones, trunks, lines.","externalDocs":{"description":"telephony provider edge","url":"https://developer.genesys.cloud/telephony/telephony-apis"}},{"name":"Test Automation","description":"Internal Testing Tool for managing Testing Data"},{"name":"Textbots","description":"Chatbot Interactions"},{"name":"Uploads","description":"Presigned url generator for uploading files","externalDocs":{"description":"Upload Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/uploads/uploads-apis"}},{"name":"User Recordings","description":"Summary, media","externalDocs":{"description":"User Recordings Documentation","url":"https://developer.genesys.cloud/analyticsdatamanagement/recording/userrecordings-apis"}},{"name":"Users","description":"Me, routing, roles","externalDocs":{"description":"Users Documentation","url":"https://developer.genesys.cloud/useragentman/users/"}},{"name":"Utilities","description":"","externalDocs":{"description":"Utilities Documentation","url":"https://developer.genesys.cloud/organization/utilities-apis"}},{"name":"Videos","description":""},{"name":"Voicemail","description":"Mailbox, messages, policy","externalDocs":{"description":"Voicemail Documentation","url":"https://developer.genesys.cloud/commdigital/voicemail/"}},{"name":"WebChat","description":"WebChat deployments","externalDocs":{"description":"WebChat Deployment Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webchat/webchat-apis"}},{"name":"WebMessaging","description":"Web messaging","externalDocs":{"description":"Web Messaging Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webmessaging/webmessaging-apis"}},{"name":"Widgets","description":"Widget deployments","externalDocs":{"description":"Widget Deployment Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webchat/widgets-apis"}},{"name":"Usage","description":"View organizational level usage data","externalDocs":{"description":"Usage Documentation","url":"https://developer.genesys.cloud/platform/usage-apis"}},{"name":"Workforce Management","description":"Adherence, Schedules, Forecasts, Intraday Monitoring, Time Off Requests, Configuration","externalDocs":{"description":"Workforce Management Documentation","url":"https://developer.genesys.cloud/useragentman/workforcemanagement/"}},{"name":"Voicebots","description":"Voicebot Interactions"},{"name":"Web Deployments","description":"Web Deployments","externalDocs":{"description":"Web Deployments Documentation","url":"https://developer.genesys.cloud/commdigital/digital/webchat/webdeployments-apis"}},{"name":"Task Management","description":"Task Management"}],"schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/api/v2/webchat/guest/conversations":{"post":{"tags":["WebChat"],"summary":"Create an ACD chat conversation from an external customer.","description":"This endpoint will create a new ACD Chat conversation under the specified Chat Deployment.\n The conversation will begin with a guest member in it (with a role=CUSTOMER) according to the customer information that is supplied. If the guest member is authenticated, the 'memberAuthToken' field should include his JWT as generated by the 'POST /api/v2/signeddata' resource; if the guest member is anonymous (and the Deployment permits it) this field can be omitted.\n The returned data includes the IDs of the conversation created, along with a newly-create JWT token that you can supply to all future endpoints as authentication to perform operations against that conversation. After successfully creating a conversation, you should connect a websocket to the event stream named in the 'eventStreamUri' field of the response; the conversation is not routed until the event stream is attached.","operationId":"postWebchatGuestConversations","produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"CreateConversationRequest","required":true,"schema":{"$ref":"#/definitions/CreateWebChatConversationRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/CreateWebChatConversationResponse"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.notnull.createconversationrequest.journeycontext.customer":"The customer may not be null.","chat.error.notnull.createconversationrequest.journeycontext.triggeringaction.actionmapversion":"The actionmapversion property may not be null.","chat.error.invalid.queue":"The specified queue is not valid.","chat.error.notnull.createconversationrequest.journeycontext.triggeringaction.actionid":"The actionid property may not be null.","bad.request":"The request could not be understood by the server due to malformed syntax.","chat.error.notnull.createconversationrequest.journeycontext.customer.customerid":"The customerid property may not be null.","constraint.validation":"%s","chat.error.notnull.createconversationrequest.memberinfo.displayname":"The displayname property may not be null.","chat.error.notnull.createconversationrequest.routingtarget":"The routingtarget property may not be null.","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","chat.error.notnull.createconversationrequest.journeycontext.customer.customeridtype":"The customeridtype property may not be null.","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s","chat.deployment.require.auth":"The deployment requires the customer member to be authenticated.","chat.error.notnull.createconversationrequest.journeycontext.customersession.sessionid":"The sessionid property may not be null.","chat.error.notnull.createconversationrequest.journeycontext.customersession.sessionidtype":"The sessionidtype property may not be null.","chat.deployment.bad.auth":"The customer member authentication has failed.","chat.error.notnull.createconversationrequest.journeycontext.triggeringaction.actionmapid":"The actionmapid property may not be null.","chat.error.createconversationrequest.routingtarget":"The routing target is not valid.","invalid.property":"Value [%s] is not a valid property for object [%s]","chat.deployment.disabled":"The web chat deployment is currently disabled.","chat.error.pattern.createconversationrequest.deploymentid":"The deploymentid property may not be null.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.invalid.flow":"Invalid chat flow","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","chat.error.bad.request":"Error occurred due to invalid request."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"origin.not.allowed":"Not allowed to create an ACD chat conversation from an external customer.","missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"caht.error":"Error performing chat conversation operation.","internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.service.timeout":"Chat service timeout error.","authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"x-purecloud-method-name":"postWebchatGuestConversations"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests/{mediaRequestId}":{"get":{"tags":["WebChat"],"summary":"Get a media request in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The media request was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequest"},"patch":{"tags":["WebChat"],"summary":"Update a media request in the conversation, setting the state to ACCEPTED/DECLINED/ERRORED","description":"","operationId":"patchWebchatGuestConversationMediarequest","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"mediaRequestId","in":"path","description":"mediaRequestId","required":true,"type":"string"},{"in":"body","name":"body","description":"Request","required":true,"schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequest"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The media request was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"patchWebchatGuestConversationMediarequest"}},"/api/v2/webchat/guest/conversations/{conversationId}/mediarequests":{"get":{"tags":["WebChat"],"summary":"Get all media requests to the guest in the conversation","description":"","operationId":"getWebchatGuestConversationMediarequests","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatGuestMediaRequestEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMediarequests"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation member","description":"","operationId":"getWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfo"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The web chat conversation member was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation operation."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMember"},"delete":{"tags":["WebChat"],"summary":"Remove a member from a chat conversation","description":"","operationId":"deleteWebchatGuestConversationMember","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"204":{"description":"Operation was successful."},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","chat.error.member.state":"The conversation member is in a state which does not permit this action."}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation operation"}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"deleteWebchatGuestConversationMember"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/messages":{"post":{"tags":["WebChat"],"summary":"Send a message in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"},{"in":"body","name":"body","description":"Message","required":true,"schema":{"$ref":"#/definitions/CreateWebChatMessageRequest"}}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.notnull.createconversationmessagerequest.body":"The request body may not be null.","bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","invalid.property":"Value [%s] is not a valid property for object [%s]","chat.error.member.state":"The conversation member is in a state which does not permit this action.","chat.error.bad.request":"Error occurred due to invalid request.","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation messages operation."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberMessages"}},"/api/v2/webchat/guest/conversations/{conversationId}/members/{memberId}/typing":{"post":{"tags":["WebChat"],"summary":"Send a typing-indicator in a chat conversation.","description":"","operationId":"postWebchatGuestConversationMemberTyping","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"memberId","in":"path","description":"memberId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatTyping"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","chat.error.conversation.state":"The conversation is in a state which does not permit this action.","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","client.failed.request":"The client did not produce a request with valid end of stream signaling. This can be caused by poor network connection and/or client behavior.","invalid.property":"Value [%s] is not a valid property for object [%s]","chat.error.member.state":"The conversation member is in a state which does not permit this action.","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"credentials.expired":"The supplied credentials are expired and cannot be used.","authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.internal":"Internal chat error","internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request.","chat.error":"Error handing chat conversation typing operation."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"postWebchatGuestConversationMemberTyping"}},"/api/v2/webchat/guest/conversations/{conversationId}/members":{"get":{"tags":["WebChat"],"summary":"Get the members of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMembers","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"pageSize","in":"query","description":"The number of entries to return per page, or omitted for the default.","required":false,"type":"integer","default":25,"format":"int32"},{"name":"pageNumber","in":"query","description":"The page number to return, or omitted for the first page.","required":false,"type":"integer","default":1,"format":"int32"},{"name":"excludeDisconnectedMembers","in":"query","description":"If true, the results will not contain members who have a DISCONNECTED state.","required":false,"type":"boolean","default":false}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMemberInfoEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMembers"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages/{messageId}":{"get":{"tags":["WebChat"],"summary":"Get a web chat conversation message","description":"","operationId":"getWebchatGuestConversationMessage","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"messageId","in":"path","description":"messageId","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessage"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"chat.error.not.found":"The web chat conversation message was not found.","not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessage"}},"/api/v2/webchat/guest/conversations/{conversationId}/messages":{"get":{"tags":["WebChat"],"summary":"Get the messages of a chat conversation.","description":"","operationId":"getWebchatGuestConversationMessages","produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"conversationId","required":true,"type":"string"},{"name":"after","in":"query","description":"If available, get the messages chronologically after the id of this message","required":false,"type":"string"},{"name":"before","in":"query","description":"If available, get the messages chronologically before the id of this message","required":false,"type":"string"},{"name":"sortOrder","in":"query","description":"Sort order","required":false,"type":"string","default":"ascending","enum":["ascending","descending"]},{"name":"maxResults","in":"query","description":"Limit the returned number of messages, up to a maximum of 100","required":false,"type":"integer","default":100,"format":"int32"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/WebChatMessageEntityList"}},"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"bad.request":"The request could not be understood by the server due to malformed syntax.","response.entity.too.large":"The response is over the size limit. Reduce pageSize or expand list to reduce response size if applicable","invalid.date":"Dates must be specified as ISO-8601 strings. For example: yyyy-MM-ddTHH:mm:ss.SSSZ","invalid.query.param.value":"Value [%s] is not valid for parameter [%s]. Allowable values are: %s","invalid.property":"Value [%s] is not a valid property for object [%s]","constraint.validation":"%s","invalid.value":"Value [%s] is not valid for field type [%s]. Allowable values are: %s"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.required":"No authentication bearer token specified in authorization header.","ip.not.authorized":"Requests originating from this IP address are not authorized: [%s]","bad.credentials":"Invalid login credentials."}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"missing.division.permission":"Unable to perform the requested action. You are missing the following permission '%s' in the provided division(s).","app.not.authorized.for.scope":"App not authorized to use scope %s","missing.permissions":"Unable to perform the requested action. You are missing the following permission(s): %s","not.authorized":"You are not authorized to perform the requested action.","missing.any.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s","authz.policy.denied":"Unable to perform the requested action. Your organization's security policies have denied access. Policy ID(s): [%s]","missing.any.division.permissions":"Unable to perform the requested action. You must have at least one of the following permissions assigned: %s in at least one of the following division(s): %s"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"not.found":"The requested resource was not found."}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"client.timeout":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads."}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"request.entity.too.large":"The request is over the size limit. Maximum bytes: %s"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"unsupported.media.type":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header."}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"too.many.requests.retry.after":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","too.many.requests":"Rate limit exceeded the maximum [%s] requests within [%s] seconds"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"internal.server.error":"The server encountered an unexpected condition which prevented it from fulfilling the request."}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"service.unavailable":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance)."}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"},"x-inin-error-codes":{"authentication.request.timeout":"Authentication request timeout.","request.timeout":"The request timed out."}}},"security":[{"Guest Chat JWT":[]}],"x-purecloud-method-name":"getWebchatGuestConversationMessages"}}},"securityDefinitions":{"PureCloud OAuth":{"type":"oauth2","authorizationUrl":"https://login.mypurecloud.com/authorize","flow":"implicit","scopes":{"all":"All the scopes"}},"Guest Chat JWT":{"type":"apiKey","name":"Authorization","in":"header"}},"definitions":{"CreateWebChatConversationRequest":{"type":"object","required":["deploymentId","memberInfo","organizationId","routingTarget"],"properties":{"organizationId":{"type":"string","description":"The organization identifier."},"deploymentId":{"type":"string","description":"The web chat Deployment ID which contains the appropriate settings for this chat conversation."},"routingTarget":{"description":"The routing information to use for the new chat conversation.","$ref":"#/definitions/WebChatRoutingTarget"},"memberInfo":{"description":"The guest member info to use for the new chat conversation.","$ref":"#/definitions/GuestMemberInfo"},"memberAuthToken":{"type":"string","description":"If the guest member is an authenticated member (ie, not anonymous) his JWT is provided here. The token will have been previously generated with the \"POST /api/v2/signeddata\" resource."},"journeyContext":{"description":"A subset of the Journey System's data relevant to this conversation/session request (for external linkage and internal usage/context).","$ref":"#/definitions/JourneyContext"}}},"WebChatRoutingTarget":{"type":"object","required":["targetAddress","targetType"],"properties":{"targetType":{"type":"string","description":"The target type of the routing target, such as 'QUEUE'.","enum":["QUEUE"]},"targetAddress":{"type":"string","description":"The target of the route, in the format appropriate given the 'targetType'."},"skills":{"type":"array","description":"The list of skill names to use for routing.","items":{"type":"string"}},"language":{"type":"string","description":"The language name to use for routing."},"priority":{"type":"integer","format":"int64","description":"The priority to assign to the conversation for routing."}}},"GuestMemberInfo":{"type":"object","required":["displayName"],"properties":{"displayName":{"type":"string","description":"The display name to use for the guest member in the conversation."},"firstName":{"type":"string","description":"The first name to use for the guest member in the conversation."},"lastName":{"type":"string","description":"The last name to use for the guest member in the conversation."},"email":{"type":"string","description":"The email address to use for the guest member in the conversation."},"phoneNumber":{"type":"string","description":"The phone number to use for the guest member in the conversation."},"avatarImageUrl":{"type":"string","format":"uri","description":"The URL to the avatar image to use for the guest member in the conversation, if any."},"customFields":{"type":"object","description":"Any custom fields of information, in key-value format, to attach to the guest member in the conversation.","additionalProperties":{"type":"string"}}}},"JourneyContext":{"type":"object","required":["customer"],"properties":{"customer":{"description":"A subset of the Journey System's customer data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomer"},"customerSession":{"description":"A subset of the Journey System's tracked customer session data at a point-in-time (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyCustomerSession"},"triggeringAction":{"description":"A subset of the Journey System's action data relevant to a part of a conversation (for external linkage and internal usage/context)","$ref":"#/definitions/JourneyAction"}}},"JourneyCustomer":{"type":"object","required":["id","idType"],"properties":{"id":{"type":"string","description":"An ID of a customer within the Journey System at a point-in-time. Note that a customer entity can have multiple customerIds based on the stitching process. Depending on the context within the PureCloud conversation, this may or may not be mutable."},"idType":{"type":"string","description":"The type of the customerId within the Journey System (e.g. cookie)."}}},"JourneyCustomerSession":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","description":"An ID of a Customer/User's session within the Journey System at a point-in-time"},"type":{"type":"string","description":"The type of the Customer/User's session within the Journey System (e.g. web, app)"}}},"JourneyAction":{"type":"object","required":["actionMap","id"],"properties":{"id":{"type":"string","description":"The ID of an action from the Journey System (an action is spawned from an actionMap)"},"actionMap":{"description":"Details about the action map from the Journey System which triggered this action","$ref":"#/definitions/JourneyActionMap"}}},"JourneyActionMap":{"type":"object","required":["id","version"],"properties":{"id":{"type":"string","description":"The ID of the actionMap in the Journey System which triggered this action"},"version":{"type":"integer","format":"int32","description":"The version number of the actionMap in the Journey System at the time this action was triggered"}}},"CreateWebChatConversationResponse":{"type":"object","properties":{"id":{"type":"string","description":"Chat Conversation identifier"},"jwt":{"type":"string","description":"The JWT that you can use to identify subsequent calls on this conversation"},"eventStreamUri":{"type":"string","format":"uri","description":"The URI which provides the conversation event stream."},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"}}},"WebChatMemberInfo":{"type":"object","required":["role"],"properties":{"id":{"type":"string","description":"The communicationId of this member."},"displayName":{"type":"string","description":"The display name of the member."},"firstName":{"type":"string","description":"The first name of the member."},"lastName":{"type":"string","description":"The last name of the member."},"email":{"type":"string","description":"The email address of the member."},"phoneNumber":{"type":"string","description":"The phone number of the member."},"avatarImageUrl":{"type":"string","format":"uri","description":"The url to the avatar image of the member."},"role":{"type":"string","description":"The role of the member, one of [agent, customer, acd, workflow]","enum":["AGENT","CUSTOMER","WORKFLOW","ACD"]},"joinDate":{"type":"string","format":"date-time","description":"The time the member joined the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z"},"leaveDate":{"type":"string","format":"date-time","description":"The time the member left the conversation, or null if the member is still active in the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z"},"authenticatedGuest":{"type":"boolean","description":"If true, the guest member is an authenticated guest."},"customFields":{"type":"object","description":"Any custom fields of information pertaining to this member.","additionalProperties":{"type":"string"}},"state":{"type":"string","description":"The connection state of this member.","enum":["CONNECTED","DISCONNECTED","ALERTING"]}}},"ErrorBody":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"status":{"type":"integer","format":"int32"},"entityId":{"type":"string"},"entityName":{"type":"string"},"messageWithParams":{"type":"string"},"messageParams":{"type":"object","additionalProperties":{"type":"string"}},"contextId":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/definitions/Detail"}},"errors":{"type":"array","items":{"$ref":"#/definitions/ErrorBody"}},"limit":{"$ref":"#/definitions/Limit"}}},"Detail":{"type":"object","properties":{"errorCode":{"type":"string"},"fieldName":{"type":"string"},"entityId":{"type":"string"},"entityName":{"type":"string"}}},"Limit":{"type":"object","properties":{"key":{"type":"string"},"namespace":{"type":"string","enum":["agent.assistant","analytics.alerting","analytics","analytics.realtime","analytics.reporting.settings","architect","audiohook","audit","auth.api","authorization","automation.testing","bots","bots.voice","callback","cobrowse","content.management","conversation","dataactions","datatables","directory","email","employee.engagement","event.orchestration","external.contacts","gcv","gdpr","groups","historical.adherence","infrastructureascode","integrations","intent.miner","journey","knowledge","language.understanding","learning","limit.registry","marketplace","media.communications","messaging","notifications","onboarding","outbound","platform.api","predictive.routing","presence","quality","recording","response.management","routing","scim","search","secondary.automation.testing","skills","speech.and.text.analytics","speech.integration","supportability","task.management","telephony.configuration","usage","users","web.deployments","web.messaging","webchat","webhooks","workforce.management"]},"value":{"type":"integer","format":"int64"}}},"WebChatGuestMediaRequest":{"type":"object","required":["state","types"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"types":{"type":"array","description":"The types of media being requested.","items":{"type":"string","enum":["COBROWSE","SCREENSHARE"]}},"state":{"type":"string","description":"The state of the media request, one of PENDING|ACCEPTED|DECLINED|TIMEDOUT|CANCELLED|ERRORED.","enum":["PENDING","ACCEPTED","DECLINED","TIMEDOUT","CANCELLED","ERRORED"]},"communicationId":{"type":"string","description":"The ID of the new media communication, if applicable."},"securityKey":{"type":"string","description":"The security information related to a media request."},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}},"description":"Object representing the guest model of a media request of a chat conversation."},"WebChatGuestMediaRequestEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatGuestMediaRequest"}}}},"CreateWebChatMessageRequest":{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The message body. Note that message bodies are limited to 4,000 characters."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice","member-join","member-leave","media-request"]}}},"WebChatMessage":{"type":"object","required":["body","bodyType","conversation","sender","timestamp"],"properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"body":{"type":"string","description":"The message body."},"bodyType":{"type":"string","description":"The purpose of the message within the conversation, such as a standard text entry versus a greeting.","enum":["standard","notice","member-join","member-leave","media-request"]},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatConversation":{"type":"object","properties":{"id":{"type":"string","description":"The globally unique identifier for the object.","readOnly":true},"name":{"type":"string"},"member":{"description":"Chat Member","$ref":"#/definitions/WebChatMemberInfo"},"selfUri":{"type":"string","format":"uri","description":"The URI for this object","readOnly":true}}},"WebChatTyping":{"type":"object","required":["conversation","id","sender","timestamp"],"properties":{"id":{"type":"string","description":"The event identifier of this typing indicator event (useful to guard against event re-delivery"},"conversation":{"description":"The identifier of the conversation","$ref":"#/definitions/WebChatConversation"},"sender":{"description":"The member who sent the message","$ref":"#/definitions/WebChatMemberInfo"},"timestamp":{"type":"string","format":"date-time","description":"The timestamp of the message, in ISO-8601 format"}}},"WebChatMemberInfoEntityList":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMemberInfo"}},"pageSize":{"type":"integer","format":"int32"},"pageNumber":{"type":"integer","format":"int32"},"total":{"type":"integer","format":"int64"},"firstUri":{"type":"string","format":"uri"},"nextUri":{"type":"string","format":"uri"},"previousUri":{"type":"string","format":"uri"},"lastUri":{"type":"string","format":"uri"},"selfUri":{"type":"string","format":"uri"},"pageCount":{"type":"integer","format":"int32"}}},"WebChatMessageEntityList":{"type":"object","properties":{"pageSize":{"type":"integer","format":"int32"},"entities":{"type":"array","items":{"$ref":"#/definitions/WebChatMessage"}},"previousPage":{"type":"string"},"next":{"type":"string"},"selfUri":{"type":"string","format":"uri"}}}},"responses":{"400":{"description":"The request could not be understood by the server due to malformed syntax.","schema":{"$ref":"#/definitions/ErrorBody"}},"401":{"description":"No authentication bearer token specified in authorization header.","schema":{"$ref":"#/definitions/ErrorBody"}},"403":{"description":"You are not authorized to perform the requested action.","schema":{"$ref":"#/definitions/ErrorBody"}},"404":{"description":"The requested resource was not found.","schema":{"$ref":"#/definitions/ErrorBody"}},"408":{"description":"The client did not produce a request within the server timeout limit. This can be caused by a slow network connection and/or large payloads.","schema":{"$ref":"#/definitions/ErrorBody"}},"413":{"description":"The request is over the size limit. Maximum bytes: %s","schema":{"$ref":"#/definitions/ErrorBody"}},"415":{"description":"Unsupported Media Type - Unsupported or incorrect media type, such as an incorrect Content-Type value in the header.","schema":{"$ref":"#/definitions/ErrorBody"}},"429":{"description":"Rate limit exceeded the maximum. Retry the request in [%s] seconds","schema":{"$ref":"#/definitions/ErrorBody"}},"500":{"description":"The server encountered an unexpected condition which prevented it from fulfilling the request.","schema":{"$ref":"#/definitions/ErrorBody"}},"503":{"description":"Service Unavailable - The server is currently unavailable (because it is overloaded or down for maintenance).","schema":{"$ref":"#/definitions/ErrorBody"}},"504":{"description":"The request timed out.","schema":{"$ref":"#/definitions/ErrorBody"}}},"externalDocs":{"description":"PureCloud API Documentation","url":"https://developer.genesys.cloud"}} \ No newline at end of file diff --git a/version.json b/version.json index 1a714ea5..e3309097 100644 --- a/version.json +++ b/version.json @@ -1,9 +1,9 @@ { "major": 13, "minor": 8, - "point": 0, + "point": 1, "prerelease": "", "apiVersion": 0, - "display": "13.8.0", - "displayFull": "13.8.0" + "display": "13.8.1", + "displayFull": "13.8.1" } \ No newline at end of file