@sinequa/atomic 0.0.113 → 0.0.122
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/dist/atomic.js +741 -684
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/events/emit-authenticated-event.d.ts +15 -0
- package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -0
- package/dist/authentication/events/index.d.ts +2 -0
- package/dist/authentication/events/index.d.ts.map +1 -0
- package/dist/authentication/index.d.ts +4 -1
- package/dist/authentication/index.d.ts.map +1 -1
- package/dist/authentication/providers/index.d.ts +3 -0
- package/dist/authentication/providers/index.d.ts.map +1 -0
- package/dist/authentication/providers/oauth-authentication.d.ts +4 -0
- package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -0
- package/dist/authentication/providers/saml-authentication.d.ts +4 -0
- package/dist/authentication/providers/saml-authentication.d.ts.map +1 -0
- package/dist/authentication/session/index.d.ts +4 -0
- package/dist/authentication/session/index.d.ts.map +1 -0
- package/dist/authentication/session/login.d.ts +9 -0
- package/dist/authentication/session/login.d.ts.map +1 -0
- package/dist/authentication/session/logout.d.ts +6 -0
- package/dist/authentication/session/logout.d.ts.map +1 -0
- package/dist/authentication/session/user-authentication.d.ts +6 -0
- package/dist/authentication/session/user-authentication.d.ts.map +1 -0
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts +8 -0
- package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -0
- package/dist/authentication/tokens/get-csrf-token.d.ts +9 -0
- package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -0
- package/dist/authentication/tokens/get-jwt-token.d.ts +14 -0
- package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -0
- package/dist/authentication/tokens/get-token.d.ts +6 -0
- package/dist/authentication/tokens/get-token.d.ts.map +1 -0
- package/dist/authentication/tokens/index.d.ts +6 -0
- package/dist/authentication/tokens/index.d.ts.map +1 -0
- package/dist/authentication/tokens/set-token.d.ts +6 -0
- package/dist/authentication/tokens/set-token.d.ts.map +1 -0
- package/dist/configurations/global.config.d.ts +1 -1
- package/dist/configurations/global.config.d.ts.map +1 -1
- package/dist/helpers/utils.d.ts +7 -0
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/utils/aggregations.d.ts +1 -0
- package/dist/utils/aggregations.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/del.d.ts +2 -2
- package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/get.d.ts +2 -2
- package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/patch.d.ts +2 -2
- package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts +2 -2
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/put.d.ts +2 -2
- package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts +1 -1
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-change-password.d.ts +4 -0
- package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -0
- package/package.json +14 -5
- package/dist/authentication/auth.d.ts +0 -59
- package/dist/authentication/auth.d.ts.map +0 -1
- package/dist/helpers/column-resolver.test.d.ts +0 -2
- package/dist/helpers/column-resolver.test.d.ts.map +0 -1
- package/dist/helpers/metadata.test.d.ts +0 -2
- package/dist/helpers/metadata.test.d.ts.map +0 -1
- package/dist/helpers/utils.test.d.ts +0 -2
- package/dist/helpers/utils.test.d.ts.map +0 -1
- package/dist/web-api/helpers/tests/helpers.test.d.ts +0 -2
- package/dist/web-api/helpers/tests/helpers.test.d.ts.map +0 -1
package/dist/atomic.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(o=typeof globalThis<"u"?globalThis:o||self,u(o.atomic={}))})(this,function(o){"use strict";var tr=Object.defineProperty;var rr=(o,u,_)=>u in o?tr(o,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):o[u]=_;var ye=(o,u,_)=>rr(o,typeof u!="symbol"?u+"":u,_);const u={loginPath:"/login",backendUrl:typeof window<"u"?window.location.origin:"http://localhost",createRoutes:!1};function _(e){Object.assign(u,e)}const D={store:{},getItem(e){return this.store[e]??null},setItem(e,t){this.store[e]=t.toString()},removeItem(e){delete this.store[e]},clear(){this.store={}}},x=D;function G(e){return typeof window>"u"||!window.localStorage?D.getItem(e):window.localStorage.getItem(e)}function M(e,t){typeof window>"u"||!window.localStorage?D.setItem(e,t):window.localStorage.setItem(e,t)}function O(e){typeof window>"u"||!window.localStorage?D.removeItem(e):window.localStorage.removeItem(e)}function pe(e){return typeof window>"u"||!window.sessionStorage?x.getItem(e):window.sessionStorage.getItem(e)}function $e(e,t){typeof window>"u"||!window.sessionStorage?x.setItem(e,t):window.sessionStorage.setItem(e,t)}function Ie(e){typeof window>"u"||!window.sessionStorage?x.removeItem(e):window.sessionStorage.removeItem(e)}function De(e,t){var a;return!(e!=null&&e.items)||((a=e==null?void 0:e.items)==null?void 0:a.length)===0?[]:e.items.reduce((s,i)=>{if(!i.value||i.value==="")return s;const c=X(i,e.column);return s.push({operator:c.operator,value:c.value,display:i.display||c.display,filters:c.filters,disabled:i.count===0,hidden:i.count===0&&e.isDistribution?!t:!1}),s},[])}function X(e,t){const r=t,n=e.value.match(/.*\:\(?([><=\d\-\.AND ]+)\)?/);if(n!=null&&n[1]){const s=(n==null?void 0:n[1].split(" AND ")).map(i=>{const c=i.indexOf(">=")!==-1?"gte":"lt";let l=i.substring(i.indexOf(" ")+1);return{field:r,operator:c,value:l,display:e.display||e.value}});if(s.length===2)return{field:r,operator:"and",filters:s,value:e.value,display:s[0].display||s[0].value};if(s.length===1)return{...s[0],field:r};throw new Error("Failed to parse distribution expression")}return{field:r,operator:"eq",value:e.value,display:e.display}}function Ae(e,t,r){return e.valuesAreExpressions?t.display===r.display:t.value===r.value}function Y(e){return e.items&&(e.items=e.items.map(t=>Y(t))),e.items&&e.items.some(t=>t.$selected||t.$opened)&&(e.$opened=!0),e}function Ne(e,t){const r=[];if(e.length>0){const n=new Map,s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g,""),i=new RegExp("\\b"+s,"i");e.forEach(c=>{if(c.display.length>1){const l=c.display.normalize("NFD").replace(/[\u0300-\u036f]/g,""),d=i.exec(l);K(r,n,"/",c.display,+(c.frequency||0),1,((d==null?void 0:d.index)||0)+t.length)}})}return r}function K(e,t,r,n,a,s,i){const c=n.indexOf("/",r.length),l=n.substring(0,c+1);let d=t.get(l);if(!d){const m=l.replace(/^\/|\/$/g,"");d={value:n.substring(r.length,c),count:a,items:[],hasChildren:!1,$level:s,$opened:i>=l.length,$path:m},t.set(l,d),e.push(d)}l.length<n.length&&(d.hasChildren=!0,K(d.items,t,l,n,a,s+1,i))}function Fe(e,t){return e.reduce((r,n)=>(t(n)?r.true.push(n):r.false.push(n),r),{true:[],false:[]})}const Qe=/(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g,Be=2,Z=3,qe=5,E=6,xe=8,T=9,Ge=11,ee=12,je=14,te=15;function y(e){if(!e)return[];const t=[],r=e.matchAll(Qe);for(let n of r)n[Z]?t.push({type:"group",value:n[Z],op:n[Be]}):n[E]?t.push({type:"adjacent",value:n[E],op:n[qe]}):n[T]?t.push({type:"exact",value:n[T],op:n[xe]}):n[ee]?t.push({type:"regex",value:n[ee],op:n[Ge]}):n[te]&&t.push({type:"token",value:n[te],op:n[je]});return t}function A(e){return e.map(t=>{const r=t.op||"";switch(t.type){case"group":return`${r}(${t.value})`;case"adjacent":return`${r}[${t.value}]`;case"exact":return`${r}"${t.value}"`;case"regex":return`${r}/${t.value}/`;case"token":return`${r}${t.value}`}}).join(" ")}function Ve(e,t,r){let n=y(e);for(let a of t)n.push({type:"adjacent",value:a,op:r});return A(n)}function ze(e,t){const r=y(t),n=r.findIndex(a=>a.value===e);return n!==-1?(r.splice(n,1),t=A(r)):t}function Je(e){const t=y(e).filter(r=>r.type!=="adjacent");return A(t)}function He(e){return y(e).filter(t=>t.type==="adjacent").map(t=>t.value)}function We(e,t,r){const n=new Intl.RelativeTimeFormat(e,{numeric:"auto"}),{offset:a,unit:s,isFuture:i}=re(t,r);return n.format(a*(i?1:-1),s)}function re(e,t){const r=new Date(e),n=t?new Date(t):new Date,a=Math.abs(n.getTime()-r.getTime());return{offset:Math.floor(a/(1e3*60*60*24)),unit:"day",isFuture:r>n}}function Me(e){const t=e.target;return t&&t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"}function Xe(e){if(e===void 0)return;const{q:t,f:r,p:n,s:a,t:s,n:i,b:c}=v(e),[l]=e.split("?");return{path:l,text:t,filters:r?j(r):void 0,page:n?parseInt(n,10):void 0,sort:a,tab:s,name:i,basket:c}}function Ye(e){if(!e)return"";const{text:t,filters:r,page:n,sort:a,tab:s,name:i,basket:c}=e,l={};t&&(l.q=t),r&&(l.f=JSON.stringify(r)),n&&(l.p=n.toString()),a&&(l.s=a),s&&(l.t=s),i&&(l.n=i),c&&(l.b=c);const d=new URLSearchParams(l).toString();return d||""}function Ke(e){if(e===void 0)return[];const{f:t}=v(e);return j(t)}function j(e){const t=decodeURIComponent(e);try{return JSON.parse(t??"[]")}catch{return console.error(`Error parsing filters from URI: ${e}`),[]}}function v(e){const t=e.split("?")[1];if(t===void 0)return{};const r=new URLSearchParams(t);return Object.fromEntries(r)}function Ze(e){const{q:t=""}=v(e);return t}function Ee(e){const{id:t}=v(e);return decodeURIComponent(t)}function Te(e){const{p:t="0"}=v(e);return parseInt(t,10)}function et(e){const{t}=v(e);return t}function tt(e,t){if(!e)return e;let r=0;const n=e.length;let a=0;if(e[a]==="["){for(;a<n&&/[0-9]/.test(e[a]);)a++;e[a]==="]"&&(r=a+1)}const s=V(e,r,!1);if(!s)return e;const i=t.charCodeAt(0),c=t.charCodeAt(1);let l=s;for(;l;)if(i===l.lang1&&c===l.lang2){const m=V(e,l.end+4,!0);return e.substring(m.start,m.end)}else l=V(e,l.end+4,!1);const d=e.substring(s.start,s.end);return d||e}function V(e,t,r){for(let n=t,a=e.length-3;n<a;n++)if(e[n]==="["&&e[n+3]==="]")return{start:t,end:n,lang1:e.charCodeAt(n+1),lang2:e.charCodeAt(n+2)};if(r)return{start:t,end:e.length,lang1:-1,lang2:-1}}function rt(e,t){const{useLocale:r,useLocaleAsPrefix:n,indexFile:a,path:s,folder:i}=t,c=r?`${e}/`:null,l=n?`${e}.${a}`:a??"";return[s,i,`${c||""}${l}`].filter(d=>d!==void 0).join("/")}function N(e){const t=new CustomEvent("notification",{bubbles:!0,cancelable:!1,detail:e});dispatchEvent(t)}const nt={success:(e,t)=>{N({type:"success",message:e,options:t})},info:(e,t)=>{N({type:"info",message:e,options:t})},warning:(e,t)=>{N({type:"warning",message:e,options:t})},error:(e,t)=>{N({type:"error",message:e,options:t})}};var z=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE",e))(z||{});let F={level:1,enableConsoleOutput:!0};function at(e){F={...F,...e}}function Q(e,t,r){if(e<F.level)return;const n=new Date().toISOString(),s=`${`[${z[e]}][${n}]`} ${t}`;if(F.enableConsoleOutput)switch(e){case 0:console.debug(s,r||"");break;case 1:console.info(s,r||"");break;case 2:console.warn(s,r||"");break;case 3:console.error(s,r||"");break}}function R(e,t){Q(0,e,t)}function g(e,t){Q(1,e,t)}function L(e,t){Q(2,e,t)}function h(e,t){Q(3,e,t)}function ot(e,t,r){var s,i,c,l;if(!e||!t)return;if(r){const d=Object.keys(t.queries).find(W=>W===(r==null?void 0:r.toLowerCase()));let m;d&&(m=t.queries[d]);const I=(i=((s=m==null?void 0:m.columnsInfo)==null?void 0:s.columns)||[])==null?void 0:i.find(W=>{var Ue,Oe;return(Oe=(Ue=W.aliases)==null?void 0:Ue.split(","))==null?void 0:Oe.includes(e)});if(I)return I.name}const n=(l=(c=t.indexes)==null?void 0:c._)==null?void 0:l.columns,a=Object.entries(n).find(d=>{var m;return(m=d[1].aliases)==null?void 0:m.includes(e)});if(a)return a[0]}function st(e,t){const r=e[t];return r===void 0?[]:Array.isArray(r)?r.map(n=>{if(typeof n=="string")return n;if(typeof n=="object"&&n!==null&&"display"in n)return n.display}).filter(n=>n!==void 0):[String(r)]}function p(e){return e!==null&&typeof e=="object"}function ne(e){return p(e)&&Object.prototype.toString.call(e)==="[object ArrayBuffer]"}function ae(e){return p(e)&&Object.prototype.toString.call(e)==="[object Blob]"}function oe(e){return typeof e=="string"}function ct(e){return(p(e)||Array.isArray(e))&&!ne(e)&&!ae(e)&&!oe(e)}function se(e=!0){let t=Date.now();return(e?"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx":"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g,n=>{const a=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(n==="x"?a:a&3|8).toString(16)})}function it(e){if(!e)return"``";if(e=String(e),e.search(/[\\`]/)===-1)return"`"+e+"`";const t=["`"];for(let r=0,n=e.length;r<n;r++){const a=e[r];(a==="\\"||a==="`")&&t.push("\\"),t.push(a)}return t.push("`"),t.join("")}function lt(e){return crypto.subtle.digest("SHA-512",new TextEncoder().encode(e)).then(t=>Array.prototype.map.call(new Uint8Array(t),r=>("00"+r.toString(16)).slice(-2)).join(""))}var S=(e=>(e.None="None",e.Search_FirstPage="Search_FirstPage",e.Search_Text="Search_Text",e.Search_Refine="Search_Refine",e.Search_Select_Item="Search_Select_Item",e.Search_Select_Custom="Search_Select_Custom",e.Search_Select_Concept="Search_Select_Concept",e.Search_Select_Correction="Search_Select_Correction",e.Search_GotoPage="Search_GotoPage",e.Search_GotoTab="Search_GotoTab",e.Search_DisplayResult="Search_DisplayResult",e.Search_RemoveResult="Search_RemoveResult",e.Search_RemoveAdvanced="Search_RemoveAdvanced",e.Search_SavedQuery="Search_SavedQuery",e.Search_WebService="Search_WebService",e.Search_DidYouMean_Original="Search_DidYouMean_Original",e.Search_DidYouMean_Correction="Search_DidYouMean_Correction",e.Search_ExportCSV="Search_ExportCSV",e.Search_SavedQuery_ExportCSV="Search_SavedQuery_ExportCSV",e.Search_Selection_ExportCSV="Search_Selection_ExportCSV",e.Search_AlertQuery="Search_AlertQuery",e.Search_Select_AnalyticsItem="Search_Select_AnalyticsItem",e.Search_Sort="Search_Sort",e.Search_Exit_Logout="Search_Exit_Logout",e.Search_Timeline_Usage="Search_Timeline_Usage",e.Search_AutoComplete="Search_Autocomplete",e.Search_Login_Success="Login_Success_Form",e.Search_QueryIntent_Detected="Search_QueryIntent_Detected",e.SavedQuery_Add="SavedQuery_Add",e.SavedQuery_Delete="SavedQuery_Delete",e.SavedQuery_DeleteAll="SavedQuery_DeleteAll",e.SavedQuery_Rename="SavedQuery_Rename",e.Alert_Edit="Alert_Edit",e.Alert_Delete="Alert_Delete",e.Alert_DeleteAll="Alert_DeleteAll",e.Link_Display="Link_Display",e.Link_Click="Link_Click",e.Basket_Add="Basket_Add",e.Basket_Delete="Basket_Delete",e.Basket_DeleteAll="Basket_DeleteAll",e.Basket_Rename="Basket_Rename",e.Basket_AddDoc="Basket_AddDoc",e.Basket_RemoveDoc="Basket_RemoveDoc",e.Basket_Open="Basket_Open",e.Basket_ExportCSV="Basket_ExportCSV",e.Label_Add="Label_Add",e.Label_Delete="Label_Delete",e.Label_Rename="Label_Rename",e.Label_Open="Label_Open",e.Label_AddDoc="Label_AddDoc",e.Label_RemoveDoc="Label_RemoveDoc",e.Label_ExportCSV="Label_ExportCSV",e.Label_Menu_ExportCSV="Label_Menu_ExportCSV",e.Rating_Set="Rating_Set",e.Rating_Delete="Rating_Delete",e.Doc_Preview="Doc_Preview",e.Doc_CacheHtml="Doc_CacheHtml",e.Doc_CachePdf="Doc_CachePdf",e.Doc_CacheOriginal="Doc_CacheOriginal",e.Doc_Url1="Doc_Url1",e.Doc_Url2="Doc_Url2",e.Preview_Close="Preview_Close",e.Click_ResultLink="Click_ResultLink",e.Click_ResultLink1="Click_ResultLink1",e.Click_ResultLink2="Click_ResultLink2",e.Click_ResultLink3="Click_ResultLink3",e.Click_ResultLink4="Click_ResultLink4",e.Click_ResultLink5="Click_ResultLink5",e.Click_ResultLink6="Click_ResultLink6",e.Click_ResultLink7="Click_ResultLink7",e.Click_ResultLink8="Click_ResultLink8",e.Click_ResultLink9="Click_ResultLink9",e.Click_ResultLink10="Click_ResultLink10",e.Click_PreviewLink1="Click_PreviewLink1",e.Click_PreviewLink2="Click_PreviewLink2",e.Click_PreviewLink3="Click_PreviewLink3",e.Click_PreviewLink4="Click_PreviewLink4",e.Click_PreviewLink5="Click_PreviewLink5",e.Click_PreviewLink6="Click_PreviewLink6",e.Click_PreviewLink7="Click_PreviewLink7",e.Click_PreviewLink8="Click_PreviewLink8",e.Click_PreviewLink9="Click_PreviewLink9",e.Click_PreviewLink10="Click_PreviewLink10",e.RFM_ClickSet="RFM_ClickSet",e.RFM_ClickReset="RFM_ClickReset",e.RFM_Like="RFM_Like",e.RFM_LikeReset="RFM_LikeReset",e.RFM_Dislike="RFM_Dislike",e.RFM_Important="RFM_Important",e.RFM_ImportantReset="RFM_ImportantReset",e.RFM_Ban="RFM_Ban",e.Navigation_Exit="Navigation_Exit",e.Navigation_Return="Navigation_Return",e.Navigation_Route="Navigation_Route",e.Answer_Display="Answer_Display",e.Answer_Click="Answer_Click",e.Answer_Result="Answer_Result",e.Answer_Liked="Answer_Liked",e.Answer_Disliked="Answer_Disliked",e.Answer_Liked_Cancelled="Answer_Liked_Cancelled",e.Answer_Disliked_Cancelled="Answer_Disliked_Cancelled",e.TopPassages_Display="TopPassages_Display",e.TopPassages_Click="TopPassages_Click",e.UserSettings_Reset="UserSettings_Reset",e))(S||{}),ce=(e=>(e[e.none=0]="none",e[e.bool=1]="bool",e[e.date=2]="date",e[e.dateTime=3]="dateTime",e[e.time=4]="time",e[e.unsigned=5]="unsigned",e[e.integer=6]="integer",e[e.float=7]="float",e[e.double=8]="double",e[e.dates=9]="dates",e[e.dateTimes=10]="dateTimes",e[e.times=11]="times",e[e.varchar=12]="varchar",e[e.binary=13]="binary",e[e.string=14]="string",e[e.csv=15]="csv",e))(ce||{}),ie=(e=>(e[e.none=0]="none",e[e.a=2053]="a",e[e.c=4]="c",e[e.d=8]="d",e[e.e=2068]="e",e[e.i=256]="i",e[e.l=2052]="l",e[e.n=8192]="n",e[e.t=524292]="t",e[e.x=8388608]="x",e[e.z=33554432]="z",e[e.f_ordinal=8192]="f_ordinal",e[e.f_multidates=8192]="f_multidates",e[e.f_varchar=33554432]="f_varchar",e[e.f_binary=33562624]="f_binary",e[e.f_string=33562888]="f_string",e[e.f_csv=42477853]="f_csv",e[e.f_overridable=33554696]="f_overridable",e))(ie||{});const ut="1.0";var le=(e=>(e[e.Original=0]="Original",e[e.Corrected=1]="Corrected",e))(le||{}),ue=(e=>(e[e.none=0]="none",e[e.positiveRate=1]="positiveRate",e[e.mainlyPosRate=2]="mainlyPosRate",e[e.unrate=4]="unrate",e[e.mainlyNegRate=8]="mainlyNegRate",e[e.negativeRate=16]="negativeRate",e[e.all=31]="all",e[e.positiveOnly=7]="positiveOnly",e[e.negativeOnly=28]="negativeOnly",e[e.personalAll=21]="personalAll",e[e.personalPosOnly=5]="personalPosOnly",e[e.personalNegOnly=20]="personalNegOnly",e))(ue||{});class k extends Error{constructor(r,n){super(r);ye(this,"status");this.name="ApiError",this.status=n}}class J extends k{constructor(t="Unauthorized access"){super(t,401),this.name="UnauthorizedError"}}class de extends k{constructor(t="Server error"){super(t,500),this.name="ServerError"}}class fe extends k{constructor(t="Request timed out"){super(t,408),this.name="TimeoutError"}}function dt(e){const t=new AbortController,{signal:r}=t;return e&&setTimeout(()=>{r.aborted||t.abort(new fe(`Request timed out after ${e}ms`))},e),{controller:t,signal:r}}async function ft(e,t=0,r=1e3){let n;for(let a=0;a<=t;a++)try{return await e()}catch(s){if(n=s,s instanceof k&&s.status>=400&&s.status<500&&s.status!==429||s instanceof DOMException&&s.name==="AbortError")throw s;a<t&&(L(`Retrying request (${a+1}/${t})`,{error:s}),await new Promise(i=>setTimeout(i,r)))}throw n}function P(e){const t=$(),r=new Headers(e);r.append("Sinequa-Force-Camel-Case","true"),r.append("accept","application/json"),t&&r.append("Sinequa-csrf-token",t);const{userOverride:n,userOverrideActive:a,bearerToken:s}=u;return s&&r.append("Authorization",`Bearer ${s}`),n&&a&&(r.append("sinequa-override-user",n.username),r.append("sinequa-override-domain",n.domain)),r}async function C(e,t="json"){const r=e.headers.get("sinequa-jwt-refresh");if(r!==null&&q(r),e.status===200)switch(t){case"arraybuffer":return await e.arrayBuffer();case"blob":return await e.blob();case"text":return await e.text();case"json":default:return await e.json()}if(e.status===401){if(u.userOverrideActive)throw u.userOverrideActive=!1,L("Unauthorized access attempt with user override",{endpoint:e.url}),new J("Unauthorized... User override failed.");await he(e,401)}throw e.status===500&&(h("Server error occurred",{endpoint:e.url}),await he(e,500)),L(`Unexpected response status: ${e.status}`,{endpoint:e.url}),new k(`Request failed with status ${e.status}`,e.status)}async function he(e,t){var r;try{const{done:n,value:a}=await((r=e.body)==null?void 0:r.getReader().read())||{done:!0,value:void 0};if(n||!a)throw new k(`Request failed with status ${t}`,t);const s=JSON.parse(new TextDecoder().decode(a));throw s.status=t,s}catch(n){throw n instanceof k?n:t===401?new J:t===500?new de:new k(`Request failed with status ${t}`,t)}}async function f(e,t,r){const n=P(r==null?void 0:r.headers),{app:a,backendUrl:s}=u,i={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=`${s}/${e}`;R(`Making POST request to: ${c}`);try{const l=await fetch(c,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(i),signal:r==null?void 0:r.signal});return C(l,r==null?void 0:r.responseType)}catch(l){throw h("Error making POST request:",l),l}}async function b(e,t,r){const n=P(r==null?void 0:r.headers),{backendUrl:a}=u,s=t?`?${new URLSearchParams(t)}`:"",i=`${a}/${e}${s}`;R(`Making GET request to: ${i}`);try{const c=await fetch(i,{method:"GET",credentials:"include",headers:n,signal:r==null?void 0:r.signal});return C(c,r==null?void 0:r.responseType)}catch(c){throw h("Error making GET request:",c),c}}async function ht(e,t,r){const n=P(r==null?void 0:r.headers),{app:a,backendUrl:s}=u,i={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=`${s}/${e}`;R(`Making PUT request to: ${c}`);try{const l=await fetch(c,{method:"PUT",headers:n,credentials:"include",body:JSON.stringify(i)});return C(l,r==null?void 0:r.responseType)}catch(l){throw h("Error making PUT request:",l),l}}async function mt(e,t,r){const n=P(r==null?void 0:r.headers),{backendUrl:a}=u,s=t?`?${new URLSearchParams(t)}`:"",i=`${a}/${e}${s}`;R(`Making DELETE request to: ${i}`);try{const c=await fetch(i,{method:"DELETE",credentials:"include",headers:n});return C(c,r==null?void 0:r.responseType)}catch(c){throw h("Error making DELETE request:",c),c}}async function _t(e,t,r){const n=P(r==null?void 0:r.headers),{app:a,backendUrl:s}=u,i={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=`${s}/${e}`;R(`Making PATCH request to: ${c}`);try{const l=await fetch(c,{method:"PATCH",headers:n,credentials:"include",body:JSON.stringify(i)});return C(l,r==null?void 0:r.responseType)}catch(l){throw h("Error making PATCH request:",l),l}}let H,me;function U(e,t=!0){let r=wt(e.$auditRecord);r&&(_e(r),t&&we(r)),e.$auditRecord=r}function wt(e){if(!e)return;let t;if(Array.isArray(e))t=e;else if(p(e)){const r=e;if(r.auditEvents||r.mlAuditEvents)return r;t=[e]}return{auditEvents:t}}function _e(e){var r;const t=gt();return(r=e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.sessionid=t}),e}function we(e){var r;const t=typeof window<"u"?decodeURIComponent(window.location.href):"http://localhost";return(r=e==null?void 0:e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.url=t}),e}function gt(){return(!H||St())&&(H=se()),me=new Date,H}function St(){return new Date().getTime()-me.getTime()>10*60*1e3}async function kt(e,t=!0){const r={event:S.None,$auditRecord:e};return U(r,t),f("api/v1/audit.notify",r)}const bt={notify:kt};async function Ct(e,t,r){var m;const n=((m=e.items)==null?void 0:m.length)||0,a=10,s={query:{...t,action:"aggregate",aggregations:{[e.name]:{skip:n,count:a}}},$auditRecord:{auditEvents:[r]}};U(s);const i=await f("api/v1/query",s),c=await C(i),{aggregations:l}=c,d=l[0];return d.$hasMore=d.items.length>a,d.items=[...e.items,...d.items],Promise.resolve(d)}async function vt(){const{app:e}=u,t=new URLSearchParams({app:e||""});return b("api/v1/app",t)}async function ge(){const{app:e}=u,t=new URLSearchParams({app:e||"",preLogin:"true"});return b("api/v1/app",t)}function Rt(){let{backendUrl:e,app:t}=u;if(typeof window<"u"){if(e||(e=window.location.origin),!t){const r=window.location.pathname.match(/\/app(?:-debug)?\/([^\/#]+)/);r&&(t=r[1])}_({...u,backendUrl:e,app:t})}return ge().then(r=>{const{autoOAuthProvider:n,autoSAMLProvider:a}=u,s=!n&&!r.autoOAuthProvider&&!a&&!r.autoSAMLProvider;return _({...u,autoOAuthProvider:n||r.autoOAuthProvider,autoSAMLProvider:a||r.autoSAMLProvider,useCredentials:s,useSSO:s}),r}).catch(r=>{throw console.error("atomic:fetchAppPreLogin error",r),r})}async function Lt(e,t,r={}){const n=`api/v1/search.dataset/${e}/${t}`,a=await f(n,{parameters:r}),s=t[0].toLowerCase()+t.slice(1),i=a.datasets[s];if("errorCode"in i&&"errorMessage"in i)throw new Error(i.errorMessage);return i}async function Pt(e,t){const r=`api/v1/search.dataset/${e}`,{parameters:n={},datasets:a=[]}=t;return(await f(r,{parameters:n,datasets:a})).datasets}async function Ut(e){return await b(`api/v1/search.dataset/${e}`)}async function Ot(e,t=!0,r){try{return(await f("api/v1/labels",{action:"list",q:e,public:t,locale:r,localize:!1})).labels}catch(n){throw h("Error in fetchLabels",n),n}}async function yt(){try{const{app:e=""}=u,t=new URLSearchParams({app:e,action:"getUserRights"});return b("api/v1/labels",t)}catch(e){throw h("Error in getUserRights",e),e}}async function pt(e,t,r=!0){try{const n={action:"add",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:S.Label_AddDoc,detail:{public:r,label:e?e.toString():null,doccount:t?t.length:0}}],mlAuditEvents:[{actionType:"addToLabel",documentIds:t}]}};return f("api/v1/labels",n)}catch(n){throw h("Error in add",n),n}}async function $t(e,t,r=!0){try{const n={action:"remove",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:S.Label_RemoveDoc,detail:{public:r,label:e?e.toString():null,doccount:t?t.length:0}}],mlAuditEvents:[{actionType:"removeFromLabel",documentIds:t}]}};return f("api/v1/labels",n)}catch(n){throw h("Error in remove",n),n}}async function It(e,t,r=!0){try{const n={action:"rename",labels:e,newLabel:t,public:r,auditEvents:{type:S.Label_Rename,detail:{public:r,oldlabel:e?e.toString():null,label:t}}};return f("api/v1/labels",n)}catch(n){throw h("Error in rename",n),n}}async function Dt(e,t=!0){try{const r={action:"delete",labels:e,public:t,auditEvents:{type:S.Label_Delete,detail:{public:t,label:e?e.toString():null}}};return f("api/v1/labels",r)}catch(r){throw h("Error in deleteLabels",r),r}}async function At(e,t,r=!0){try{const n={action:"bulkAdd",labels:e,query:t,public:r,auditEvents:{type:S.Label_Add,detail:{public:r,label:e?e.toString():null,query:t!==null?t.name:null}}};return f("api/v1/labels",n)}catch(n){throw h("Error in bulkAdd",n),n}}async function Nt(e,t,r=!0){try{const n={action:"bulkRemove",labels:e,query:t,public:r,auditEvents:{type:S.Label_Delete,detail:{public:r,label:e?e.toString():null,query:t!==null?t.name:null}}};return f("api/v1/labels",n)}catch(n){throw h("Error in bulkRemove",n),n}}const Ft={getUserRights:yt,add:pt,remove:$t,rename:It,delete:Dt,bulkAdd:At,bulkRemove:Nt};async function Qt(e,t){if(typeof window>"u")return f("api/v1/preview",{action:"get",id:e,query:t});const r=`${window.location.origin}${window.location.pathname}`,n={name:t==null?void 0:t.name,text:t==null?void 0:t.text};return f("api/v1/preview",{action:"get",id:e,query:n,browserUrl:r})}async function Bt(e){const t=new Headers;t.append("content-type","text");const r=await fetch(e,{method:"GET",headers:t});C(r)}async function Se(){const e=new URLSearchParams({action:"get",noAutoAuthentication:"true"});return b("api/v1/principal",e)}const ke=11;async function qt(e,t,r){var i;const a=await f("api/v1/query",{query:e,$auditRecord:t,queryIntentData:r});a.aggregations.forEach(c=>{c.$hasMore=!1,!c.isDistribution&&!c.isTree&&c.items&&(c.$hasMore=c.items.length===ke),c.isTree&&c.items&&B(c)}),(i=a.records)==null||i.map(c=>Object.assign(c,{value:c.title,type:"default"}));const s={...a,nextPage:a.page<Math.ceil(a.rowCount/a.pageSize)?a.page+1:void 0,previousPage:a.page>1?a.page-1:void 0};return Promise.resolve(s)}async function xt(e,t,r){const{app:n=""}=u,a={methods:[],mode:t,propagateErrors:!0,$auditRecord:{auditEvents:[r]}};for(const c of e)a.methods.push({method:"query",app:n,query:c});const s=await f("api/v1/multi",a);s.results.forEach(c=>{c.aggregations.forEach(l=>{l.$hasMore=!1,!l.isDistribution&&!l.isTree&&l.items&&(l.$hasMore=l.items.length===ke),l.isTree&&B(l)})}),s.results.forEach(c=>{var l;return(l=c.records)==null?void 0:l.map(d=>Object.assign(d,{value:d.title,type:"default"}))});const i=s.results.map(c=>({...c,nextPage:c.page<Math.ceil(c.rowCount/c.pageSize)?c.page+1:void 0,previousPage:c.page>1?c.page-1:void 0}));return Promise.resolve(i)}function B(e,t="",r=0){let n=[];return e.items&&e.items.forEach(a=>{let s=t?`${t}/${a.value}`:a.value,i=r+1;n.push({path:s,level:i}),a.$path=s,a.$level=i,a.hasChildren?n=n.concat(B(a,s,i)):a.hasChildren=!1}),n}async function Gt(e){const r=await f("api/v1/queryintent",{query:e});return r==null?void 0:r.intents}async function jt({model:e,appName:t,query:r,article:n}){const{webservice:a,format:s,maxcount:i,exportedColumns:c,export:l}=e,d={app:t,webservice:a,query:r,type:l,format:s,maxcount:i,exportedColumns:c,$auditRecord:{auditEvents:[{type:"Search_ExportCSV",detail:{resultid:n?n.id:void 0}}]}};return U(d),await f("api/v1/search.queryexport",d,{responseType:"blob"})}async function Vt(e,t,r){return(await f("api/v1/similardocuments",{sourceDocumentId:e,query:{name:t}},{signal:r})).data}async function zt(e,t){var a;const n=await f("api/v1/query.links",{webservice:e,query:t});return(a=n==null?void 0:n.links)==null?void 0:a.map(s=>({...s,query:t}))}async function Jt(e,t,r,n,a){const{app:s}=u,i={app:s||"",suggestQuery:e,text:t,filter:r,kinds:n,showSource:a};try{return(await f("api/v1/search.suggest",i)).suggests}catch(c){throw console.error("Error fetching suggestions:",c),c}}async function Ht(e,t,r,n){const{app:a}=u;return(await f("api/v1/suggestquery",{app:a||"",suggestQuery:e,text:t,query:r,kinds:n})).suggests}async function Wt(e,t){if(!t)return Promise.resolve([]);const{app:r}=u;return(await f("api/v1/suggestfield",{app:r||"",text:e,action:"suggests",fields:t})).suggests}async function Mt(e,t,r,n,a,s){return f("api/v1/doc.textchunks",{id:e,textChunks:t,highlights:r,query:n,leftSentencesCount:a,rightSentencesCount:s})}async function Xt(){const{app:e}=u,t=new URLSearchParams({app:e||"",action:"load"});return b("api/v1/usersettings",t)}async function be(e,t){const r={action:"save",userSettings:e,$auditRecord:{auditEvents:[t]}};return U(r),f("api/v1/usersettings",r)}async function Yt(e,t){const n={action:"patch",userSettings:e,$auditRecord:t?{auditEvents:[t]}:void 0};return U(n),f("api/v1/usersettings",n)}async function Kt(){return be({},{type:"UserSettings_Reset"})}async function Zt(){return await b("api/v2/version")}function w(e){const t=new CustomEvent("authenticated",{bubbles:!0,cancelable:!1,detail:{authenticated:e}});dispatchEvent(t)}const Ce=async()=>{const{autoOAuthProvider:e}=u;if(typeof window>"u")return f("security.oauth",{action:"getcode",provider:e,tokenInCookie:!0,originalUrl:"http://localhost"});const t={action:"getcode",provider:e,tokenInCookie:!0,originalUrl:window.location.href};try{const r=await f("api/v1/security.oauth",t);return r.redirectUrl&&(M("oauthRedirectUrl",r.redirectUrl),window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with OAuth",r),r}},ve=async()=>{const{autoSAMLProvider:e}=u;if(typeof window>"u")return f("security.saml",{action:"getresponse",provider:e,tokenInCookie:!0,originalUrl:"http://localhost"});const t={action:"getresponse",provider:e,tokenInCookie:!0,originalUrl:window.location.href};try{const r=await f("api/v1/security.saml",t);return r.redirectUrl&&(M("samlRedirectUrl",r.redirectUrl),window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with SAML",r),r}},Re=async e=>{const{username:t,password:r}=e||{},n={action:"get",tokenInCookie:!0,user:t,password:r,noUserOverride:!0,noAutoAuthentication:!0};try{const a=await f("api/v1/security.webtoken",n);return a.csrfToken?(q(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT",a),a}},Le=async()=>{const e=new URLSearchParams({action:"deleteWebTokenCookie",noUserOverride:"true",noAutoAuthentication:"true"});return b("challenge",e)},$=()=>{const e=G("csrfToken"),t=pe("sinequa-credentials");return t?JSON.parse(t).data.csrfToken:e||null},q=e=>$e("sinequa-credentials",JSON.stringify({data:{csrfToken:e}})),Et=async e=>{if(e)g("Attempting authentication using credentials"),_({useCredentials:!0,useSSO:!1});else try{const i=G("oauthRedirectUrl"),c=G("samlRedirectUrl");g("Attempting to retrieve CSRF token");const l=await Pe();if(R("CSRF token retrieval result",l?"success":"failed"),l===null){if(i||c)return L("Redirection from provider failed after previous attempt"),O("oauthRedirectUrl"),O("samlRedirectUrl"),w(!1),!1;const{autoOAuthProvider:d,autoSAMLProvider:m,useSAML:I}=u;if(d&&!I)return g("Initiating OAuth authentication flow"),await Ce(),L("OAuth authentication flow did not redirect as expected"),w(!1),!1;if(m)return g("Initiating SAML authentication flow"),await ve(),L("SAML authentication flow did not redirect as expected"),w(!1),!1;g("No direct authentication method available, will try SSO then credentials"),_({useCredentials:!0,useSSO:!0})}else return O("oauthRedirectUrl"),O("samlRedirectUrl"),g("User authenticated via existing token"),w(!0),!0}catch(i){throw h("Unexpected error during authentication",i),w(!1),i}if(u.useCredentials&&u.useSSO)try{if(g("Checking if user is authenticated via SSO"),await Se())return g("User authenticated using SSO"),_({useCredentials:!1,useSSO:!0}),w(!0),!0}catch(i){if((i==null?void 0:i.status)===401)return g("SSO authentication failed with 401, falling back to credentials"),_({useCredentials:!0,useSSO:!1}),!1;throw h("SSO authentication failed with unexpected error",i),w(!1),h}const{useSSO:r}=u;if($()!==null||r)return g("user already authenticated",$()),_({isRedirectUrl:!1}),w(!0),!0;const{useCredentials:n}=u,{username:a,password:s}=e||{};if(n&&!a&&!s)return h("Credentials are required for authentication"),w(!1),!1;if(a&&s)try{return g("authentication using credentials..."),_({useCredentials:!0,useSSO:!1}),await Re(e),w(!0),!0}catch(i){throw w(!1),i}return w(!1),h("No authentication method available. Please provide credentials or configure OAuth/SAML."),!1},Tt=async()=>{const{useCredentials:e,userOverrideActive:t}=u;O("csrfToken"),Ie("sinequa-credentials"),e&&!t?(await Le()).methodresult==="ok"?w(!1):console.error("logout failed"):w(!1)},er=()=>!!$(),Pe=async()=>{const{backendUrl:e}=u;try{const r=await(await fetch(`${e}/api/v1/challenge?action=getCsrfToken&suppressErrors=true`)).json();return r!=null&&r.csrfToken?(q(r.csrfToken),r.csrfToken):null}catch(t){throw console.error("Failed to get CSRF token",t),t}};o.ApiError=k,o.Audit=bt,o.AuditEventType=S,o.DidYouMeanKind=le,o.EngineType=ce,o.EngineTypeModifier=ie,o.LogLevel=z,o.MINIMUM_COMPATIBLE_SERVER_API_VERSION=ut,o.RFMDisplay=ue,o.ServerError=de,o.TimeoutError=fe,o.UnauthorizedError=J,o.addAuditAdditionalInfo=U,o.addConcepts=Ve,o.addSessionId=_e,o.addUrl=we,o.aggregationItemStrictCompare=Ae,o.appInitializerFn=Rt,o.bisect=Fe,o.buildPathsAndLevels=B,o.configureLogger=at,o.createHeaders=P,o.createTimeoutController=dt,o.debug=R,o.del=mt,o.deleteUserSettings=Kt,o.deleteWebTokenCookie=Le,o.error=h,o.escapeExpr=it,o.fetchAggregation=Ct,o.fetchApp=vt,o.fetchAppPreLogin=ge,o.fetchBulkQuery=xt,o.fetchDataset=Lt,o.fetchDatasetList=Ut,o.fetchDatasets=Pt,o.fetchLabels=Ot,o.fetchPreview=Qt,o.fetchPreviewUrl=Bt,o.fetchPrincipal=Se,o.fetchQuery=qt,o.fetchQueryExport=jt,o.fetchQueryIntent=Gt,o.fetchSimilarDocuments=Vt,o.fetchSponsoredLinks=zt,o.fetchSuggest=Jt,o.fetchSuggestField=Wt,o.fetchSuggestQuery=Ht,o.fetchTextChunks=Mt,o.fetchUserSettings=Xt,o.fetchVersion=Zt,o.get=b,o.getConcepts=He,o.getCsrfToken=Pe,o.getFiltersFromURI=j,o.getFiltersFromUrl=Ke,o.getHelpIndexUrl=rt,o.getIdFromUrl=Ee,o.getJWToken=Re,o.getMetadata=st,o.getOffsetFromDates=re,o.getQueryPageFromUrl=Te,o.getQueryParamsFromUrl=Xe,o.getQueryTabFromUrl=et,o.getQueryTextFromUrl=Ze,o.getRelativeDate=We,o.getToken=$,o.getUrlParamsFromQueryParams=Ye,o.globalConfig=u,o.guid=se,o.handleResponse=C,o.info=g,o.isArrayBuffer=ne,o.isAuthenticated=er,o.isBlob=ae,o.isJsonable=ct,o.isNotInputEvent=Me,o.isObject=p,o.isString=oe,o.labels=Ft,o.login=Et,o.logout=Tt,o.notify=nt,o.openParentNodes=Y,o.parseText=y,o.parseValueAndOperatorFromItem=X,o.patch=_t,o.patchUserSettings=Yt,o.post=f,o.put=ht,o.queryParamsFromUrl=v,o.removeConcept=ze,o.removeConcepts=Je,o.resolveToColumnName=ot,o.rewriteText=A,o.saveUserSettings=be,o.setGlobalConfig=_,o.setToken=q,o.sha512=lt,o.suggestionsToTreeAggregationNodes=Ne,o.sysLang=tt,o.translateAggregationToDateOptions=De,o.tryOAuthAuthentication=Ce,o.trySAMLAuthentication=ve,o.warn=L,o.withRetry=ft,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(o,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(o=typeof globalThis<"u"?globalThis:o||self,h(o.atomic={}))})(this,function(o){"use strict";var rr=Object.defineProperty;var nr=(o,h,f)=>h in o?rr(o,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):o[h]=f;var ye=(o,h,f)=>nr(o,typeof h!="symbol"?h+"":h,f);function h(e){const t=new CustomEvent("authenticated",{bubbles:!0,cancelable:!1,detail:{authenticated:e}});dispatchEvent(t)}const f={loginPath:"/login",createRoutes:!1};function w(e){Object.assign(f,e)}function pe(e,t,r){var s,l,c,i;if(!e||!t)return;if(r){const u=Object.keys(t.queries).find(J=>J===(r==null?void 0:r.toLowerCase()));let g;u&&(g=t.queries[u]);const H=(l=((s=g==null?void 0:g.columnsInfo)==null?void 0:s.columns)||[])==null?void 0:l.find(J=>{var Le,Oe;return(Oe=(Le=J.aliases)==null?void 0:Le.split(","))==null?void 0:Oe.includes(e)});if(H)return H.name}const n=(i=(c=t.indexes)==null?void 0:c._)==null?void 0:i.columns,a=Object.entries(n).find(u=>{var g;return(g=u[1].aliases)==null?void 0:g.includes(e)});if(a)return a[0]}function Ue(e,t){const r=e[t];return r===void 0?[]:Array.isArray(r)?r.map(n=>{if(typeof n=="string")return n;if(typeof n=="object"&&n!==null&&"display"in n)return n.display}).filter(n=>n!==void 0):[String(r)]}function y(e){return e!==null&&typeof e=="object"}function W(e){return y(e)&&Object.prototype.toString.call(e)==="[object ArrayBuffer]"}function M(e){return y(e)&&Object.prototype.toString.call(e)==="[object Blob]"}function X(e){return typeof e=="string"}function $e(e){return(y(e)||Array.isArray(e))&&!W(e)&&!M(e)&&!X(e)}function Y(e=!0){let t=Date.now();return(e?"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx":"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g,n=>{const a=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(n==="x"?a:a&3|8).toString(16)})}function Ie(e){if(!e)return"``";if(e=String(e),e.search(/[\\`]/)===-1)return"`"+e+"`";const t=["`"];for(let r=0,n=e.length;r<n;r++){const a=e[r];(a==="\\"||a==="`")&&t.push("\\"),t.push(a)}return t.push("`"),t.join("")}function Ae(e){if(typeof crypto<"u"&&crypto.subtle&&typeof crypto.subtle.digest=="function")try{return crypto.subtle.digest("SHA-512",new TextEncoder().encode(e)).then(t=>Array.prototype.map.call(new Uint8Array(t),r=>("00"+r.toString(16)).slice(-2)).join("")).catch(()=>Promise.resolve(B(e)))}catch{return Promise.resolve(B(e))}return Promise.resolve(B(e))}function B(e){let n=2166136261;for(let g=0;g<e.length;g++)n^=e.charCodeAt(g),n=n*16777619>>>0;const a=n.toString(16).padStart(8,"0"),s=((n^2863311530)>>>0).toString(16).padStart(8,"0"),l=((n^1431655765)>>>0).toString(16).padStart(8,"0"),c=((n^3435973836)>>>0).toString(16).padStart(8,"0"),i=a+s+l+c;return(i+i+i+i).substring(0,128)}var k=(e=>(e.None="None",e.Search_FirstPage="Search_FirstPage",e.Search_Text="Search_Text",e.Search_Refine="Search_Refine",e.Search_Select_Item="Search_Select_Item",e.Search_Select_Custom="Search_Select_Custom",e.Search_Select_Concept="Search_Select_Concept",e.Search_Select_Correction="Search_Select_Correction",e.Search_GotoPage="Search_GotoPage",e.Search_GotoTab="Search_GotoTab",e.Search_DisplayResult="Search_DisplayResult",e.Search_RemoveResult="Search_RemoveResult",e.Search_RemoveAdvanced="Search_RemoveAdvanced",e.Search_SavedQuery="Search_SavedQuery",e.Search_WebService="Search_WebService",e.Search_DidYouMean_Original="Search_DidYouMean_Original",e.Search_DidYouMean_Correction="Search_DidYouMean_Correction",e.Search_ExportCSV="Search_ExportCSV",e.Search_SavedQuery_ExportCSV="Search_SavedQuery_ExportCSV",e.Search_Selection_ExportCSV="Search_Selection_ExportCSV",e.Search_AlertQuery="Search_AlertQuery",e.Search_Select_AnalyticsItem="Search_Select_AnalyticsItem",e.Search_Sort="Search_Sort",e.Search_Exit_Logout="Search_Exit_Logout",e.Search_Timeline_Usage="Search_Timeline_Usage",e.Search_AutoComplete="Search_Autocomplete",e.Search_Login_Success="Login_Success_Form",e.Search_QueryIntent_Detected="Search_QueryIntent_Detected",e.SavedQuery_Add="SavedQuery_Add",e.SavedQuery_Delete="SavedQuery_Delete",e.SavedQuery_DeleteAll="SavedQuery_DeleteAll",e.SavedQuery_Rename="SavedQuery_Rename",e.Alert_Edit="Alert_Edit",e.Alert_Delete="Alert_Delete",e.Alert_DeleteAll="Alert_DeleteAll",e.Link_Display="Link_Display",e.Link_Click="Link_Click",e.Basket_Add="Basket_Add",e.Basket_Delete="Basket_Delete",e.Basket_DeleteAll="Basket_DeleteAll",e.Basket_Rename="Basket_Rename",e.Basket_AddDoc="Basket_AddDoc",e.Basket_RemoveDoc="Basket_RemoveDoc",e.Basket_Open="Basket_Open",e.Basket_ExportCSV="Basket_ExportCSV",e.Label_Add="Label_Add",e.Label_Delete="Label_Delete",e.Label_Rename="Label_Rename",e.Label_Open="Label_Open",e.Label_AddDoc="Label_AddDoc",e.Label_RemoveDoc="Label_RemoveDoc",e.Label_ExportCSV="Label_ExportCSV",e.Label_Menu_ExportCSV="Label_Menu_ExportCSV",e.Rating_Set="Rating_Set",e.Rating_Delete="Rating_Delete",e.Doc_Preview="Doc_Preview",e.Doc_CacheHtml="Doc_CacheHtml",e.Doc_CachePdf="Doc_CachePdf",e.Doc_CacheOriginal="Doc_CacheOriginal",e.Doc_Url1="Doc_Url1",e.Doc_Url2="Doc_Url2",e.Preview_Close="Preview_Close",e.Click_ResultLink="Click_ResultLink",e.Click_ResultLink1="Click_ResultLink1",e.Click_ResultLink2="Click_ResultLink2",e.Click_ResultLink3="Click_ResultLink3",e.Click_ResultLink4="Click_ResultLink4",e.Click_ResultLink5="Click_ResultLink5",e.Click_ResultLink6="Click_ResultLink6",e.Click_ResultLink7="Click_ResultLink7",e.Click_ResultLink8="Click_ResultLink8",e.Click_ResultLink9="Click_ResultLink9",e.Click_ResultLink10="Click_ResultLink10",e.Click_PreviewLink1="Click_PreviewLink1",e.Click_PreviewLink2="Click_PreviewLink2",e.Click_PreviewLink3="Click_PreviewLink3",e.Click_PreviewLink4="Click_PreviewLink4",e.Click_PreviewLink5="Click_PreviewLink5",e.Click_PreviewLink6="Click_PreviewLink6",e.Click_PreviewLink7="Click_PreviewLink7",e.Click_PreviewLink8="Click_PreviewLink8",e.Click_PreviewLink9="Click_PreviewLink9",e.Click_PreviewLink10="Click_PreviewLink10",e.RFM_ClickSet="RFM_ClickSet",e.RFM_ClickReset="RFM_ClickReset",e.RFM_Like="RFM_Like",e.RFM_LikeReset="RFM_LikeReset",e.RFM_Dislike="RFM_Dislike",e.RFM_Important="RFM_Important",e.RFM_ImportantReset="RFM_ImportantReset",e.RFM_Ban="RFM_Ban",e.Navigation_Exit="Navigation_Exit",e.Navigation_Return="Navigation_Return",e.Navigation_Route="Navigation_Route",e.Answer_Display="Answer_Display",e.Answer_Click="Answer_Click",e.Answer_Result="Answer_Result",e.Answer_Liked="Answer_Liked",e.Answer_Disliked="Answer_Disliked",e.Answer_Liked_Cancelled="Answer_Liked_Cancelled",e.Answer_Disliked_Cancelled="Answer_Disliked_Cancelled",e.TopPassages_Display="TopPassages_Display",e.TopPassages_Click="TopPassages_Click",e.UserSettings_Reset="UserSettings_Reset",e))(k||{}),K=(e=>(e[e.none=0]="none",e[e.bool=1]="bool",e[e.date=2]="date",e[e.dateTime=3]="dateTime",e[e.time=4]="time",e[e.unsigned=5]="unsigned",e[e.integer=6]="integer",e[e.float=7]="float",e[e.double=8]="double",e[e.dates=9]="dates",e[e.dateTimes=10]="dateTimes",e[e.times=11]="times",e[e.varchar=12]="varchar",e[e.binary=13]="binary",e[e.string=14]="string",e[e.csv=15]="csv",e))(K||{}),Z=(e=>(e[e.none=0]="none",e[e.a=2053]="a",e[e.c=4]="c",e[e.d=8]="d",e[e.e=2068]="e",e[e.i=256]="i",e[e.l=2052]="l",e[e.n=8192]="n",e[e.t=524292]="t",e[e.x=8388608]="x",e[e.z=33554432]="z",e[e.f_ordinal=8192]="f_ordinal",e[e.f_multidates=8192]="f_multidates",e[e.f_varchar=33554432]="f_varchar",e[e.f_binary=33562624]="f_binary",e[e.f_string=33562888]="f_string",e[e.f_csv=42477853]="f_csv",e[e.f_overridable=33554696]="f_overridable",e))(Z||{});const De="1.0";var E=(e=>(e[e.Original=0]="Original",e[e.Corrected=1]="Corrected",e))(E||{}),T=(e=>(e[e.none=0]="none",e[e.positiveRate=1]="positiveRate",e[e.mainlyPosRate=2]="mainlyPosRate",e[e.unrate=4]="unrate",e[e.mainlyNegRate=8]="mainlyNegRate",e[e.negativeRate=16]="negativeRate",e[e.all=31]="all",e[e.positiveOnly=7]="positiveOnly",e[e.negativeOnly=28]="negativeOnly",e[e.personalAll=21]="personalAll",e[e.personalPosOnly=5]="personalPosOnly",e[e.personalNegOnly=20]="personalNegOnly",e))(T||{});class b extends Error{constructor(r,n){super(r);ye(this,"status");this.name="ApiError",this.status=n}}class Q extends b{constructor(t="Unauthorized access"){super(t,401),this.name="UnauthorizedError"}}class ee extends b{constructor(t="Server error"){super(t,500),this.name="ServerError"}}class te extends b{constructor(t="Request timed out"){super(t,408),this.name="TimeoutError"}}function Fe(e){const t=new AbortController,{signal:r}=t;return e&&setTimeout(()=>{r.aborted||t.abort(new te(`Request timed out after ${e}ms`))},e),{controller:t,signal:r}}var q=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE",e))(q||{});let $={level:1,enableConsoleOutput:!0};function Ne(e){$={...$,...e}}function I(e,t,r){if(e<$.level)return;const n=new Date().toISOString(),s=`${`[${q[e]}][${n}]`} ${t}`;if($.enableConsoleOutput)switch(e){case 0:console.debug(s,r||"");break;case 1:console.info(s,r||"");break;case 2:console.warn(s,r||"");break;case 3:console.error(s,r||"");break}}function v(e,t){I(0,e,t)}function m(e,t){I(1,e,t)}function P(e,t){I(2,e,t)}function _(e,t){I(3,e,t)}async function Be(e,t=0,r=1e3){let n;for(let a=0;a<=t;a++)try{return await e()}catch(s){if(n=s,s instanceof b&&s.status>=400&&s.status<500&&s.status!==429||s instanceof DOMException&&s.name==="AbortError")throw s;a<t&&(P(`Retrying request (${a+1}/${t})`,{error:s}),await new Promise(l=>setTimeout(l,r)))}throw n}function L(e){const t=N(),r=new Headers(e);r.append("Sinequa-Force-Camel-Case","true"),r.append("accept","application/json"),t&&r.append("Sinequa-csrf-token",t);const{userOverride:n,userOverrideActive:a,bearerToken:s}=f;return s&&r.append("Authorization",`Bearer ${s}`),n&&a&&(r.append("sinequa-override-user",n.username),r.append("sinequa-override-domain",n.domain)),r}async function C(e,t="json"){const r=e.headers.get("sinequa-jwt-refresh");if(r!==null&&U(r),e.status===200)switch(t){case"arraybuffer":return await e.arrayBuffer();case"blob":return await e.blob();case"text":return await e.text();case"json":default:return await e.json()}if(e.status===401){if(f.userOverrideActive)throw f.userOverrideActive=!1,P("Unauthorized access attempt with user override",{endpoint:e.url}),new Q("Unauthorized... User override failed.");await re(e,401)}throw e.status===500&&(_("Server error occurred",{endpoint:e.url}),await re(e,500)),P(`Unexpected response status: ${e.status}`,{endpoint:e.url}),new b(`Request failed with status ${e.status}`,e.status)}async function re(e,t){var r;try{const{done:n,value:a}=await((r=e.body)==null?void 0:r.getReader().read())||{done:!0,value:void 0};if(n||!a)throw new b(`Request failed with status ${t}`,t);const s=JSON.parse(new TextDecoder().decode(a));throw s.status=t,s}catch(n){throw n instanceof b?n:t===401?new Q:t===500?new ee:new b(`Request failed with status ${t}`,t)}}const ne=/.*\:\(?([><=\d\-\.AND ]+)\)?/;function Qe(e,t){var a;return!(e!=null&&e.items)||((a=e==null?void 0:e.items)==null?void 0:a.length)===0?[]:e.items.reduce((s,l)=>{if(!l.value||l.value==="")return s;const c=ae(l,e.column);return s.push({operator:c.operator,value:c.value,display:l.display||c.display,filters:c.filters,disabled:l.count===0,hidden:l.count===0&&e.isDistribution?!t:!1}),s},[])}function ae(e,t){const r=t,n=e.value.match(ne);if(n!=null&&n[1]){const s=(n==null?void 0:n[1].split(" AND ")).map(l=>{const c=l.indexOf(">=")!==-1?"gte":"lt";let i=l.substring(l.indexOf(" ")+1);return{field:r,operator:c,value:i,display:e.display||e.value}});if(s.length===2)return{field:r,operator:"and",filters:s,value:e.value,display:s[0].display||s[0].value};if(s.length===1)return{...s[0],field:r};throw new Error("Failed to parse distribution expression")}return{field:r,operator:"eq",value:e.value,display:e.display}}function qe(e,t,r){return e.valuesAreExpressions?t.display===r.display:t.value===r.value}function oe(e){return e.items&&(e.items=e.items.map(t=>oe(t))),e.items&&e.items.some(t=>t.$selected||t.$opened)&&(e.$opened=!0),e}function Ve(e,t){const r=[];if(e.length>0){const n=new Map,s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g,""),l=new RegExp("\\b"+s,"i");e.forEach(c=>{if(c.display.length>1){const i=c.display.normalize("NFD").replace(/[\u0300-\u036f]/g,""),u=l.exec(i);se(r,n,"/",c.display,+(c.frequency||0),1,((u==null?void 0:u.index)||0)+t.length)}})}return r}function se(e,t,r,n,a,s,l){const c=n.indexOf("/",r.length),i=n.substring(0,c+1);let u=t.get(i);if(!u){const g=i.replace(/^\/|\/$/g,"");u={value:n.substring(r.length,c),count:a,items:[],hasChildren:!1,$level:s,$opened:l>=i.length,$path:g},t.set(i,u),e.push(u)}i.length<n.length&&(u.hasChildren=!0,se(u.items,t,i,n,a,s+1,l))}function je(e,t){return e.reduce((r,n)=>(t(n)?r.true.push(n):r.false.push(n),r),{true:[],false:[]})}const xe=/(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g,Ge=2,ce=3,ze=5,ie=6,He=8,le=9,Je=11,ue=12,We=14,fe=15;function p(e){if(!e)return[];const t=[],r=e.matchAll(xe);for(let n of r)n[ce]?t.push({type:"group",value:n[ce],op:n[Ge]}):n[ie]?t.push({type:"adjacent",value:n[ie],op:n[ze]}):n[le]?t.push({type:"exact",value:n[le],op:n[He]}):n[ue]?t.push({type:"regex",value:n[ue],op:n[Je]}):n[fe]&&t.push({type:"token",value:n[fe],op:n[We]});return t}function A(e){return e.map(t=>{const r=t.op||"";switch(t.type){case"group":return`${r}(${t.value})`;case"adjacent":return`${r}[${t.value}]`;case"exact":return`${r}"${t.value}"`;case"regex":return`${r}/${t.value}/`;case"token":return`${r}${t.value}`}}).join(" ")}function Me(e,t,r){let n=p(e);for(let a of t)n.push({type:"adjacent",value:a,op:r});return A(n)}function Xe(e,t){const r=p(t),n=r.findIndex(a=>a.value===e);return n!==-1?(r.splice(n,1),t=A(r)):t}function Ye(e){const t=p(e).filter(r=>r.type!=="adjacent");return A(t)}function Ke(e){return p(e).filter(t=>t.type==="adjacent").map(t=>t.value)}function Ze(e,t,r){const n=new Intl.RelativeTimeFormat(e,{numeric:"auto"}),{offset:a,unit:s,isFuture:l}=de(t,r);return n.format(a*(l?1:-1),s)}function de(e,t){const r=new Date(e),n=t?new Date(t):new Date,a=Math.abs(n.getTime()-r.getTime());return{offset:Math.floor(a/(1e3*60*60*24)),unit:"day",isFuture:r>n}}function Ee(e){const t=e.target;return t&&t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"}function Te(e){if(e===void 0)return;const{q:t,f:r,p:n,s:a,t:s,n:l,b:c}=R(e),[i]=e.split("?");return{path:i,text:t,filters:r?V(r):void 0,page:n?parseInt(n,10):void 0,sort:a,tab:s,name:l,basket:c}}function et(e){if(!e)return"";const{text:t,filters:r,page:n,sort:a,tab:s,name:l,basket:c}=e,i={};t&&(i.q=t),r&&(i.f=JSON.stringify(r)),n&&(i.p=n.toString()),a&&(i.s=a),s&&(i.t=s),l&&(i.n=l),c&&(i.b=c);const u=new URLSearchParams(i).toString();return u||""}function tt(e){if(e===void 0)return[];const{f:t}=R(e);return V(t)}function V(e){const t=decodeURIComponent(e);try{return JSON.parse(t??"[]")}catch{return console.error(`Error parsing filters from URI: ${e}`),[]}}function R(e){const t=e.split("?")[1];if(t===void 0)return{};const r=new URLSearchParams(t);return Object.fromEntries(r)}function rt(e){const{q:t=""}=R(e);return t}function nt(e){const{id:t}=R(e);return decodeURIComponent(t)}function at(e){const{p:t="0"}=R(e);return parseInt(t,10)}function ot(e){const{t}=R(e);return t}function st(e,t){if(!e)return e;let r=0;const n=e.length;let a=0;if(e[a]==="["){for(;a<n&&/[0-9]/.test(e[a]);)a++;e[a]==="]"&&(r=a+1)}const s=j(e,r,!1);if(!s)return e;const l=t.charCodeAt(0),c=t.charCodeAt(1);let i=s;for(;i;)if(l===i.lang1&&c===i.lang2){const g=j(e,i.end+4,!0);return e.substring(g.start,g.end)}else i=j(e,i.end+4,!1);const u=e.substring(s.start,s.end);return u||e}function j(e,t,r){for(let n=t,a=e.length-3;n<a;n++)if(e[n]==="["&&e[n+3]==="]")return{start:t,end:n,lang1:e.charCodeAt(n+1),lang2:e.charCodeAt(n+2)};if(r)return{start:t,end:e.length,lang1:-1,lang2:-1}}function ct(e,t){const{useLocale:r,useLocaleAsPrefix:n,indexFile:a,path:s,folder:l}=t,c=r?`${e}/`:null,i=n?`${e}.${a}`:a??"";return[s,l,`${c||""}${i}`].filter(u=>u!==void 0).join("/")}function D(e){const t=new CustomEvent("notification",{bubbles:!0,cancelable:!1,detail:e});dispatchEvent(t)}const it={success:(e,t)=>{D({type:"success",message:e,options:t})},info:(e,t)=>{D({type:"info",message:e,options:t})},warning:(e,t)=>{D({type:"warning",message:e,options:t})},error:(e,t)=>{D({type:"error",message:e,options:t})}};async function d(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=f,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0};e.startsWith("plugin")&&(e=`api/v1/${e}`);const c=s?`${s}/${e}`:`${e}`;v(`Making POST request to: ${c}`);try{const i=await fetch(c,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(l),signal:r==null?void 0:r.signal});return C(i,r==null?void 0:r.responseType)}catch(i){throw _("Error making POST request:",i),i}}async function S(e,t,r){const n=L(r==null?void 0:r.headers),{backendUrl:a}=f,s=t?`?${new URLSearchParams(t)}`:"";e.startsWith("plugin")&&(e=`api/v1/${e}`);const l=a?`${a}/${e}${s}`:`${e}${s}`;v(`Making GET request to: ${l}`);try{const c=await fetch(l,{method:"GET",credentials:"include",headers:n,signal:r==null?void 0:r.signal});return C(c,r==null?void 0:r.responseType)}catch(c){throw _("Error making GET request:",c),c}}async function lt(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=f,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=`${s}/${e}`;v(`Making PUT request to: ${c}`);try{const i=await fetch(c,{method:"PUT",headers:n,credentials:"include",body:JSON.stringify(l)});return C(i,r==null?void 0:r.responseType)}catch(i){throw _("Error making PUT request:",i),i}}async function ut(e,t,r){const n=L(r==null?void 0:r.headers),{backendUrl:a}=f,s=t?`?${new URLSearchParams(t)}`:"",l=a?`${a}/${e}${s}`:`${e}${s}`;v(`Making DELETE request to: ${l}`);try{const c=await fetch(l,{method:"DELETE",credentials:"include",headers:n});return C(c,r==null?void 0:r.responseType)}catch(c){throw _("Error making DELETE request:",c),c}}async function ft(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=f,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=s?`${s}/${e}`:`${e}`;v(`Making PATCH request to: ${c}`);try{const i=await fetch(c,{method:"PATCH",headers:n,credentials:"include",body:JSON.stringify(l)});return C(i,r==null?void 0:r.responseType)}catch(i){throw _("Error making PATCH request:",i),i}}let x,he;function O(e,t=!0){let r=dt(e.$auditRecord);r&&(_e(r),t&&ge(r)),e.$auditRecord=r}function dt(e){if(!e)return;let t;if(Array.isArray(e))t=e;else if(y(e)){const r=e;if(r.auditEvents||r.mlAuditEvents)return r;t=[e]}return{auditEvents:t}}function _e(e){var r;const t=ht();return(r=e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.sessionid=t}),e}function ge(e){var r;const t=typeof window<"u"?decodeURIComponent(window.location.href):"http://localhost";return(r=e==null?void 0:e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.url=t}),e}function ht(){return(!x||_t())&&(x=Y()),he=new Date,x}function _t(){return new Date().getTime()-he.getTime()>10*60*1e3}async function gt(e,t=!0){const r={event:k.None,$auditRecord:e};return O(r,t),d("api/v1/audit.notify",r)}const mt={notify:gt};async function St(e,t,r){var g;const n=((g=e.items)==null?void 0:g.length)||0,a=10,s={query:{...t,action:"aggregate",aggregations:{[e.name]:{skip:n,count:a}}},$auditRecord:{auditEvents:[r]}};O(s);const l=await d("api/v1/query",s),c=await C(l),{aggregations:i}=c,u=i[0];return u.$hasMore=u.items.length>a,u.items=[...e.items,...u.items],Promise.resolve(u)}async function wt(){const{app:e}=f,t=new URLSearchParams({app:e||""});return S("api/v1/app",t)}async function me(){const{app:e}=f,t=new URLSearchParams({app:e||"",preLogin:"true"});return S("api/v1/app",t)}function kt(){let{backendUrl:e,app:t}=f;if(typeof window<"u"){if(e||(e=window.location.origin),!t){const r=window.location.pathname.match(/\/app(?:-debug)?\/([^/#]+)/);r&&(t=r[1])}w({...f,backendUrl:e,app:t})}return me().then(r=>{const{autoOAuthProvider:n,autoSAMLProvider:a}=f,s=!n&&!r.autoOAuthProvider&&!a&&!r.autoSAMLProvider;return w({...f,autoOAuthProvider:n||r.autoOAuthProvider,autoSAMLProvider:a||r.autoSAMLProvider,useCredentials:s,useSSO:s}),r}).catch(r=>{throw _("atomic:fetchAppPreLogin error",r),r})}async function bt(e,t,r={}){const n=`api/v1/search.dataset/${e}/${t}`,a=await d(n,{parameters:r}),s=t[0].toLowerCase()+t.slice(1),l=a.datasets[s];if("errorCode"in l&&"errorMessage"in l)throw new Error(l.errorMessage);return l}async function Ct(e,t){const r=`api/v1/search.dataset/${e}`,{parameters:n={},datasets:a=[]}=t;return(await d(r,{parameters:n,datasets:a})).datasets}async function vt(e){return await S(`api/v1/search.dataset/${e}`)}async function Rt(e,t=!0,r){try{return(await d("api/v1/labels",{action:"list",q:e,public:t,locale:r,localize:!1})).labels}catch(n){throw _("Error in fetchLabels",n),n}}async function Pt(){try{const{app:e=""}=f,t=new URLSearchParams({app:e,action:"getUserRights"});return S("api/v1/labels",t)}catch(e){throw _("Error in getUserRights",e),e}}async function Lt(e,t,r=!0){try{const n={action:"add",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:k.Label_AddDoc,detail:{public:r,label:e?e.toString():null,doccount:t?t.length:0}}],mlAuditEvents:[{actionType:"addToLabel",documentIds:t}]}};return d("api/v1/labels",n)}catch(n){throw _("Error in add",n),n}}async function Ot(e,t,r=!0){try{const n={action:"remove",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:k.Label_RemoveDoc,detail:{public:r,label:e?e.toString():null,doccount:t?t.length:0}}],mlAuditEvents:[{actionType:"removeFromLabel",documentIds:t}]}};return d("api/v1/labels",n)}catch(n){throw _("Error in remove",n),n}}async function yt(e,t,r=!0){try{const n={action:"rename",labels:e,newLabel:t,public:r,auditEvents:{type:k.Label_Rename,detail:{public:r,oldlabel:e?e.toString():null,label:t}}};return d("api/v1/labels",n)}catch(n){throw _("Error in rename",n),n}}async function pt(e,t=!0){try{const r={action:"delete",labels:e,public:t,auditEvents:{type:k.Label_Delete,detail:{public:t,label:e?e.toString():null}}};return d("api/v1/labels",r)}catch(r){throw _("Error in deleteLabels",r),r}}async function Ut(e,t,r=!0){try{const n={action:"bulkAdd",labels:e,query:t,public:r,auditEvents:{type:k.Label_Add,detail:{public:r,label:e?e.toString():null,query:t!==null?t.name:null}}};return d("api/v1/labels",n)}catch(n){throw _("Error in bulkAdd",n),n}}async function $t(e,t,r=!0){try{const n={action:"bulkRemove",labels:e,query:t,public:r,auditEvents:{type:k.Label_Delete,detail:{public:r,label:e?e.toString():null,query:t!==null?t.name:null}}};return d("api/v1/labels",n)}catch(n){throw _("Error in bulkRemove",n),n}}const It={getUserRights:Pt,add:Lt,remove:Ot,rename:yt,delete:pt,bulkAdd:Ut,bulkRemove:$t};async function At(e,t){if(typeof window>"u")return d("api/v1/preview",{action:"get",id:e,query:t});const r=`${window.location.origin}${window.location.pathname}`,n={name:t==null?void 0:t.name,text:t==null?void 0:t.text};return d("api/v1/preview",{action:"get",id:e,query:n,browserUrl:r})}async function Dt(e){const t=new Headers;t.append("content-type","text");const r=await fetch(e,{method:"GET",headers:t});C(r)}async function Se(){const e=new URLSearchParams({action:"get",noAutoAuthentication:"true"});return S("api/v1/principal",e)}const we=11;async function Ft(e,t,r){var l;const a=await d("api/v1/query",{query:e,$auditRecord:t,queryIntentData:r});a.aggregations.forEach(c=>{c.$hasMore=!1,!c.isDistribution&&!c.isTree&&c.items&&(c.$hasMore=c.items.length===we),c.isTree&&c.items&&F(c)}),(l=a.records)==null||l.map(c=>Object.assign(c,{value:c.title,type:"default"}));const s={...a,nextPage:a.page<Math.ceil(a.rowCount/a.pageSize)?a.page+1:void 0,previousPage:a.page>1?a.page-1:void 0};return Promise.resolve(s)}async function Nt(e,t,r){const{app:n=""}=f,a={methods:[],mode:t,propagateErrors:!0,$auditRecord:{auditEvents:[r]}};for(const c of e)a.methods.push({method:"query",app:n,query:c});const s=await d("api/v1/multi",a);s.results.forEach(c=>{c.aggregations.forEach(i=>{i.$hasMore=!1,!i.isDistribution&&!i.isTree&&i.items&&(i.$hasMore=i.items.length===we),i.isTree&&F(i)})}),s.results.forEach(c=>{var i;return(i=c.records)==null?void 0:i.map(u=>Object.assign(u,{value:u.title,type:"default"}))});const l=s.results.map(c=>({...c,nextPage:c.page<Math.ceil(c.rowCount/c.pageSize)?c.page+1:void 0,previousPage:c.page>1?c.page-1:void 0}));return Promise.resolve(l)}function F(e,t="",r=0){let n=[];return e.items&&e.items.forEach(a=>{let s=t?`${t}/${a.value}`:a.value,l=r+1;n.push({path:s,level:l}),a.$path=s,a.$level=l,a.hasChildren?n=n.concat(F(a,s,l)):a.hasChildren=!1}),n}async function Bt(e){const r=await d("api/v1/queryintent",{query:e});return r==null?void 0:r.intents}async function Qt({model:e,appName:t,query:r,article:n}){const{webservice:a,format:s,maxcount:l,exportedColumns:c,export:i}=e,u={app:t,webservice:a,query:r,type:i,format:s,maxcount:l,exportedColumns:c,$auditRecord:{auditEvents:[{type:"Search_ExportCSV",detail:{resultid:n?n.id:void 0}}]}};return O(u),await d("api/v1/search.queryexport",u,{responseType:"blob"})}async function qt(e,t,r){return(await d("api/v1/similardocuments",{sourceDocumentId:e,query:{name:t}},{signal:r})).data}async function Vt(e,t){var a;const n=await d("api/v1/query.links",{webservice:e,query:t});return(a=n==null?void 0:n.links)==null?void 0:a.map(s=>({...s,query:t}))}async function jt(e,t,r,n,a){const{app:s}=f,l={app:s||"",suggestQuery:e,text:t,filter:r,kinds:n,showSource:a};try{return(await d("api/v1/search.suggest",l)).suggests}catch(c){throw console.error("Error fetching suggestions:",c),c}}async function xt(e,t,r,n){const{app:a}=f;return(await d("api/v1/suggestquery",{app:a||"",suggestQuery:e,text:t,query:r,kinds:n})).suggests}async function Gt(e,t){if(!t)return Promise.resolve([]);const{app:r}=f;return(await d("api/v1/suggestfield",{app:r||"",text:e,action:"suggests",fields:t})).suggests}async function zt(e,t,r,n,a,s){return d("api/v1/doc.textchunks",{id:e,textChunks:t,highlights:r,query:n,leftSentencesCount:a,rightSentencesCount:s})}async function Ht(){const{app:e}=f,t=new URLSearchParams({app:e||"",action:"load"});return S("api/v1/usersettings",t)}async function ke(e,t){const r={action:"save",userSettings:e,$auditRecord:{auditEvents:[t]}};return O(r),d("api/v1/usersettings",r)}async function Jt(e,t){const n={action:"patch",userSettings:e,$auditRecord:t?{auditEvents:[t]}:void 0};return O(n),d("api/v1/usersettings",n)}async function Wt(){return ke({},{type:"UserSettings_Reset"})}async function Mt(){return await S("api/v2/version")}const be=async()=>{const{autoOAuthProvider:e}=f;if(typeof window>"u")return d("security.oauth",{action:"getcode",provider:e,tokenInCookie:!0,originalUrl:"http://localhost"});const t={action:"getcode",provider:e,tokenInCookie:!0,originalUrl:window.location.href};try{const r=await d("api/v1/security.oauth",t);return r.redirectUrl&&(window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with OAuth",r),r}},Ce=async()=>{const{autoSAMLProvider:e}=f;if(typeof window>"u")return d("security.saml",{action:"getresponse",provider:e,tokenInCookie:!0,originalUrl:"http://localhost"});const t={action:"getresponse",provider:e,tokenInCookie:!0,originalUrl:window.location.href};try{const r=await d("api/v1/security.saml",t);return r.redirectUrl&&(window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with SAML",r),r}},G={store:{},getItem(e){return this.store[e]??null},setItem(e,t){this.store[e]=t.toString()},removeItem(e){delete this.store[e]},clear(){this.store={}}},z=G;function Xt(e){return typeof window>"u"||!window.localStorage?G.getItem(e):window.localStorage.getItem(e)}function Yt(e){typeof window>"u"||!window.localStorage?G.removeItem(e):window.localStorage.removeItem(e)}function Kt(e){return typeof window>"u"||!window.sessionStorage?z.getItem(e):window.sessionStorage.getItem(e)}function Zt(e,t){typeof window>"u"||!window.sessionStorage?z.setItem(e,t):window.sessionStorage.setItem(e,t)}function Et(e){typeof window>"u"||!window.sessionStorage?z.removeItem(e):window.sessionStorage.removeItem(e)}const U=e=>Zt("sinequa-credentials",JSON.stringify({data:{csrfToken:e}})),ve=async()=>{try{const e=await S("api/v1/challenge?action=getCsrfToken&suppressErrors=true");return e!=null&&e.csrfToken?(U(e.csrfToken),e.csrfToken):null}catch(e){throw _("Failed to get CSRF token",e),e}};async function Re(e){if(e){const{username:t,password:r}=e,n={action:"get",tokenInCookie:!0,user:t,password:r,noUserOverride:!0,noAutoAuthentication:!0};try{const a=await d("api/v1/security.webtoken",n);return a!=null&&a.csrfToken?(U(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT",a),a}}else{const t={action:"get",tokenInCookie:!0,noUserOverride:!0,noAutoAuthentication:!1},{bearerToken:r}=f;if(!r)throw new Error("Bearer token is required in globalConfig for credentialless JWT retrieval.");const n=new Headers;n.append("Sinequa-Force-Camel-Case","true"),n.append("accept","application/json"),n.append("Content-Type","application/json"),n.append("Authorization",`Bearer ${r}`);try{const a=await d("api/v1/security.webtoken",t,{headers:n});return a.csrfToken?(U(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT without credentials",a),a}}}const N=()=>{var r;const e=Kt("sinequa-credentials");if(e)try{const a=(r=JSON.parse(e).data)==null?void 0:r.csrfToken;if(a!==void 0)return a}catch{}const t=Xt("csrfToken");return t!==null?t:null},Tt=async e=>{if(e)m("Attempting authentication using credentials"),w({useCredentials:!0,useSSO:!1});else{let c=null;try{m("Attempting to retrieve CSRF token from the backend"),c=await ve(),v("CSRF token retrieval result",c?"success":"failed")}catch(i){_("Failed to retrieve CSRF token",i)}try{if(c===null){const{autoOAuthProvider:i,autoSAMLProvider:u,useSAML:g}=f;if(i&&!g)return m("Initiating OAuth authentication flow"),await be(),P("OAuth authentication flow did not redirect as expected"),h(!1),!1;if(u)return m("Initiating SAML authentication flow"),await Ce(),P("SAML authentication flow did not redirect as expected"),h(!1),!1;m("No direct authentication method available, will try SSO then credentials"),w({useCredentials:!0,useSSO:!0})}else return m("User authenticated via existing token"),h(!0),!0}catch(i){throw _("Unexpected error during authentication",i),h(!1),i}}if(f.useCredentials&&f.useSSO)try{if(m("Checking if user is authenticated via SSO"),await Se())return m("User authenticated using SSO"),w({useCredentials:!1,useSSO:!0}),h(!0),!0}catch(c){if((c==null?void 0:c.status)===401)return m("SSO authentication failed with 401, falling back to credentials"),w({useCredentials:!0,useSSO:!1}),!1;throw _("SSO authentication failed with unexpected error",c),h(!1),_}const{useSSO:r}=f,n=N();if(n&&n!==null||r)return m("user already authenticated",n),w({isRedirectUrl:!1}),h(!0),!0;const{useCredentials:a}=f,{username:s,password:l}=e||{};if(a&&!s&&!l)return _("Credentials are required for authentication"),h(!1),!1;if(s&&l)try{return m("authentication using credentials..."),w({useCredentials:!0,useSSO:!1}),await Re({username:s,password:l}),h(!0),!0}catch(c){throw h(!1),c}return h(!1),_("No authentication method available. Please provide credentials or configure OAuth/SAML."),!1},Pe=async()=>{const e=new URLSearchParams({action:"deleteWebTokenCookie",noUserOverride:"true",noAutoAuthentication:"true"});return S("api/v1/challenge",e)},er=async()=>{const{useCredentials:e,userOverrideActive:t}=f;Yt("csrfToken"),Et("sinequa-credentials"),e&&!t?(await Pe()).methodresult==="ok"?h(!1):console.error("logout failed"):h(!1)},tr=()=>!!N();o.ApiError=b,o.Audit=mt,o.AuditEventType=k,o.DidYouMeanKind=E,o.EngineType=K,o.EngineTypeModifier=Z,o.LogLevel=q,o.MINIMUM_COMPATIBLE_SERVER_API_VERSION=De,o.RFMDisplay=T,o.ServerError=ee,o.TimeoutError=te,o.UnauthorizedError=Q,o.addAuditAdditionalInfo=O,o.addConcepts=Me,o.addSessionId=_e,o.addUrl=ge,o.aggItemRegex=ne,o.aggregationItemStrictCompare=qe,o.appInitializerFn=kt,o.bisect=je,o.buildPathsAndLevels=F,o.configureLogger=Ne,o.createHeaders=L,o.createTimeoutController=Fe,o.debug=v,o.del=ut,o.deleteUserSettings=Wt,o.deleteWebTokenCookie=Pe,o.emitAuthenticatedEvent=h,o.error=_,o.escapeExpr=Ie,o.fetchAggregation=St,o.fetchApp=wt,o.fetchAppPreLogin=me,o.fetchBulkQuery=Nt,o.fetchDataset=bt,o.fetchDatasetList=vt,o.fetchDatasets=Ct,o.fetchLabels=Rt,o.fetchPreview=At,o.fetchPreviewUrl=Dt,o.fetchPrincipal=Se,o.fetchQuery=Ft,o.fetchQueryExport=Qt,o.fetchQueryIntent=Bt,o.fetchSimilarDocuments=qt,o.fetchSponsoredLinks=Vt,o.fetchSuggest=jt,o.fetchSuggestField=Gt,o.fetchSuggestQuery=xt,o.fetchTextChunks=zt,o.fetchUserSettings=Ht,o.fetchVersion=Mt,o.get=S,o.getConcepts=Ke,o.getCsrfToken=ve,o.getFiltersFromURI=V,o.getFiltersFromUrl=tt,o.getHelpIndexUrl=ct,o.getIdFromUrl=nt,o.getJWToken=Re,o.getMetadata=Ue,o.getOffsetFromDates=de,o.getQueryPageFromUrl=at,o.getQueryParamsFromUrl=Te,o.getQueryTabFromUrl=ot,o.getQueryTextFromUrl=rt,o.getRelativeDate=Ze,o.getToken=N,o.getUrlParamsFromQueryParams=et,o.globalConfig=f,o.guid=Y,o.handleResponse=C,o.info=m,o.isArrayBuffer=W,o.isAuthenticated=tr,o.isBlob=M,o.isJsonable=$e,o.isNotInputEvent=Ee,o.isObject=y,o.isString=X,o.labels=It,o.login=Tt,o.logout=er,o.notify=it,o.openParentNodes=oe,o.parseText=p,o.parseValueAndOperatorFromItem=ae,o.patch=ft,o.patchUserSettings=Jt,o.post=d,o.put=lt,o.queryParamsFromUrl=R,o.removeConcept=Xe,o.removeConcepts=Ye,o.resolveToColumnName=pe,o.rewriteText=A,o.saveUserSettings=ke,o.setGlobalConfig=w,o.setToken=U,o.sha512=Ae,o.suggestionsToTreeAggregationNodes=Ve,o.sysLang=st,o.translateAggregationToDateOptions=Qe,o.tryOAuthAuthentication=be,o.trySAMLAuthentication=Ce,o.warn=P,o.withRetry=Be,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emits a custom 'authenticated' event with the provided authentication status.
|
|
3
|
+
*
|
|
4
|
+
* @param authenticated - A boolean indicating whether the user is authenticated.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* How to listen for the 'authenticated' event:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* document.addEventListener('authenticated', (event: CustomEvent) => {
|
|
10
|
+
* console.log('Authenticated:', event.detail.authenticated);
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function emitAuthenticatedEvent(authenticated: boolean): void;
|
|
15
|
+
//# sourceMappingURL=emit-authenticated-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-authenticated-event.d.ts","sourceRoot":"","sources":["../../../src/authentication/events/emit-authenticated-event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,OAAO,QAO5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/events/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { emitAuthenticatedEvent } from "./events";
|
|
2
|
+
export { tryOAuthAuthentication, trySAMLAuthentication } from "./providers";
|
|
3
|
+
export { isAuthenticated, login, logout } from "./session";
|
|
4
|
+
export { deleteWebTokenCookie, getCsrfToken, getJWToken, getToken, setToken, } from "./tokens";
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3D,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/providers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-authentication.d.ts","sourceRoot":"","sources":["../../../src/authentication/providers/oauth-authentication.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,sBAAsB;iBAKJ,MAAM;EA4BpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saml-authentication.d.ts","sourceRoot":"","sources":["../../../src/authentication/providers/saml-authentication.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,qBAAqB;iBAKH,MAAM;EA4BpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Credentials } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Logs in the user with the provided credentials.
|
|
4
|
+
*
|
|
5
|
+
* @param credentials - The user's login credentials.
|
|
6
|
+
* @returns A promise that resolves to a boolean indicating whether the login was successful.
|
|
7
|
+
*/
|
|
8
|
+
export declare const login: (credentials?: Credentials) => Promise<boolean>;
|
|
9
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/login.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,CAmItE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/logout.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,eAAO,MAAM,MAAM,qBAgBlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-authentication.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/user-authentication.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,OAAuB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deletes the JSON Web Token (JWT) cookie by sending a GET request to the backend server.
|
|
3
|
+
* @returns {Promise<Response>} - A promise that resolves to the response from the server.
|
|
4
|
+
*/
|
|
5
|
+
export declare const deleteWebTokenCookie: () => Promise<{
|
|
6
|
+
methodresult: string;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=delete-web-token-cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-web-token-cookie.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/delete-web-token-cookie.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;kBAOJ,MAAM;EAClC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves the CSRF token from the backend server.
|
|
3
|
+
* If the token is successfully retrieved, it is stored in the session storage and the authenticated$ subject is updated.
|
|
4
|
+
* If the token is not retrieved, the user is redirected to the OAuth/SAML provider's login page.
|
|
5
|
+
* @param authMode The authentication mode. Defaults to "oauth".
|
|
6
|
+
* @returns A boolean indicating whether the CSRF token was successfully retrieved.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getCsrfToken: () => Promise<string | null>;
|
|
9
|
+
//# sourceMappingURL=get-csrf-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-csrf-token.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/get-csrf-token.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,8BAcxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Credentials } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves a JSON Web Token (JWT) without requiring explicit credentials.
|
|
4
|
+
* This function relies on existing authentication state or session cookies.
|
|
5
|
+
*
|
|
6
|
+
* @returns A promise that resolves to the JWT (csrfToken) if successful, or `null` if no token is returned.
|
|
7
|
+
* @throws An error if the request to retrieve the JWT fails.
|
|
8
|
+
*
|
|
9
|
+
* The function sends a POST request to the `security.webtoken` endpoint without user credentials,
|
|
10
|
+
* relying on existing authentication mechanisms such as session cookies or existing tokens.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getJWToken(credentials: Credentials): Promise<string | null>;
|
|
13
|
+
export declare function getJWToken(): Promise<string | null>;
|
|
14
|
+
//# sourceMappingURL=get-jwt-token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-jwt-token.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/get-jwt-token.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAC7E,wBAAgB,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-token.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/get-token.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,QAAQ,WAgBpB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { deleteWebTokenCookie } from "./delete-web-token-cookie";
|
|
2
|
+
export { getCsrfToken } from "./get-csrf-token";
|
|
3
|
+
export { getJWToken } from "./get-jwt-token";
|
|
4
|
+
export { getToken } from "./get-token";
|
|
5
|
+
export { setToken } from "./set-token";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-token.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/set-token.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,SAInC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.config.d.ts","sourceRoot":"","sources":["../../src/configurations/global.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"global.config.d.ts","sourceRoot":"","sources":["../../src/configurations/global.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,CAAC,CAAC;AAEN;;GAEG;AACH,QAAA,MAAM,YAAY,EAAE,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAGhE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GACrD,IAAI,CAKN;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -17,5 +17,12 @@ export declare function guid(withHyphens?: boolean): string;
|
|
|
17
17
|
* For example: `` a\`\b `` => `` a\\\`\\b ``
|
|
18
18
|
*/
|
|
19
19
|
export declare function escapeExpr(value: string | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* Calculate SHA-512 hash of a string value
|
|
22
|
+
* Uses native crypto.subtle.digest when available, falls back to a deterministic hash for unsupported browsers
|
|
23
|
+
*
|
|
24
|
+
* @param value The string to hash
|
|
25
|
+
* @returns Promise resolving to hex-encoded hash string
|
|
26
|
+
*/
|
|
20
27
|
export declare function sha512(value: string): Promise<string>;
|
|
21
28
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEhD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE9C;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEhD;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKhD;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,WAAW,UAAO,GAAG,MAAM,CAS/C;AAED;;;;;;GAMG;AAIH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAkB5D;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEhD;AACD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE9C;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEhD;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKhD;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,WAAW,UAAO,GAAG,MAAM,CAS/C;AAED;;;;;;GAMG;AAIH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAkB5D;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregations.d.ts","sourceRoot":"","sources":["../../src/utils/aggregations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhH;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,GAAG,UAAU,EAAE,CA4BpI;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,GAAG,YAAY,CAsB5G;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,EACtD,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC,EACjD,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC,GACjD,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAqBnH"}
|
|
1
|
+
{"version":3,"file":"aggregations.d.ts","sourceRoot":"","sources":["../../src/utils/aggregations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhH,eAAO,MAAM,YAAY,QAAiC,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,GAAG,UAAU,EAAE,CA4BpI;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,GAAG,YAAY,CAsB5G;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,EACtD,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC,EACjD,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC,GACjD,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB,CAQ9E;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAqBnH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_ENDPOINTS } from "../../../types";
|
|
1
|
+
import type { API_ENDPOINTS } from "../../../types";
|
|
2
2
|
/**
|
|
3
3
|
* Makes a DELETE request to the specified API endpoint.
|
|
4
4
|
*
|
|
@@ -11,6 +11,6 @@ import { API_ENDPOINTS } from "../../../types";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function del<T>(endpoint: API_ENDPOINTS, params?: URLSearchParams, options?: {
|
|
13
13
|
headers?: Headers;
|
|
14
|
-
responseType?:
|
|
14
|
+
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
15
15
|
}): Promise<T>;
|
|
16
16
|
//# sourceMappingURL=del.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"del.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/del.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"del.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/del.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACzD,GACA,OAAO,CAAC,CAAC,CAAC,CAuBZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_ENDPOINTS } from "../../../types";
|
|
1
|
+
import type { API_ENDPOINTS } from "../../../types";
|
|
2
2
|
/**
|
|
3
3
|
* Makes a GET request to the specified API endpoint with the given parameters.
|
|
4
4
|
*
|
|
@@ -11,7 +11,7 @@ import { API_ENDPOINTS } from "../../../types";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function get<T>(endpoint: API_ENDPOINTS, params?: URLSearchParams, options?: {
|
|
13
13
|
headers?: Headers;
|
|
14
|
-
responseType?:
|
|
14
|
+
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
15
15
|
signal?: AbortSignal;
|
|
16
16
|
}): Promise<T>;
|
|
17
17
|
//# sourceMappingURL=get.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/get.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,CAAC,CAAC,CA8BZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_ENDPOINTS } from "../../../types";
|
|
1
|
+
import type { API_ENDPOINTS } from "../../../types";
|
|
2
2
|
/**
|
|
3
3
|
* Makes a PATCH request to the specified API endpoint.
|
|
4
4
|
*
|
|
@@ -11,6 +11,6 @@ import { API_ENDPOINTS } from "../../../types";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function patch<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: {
|
|
13
13
|
headers?: Headers;
|
|
14
|
-
responseType?:
|
|
14
|
+
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
15
15
|
}): Promise<T>;
|
|
16
16
|
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/patch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/patch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACzD,GACA,OAAO,CAAC,CAAC,CAAC,CA2BZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_ENDPOINTS } from "../../../types";
|
|
1
|
+
import type { API_ENDPOINTS } from "../../../types";
|
|
2
2
|
/**
|
|
3
3
|
* Makes a POST request to the specified API endpoint.
|
|
4
4
|
* `app` and `locale` are added automatically to the request body.
|
|
@@ -12,7 +12,7 @@ import { API_ENDPOINTS } from "../../../types";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function post<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: {
|
|
14
14
|
headers?: Headers;
|
|
15
|
-
responseType?:
|
|
15
|
+
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
16
16
|
signal?: AbortSignal;
|
|
17
17
|
}): Promise<T>;
|
|
18
18
|
//# sourceMappingURL=post.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/post.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/post.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;;GAUG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,CAAC,CAAC,CAiCZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API_ENDPOINTS } from "../../../types";
|
|
1
|
+
import type { API_ENDPOINTS } from "../../../types";
|
|
2
2
|
/**
|
|
3
3
|
* Makes a PUT request to the specified API endpoint.
|
|
4
4
|
*
|
|
@@ -11,6 +11,6 @@ import { API_ENDPOINTS } from "../../../types";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function put<T>(endpoint: API_ENDPOINTS, body: Record<string, unknown>, options?: {
|
|
13
13
|
headers?: Headers;
|
|
14
|
-
responseType?:
|
|
14
|
+
responseType?: "arraybuffer" | "blob" | "json" | "text";
|
|
15
15
|
}): Promise<T>;
|
|
16
16
|
//# sourceMappingURL=put.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/put.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"put.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/put.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACzD,GACA,OAAO,CAAC,CAAC,CAAC,CA2BZ"}
|
|
@@ -13,5 +13,5 @@ export declare function fetchAppPreLogin(): Promise<CCAppPreLogin>;
|
|
|
13
13
|
* Initializes the application by setting the global configuration and fetching app pre-login data.
|
|
14
14
|
* @returns A promise that resolves when the initialization is complete.
|
|
15
15
|
*/
|
|
16
|
-
export declare function appInitializerFn(): Promise<
|
|
16
|
+
export declare function appInitializerFn(): Promise<CCAppPreLogin>;
|
|
17
17
|
//# sourceMappingURL=fetch-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-app.d.ts","sourceRoot":"","sources":["../../../src/web-api/v1/fetch-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch-app.d.ts","sourceRoot":"","sources":["../../../src/web-api/v1/fetch-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAInD;;;GAGG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,CAK/C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CA2DzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-change-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-change-password.ts"],"names":[],"mappings":"AAAA,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM;;GAS5D"}
|