@libretexts/cxone-expert-node 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1639 -1220
- package/dist/modules/pages.d.ts +10 -2
- package/dist/modules/pages.d.ts.map +1 -1
- package/dist/modules/requests.d.ts +3 -1
- package/dist/modules/requests.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -29,7 +29,8 @@ const expert = new Expert({
|
|
|
29
29
|
secret: process.env.SERVER_SECRET,
|
|
30
30
|
user: process.env.SERVER_USER,
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
debug: false, // Optional debug logging
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
// Now you can start making API calls!
|
|
@@ -50,5 +51,8 @@ const customAuth = { 'X-Deki-Token': 'different-token' };
|
|
|
50
51
|
const page2 = await expert.pages.getPage(456, { auth: customAuth });
|
|
51
52
|
```
|
|
52
53
|
|
|
54
|
+
## Dependencies
|
|
55
|
+
This package is designed to be lightweight and has only two dependencies: `axios` for making HTTP requests and `debug` for logging/troubleshooting.
|
|
56
|
+
|
|
53
57
|
## License
|
|
54
58
|
This package is open-source and free to use under the [MIT License](http://opensource.org/licenses/MIT).
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";const bt=require("crypto");class We{token=null;BrowserToken({key:e}){return this.token=e,this}ServerToken({key:e,secret:t,user:s}){if(!e||!t||!s)throw new Error("Missing required parameters: key, secret, user");const n=Math.floor(Date.now()/1e3),a=bt.createHmac("sha256",t);a.update(`${e}${n}=${s}`);const o=a.digest("hex");return this.token=`${e}_${n}_=${s}_${o}`,this}getToken(){return this.token}getHeader(){return{"X-Deki-Token":this.token}}}function h(r,e){if(!e&&!r.tld)throw new Error("TLD is required");return e??r.tld}function p(r,e){if(e)return e;if(r.auth){const t=new We;if(r.auth.type==="server")return t.ServerToken(r.auth.params).getHeader();if(r.auth.type==="browser")return t.BrowserToken(r.auth.params).getHeader()}throw new Error("Authentication is required. Configure auth in Expert constructor or pass auth to method call.")}function Ve(r,e){return function(){return r.apply(e,arguments)}}const{toString:wt}=Object.prototype,{getPrototypeOf:Ie}=Object,{iterator:oe,toStringTag:Ge}=Symbol,ie=(r=>e=>{const t=wt.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),U=r=>(r=r.toLowerCase(),e=>ie(e)===r),le=r=>e=>typeof e===r,{isArray:K}=Array,H=le("undefined");function W(r){return r!==null&&!H(r)&&r.constructor!==null&&!H(r.constructor)&&O(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Xe=U("ArrayBuffer");function yt(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Xe(r.buffer),e}const It=le("string"),O=le("function"),Qe=le("number"),V=r=>r!==null&&typeof r=="object",qt=r=>r===!0||r===!1,se=r=>{if(ie(r)!=="object")return!1;const e=Ie(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Ge in r)&&!(oe in r)},Rt=r=>{if(!V(r)||W(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Pt=U("Date"),Et=U("File"),St=U("Blob"),Tt=U("FileList"),$t=r=>V(r)&&O(r.pipe),Ot=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||O(r.append)&&((e=ie(r))==="formdata"||e==="object"&&O(r.toString)&&r.toString()==="[object FormData]"))},_t=U("URLSearchParams"),[Ft,Ct,xt,Nt]=["ReadableStream","Request","Response","Headers"].map(U),Ut=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let s,n;if(typeof r!="object"&&(r=[r]),K(r))for(s=0,n=r.length;s<n;s++)e.call(null,r[s],s,r);else{if(W(r))return;const a=t?Object.getOwnPropertyNames(r):Object.keys(r),o=a.length;let i;for(s=0;s<o;s++)i=a[s],e.call(null,r[i],i,r)}}function Ze(r,e){if(W(r))return null;e=e.toLowerCase();const t=Object.keys(r);let s=t.length,n;for(;s-- >0;)if(n=t[s],e===n.toLowerCase())return n;return null}const v=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ye=r=>!H(r)&&r!==v;function me(){const{caseless:r,skipUndefined:e}=Ye(this)&&this||{},t={},s=(n,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const o=r&&Ze(t,a)||a;se(t[o])&&se(n)?t[o]=me(t[o],n):se(n)?t[o]=me({},n):K(n)?t[o]=n.slice():(!e||!H(n))&&(t[o]=n)};for(let n=0,a=arguments.length;n<a;n++)arguments[n]&&G(arguments[n],s);return t}const Dt=(r,e,t,{allOwnKeys:s}={})=>(G(e,(n,a)=>{t&&O(n)?Object.defineProperty(r,a,{value:Ve(n,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,a,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),r),kt=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Lt=(r,e,t,s)=>{r.prototype=Object.create(e.prototype,s),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},Bt=(r,e,t,s)=>{let n,a,o;const i={};if(e=e||{},r==null)return e;do{for(n=Object.getOwnPropertyNames(r),a=n.length;a-- >0;)o=n[a],(!s||s(o,r,e))&&!i[o]&&(e[o]=r[o],i[o]=!0);r=t!==!1&&Ie(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},vt=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const s=r.indexOf(e,t);return s!==-1&&s===t},jt=r=>{if(!r)return null;if(K(r))return r;let e=r.length;if(!Qe(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},At=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Ie(Uint8Array)),Mt=(r,e)=>{const s=(r&&r[oe]).call(r);let n;for(;(n=s.next())&&!n.done;){const a=n.value;e.call(r,a[0],a[1])}},Ht=(r,e)=>{let t;const s=[];for(;(t=r.exec(e))!==null;)s.push(t);return s},Kt=U("HTMLFormElement"),zt=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,n){return s.toUpperCase()+n}),Ce=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),Jt=U("RegExp"),et=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),s={};G(t,(n,a)=>{let o;(o=e(n,a,r))!==!1&&(s[a]=o||n)}),Object.defineProperties(r,s)},Wt=r=>{et(r,(e,t)=>{if(O(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=r[t];if(O(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Vt=(r,e)=>{const t={},s=n=>{n.forEach(a=>{t[a]=!0})};return K(r)?s(r):s(String(r).split(e)),t},Gt=()=>{},Xt=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Qt(r){return!!(r&&O(r.append)&&r[Ge]==="FormData"&&r[oe])}const Zt=r=>{const e=new Array(10),t=(s,n)=>{if(V(s)){if(e.indexOf(s)>=0)return;if(W(s))return s;if(!("toJSON"in s)){e[n]=s;const a=K(s)?[]:{};return G(s,(o,i)=>{const l=t(o,n+1);!H(l)&&(a[i]=l)}),e[n]=void 0,a}}return s};return t(r,0)},Yt=U("AsyncFunction"),es=r=>r&&(V(r)||O(r))&&O(r.then)&&O(r.catch),tt=((r,e)=>r?setImmediate:e?((t,s)=>(v.addEventListener("message",({source:n,data:a})=>{n===v&&a===t&&s.length&&s.shift()()},!1),n=>{s.push(n),v.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",O(v.postMessage)),ts=typeof queueMicrotask<"u"?queueMicrotask.bind(v):typeof process<"u"&&process.nextTick||tt,ss=r=>r!=null&&O(r[oe]),c={isArray:K,isArrayBuffer:Xe,isBuffer:W,isFormData:Ot,isArrayBufferView:yt,isString:It,isNumber:Qe,isBoolean:qt,isObject:V,isPlainObject:se,isEmptyObject:Rt,isReadableStream:Ft,isRequest:Ct,isResponse:xt,isHeaders:Nt,isUndefined:H,isDate:Pt,isFile:Et,isBlob:St,isRegExp:Jt,isFunction:O,isStream:$t,isURLSearchParams:_t,isTypedArray:At,isFileList:Tt,forEach:G,merge:me,extend:Dt,trim:Ut,stripBOM:kt,inherits:Lt,toFlatObject:Bt,kindOf:ie,kindOfTest:U,endsWith:vt,toArray:jt,forEachEntry:Mt,matchAll:Ht,isHTMLForm:Kt,hasOwnProperty:Ce,hasOwnProp:Ce,reduceDescriptors:et,freezeMethods:Wt,toObjectSet:Vt,toCamelCase:zt,noop:Gt,toFiniteNumber:Xt,findKey:Ze,global:v,isContextDefined:Ye,isSpecCompliantForm:Qt,toJSONObject:Zt,isAsyncFn:Yt,isThenable:es,setImmediate:tt,asap:ts,isIterable:ss};let y=class st extends Error{static from(e,t,s,n,a,o){const i=new st(e.message,t||e.code,s,n,a);return i.cause=e,i.name=e.name,o&&Object.assign(i,o),i}constructor(e,t,s,n,a){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),s&&(this.config=s),n&&(this.request=n),a&&(this.response=a,this.status=a.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}};y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";y.ERR_BAD_OPTION="ERR_BAD_OPTION";y.ECONNABORTED="ECONNABORTED";y.ETIMEDOUT="ETIMEDOUT";y.ERR_NETWORK="ERR_NETWORK";y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";y.ERR_DEPRECATED="ERR_DEPRECATED";y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";y.ERR_BAD_REQUEST="ERR_BAD_REQUEST";y.ERR_CANCELED="ERR_CANCELED";y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";y.ERR_INVALID_URL="ERR_INVALID_URL";const ns=null;function be(r){return c.isPlainObject(r)||c.isArray(r)}function nt(r){return c.endsWith(r,"[]")?r.slice(0,-2):r}function xe(r,e,t){return r?r.concat(e).map(function(n,a){return n=nt(n),!t&&a?"["+n+"]":n}).join(t?".":""):e}function rs(r){return c.isArray(r)&&!r.some(be)}const as=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function ce(r,e,t){if(!c.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=c.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,m){return!c.isUndefined(m[w])});const s=t.metaTokens,n=t.visitor||u,a=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(n))throw new TypeError("visitor must be a function");function d(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!l&&c.isBlob(f))throw new y("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,w,m){let R=f;if(f&&!m&&typeof f=="object"){if(c.endsWith(w,"{}"))w=s?w:w.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&rs(f)||(c.isFileList(f)||c.endsWith(w,"[]"))&&(R=c.toArray(f)))return w=nt(w),R.forEach(function(P,T){!(c.isUndefined(P)||P===null)&&e.append(o===!0?xe([w],T,a):o===null?w:w+"[]",d(P))}),!1}return be(f)?!0:(e.append(xe(m,w,a),d(f)),!1)}const b=[],I=Object.assign(as,{defaultVisitor:u,convertValue:d,isVisitable:be});function E(f,w){if(!c.isUndefined(f)){if(b.indexOf(f)!==-1)throw Error("Circular reference detected in "+w.join("."));b.push(f),c.forEach(f,function(R,F){(!(c.isUndefined(R)||R===null)&&n.call(e,R,c.isString(F)?F.trim():F,w,I))===!0&&E(R,w?w.concat(F):[F])}),b.pop()}}if(!c.isObject(r))throw new TypeError("data must be an object");return E(r),e}function Ne(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function qe(r,e){this._pairs=[],r&&ce(r,this,e)}const rt=qe.prototype;rt.append=function(e,t){this._pairs.push([e,t])};rt.toString=function(e){const t=e?function(s){return e.call(this,s,Ne)}:Ne;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};function os(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function at(r,e,t){if(!e)return r;const s=t&&t.encode||os,n=c.isFunction(t)?{serialize:t}:t,a=n&&n.serialize;let o;if(a?o=a(e,n):o=c.isURLSearchParams(e)?e.toString():new qe(e,n).toString(s),o){const i=r.indexOf("#");i!==-1&&(r=r.slice(0,i)),r+=(r.indexOf("?")===-1?"?":"&")+o}return r}class Ue{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},is=typeof URLSearchParams<"u"?URLSearchParams:qe,ls=typeof FormData<"u"?FormData:null,cs=typeof Blob<"u"?Blob:null,us={isBrowser:!0,classes:{URLSearchParams:is,FormData:ls,Blob:cs},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",we=typeof navigator=="object"&&navigator||void 0,ds=Pe&&(!we||["ReactNative","NativeScript","NS"].indexOf(we.product)<0),hs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ps=Pe&&window.location.href||"http://localhost",gs=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:ds,hasStandardBrowserWebWorkerEnv:hs,navigator:we,origin:ps},Symbol.toStringTag,{value:"Module"})),S={...gs,...us};function fs(r,e){return ce(r,new S.classes.URLSearchParams,{visitor:function(t,s,n,a){return S.isNode&&c.isBuffer(t)?(this.append(s,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...e})}function ms(r){return c.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bs(r){const e={},t=Object.keys(r);let s;const n=t.length;let a;for(s=0;s<n;s++)a=t[s],e[a]=r[a];return e}function ot(r){function e(t,s,n,a){let o=t[a++];if(o==="__proto__")return!0;const i=Number.isFinite(+o),l=a>=t.length;return o=!o&&c.isArray(n)?n.length:o,l?(c.hasOwnProp(n,o)?n[o]=[n[o],s]:n[o]=s,!i):((!n[o]||!c.isObject(n[o]))&&(n[o]=[]),e(t,s,n[o],a)&&c.isArray(n[o])&&(n[o]=bs(n[o])),!i)}if(c.isFormData(r)&&c.isFunction(r.entries)){const t={};return c.forEachEntry(r,(s,n)=>{e(ms(s),n,t,0)}),t}return null}function ws(r,e,t){if(c.isString(r))try{return(e||JSON.parse)(r),c.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}const X={transitional:Re,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",n=s.indexOf("application/json")>-1,a=c.isObject(e);if(a&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return n?JSON.stringify(ot(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(a){if(s.indexOf("application/x-www-form-urlencoded")>-1)return fs(e,this.formSerializer).toString();if((i=c.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ce(i?{"files[]":e}:e,l&&new l,this.formSerializer)}}return a||n?(t.setContentType("application/json",!1),ws(e)):e}],transformResponse:[function(e){const t=this.transitional||X.transitional,s=t&&t.forcedJSONParsing,n=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(s&&!this.responseType||n)){const o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(i){if(o)throw i.name==="SyntaxError"?y.from(i,y.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:S.classes.FormData,Blob:S.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],r=>{X.headers[r]={}});const ys=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Is=r=>{const e={};let t,s,n;return r&&r.split(`
|
|
2
|
-
`).forEach(function(o){
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(n=>s.set(n)),s}static accessor(e){const s=(this[De]=this[De]={accessors:{}}).accessors,n=this.prototype;function a(o){const i=J(o);s[i]||(Es(n,o),s[i]=!0)}return c.isArray(e)?e.forEach(a):a(e),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(_.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(s){this[t]=s}}});c.freezeMethods(_);function ge(r,e){const t=this||X,s=e||t,n=_.from(s.headers);let a=s.data;return c.forEach(r,function(i){a=i.call(t,a,n.normalize(),e?e.status:void 0)}),n.normalize(),a}function it(r){return!!(r&&r.__CANCEL__)}let Q=class extends y{constructor(e,t,s){super(e??"canceled",y.ERR_CANCELED,t,s),this.name="CanceledError",this.__CANCEL__=!0}};function lt(r,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?r(t):e(new y("Request failed with status code "+t.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Ss(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function Ts(r,e){r=r||10;const t=new Array(r),s=new Array(r);let n=0,a=0,o;return e=e!==void 0?e:1e3,function(l){const d=Date.now(),u=s[a];o||(o=d),t[n]=l,s[n]=d;let b=a,I=0;for(;b!==n;)I+=t[b++],b=b%r;if(n=(n+1)%r,n===a&&(a=(a+1)%r),d-o<e)return;const E=u&&d-u;return E?Math.round(I*1e3/E):void 0}}function $s(r,e){let t=0,s=1e3/e,n,a;const o=(d,u=Date.now())=>{t=u,n=null,a&&(clearTimeout(a),a=null),r(...d)};return[(...d)=>{const u=Date.now(),b=u-t;b>=s?o(d,u):(n=d,a||(a=setTimeout(()=>{a=null,o(n)},s-b)))},()=>n&&o(n)]}const ae=(r,e,t=3)=>{let s=0;const n=Ts(50,250);return $s(a=>{const o=a.loaded,i=a.lengthComputable?a.total:void 0,l=o-s,d=n(l),u=o<=i;s=o;const b={loaded:o,total:i,progress:i?o/i:void 0,bytes:l,rate:d||void 0,estimated:d&&i&&u?(i-o)/d:void 0,event:a,lengthComputable:i!=null,[e?"download":"upload"]:!0};r(b)},t)},ke=(r,e)=>{const t=r!=null;return[s=>e[0]({lengthComputable:t,total:r,loaded:s}),e[1]]},Le=r=>(...e)=>c.asap(()=>r(...e)),Os=S.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,S.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(S.origin),S.navigator&&/(msie|trident)/i.test(S.navigator.userAgent)):()=>!0,_s=S.hasStandardBrowserEnv?{write(r,e,t,s,n,a,o){if(typeof document>"u")return;const i=[`${r}=${encodeURIComponent(e)}`];c.isNumber(t)&&i.push(`expires=${new Date(t).toUTCString()}`),c.isString(s)&&i.push(`path=${s}`),c.isString(n)&&i.push(`domain=${n}`),a===!0&&i.push("secure"),c.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(r){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Fs(r){return typeof r!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function Cs(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function ct(r,e,t){let s=!Fs(e);return r&&(s||t==!1)?Cs(r,e):e}const Be=r=>r instanceof _?{...r}:r;function A(r,e){e=e||{};const t={};function s(d,u,b,I){return c.isPlainObject(d)&&c.isPlainObject(u)?c.merge.call({caseless:I},d,u):c.isPlainObject(u)?c.merge({},u):c.isArray(u)?u.slice():u}function n(d,u,b,I){if(c.isUndefined(u)){if(!c.isUndefined(d))return s(void 0,d,b,I)}else return s(d,u,b,I)}function a(d,u){if(!c.isUndefined(u))return s(void 0,u)}function o(d,u){if(c.isUndefined(u)){if(!c.isUndefined(d))return s(void 0,d)}else return s(void 0,u)}function i(d,u,b){if(b in e)return s(d,u);if(b in r)return s(void 0,d)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:i,headers:(d,u,b)=>n(Be(d),Be(u),b,!0)};return c.forEach(Object.keys({...r,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const b=c.hasOwnProp(l,u)?l[u]:n,I=b(r[u],e[u],u);c.isUndefined(I)&&b!==i||(t[u]=I)}),t}const ut=r=>{const e=A({},r);let{data:t,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:a,headers:o,auth:i}=e;if(e.headers=o=_.from(o),e.url=at(ct(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),c.isFormData(t)){if(S.hasStandardBrowserEnv||S.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(t.getHeaders)){const l=t.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([u,b])=>{d.includes(u.toLowerCase())&&o.set(u,b)})}}if(S.hasStandardBrowserEnv&&(s&&c.isFunction(s)&&(s=s(e)),s||s!==!1&&Os(e.url))){const l=n&&a&&_s.read(a);l&&o.set(n,l)}return e},xs=typeof XMLHttpRequest<"u",Ns=xs&&function(r){return new Promise(function(t,s){const n=ut(r);let a=n.data;const o=_.from(n.headers).normalize();let{responseType:i,onUploadProgress:l,onDownloadProgress:d}=n,u,b,I,E,f;function w(){E&&E(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout;function R(){if(!m)return;const P=_.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),N={data:!i||i==="text"||i==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:P,config:r,request:m};lt(function(C){t(C),w()},function(C){s(C),w()},N),m=null}"onloadend"in m?m.onloadend=R:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(R)},m.onabort=function(){m&&(s(new y("Request aborted",y.ECONNABORTED,r,m)),m=null)},m.onerror=function(T){const N=T&&T.message?T.message:"Network Error",L=new y(N,y.ERR_NETWORK,r,m);L.event=T||null,s(L),m=null},m.ontimeout=function(){let T=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const N=n.transitional||Re;n.timeoutErrorMessage&&(T=n.timeoutErrorMessage),s(new y(T,N.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,r,m)),m=null},a===void 0&&o.setContentType(null),"setRequestHeader"in m&&c.forEach(o.toJSON(),function(T,N){m.setRequestHeader(N,T)}),c.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),i&&i!=="json"&&(m.responseType=n.responseType),d&&([I,f]=ae(d,!0),m.addEventListener("progress",I)),l&&m.upload&&([b,E]=ae(l),m.upload.addEventListener("progress",b),m.upload.addEventListener("loadend",E)),(n.cancelToken||n.signal)&&(u=P=>{m&&(s(!P||P.type?new Q(null,r,m):P),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const F=Ss(n.url);if(F&&S.protocols.indexOf(F)===-1){s(new y("Unsupported protocol "+F+":",y.ERR_BAD_REQUEST,r));return}m.send(a||null)})},Us=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let s=new AbortController,n;const a=function(d){if(!n){n=!0,i();const u=d instanceof Error?d:this.reason;s.abort(u instanceof y?u:new Q(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,a(new y(`timeout of ${e}ms exceeded`,y.ETIMEDOUT))},e);const i=()=>{r&&(o&&clearTimeout(o),o=null,r.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),r=null)};r.forEach(d=>d.addEventListener("abort",a));const{signal:l}=s;return l.unsubscribe=()=>c.asap(i),l}},Ds=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let s=0,n;for(;s<t;)n=s+e,yield r.slice(s,n),s=n},ks=async function*(r,e){for await(const t of Ls(r))yield*Ds(t,e)},Ls=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},ve=(r,e,t,s)=>{const n=ks(r,e);let a=0,o,i=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await n.next();if(d){i(),l.close();return}let b=u.byteLength;if(t){let I=a+=b;t(I)}l.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(l){return i(l),n.return()}},{highWaterMark:2})},je=64*1024,{isFunction:te}=c,Bs=(({Request:r,Response:e})=>({Request:r,Response:e}))(c.global),{ReadableStream:Ae,TextEncoder:Me}=c.global,He=(r,...e)=>{try{return!!r(...e)}catch{return!1}},vs=r=>{r=c.merge.call({skipUndefined:!0},Bs,r);const{fetch:e,Request:t,Response:s}=r,n=e?te(e):typeof fetch=="function",a=te(t),o=te(s);if(!n)return!1;const i=n&&te(Ae),l=n&&(typeof Me=="function"?(f=>w=>f.encode(w))(new Me):async f=>new Uint8Array(await new t(f).arrayBuffer())),d=a&&i&&He(()=>{let f=!1;const w=new t(S.origin,{body:new Ae,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!w}),u=o&&i&&He(()=>c.isReadableStream(new s("").body)),b={stream:u&&(f=>f.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!b[f]&&(b[f]=(w,m)=>{let R=w&&w[f];if(R)return R.call(w);throw new y(`Response type '${f}' is not supported`,y.ERR_NOT_SUPPORT,m)})});const I=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new t(S.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await l(f)).byteLength},E=async(f,w)=>{const m=c.toFiniteNumber(f.getContentLength());return m??I(w)};return async f=>{let{url:w,method:m,data:R,signal:F,cancelToken:P,timeout:T,onDownloadProgress:N,onUploadProgress:L,responseType:C,headers:de,withCredentials:Z="same-origin",fetchOptions:Se}=ut(f),Te=e||fetch;C=C?(C+"").toLowerCase():"text";let Y=Us([F,P&&P.toAbortSignal()],T),z=null;const B=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let $e;try{if(L&&d&&m!=="get"&&m!=="head"&&($e=await E(de,R))!==0){let k=new t(w,{method:"POST",body:R,duplex:"half"}),M;if(c.isFormData(R)&&(M=k.headers.get("content-type"))&&de.setContentType(M),k.body){const[he,ee]=ke($e,ae(Le(L)));R=ve(k.body,je,he,ee)}}c.isString(Z)||(Z=Z?"include":"omit");const $=a&&"credentials"in t.prototype,Oe={...Se,signal:Y,method:m.toUpperCase(),headers:de.normalize().toJSON(),body:R,duplex:"half",credentials:$?Z:void 0};z=a&&new t(w,Oe);let D=await(a?Te(z,Se):Te(w,Oe));const _e=u&&(C==="stream"||C==="response");if(u&&(N||_e&&B)){const k={};["status","statusText","headers"].forEach(Fe=>{k[Fe]=D[Fe]});const M=c.toFiniteNumber(D.headers.get("content-length")),[he,ee]=N&&ke(M,ae(Le(N),!0))||[];D=new s(ve(D.body,je,he,()=>{ee&&ee(),B&&B()}),k)}C=C||"text";let mt=await b[c.findKey(b,C)||"text"](D,f);return!_e&&B&&B(),await new Promise((k,M)=>{lt(k,M,{data:mt,headers:_.from(D.headers),status:D.status,statusText:D.statusText,config:f,request:z})})}catch($){throw B&&B(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,f,z,$&&$.response),{cause:$.cause||$}):y.from($,$&&$.code,f,z,$&&$.response)}}},js=new Map,dt=r=>{let e=r&&r.env||{};const{fetch:t,Request:s,Response:n}=e,a=[s,n,t];let o=a.length,i=o,l,d,u=js;for(;i--;)l=a[i],d=u.get(l),d===void 0&&u.set(l,d=i?new Map:vs(e)),u=d;return d};dt();const Ee={http:ns,xhr:Ns,fetch:{get:dt}};c.forEach(Ee,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const Ke=r=>`- ${r}`,As=r=>c.isFunction(r)||r===null||r===!1;function Ms(r,e){r=c.isArray(r)?r:[r];const{length:t}=r;let s,n;const a={};for(let o=0;o<t;o++){s=r[o];let i;if(n=s,!As(s)&&(n=Ee[(i=String(s)).toLowerCase()],n===void 0))throw new y(`Unknown adapter '${i}'`);if(n&&(c.isFunction(n)||(n=n.get(e))))break;a[i||"#"+o]=n}if(!n){const o=Object.entries(a).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
4
|
-
`+o.map(
|
|
5
|
-
`):" "+
|
|
6
|
-
`+a):s.stack=a}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=A(this.defaults,t);const{transitional:s,paramsSerializer:n,headers:a}=t;s!==void 0&&re.assertOptions(s,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean),legacyInterceptorReqResOrdering:x.transitional(x.boolean)},!1),n!=null&&(c.isFunction(n)?t.paramsSerializer={serialize:n}:re.assertOptions(n,{encode:x.function,serialize:x.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),re.assertOptions(t,{baseUrl:x.spelling("baseURL"),withXsrfToken:x.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&c.merge(a.common,a[t.method]);a&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete a[f]}),t.headers=_.concat(o,a);const i=[];let l=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(t)===!1)return;l=l&&w.synchronous;const m=t.transitional||Re;m&&m.legacyInterceptorReqResOrdering?i.unshift(w.fulfilled,w.rejected):i.push(w.fulfilled,w.rejected)});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let u,b=0,I;if(!l){const f=[ze.bind(this),void 0];for(f.unshift(...i),f.push(...d),I=f.length,u=Promise.resolve(t);b<I;)u=u.then(f[b++],f[b++]);return u}I=i.length;let E=t;for(;b<I;){const f=i[b++],w=i[b++];try{E=f(E)}catch(m){w.call(this,m);break}}try{u=ze.call(this,E)}catch(f){return Promise.reject(f)}for(b=0,I=d.length;b<I;)u=u.then(d[b++],d[b++]);return u}getUri(e){e=A(this.defaults,e);const t=ct(e.baseURL,e.url,e.allowAbsoluteUrls);return at(t,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){j.prototype[e]=function(t,s){return this.request(A(s||{},{method:e,url:t,data:(s||{}).data}))}});c.forEach(["post","put","patch"],function(e){function t(s){return function(a,o,i){return this.request(A(i||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}j.prototype[e]=t(),j.prototype[e+"Form"]=t(!0)});let Ks=class gt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});const s=this;this.promise.then(n=>{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](n);s._listeners=null}),this.promise.then=n=>{let a;const o=new Promise(i=>{s.subscribe(i),a=i}).then(n);return o.cancel=function(){s.unsubscribe(a)},o},e(function(a,o,i){s.reason||(s.reason=new Q(a,o,i),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new gt(function(n){e=n}),cancel:e}}};function zs(r){return function(t){return r.apply(null,t)}}function Js(r){return c.isObject(r)&&r.isAxiosError===!0}const ye={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ye).forEach(([r,e])=>{ye[e]=r});function ft(r){const e=new j(r),t=Ve(j.prototype.request,e);return c.extend(t,j.prototype,e,{allOwnKeys:!0}),c.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return ft(A(r,n))},t}const q=ft(X);q.Axios=j;q.CanceledError=Q;q.CancelToken=Ks;q.isCancel=it;q.VERSION=pt;q.toFormData=ce;q.AxiosError=y;q.Cancel=q.CanceledError;q.all=function(e){return Promise.all(e)};q.spread=zs;q.isAxiosError=Js;q.mergeConfig=A;q.AxiosHeaders=_;q.formToJSON=r=>ot(c.isHTMLForm(r)?new FormData(r):r);q.getAdapter=ht.getAdapter;q.HttpStatusCode=ye;q.default=q;const{Axios:on,AxiosError:ln,CanceledError:cn,isCancel:un,CancelToken:dn,VERSION:hn,all:pn,Cancel:gn,isAxiosError:fn,spread:mn,toFormData:bn,AxiosHeaders:wn,HttpStatusCode:yn,formToJSON:In,getAdapter:qn,mergeConfig:Rn}=q,Ws="/@api/deki";class g{axiosInstance=q.create();format="json";constructor(e,t,s="json"){if(!e)throw new Error("TLD is required");if(!t)throw new Error("Auth object is required");let n=e;!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`https://${n}`),n.endsWith("/")&&(n=n.slice(0,n.length-1)),this.format=s,this.axiosInstance=q.create({baseURL:`${n}${Ws}`,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",...t}})}getFormatParam(){return{"dream.out.format":this.format}}async get(e,t){return await this.axiosInstance.get(e,{...t,params:{...t?.params,...this.getFormatParam()}})}async post(e,t,s){return await this.axiosInstance.post(e,t,{...s})}async put(e,t,s){return await this.axiosInstance.put(e,t,{...s})}async patch(e,t,s){return await this.axiosInstance.patch(e,t,{...s})}async del(e,t){return await this.axiosInstance.delete(e,{...t})}async head(e,t){return await this.axiosInstance.head(e,{...t})}}class Vs{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():e==="home"?e:`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return`${encodeURIComponent(encodeURIComponent(e))}`}async getPages(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/pages",{params:{...e}})).data}async getPage(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}`,{params:{...t}})).data}async getPageContents(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/contents`,{params:{...t}})).data}async getPageContentsExplain(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/contents/explain`,{params:{...t}})).data}async getPageDiff(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/diff`,{params:{...t}})).data}async getPageExplain(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/explain`,{params:{...t}})).data}async getPageExportToken(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).get(`/pages/${a}/export/${t}`,{params:{...s},responseType:"stream"})).data}async getPageExportTokenFilename(e,t,s,n,a){const o=this.parsePageId(e),i=this.parseFileName(s),l=h(this.globals,a?.tld),d=p(this.globals,a?.auth);return(await new g(l,d).get(`/pages/${o}/export/${t}/${i}`,{params:{...n},responseType:"stream"})).data}async getPageFilesSubpages(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/explain`,{params:{...t}})).data}async getPageFiles(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/explain`,{params:{...t}})).data}async getPageFile(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}`,{params:{...s},responseType:"stream"})).data}async getPageFileDescription(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}/description`,{params:{...s},responseType:"stream"})).data}async getPageFileInfo(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}/info`,{params:{...s}})).data}async getPageFileRevisions(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}/revisions`,{params:{...s}})).data}async getPageFind(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/find`,{params:{...t}})).data}async getPageInfo(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/info`,{params:{...t}})).data}async getPageLinks(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/links`,{params:{...t}})).data}async getPagePDF(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/pdf`,{params:{...t},responseType:"stream"})).data}async getPagePDFFilename(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/pdf/${o}`,{params:{...s},responseType:"stream"})).data}async getPageProperties(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/properties`,{params:{...t}})).data}async getPagePropertiesKey(e,t,s,n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/properties/${o}`,{params:{...s}})).data}async getPagePropertiesKeyInfo(e,t,s,n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/pages/${a}/properties/${o}/info`,{params:{...s}})).data}async getPageRatings(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/ratings`,{params:{...t}})).data}async getPageRevisions(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/revisions`,{params:{...t}})).data}async getPageSubpages(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/subpages`,{params:{...t}})).data}async getPageTags(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/tags`,{params:{...t}})).data}async getPageTree(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/pages/${n}/tree`,{params:{...t}})).data}async getPageBook(e,t,s){this.parsePageId(e);const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get("/pages/book",{params:{...t},responseType:"stream"})).data}async getPageBookFilename(e,t,s,n){this.parsePageId(e),this.parseFileName(t);const a=h(this.globals,n?.tld),o=p(this.globals,n?.auth);return(await new g(a,o).get(`/pages/book/${t}`,{params:{...s},responseType:"stream"})).data}async getPagesCsv(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/pages/csv",{params:{...e},responseType:"stream"})).data}async getPagesPopular(e,t,s){this.parsePageId(e);const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get("/pages/popular",{params:{...t}})).data}async postPageContents(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).post(`/pages/${a}/contents`,t??"",{headers:{"Content-Type":"text/plain"},params:{...s}})).data}async putPageUnorder(e,t){const s=this.parsePageId(e),n=h(this.globals,t?.tld),a=p(this.globals,t?.auth);return(await new g(n,a).put(`/pages/${s}/unorder`,"")).data}async delPageDelete(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).del(`/pages/${n}`,{params:{...t}})).data}async delPageAllowed(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).del(`/pages/${n}/allowed`,{params:{...t}})).data}async postPageCopied(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).post(`/pages/${n}/copy`,"",{params:{...t}})).data}async postPageExport(e,t){const s=this.parsePageId(e),n=h(this.globals,t?.tld),a=p(this.globals,t?.auth);return(await new g(n,a).post(`/pages/${s}/export`,"")).data}async delPageFileName(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).del(`/pages/${a}/files/${o}`,{params:{...s}})).data}async headPageFileName(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).head(`/pages/${a}/files/${o}`,{params:{...s}})).data}async putPageFileName(e,t,s,n,a){const o=this.parsePageId(e),i=this.parseFileName(t),l=h(this.globals,a?.tld),d=p(this.globals,a?.auth);return(await new g(l,d).put(`/pages/${o}/files/${i}`,s,{headers:{"Content-Type":"application/octet-stream"},params:{...n}})).data}async delPageFileNameDescription(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).del(`/pages/${a}/files/${o}/description`,{params:{...s}})).data}async putPageFileNameDescription(e,t,s,n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).put(`/pages/${a}/files/${o}/description`,{params:{...s}})).data}async putPageFileNamePropertiesKey(e,t,s,n,a){const o=this.parsePageId(e),i=this.parseFileName(t),l=this.parseKey(s),d=h(this.globals,a?.tld),u=p(this.globals,a?.auth);return(await new g(d,u).put(`/pages/${o}/files/${i}/properties/${l}`,"",{params:{...n}})).data}async putPageImport(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).put(`/pages/${n}/import`,"",{params:{...t}})).data}async putPageMove(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).put(`/pages/${n}/move`,"",{params:{...t}})).data}async putPageOrder(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).put(`/pages/${n}/order`,"",{params:{...t}})).data}async postPageProperties(e,t,s,n,a){const o=this.parsePageId(e),i=h(this.globals,a?.tld),l=p(this.globals,a?.auth);return(await new g(i,l).post(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...n}})).data}async putPageProperties(e,t,s,n,a){const o=this.parsePageId(e),i=h(this.globals,a?.tld),l=p(this.globals,a?.auth);return(await new g(i,l).put(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...n}})).data}async deletePagePropertiesKey(e,t,s,n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).del(`/pages/${a}/properties/${o}`,{params:{...s}})).data}async putPagePropertiesKey(e,t,s,n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).put(`/pages/${a}/properties/${o}`,"",{params:{...s}})).data}async postPageRatings(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).post(`/pages/${n}/ratings`,"",{params:{...t}})).data}async postPageRevert(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).post(`/pages/${n}/revert`,"",{params:{...t}})).data}async deletePageSecurity(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).del(`/pages/${n}/security`,{params:{...t}})).data}async postPageSecurity(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).post(`/pages/${a}/security`,t,{params:{...s}})).data}async putPageSecurity(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).put(`/pages/${a}/security`,t,{params:{...s}})).data}async putPageTags(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).put(`/pages/${a}/tags`,t,{params:{...s}})).data}}class Gs{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseGroupId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(e)}`}async getGroups(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/groups",{params:{...e}})).data}async getGroup(e,t,s){const n=this.parseGroupId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/groups/${n}`,{params:{...t}})).data}async getGroupUser(e,t,s){const n=this.parseGroupId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/groups/${n}/users`,{params:{...t}})).data}}class Xs{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}async getPageHierarchyById(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`events/page-hierarchy/${n}`,{params:{...t}})).data}async getPageHierarchyDetailById(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).get(`events/page-hierarchy/${a}/${t}`,{params:{...s}})).data}async getEventPage(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`events/page/${n}`,{params:{...t}})).data}async getEventPageDetail(e,t,s,n){const a=this.parsePageId(e),o=h(this.globals,n?.tld),i=p(this.globals,n?.auth);return(await new g(o,i).get(`/events/page/${a}/${t}`,{params:{...s}})).data}async getEventUserPage(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/events/user-page/${this.parseUserId(e)}`,{params:{...t}})).data}async getEventUserDetailPage(e,t,s,n){const a=h(this.globals,n?.tld),o=p(this.globals,n?.auth);return(await new g(a,o).get(`/events/user-page/${this.parseUserId(e)}/${t}`,{params:{...s}})).data}}class Qs{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getArchive(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/archive",{params:{...e}})).data}async getArchiveFiles(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/archive/files",{params:{...e}})).data}async getArchiveFile(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/archive/files/${e}`,{params:{...t},responseType:"stream"})).data}async getArchiveFileByName(e,t,s,n){const a=h(this.globals,n?.tld),o=this.parseFileName(t),i=p(this.globals,n?.auth);return(await new g(a,i).get(`/archive/files/${e}/${o}`,{params:{...s},responseType:"stream"})).data}async getArchiveFileInfo(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/archive/files/${e}/info`,{params:{...t}})).data}async getArchivePages(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/archive/pages",{params:{...e}})).data}async getArchivePage(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/archive/page/${e}`,{params:{...t}})).data}async getArchivePageContents(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/archive/page/${e}/contents`,{params:{...t}})).data}async getArchivePageInfo(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/archive/page/${e}/info`,{params:{...t}})).data}async getArchivePageSubPages(e,t,s){const n=h(this.globals,s?.tld),a=p(this.globals,s?.auth);return(await new g(n,a).get(`/archive/page/${e}/subpages`,{params:{...t}})).data}}class Zs{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getSiteActivity(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/site/activity",{params:{...e}})).data}async getSiteExportGroups(e){const t=h(this.globals,e?.tld),s=p(this.globals,e?.auth);return(await new g(t,s).get("/site/export/groups")).data}async getSiteExportUsers(e){const t=h(this.globals,e?.tld),s=p(this.globals,e?.auth);return(await new g(t,s).get("/site/export/users")).data}async getSiteSubPagesTags(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/site/nav/${n}/children`,{params:{...t}})).data}async getSiteFullNavTreeTags(e,t,s){const n=this.parsePageId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/site/nav/${n}/full`,{params:{...t}})).data}async getSiteOperations(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/site/operations",{params:{...e}})).data}async getSiteProperties(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/site/properties",{params:{...e}})).data}async GetSiteKeyProperties(e,t,s){const n=this.parseKey(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/site/properties/${n}`,{params:{...t}})).data}async GetSiteKeyPropertiesInfo(e,t,s){const n=this.parseKey(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/site/properties/${n}/info`,{params:{...t}})).data}async GetSiteQuery(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/site/query",{params:{...e}})).data}async GetSiteStatus(e){const t=h(this.globals,e?.tld),s=p(this.globals,e?.auth);return(await new g(t,s).get("/site/status")).data}async GetSiteTags(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/site/tags",{params:{...e}})).data}async GetSiteTag(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/site/tag",{params:{...e}})).data}}class Ys{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getContextMaps(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/contextmaps",{params:{...e}})).data}async getContextMapsById(e,t,s,n){const a=h(this.globals,n?.tld),o=p(this.globals,n?.auth);return(await new g(a,o).get(`/contextmaps/${e}/${t}`,{params:{...s}})).data}}class en{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getUsers(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/users",{params:{...e}})).data}async getUser(e,t,s){const n=this.parseUserId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/users/${n}`,{params:{...t}})).data}async getUserMetrics(e,t,s){const n=this.parseUserId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/users/${n}/metrics`,{params:{...t}})).data}async getUserProperties(e,t,s){const n=this.parseUserId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`/users/${n}/properties`,{params:{...t}})).data}async getUserPropertiesKey(e,t,s,n){const a=this.parseUserId(e),o=this.parseKey(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/users/${a}/properties/${o}`,{params:{...s}})).data}async getUserPropertiesKeyInfo(e,t,s,n){const a=this.parseUserId(e),o=this.parseKey(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`/users/${a}/properties/${o}/info`,{params:{...s}})).data}async getUsersSearch(e,t){const s=h(this.globals,t?.tld),n=p(this.globals,t?.auth);return(await new g(s,n).get("/users/search",{params:{...e}})).data}}class tn{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getFile(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`files/${n}`,{params:{...t},responseType:"stream"})).data}async getFileName(e,t,s,n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).get(`files/${a}/${o}`,{params:{...s},responseType:"stream"})).data}async getFileDescription(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`files/${n}/description`,{params:{...t},responseType:"stream"})).data}async getFileInfo(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`files/${n}/info`,{params:{...t}})).data}async getFileRevisions(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).get(`files/${n}/revisions`,{params:{...t}})).data}async deleteFile(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).del(`files/${n}`,{params:{...t}})).data}async headFile(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).head(`files/${n}`,{params:{...t}})).data}async putFile(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).put(`files/${n}`,"",{params:{...t}})).data}async deleteFileName(e,t,s,n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).del(`files/${a}/${o}`,{params:{...s}})).data}async headFileName(e,t,s,n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).head(`files/${a}/${o}`,{params:{...s}})).data}async putFileName(e,t,s,n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,n?.tld),l=p(this.globals,n?.auth);return(await new g(i,l).put(`files/${a}/${o}`,"",{params:{...s}})).data}async postFileCopy(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).post(`files/${n}/copy`,"",{params:{...t}})).data}async delDescriptionFile(e,t,s){const n=this.parseFileId(e),a=h(this.globals,s?.tld),o=p(this.globals,s?.auth);return(await new g(a,o).del(`files/${n}/description`,{params:{...t}})).data}}class sn{globals={};_pages;_groups;_site;_auth;_archive;_events;_contextMaps;_users;_files;constructor(e){e&&(e.tld&&(this.globals.tld=e.tld),e.auth&&(this.globals.auth=e.auth))}setAuth(e){return this.globals.auth=e,this}configureServerAuth(e){return this.globals.auth={type:"server",params:e},this}configureBrowserAuth(e){return this.globals.auth={type:"browser",params:e},this}get pages(){return this._pages||(this._pages=new Vs(this.globals)),this._pages}get auth(){return this._auth||(this._auth=new We),this._auth}get site(){return this._site||(this._site=new Zs(this.globals)),this._site}get archive(){return this._archive||(this._archive=new Qs(this.globals)),this._archive}get groups(){return this._groups||(this._groups=new Gs(this.globals)),this._groups}get events(){return this._events||(this._events=new Xs(this.globals)),this._events}get contextMaps(){return this._contextMaps||(this._contextMaps=new Ys(this.globals)),this._contextMaps}get users(){return this._users||(this._users=new en(this.globals)),this._users}get files(){return this._files||(this._files=new tn(this.globals)),this._files}}module.exports=sn;
|
|
1
|
+
"use strict";const Ct=require("crypto");class et{token=null;BrowserToken({key:e}){return this.token=e,this}ServerToken({key:e,secret:t,user:s}){if(!e||!t||!s)throw new Error("Missing required parameters: key, secret, user");const r=Math.floor(Date.now()/1e3),n=Ct.createHmac("sha256",t);n.update(`${e}${r}=${s}`);const o=n.digest("hex");return this.token=`${e}_${r}_=${s}_${o}`,this}getToken(){return this.token}getHeader(){return{"X-Deki-Token":this.token}}}function Ft(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var re={exports:{}},fe,Ue;function Et(){if(Ue)return fe;Ue=1;var a=1e3,e=a*60,t=e*60,s=t*24,r=s*7,n=s*365.25;fe=function(u,h){h=h||{};var m=typeof u;if(m==="string"&&u.length>0)return o(u);if(m==="number"&&isFinite(u))return h.long?l(u):i(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(h){var m=parseFloat(h[1]),q=(h[2]||"ms").toLowerCase();switch(q){case"years":case"year":case"yrs":case"yr":case"y":return m*n;case"weeks":case"week":case"w":return m*r;case"days":case"day":case"d":return m*s;case"hours":case"hour":case"hrs":case"hr":case"h":return m*t;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function i(u){var h=Math.abs(u);return h>=s?Math.round(u/s)+"d":h>=t?Math.round(u/t)+"h":h>=e?Math.round(u/e)+"m":h>=a?Math.round(u/a)+"s":u+"ms"}function l(u){var h=Math.abs(u);return h>=s?d(u,h,s,"day"):h>=t?d(u,h,t,"hour"):h>=e?d(u,h,e,"minute"):h>=a?d(u,h,a,"second"):u+" ms"}function d(u,h,m,q){var f=h>=m*1.5;return Math.round(u/m)+" "+q+(f?"s":"")}return fe}var be,De;function St(){if(De)return be;De=1;function a(e){s.debug=s,s.default=s,s.coerce=d,s.disable=i,s.enable=n,s.enabled=l,s.humanize=Et(),s.destroy=u,Object.keys(e).forEach(h=>{s[h]=e[h]}),s.names=[],s.skips=[],s.formatters={};function t(h){let m=0;for(let q=0;q<h.length;q++)m=(m<<5)-m+h.charCodeAt(q),m|=0;return s.colors[Math.abs(m)%s.colors.length]}s.selectColor=t;function s(h){let m,q=null,f,y;function b(...R){if(!b.enabled)return;const F=b,I=Number(new Date),E=I-(m||I);F.diff=E,F.prev=m,F.curr=I,m=I,R[0]=s.coerce(R[0]),typeof R[0]!="string"&&R.unshift("%O");let S=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(T,J)=>{if(T==="%%")return"%";S++;const L=s.formatters[J];if(typeof L=="function"){const ee=R[S];T=L.call(F,ee),R.splice(S,1),S--}return T}),s.formatArgs.call(F,R),(F.log||s.log).apply(F,R)}return b.namespace=h,b.useColors=s.useColors(),b.color=s.selectColor(h),b.extend=r,b.destroy=s.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>q!==null?q:(f!==s.namespaces&&(f=s.namespaces,y=s.enabled(h)),y),set:R=>{q=R}}),typeof s.init=="function"&&s.init(b),b}function r(h,m){const q=s(this.namespace+(typeof m>"u"?":":m)+h);return q.log=this.log,q}function n(h){s.save(h),s.namespaces=h,s.names=[],s.skips=[];const m=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const q of m)q[0]==="-"?s.skips.push(q.slice(1)):s.names.push(q)}function o(h,m){let q=0,f=0,y=-1,b=0;for(;q<h.length;)if(f<m.length&&(m[f]===h[q]||m[f]==="*"))m[f]==="*"?(y=f,b=q,f++):(q++,f++);else if(y!==-1)f=y+1,b++,q=b;else return!1;for(;f<m.length&&m[f]==="*";)f++;return f===m.length}function i(){const h=[...s.names,...s.skips.map(m=>"-"+m)].join(",");return s.enable(""),h}function l(h){for(const m of s.skips)if(o(h,m))return!1;for(const m of s.names)if(o(h,m))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return be=a,be}var ke;function Tt(){return ke||(ke=1,(function(a,e){e.formatArgs=s,e.save=r,e.load=n,e.useColors=t,e.storage=o(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+a.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;l.splice(1,0,d,"color: inherit");let u=0,h=0;l[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(u++,m==="%c"&&(h=u))}),l.splice(h,0,d)}e.log=console.debug||console.log||(()=>{});function r(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function n(){let l;try{l=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}a.exports=St()(e);const{formatters:i}=a.exports;i.j=function(l){try{return JSON.stringify(l)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(re,re.exports)),re.exports}var xt=Tt();const Ot=Ft(xt);function Ce(a,e){const t=Ot(a);return e!==void 0&&(t.enabled=e),t}function p(a,e){if(!e&&!a.tld)throw new Error("TLD is required");return e??a.tld}function g(a,e){if(e)return e;if(a.auth){const t=new et;if(a.auth.type==="server")return t.ServerToken(a.auth.params).getHeader();if(a.auth.type==="browser")return t.BrowserToken(a.auth.params).getHeader()}throw new Error("Authentication is required. Configure auth in Expert constructor or pass auth to method call.")}function tt(a,e){return function(){return a.apply(e,arguments)}}const{toString:$t}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:ue,toStringTag:st}=Symbol,ce=(a=>e=>{const t=$t.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),v=a=>(a=a.toLowerCase(),e=>ce(e)===a),de=a=>e=>typeof e===a,{isArray:z}=Array,K=de("undefined");function G(a){return a!==null&&!K(a)&&a.constructor!==null&&!K(a.constructor)&&$(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}const rt=v("ArrayBuffer");function _t(a){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(a):e=a&&a.buffer&&rt(a.buffer),e}const Nt=de("string"),$=de("function"),at=de("number"),X=a=>a!==null&&typeof a=="object",vt=a=>a===!0||a===!1,ne=a=>{if(ce(a)!=="object")return!1;const e=Fe(a);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(st in a)&&!(ue in a)},Ut=a=>{if(!X(a)||G(a))return!1;try{return Object.keys(a).length===0&&Object.getPrototypeOf(a)===Object.prototype}catch{return!1}},Dt=v("Date"),kt=v("File"),Lt=v("Blob"),Bt=v("FileList"),At=a=>X(a)&&$(a.pipe),jt=a=>{let e;return a&&(typeof FormData=="function"&&a instanceof FormData||$(a.append)&&((e=ce(a))==="formdata"||e==="object"&&$(a.toString)&&a.toString()==="[object FormData]"))},Mt=v("URLSearchParams"),[Ht,Kt,zt,Jt]=["ReadableStream","Request","Response","Headers"].map(v),Wt=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(a,e,{allOwnKeys:t=!1}={}){if(a===null||typeof a>"u")return;let s,r;if(typeof a!="object"&&(a=[a]),z(a))for(s=0,r=a.length;s<r;s++)e.call(null,a[s],s,a);else{if(G(a))return;const n=t?Object.getOwnPropertyNames(a):Object.keys(a),o=n.length;let i;for(s=0;s<o;s++)i=n[s],e.call(null,a[i],i,a)}}function nt(a,e){if(G(a))return null;e=e.toLowerCase();const t=Object.keys(a);let s=t.length,r;for(;s-- >0;)if(r=t[s],e===r.toLowerCase())return r;return null}const A=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ot=a=>!K(a)&&a!==A;function Pe(){const{caseless:a,skipUndefined:e}=ot(this)&&this||{},t={},s=(r,n)=>{if(n==="__proto__"||n==="constructor"||n==="prototype")return;const o=a&&nt(t,n)||n;ne(t[o])&&ne(r)?t[o]=Pe(t[o],r):ne(r)?t[o]=Pe({},r):z(r)?t[o]=r.slice():(!e||!K(r))&&(t[o]=r)};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&Q(arguments[r],s);return t}const Vt=(a,e,t,{allOwnKeys:s}={})=>(Q(e,(r,n)=>{t&&$(r)?Object.defineProperty(a,n,{value:tt(r,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(a,n,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),a),Gt=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),Xt=(a,e,t,s)=>{a.prototype=Object.create(e.prototype,s),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(a,"super",{value:e.prototype}),t&&Object.assign(a.prototype,t)},Qt=(a,e,t,s)=>{let r,n,o;const i={};if(e=e||{},a==null)return e;do{for(r=Object.getOwnPropertyNames(a),n=r.length;n-- >0;)o=r[n],(!s||s(o,a,e))&&!i[o]&&(e[o]=a[o],i[o]=!0);a=t!==!1&&Fe(a)}while(a&&(!t||t(a,e))&&a!==Object.prototype);return e},Zt=(a,e,t)=>{a=String(a),(t===void 0||t>a.length)&&(t=a.length),t-=e.length;const s=a.indexOf(e,t);return s!==-1&&s===t},Yt=a=>{if(!a)return null;if(z(a))return a;let e=a.length;if(!at(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=a[e];return t},es=(a=>e=>a&&e instanceof a)(typeof Uint8Array<"u"&&Fe(Uint8Array)),ts=(a,e)=>{const s=(a&&a[ue]).call(a);let r;for(;(r=s.next())&&!r.done;){const n=r.value;e.call(a,n[0],n[1])}},ss=(a,e)=>{let t;const s=[];for(;(t=a.exec(e))!==null;)s.push(t);return s},rs=v("HTMLFormElement"),as=a=>a.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),Le=(({hasOwnProperty:a})=>(e,t)=>a.call(e,t))(Object.prototype),ns=v("RegExp"),it=(a,e)=>{const t=Object.getOwnPropertyDescriptors(a),s={};Q(t,(r,n)=>{let o;(o=e(r,n,a))!==!1&&(s[n]=o||r)}),Object.defineProperties(a,s)},os=a=>{it(a,(e,t)=>{if($(a)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=a[t];if($(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},is=(a,e)=>{const t={},s=r=>{r.forEach(n=>{t[n]=!0})};return z(a)?s(a):s(String(a).split(e)),t},ls=()=>{},us=(a,e)=>a!=null&&Number.isFinite(a=+a)?a:e;function cs(a){return!!(a&&$(a.append)&&a[st]==="FormData"&&a[ue])}const ds=a=>{const e=new Array(10),t=(s,r)=>{if(X(s)){if(e.indexOf(s)>=0)return;if(G(s))return s;if(!("toJSON"in s)){e[r]=s;const n=z(s)?[]:{};return Q(s,(o,i)=>{const l=t(o,r+1);!K(l)&&(n[i]=l)}),e[r]=void 0,n}}return s};return t(a,0)},hs=v("AsyncFunction"),ps=a=>a&&(X(a)||$(a))&&$(a.then)&&$(a.catch),lt=((a,e)=>a?setImmediate:e?((t,s)=>(A.addEventListener("message",({source:r,data:n})=>{r===A&&n===t&&s.length&&s.shift()()},!1),r=>{s.push(r),A.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",$(A.postMessage)),gs=typeof queueMicrotask<"u"?queueMicrotask.bind(A):typeof process<"u"&&process.nextTick||lt,fs=a=>a!=null&&$(a[ue]),c={isArray:z,isArrayBuffer:rt,isBuffer:G,isFormData:jt,isArrayBufferView:_t,isString:Nt,isNumber:at,isBoolean:vt,isObject:X,isPlainObject:ne,isEmptyObject:Ut,isReadableStream:Ht,isRequest:Kt,isResponse:zt,isHeaders:Jt,isUndefined:K,isDate:Dt,isFile:kt,isBlob:Lt,isRegExp:ns,isFunction:$,isStream:At,isURLSearchParams:Mt,isTypedArray:es,isFileList:Bt,forEach:Q,merge:Pe,extend:Vt,trim:Wt,stripBOM:Gt,inherits:Xt,toFlatObject:Qt,kindOf:ce,kindOfTest:v,endsWith:Zt,toArray:Yt,forEachEntry:ts,matchAll:ss,isHTMLForm:rs,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:it,freezeMethods:os,toObjectSet:is,toCamelCase:as,noop:ls,toFiniteNumber:us,findKey:nt,global:A,isContextDefined:ot,isSpecCompliantForm:cs,toJSONObject:ds,isAsyncFn:hs,isThenable:ps,setImmediate:lt,asap:gs,isIterable:fs};let P=class ut extends Error{static from(e,t,s,r,n,o){const i=new ut(e.message,t||e.code,s,r,n);return i.cause=e,i.name=e.name,o&&Object.assign(i,o),i}constructor(e,t,s,r,n){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),s&&(this.config=s),r&&(this.request=r),n&&(this.response=n,this.status=n.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}};P.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";P.ERR_BAD_OPTION="ERR_BAD_OPTION";P.ECONNABORTED="ECONNABORTED";P.ETIMEDOUT="ETIMEDOUT";P.ERR_NETWORK="ERR_NETWORK";P.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";P.ERR_DEPRECATED="ERR_DEPRECATED";P.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";P.ERR_BAD_REQUEST="ERR_BAD_REQUEST";P.ERR_CANCELED="ERR_CANCELED";P.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";P.ERR_INVALID_URL="ERR_INVALID_URL";const bs=null;function qe(a){return c.isPlainObject(a)||c.isArray(a)}function ct(a){return c.endsWith(a,"[]")?a.slice(0,-2):a}function Be(a,e,t){return a?a.concat(e).map(function(r,n){return r=ct(r),!t&&n?"["+r+"]":r}).join(t?".":""):e}function ms(a){return c.isArray(a)&&!a.some(qe)}const ys=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function he(a,e,t){if(!c.isObject(a))throw new TypeError("target must be an object");e=e||new FormData,t=c.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,b){return!c.isUndefined(b[y])});const s=t.metaTokens,r=t.visitor||u,n=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function d(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!l&&c.isBlob(f))throw new P("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,y,b){let R=f;if(f&&!b&&typeof f=="object"){if(c.endsWith(y,"{}"))y=s?y:y.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&ms(f)||(c.isFileList(f)||c.endsWith(y,"[]"))&&(R=c.toArray(f)))return y=ct(y),R.forEach(function(I,E){!(c.isUndefined(I)||I===null)&&e.append(o===!0?Be([y],E,n):o===null?y:y+"[]",d(I))}),!1}return qe(f)?!0:(e.append(Be(b,y,n),d(f)),!1)}const h=[],m=Object.assign(ys,{defaultVisitor:u,convertValue:d,isVisitable:qe});function q(f,y){if(!c.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(f),c.forEach(f,function(R,F){(!(c.isUndefined(R)||R===null)&&r.call(e,R,c.isString(F)?F.trim():F,y,m))===!0&&q(R,y?y.concat(F):[F])}),h.pop()}}if(!c.isObject(a))throw new TypeError("data must be an object");return q(a),e}function Ae(a){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ee(a,e){this._pairs=[],a&&he(a,this,e)}const dt=Ee.prototype;dt.append=function(e,t){this._pairs.push([e,t])};dt.toString=function(e){const t=e?function(s){return e.call(this,s,Ae)}:Ae;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function ws(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(a,e,t){if(!e)return a;const s=t&&t.encode||ws,r=c.isFunction(t)?{serialize:t}:t,n=r&&r.serialize;let o;if(n?o=n(e,r):o=c.isURLSearchParams(e)?e.toString():new Ee(e,r).toString(s),o){const i=a.indexOf("#");i!==-1&&(a=a.slice(0,i)),a+=(a.indexOf("?")===-1?"?":"&")+o}return a}class je{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ps=typeof URLSearchParams<"u"?URLSearchParams:Ee,qs=typeof FormData<"u"?FormData:null,Rs=typeof Blob<"u"?Blob:null,Is={isBrowser:!0,classes:{URLSearchParams:Ps,FormData:qs,Blob:Rs},protocols:["http","https","file","blob","url","data"]},Te=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,Cs=Te&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Fs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Es=Te&&window.location.href||"http://localhost",Ss=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Te,hasStandardBrowserEnv:Cs,hasStandardBrowserWebWorkerEnv:Fs,navigator:Re,origin:Es},Symbol.toStringTag,{value:"Module"})),x={...Ss,...Is};function Ts(a,e){return he(a,new x.classes.URLSearchParams,{visitor:function(t,s,r,n){return x.isNode&&c.isBuffer(t)?(this.append(s,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function xs(a){return c.matchAll(/\w+|\[(\w*)]/g,a).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Os(a){const e={},t=Object.keys(a);let s;const r=t.length;let n;for(s=0;s<r;s++)n=t[s],e[n]=a[n];return e}function pt(a){function e(t,s,r,n){let o=t[n++];if(o==="__proto__")return!0;const i=Number.isFinite(+o),l=n>=t.length;return o=!o&&c.isArray(r)?r.length:o,l?(c.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!i):((!r[o]||!c.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],n)&&c.isArray(r[o])&&(r[o]=Os(r[o])),!i)}if(c.isFormData(a)&&c.isFunction(a.entries)){const t={};return c.forEachEntry(a,(s,r)=>{e(xs(s),r,t,0)}),t}return null}function $s(a,e,t){if(c.isString(a))try{return(e||JSON.parse)(a),c.trim(a)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(a)}const Z={transitional:Se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,n=c.isObject(e);if(n&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return r?JSON.stringify(pt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ts(e,this.formSerializer).toString();if((i=c.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return he(i?{"files[]":e}:e,l&&new l,this.formSerializer)}}return n||r?(t.setContentType("application/json",!1),$s(e)):e}],transformResponse:[function(e){const t=this.transitional||Z.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(s&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(i){if(o)throw i.name==="SyntaxError"?P.from(i,P.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:x.classes.FormData,Blob:x.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],a=>{Z.headers[a]={}});const _s=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ns=a=>{const e={};let t,s,r;return a&&a.split(`
|
|
2
|
+
`).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&_s[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Me=Symbol("internals");function V(a){return a&&String(a).trim().toLowerCase()}function oe(a){return a===!1||a==null?a:c.isArray(a)?a.map(oe):String(a)}function vs(a){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(a);)e[s[1]]=s[2];return e}const Us=a=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(a.trim());function me(a,e,t,s,r){if(c.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!c.isString(e)){if(c.isString(s))return e.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(e)}}function Ds(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function ks(a,e){const t=c.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(a,s+t,{value:function(r,n,o){return this[s].call(this,e,r,n,o)},configurable:!0})})}let _=class{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function n(i,l,d){const u=V(l);if(!u)throw new Error("header name must be a non-empty string");const h=c.findKey(r,u);(!h||r[h]===void 0||d===!0||d===void 0&&r[h]!==!1)&&(r[h||l]=oe(i))}const o=(i,l)=>c.forEach(i,(d,u)=>n(d,u,l));if(c.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(c.isString(e)&&(e=e.trim())&&!Us(e))o(Ns(e),t);else if(c.isObject(e)&&c.isIterable(e)){let i={},l,d;for(const u of e){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");i[d=u[0]]=(l=i[d])?c.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}o(i,t)}else e!=null&&n(t,e,s);return this}get(e,t){if(e=V(e),e){const s=c.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return vs(r);if(c.isFunction(t))return t.call(this,r,s);if(c.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=V(e),e){const s=c.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||me(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function n(o){if(o=V(o),o){const i=c.findKey(s,o);i&&(!t||me(s,s[i],i,t))&&(delete s[i],r=!0)}}return c.isArray(e)?e.forEach(n):n(e),r}clear(e){const t=Object.keys(this);let s=t.length,r=!1;for(;s--;){const n=t[s];(!e||me(this,this[n],n,e,!0))&&(delete this[n],r=!0)}return r}normalize(e){const t=this,s={};return c.forEach(this,(r,n)=>{const o=c.findKey(s,n);if(o){t[o]=oe(r),delete t[n];return}const i=e?Ds(n):String(n).trim();i!==n&&delete t[n],t[i]=oe(r),s[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return c.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&c.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Me]=this[Me]={accessors:{}}).accessors,r=this.prototype;function n(o){const i=V(o);s[i]||(ks(r,o),s[i]=!0)}return c.isArray(e)?e.forEach(n):n(e),this}};_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(_.prototype,({value:a},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>a,set(s){this[t]=s}}});c.freezeMethods(_);function ye(a,e){const t=this||Z,s=e||t,r=_.from(s.headers);let n=s.data;return c.forEach(a,function(i){n=i.call(t,n,r.normalize(),e?e.status:void 0)}),r.normalize(),n}function gt(a){return!!(a&&a.__CANCEL__)}let Y=class extends P{constructor(e,t,s){super(e??"canceled",P.ERR_CANCELED,t,s),this.name="CanceledError",this.__CANCEL__=!0}};function ft(a,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?a(t):e(new P("Request failed with status code "+t.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Ls(a){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return e&&e[1]||""}function Bs(a,e){a=a||10;const t=new Array(a),s=new Array(a);let r=0,n=0,o;return e=e!==void 0?e:1e3,function(l){const d=Date.now(),u=s[n];o||(o=d),t[r]=l,s[r]=d;let h=n,m=0;for(;h!==r;)m+=t[h++],h=h%a;if(r=(r+1)%a,r===n&&(n=(n+1)%a),d-o<e)return;const q=u&&d-u;return q?Math.round(m*1e3/q):void 0}}function As(a,e){let t=0,s=1e3/e,r,n;const o=(d,u=Date.now())=>{t=u,r=null,n&&(clearTimeout(n),n=null),a(...d)};return[(...d)=>{const u=Date.now(),h=u-t;h>=s?o(d,u):(r=d,n||(n=setTimeout(()=>{n=null,o(r)},s-h)))},()=>r&&o(r)]}const le=(a,e,t=3)=>{let s=0;const r=Bs(50,250);return As(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,l=o-s,d=r(l),u=o<=i;s=o;const h={loaded:o,total:i,progress:i?o/i:void 0,bytes:l,rate:d||void 0,estimated:d&&i&&u?(i-o)/d:void 0,event:n,lengthComputable:i!=null,[e?"download":"upload"]:!0};a(h)},t)},He=(a,e)=>{const t=a!=null;return[s=>e[0]({lengthComputable:t,total:a,loaded:s}),e[1]]},Ke=a=>(...e)=>c.asap(()=>a(...e)),js=x.hasStandardBrowserEnv?((a,e)=>t=>(t=new URL(t,x.origin),a.protocol===t.protocol&&a.host===t.host&&(e||a.port===t.port)))(new URL(x.origin),x.navigator&&/(msie|trident)/i.test(x.navigator.userAgent)):()=>!0,Ms=x.hasStandardBrowserEnv?{write(a,e,t,s,r,n,o){if(typeof document>"u")return;const i=[`${a}=${encodeURIComponent(e)}`];c.isNumber(t)&&i.push(`expires=${new Date(t).toUTCString()}`),c.isString(s)&&i.push(`path=${s}`),c.isString(r)&&i.push(`domain=${r}`),n===!0&&i.push("secure"),c.isString(o)&&i.push(`SameSite=${o}`),document.cookie=i.join("; ")},read(a){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+a+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(a){this.write(a,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Hs(a){return typeof a!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function Ks(a,e){return e?a.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):a}function bt(a,e,t){let s=!Hs(e);return a&&(s||t==!1)?Ks(a,e):e}const ze=a=>a instanceof _?{...a}:a;function M(a,e){e=e||{};const t={};function s(d,u,h,m){return c.isPlainObject(d)&&c.isPlainObject(u)?c.merge.call({caseless:m},d,u):c.isPlainObject(u)?c.merge({},u):c.isArray(u)?u.slice():u}function r(d,u,h,m){if(c.isUndefined(u)){if(!c.isUndefined(d))return s(void 0,d,h,m)}else return s(d,u,h,m)}function n(d,u){if(!c.isUndefined(u))return s(void 0,u)}function o(d,u){if(c.isUndefined(u)){if(!c.isUndefined(d))return s(void 0,d)}else return s(void 0,u)}function i(d,u,h){if(h in e)return s(d,u);if(h in a)return s(void 0,d)}const l={url:n,method:n,data:n,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:i,headers:(d,u,h)=>r(ze(d),ze(u),h,!0)};return c.forEach(Object.keys({...a,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=c.hasOwnProp(l,u)?l[u]:r,m=h(a[u],e[u],u);c.isUndefined(m)&&h!==i||(t[u]=m)}),t}const mt=a=>{const e=M({},a);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:n,headers:o,auth:i}=e;if(e.headers=o=_.from(o),e.url=ht(bt(e.baseURL,e.url,e.allowAbsoluteUrls),a.params,a.paramsSerializer),i&&o.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),c.isFormData(t)){if(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(t.getHeaders)){const l=t.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([u,h])=>{d.includes(u.toLowerCase())&&o.set(u,h)})}}if(x.hasStandardBrowserEnv&&(s&&c.isFunction(s)&&(s=s(e)),s||s!==!1&&js(e.url))){const l=r&&n&&Ms.read(n);l&&o.set(r,l)}return e},zs=typeof XMLHttpRequest<"u",Js=zs&&function(a){return new Promise(function(t,s){const r=mt(a);let n=r.data;const o=_.from(r.headers).normalize();let{responseType:i,onUploadProgress:l,onDownloadProgress:d}=r,u,h,m,q,f;function y(){q&&q(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(r.method.toUpperCase(),r.url,!0),b.timeout=r.timeout;function R(){if(!b)return;const I=_.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),S={data:!i||i==="text"||i==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:I,config:a,request:b};ft(function(T){t(T),y()},function(T){s(T),y()},S),b=null}"onloadend"in b?b.onloadend=R:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(R)},b.onabort=function(){b&&(s(new P("Request aborted",P.ECONNABORTED,a,b)),b=null)},b.onerror=function(E){const S=E&&E.message?E.message:"Network Error",U=new P(S,P.ERR_NETWORK,a,b);U.event=E||null,s(U),b=null},b.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||Se;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),s(new P(E,S.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,a,b)),b=null},n===void 0&&o.setContentType(null),"setRequestHeader"in b&&c.forEach(o.toJSON(),function(E,S){b.setRequestHeader(S,E)}),c.isUndefined(r.withCredentials)||(b.withCredentials=!!r.withCredentials),i&&i!=="json"&&(b.responseType=r.responseType),d&&([m,f]=le(d,!0),b.addEventListener("progress",m)),l&&b.upload&&([h,q]=le(l),b.upload.addEventListener("progress",h),b.upload.addEventListener("loadend",q)),(r.cancelToken||r.signal)&&(u=I=>{b&&(s(!I||I.type?new Y(null,a,b):I),b.abort(),b=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const F=Ls(r.url);if(F&&x.protocols.indexOf(F)===-1){s(new P("Unsupported protocol "+F+":",P.ERR_BAD_REQUEST,a));return}b.send(n||null)})},Ws=(a,e)=>{const{length:t}=a=a?a.filter(Boolean):[];if(e||t){let s=new AbortController,r;const n=function(d){if(!r){r=!0,i();const u=d instanceof Error?d:this.reason;s.abort(u instanceof P?u:new Y(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,n(new P(`timeout of ${e}ms exceeded`,P.ETIMEDOUT))},e);const i=()=>{a&&(o&&clearTimeout(o),o=null,a.forEach(d=>{d.unsubscribe?d.unsubscribe(n):d.removeEventListener("abort",n)}),a=null)};a.forEach(d=>d.addEventListener("abort",n));const{signal:l}=s;return l.unsubscribe=()=>c.asap(i),l}},Vs=function*(a,e){let t=a.byteLength;if(t<e){yield a;return}let s=0,r;for(;s<t;)r=s+e,yield a.slice(s,r),s=r},Gs=async function*(a,e){for await(const t of Xs(a))yield*Vs(t,e)},Xs=async function*(a){if(a[Symbol.asyncIterator]){yield*a;return}const e=a.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Je=(a,e,t,s)=>{const r=Gs(a,e);let n=0,o,i=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await r.next();if(d){i(),l.close();return}let h=u.byteLength;if(t){let m=n+=h;t(m)}l.enqueue(new Uint8Array(u))}catch(d){throw i(d),d}},cancel(l){return i(l),r.return()}},{highWaterMark:2})},We=64*1024,{isFunction:ae}=c,Qs=(({Request:a,Response:e})=>({Request:a,Response:e}))(c.global),{ReadableStream:Ve,TextEncoder:Ge}=c.global,Xe=(a,...e)=>{try{return!!a(...e)}catch{return!1}},Zs=a=>{a=c.merge.call({skipUndefined:!0},Qs,a);const{fetch:e,Request:t,Response:s}=a,r=e?ae(e):typeof fetch=="function",n=ae(t),o=ae(s);if(!r)return!1;const i=r&&ae(Ve),l=r&&(typeof Ge=="function"?(f=>y=>f.encode(y))(new Ge):async f=>new Uint8Array(await new t(f).arrayBuffer())),d=n&&i&&Xe(()=>{let f=!1;const y=new t(x.origin,{body:new Ve,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),u=o&&i&&Xe(()=>c.isReadableStream(new s("").body)),h={stream:u&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!h[f]&&(h[f]=(y,b)=>{let R=y&&y[f];if(R)return R.call(y);throw new P(`Response type '${f}' is not supported`,P.ERR_NOT_SUPPORT,b)})});const m=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new t(x.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await l(f)).byteLength},q=async(f,y)=>{const b=c.toFiniteNumber(f.getContentLength());return b??m(y)};return async f=>{let{url:y,method:b,data:R,signal:F,cancelToken:I,timeout:E,onDownloadProgress:S,onUploadProgress:U,responseType:T,headers:J,withCredentials:L="same-origin",fetchOptions:ee}=mt(f),Oe=e||fetch;T=T?(T+"").toLowerCase():"text";let te=Ws([F,I&&I.toAbortSignal()],E),W=null;const B=te&&te.unsubscribe&&(()=>{te.unsubscribe()});let $e;try{if(U&&d&&b!=="get"&&b!=="head"&&($e=await q(J,R))!==0){let k=new t(y,{method:"POST",body:R,duplex:"half"}),H;if(c.isFormData(R)&&(H=k.headers.get("content-type"))&&J.setContentType(H),k.body){const[ge,se]=He($e,le(Ke(U)));R=Je(k.body,We,ge,se)}}c.isString(L)||(L=L?"include":"omit");const O=n&&"credentials"in t.prototype,_e={...ee,signal:te,method:b.toUpperCase(),headers:J.normalize().toJSON(),body:R,duplex:"half",credentials:O?L:void 0};W=n&&new t(y,_e);let D=await(n?Oe(W,ee):Oe(y,_e));const Ne=u&&(T==="stream"||T==="response");if(u&&(S||Ne&&B)){const k={};["status","statusText","headers"].forEach(ve=>{k[ve]=D[ve]});const H=c.toFiniteNumber(D.headers.get("content-length")),[ge,se]=S&&He(H,le(Ke(S),!0))||[];D=new s(Je(D.body,We,ge,()=>{se&&se(),B&&B()}),k)}T=T||"text";let It=await h[c.findKey(h,T)||"text"](D,f);return!Ne&&B&&B(),await new Promise((k,H)=>{ft(k,H,{data:It,headers:_.from(D.headers),status:D.status,statusText:D.statusText,config:f,request:W})})}catch(O){throw B&&B(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new P("Network Error",P.ERR_NETWORK,f,W,O&&O.response),{cause:O.cause||O}):P.from(O,O&&O.code,f,W,O&&O.response)}}},Ys=new Map,yt=a=>{let e=a&&a.env||{};const{fetch:t,Request:s,Response:r}=e,n=[s,r,t];let o=n.length,i=o,l,d,u=Ys;for(;i--;)l=n[i],d=u.get(l),d===void 0&&u.set(l,d=i?new Map:Zs(e)),u=d;return d};yt();const xe={http:bs,xhr:Js,fetch:{get:yt}};c.forEach(xe,(a,e)=>{if(a){try{Object.defineProperty(a,"name",{value:e})}catch{}Object.defineProperty(a,"adapterName",{value:e})}});const Qe=a=>`- ${a}`,er=a=>c.isFunction(a)||a===null||a===!1;function tr(a,e){a=c.isArray(a)?a:[a];const{length:t}=a;let s,r;const n={};for(let o=0;o<t;o++){s=a[o];let i;if(r=s,!er(s)&&(r=xe[(i=String(s)).toLowerCase()],r===void 0))throw new P(`Unknown adapter '${i}'`);if(r&&(c.isFunction(r)||(r=r.get(e))))break;n[i||"#"+o]=r}if(!r){const o=Object.entries(n).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
4
|
+
`+o.map(Qe).join(`
|
|
5
|
+
`):" "+Qe(o[0]):"as no adapter specified";throw new P("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r}const wt={getAdapter:tr,adapters:xe};function we(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new Y(null,a)}function Ze(a){return we(a),a.headers=_.from(a.headers),a.data=ye.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),wt.getAdapter(a.adapter||Z.adapter,a)(a).then(function(s){return we(a),s.data=ye.call(a,a.transformResponse,s),s.headers=_.from(s.headers),s},function(s){return gt(s)||(we(a),s&&s.response&&(s.response.data=ye.call(a,a.transformResponse,s.response),s.response.headers=_.from(s.response.headers))),Promise.reject(s)})}const Pt="1.13.5",pe={};["object","boolean","number","function","string","symbol"].forEach((a,e)=>{pe[a]=function(s){return typeof s===a||"a"+(e<1?"n ":" ")+a}});const Ye={};pe.transitional=function(e,t,s){function r(n,o){return"[Axios v"+Pt+"] Transitional option '"+n+"'"+o+(s?". "+s:"")}return(n,o,i)=>{if(e===!1)throw new P(r(o," has been removed"+(t?" in "+t:"")),P.ERR_DEPRECATED);return t&&!Ye[o]&&(Ye[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,o,i):!0}};pe.spelling=function(e){return(t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function sr(a,e,t){if(typeof a!="object")throw new P("options must be an object",P.ERR_BAD_OPTION_VALUE);const s=Object.keys(a);let r=s.length;for(;r-- >0;){const n=s[r],o=e[n];if(o){const i=a[n],l=i===void 0||o(i,n,a);if(l!==!0)throw new P("option "+n+" must be "+l,P.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new P("Unknown option "+n,P.ERR_BAD_OPTION)}}const ie={assertOptions:sr,validators:pe},N=ie.validators;let j=class{constructor(e){this.defaults=e||{},this.interceptors={request:new je,response:new je}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const n=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?n&&!String(s.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
+
`+n):s.stack=n}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=M(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:n}=t;s!==void 0&&ie.assertOptions(s,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean),legacyInterceptorReqResOrdering:N.transitional(N.boolean)},!1),r!=null&&(c.isFunction(r)?t.paramsSerializer={serialize:r}:ie.assertOptions(r,{encode:N.function,serialize:N.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ie.assertOptions(t,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=n&&c.merge(n.common,n[t.method]);n&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),t.headers=_.concat(o,n);const i=[];let l=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(t)===!1)return;l=l&&y.synchronous;const b=t.transitional||Se;b&&b.legacyInterceptorReqResOrdering?i.unshift(y.fulfilled,y.rejected):i.push(y.fulfilled,y.rejected)});const d=[];this.interceptors.response.forEach(function(y){d.push(y.fulfilled,y.rejected)});let u,h=0,m;if(!l){const f=[Ze.bind(this),void 0];for(f.unshift(...i),f.push(...d),m=f.length,u=Promise.resolve(t);h<m;)u=u.then(f[h++],f[h++]);return u}m=i.length;let q=t;for(;h<m;){const f=i[h++],y=i[h++];try{q=f(q)}catch(b){y.call(this,b);break}}try{u=Ze.call(this,q)}catch(f){return Promise.reject(f)}for(h=0,m=d.length;h<m;)u=u.then(d[h++],d[h++]);return u}getUri(e){e=M(this.defaults,e);const t=bt(e.baseURL,e.url,e.allowAbsoluteUrls);return ht(t,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){j.prototype[e]=function(t,s){return this.request(M(s||{},{method:e,url:t,data:(s||{}).data}))}});c.forEach(["post","put","patch"],function(e){function t(s){return function(n,o,i){return this.request(M(i||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}j.prototype[e]=t(),j.prototype[e+"Form"]=t(!0)});let rr=class qt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(n){t=n});const s=this;this.promise.then(r=>{if(!s._listeners)return;let n=s._listeners.length;for(;n-- >0;)s._listeners[n](r);s._listeners=null}),this.promise.then=r=>{let n;const o=new Promise(i=>{s.subscribe(i),n=i}).then(r);return o.cancel=function(){s.unsubscribe(n)},o},e(function(n,o,i){s.reason||(s.reason=new Y(n,o,i),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new qt(function(r){e=r}),cancel:e}}};function ar(a){return function(t){return a.apply(null,t)}}function nr(a){return c.isObject(a)&&a.isAxiosError===!0}const Ie={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ie).forEach(([a,e])=>{Ie[e]=a});function Rt(a){const e=new j(a),t=tt(j.prototype.request,e);return c.extend(t,j.prototype,e,{allOwnKeys:!0}),c.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Rt(M(a,r))},t}const C=Rt(Z);C.Axios=j;C.CanceledError=Y;C.CancelToken=rr;C.isCancel=gt;C.VERSION=Pt;C.toFormData=he;C.AxiosError=P;C.Cancel=C.CanceledError;C.all=function(e){return Promise.all(e)};C.spread=ar;C.isAxiosError=nr;C.mergeConfig=M;C.AxiosHeaders=_;C.formToJSON=a=>pt(c.isHTMLForm(a)?new FormData(a):a);C.getAdapter=wt.getAdapter;C.HttpStatusCode=Ie;C.default=C;const{Axios:wr,AxiosError:Pr,CanceledError:qr,isCancel:Rr,CancelToken:Ir,VERSION:Cr,all:Fr,Cancel:Er,isAxiosError:Sr,spread:Tr,toFormData:xr,AxiosHeaders:Or,HttpStatusCode:$r,formToJSON:_r,getAdapter:Nr,mergeConfig:vr}=C,or="/@api/deki";class w{axiosInstance=C.create();format="json";debug;constructor(e,t,s="json",r){if(this.debug=Ce("cxone-expert:requests",r),!e)throw this.debug("TLD is required to initialize Requests module"),new Error("TLD is required");if(!t)throw this.debug("Auth object is required to initialize Requests module"),new Error("Auth object is required");let n=e;!n.startsWith("http://")&&!n.startsWith("https://")&&(n=`https://${n}`),n.endsWith("/")&&(n=n.slice(0,n.length-1)),this.format=s,this.axiosInstance=C.create({baseURL:`${n}${or}`,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",...t}}),this.setupInterceptors()}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{if(this.debug(`→ ${e.method?.toUpperCase()} ${e.baseURL}${e.url}`),e.params&&Object.keys(e.params).length>0&&this.debug(" Query params:",JSON.stringify(e.params)),e.data&&e.headers?.["Content-Type"]!=="application/octet-stream"){const t=typeof e.data=="string"?e.data:JSON.stringify(e.data);t.length>200?this.debug(" Body:",t.substring(0,200)+"... (truncated)"):t.length>0&&this.debug(" Body:",t)}return e},e=>(this.debug("✗ Request error:",e.message),Promise.reject(e))),this.axiosInstance.interceptors.response.use(e=>{if(this.debug(`← ${e.status} ${e.config.method?.toUpperCase()} ${e.config.url}`),e.data&&e.headers["content-type"]?.includes("application/json")){const t=JSON.stringify(e.data);t.length>200?this.debug(" Response:",t.substring(0,200)+"... (truncated)"):this.debug(" Response:",t)}else e.headers["content-type"]?.includes("text/")?this.debug(" Response: [text content]"):e.data&&this.debug(" Response: [binary content]");return e},e=>{if(e.response){if(this.debug(`✗ ${e.response.status} ${e.config?.method?.toUpperCase()} ${e.config?.url}`),this.debug(" Error:",e.response.statusText),e.response.data){const t=typeof e.response.data=="string"?e.response.data:JSON.stringify(e.response.data);t.length>200?this.debug(" Error details:",t.substring(0,200)+"... (truncated)"):this.debug(" Error details:",t)}}else e.request?this.debug("✗ No response received:",e.message):this.debug("✗ Request setup error:",e.message);return Promise.reject(e)})}getFormatParam(){return{"dream.out.format":this.format}}async get(e,t){return await this.axiosInstance.get(e,{...t,params:{...t?.params,...this.getFormatParam()}})}async post(e,t,s){return await this.axiosInstance.post(e,t,{...s})}async put(e,t,s){return await this.axiosInstance.put(e,t,{...s})}async patch(e,t,s){return await this.axiosInstance.patch(e,t,{...s})}async del(e,t){return await this.axiosInstance.delete(e,{...t})}async head(e,t){return await this.axiosInstance.head(e,{...t})}}class ir{globals;_auth;debug;constructor(e,t){this.globals=e,this._auth=t,this.debug=Ce("cxone-expert-node:pages",e.debug),this.debug("Pages module initialized")}parsePageId(e){return typeof e=="number"?e.toString():e==="home"?e:`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return`${encodeURIComponent(encodeURIComponent(e))}`}createRequests(e,t){return new w(e,t,"json",this.globals.debug)}async getPages(e,t){this.debug("getPages called");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages",{params:{...e}});return this.debug("getPages completed successfully"),o.data}async getPage(e,t,s){this.debug("getPage called for:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}`,{params:{...t}});return this.debug("getPage completed successfully"),l.data}async getPageContents(e,t,s){this.debug("getPageContents called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/contents`,{params:{...t}});return this.debug("getPageContents retrieved contents for page:",e),l.data}async getPageContentsExplain(e,t,s){this.debug("getPageContentsExplain called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/contents/explain`,{params:{...t}});return this.debug("getPageContentsExplain retrieved contents for page:",e),l.data}async getPageDiff(e,t,s){this.debug("getPageDiff called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/diff`,{params:{...t}});return this.debug("getPageDiff retrieved diff for page:",e),l.data}async getPageExplain(e,t,s){this.debug("getPageExplain called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/explain`,{params:{...t}});return this.debug("getPageExplain retrieved explanation for page:",e),l.data}async getPageExportToken(e,t,s,r){this.debug("getPageExportToken called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).get(`/pages/${n}/export/${t}`,{params:{...s},responseType:"stream"});return this.debug("getPageExportToken successfully retrieved export for page:",e),d.data}async getPageExportTokenFilename(e,t,s,r,n){this.debug("getPageExportTokenFilename called for page:",e);const o=this.parsePageId(e),i=this.parseFileName(s),l=p(this.globals,n?.tld),d=g(this.globals,n?.auth),h=await this.createRequests(l,d).get(`/pages/${o}/export/${t}/${i}`,{params:{...r},responseType:"stream"});return this.debug("getPageExportTokenFilename successfully retrieved export for page:",e),h.data}async getPageFilesSubpages(e,t,s){this.debug("getPageFilesSubpages called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/explain`,{params:{...t}});return this.debug("getPageFilesSubpages retrieved file and subpage info for page:",e),l.data}async getPageFiles(e,t,s){this.debug("getPageFiles called");const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/explain`,{params:{...t}});return this.debug("getPageFiles retrieved file info for page:",e),l.data}async getPageFile(e,t,s,r){this.debug("getPageFile called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}`,{params:{...s},responseType:"stream"});return this.debug("getPageFile successfully retrieved file for page:",e),u.data}async getPageFileDescription(e,t,s,r){this.debug("getPageFileDescription called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}/description`,{params:{...s},responseType:"stream"});return this.debug("getPageFileDescription successfully retrieved description for page:",e),u.data}async getPageFileInfo(e,t,s,r){this.debug("getPageFileInfo called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}/info`,{params:{...s}});return this.debug("getPageFileInfo successfully retrieved info for file on page:",e),u.data}async getPageFileRevisions(e,t,s,r){this.debug("getPageFileRevisions called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/files/${o}/revisions`,{params:{...s}});return this.debug("getPageFileRevisions successfully retrieved revisions for file on page:",e),u.data}async getPageFind(e,t,s){this.debug("getPageFind called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/find`,{params:{...t}});return this.debug("getPageFind successfully retrieved find results for page:",e),l.data}async getPageInfo(e,t,s){this.debug("getPageInfo called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/info`,{params:{...t}});return this.debug("getPageInfo successfully retrieved info for page:",e),l.data}async getPageLinks(e,t,s){this.debug("getPageLinks called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/links`,{params:{...t}});return this.debug("getPageLinks successfully retrieved links for page:",e),l.data}async getPagePDF(e,t,s){this.debug("getPagePDF called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/pdf`,{params:{...t},responseType:"stream"});return this.debug("getPagePDF successfully retrieved PDF for page:",e),l.data}async getPagePDFFilename(e,t,s,r){this.debug("getPagePDFFilename called for page:",e);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/pdf/${o}`,{params:{...s},responseType:"stream"});return this.debug("getPagePDFFilename successfully retrieved PDF for page:",e),u.data}async getPageProperties(e,t,s){this.debug("getPageProperties called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/properties`,{params:{...t}});return this.debug("getPageProperties successfully retrieved properties for page:",e),l.data}async getPagePropertiesKey(e,t,s,r){this.debug("getPagePropertiesKey called for page:",e);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/properties/${o}`,{params:{...s}});return this.debug("getPagePropertiesKey successfully retrieved property key for page:",e),u.data}async getPagePropertiesKeyInfo(e,t,s,r){this.debug("getPagePropertiesKeyInfo called for page:",e);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).get(`/pages/${n}/properties/${o}/info`,{params:{...s}});return this.debug("getPagePropertiesKeyInfo successfully retrieved property key info for page:",e),u.data}async getPageRatings(e,t,s){this.debug("getPageRatings called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/ratings`,{params:{...t}});return this.debug("getPageRatings successfully retrieved ratings for page:",e),l.data}async getPageRevisions(e,t,s){this.debug("getPageRevisions called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/revisions`,{params:{...t}});return this.debug("getPageRevisions successfully retrieved revisions for page:",e),l.data}async getPageSubpages(e,t,s){this.debug("getPageSubpages called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/subpages`,{params:{...t}});return this.debug("getPageSubpages successfully retrieved subpages for page:",e),l.data}async getPageTags(e,t,s){this.debug("getPageTags called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/tags`,{params:{...t}});return this.debug("getPageTags successfully retrieved tags for page:",e),l.data}async getPageTree(e,t,s){this.debug("getPageTree called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).get(`/pages/${r}/tree`,{params:{...t}});return this.debug("getPageTree successfully retrieved tree for page:",e),l.data}async getPageBook(e,t){this.debug("getPageBook called");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages/book",{params:{...e},responseType:"stream"});return this.debug("getPageBook successfully retrieved book"),o.data}async getPageBookFilename(e,t,s,r){this.debug("getPageBookFilename called for page:",e),this.parsePageId(e),this.parseFileName(t);const n=p(this.globals,r?.tld),o=g(this.globals,r?.auth),l=await this.createRequests(n,o).get(`/pages/book/${t}`,{params:{...s},responseType:"stream"});return this.debug("getPageBookFilename successfully retrieved book for page:",e),l.data}async getPagesCsv(e,t){this.debug("getPagesCsv called with params");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages/csv",{params:{...e},responseType:"stream"});return this.debug("getPagesCsv successfully retrieved CSV data"),o.data}async getPagesPopular(e,t){this.debug("getPagesPopular called for page.");const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth),o=await this.createRequests(s,r).get("/pages/popular",{params:{...e}});return this.debug("getPagesPopular successfully retrieved popular pages."),o.data}async postPageContents(e,t,s,r){this.debug("postPageContents called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).post(`/pages/${n}/contents`,t??"",{headers:{"Content-Type":"text/plain"},params:{...s}});return this.debug("postPageContents successfully updated page:",e),d.data}async putPageUnorder(e,t){this.debug("putPageUnorder called for page:",e);const s=this.parsePageId(e),r=p(this.globals,t?.tld),n=g(this.globals,t?.auth);return(await this.createRequests(r,n).put(`/pages/${s}/unorder`,"")).data}async delPageDelete(e,t,s){this.debug("delPageDelete called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).del(`/pages/${r}`,{params:{...t}});return this.debug("delPageDelete successfully deleted page:",e),l.data}async delPageAllowed(e,t,s){this.debug("delPageAllowed called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).del(`/pages/${r}/allowed`,{params:{...t}});return this.debug("delPageAllowed successfully changed permissions for page:",e),l.data}async postPageCopied(e,t,s){this.debug("postPageCopied called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).post(`/pages/${r}/copy`,"",{params:{...t}});return this.debug("postPageCopied successfully copied page:",e),l.data}async postPageExport(e,t){this.debug("postPageExport called for page:",e);const s=this.parsePageId(e),r=p(this.globals,t?.tld),n=g(this.globals,t?.auth),i=await this.createRequests(r,n).post(`/pages/${s}/export`,"");return this.debug("postPageExport successfully exported page:",e),i.data}async delPageFileName(e,t,s,r){this.debug("delPageFileName called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).del(`/pages/${n}/files/${o}`,{params:{...s}});return this.debug("delPageFileName successfully deleted file:",t,"from page:",e),u.data}async headPageFileName(e,t,s,r){this.debug("headPageFileName called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).head(`/pages/${n}/files/${o}`,{params:{...s}});return this.debug("headPageFileName successfully checked existence of file:",t,"on page:",e),u.data}async putPageFileName(e,t,s,r,n){this.debug("putPageFileName called for page:",e,"filename:",t);const o=this.parsePageId(e),i=this.parseFileName(t),l=p(this.globals,n?.tld),d=g(this.globals,n?.auth),h=await this.createRequests(l,d).put(`/pages/${o}/files/${i}`,s,{headers:{"Content-Type":"application/octet-stream"},params:{...r}});return this.debug("putPageFileName successfully uploaded file:",t,"to page:",e),h.data}async delPageFileNameDescription(e,t,s,r){this.debug("delPageFileNameDescription called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).del(`/pages/${n}/files/${o}/description`,{params:{...s}});return this.debug("delPageFileNameDescription successfully deleted description for file:",t,"on page:",e),u.data}async putPageFileNameDescription(e,t,s,r){this.debug("putPageFileNameDescription called for page:",e,"filename:",t);const n=this.parsePageId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).put(`/pages/${n}/files/${o}/description`,{params:{...s}});return this.debug("putPageFileNameDescription successfully updated description for file:",t,"on page:",e),u.data}async putPageFileNamePropertiesKey(e,t,s,r,n){this.debug("putPageFileNamePropertiesKey called for page:",e,"filename:",t,"key:",s);const o=this.parsePageId(e),i=this.parseFileName(t),l=this.parseKey(s),d=p(this.globals,n?.tld),u=g(this.globals,n?.auth),m=await this.createRequests(d,u).put(`/pages/${o}/files/${i}/properties/${l}`,"",{params:{...r}});return this.debug("putPageFileNamePropertiesKey successfully updated property key:",s,"for file:",t,"on page:",e),m.data}async putPageImport(e,t,s){this.debug("putPageImport called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).put(`/pages/${r}/import`,"",{params:{...t}});return this.debug("putPageImport successfully imported content to page:",e),l.data}async putPageMove(e,t,s){this.debug("putPageMove called for page:",e,"to:",t?.to);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).put(`/pages/${r}/move`,"",{params:{...t}});return this.debug("putPageMove successfully moved page:",e),l.data}async putPageOrder(e,t,s){this.debug("putPageOrder called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).put(`/pages/${r}/order`,"",{params:{...t}});return this.debug("putPageOrder successfully updated order for page:",e),l.data}async postPageProperties(e,t,s,r,n){this.debug("postPageProperties called for page:",e,"property:",t);const o=this.parsePageId(e),i=p(this.globals,n?.tld),l=g(this.globals,n?.auth),u=await this.createRequests(i,l).post(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...r}});return this.debug("postPageProperties successfully created property:",t,"for page:",e),u.data}async putPageProperties(e,t,s,r,n){this.debug("putPageProperties called for page:",e,"property:",t);const o=this.parsePageId(e),i=p(this.globals,n?.tld),l=g(this.globals,n?.auth),u=await this.createRequests(i,l).put(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...r}});return this.debug("putPageProperties successfully updated property:",t,"for page:",e),u.data}async deletePagePropertiesKey(e,t,s,r){this.debug("deletePagePropertiesKey called for page:",e,"key:",t);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).del(`/pages/${n}/properties/${o}`,{params:{...s}});return this.debug("deletePagePropertiesKey successfully deleted property key:",t,"for page:",e),u.data}async putPagePropertiesKey(e,t,s,r){this.debug("putPagePropertiesKey called for page:",e,"key:",t);const n=this.parsePageId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth),u=await this.createRequests(i,l).put(`/pages/${n}/properties/${o}`,"",{params:{...s}});return this.debug("putPagePropertiesKey successfully updated property key:",t,"for page:",e),u.data}async postPageRatings(e,t,s){this.debug("postPageRatings called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).post(`/pages/${r}/ratings`,"",{params:{...t}});return this.debug("postPageRatings successfully submitted rating for page:",e),l.data}async postPageRevert(e,t,s){this.debug("postPageRevert called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).post(`/pages/${r}/revert`,"",{params:{...t}});return this.debug("postPageRevert successfully reverted page:",e),l.data}async deletePageSecurity(e,t,s){this.debug("deletePageSecurity called for page:",e);const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth),l=await this.createRequests(n,o).del(`/pages/${r}/security`,{params:{...t}});return this.debug("deletePageSecurity successfully deleted security settings for page:",e),l.data}async postPageSecurity(e,t,s,r){this.debug("postPageSecurity called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).post(`/pages/${n}/security`,t,{params:{...s}});return this.debug("postPageSecurity successfully created security settings for page:",e),d.data}async putPageSecurity(e,t,s,r){this.debug("putPageSecurity called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).put(`/pages/${n}/security`,t,{params:{...s}});return this.debug("putPageSecurity successfully updated security settings for page:",e),d.data}async putPageTags(e,t,s,r){this.debug("putPageTags called for page:",e);const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth),d=await this.createRequests(o,i).put(`/pages/${n}/tags`,t,{params:{...s}});return this.debug("putPageTags successfully updated tags for page:",e),d.data}}class lr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseGroupId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(e)}`}async getGroups(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/groups",{params:{...e}})).data}async getGroup(e,t,s){const r=this.parseGroupId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/groups/${r}`,{params:{...t}})).data}async getGroupUser(e,t,s){const r=this.parseGroupId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/groups/${r}/users`,{params:{...t}})).data}}class ur{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}async getPageHierarchyById(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`events/page-hierarchy/${r}`,{params:{...t}})).data}async getPageHierarchyDetailById(e,t,s,r){const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth);return(await new w(o,i).get(`events/page-hierarchy/${n}/${t}`,{params:{...s}})).data}async getEventPage(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`events/page/${r}`,{params:{...t}})).data}async getEventPageDetail(e,t,s,r){const n=this.parsePageId(e),o=p(this.globals,r?.tld),i=g(this.globals,r?.auth);return(await new w(o,i).get(`/events/page/${n}/${t}`,{params:{...s}})).data}async getEventUserPage(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/events/user-page/${this.parseUserId(e)}`,{params:{...t}})).data}async getEventUserDetailPage(e,t,s,r){const n=p(this.globals,r?.tld),o=g(this.globals,r?.auth);return(await new w(n,o).get(`/events/user-page/${this.parseUserId(e)}/${t}`,{params:{...s}})).data}}class cr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getArchive(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/archive",{params:{...e}})).data}async getArchiveFiles(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/archive/files",{params:{...e}})).data}async getArchiveFile(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/files/${e}`,{params:{...t},responseType:"stream"})).data}async getArchiveFileByName(e,t,s,r){const n=p(this.globals,r?.tld),o=this.parseFileName(t),i=g(this.globals,r?.auth);return(await new w(n,i).get(`/archive/files/${e}/${o}`,{params:{...s},responseType:"stream"})).data}async getArchiveFileInfo(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/files/${e}/info`,{params:{...t}})).data}async getArchivePages(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/archive/pages",{params:{...e}})).data}async getArchivePage(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}`,{params:{...t}})).data}async getArchivePageContents(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}/contents`,{params:{...t}})).data}async getArchivePageInfo(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}/info`,{params:{...t}})).data}async getArchivePageSubPages(e,t,s){const r=p(this.globals,s?.tld),n=g(this.globals,s?.auth);return(await new w(r,n).get(`/archive/page/${e}/subpages`,{params:{...t}})).data}}class dr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parsePageId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getSiteActivity(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/activity",{params:{...e}})).data}async getSiteExportGroups(e){const t=p(this.globals,e?.tld),s=g(this.globals,e?.auth);return(await new w(t,s).get("/site/export/groups")).data}async getSiteExportUsers(e){const t=p(this.globals,e?.tld),s=g(this.globals,e?.auth);return(await new w(t,s).get("/site/export/users")).data}async getSiteSubPagesTags(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/nav/${r}/children`,{params:{...t}})).data}async getSiteFullNavTreeTags(e,t,s){const r=this.parsePageId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/nav/${r}/full`,{params:{...t}})).data}async getSiteOperations(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/operations",{params:{...e}})).data}async getSiteProperties(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/properties",{params:{...e}})).data}async GetSiteKeyProperties(e,t,s){const r=this.parseKey(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/properties/${r}`,{params:{...t}})).data}async GetSiteKeyPropertiesInfo(e,t,s){const r=this.parseKey(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/site/properties/${r}/info`,{params:{...t}})).data}async GetSiteQuery(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/query",{params:{...e}})).data}async GetSiteStatus(e){const t=p(this.globals,e?.tld),s=g(this.globals,e?.auth);return(await new w(t,s).get("/site/status")).data}async GetSiteTags(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/tags",{params:{...e}})).data}async GetSiteTag(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/site/tag",{params:{...e}})).data}}class hr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}async getContextMaps(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/contextmaps",{params:{...e}})).data}async getContextMapsById(e,t,s,r){const n=p(this.globals,r?.tld),o=g(this.globals,r?.auth);return(await new w(n,o).get(`/contextmaps/${e}/${t}`,{params:{...s}})).data}}class pr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseUserId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getUsers(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/users",{params:{...e}})).data}async getUser(e,t,s){const r=this.parseUserId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/users/${r}`,{params:{...t}})).data}async getUserMetrics(e,t,s){const r=this.parseUserId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/users/${r}/metrics`,{params:{...t}})).data}async getUserProperties(e,t,s){const r=this.parseUserId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`/users/${r}/properties`,{params:{...t}})).data}async getUserPropertiesKey(e,t,s,r){const n=this.parseUserId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).get(`/users/${n}/properties/${o}`,{params:{...s}})).data}async getUserPropertiesKeyInfo(e,t,s,r){const n=this.parseUserId(e),o=this.parseKey(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).get(`/users/${n}/properties/${o}/info`,{params:{...s}})).data}async getUsersSearch(e,t){const s=p(this.globals,t?.tld),r=g(this.globals,t?.auth);return(await new w(s,r).get("/users/search",{params:{...e}})).data}}class gr{globals;_auth;constructor(e,t){this.globals=e,this._auth=t}parseFileId(e){return typeof e=="number"?e.toString():`=${encodeURIComponent(encodeURIComponent(e))}`}parseFileName(e){return`=${encodeURIComponent(encodeURIComponent(e))}`}parseKey(e){return encodeURIComponent(encodeURIComponent(e))}async getFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}`,{params:{...t},responseType:"stream"})).data}async getFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).get(`files/${n}/${o}`,{params:{...s},responseType:"stream"})).data}async getFileDescription(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}/description`,{params:{...t},responseType:"stream"})).data}async getFileInfo(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}/info`,{params:{...t}})).data}async getFileRevisions(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).get(`files/${r}/revisions`,{params:{...t}})).data}async deleteFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).del(`files/${r}`,{params:{...t}})).data}async headFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).head(`files/${r}`,{params:{...t}})).data}async putFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).put(`files/${r}`,"",{params:{...t}})).data}async deleteFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).del(`files/${n}/${o}`,{params:{...s}})).data}async headFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).head(`files/${n}/${o}`,{params:{...s}})).data}async putFileName(e,t,s,r){const n=this.parseFileId(e),o=this.parseFileName(t),i=p(this.globals,r?.tld),l=g(this.globals,r?.auth);return(await new w(i,l).put(`files/${n}/${o}`,"",{params:{...s}})).data}async postFileCopy(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).post(`files/${r}/copy`,"",{params:{...t}})).data}async delDescriptionFile(e,t,s){const r=this.parseFileId(e),n=p(this.globals,s?.tld),o=g(this.globals,s?.auth);return(await new w(n,o).del(`files/${r}/description`,{params:{...t}})).data}}class fr{globals={};debug;_pages;_groups;_site;_auth;_archive;_events;_contextMaps;_users;_files;constructor(e){e&&(e.tld&&(this.globals.tld=e.tld),e.auth&&(this.globals.auth=e.auth),e.debug!==void 0&&(this.globals.debug=e.debug)),this.debug=Ce("cxone-expert-node",this.globals.debug),this.debug("Debug logging enabled for cxone-expert-node. This is not recommended for production use as credentials may be exposed in log files!"),this.debug("Expert instance created with options:",e)}setAuth(e){return this.globals.auth=e,this.debug("Authentication configured:",e),this}configureServerAuth(e){return this.globals.auth={type:"server",params:e},this.debug("Server authentication configured:",e),this}configureBrowserAuth(e){return this.globals.auth={type:"browser",params:e},this.debug("Browser authentication configured:",e),this}get pages(){return this._pages||(this.debug("Initializing Pages module"),this._pages=new ir(this.globals)),this._pages}get auth(){return this._auth||(this.debug("Initializing Auth module"),this._auth=new et),this._auth}get site(){return this._site||(this.debug("Initializing Site module"),this._site=new dr(this.globals)),this._site}get archive(){return this._archive||(this.debug("Initializing Archive module"),this._archive=new cr(this.globals)),this._archive}get groups(){return this._groups||(this.debug("Initializing Groups module"),this._groups=new lr(this.globals)),this._groups}get events(){return this._events||(this.debug("Initializing Events module"),this._events=new ur(this.globals)),this._events}get contextMaps(){return this._contextMaps||(this.debug("Initializing Context Maps module"),this._contextMaps=new hr(this.globals)),this._contextMaps}get users(){return this._users||(this.debug("Initializing Users module"),this._users=new pr(this.globals)),this._users}get files(){return this._files||(this.debug("Initializing Files module"),this._files=new gr(this.globals)),this._files}}module.exports=fr;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { default as Files } from './modules/files';
|
|
|
11
11
|
export * from './types/index';
|
|
12
12
|
export default class Expert {
|
|
13
13
|
private globals;
|
|
14
|
+
private debug;
|
|
14
15
|
private _pages?;
|
|
15
16
|
private _groups?;
|
|
16
17
|
private _site?;
|
|
@@ -23,6 +24,7 @@ export default class Expert {
|
|
|
23
24
|
constructor(options?: {
|
|
24
25
|
tld?: string;
|
|
25
26
|
auth?: AuthConfig;
|
|
27
|
+
debug?: boolean;
|
|
26
28
|
});
|
|
27
29
|
setAuth(authConfig: AuthConfig): this;
|
|
28
30
|
configureServerAuth(params: ServerTokenParams): this;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAIpC,cAAc,eAAe,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAC,CAAQ;gBAEX,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;IAYnE,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAMrC,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAMpD,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAM7D,IAAW,KAAK,IAAI,KAAK,CAOxB;IAED,IAAW,IAAI,IAAI,IAAI,CAOtB;IAED,IAAW,IAAI,IAAI,IAAI,CAOtB;IAED,IAAW,OAAO,IAAI,OAAO,CAO5B;IAED,IAAW,MAAM,IAAI,MAAM,CAO1B;IAED,IAAW,MAAM,IAAI,MAAM,CAO1B;IAED,IAAW,WAAW,IAAI,WAAW,CAMpC;IAED,IAAW,KAAK,IAAI,KAAK,CAOxB;IAED,IAAW,KAAK,IAAI,KAAK,CAOxB;CACJ"}
|