@sinequa/atomic 0.0.113 → 0.0.121
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 +770 -704
- 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.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 +1 -1
- 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 +1 -1
- package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts +1 -1
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/put.d.ts +1 -1
- package/dist/web-api/helpers/methods/put.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 nr=Object.defineProperty;var ar=(o,h,d)=>h in o?nr(o,h,{enumerable:!0,configurable:!0,writable:!0,value:d}):o[h]=d;var $e=(o,h,d)=>ar(o,typeof h!="symbol"?h+"":h,d);function h(e){const t=new CustomEvent("authenticated",{bubbles:!0,cancelable:!1,detail:{authenticated:e}});dispatchEvent(t)}const d={loginPath:"/login",createRoutes:!1};function w(e){Object.assign(d,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={}}},j=D;function x(e){return typeof window>"u"||!window.localStorage?D.getItem(e):window.localStorage.getItem(e)}function X(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 Ie(e){return typeof window>"u"||!window.sessionStorage?j.getItem(e):window.sessionStorage.getItem(e)}function Ae(e,t){typeof window>"u"||!window.sessionStorage?j.setItem(e,t):window.sessionStorage.setItem(e,t)}function De(e){typeof window>"u"||!window.sessionStorage?j.removeItem(e):window.sessionStorage.removeItem(e)}function Fe(e,t,r){var s,l,c,i;if(!e||!t)return;if(r){const u=Object.keys(t.queries).find(A=>A===(r==null?void 0:r.toLowerCase()));let _;u&&(_=t.queries[u]);const I=(l=((s=_==null?void 0:_.columnsInfo)==null?void 0:s.columns)||[])==null?void 0:l.find(A=>{var pe,ye;return(ye=(pe=A.aliases)==null?void 0:pe.split(","))==null?void 0:ye.includes(e)});if(I)return I.name}const n=(i=(c=t.indexes)==null?void 0:c._)==null?void 0:i.columns,a=Object.entries(n).find(u=>{var _;return(_=u[1].aliases)==null?void 0:_.includes(e)});if(a)return a[0]}function Ne(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 Y(e){return p(e)&&Object.prototype.toString.call(e)==="[object ArrayBuffer]"}function K(e){return p(e)&&Object.prototype.toString.call(e)==="[object Blob]"}function Z(e){return typeof e=="string"}function Be(e){return(p(e)||Array.isArray(e))&&!Y(e)&&!K(e)&&!Z(e)}function E(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 Qe(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 qe(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(G(e)))}catch{return Promise.resolve(G(e))}return Promise.resolve(G(e))}function G(e){let n=2166136261;for(let _=0;_<e.length;_++)n^=e.charCodeAt(_),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||{}),T=(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))(T||{}),ee=(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))(ee||{});const Ve="1.0";var te=(e=>(e[e.Original=0]="Original",e[e.Corrected=1]="Corrected",e))(te||{}),re=(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))(re||{});class b extends Error{constructor(r,n){super(r);$e(this,"status");this.name="ApiError",this.status=n}}class z extends b{constructor(t="Unauthorized access"){super(t,401),this.name="UnauthorizedError"}}class ne extends b{constructor(t="Server error"){super(t,500),this.name="ServerError"}}class ae extends b{constructor(t="Request timed out"){super(t,408),this.name="TimeoutError"}}function je(e){const t=new AbortController,{signal:r}=t;return e&&setTimeout(()=>{r.aborted||t.abort(new ae(`Request timed out after ${e}ms`))},e),{controller:t,signal:r}}var H=(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))(H||{});let F={level:1,enableConsoleOutput:!0};function xe(e){F={...F,...e}}function N(e,t,r){if(e<F.level)return;const n=new Date().toISOString(),s=`${`[${H[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 C(e,t){N(0,e,t)}function g(e,t){N(1,e,t)}function R(e,t){N(2,e,t)}function m(e,t){N(3,e,t)}async function Ge(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&&(R(`Retrying request (${a+1}/${t})`,{error:s}),await new Promise(l=>setTimeout(l,r)))}throw n}function L(e){const t=V(),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}=d;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 v(e,t="json"){const r=e.headers.get("sinequa-jwt-refresh");if(r!==null&&$(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(d.userOverrideActive)throw d.userOverrideActive=!1,R("Unauthorized access attempt with user override",{endpoint:e.url}),new z("Unauthorized... User override failed.");await oe(e,401)}throw e.status===500&&(m("Server error occurred",{endpoint:e.url}),await oe(e,500)),R(`Unexpected response status: ${e.status}`,{endpoint:e.url}),new b(`Request failed with status ${e.status}`,e.status)}async function oe(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 z:t===500?new ne:new b(`Request failed with status ${t}`,t)}}const se=/.*\:\(?([><=\d\-\.AND ]+)\)?/;function ze(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=ce(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 ce(e,t){const r=t,n=e.value.match(se);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 He(e,t,r){return e.valuesAreExpressions?t.display===r.display:t.value===r.value}function ie(e){return e.items&&(e.items=e.items.map(t=>ie(t))),e.items&&e.items.some(t=>t.$selected||t.$opened)&&(e.$opened=!0),e}function Je(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);le(r,n,"/",c.display,+(c.frequency||0),1,((u==null?void 0:u.index)||0)+t.length)}})}return r}function le(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 _=i.replace(/^\/|\/$/g,"");u={value:n.substring(r.length,c),count:a,items:[],hasChildren:!1,$level:s,$opened:l>=i.length,$path:_},t.set(i,u),e.push(u)}i.length<n.length&&(u.hasChildren=!0,le(u.items,t,i,n,a,s+1,l))}function We(e,t){return e.reduce((r,n)=>(t(n)?r.true.push(n):r.false.push(n),r),{true:[],false:[]})}const Me=/(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g,Xe=2,ue=3,Ye=5,de=6,Ke=8,fe=9,Ze=11,he=12,Ee=14,me=15;function y(e){if(!e)return[];const t=[],r=e.matchAll(Me);for(let n of r)n[ue]?t.push({type:"group",value:n[ue],op:n[Xe]}):n[de]?t.push({type:"adjacent",value:n[de],op:n[Ye]}):n[fe]?t.push({type:"exact",value:n[fe],op:n[Ke]}):n[he]?t.push({type:"regex",value:n[he],op:n[Ze]}):n[me]&&t.push({type:"token",value:n[me],op:n[Ee]});return t}function B(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 Te(e,t,r){let n=y(e);for(let a of t)n.push({type:"adjacent",value:a,op:r});return B(n)}function et(e,t){const r=y(t),n=r.findIndex(a=>a.value===e);return n!==-1?(r.splice(n,1),t=B(r)):t}function tt(e){const t=y(e).filter(r=>r.type!=="adjacent");return B(t)}function rt(e){return y(e).filter(t=>t.type==="adjacent").map(t=>t.value)}function nt(e,t,r){const n=new Intl.RelativeTimeFormat(e,{numeric:"auto"}),{offset:a,unit:s,isFuture:l}=_e(t,r);return n.format(a*(l?1:-1),s)}function _e(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 at(e){const t=e.target;return t&&t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"}function ot(e){if(e===void 0)return;const{q:t,f:r,p:n,s:a,t:s,n:l,b:c}=P(e),[i]=e.split("?");return{path:i,text:t,filters:r?J(r):void 0,page:n?parseInt(n,10):void 0,sort:a,tab:s,name:l,basket:c}}function st(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 ct(e){if(e===void 0)return[];const{f:t}=P(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 P(e){const t=e.split("?")[1];if(t===void 0)return{};const r=new URLSearchParams(t);return Object.fromEntries(r)}function it(e){const{q:t=""}=P(e);return t}function lt(e){const{id:t}=P(e);return decodeURIComponent(t)}function ut(e){const{p:t="0"}=P(e);return parseInt(t,10)}function dt(e){const{t}=P(e);return t}function ft(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=W(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 _=W(e,i.end+4,!0);return e.substring(_.start,_.end)}else i=W(e,i.end+4,!1);const u=e.substring(s.start,s.end);return u||e}function W(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 ht(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 Q(e){const t=new CustomEvent("notification",{bubbles:!0,cancelable:!1,detail:e});dispatchEvent(t)}const mt={success:(e,t)=>{Q({type:"success",message:e,options:t})},info:(e,t)=>{Q({type:"info",message:e,options:t})},warning:(e,t)=>{Q({type:"warning",message:e,options:t})},error:(e,t)=>{Q({type:"error",message:e,options:t})}};async function f(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=d,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}`;C(`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 v(i,r==null?void 0:r.responseType)}catch(i){throw m("Error making POST request:",i),i}}async function S(e,t,r){const n=L(r==null?void 0:r.headers),{backendUrl:a}=d,s=t?`?${new URLSearchParams(t)}`:"";e.startsWith("plugin")&&(e=`api/v1/${e}`);const l=a?`${a}/${e}${s}`:`${e}${s}`;C(`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 v(c,r==null?void 0:r.responseType)}catch(c){throw m("Error making GET request:",c),c}}async function _t(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=d,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=`${s}/${e}`;C(`Making PUT request to: ${c}`);try{const i=await fetch(c,{method:"PUT",headers:n,credentials:"include",body:JSON.stringify(l)});return v(i,r==null?void 0:r.responseType)}catch(i){throw m("Error making PUT request:",i),i}}async function gt(e,t,r){const n=L(r==null?void 0:r.headers),{backendUrl:a}=d,s=t?`?${new URLSearchParams(t)}`:"",l=a?`${a}/${e}${s}`:`${e}${s}`;C(`Making DELETE request to: ${l}`);try{const c=await fetch(l,{method:"DELETE",credentials:"include",headers:n});return v(c,r==null?void 0:r.responseType)}catch(c){throw m("Error making DELETE request:",c),c}}async function St(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=d,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=s?`${s}/${e}`:`${e}`;C(`Making PATCH request to: ${c}`);try{const i=await fetch(c,{method:"PATCH",headers:n,credentials:"include",body:JSON.stringify(l)});return v(i,r==null?void 0:r.responseType)}catch(i){throw m("Error making PATCH request:",i),i}}let M,ge;function U(e,t=!0){let r=wt(e.$auditRecord);r&&(Se(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 Se(e){var r;const t=kt();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 kt(){return(!M||bt())&&(M=E()),ge=new Date,M}function bt(){return new Date().getTime()-ge.getTime()>10*60*1e3}async function vt(e,t=!0){const r={event:k.None,$auditRecord:e};return U(r,t),f("api/v1/audit.notify",r)}const Ct={notify:vt};async function Rt(e,t,r){var _;const n=((_=e.items)==null?void 0:_.length)||0,a=10,s={query:{...t,action:"aggregate",aggregations:{[e.name]:{skip:n,count:a}}},$auditRecord:{auditEvents:[r]}};U(s);const l=await f("api/v1/query",s),c=await v(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 Pt(){const{app:e}=d,t=new URLSearchParams({app:e||""});return S("api/v1/app",t)}async function ke(){const{app:e}=d,t=new URLSearchParams({app:e||"",preLogin:"true"});return S("api/v1/app",t)}function Lt(){let{backendUrl:e,app:t}=d;if(typeof window<"u"){if(e||(e=window.location.origin),!t){const r=window.location.pathname.match(/\/app(?:-debug)?\/([^\/#]+)/);r&&(t=r[1])}w({...d,backendUrl:e,app:t})}return ke().then(r=>{const{autoOAuthProvider:n,autoSAMLProvider:a}=d,s=!n&&!r.autoOAuthProvider&&!a&&!r.autoSAMLProvider;return w({...d,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 Ut(e,t,r={}){const n=`api/v1/search.dataset/${e}/${t}`,a=await f(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 Ot(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 pt(e){return await S(`api/v1/search.dataset/${e}`)}async function yt(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 m("Error in fetchLabels",n),n}}async function $t(){try{const{app:e=""}=d,t=new URLSearchParams({app:e,action:"getUserRights"});return S("api/v1/labels",t)}catch(e){throw m("Error in getUserRights",e),e}}async function It(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 f("api/v1/labels",n)}catch(n){throw m("Error in add",n),n}}async function At(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 f("api/v1/labels",n)}catch(n){throw m("Error in remove",n),n}}async function Dt(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 f("api/v1/labels",n)}catch(n){throw m("Error in rename",n),n}}async function Ft(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 f("api/v1/labels",r)}catch(r){throw m("Error in deleteLabels",r),r}}async function Nt(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 f("api/v1/labels",n)}catch(n){throw m("Error in bulkAdd",n),n}}async function Bt(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 f("api/v1/labels",n)}catch(n){throw m("Error in bulkRemove",n),n}}const Qt={getUserRights:$t,add:It,remove:At,rename:Dt,delete:Ft,bulkAdd:Nt,bulkRemove:Bt};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 Vt(e){const t=new Headers;t.append("content-type","text");const r=await fetch(e,{method:"GET",headers:t});v(r)}async function be(){const e=new URLSearchParams({action:"get",noAutoAuthentication:"true"});return S("api/v1/principal",e)}const ve=11;async function jt(e,t,r){var l;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===ve),c.isTree&&c.items&&q(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 xt(e,t,r){const{app:n=""}=d,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(i=>{i.$hasMore=!1,!i.isDistribution&&!i.isTree&&i.items&&(i.$hasMore=i.items.length===ve),i.isTree&&q(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 q(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(q(a,s,l)):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 zt({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 U(u),await f("api/v1/search.queryexport",u,{responseType:"blob"})}async function Ht(e,t,r){return(await f("api/v1/similardocuments",{sourceDocumentId:e,query:{name:t}},{signal:r})).data}async function Jt(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 Wt(e,t,r,n,a){const{app:s}=d,l={app:s||"",suggestQuery:e,text:t,filter:r,kinds:n,showSource:a};try{return(await f("api/v1/search.suggest",l)).suggests}catch(c){throw console.error("Error fetching suggestions:",c),c}}async function Mt(e,t,r,n){const{app:a}=d;return(await f("api/v1/suggestquery",{app:a||"",suggestQuery:e,text:t,query:r,kinds:n})).suggests}async function Xt(e,t){if(!t)return Promise.resolve([]);const{app:r}=d;return(await f("api/v1/suggestfield",{app:r||"",text:e,action:"suggests",fields:t})).suggests}async function Yt(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 Kt(){const{app:e}=d,t=new URLSearchParams({app:e||"",action:"load"});return S("api/v1/usersettings",t)}async function Ce(e,t){const r={action:"save",userSettings:e,$auditRecord:{auditEvents:[t]}};return U(r),f("api/v1/usersettings",r)}async function Zt(e,t){const n={action:"patch",userSettings:e,$auditRecord:t?{auditEvents:[t]}:void 0};return U(n),f("api/v1/usersettings",n)}async function Et(){return Ce({},{type:"UserSettings_Reset"})}async function Tt(){return await S("api/v2/version")}const Re=async()=>{const{autoOAuthProvider:e}=d;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&&(X("oauthRedirectUrl",r.redirectUrl),window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with OAuth",r),r}},Pe=async()=>{const{autoSAMLProvider:e}=d;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&&(X("samlRedirectUrl",r.redirectUrl),window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with SAML",r),r}},$=e=>Ae("sinequa-credentials",JSON.stringify({data:{csrfToken:e}})),Le=async()=>{try{const e=await S("api/v1/challenge?action=getCsrfToken&suppressErrors=true");return e!=null&&e.csrfToken?($(e.csrfToken),e.csrfToken):null}catch(e){throw m("Failed to get CSRF token",e),e}};async function Ue(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 f("api/v1/security.webtoken",n);return a!=null&&a.csrfToken?($(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}=d;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 f("api/v1/security.webtoken",t,{headers:n});return a.csrfToken?($(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT without credentials",a),a}}}const V=()=>{var r;const e=Ie("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=x("csrfToken");return t!==null?t:null},er=async e=>{if(e)g("Attempting authentication using credentials"),w({useCredentials:!0,useSSO:!1});else{let c=null;try{g("Attempting to retrieve CSRF token from the backend"),c=await Le(),C("CSRF token retrieval result",c?"success":"failed")}catch(i){m("Failed to retrieve CSRF token",i)}try{const i=x("oauthRedirectUrl"),u=x("samlRedirectUrl");if(c===null){if(i||u)return R("Redirection from provider failed after previous attempt"),O("oauthRedirectUrl"),O("samlRedirectUrl"),h(!1),!1;const{autoOAuthProvider:_,autoSAMLProvider:I,useSAML:A}=d;if(_&&!A)return g("Initiating OAuth authentication flow"),await Re(),R("OAuth authentication flow did not redirect as expected"),h(!1),!1;if(I)return g("Initiating SAML authentication flow"),await Pe(),R("SAML authentication flow did not redirect as expected"),h(!1),!1;g("No direct authentication method available, will try SSO then credentials"),w({useCredentials:!0,useSSO:!0})}else return O("oauthRedirectUrl"),O("samlRedirectUrl"),g("User authenticated via existing token"),h(!0),!0}catch(i){throw m("Unexpected error during authentication",i),h(!1),i}}if(d.useCredentials&&d.useSSO)try{if(g("Checking if user is authenticated via SSO"),await be())return g("User authenticated using SSO"),w({useCredentials:!1,useSSO:!0}),h(!0),!0}catch(c){if((c==null?void 0:c.status)===401)return g("SSO authentication failed with 401, falling back to credentials"),w({useCredentials:!0,useSSO:!1}),!1;throw m("SSO authentication failed with unexpected error",c),h(!1),m}const{useSSO:r}=d,n=V();if(n&&n!==null||r)return g("user already authenticated",n),w({isRedirectUrl:!1}),h(!0),!0;const{useCredentials:a}=d,{username:s,password:l}=e||{};if(a&&!s&&!l)return m("Credentials are required for authentication"),h(!1),!1;if(s&&l)try{return g("authentication using credentials..."),w({useCredentials:!0,useSSO:!1}),await Ue({username:s,password:l}),h(!0),!0}catch(c){throw h(!1),c}return h(!1),m("No authentication method available. Please provide credentials or configure OAuth/SAML."),!1},Oe=async()=>{const e=new URLSearchParams({action:"deleteWebTokenCookie",noUserOverride:"true",noAutoAuthentication:"true"});return S("api/v1/challenge",e)},tr=async()=>{const{useCredentials:e,userOverrideActive:t}=d;O("csrfToken"),De("sinequa-credentials"),e&&!t?(await Oe()).methodresult==="ok"?h(!1):console.error("logout failed"):h(!1)},rr=()=>!!V();o.ApiError=b,o.Audit=Ct,o.AuditEventType=k,o.DidYouMeanKind=te,o.EngineType=T,o.EngineTypeModifier=ee,o.LogLevel=H,o.MINIMUM_COMPATIBLE_SERVER_API_VERSION=Ve,o.RFMDisplay=re,o.ServerError=ne,o.TimeoutError=ae,o.UnauthorizedError=z,o.addAuditAdditionalInfo=U,o.addConcepts=Te,o.addSessionId=Se,o.addUrl=we,o.aggItemRegex=se,o.aggregationItemStrictCompare=He,o.appInitializerFn=Lt,o.bisect=We,o.buildPathsAndLevels=q,o.configureLogger=xe,o.createHeaders=L,o.createTimeoutController=je,o.debug=C,o.del=gt,o.deleteUserSettings=Et,o.deleteWebTokenCookie=Oe,o.emitAuthenticatedEvent=h,o.error=m,o.escapeExpr=Qe,o.fetchAggregation=Rt,o.fetchApp=Pt,o.fetchAppPreLogin=ke,o.fetchBulkQuery=xt,o.fetchDataset=Ut,o.fetchDatasetList=pt,o.fetchDatasets=Ot,o.fetchLabels=yt,o.fetchPreview=qt,o.fetchPreviewUrl=Vt,o.fetchPrincipal=be,o.fetchQuery=jt,o.fetchQueryExport=zt,o.fetchQueryIntent=Gt,o.fetchSimilarDocuments=Ht,o.fetchSponsoredLinks=Jt,o.fetchSuggest=Wt,o.fetchSuggestField=Xt,o.fetchSuggestQuery=Mt,o.fetchTextChunks=Yt,o.fetchUserSettings=Kt,o.fetchVersion=Tt,o.get=S,o.getConcepts=rt,o.getCsrfToken=Le,o.getFiltersFromURI=J,o.getFiltersFromUrl=ct,o.getHelpIndexUrl=ht,o.getIdFromUrl=lt,o.getJWToken=Ue,o.getMetadata=Ne,o.getOffsetFromDates=_e,o.getQueryPageFromUrl=ut,o.getQueryParamsFromUrl=ot,o.getQueryTabFromUrl=dt,o.getQueryTextFromUrl=it,o.getRelativeDate=nt,o.getToken=V,o.getUrlParamsFromQueryParams=st,o.globalConfig=d,o.guid=E,o.handleResponse=v,o.info=g,o.isArrayBuffer=Y,o.isAuthenticated=rr,o.isBlob=K,o.isJsonable=Be,o.isNotInputEvent=at,o.isObject=p,o.isString=Z,o.labels=Qt,o.login=er,o.logout=tr,o.notify=mt,o.openParentNodes=ie,o.parseText=y,o.parseValueAndOperatorFromItem=ce,o.patch=St,o.patchUserSettings=Zt,o.post=f,o.put=_t,o.queryParamsFromUrl=P,o.removeConcept=et,o.removeConcepts=tt,o.resolveToColumnName=Fe,o.rewriteText=B,o.saveUserSettings=Ce,o.setGlobalConfig=w,o.setToken=$,o.sha512=qe,o.suggestionsToTreeAggregationNodes=Je,o.sysLang=ft,o.translateAggregationToDateOptions=ze,o.tryOAuthAuthentication=Re,o.trySAMLAuthentication=Pe,o.warn=R,o.withRetry=Ge,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,QAS5D"}
|
|
@@ -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,EACN,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,GACR,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":"AAaA,eAAO,MAAM,sBAAsB;iBAKN,MAAM;EA6BlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saml-authentication.d.ts","sourceRoot":"","sources":["../../../src/authentication/providers/saml-authentication.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,qBAAqB;iBAKL,MAAM;EA6BlC,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":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,CAmJtE,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;kBAOL,MAAM;EACjC,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,SAIpC,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;AAEpC;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI;
|
|
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;AAEpC;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI;IACjE,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;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KACf,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;CACtB,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,CAC9B,MAAM,EAAE,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GACpD,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"}
|
|
@@ -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,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACxD,GACC,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,EAC1B,QAAQ,EAAE,aAAa,EACvB,MAAM,CAAC,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,GACC,OAAO,CAAC,CAAC,CAAC,CA8BZ"}
|
|
@@ -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,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC5B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACxD,GACC,OAAO,CAAC,CAAC,CAAC,CA2BZ"}
|
|
@@ -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,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C;;;;;;;;;;GAUG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAC3B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,GACC,OAAO,CAAC,CAAC,CAAC,CAiCZ"}
|
|
@@ -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,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACT,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CACxD,GACC,OAAO,CAAC,CAAC,CAAC,CA2BZ"}
|
|
@@ -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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinequa/atomic",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.121",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/atomic.umd.cjs",
|
|
7
7
|
"module": "./dist/atomic.js",
|
|
@@ -30,14 +30,23 @@
|
|
|
30
30
|
"watch": "vite build --watch",
|
|
31
31
|
"test": "vitest",
|
|
32
32
|
"v:publish": "npm publish --registry https://npm.sinequa.com",
|
|
33
|
-
"v:unpublish": "npm unpublish --registry https://npm.sinequa.com --force"
|
|
33
|
+
"v:unpublish": "npm unpublish --registry https://npm.sinequa.com --force",
|
|
34
|
+
"prepare": "husky"
|
|
35
|
+
},
|
|
36
|
+
"lint-staged": {
|
|
37
|
+
"*.{js,ts,html,scss,css,json}": [
|
|
38
|
+
"npx @biomejs/biome check --write --files-ignore-unknown=true"
|
|
39
|
+
]
|
|
34
40
|
},
|
|
35
41
|
"devDependencies": {
|
|
42
|
+
"@biomejs/biome": "2.2.7",
|
|
36
43
|
"@types/node": "^20.11.0",
|
|
44
|
+
"husky": "^9.1.7",
|
|
37
45
|
"jsdom": "^26.0.0",
|
|
46
|
+
"lint-staged": "^16.2.6",
|
|
38
47
|
"typescript": "^5.7.3",
|
|
39
|
-
"vite": "^6.
|
|
40
|
-
"vite-plugin-dts": "^4.5.
|
|
41
|
-
"vitest": "^3.
|
|
48
|
+
"vite": "^6.4.1",
|
|
49
|
+
"vite-plugin-dts": "^4.5.4",
|
|
50
|
+
"vitest": "^3.2.4"
|
|
42
51
|
}
|
|
43
52
|
}
|