@libretexts/cxone-expert-node 1.1.1 → 1.2.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 +29 -18
- package/dist/index.cjs +6 -0
- package/dist/index.d.ts +40 -32
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +3079 -0
- package/dist/modules/archive.d.ts +19 -18
- package/dist/modules/archive.d.ts.map +1 -0
- package/dist/modules/auth.d.ts +9 -8
- package/dist/modules/auth.d.ts.map +1 -0
- package/dist/modules/contextMaps.d.ts +11 -10
- package/dist/modules/contextMaps.d.ts.map +1 -0
- package/dist/modules/events.d.ts +16 -15
- package/dist/modules/events.d.ts.map +1 -0
- package/dist/modules/files.d.ts +24 -23
- package/dist/modules/files.d.ts.map +1 -0
- package/dist/modules/groups.d.ts +12 -11
- package/dist/modules/groups.d.ts.map +1 -0
- package/dist/modules/pages.d.ts +68 -68
- package/dist/modules/pages.d.ts.map +1 -0
- package/dist/modules/requests.d.ts +15 -14
- package/dist/modules/requests.d.ts.map +1 -0
- package/dist/modules/site.d.ts +23 -22
- package/dist/modules/site.d.ts.map +1 -0
- package/dist/modules/users.d.ts +17 -16
- package/dist/modules/users.d.ts.map +1 -0
- package/dist/types/archive.d.ts +79 -78
- package/dist/types/archive.d.ts.map +1 -0
- package/dist/types/auth.d.ts +12 -11
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/contextMaps.d.ts +35 -34
- package/dist/types/contextMaps.d.ts.map +1 -0
- package/dist/types/events.d.ts +69 -68
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/files.d.ts +62 -61
- package/dist/types/files.d.ts.map +1 -0
- package/dist/types/groups.d.ts +58 -57
- package/dist/types/groups.d.ts.map +1 -0
- package/dist/types/index.d.ts +28 -19
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/pages.d.ts +738 -737
- package/dist/types/pages.d.ts.map +1 -0
- package/dist/types/requests.d.ts +10 -9
- package/dist/types/requests.d.ts.map +1 -0
- package/dist/types/security.d.ts +58 -57
- package/dist/types/security.d.ts.map +1 -0
- package/dist/types/site.d.ts +255 -254
- package/dist/types/site.d.ts.map +1 -0
- package/dist/types/users.d.ts +82 -81
- package/dist/types/users.d.ts.map +1 -0
- package/dist/utils.d.ts +4 -2
- package/dist/utils.d.ts.map +1 -0
- package/package.json +20 -10
- package/dist/cxone-expert-node.cjs.development.js +0 -1511
- package/dist/cxone-expert-node.cjs.development.js.map +0 -1
- package/dist/cxone-expert-node.cjs.production.min.js +0 -2
- package/dist/cxone-expert-node.cjs.production.min.js.map +0 -1
- package/dist/cxone-expert-node.esm.js +0 -1505
- package/dist/cxone-expert-node.esm.js.map +0 -1
- package/dist/index.js +0 -8
- package/src/index.ts +0 -105
- package/src/modules/archive.ts +0 -186
- package/src/modules/auth.ts +0 -35
- package/src/modules/contextMaps.ts +0 -56
- package/src/modules/events.ts +0 -140
- package/src/modules/files.ts +0 -291
- package/src/modules/groups.ts +0 -79
- package/src/modules/pages.ts +0 -1236
- package/src/modules/requests.ts +0 -68
- package/src/modules/site.ts +0 -266
- package/src/modules/users.ts +0 -161
- package/src/types/archive.ts +0 -101
- package/src/types/auth.ts +0 -14
- package/src/types/contextMaps.ts +0 -46
- package/src/types/events.ts +0 -91
- package/src/types/files.ts +0 -87
- package/src/types/groups.ts +0 -74
- package/src/types/index.ts +0 -22
- package/src/types/pages.ts +0 -859
- package/src/types/requests.ts +0 -11
- package/src/types/security.ts +0 -61
- package/src/types/site.ts +0 -304
- package/src/types/users.ts +0 -101
- package/src/utils.ts +0 -8
package/README.md
CHANGED
|
@@ -8,32 +8,43 @@ npm install @libretexts/cxone-expert-node
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
|
-
```
|
|
12
|
-
import Expert from "@libretexts/cxone-expert-node";
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
#### Recommended
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
Configure authentication once at the Expert instance level:
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
```typescript
|
|
17
|
+
import Expert from "@libretexts/cxone-expert-node";
|
|
18
|
+
|
|
19
|
+
// Option 1: Configure everything in the constructor
|
|
20
|
+
const expert = new Expert({
|
|
21
|
+
tld: process.env.SERVER_DOMAIN,
|
|
22
|
+
auth: {
|
|
23
|
+
type: 'server',
|
|
24
|
+
params: {
|
|
25
|
+
key: process.env.SERVER_KEY,
|
|
26
|
+
secret: process.env.SERVER_SECRET,
|
|
27
|
+
user: process.env.SERVER_USER,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
23
30
|
});
|
|
24
31
|
|
|
25
|
-
//
|
|
32
|
+
// Now you can start making API calls!
|
|
33
|
+
const page = await expert.pages.getPage(123);
|
|
34
|
+
const pages = await expert.pages.getPages();
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
console.log(page);
|
|
37
|
+
```
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
const page = await expert.pages.getPage(123, {
|
|
32
|
-
auth: authHeaders,
|
|
33
|
-
tld,
|
|
34
|
-
});
|
|
39
|
+
#### Per-call auth override (when needed):
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
```typescript
|
|
42
|
+
// Global auth is used by default
|
|
43
|
+
const page1 = await expert.pages.getPage(123);
|
|
44
|
+
|
|
45
|
+
// Override with different auth for specific call
|
|
46
|
+
const customAuth = { 'X-Deki-Token': 'different-token' };
|
|
47
|
+
const page2 = await expert.pages.getPage(456, { auth: customAuth });
|
|
37
48
|
```
|
|
38
49
|
|
|
39
50
|
## License
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const bt=require("crypto");class Ve{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 Ve;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 We(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 V(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"),W=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(!W(r)||V(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=>W(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(V(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(V(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:We(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)},Vt=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+"'")})}})},Wt=(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(W(s)){if(e.indexOf(s)>=0)return;if(V(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&&(W(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:V,isFormData:Ot,isArrayBufferView:yt,isString:It,isNumber:Qe,isBoolean:qt,isObject:W,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:Vt,toObjectSet:Wt,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){n=o.indexOf(":"),t=o.substring(0,n).trim().toLowerCase(),s=o.substring(n+1).trim(),!(!t||e[t]&&ys[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},De=Symbol("internals");function J(r){return r&&String(r).trim().toLowerCase()}function ne(r){return r===!1||r==null?r:c.isArray(r)?r.map(ne):String(r)}function qs(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(r);)e[s[1]]=s[2];return e}const Rs=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function pe(r,e,t,s,n){if(c.isFunction(s))return s.call(this,e,t);if(n&&(e=t),!!c.isString(e)){if(c.isString(s))return e.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(e)}}function Ps(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function Es(r,e){const t=c.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(r,s+t,{value:function(n,a,o){return this[s].call(this,e,n,a,o)},configurable:!0})})}let _=class{constructor(e){e&&this.set(e)}set(e,t,s){const n=this;function a(i,l,d){const u=J(l);if(!u)throw new Error("header name must be a non-empty string");const b=c.findKey(n,u);(!b||n[b]===void 0||d===!0||d===void 0&&n[b]!==!1)&&(n[b||l]=ne(i))}const o=(i,l)=>c.forEach(i,(d,u)=>a(d,u,l));if(c.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(c.isString(e)&&(e=e.trim())&&!Rs(e))o(Is(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&&a(t,e,s);return this}get(e,t){if(e=J(e),e){const s=c.findKey(this,e);if(s){const n=this[s];if(!t)return n;if(t===!0)return qs(n);if(c.isFunction(t))return t.call(this,n,s);if(c.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=J(e),e){const s=c.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||pe(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let n=!1;function a(o){if(o=J(o),o){const i=c.findKey(s,o);i&&(!t||pe(s,s[i],i,t))&&(delete s[i],n=!0)}}return c.isArray(e)?e.forEach(a):a(e),n}clear(e){const t=Object.keys(this);let s=t.length,n=!1;for(;s--;){const a=t[s];(!e||pe(this,this[a],a,e,!0))&&(delete this[a],n=!0)}return n}normalize(e){const t=this,s={};return c.forEach(this,(n,a)=>{const o=c.findKey(s,a);if(o){t[o]=ne(n),delete t[a];return}const i=e?Ps(a):String(a).trim();i!==a&&delete t[a],t[i]=ne(n),s[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return c.forEach(this,(s,n)=>{s!=null&&s!==!1&&(t[n]=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(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(Ke).join(`
|
|
5
|
+
`):" "+Ke(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return n}const ht={getAdapter:Ms,adapters:Ee};function fe(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Q(null,r)}function ze(r){return fe(r),r.headers=_.from(r.headers),r.data=ge.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),ht.getAdapter(r.adapter||X.adapter,r)(r).then(function(s){return fe(r),s.data=ge.call(r,r.transformResponse,s),s.headers=_.from(s.headers),s},function(s){return it(s)||(fe(r),s&&s.response&&(s.response.data=ge.call(r,r.transformResponse,s.response),s.response.headers=_.from(s.response.headers))),Promise.reject(s)})}const pt="1.13.5",ue={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{ue[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});const Je={};ue.transitional=function(e,t,s){function n(a,o){return"[Axios v"+pt+"] Transitional option '"+a+"'"+o+(s?". "+s:"")}return(a,o,i)=>{if(e===!1)throw new y(n(o," has been removed"+(t?" in "+t:"")),y.ERR_DEPRECATED);return t&&!Je[o]&&(Je[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,i):!0}};ue.spelling=function(e){return(t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Hs(r,e,t){if(typeof r!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const s=Object.keys(r);let n=s.length;for(;n-- >0;){const a=s[n],o=e[a];if(o){const i=r[a],l=i===void 0||o(i,a,r);if(l!==!0)throw new y("option "+a+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new y("Unknown option "+a,y.ERR_BAD_OPTION)}}const re={assertOptions:Hs,validators:ue},x=re.validators;let j=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ue,response:new Ue}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const a=n.stack?n.stack.replace(/^.+\n/,""):"";try{s.stack?a&&!String(s.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
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=We(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,Vs="/@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");const n=e.endsWith("/")?e.slice(0,e.length-1):`${e}`;this.format=s,this.axiosInstance=q.create({baseURL:`${n}${Vs}`,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 Ws{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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/pages",{params:{...t}})).data}async getPage(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}`,{params:{...s}})).data}async getPageContents(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/contents`,{params:{...s}})).data}async getPageContentsExplain(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/contents/explain`,{params:{...s}})).data}async getPageDiff(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/diff`,{params:{...s}})).data}async getPageExplain(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/explain`,{params:{...s}})).data}async getPageExportToken(e,t,s={},n){const a=this.parsePageId(e),o=h(this.globals,s.tld),i=p(this.globals,s.auth);return(await new g(o,i).get(`/pages/${a}/export/${t}`,{params:{...n},responseType:"stream"})).data}async getPageExportTokenFilename(e,t,s,n={},a){const o=this.parsePageId(e),i=this.parseFileName(s),l=h(this.globals,n.tld),d=p(this.globals,n.auth);return(await new g(l,d).get(`/pages/${o}/export/${t}/${i}`,{params:{...a},responseType:"stream"})).data}async getPageFilesSubpages(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/explain`,{params:{...s}})).data}async getPageFiles(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/explain`,{params:{...s}})).data}async getPageFile(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}`,{params:{...n},responseType:"stream"})).data}async getPageFileDescription(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}/description`,{params:{...n},responseType:"stream"})).data}async getPageFileInfo(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}/info`,{params:{...n}})).data}async getPageFileRevisions(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/files/${o}/revisions`,{params:{...n}})).data}async getPageFind(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/find`,{params:{...s}})).data}async getPageInfo(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/info`,{params:{...s}})).data}async getPageLinks(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/links`,{params:{...s}})).data}async getPagePDF(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/pdf`,{params:{...s},responseType:"stream"})).data}async getPagePDFFilename(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/pdf/${o}`,{params:{...n},responseType:"stream"})).data}async getPageProperties(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/properties`,{params:{...s}})).data}async getPagePropertiesKey(e,t,s={},n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/properties/${o}`,{params:{...n}})).data}async getPagePropertiesKeyInfo(e,t,s={},n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/pages/${a}/properties/${o}/info`,{params:{...n}})).data}async getPageRatings(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/ratings`,{params:{...s}})).data}async getPageRevisions(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/revisions`,{params:{...s}})).data}async getPageSubpages(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/subpages`,{params:{...s}})).data}async getPageTags(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/tags`,{params:{...s}})).data}async getPageTree(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/pages/${n}/tree`,{params:{...s}})).data}async getPageBook(e,t={},s){this.parsePageId(e);const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get("/pages/book",{params:{...s},responseType:"stream"})).data}async getPageBookFilename(e,t,s={},n){this.parsePageId(e),this.parseFileName(t);const a=h(this.globals,s.tld),o=p(this.globals,s.auth);return(await new g(a,o).get(`/pages/book/${t}`,{params:{...n},responseType:"stream"})).data}async getPagesCsv(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/pages/csv",{params:{...t},responseType:"stream"})).data}async getPagesPopular(e,t={},s){this.parsePageId(e);const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get("/pages/popular",{params:{...s}})).data}async postPageContents(e,t={},s,n){const a=this.parsePageId(e),o=h(this.globals,t.tld),i=p(this.globals,t.auth);return(await new g(o,i).post(`/pages/${a}/contents`,s??"",{headers:{"Content-Type":"text/plain"},params:{...n}})).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,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).del(`/pages/${n}`,{params:{...s}})).data}async delPageAllowed(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).del(`/pages/${n}/allowed`,{params:{...s}})).data}async postPageCopied(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).post(`/pages/${n}/copy`,"",{params:{...s}})).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,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).del(`/pages/${a}/files/${o}`,{params:{...n}})).data}async headPageFileName(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).head(`/pages/${a}/files/${o}`,{params:{...n}})).data}async putPageFileName(e,t,s,n={},a){const o=this.parsePageId(e),i=this.parseFileName(t),l=h(this.globals,n.tld),d=p(this.globals,n.auth);return(await new g(l,d).put(`/pages/${o}/files/${i}`,s,{headers:{"Content-Type":"application/octet-stream"},params:{...a}})).data}async delPageFileNameDescription(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).del(`/pages/${a}/files/${o}/description`,{params:{...n}})).data}async putPageFileNameDescription(e,t,s={},n){const a=this.parsePageId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).put(`/pages/${a}/files/${o}/description`,{params:{...n}})).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,n.tld),u=p(this.globals,n.auth);return(await new g(d,u).put(`/pages/${o}/files/${i}/properties/${l}`,"",{params:{...a}})).data}async putPageImport(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).put(`/pages/${n}/import`,"",{params:{...s}})).data}async putPageMove(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).put(`/pages/${n}/move`,"",{params:{...s}})).data}async putPageOrder(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).put(`/pages/${n}/order`,"",{params:{...s}})).data}async postPageProperties(e,t,s,n={},a){const o=this.parsePageId(e),i=h(this.globals,n.tld),l=p(this.globals,n.auth);return(await new g(i,l).post(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...a}})).data}async putPageProperties(e,t,s,n={},a){const o=this.parsePageId(e),i=h(this.globals,n.tld),l=p(this.globals,n.auth);return(await new g(i,l).put(`/pages/${o}/properties`,s,{headers:{Slug:t},params:{...a}})).data}async deletePagePropertiesKey(e,t,s={},n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).del(`/pages/${a}/properties/${o}`,{params:{...n}})).data}async putPagePropertiesKey(e,t,s={},n){const a=this.parsePageId(e),o=this.parseKey(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).put(`/pages/${a}/properties/${o}`,"",{params:{...n}})).data}async postPageRatings(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).post(`/pages/${n}/ratings`,"",{params:{...s}})).data}async postPageRevert(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).post(`/pages/${n}/revert`,"",{params:{...s}})).data}async deletePageSecurity(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).del(`/pages/${n}/security`,{params:{...s}})).data}async postPageSecurity(e,t={},s,n){const a=this.parsePageId(e),o=h(this.globals,t.tld),i=p(this.globals,t.auth);return(await new g(o,i).post(`/pages/${a}/security`,s,{params:{...n}})).data}async putPageSecurity(e,t={},s,n){const a=this.parsePageId(e),o=h(this.globals,t.tld),i=p(this.globals,t.auth);return(await new g(o,i).put(`/pages/${a}/security`,s,{params:{...n}})).data}async putPageTags(e,t={},s,n){const a=this.parsePageId(e),o=h(this.globals,t.tld),i=p(this.globals,t.auth);return(await new g(o,i).put(`/pages/${a}/tags`,s,{params:{...n}})).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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/groups",{params:{...t}})).data}async getGroup(e,t={},s){const n=this.parseGroupId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/groups/${n}`,{params:{...s}})).data}async getGroupUser(e,t={},s){const n=this.parseGroupId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/groups/${n}/users`,{params:{...s}})).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,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`events/page-hierarchy/${n}`,{params:{...s}})).data}async getPageHierarchyDetailById(e,t,s={},n){const a=this.parsePageId(e),o=h(this.globals,s.tld),i=p(this.globals,s.auth);return(await new g(o,i).get(`events/page-hierarchy/${a}/${t}`,{params:{...n}})).data}async getEventPage(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`events/page/${n}`,{params:{...s}})).data}async getEventPageDetail(e,t,s={},n){const a=this.parsePageId(e),o=h(this.globals,s.tld),i=p(this.globals,s.auth);return(await new g(o,i).get(`/events/page/${a}/${t}`,{params:{...n}})).data}async getEventUserPage(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/events/user-page/${this.parseUserId(e)}`,{params:{...s}})).data}async getEventUserDetailPage(e,t,s={},n){const a=h(this.globals,s.tld),o=p(this.globals,s.auth);return(await new g(a,o).get(`/events/user-page/${this.parseUserId(e)}/${t}`,{params:{...n}})).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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/archive",{params:{...t}})).data}async getArchiveFiles(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/archive/files",{params:{...t}})).data}async getArchiveFile(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/archive/files/${e}`,{params:{...s},responseType:"stream"})).data}async getArchiveFileByName(e,t,s={},n){const a=h(this.globals,s.tld),o=this.parseFileName(t),i=p(this.globals,s.auth);return(await new g(a,i).get(`/archive/files/${e}/${o}`,{params:{...n},responseType:"stream"})).data}async getArchiveFileInfo(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/archive/files/${e}/info`,{params:{...s}})).data}async getArchivePages(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/archive/pages",{params:{...t}})).data}async getArchivePage(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/archive/page/${e}`,{params:{...s}})).data}async getArchivePageContents(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/archive/page/${e}/contents`,{params:{...s}})).data}async getArchivePageInfo(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/archive/page/${e}/info`,{params:{...s}})).data}async getArchivePageSubPages(e,t={},s){const n=h(this.globals,t.tld),a=p(this.globals,t.auth);return(await new g(n,a).get(`/archive/page/${e}/subpages`,{params:{...s}})).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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/site/activity",{params:{...t}})).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,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/site/nav/${n}/children`,{params:{...s}})).data}async getSiteFullNavTreeTags(e,t={},s){const n=this.parsePageId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/site/nav/${n}/full`,{params:{...s}})).data}async getSiteOperations(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/site/operations",{params:{...t}})).data}async getSiteProperties(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/site/properties",{params:{...t}})).data}async GetSiteKeyProperties(e,t={},s){const n=this.parseKey(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/site/properties/${n}`,{params:{...s}})).data}async GetSiteKeyPropertiesInfo(e,t={},s){const n=this.parseKey(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/site/properties/${n}/info`,{params:{...s}})).data}async GetSiteQuery(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/site/query",{params:{...t}})).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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/site/tags",{params:{...t}})).data}async GetSiteTag(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/site/tag",{params:{...t}})).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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/contextmaps",{params:{...t}})).data}async getContextMapsById(e,t,s={},n){const a=h(this.globals,s.tld),o=p(this.globals,s.auth);return(await new g(a,o).get(`/contextmaps/${e}/${t}`,{params:{...n}})).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,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/users",{params:{...t}})).data}async getUser(e,t={},s){const n=this.parseUserId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/users/${n}`,{params:{...s}})).data}async getUserMetrics(e,t={},s){const n=this.parseUserId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/users/${n}/metrics`,{params:{...s}})).data}async getUserProperties(e,t={},s){const n=this.parseUserId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`/users/${n}/properties`,{params:{...s}})).data}async getUserPropertiesKey(e,t,s={},n){const a=this.parseUserId(e),o=this.parseKey(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/users/${a}/properties/${o}`,{params:{...n}})).data}async getUserPropertiesKeyInfo(e,t,s={},n){const a=this.parseUserId(e),o=this.parseKey(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`/users/${a}/properties/${o}/info`,{params:{...n}})).data}async getUsersSearch(e={},t){const s=h(this.globals,e.tld),n=p(this.globals,e.auth);return(await new g(s,n).get("/users/search",{params:{...t}})).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,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`files/${n}`,{params:{...s},responseType:"stream"})).data}async getFileName(e,t,s={},n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).get(`files/${a}/${o}`,{params:{...n},responseType:"stream"})).data}async getFileDescription(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`files/${n}/description`,{params:{...s},responseType:"stream"})).data}async getFileInfo(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`files/${n}/info`,{params:{...s}})).data}async getFileRevisions(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).get(`files/${n}/revisions`,{params:{...s}})).data}async deleteFile(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).del(`files/${n}`,{params:{...s}})).data}async headFile(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).head(`files/${n}`,{params:{...s}})).data}async putFile(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).put(`files/${n}`,"",{params:{...s}})).data}async deleteFileName(e,t,s={},n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).del(`files/${a}/${o}`,{params:{...n}})).data}async headFileName(e,t,s={},n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).head(`files/${a}/${o}`,{params:{...n}})).data}async putFileName(e,t,s={},n){const a=this.parseFileId(e),o=this.parseFileName(t),i=h(this.globals,s.tld),l=p(this.globals,s.auth);return(await new g(i,l).put(`files/${a}/${o}`,"",{params:{...n}})).data}async postFileCopy(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).post(`files/${n}/copy`,"",{params:{...s}})).data}async delDescriptionFile(e,t={},s){const n=this.parseFileId(e),a=h(this.globals,t.tld),o=p(this.globals,t.auth);return(await new g(a,o).del(`files/${n}/description`,{params:{...s}})).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 Ws(this.globals)),this._pages}get auth(){return this._auth||(this._auth=new Ve),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;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
import auth from './modules/auth';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
get
|
|
31
|
-
get
|
|
32
|
-
|
|
1
|
+
import { default as auth } from './modules/auth';
|
|
2
|
+
import { AuthConfig, BrowserTokenParams, ServerTokenParams } from './types';
|
|
3
|
+
import { default as Pages } from './modules/pages';
|
|
4
|
+
import { default as Groups } from './modules/groups';
|
|
5
|
+
import { default as Events } from './modules/events';
|
|
6
|
+
import { default as Archive } from './modules/archive';
|
|
7
|
+
import { default as Site } from './modules/site';
|
|
8
|
+
import { default as contextMaps } from './modules/contextMaps';
|
|
9
|
+
import { default as Users } from './modules/users';
|
|
10
|
+
import { default as Files } from './modules/files';
|
|
11
|
+
export * from './types/index';
|
|
12
|
+
export default class Expert {
|
|
13
|
+
private globals;
|
|
14
|
+
private _pages?;
|
|
15
|
+
private _groups?;
|
|
16
|
+
private _site?;
|
|
17
|
+
private _auth?;
|
|
18
|
+
private _archive?;
|
|
19
|
+
private _events?;
|
|
20
|
+
private _contextMaps?;
|
|
21
|
+
private _users?;
|
|
22
|
+
private _files?;
|
|
23
|
+
constructor(options?: {
|
|
24
|
+
tld?: string;
|
|
25
|
+
auth?: AuthConfig;
|
|
26
|
+
});
|
|
27
|
+
setAuth(authConfig: AuthConfig): this;
|
|
28
|
+
configureServerAuth(params: ServerTokenParams): this;
|
|
29
|
+
configureBrowserAuth(params: BrowserTokenParams): this;
|
|
30
|
+
get pages(): Pages;
|
|
31
|
+
get auth(): auth;
|
|
32
|
+
get site(): Site;
|
|
33
|
+
get archive(): Archive;
|
|
34
|
+
get groups(): Groups;
|
|
35
|
+
get events(): Events;
|
|
36
|
+
get contextMaps(): contextMaps;
|
|
37
|
+
get users(): Users;
|
|
38
|
+
get files(): Files;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,UAAU,EAAwB,kBAAkB,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACvH,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;AAEpC,cAAc,eAAe,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,MAAM;IACvB,OAAO,CAAC,OAAO,CAA2B;IAC1C,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,CAAA;KAAE;IAOlD,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAKrC,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAKpD,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IAK7D,IAAW,KAAK,IAAI,KAAK,CAMxB;IAED,IAAW,IAAI,IAAI,IAAI,CAMtB;IAED,IAAW,IAAI,IAAI,IAAI,CAMtB;IAED,IAAW,OAAO,IAAI,OAAO,CAM5B;IAED,IAAW,MAAM,IAAI,MAAM,CAM1B;IAED,IAAW,MAAM,IAAI,MAAM,CAM1B;IAED,IAAW,WAAW,IAAI,WAAW,CAKpC;IAED,IAAW,KAAK,IAAI,KAAK,CAMxB;IAED,IAAW,KAAK,IAAI,KAAK,CAMxB;CAEJ"}
|