@sinequa/atomic 0.0.123 → 0.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +188 -36
- package/dist/atomic.js +826 -646
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/helpers/columns.d.ts +27 -0
- package/dist/helpers/columns.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +5 -4
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/metadata.d.ts +32 -0
- package/dist/helpers/metadata.d.ts.map +1 -1
- package/dist/types/aggregations/AggregationItem.d.ts +4 -0
- package/dist/types/aggregations/AggregationItem.d.ts.map +1 -1
- package/dist/types/config/CCApp.d.ts +3 -1
- package/dist/types/config/CCApp.d.ts.map +1 -1
- package/dist/types/principal/Principal.d.ts +2 -0
- package/dist/types/principal/Principal.d.ts.map +1 -1
- package/dist/utils/notification.d.ts +6 -1
- package/dist/utils/notification.d.ts.map +1 -1
- package/dist/web-api/helpers/handle-response.d.ts +1 -1
- package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
- package/dist/web-api/helpers/index.d.ts +9 -8
- package/dist/web-api/helpers/index.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/date-utils..d.ts +14 -0
- package/dist/web-api/helpers/utils/date-utils..d.ts.map +1 -0
- package/dist/web-api/index.d.ts +4 -2
- package/dist/web-api/index.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-change-password.d.ts +12 -2
- package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-forgot-password.d.ts +11 -0
- package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/atomic.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(o=typeof globalThis<"u"?globalThis:o||self,h(o.atomic={}))})(this,function(o){"use strict";var rr=Object.defineProperty;var nr=(o,h,f)=>h in o?rr(o,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):o[h]=f;var ye=(o,h,f)=>nr(o,typeof h!="symbol"?h+"":h,f);function h(e){const t=new CustomEvent("authenticated",{bubbles:!0,cancelable:!1,detail:{authenticated:e}});dispatchEvent(t)}const f={loginPath:"/login",createRoutes:!1};function w(e){Object.assign(f,e)}function pe(e,t,r){var s,l,c,i;if(!e||!t)return;if(r){const u=Object.keys(t.queries).find(J=>J===(r==null?void 0:r.toLowerCase()));let g;u&&(g=t.queries[u]);const H=(l=((s=g==null?void 0:g.columnsInfo)==null?void 0:s.columns)||[])==null?void 0:l.find(J=>{var Le,Oe;return(Oe=(Le=J.aliases)==null?void 0:Le.split(","))==null?void 0:Oe.includes(e)});if(H)return H.name}const n=(i=(c=t.indexes)==null?void 0:c._)==null?void 0:i.columns,a=Object.entries(n).find(u=>{var g;return(g=u[1].aliases)==null?void 0:g.includes(e)});if(a)return a[0]}function Ue(e,t){const r=e[t];return r===void 0?[]:Array.isArray(r)?r.map(n=>{if(typeof n=="string")return n;if(typeof n=="object"&&n!==null&&"display"in n)return n.display}).filter(n=>n!==void 0):[String(r)]}function y(e){return e!==null&&typeof e=="object"}function W(e){return y(e)&&Object.prototype.toString.call(e)==="[object ArrayBuffer]"}function M(e){return y(e)&&Object.prototype.toString.call(e)==="[object Blob]"}function X(e){return typeof e=="string"}function $e(e){return(y(e)||Array.isArray(e))&&!W(e)&&!M(e)&&!X(e)}function Y(e=!0){let t=Date.now();return(e?"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx":"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g,n=>{const a=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(n==="x"?a:a&3|8).toString(16)})}function Ie(e){if(!e)return"``";if(e=String(e),e.search(/[\\`]/)===-1)return"`"+e+"`";const t=["`"];for(let r=0,n=e.length;r<n;r++){const a=e[r];(a==="\\"||a==="`")&&t.push("\\"),t.push(a)}return t.push("`"),t.join("")}function Ae(e){if(typeof crypto<"u"&&crypto.subtle&&typeof crypto.subtle.digest=="function")try{return crypto.subtle.digest("SHA-512",new TextEncoder().encode(e)).then(t=>Array.prototype.map.call(new Uint8Array(t),r=>("00"+r.toString(16)).slice(-2)).join("")).catch(()=>Promise.resolve(B(e)))}catch{return Promise.resolve(B(e))}return Promise.resolve(B(e))}function B(e){let n=2166136261;for(let g=0;g<e.length;g++)n^=e.charCodeAt(g),n=n*16777619>>>0;const a=n.toString(16).padStart(8,"0"),s=((n^2863311530)>>>0).toString(16).padStart(8,"0"),l=((n^1431655765)>>>0).toString(16).padStart(8,"0"),c=((n^3435973836)>>>0).toString(16).padStart(8,"0"),i=a+s+l+c;return(i+i+i+i).substring(0,128)}var k=(e=>(e.None="None",e.Search_FirstPage="Search_FirstPage",e.Search_Text="Search_Text",e.Search_Refine="Search_Refine",e.Search_Select_Item="Search_Select_Item",e.Search_Select_Custom="Search_Select_Custom",e.Search_Select_Concept="Search_Select_Concept",e.Search_Select_Correction="Search_Select_Correction",e.Search_GotoPage="Search_GotoPage",e.Search_GotoTab="Search_GotoTab",e.Search_DisplayResult="Search_DisplayResult",e.Search_RemoveResult="Search_RemoveResult",e.Search_RemoveAdvanced="Search_RemoveAdvanced",e.Search_SavedQuery="Search_SavedQuery",e.Search_WebService="Search_WebService",e.Search_DidYouMean_Original="Search_DidYouMean_Original",e.Search_DidYouMean_Correction="Search_DidYouMean_Correction",e.Search_ExportCSV="Search_ExportCSV",e.Search_SavedQuery_ExportCSV="Search_SavedQuery_ExportCSV",e.Search_Selection_ExportCSV="Search_Selection_ExportCSV",e.Search_AlertQuery="Search_AlertQuery",e.Search_Select_AnalyticsItem="Search_Select_AnalyticsItem",e.Search_Sort="Search_Sort",e.Search_Exit_Logout="Search_Exit_Logout",e.Search_Timeline_Usage="Search_Timeline_Usage",e.Search_AutoComplete="Search_Autocomplete",e.Search_Login_Success="Login_Success_Form",e.Search_QueryIntent_Detected="Search_QueryIntent_Detected",e.SavedQuery_Add="SavedQuery_Add",e.SavedQuery_Delete="SavedQuery_Delete",e.SavedQuery_DeleteAll="SavedQuery_DeleteAll",e.SavedQuery_Rename="SavedQuery_Rename",e.Alert_Edit="Alert_Edit",e.Alert_Delete="Alert_Delete",e.Alert_DeleteAll="Alert_DeleteAll",e.Link_Display="Link_Display",e.Link_Click="Link_Click",e.Basket_Add="Basket_Add",e.Basket_Delete="Basket_Delete",e.Basket_DeleteAll="Basket_DeleteAll",e.Basket_Rename="Basket_Rename",e.Basket_AddDoc="Basket_AddDoc",e.Basket_RemoveDoc="Basket_RemoveDoc",e.Basket_Open="Basket_Open",e.Basket_ExportCSV="Basket_ExportCSV",e.Label_Add="Label_Add",e.Label_Delete="Label_Delete",e.Label_Rename="Label_Rename",e.Label_Open="Label_Open",e.Label_AddDoc="Label_AddDoc",e.Label_RemoveDoc="Label_RemoveDoc",e.Label_ExportCSV="Label_ExportCSV",e.Label_Menu_ExportCSV="Label_Menu_ExportCSV",e.Rating_Set="Rating_Set",e.Rating_Delete="Rating_Delete",e.Doc_Preview="Doc_Preview",e.Doc_CacheHtml="Doc_CacheHtml",e.Doc_CachePdf="Doc_CachePdf",e.Doc_CacheOriginal="Doc_CacheOriginal",e.Doc_Url1="Doc_Url1",e.Doc_Url2="Doc_Url2",e.Preview_Close="Preview_Close",e.Click_ResultLink="Click_ResultLink",e.Click_ResultLink1="Click_ResultLink1",e.Click_ResultLink2="Click_ResultLink2",e.Click_ResultLink3="Click_ResultLink3",e.Click_ResultLink4="Click_ResultLink4",e.Click_ResultLink5="Click_ResultLink5",e.Click_ResultLink6="Click_ResultLink6",e.Click_ResultLink7="Click_ResultLink7",e.Click_ResultLink8="Click_ResultLink8",e.Click_ResultLink9="Click_ResultLink9",e.Click_ResultLink10="Click_ResultLink10",e.Click_PreviewLink1="Click_PreviewLink1",e.Click_PreviewLink2="Click_PreviewLink2",e.Click_PreviewLink3="Click_PreviewLink3",e.Click_PreviewLink4="Click_PreviewLink4",e.Click_PreviewLink5="Click_PreviewLink5",e.Click_PreviewLink6="Click_PreviewLink6",e.Click_PreviewLink7="Click_PreviewLink7",e.Click_PreviewLink8="Click_PreviewLink8",e.Click_PreviewLink9="Click_PreviewLink9",e.Click_PreviewLink10="Click_PreviewLink10",e.RFM_ClickSet="RFM_ClickSet",e.RFM_ClickReset="RFM_ClickReset",e.RFM_Like="RFM_Like",e.RFM_LikeReset="RFM_LikeReset",e.RFM_Dislike="RFM_Dislike",e.RFM_Important="RFM_Important",e.RFM_ImportantReset="RFM_ImportantReset",e.RFM_Ban="RFM_Ban",e.Navigation_Exit="Navigation_Exit",e.Navigation_Return="Navigation_Return",e.Navigation_Route="Navigation_Route",e.Answer_Display="Answer_Display",e.Answer_Click="Answer_Click",e.Answer_Result="Answer_Result",e.Answer_Liked="Answer_Liked",e.Answer_Disliked="Answer_Disliked",e.Answer_Liked_Cancelled="Answer_Liked_Cancelled",e.Answer_Disliked_Cancelled="Answer_Disliked_Cancelled",e.TopPassages_Display="TopPassages_Display",e.TopPassages_Click="TopPassages_Click",e.UserSettings_Reset="UserSettings_Reset",e))(k||{}),K=(e=>(e[e.none=0]="none",e[e.bool=1]="bool",e[e.date=2]="date",e[e.dateTime=3]="dateTime",e[e.time=4]="time",e[e.unsigned=5]="unsigned",e[e.integer=6]="integer",e[e.float=7]="float",e[e.double=8]="double",e[e.dates=9]="dates",e[e.dateTimes=10]="dateTimes",e[e.times=11]="times",e[e.varchar=12]="varchar",e[e.binary=13]="binary",e[e.string=14]="string",e[e.csv=15]="csv",e))(K||{}),Z=(e=>(e[e.none=0]="none",e[e.a=2053]="a",e[e.c=4]="c",e[e.d=8]="d",e[e.e=2068]="e",e[e.i=256]="i",e[e.l=2052]="l",e[e.n=8192]="n",e[e.t=524292]="t",e[e.x=8388608]="x",e[e.z=33554432]="z",e[e.f_ordinal=8192]="f_ordinal",e[e.f_multidates=8192]="f_multidates",e[e.f_varchar=33554432]="f_varchar",e[e.f_binary=33562624]="f_binary",e[e.f_string=33562888]="f_string",e[e.f_csv=42477853]="f_csv",e[e.f_overridable=33554696]="f_overridable",e))(Z||{});const De="1.0";var E=(e=>(e[e.Original=0]="Original",e[e.Corrected=1]="Corrected",e))(E||{}),T=(e=>(e[e.none=0]="none",e[e.positiveRate=1]="positiveRate",e[e.mainlyPosRate=2]="mainlyPosRate",e[e.unrate=4]="unrate",e[e.mainlyNegRate=8]="mainlyNegRate",e[e.negativeRate=16]="negativeRate",e[e.all=31]="all",e[e.positiveOnly=7]="positiveOnly",e[e.negativeOnly=28]="negativeOnly",e[e.personalAll=21]="personalAll",e[e.personalPosOnly=5]="personalPosOnly",e[e.personalNegOnly=20]="personalNegOnly",e))(T||{});class b extends Error{constructor(r,n){super(r);ye(this,"status");this.name="ApiError",this.status=n}}class Q extends b{constructor(t="Unauthorized access"){super(t,401),this.name="UnauthorizedError"}}class ee extends b{constructor(t="Server error"){super(t,500),this.name="ServerError"}}class te extends b{constructor(t="Request timed out"){super(t,408),this.name="TimeoutError"}}function Fe(e){const t=new AbortController,{signal:r}=t;return e&&setTimeout(()=>{r.aborted||t.abort(new te(`Request timed out after ${e}ms`))},e),{controller:t,signal:r}}var q=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE",e))(q||{});let $={level:1,enableConsoleOutput:!0};function Ne(e){$={...$,...e}}function I(e,t,r){if(e<$.level)return;const a=`${`[${q[e]}]`} ${t}`;if($.enableConsoleOutput)switch(e){case 0:console.debug(a,r||"");break;case 1:console.info(a,r||"");break;case 2:console.warn(a,r||"");break;case 3:console.error(a,r||"");break}}function v(e,t){I(0,e,t)}function m(e,t){I(1,e,t)}function P(e,t){I(2,e,t)}function _(e,t){I(3,e,t)}async function Be(e,t=0,r=1e3){let n;for(let a=0;a<=t;a++)try{return await e()}catch(s){if(n=s,s instanceof b&&s.status>=400&&s.status<500&&s.status!==429||s instanceof DOMException&&s.name==="AbortError")throw s;a<t&&(P(`Retrying request (${a+1}/${t})`,{error:s}),await new Promise(l=>setTimeout(l,r)))}throw n}function L(e){const t=N(),r=new Headers(e);r.append("Sinequa-Force-Camel-Case","true"),r.append("accept","application/json"),t&&r.append("Sinequa-csrf-token",t);const{userOverride:n,userOverrideActive:a,bearerToken:s}=f;return s&&r.append("Authorization",`Bearer ${s}`),n&&a&&(r.append("sinequa-override-user",n.username),r.append("sinequa-override-domain",n.domain)),r}async function C(e,t="json"){const r=e.headers.get("sinequa-jwt-refresh");if(r!==null&&U(r),e.status===200)switch(t){case"arraybuffer":return await e.arrayBuffer();case"blob":return await e.blob();case"text":return await e.text();case"json":default:return await e.json()}if(e.status===401){if(f.userOverrideActive)throw f.userOverrideActive=!1,P("Unauthorized access attempt with user override",{endpoint:e.url}),new Q("Unauthorized... User override failed.");await re(e,401)}throw e.status===500&&(_("Server error occurred",{endpoint:e.url}),await re(e,500)),P(`Unexpected response status: ${e.status}`,{endpoint:e.url}),new b(`Request failed with status ${e.status}`,e.status)}async function re(e,t){var r;try{const{done:n,value:a}=await((r=e.body)==null?void 0:r.getReader().read())||{done:!0,value:void 0};if(n||!a)throw new b(`Request failed with status ${t}`,t);const s=JSON.parse(new TextDecoder().decode(a));throw s.status=t,s}catch(n){throw n instanceof b?n:t===401?new Q:t===500?new ee:new b(`Request failed with status ${t}`,t)}}const ne=/.*\:\(?([><=\d\-\.AND ]+)\)?/;function Qe(e,t){var a;return!(e!=null&&e.items)||((a=e==null?void 0:e.items)==null?void 0:a.length)===0?[]:e.items.reduce((s,l)=>{if(!l.value||l.value==="")return s;const c=ae(l,e.column);return s.push({operator:c.operator,value:c.value,display:l.display||c.display,filters:c.filters,disabled:l.count===0,hidden:l.count===0&&e.isDistribution?!t:!1}),s},[])}function ae(e,t){const r=t,n=e.value.match(ne);if(n!=null&&n[1]){const s=(n==null?void 0:n[1].split(" AND ")).map(l=>{const c=l.indexOf(">=")!==-1?"gte":"lt";let i=l.substring(l.indexOf(" ")+1);return{field:r,operator:c,value:i,display:e.display||e.value}});if(s.length===2)return{field:r,operator:"and",filters:s,value:e.value,display:s[0].display||s[0].value};if(s.length===1)return{...s[0],field:r};throw new Error("Failed to parse distribution expression")}return{field:r,operator:"eq",value:e.value,display:e.display}}function qe(e,t,r){return e.valuesAreExpressions?t.display===r.display:t.value===r.value}function oe(e){return e.items&&(e.items=e.items.map(t=>oe(t))),e.items&&e.items.some(t=>t.$selected||t.$opened)&&(e.$opened=!0),e}function Ve(e,t){const r=[];if(e.length>0){const n=new Map,s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g,""),l=new RegExp("\\b"+s,"i");e.forEach(c=>{if(c.display.length>1){const i=c.display.normalize("NFD").replace(/[\u0300-\u036f]/g,""),u=l.exec(i);se(r,n,"/",c.display,+(c.frequency||0),1,((u==null?void 0:u.index)||0)+t.length)}})}return r}function se(e,t,r,n,a,s,l){const c=n.indexOf("/",r.length),i=n.substring(0,c+1);let u=t.get(i);if(!u){const g=i.replace(/^\/|\/$/g,"");u={value:n.substring(r.length,c),count:a,items:[],hasChildren:!1,$level:s,$opened:l>=i.length,$path:g},t.set(i,u),e.push(u)}i.length<n.length&&(u.hasChildren=!0,se(u.items,t,i,n,a,s+1,l))}function je(e,t){return e.reduce((r,n)=>(t(n)?r.true.push(n):r.false.push(n),r),{true:[],false:[]})}const xe=/(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g,Ge=2,ce=3,ze=5,ie=6,He=8,le=9,Je=11,ue=12,We=14,fe=15;function p(e){if(!e)return[];const t=[],r=e.matchAll(xe);for(let n of r)n[ce]?t.push({type:"group",value:n[ce],op:n[Ge]}):n[ie]?t.push({type:"adjacent",value:n[ie],op:n[ze]}):n[le]?t.push({type:"exact",value:n[le],op:n[He]}):n[ue]?t.push({type:"regex",value:n[ue],op:n[Je]}):n[fe]&&t.push({type:"token",value:n[fe],op:n[We]});return t}function A(e){return e.map(t=>{const r=t.op||"";switch(t.type){case"group":return`${r}(${t.value})`;case"adjacent":return`${r}[${t.value}]`;case"exact":return`${r}"${t.value}"`;case"regex":return`${r}/${t.value}/`;case"token":return`${r}${t.value}`}}).join(" ")}function Me(e,t,r){let n=p(e);for(let a of t)n.push({type:"adjacent",value:a,op:r});return A(n)}function Xe(e,t){const r=p(t),n=r.findIndex(a=>a.value===e);return n!==-1?(r.splice(n,1),t=A(r)):t}function Ye(e){const t=p(e).filter(r=>r.type!=="adjacent");return A(t)}function Ke(e){return p(e).filter(t=>t.type==="adjacent").map(t=>t.value)}function Ze(e,t,r){const n=new Intl.RelativeTimeFormat(e,{numeric:"auto"}),{offset:a,unit:s,isFuture:l}=de(t,r);return n.format(a*(l?1:-1),s)}function de(e,t){const r=new Date(e),n=t?new Date(t):new Date,a=Math.abs(n.getTime()-r.getTime());return{offset:Math.floor(a/(1e3*60*60*24)),unit:"day",isFuture:r>n}}function Ee(e){const t=e.target;return t&&t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"}function Te(e){if(e===void 0)return;const{q:t,f:r,p:n,s:a,t:s,n:l,b:c}=R(e),[i]=e.split("?");return{path:i,text:t,filters:r?V(r):void 0,page:n?parseInt(n,10):void 0,sort:a,tab:s,name:l,basket:c}}function et(e){if(!e)return"";const{text:t,filters:r,page:n,sort:a,tab:s,name:l,basket:c}=e,i={};t&&(i.q=t),r&&(i.f=JSON.stringify(r)),n&&(i.p=n.toString()),a&&(i.s=a),s&&(i.t=s),l&&(i.n=l),c&&(i.b=c);const u=new URLSearchParams(i).toString();return u||""}function tt(e){if(e===void 0)return[];const{f:t}=R(e);return V(t)}function V(e){const t=decodeURIComponent(e);try{return JSON.parse(t??"[]")}catch{return console.error(`Error parsing filters from URI: ${e}`),[]}}function R(e){const t=e.split("?")[1];if(t===void 0)return{};const r=new URLSearchParams(t);return Object.fromEntries(r)}function rt(e){const{q:t=""}=R(e);return t}function nt(e){const{id:t}=R(e);return decodeURIComponent(t)}function at(e){const{p:t="0"}=R(e);return parseInt(t,10)}function ot(e){const{t}=R(e);return t}function st(e,t){if(!e)return e;let r=0;const n=e.length;let a=0;if(e[a]==="["){for(;a<n&&/[0-9]/.test(e[a]);)a++;e[a]==="]"&&(r=a+1)}const s=j(e,r,!1);if(!s)return e;const l=t.charCodeAt(0),c=t.charCodeAt(1);let i=s;for(;i;)if(l===i.lang1&&c===i.lang2){const g=j(e,i.end+4,!0);return e.substring(g.start,g.end)}else i=j(e,i.end+4,!1);const u=e.substring(s.start,s.end);return u||e}function j(e,t,r){for(let n=t,a=e.length-3;n<a;n++)if(e[n]==="["&&e[n+3]==="]")return{start:t,end:n,lang1:e.charCodeAt(n+1),lang2:e.charCodeAt(n+2)};if(r)return{start:t,end:e.length,lang1:-1,lang2:-1}}function ct(e,t){const{useLocale:r,useLocaleAsPrefix:n,indexFile:a,path:s,folder:l}=t,c=r?`${e}/`:null,i=n?`${e}.${a}`:a??"";return[s,l,`${c||""}${i}`].filter(u=>u!==void 0).join("/")}function D(e){const t=new CustomEvent("notification",{bubbles:!0,cancelable:!1,detail:e});dispatchEvent(t)}const it={success:(e,t)=>{D({type:"success",message:e,options:t})},info:(e,t)=>{D({type:"info",message:e,options:t})},warning:(e,t)=>{D({type:"warning",message:e,options:t})},error:(e,t)=>{D({type:"error",message:e,options:t})}};async function d(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=f,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0};e.startsWith("plugin")&&(e=`api/v1/${e}`);const c=s?`${s}/${e}`:`${e}`;v(`Making POST request to: ${c}`);try{const i=await fetch(c,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(l),signal:r==null?void 0:r.signal});return C(i,r==null?void 0:r.responseType)}catch(i){throw _("Error making POST request:",i),i}}async function S(e,t,r){const n=L(r==null?void 0:r.headers),{backendUrl:a}=f,s=t?`?${new URLSearchParams(t)}`:"";e.startsWith("plugin")&&(e=`api/v1/${e}`);const l=a?`${a}/${e}${s}`:`${e}${s}`;v(`Making GET request to: ${l}`);try{const c=await fetch(l,{method:"GET",credentials:"include",headers:n,signal:r==null?void 0:r.signal});return C(c,r==null?void 0:r.responseType)}catch(c){throw _("Error making GET request:",c),c}}async function lt(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=f,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=`${s}/${e}`;v(`Making PUT request to: ${c}`);try{const i=await fetch(c,{method:"PUT",headers:n,credentials:"include",body:JSON.stringify(l)});return C(i,r==null?void 0:r.responseType)}catch(i){throw _("Error making PUT request:",i),i}}async function ut(e,t,r){const n=L(r==null?void 0:r.headers),{backendUrl:a}=f,s=t?`?${new URLSearchParams(t)}`:"",l=a?`${a}/${e}${s}`:`${e}${s}`;v(`Making DELETE request to: ${l}`);try{const c=await fetch(l,{method:"DELETE",credentials:"include",headers:n});return C(c,r==null?void 0:r.responseType)}catch(c){throw _("Error making DELETE request:",c),c}}async function ft(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=f,l={app:a,...t,locale:t.locale||navigator.language,noUserOverride:!0,noAutoAuthentication:!0},c=s?`${s}/${e}`:`${e}`;v(`Making PATCH request to: ${c}`);try{const i=await fetch(c,{method:"PATCH",headers:n,credentials:"include",body:JSON.stringify(l)});return C(i,r==null?void 0:r.responseType)}catch(i){throw _("Error making PATCH request:",i),i}}let x,he;function O(e,t=!0){let r=dt(e.$auditRecord);r&&(_e(r),t&&ge(r)),e.$auditRecord=r}function dt(e){if(!e)return;let t;if(Array.isArray(e))t=e;else if(y(e)){const r=e;if(r.auditEvents||r.mlAuditEvents)return r;t=[e]}return{auditEvents:t}}function _e(e){var r;const t=ht();return(r=e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.sessionid=t}),e}function ge(e){var r;const t=typeof window<"u"?decodeURIComponent(window.location.href):"http://localhost";return(r=e==null?void 0:e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.url=t}),e}function ht(){return(!x||_t())&&(x=Y()),he=new Date,x}function _t(){return new Date().getTime()-he.getTime()>10*60*1e3}async function gt(e,t=!0){const r={event:k.None,$auditRecord:e};return O(r,t),d("api/v1/audit.notify",r)}const mt={notify:gt};async function St(e,t,r){var g;const n=((g=e.items)==null?void 0:g.length)||0,a=10,s={query:{...t,action:"aggregate",aggregations:{[e.name]:{skip:n,count:a}}},$auditRecord:{auditEvents:[r]}};O(s);const l=await d("api/v1/query",s),c=await C(l),{aggregations:i}=c,u=i[0];return u.$hasMore=u.items.length>a,u.items=[...e.items,...u.items],Promise.resolve(u)}async function wt(){const{app:e}=f,t=new URLSearchParams({app:e||""});return S("api/v1/app",t)}async function me(){const{app:e}=f,t=new URLSearchParams({app:e||"",preLogin:"true"});return S("api/v1/app",t)}function kt(){let{backendUrl:e,app:t}=f;if(typeof window<"u"){if(e||(e=window.location.origin),!t){const r=window.location.pathname.match(/\/app(?:-debug)?\/([^/#]+)/);r&&(t=r[1])}w({...f,backendUrl:e,app:t})}return me().then(r=>{const{autoOAuthProvider:n,autoSAMLProvider:a}=f,s=!n&&!r.autoOAuthProvider&&!a&&!r.autoSAMLProvider;return w({...f,autoOAuthProvider:n||r.autoOAuthProvider,autoSAMLProvider:a||r.autoSAMLProvider,useCredentials:s,useSSO:s}),r}).catch(r=>{throw _("atomic:fetchAppPreLogin error",r),r})}async function bt(e,t,r={}){const n=`api/v1/search.dataset/${e}/${t}`,a=await d(n,{parameters:r}),s=t[0].toLowerCase()+t.slice(1),l=a.datasets[s];if("errorCode"in l&&"errorMessage"in l)throw new Error(l.errorMessage);return l}async function Ct(e,t){const r=`api/v1/search.dataset/${e}`,{parameters:n={},datasets:a=[]}=t;return(await d(r,{parameters:n,datasets:a})).datasets}async function vt(e){return await S(`api/v1/search.dataset/${e}`)}async function Rt(e,t=!0,r){try{return(await d("api/v1/labels",{action:"list",q:e,public:t,locale:r,localize:!1})).labels}catch(n){throw _("Error in fetchLabels",n),n}}async function Pt(){try{const{app:e=""}=f,t=new URLSearchParams({app:e,action:"getUserRights"});return S("api/v1/labels",t)}catch(e){throw _("Error in getUserRights",e),e}}async function Lt(e,t,r=!0){try{const n={action:"add",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:k.Label_AddDoc,detail:{public:r,label:e?e.toString():null,doccount:t?t.length:0}}],mlAuditEvents:[{actionType:"addToLabel",documentIds:t}]}};return d("api/v1/labels",n)}catch(n){throw _("Error in add",n),n}}async function Ot(e,t,r=!0){try{const n={action:"remove",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:k.Label_RemoveDoc,detail:{public:r,label:e?e.toString():null,doccount:t?t.length:0}}],mlAuditEvents:[{actionType:"removeFromLabel",documentIds:t}]}};return d("api/v1/labels",n)}catch(n){throw _("Error in remove",n),n}}async function yt(e,t,r=!0){try{const n={action:"rename",labels:e,newLabel:t,public:r,auditEvents:{type:k.Label_Rename,detail:{public:r,oldlabel:e?e.toString():null,label:t}}};return d("api/v1/labels",n)}catch(n){throw _("Error in rename",n),n}}async function pt(e,t=!0){try{const r={action:"delete",labels:e,public:t,auditEvents:{type:k.Label_Delete,detail:{public:t,label:e?e.toString():null}}};return d("api/v1/labels",r)}catch(r){throw _("Error in deleteLabels",r),r}}async function Ut(e,t,r=!0){try{const n={action:"bulkAdd",labels:e,query:t,public:r,auditEvents:{type:k.Label_Add,detail:{public:r,label:e?e.toString():null,query:t!==null?t.name:null}}};return d("api/v1/labels",n)}catch(n){throw _("Error in bulkAdd",n),n}}async function $t(e,t,r=!0){try{const n={action:"bulkRemove",labels:e,query:t,public:r,auditEvents:{type:k.Label_Delete,detail:{public:r,label:e?e.toString():null,query:t!==null?t.name:null}}};return d("api/v1/labels",n)}catch(n){throw _("Error in bulkRemove",n),n}}const It={getUserRights:Pt,add:Lt,remove:Ot,rename:yt,delete:pt,bulkAdd:Ut,bulkRemove:$t};async function At(e,t){if(typeof window>"u")return d("api/v1/preview",{action:"get",id:e,query:t});const r=`${window.location.origin}${window.location.pathname}`,n={name:t==null?void 0:t.name,text:t==null?void 0:t.text};return d("api/v1/preview",{action:"get",id:e,query:n,browserUrl:r})}async function Dt(e){const t=new Headers;t.append("content-type","text");const r=await fetch(e,{method:"GET",headers:t});C(r)}async function Se(){const e=new URLSearchParams({action:"get",noAutoAuthentication:"true"});return S("api/v1/principal",e)}const we=11;async function Ft(e,t,r){var l;const a=await d("api/v1/query",{query:e,$auditRecord:t,queryIntentData:r});a.aggregations.forEach(c=>{c.$hasMore=!1,!c.isDistribution&&!c.isTree&&c.items&&(c.$hasMore=c.items.length===we),c.isTree&&c.items&&F(c)}),(l=a.records)==null||l.map(c=>Object.assign(c,{value:c.title,type:"default"}));const s={...a,nextPage:a.page<Math.ceil(a.rowCount/a.pageSize)?a.page+1:void 0,previousPage:a.page>1?a.page-1:void 0};return Promise.resolve(s)}async function Nt(e,t,r){const{app:n=""}=f,a={methods:[],mode:t,propagateErrors:!0,$auditRecord:{auditEvents:[r]}};for(const c of e)a.methods.push({method:"query",app:n,query:c});const s=await d("api/v1/multi",a);s.results.forEach(c=>{c.aggregations.forEach(i=>{i.$hasMore=!1,!i.isDistribution&&!i.isTree&&i.items&&(i.$hasMore=i.items.length===we),i.isTree&&F(i)})}),s.results.forEach(c=>{var i;return(i=c.records)==null?void 0:i.map(u=>Object.assign(u,{value:u.title,type:"default"}))});const l=s.results.map(c=>({...c,nextPage:c.page<Math.ceil(c.rowCount/c.pageSize)?c.page+1:void 0,previousPage:c.page>1?c.page-1:void 0}));return Promise.resolve(l)}function F(e,t="",r=0){let n=[];return e.items&&e.items.forEach(a=>{let s=t?`${t}/${a.value}`:a.value,l=r+1;n.push({path:s,level:l}),a.$path=s,a.$level=l,a.hasChildren?n=n.concat(F(a,s,l)):a.hasChildren=!1}),n}async function Bt(e){const r=await d("api/v1/queryintent",{query:e});return r==null?void 0:r.intents}async function Qt({model:e,appName:t,query:r,article:n}){const{webservice:a,format:s,maxcount:l,exportedColumns:c,export:i}=e,u={app:t,webservice:a,query:r,type:i,format:s,maxcount:l,exportedColumns:c,$auditRecord:{auditEvents:[{type:"Search_ExportCSV",detail:{resultid:n?n.id:void 0}}]}};return O(u),await d("api/v1/search.queryexport",u,{responseType:"blob"})}async function qt(e,t,r){return(await d("api/v1/similardocuments",{sourceDocumentId:e,query:{name:t}},{signal:r})).data}async function Vt(e,t){var a;const n=await d("api/v1/query.links",{webservice:e,query:t});return(a=n==null?void 0:n.links)==null?void 0:a.map(s=>({...s,query:t}))}async function jt(e,t,r,n,a){const{app:s}=f,l={app:s||"",suggestQuery:e,text:t,filter:r,kinds:n,showSource:a};try{return(await d("api/v1/search.suggest",l)).suggests}catch(c){throw console.error("Error fetching suggestions:",c),c}}async function xt(e,t,r,n){const{app:a}=f;return(await d("api/v1/suggestquery",{app:a||"",suggestQuery:e,text:t,query:r,kinds:n})).suggests}async function Gt(e,t){if(!t)return Promise.resolve([]);const{app:r}=f;return(await d("api/v1/suggestfield",{app:r||"",text:e,action:"suggests",fields:t})).suggests}async function zt(e,t,r,n,a,s){return d("api/v1/doc.textchunks",{id:e,textChunks:t,highlights:r,query:n,leftSentencesCount:a,rightSentencesCount:s})}async function Ht(){const{app:e}=f,t=new URLSearchParams({app:e||"",action:"load"});return S("api/v1/usersettings",t)}async function ke(e,t){const r={action:"save",userSettings:e,$auditRecord:{auditEvents:[t]}};return O(r),d("api/v1/usersettings",r)}async function Jt(e,t){const n={action:"patch",userSettings:e,$auditRecord:t?{auditEvents:[t]}:void 0};return O(n),d("api/v1/usersettings",n)}async function Wt(){return ke({},{type:"UserSettings_Reset"})}async function Mt(){return await S("api/v2/version")}const be=async()=>{const{autoOAuthProvider:e}=f;if(typeof window>"u")return d("security.oauth",{action:"getcode",provider:e,tokenInCookie:!0,originalUrl:"http://localhost"});const t={action:"getcode",provider:e,tokenInCookie:!0,originalUrl:window.location.href};try{const r=await d("api/v1/security.oauth",t);return r.redirectUrl&&(window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with OAuth",r),r}},Ce=async()=>{const{autoSAMLProvider:e}=f;if(typeof window>"u")return d("security.saml",{action:"getresponse",provider:e,tokenInCookie:!0,originalUrl:"http://localhost"});const t={action:"getresponse",provider:e,tokenInCookie:!0,originalUrl:window.location.href};try{const r=await d("api/v1/security.saml",t);return r.redirectUrl&&(window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with SAML",r),r}},G={store:{},getItem(e){return this.store[e]??null},setItem(e,t){this.store[e]=t.toString()},removeItem(e){delete this.store[e]},clear(){this.store={}}},z=G;function Xt(e){return typeof window>"u"||!window.localStorage?G.getItem(e):window.localStorage.getItem(e)}function Yt(e){typeof window>"u"||!window.localStorage?G.removeItem(e):window.localStorage.removeItem(e)}function Kt(e){return typeof window>"u"||!window.sessionStorage?z.getItem(e):window.sessionStorage.getItem(e)}function Zt(e,t){typeof window>"u"||!window.sessionStorage?z.setItem(e,t):window.sessionStorage.setItem(e,t)}function Et(e){typeof window>"u"||!window.sessionStorage?z.removeItem(e):window.sessionStorage.removeItem(e)}const U=e=>Zt("sinequa-credentials",JSON.stringify({data:{csrfToken:e}})),ve=async()=>{try{const e=await S("api/v1/challenge?action=getCsrfToken&suppressErrors=true");return e!=null&&e.csrfToken?(U(e.csrfToken),e.csrfToken):null}catch(e){throw _("Failed to get CSRF token",e),e}};async function Re(e){if(e){const{username:t,password:r}=e,n={action:"get",tokenInCookie:!0,user:t,password:r,noUserOverride:!0,noAutoAuthentication:!0};try{const a=await d("api/v1/security.webtoken",n);return a!=null&&a.csrfToken?(U(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT",a),a}}else{const t={action:"get",tokenInCookie:!0,noUserOverride:!0,noAutoAuthentication:!1},{bearerToken:r}=f;if(!r)throw new Error("Bearer token is required in globalConfig for credentialless JWT retrieval.");const n=new Headers;n.append("Sinequa-Force-Camel-Case","true"),n.append("accept","application/json"),n.append("Content-Type","application/json"),n.append("Authorization",`Bearer ${r}`);try{const a=await d("api/v1/security.webtoken",t,{headers:n});return a.csrfToken?(U(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT without credentials",a),a}}}const N=()=>{var r;const e=Kt("sinequa-credentials");if(e)try{const a=(r=JSON.parse(e).data)==null?void 0:r.csrfToken;if(a!==void 0)return a}catch{}const t=Xt("csrfToken");return t!==null?t:null},Tt=async e=>{if(e)m("Attempting authentication using credentials"),w({useCredentials:!0,useSSO:!1});else{let c=null;try{m("Attempting to retrieve CSRF token from the backend"),c=await ve(),v("CSRF token retrieval result",c?"success":"failed")}catch(i){_("Failed to retrieve CSRF token",i)}try{if(c===null){const{autoOAuthProvider:i,autoSAMLProvider:u,useSAML:g}=f;if(i&&!g)return m("Initiating OAuth authentication flow"),await be(),P("OAuth authentication flow did not redirect as expected"),h(!1),!1;if(u)return m("Initiating SAML authentication flow"),await Ce(),P("SAML authentication flow did not redirect as expected"),h(!1),!1;m("No direct authentication method available, will try SSO then credentials"),w({useCredentials:!0,useSSO:!0})}else return m("User authenticated via existing token"),h(!0),!0}catch(i){throw _("Unexpected error during authentication",i),h(!1),i}}if(f.useCredentials&&f.useSSO)try{if(m("Checking if user is authenticated via SSO"),await Se())return m("User authenticated using SSO"),w({useCredentials:!1,useSSO:!0}),h(!0),!0}catch(c){if((c==null?void 0:c.status)===401)return m("SSO authentication failed with 401, falling back to credentials"),w({useCredentials:!0,useSSO:!1}),!1;throw _("SSO authentication failed with unexpected error",c),h(!1),_}const{useSSO:r}=f,n=N();if(n&&n!==null||r)return m("user already authenticated",n),w({isRedirectUrl:!1}),h(!0),!0;const{useCredentials:a}=f,{username:s,password:l}=e||{};if(a&&!s&&!l)return _("Credentials are required for authentication"),h(!1),!1;if(s&&l)try{return m("authentication using credentials..."),w({useCredentials:!0,useSSO:!1}),await Re({username:s,password:l}),h(!0),!0}catch(c){throw h(!1),c}return h(!1),_("No authentication method available. Please provide credentials or configure OAuth/SAML."),!1},Pe=async()=>{const e=new URLSearchParams({action:"deleteWebTokenCookie",noUserOverride:"true",noAutoAuthentication:"true"});return S("api/v1/challenge",e)},er=async()=>{const{useCredentials:e,userOverrideActive:t}=f;Yt("csrfToken"),Et("sinequa-credentials"),e&&!t?(await Pe()).methodresult==="ok"?h(!1):console.error("logout failed"):h(!1)},tr=()=>!!N();o.ApiError=b,o.Audit=mt,o.AuditEventType=k,o.DidYouMeanKind=E,o.EngineType=K,o.EngineTypeModifier=Z,o.LogLevel=q,o.MINIMUM_COMPATIBLE_SERVER_API_VERSION=De,o.RFMDisplay=T,o.ServerError=ee,o.TimeoutError=te,o.UnauthorizedError=Q,o.addAuditAdditionalInfo=O,o.addConcepts=Me,o.addSessionId=_e,o.addUrl=ge,o.aggItemRegex=ne,o.aggregationItemStrictCompare=qe,o.appInitializerFn=kt,o.bisect=je,o.buildPathsAndLevels=F,o.configureLogger=Ne,o.createHeaders=L,o.createTimeoutController=Fe,o.debug=v,o.del=ut,o.deleteUserSettings=Wt,o.deleteWebTokenCookie=Pe,o.emitAuthenticatedEvent=h,o.error=_,o.escapeExpr=Ie,o.fetchAggregation=St,o.fetchApp=wt,o.fetchAppPreLogin=me,o.fetchBulkQuery=Nt,o.fetchDataset=bt,o.fetchDatasetList=vt,o.fetchDatasets=Ct,o.fetchLabels=Rt,o.fetchPreview=At,o.fetchPreviewUrl=Dt,o.fetchPrincipal=Se,o.fetchQuery=Ft,o.fetchQueryExport=Qt,o.fetchQueryIntent=Bt,o.fetchSimilarDocuments=qt,o.fetchSponsoredLinks=Vt,o.fetchSuggest=jt,o.fetchSuggestField=Gt,o.fetchSuggestQuery=xt,o.fetchTextChunks=zt,o.fetchUserSettings=Ht,o.fetchVersion=Mt,o.get=S,o.getConcepts=Ke,o.getCsrfToken=ve,o.getFiltersFromURI=V,o.getFiltersFromUrl=tt,o.getHelpIndexUrl=ct,o.getIdFromUrl=nt,o.getJWToken=Re,o.getMetadata=Ue,o.getOffsetFromDates=de,o.getQueryPageFromUrl=at,o.getQueryParamsFromUrl=Te,o.getQueryTabFromUrl=ot,o.getQueryTextFromUrl=rt,o.getRelativeDate=Ze,o.getToken=N,o.getUrlParamsFromQueryParams=et,o.globalConfig=f,o.guid=Y,o.handleResponse=C,o.info=m,o.isArrayBuffer=W,o.isAuthenticated=tr,o.isBlob=M,o.isJsonable=$e,o.isNotInputEvent=Ee,o.isObject=y,o.isString=X,o.labels=It,o.login=Tt,o.logout=er,o.notify=it,o.openParentNodes=oe,o.parseText=p,o.parseValueAndOperatorFromItem=ae,o.patch=ft,o.patchUserSettings=Jt,o.post=d,o.put=lt,o.queryParamsFromUrl=R,o.removeConcept=Xe,o.removeConcepts=Ye,o.resolveToColumnName=pe,o.rewriteText=A,o.saveUserSettings=ke,o.setGlobalConfig=w,o.setToken=U,o.sha512=Ae,o.suggestionsToTreeAggregationNodes=Ve,o.sysLang=st,o.translateAggregationToDateOptions=Qe,o.tryOAuthAuthentication=be,o.trySAMLAuthentication=Ce,o.warn=P,o.withRetry=Be,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
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 hr=Object.defineProperty;var gr=(o,h,d)=>h in o?hr(o,h,{enumerable:!0,configurable:!0,writable:!0,value:d}):o[h]=d;var Ue=(o,h,d)=>gr(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 k(e){Object.assign(d,e)}function L(e){const t=x(),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}class R extends Error{constructor(r,n){super(r);Ue(this,"status");this.name="ApiError",this.status=n}}class V extends R{constructor(t="Server error"){super(t,500),this.name="ServerError"}}class E extends R{constructor(t="Request timed out"){super(t,408),this.name="TimeoutError"}}class D extends R{constructor(t="Unauthorized access"){super(t,401),this.name="UnauthorizedError"}}const T=/.*\:\(?([><=\d\-\.AND ]+)\)?/;function $e(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=ee(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 ee(e,t){const r=t,n=e.value.match(T);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 Ie(e,t,r){return e.valuesAreExpressions?t.display===r.display:t.value===r.value}function te(e){return e.items&&(e.items=e.items.map(t=>te(t))),e.items&&e.items.some(t=>t.$selected||t.$opened)&&(e.$opened=!0),e}function Ae(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);re(r,n,"/",c.display,+(c.frequency||0),1,((u==null?void 0:u.index)||0)+t.length)}})}return r}function re(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 m=i.replace(/^\/|\/$/g,"");u={value:n.substring(r.length,c),count:a,items:[],hasChildren:!1,$level:s,$opened:l>=i.length,$path:m},t.set(i,u),e.push(u)}i.length<n.length&&(u.hasChildren=!0,re(u.items,t,i,n,a,s+1,l))}function De(e,t){return e.reduce((r,n)=>(t(n)?r.true.push(n):r.false.push(n),r),{true:[],false:[]})}const Fe=/(([\+\-])?\(([^\)]+)\))|(([\+\-])?\[([^\]]+)\])|(([\+\-])?\"([^\"]+)\")|(([\+\-])?\/([^\/]+)\/)|(([\+\-])?(\S+))/g,Ne=2,ne=3,Be=5,ae=6,Qe=8,oe=9,qe=11,se=12,xe=14,ce=15;function $(e){if(!e)return[];const t=[],r=e.matchAll(Fe);for(let n of r)n[ne]?t.push({type:"group",value:n[ne],op:n[Ne]}):n[ae]?t.push({type:"adjacent",value:n[ae],op:n[Be]}):n[oe]?t.push({type:"exact",value:n[oe],op:n[Qe]}):n[se]?t.push({type:"regex",value:n[se],op:n[qe]}):n[ce]&&t.push({type:"token",value:n[ce],op:n[xe]});return t}function F(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=$(e);for(let a of t)n.push({type:"adjacent",value:a,op:r});return F(n)}function je(e,t){const r=$(t),n=r.findIndex(a=>a.value===e);return n!==-1?(r.splice(n,1),t=F(r)):t}function Ge(e){const t=$(e).filter(r=>r.type!=="adjacent");return F(t)}function ze(e){return $(e).filter(t=>t.type==="adjacent").map(t=>t.value)}function He(e,t,r){const n=new Intl.RelativeTimeFormat(e,{numeric:"auto"}),{offset:a,unit:s,isFuture:l}=ie(t,r);return n.format(a*(l?1:-1),s)}function ie(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 Je(e){const t=e.target;return t&&t.nodeName!=="INPUT"&&t.nodeName!=="TEXTAREA"}function Me(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 We(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 Xe(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 Ye(e){const{q:t=""}=P(e);return t}function Ke(e){const{id:t}=P(e);return decodeURIComponent(t)}function Ze(e){const{p:t="0"}=P(e);return parseInt(t,10)}function Ee(e){const{t}=P(e);return t}function Te(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=G(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 m=G(e,i.end+4,!0);return e.substring(m.start,m.end)}else i=G(e,i.end+4,!1);const u=e.substring(s.start,s.end);return u||e}function G(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 et(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 N(e){const t=new CustomEvent("notification",{bubbles:!0,cancelable:!1,detail:e});dispatchEvent(t)}const tt={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 B={level:1,enableConsoleOutput:!0};function rt(e){B={...B,...e}}function Q(e,t,r){if(e<B.level)return;const a=`${`[${z[e]}]`} ${t}`;if(B.enableConsoleOutput)switch(e){case 0:console.debug(a,r||"");break;case 1:console.info(a,r||"");break;case 2:console.warn(a,r||"");break;case 3:console.error(a,r||"");break}}function y(e,t){Q(0,e,t)}function v(e,t){Q(1,e,t)}function O(e,t){Q(2,e,t)}function g(e,t){Q(3,e,t)}async function p(e,t="json"){const r=e.headers.get("sinequa-jwt-refresh");if(r!==null&&A(r),e.status===200)switch(t){case"arraybuffer":return await e.arrayBuffer();case"blob":return await e.blob();case"text":return await e.text();default:return await e.json()}if(e.status===401){if(d.userOverrideActive)throw O("Unauthorized access attempt with user override",{endpoint:e.url}),new D("Unauthorized... User override failed.");return await H(e,401)}return e.status===500?(g("Server error occurred",{endpoint:e.url}),await H(e,500)):(O(`Unexpected response status: ${e.status}`,{endpoint:e.url}),await H(e,e.status))}async function H(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 t===401?new D:t===500?new V:new R(`Request failed with status ${t}`,t);const s=JSON.parse(new TextDecoder().decode(a));throw new Error(s.errorMessage||s.message||`Request failed with status ${t}`,{cause:{errorCode:s.errorCode,errorCodeTest:s.errorCodeTest}})}catch(n){throw n instanceof R?n:t===401?new D(n.message):t===500?new V(n.message):new R(n.message??`Request failed with status ${t}`,t)}}async function nt(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}`;y(`Making DELETE request to: ${l}`);try{const c=await fetch(l,{method:"DELETE",credentials:"include",headers:n});return p(c,r==null?void 0:r.responseType)}catch(c){throw g("Error making DELETE request:",c),c}}async function b(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}`;y(`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 p(c,r==null?void 0:r.responseType)}catch(c){throw g("Error making GET request:",c),c}}async function at(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}`;y(`Making PATCH request to: ${c}`);try{const i=await fetch(c,{method:"PATCH",headers:n,credentials:"include",body:JSON.stringify(l)});return p(i,r==null?void 0:r.responseType)}catch(i){throw g("Error making PATCH request:",i),i}}async function f(e,t,r){const n=L(r==null?void 0:r.headers),{app:a,backendUrl:s}=d;n.has("Content-Type")||n.set("Content-Type","application/json");const 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}`;y(`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 p(i,r==null?void 0:r.responseType)}catch(i){throw g("Error making POST request:",i),i}}async function ot(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}`;y(`Making PUT request to: ${c}`);try{const i=await fetch(c,{method:"PUT",headers:n,credentials:"include",body:JSON.stringify(l)});return p(i,r==null?void 0:r.responseType)}catch(i){throw g("Error making PUT request:",i),i}}function st(e){const t=new AbortController,{signal:r}=t;return e&&setTimeout(()=>{r.aborted||t.abort(new E(`Request timed out after ${e}ms`))},e),{controller:t,signal:r}}function J(e){if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function ct(e){const t=J(e);return!!t&&t.getTime()<=Date.now()}function it(e,t=7){const r=J(e);if(!r)return!1;const n=Date.now(),a=n+t*24*60*60*1e3,s=r.getTime();return s>n&&s<=a}async function lt(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 R&&s.status>=400&&s.status<500&&s.status!==429||s instanceof DOMException&&s.name==="AbortError")throw s;a<t&&(O(`Retrying request (${a+1}/${t})`,{error:s}),await new Promise(l=>setTimeout(l,r)))}throw n}function ut(e,t,r){var s,l,c,i;if(!e||!t)return;if(r){const u=Object.keys(t.queries).find(Z=>Z===(r==null?void 0:r.toLowerCase()));let m;u&&(m=t.queries[u]);const K=(l=((s=m==null?void 0:m.columnsInfo)==null?void 0:s.columns)||[])==null?void 0:l.find(Z=>{var Le,Oe;return(Oe=(Le=Z.aliases)==null?void 0:Le.split(","))==null?void 0:Oe.includes(e)});if(K)return K.name}const n=(i=(c=t.indexes)==null?void 0:c._)==null?void 0:i.columns,a=Object.entries(n).find(u=>{var m;return(m=u[1].aliases)==null?void 0:m.includes(e)});if(a)return a[0]}var C=(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))(C||{}),w=(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))(w||{}),S=(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))(S||{});const dt="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||{});function ft(e){if(!e)return w.none;switch(e.toLocaleLowerCase()){case"bool":case"boolean":return w.bool;case"date":return w.date;case"datetime":return w.dateTime;case"time":return w.time;case"unsigned":return w.unsigned;case"integer":return w.integer;case"float":return w.float;case"double":return w.double;case"dates":return w.dates;case"datetimes":return w.dateTimes;case"times":return w.times;case"varchar":return w.varchar;case"binary":return w.binary;case"string":return w.string;case"csv":return w.csv;default:return w.none}}function ht(e){switch(e){case"a":return S.a;case"c":return S.c;case"d":return S.d;case"e":return S.e;case"i":return S.i;case"l":return S.l;case"n":return S.n;case"t":return S.t;case"x":return S.x;case"z":return S.z;default:return S.none}}function gt(e){let t=S.none;if(e)for(const r of e)t|=ht(r);return t}function _(e,t,r,n){const a=ft(t),s=gt(r||"");return{name:e,type:t,typeModifier:r,eType:a,eTypeModifier:s,aliases:n}}const mt={id:_("id","string"),text:_("text","varchar"),documentlanguages:_("documentlanguages","csv","ci",["language"]),databasealias:_("databasealias","varchar"),globalrelevance:_("globalrelevance","double"),matchingpartnames:_("matchingpartnames","csv"),matchlocations:_("matchlocations","csv"),matchlocationsperpartname:_("matchlocationsperpartname","varchar"),extracts:_("extracts","csv"),extractsperpartname:_("extractsperpartname","varchar"),extractslocations:_("extractslocations","csv"),documentweight:_("documentweight","varchar"),groupcount:_("groupcount","integer"),accesslists:_("accesslists","varchar",void 0,["accessLists"])};function wt(e,t){let r=e[t];return r===void 0?[]:(typeof r=="string"&&(r=String(r).split(",")),Array.isArray(r)?r.map(n=>{if(typeof n=="string")return n.trim();if(typeof n=="object"&&n!==null&&"display"in n)return n.display.trim()}).filter(n=>n!==void 0):[String(r).trim()])}function _t(e,t){let r=e[t];if(r===void 0)return[];if(typeof r=="string"&&(r=String(r).split(",")),Array.isArray(r))return r.map(a=>{if(typeof a=="string")return{display:a.trim(),value:a.trim()};if(typeof a=="object"&&a!==null&&"display"in a){const s=a.display.trim(),l="value"in a?String(a.value).trim():s;return{display:s,value:l}}}).filter(a=>a!==void 0);const n=String(r).trim();return[{display:n,value:n}]}function I(e){return e!==null&&typeof e=="object"}function de(e){return I(e)&&Object.prototype.toString.call(e)==="[object ArrayBuffer]"}function fe(e){return I(e)&&Object.prototype.toString.call(e)==="[object Blob]"}function he(e){return typeof e=="string"}function St(e){return(I(e)||Array.isArray(e))&&!de(e)&&!fe(e)&&!he(e)}function ge(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 kt(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 vt(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(M(e)))}catch{return Promise.resolve(M(e))}return Promise.resolve(M(e))}function M(e){let n=2166136261;for(let m=0;m<e.length;m++)n^=e.charCodeAt(m),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)}let W,me;function U(e,t=!0){let r=bt(e.$auditRecord);r&&(we(r),t&&_e(r)),e.$auditRecord=r}function bt(e){if(!e)return;let t;if(Array.isArray(e))t=e;else if(I(e)){const r=e;if(r.auditEvents||r.mlAuditEvents)return r;t=[e]}return{auditEvents:t}}function we(e){var r;const t=Ct();return(r=e.auditEvents)==null||r.forEach(n=>{n.detail||(n.detail={}),n.detail.sessionid=t}),e}function _e(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 Ct(){return(!W||Rt())&&(W=ge()),me=new Date,W}function Rt(){return new Date().getTime()-me.getTime()>10*60*1e3}async function pt(e,t=!0){const r={event:C.None,$auditRecord:e};return U(r,t),f("api/v1/audit.notify",r)}const Pt={notify:pt};async function yt(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 l=await f("api/v1/query",s),c=await p(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 Lt(){const{app:e}=d,t=new URLSearchParams({app:e||""});return b("api/v1/app",t)}async function Se(){const{app:e}=d,t=new URLSearchParams({app:e||"",preLogin:"true"});return b("api/v1/app",t)}function Ot(){let{backendUrl:e,app:t,useCredentials:r}=d;if(typeof window<"u"){if(e||(e=window.location.origin),!t){const n=window.location.pathname.match(/\/app(?:-debug)?\/([^/#]+)/);n&&(t=n[1])}k({...d,backendUrl:e,app:t})}return r?(k({...d,useCredentials:!0,useSSO:!1,autoOAuthProvider:void 0,autoSAMLProvider:void 0,bearerToken:void 0,useSAML:void 0}),Promise.resolve({})):Se().then(n=>{const{autoOAuthProvider:a,autoSAMLProvider:s}=d,l=!a&&!n.autoOAuthProvider&&!s&&!n.autoSAMLProvider;return k({...d,autoOAuthProvider:a||n.autoOAuthProvider,autoSAMLProvider:s||n.autoSAMLProvider,useCredentials:l,useSSO:l}),n}).catch(n=>{throw g("atomic:fetchAppPreLogin error",n),n})}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 $t(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 It(e){return await b(`api/v1/search.dataset/${e}`)}async function At(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 g("Error in fetchLabels",n),n}}async function Dt(){try{const{app:e=""}=d,t=new URLSearchParams({app:e,action:"getUserRights"});return b("api/v1/labels",t)}catch(e){throw g("Error in getUserRights",e),e}}async function Ft(e,t,r=!0){try{const n={action:"add",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:C.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 g("Error in add",n),n}}async function Nt(e,t,r=!0){try{const n={action:"remove",labels:e,ids:t,public:r,$auditRecord:{auditEvents:[{type:C.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 g("Error in remove",n),n}}async function Bt(e,t,r=!0){try{const n={action:"rename",labels:e,newLabel:t,public:r,auditEvents:{type:C.Label_Rename,detail:{public:r,oldlabel:e?e.toString():null,label:t}}};return f("api/v1/labels",n)}catch(n){throw g("Error in rename",n),n}}async function Qt(e,t=!0){try{const r={action:"delete",labels:e,public:t,auditEvents:{type:C.Label_Delete,detail:{public:t,label:e?e.toString():null}}};return f("api/v1/labels",r)}catch(r){throw g("Error in deleteLabels",r),r}}async function qt(e,t,r=!0){try{const n={action:"bulkAdd",labels:e,query:t,public:r,auditEvents:{type:C.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 g("Error in bulkAdd",n),n}}async function xt(e,t,r=!0){try{const n={action:"bulkRemove",labels:e,query:t,public:r,auditEvents:{type:C.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 g("Error in bulkRemove",n),n}}const Vt={getUserRights:Dt,add:Ft,remove:Nt,rename:Bt,delete:Qt,bulkAdd:qt,bulkRemove:xt};async function jt(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 Gt(e){const t=new Headers;t.append("content-type","text");const r=await fetch(e,{method:"GET",headers:t});p(r)}async function ke(){const e=new URLSearchParams({action:"get",noAutoAuthentication:"true"});return b("api/v1/principal",e)}const ve=11;async function zt(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 Ht(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 Jt({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 Mt(e){const r=await f("api/v1/queryintent",{query:e});return r==null?void 0:r.intents}async function Wt(e,t,r){return(await f("api/v1/similardocuments",{sourceDocumentId:e,query:{name:t}},{signal:r})).data}async function Xt(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 Yt(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 Kt(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 Zt(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 Et(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 Tt(){const{app:e}=d,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 er(e,t){const n={action:"patch",userSettings:e,$auditRecord:t?{auditEvents:[t]}:void 0};return U(n),f("api/v1/usersettings",n)}async function tr(){return be({},{type:"UserSettings_Reset"})}async function rr(e,t){return f("api/v2/security/password/change",{newPassword:e,currentPassword:t})}async function nr(e){const t="api/v2/security/password/ask-reset-email",n={changePasswordRedirectUrl:`${window.location.origin}/login?mode=changepassword`,userName:e};return f(t,n)}async function ar(){return await b("api/v2/version")}const Ce=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&&(window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with OAuth",r),r}},Re=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&&(window.location.href=r.redirectUrl),r}catch(r){throw console.error("Failed to authenticate with SAML",r),r}},X={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={}}},Y=X;function or(e){return typeof window>"u"||!window.localStorage?X.getItem(e):window.localStorage.getItem(e)}function sr(e){typeof window>"u"||!window.localStorage?X.removeItem(e):window.localStorage.removeItem(e)}function cr(e){return typeof window>"u"||!window.sessionStorage?Y.getItem(e):window.sessionStorage.getItem(e)}function ir(e,t){typeof window>"u"||!window.sessionStorage?Y.setItem(e,t):window.sessionStorage.setItem(e,t)}function lr(e){typeof window>"u"||!window.sessionStorage?Y.removeItem(e):window.sessionStorage.removeItem(e)}const A=e=>ir("sinequa-credentials",JSON.stringify({data:{csrfToken:e}})),pe=async()=>{try{const e=await b("api/v1/challenge?action=getCsrfToken&suppressErrors=true");return e!=null&&e.csrfToken?(A(e.csrfToken),e.csrfToken):null}catch(e){throw g("Failed to get CSRF token",e),e}};async function Pe(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(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(a.csrfToken),a.csrfToken):null}catch(a){throw console.error("Failed to get JWT without credentials",a),a}}}const x=()=>{var r;const e=cr("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=or("csrfToken");return t!==null?t:null},ur=async e=>{if(e)v("Attempting authentication using credentials"),k({useCredentials:!0,useSSO:!1});else{let c=null;try{v("Attempting to retrieve CSRF token from the backend"),c=await pe(),y("CSRF token retrieval result",c?"success":"failed")}catch(i){g("Failed to retrieve CSRF token",i)}try{if(c===null){const{autoOAuthProvider:i,autoSAMLProvider:u,useSAML:m}=d;if(i&&!m)return v("Initiating OAuth authentication flow"),await Ce(),O("OAuth authentication flow did not redirect as expected"),h(!1),!1;if(u)return v("Initiating SAML authentication flow"),await Re(),O("SAML authentication flow did not redirect as expected"),h(!1),!1;v("No direct authentication method available, will try SSO then credentials"),k({useCredentials:!0,useSSO:!0})}else return v("User authenticated via existing token"),h(!0),!0}catch(i){throw g("Unexpected error during authentication",i),h(!1),i}}if(d.useCredentials&&d.useSSO)try{if(v("Checking if user is authenticated via SSO"),await ke())return v("User authenticated using SSO"),k({useCredentials:!1,useSSO:!0}),h(!0),!0}catch(c){if((c==null?void 0:c.status)===401)return v("SSO authentication failed with 401, falling back to credentials"),k({useCredentials:!0,useSSO:!1}),!1;throw g("SSO authentication failed with unexpected error",c),h(!1),g}const{useSSO:r}=d,n=x();if(n&&n!==null||r)return v("user already authenticated",n),k({isRedirectUrl:!1}),h(!0),!0;const{useCredentials:a}=d,{username:s,password:l}=e||{};if(a&&!s&&!l)return g("Credentials are required for authentication"),h(!1),!1;if(s&&l)try{v("authentication using credentials..."),k({useCredentials:!0,useSSO:!1});const{userOverrideActive:c,useroverride:i}=d;return k({userOverrideActive:!1,useroverride:void 0}),await Pe({username:s,password:l}),k({userOverrideActive:c,useroverride:i}),h(!0),!0}catch(c){throw h(!1),c}return h(!1),g("No authentication method available. Please provide credentials or configure OAuth/SAML."),!1},ye=async()=>{const e=new URLSearchParams({action:"deleteWebTokenCookie",noUserOverride:"true",noAutoAuthentication:"true"});return b("api/v1/challenge",e)},dr=async()=>{const{useCredentials:e,userOverrideActive:t}=d;sr("csrfToken"),lr("sinequa-credentials"),e&&!t?(await ye()).methodresult==="ok"?h(!1):console.error("logout failed"):h(!1)},fr=()=>!!x();o.ApiError=R,o.Audit=Pt,o.AuditEventType=C,o.DidYouMeanKind=le,o.EngineType=w,o.EngineTypeModifier=S,o.LogLevel=z,o.MINIMUM_COMPATIBLE_SERVER_API_VERSION=dt,o.RFMDisplay=ue,o.ServerError=V,o.TimeoutError=E,o.UnauthorizedError=D,o.addAuditAdditionalInfo=U,o.addConcepts=Ve,o.addSessionId=we,o.addUrl=_e,o.aggItemRegex=T,o.aggregationItemStrictCompare=Ie,o.appInitializerFn=Ot,o.bisect=De,o.buildPathsAndLevels=q,o.configureLogger=rt,o.createHeaders=L,o.createTimeoutController=st,o.debug=y,o.del=nt,o.deleteUserSettings=tr,o.deleteWebTokenCookie=ye,o.emitAuthenticatedEvent=h,o.error=g,o.escapeExpr=kt,o.expiresSoon=it,o.extraColumns=mt,o.fetchAggregation=yt,o.fetchApp=Lt,o.fetchAppPreLogin=Se,o.fetchBulkQuery=Ht,o.fetchChangePassword=rr,o.fetchDataset=Ut,o.fetchDatasetList=It,o.fetchDatasets=$t,o.fetchLabels=At,o.fetchPreview=jt,o.fetchPreviewUrl=Gt,o.fetchPrincipal=ke,o.fetchQuery=zt,o.fetchQueryExport=Jt,o.fetchQueryIntent=Mt,o.fetchSendPasswordResetEmail=nr,o.fetchSimilarDocuments=Wt,o.fetchSponsoredLinks=Xt,o.fetchSuggest=Yt,o.fetchSuggestField=Zt,o.fetchSuggestQuery=Kt,o.fetchTextChunks=Et,o.fetchUserSettings=Tt,o.fetchVersion=ar,o.get=b,o.getConcepts=ze,o.getCsrfToken=pe,o.getFiltersFromURI=j,o.getFiltersFromUrl=Xe,o.getHelpIndexUrl=et,o.getIdFromUrl=Ke,o.getJWToken=Pe,o.getMetadata=wt,o.getMetadataWithValues=_t,o.getOffsetFromDates=ie,o.getQueryPageFromUrl=Ze,o.getQueryParamsFromUrl=Me,o.getQueryTabFromUrl=Ee,o.getQueryTextFromUrl=Ye,o.getRelativeDate=He,o.getToken=x,o.getUrlParamsFromQueryParams=We,o.globalConfig=d,o.guid=ge,o.handleResponse=p,o.info=v,o.isArrayBuffer=de,o.isAuthenticated=fr,o.isBlob=fe,o.isExpired=ct,o.isJsonable=St,o.isNotInputEvent=Je,o.isObject=I,o.isString=he,o.labels=Vt,o.login=ur,o.logout=dr,o.makeColumn=_,o.notify=tt,o.openParentNodes=te,o.parseText=$,o.parseValueAndOperatorFromItem=ee,o.patch=at,o.patchUserSettings=er,o.post=f,o.put=ot,o.queryParamsFromUrl=P,o.removeConcept=je,o.removeConcepts=Ge,o.resolveToColumnName=ut,o.rewriteText=F,o.saveUserSettings=be,o.setGlobalConfig=k,o.setToken=A,o.sha512=vt,o.suggestionsToTreeAggregationNodes=Ae,o.sysLang=Te,o.toDate=J,o.translateAggregationToDateOptions=$e,o.tryOAuthAuthentication=Ce,o.trySAMLAuthentication=Re,o.warn=O,o.withRetry=lt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/login.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/login.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,CAwItE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CCColumn, EngineType, EngineTypeModifier } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a column configuration object with both user-facing and engine-specific type information.
|
|
4
|
+
*
|
|
5
|
+
* @param name - The name of the column
|
|
6
|
+
* @param type - The user-facing type of the column
|
|
7
|
+
* @param typeModifier - Optional modifier for the column type (e.g., length, precision)
|
|
8
|
+
* @param aliases - Optional array of alternative names for the column
|
|
9
|
+
* @returns A column configuration object containing the original parameters plus converted engine types
|
|
10
|
+
*/
|
|
11
|
+
export declare function makeColumn(name: string, type: string, typeModifier?: string, aliases?: string[]): {
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
typeModifier: string | undefined;
|
|
15
|
+
eType: EngineType;
|
|
16
|
+
eTypeModifier: EngineTypeModifier;
|
|
17
|
+
aliases: string[] | undefined;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A collection of additional column definitions used for data processing.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* This record maps column identifiers to their respective {@link CCColumn} configurations,
|
|
24
|
+
* defining the data type, format, and any associated aliases for each column.
|
|
25
|
+
*/
|
|
26
|
+
export declare const extraColumns: Record<string, CCColumn>;
|
|
27
|
+
//# sourceMappingURL=columns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/helpers/columns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgFpE;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EAAE;;;;;;;EAYnB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAejD,CAAC"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./column-resolver";
|
|
2
|
+
export * from "./columns";
|
|
3
|
+
export * from "./metadata";
|
|
4
|
+
export * from "./ts-helper";
|
|
5
|
+
export * from "./utils";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -19,10 +19,42 @@ import { KeyOf } from "./ts-helper";
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* getMetadata({ tags: ['foo', 'bar'] }, 'tags'); // ['foo', 'bar']
|
|
22
|
+
* getMetadata({ tags: 'foo,bar' }, 'tags'); // ['foo', 'bar']
|
|
22
23
|
* getMetadata({ authors: [{ display: 'Alice' }, { display: 'Bob' }] }, 'authors'); // ['Alice', 'Bob']
|
|
23
24
|
* getMetadata({ title: 'Hello World' }, 'title'); // ['Hello World']
|
|
24
25
|
* getMetadata({ year: 2024 }, 'year'); // ['2024']
|
|
25
26
|
* getMetadata({}, 'nonexistent'); // []
|
|
26
27
|
*/
|
|
27
28
|
export declare function getMetadata(article: Partial<Article & Record<string, unknown>>, metadata: KeyOf<Article & Record<string, unknown>>): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves metadata values from an article object for a given metadata key as display-value pairs.
|
|
31
|
+
*
|
|
32
|
+
* This function handles metadata values that can be:
|
|
33
|
+
* - An array of strings
|
|
34
|
+
* - An array of objects with a `display` property (and optionally a `value` property)
|
|
35
|
+
* - A single string or number
|
|
36
|
+
*
|
|
37
|
+
* If the metadata value is undefined, it returns an empty array.
|
|
38
|
+
* If the metadata value is an array, it maps each item to an object with `display` and `value` properties.
|
|
39
|
+
* For objects with a `value` property, it uses that; otherwise, it uses the `display` value as both.
|
|
40
|
+
* If the metadata value is a single value, it converts it to a string and returns it as both display and value.
|
|
41
|
+
*
|
|
42
|
+
* @param article - The article object containing metadata, possibly partial and with additional properties.
|
|
43
|
+
* @param metadata - The key of the metadata to retrieve from the article.
|
|
44
|
+
* @returns An array of objects with `display` and `value` string properties.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* getMetadataWithValues({ tags: ['foo', 'bar'] }, 'tags');
|
|
48
|
+
* // [{ display: 'foo', value: 'foo' }, { display: 'bar', value: 'bar' }]
|
|
49
|
+
*
|
|
50
|
+
* getMetadataWithValues({ authors: [{ display: 'Alice', value: 'alice123' }] }, 'authors');
|
|
51
|
+
* // [{ display: 'Alice', value: 'alice123' }]
|
|
52
|
+
*
|
|
53
|
+
* getMetadataWithValues({ title: 'Hello World' }, 'title');
|
|
54
|
+
* // [{ display: 'Hello World', value: 'Hello World' }]
|
|
55
|
+
*/
|
|
56
|
+
export declare function getMetadataWithValues(article: Partial<Article & Record<string, unknown>>, metadata: KeyOf<Article & Record<string, unknown>>): {
|
|
57
|
+
display: string;
|
|
58
|
+
value: string;
|
|
59
|
+
}[];
|
|
28
60
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/helpers/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/helpers/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACnD,QAAQ,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACjD,MAAM,EAAE,CA6BV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACnD,QAAQ,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACjD;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAyCtC"}
|
|
@@ -24,6 +24,10 @@ export type AggregationItem = {
|
|
|
24
24
|
* A client-side field that indicates whether this item is currently selected
|
|
25
25
|
*/
|
|
26
26
|
$selected?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A client-side field that indicates whether this item is visually selected (checked in the DOM but not sent in the query filters)
|
|
29
|
+
*/
|
|
30
|
+
$selectedVisually?: boolean;
|
|
27
31
|
$cached?: boolean;
|
|
28
32
|
};
|
|
29
33
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregationItem.d.ts","sourceRoot":"","sources":["../../../src/types/aggregations/AggregationItem.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,QAAA,MAAM,mBAAmB,6DAAmE,CAAA;AAE5F,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAA"}
|
|
1
|
+
{"version":3,"file":"AggregationItem.d.ts","sourceRoot":"","sources":["../../../src/types/aggregations/AggregationItem.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,QAAA,MAAM,mBAAmB,6DAAmE,CAAA;AAE5F,MAAM,MAAM,eAAe,GAAG;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,OAAO,mBAAmB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5E;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAA"}
|
|
@@ -25,7 +25,9 @@ export type CCApp = CCConfig & {
|
|
|
25
25
|
/**
|
|
26
26
|
* Defines the indexes configured on the application
|
|
27
27
|
*/
|
|
28
|
-
indexes:
|
|
28
|
+
indexes: {
|
|
29
|
+
_: CCIndex;
|
|
30
|
+
} & Record<string, CCIndex>;
|
|
29
31
|
/**
|
|
30
32
|
* Defines the lists configured on the application
|
|
31
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CCApp.d.ts","sourceRoot":"","sources":["../../../src/types/config/CCApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"CCApp.d.ts","sourceRoot":"","sources":["../../../src/types/config/CCApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG;IAC7B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5B;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,WAAW,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B,CAAC,CAAC;IACH;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Principal.d.ts","sourceRoot":"","sources":["../../../src/types/principal/Principal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,SAAS,GAAG;
|
|
1
|
+
{"version":3,"file":"Principal.d.ts","sourceRoot":"","sources":["../../../src/types/principal/Principal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -2,12 +2,17 @@ export type NotificationsEventOptions = {
|
|
|
2
2
|
duration?: number;
|
|
3
3
|
description?: string;
|
|
4
4
|
closeButton?: boolean;
|
|
5
|
+
action?: NotificationAction;
|
|
5
6
|
};
|
|
6
7
|
export type NotificationEvent = {
|
|
7
|
-
type:
|
|
8
|
+
type: "success" | "info" | "warning" | "error";
|
|
8
9
|
message: string;
|
|
9
10
|
options?: NotificationsEventOptions;
|
|
10
11
|
};
|
|
12
|
+
export type NotificationAction = {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
};
|
|
11
16
|
export declare const notify: {
|
|
12
17
|
success: (message: string, options?: NotificationsEventOptions) => void;
|
|
13
18
|
info: (message: string, options?: NotificationsEventOptions) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/utils/notification.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/utils/notification.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAWF,eAAO,MAAM,MAAM;uBACE,MAAM,YAAY,yBAAyB;oBAQ9C,MAAM,YAAY,yBAAyB;uBAQxC,MAAM,YAAY,yBAAyB;qBAQ7C,MAAM,YAAY,yBAAyB;CAO7D,CAAC"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @param responseType - The type of response expected ('arraybuffer', 'blob', 'json', or 'text')
|
|
6
6
|
* @returns A promise that resolves to the response data of type T.
|
|
7
7
|
*/
|
|
8
|
-
export declare function handleResponse<T>(response: Response, responseType?:
|
|
8
|
+
export declare function handleResponse<T>(response: Response, responseType?: "arraybuffer" | "blob" | "json" | "text"): Promise<T>;
|
|
9
9
|
//# sourceMappingURL=handle-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-response.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/handle-response.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"handle-response.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/handle-response.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,QAAQ,EAAE,QAAQ,EAClB,YAAY,GAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAe,GAC9D,OAAO,CAAC,CAAC,CAAC,CAwCZ"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
export * from "./create-headers";
|
|
1
2
|
export * from "./errors/api-error";
|
|
2
|
-
export * from "./errors/unauthorized-error";
|
|
3
3
|
export * from "./errors/server-error";
|
|
4
4
|
export * from "./errors/timeout-error";
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./utils/create-timeout-controller";
|
|
7
|
-
export * from "./utils/with-retry";
|
|
8
|
-
export * from "./create-headers";
|
|
5
|
+
export * from "./errors/unauthorized-error";
|
|
9
6
|
export * from "./handle-response";
|
|
10
|
-
export * from "./methods/post";
|
|
11
|
-
export * from "./methods/get";
|
|
12
|
-
export * from "./methods/put";
|
|
13
7
|
export * from "./methods/del";
|
|
8
|
+
export * from "./methods/get";
|
|
14
9
|
export * from "./methods/patch";
|
|
10
|
+
export * from "./methods/post";
|
|
11
|
+
export * from "./methods/put";
|
|
12
|
+
export * from "./request-options";
|
|
13
|
+
export * from "./utils/create-timeout-controller";
|
|
14
|
+
export * from "./utils/date-utils.";
|
|
15
|
+
export * from "./utils/with-retry";
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web-api/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/post.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;;GAUG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/methods/post.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD;;;;;;;;;;GAUG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAC1B,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACxD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,CAAC,CAAC,CAsCZ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralizes date handling for web-api helpers:
|
|
3
|
+
* - parse/normalize backend date values into a consistent Date (`toDate`)
|
|
4
|
+
* - simple comparisons for expiry / validity (`isExpired`, `expiresSoon`)
|
|
5
|
+
* The goal is to keep behaviour consistent (parsing, timezone, now vs future)
|
|
6
|
+
* and avoid duplicating this logic across callers.
|
|
7
|
+
*/
|
|
8
|
+
/** Safely parses an ISO date string to a Date. */
|
|
9
|
+
export declare function toDate(iso?: string): Date | undefined;
|
|
10
|
+
/** Returns true if the given ISO date is in the past (or now). */
|
|
11
|
+
export declare function isExpired(iso?: string): boolean;
|
|
12
|
+
/** Returns true if the given ISO date is within the next N days. */
|
|
13
|
+
export declare function expiresSoon(iso?: string, days?: number): boolean;
|
|
14
|
+
//# sourceMappingURL=date-utils..d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-utils..d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/utils/date-utils..ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,kDAAkD;AAClD,wBAAgB,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAKrD;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAG/C;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,OAAO,CAS3D"}
|
package/dist/web-api/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./helpers";
|
|
1
2
|
export * from "./v1/fetch-aggregation";
|
|
2
3
|
export * from "./v1/fetch-app";
|
|
3
4
|
export * from "./v1/fetch-audit";
|
|
@@ -6,13 +7,14 @@ export * from "./v1/fetch-labels";
|
|
|
6
7
|
export * from "./v1/fetch-preview";
|
|
7
8
|
export * from "./v1/fetch-principal";
|
|
8
9
|
export * from "./v1/fetch-query";
|
|
9
|
-
export * from "./v1/fetch-query-intent";
|
|
10
10
|
export * from "./v1/fetch-query-export";
|
|
11
|
+
export * from "./v1/fetch-query-intent";
|
|
11
12
|
export * from "./v1/fetch-similar-documents";
|
|
12
13
|
export * from "./v1/fetch-sponsored-links";
|
|
13
14
|
export * from "./v1/fetch-suggest";
|
|
14
15
|
export * from "./v1/fetch-text-chunk";
|
|
15
16
|
export * from "./v1/fetch-user-settings";
|
|
16
|
-
export * from "./
|
|
17
|
+
export * from "./v2/fetch-change-password";
|
|
18
|
+
export * from "./v2/fetch-forgot-password";
|
|
17
19
|
export * from "./v2/fetch-version";
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web-api/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web-api/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-app.d.ts","sourceRoot":"","sources":["../../../src/web-api/v1/fetch-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIxD;;;GAGG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,CAK/C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"fetch-app.d.ts","sourceRoot":"","sources":["../../../src/web-api/v1/fetch-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIxD;;;GAGG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,CAK/C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CAQ/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CA0EzD"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ChangePasswordResponse = {
|
|
2
2
|
success: boolean;
|
|
3
|
-
|
|
3
|
+
message?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Calls the V2 API to change the current user's password.
|
|
7
|
+
*
|
|
8
|
+
* @param newPassword - The new password to set.
|
|
9
|
+
* @param currentPassword - The current password, if required by the backend.
|
|
10
|
+
* @throws UnauthorizedError When the backend returns 401 (invalid current password / unauthorized).
|
|
11
|
+
* @throws ApiError For any other HTTP or transport error.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchChangePassword(newPassword: string, currentPassword?: string): Promise<ChangePasswordResponse>;
|
|
4
14
|
//# sourceMappingURL=fetch-change-password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-change-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-change-password.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch-change-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-change-password.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,sBAAsB,CAAC,CAMjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type PasswordResetEmailResponse = {
|
|
2
|
+
email?: string;
|
|
3
|
+
passwordResetTokenExpiry?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Calls the V2 API to send a password reset email for the given user.
|
|
7
|
+
*
|
|
8
|
+
* @param userName - The username for which the reset email should be sent.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fetchSendPasswordResetEmail(userName: string): Promise<PasswordResetEmailResponse>;
|
|
11
|
+
//# sourceMappingURL=fetch-forgot-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-forgot-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-forgot-password.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,0BAA0B,CAAC,CAWrC"}
|