@sinequa/atomic 2.0.1 → 2.0.4

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.
Files changed (30) hide show
  1. package/README.md +38 -3
  2. package/dist/atomic.cjs +1 -0
  3. package/dist/atomic.js +2 -1927
  4. package/dist/authentication/index.d.ts +1 -1
  5. package/dist/authentication/index.d.ts.map +1 -1
  6. package/dist/authentication/session/index.d.ts +1 -0
  7. package/dist/authentication/session/index.d.ts.map +1 -1
  8. package/dist/authentication/session/login.d.ts.map +1 -1
  9. package/dist/authentication/session/try-auto-authentication.d.ts +19 -0
  10. package/dist/authentication/session/try-auto-authentication.d.ts.map +1 -0
  11. package/dist/authentication/tokens/get-csrf-token.d.ts +12 -6
  12. package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
  13. package/dist/spfx/index.cjs +1 -0
  14. package/dist/spfx/index.d.ts +3 -0
  15. package/dist/spfx/index.d.ts.map +1 -0
  16. package/dist/spfx/index.js +2 -0
  17. package/dist/src-BW4JX9K-.js +1814 -0
  18. package/dist/src-U6mXZKpZ.cjs +1 -0
  19. package/dist/web-api/helpers/aad-http-client-manager.d.ts +53 -0
  20. package/dist/web-api/helpers/aad-http-client-manager.d.ts.map +1 -0
  21. package/dist/web-api/helpers/handle-response.d.ts +5 -2
  22. package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
  23. package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
  24. package/dist/web-api/helpers/methods/get.d.ts +4 -0
  25. package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
  26. package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
  27. package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
  28. package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
  29. package/package.json +17 -4
  30. package/dist/atomic.umd.cjs +0 -1
@@ -1,5 +1,5 @@
1
1
  export { emitAuthenticatedEvent } from "./events";
2
2
  export { tryOAuthAuthentication, trySAMLAuthentication } from "./providers";
3
- export { clearSessionTokens, detectAuthMode, isAuthenticated, login, logout, } from "./session";
3
+ export { clearSessionTokens, detectAuthMode, isAuthenticated, login, logout, tryAutoAuthentication, } from "./session";
4
4
  export { deleteWebTokenCookie, getCsrfToken, getJWToken, getToken, setToken, } from "./tokens";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,KAAK,EACL,MAAM,GACP,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authentication/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,KAAK,EACL,MAAM,EACN,qBAAqB,GACtB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,GACT,MAAM,UAAU,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export { detectAuthMode } from "./detect-auth-mode";
2
2
  export { login } from "./login";
3
3
  export { clearSessionTokens, logout } from "./logout";
4
+ export { tryAutoAuthentication } from "./try-auto-authentication";
4
5
  export { isAuthenticated } from "./user-authentication";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAU/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,CA4EtE,CAAC"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,CAoGtE,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Probes the server for **auto-authentication** (e.g. OIDC) before falling back to the credentials
3
+ * form.
4
+ *
5
+ * Unlike {@link getCsrfToken} — which calls the challenge endpoint with `suppressErrors=true` and
6
+ * therefore never triggers the server-side auth challenge — and unlike {@link fetchPrincipal} — which
7
+ * sends `noAutoAuthentication=true` to explicitly disable it — this probe hits a protected endpoint
8
+ * **allowing the server to auto-authenticate**. When the user already has a valid IdP session, the
9
+ * server completes the handshake and answers `200`; otherwise it answers `401` (or redirects to the
10
+ * IdP, which we do not follow — see `redirect: "manual"` below).
11
+ *
12
+ * A successful `200` also carries the `sinequa-jwt-refresh` header, which `handleResponse` feeds into
13
+ * `setToken`, so the session becomes usable immediately.
14
+ *
15
+ * @returns `true` when the server auto-authenticated the user (`200`), `false` otherwise (401,
16
+ * redirect, timeout or any network error). Never throws.
17
+ */
18
+ export declare const tryAutoAuthentication: () => Promise<boolean>;
19
+ //# sourceMappingURL=try-auto-authentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"try-auto-authentication.d.ts","sourceRoot":"","sources":["../../../src/authentication/session/try-auto-authentication.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC,OAAO,CAgB7D,CAAC"}
@@ -1,10 +1,16 @@
1
1
  /**
2
2
  * Retrieves the CSRF token from the backend server.
3
- * If the token is successfully retrieved, it is stored in the session storage.
4
- * @returns The CSRF token string if successfully retrieved.
5
- * @throws An error if the request to the backend fails, or if the response
6
- * succeeds (HTTP 200) but contains no CSRF token, which is treated as a
7
- * masked server-side error rather than a valid empty result.
3
+ *
4
+ * The endpoint is called with `suppressErrors=true`, so the server answers `200` **without a token**
5
+ * when there is no session (instead of an error status, and without running the auth challenge). A
6
+ * missing token is therefore an **expected** "not authenticated / no CSRF token needed" signal — e.g.
7
+ * a proxy SSO that authenticates via cookie — and is reported by returning `null`, not by throwing.
8
+ *
9
+ * A genuine request failure (network / timeout / HTTP) is a different matter — an exceptional
10
+ * condition the caller may want to react to — so it is logged at `warn` and **rethrown**.
11
+ *
12
+ * @returns The CSRF token string, or `null` when the server returns a `200` with no token.
13
+ * @throws The underlying error on a genuine network / timeout / HTTP failure.
8
14
  */
9
- export declare const getCsrfToken: () => Promise<string>;
15
+ export declare const getCsrfToken: () => Promise<string | null>;
10
16
  //# sourceMappingURL=get-csrf-token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-csrf-token.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/get-csrf-token.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,uBAiBxB,CAAC"}
1
+ {"version":3,"file":"get-csrf-token.d.ts","sourceRoot":"","sources":["../../../src/authentication/tokens/get-csrf-token.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,MAAM,GAAG,IAAI,CAsB1D,CAAC"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../src-U6mXZKpZ.cjs");exports.API=e.F,exports.ApiError=e.Vt,exports.Audit=e.$,exports.AuditEventType=e.Ct,exports.AuthMode=e.Tn,exports.DidYouMeanKind=e.yt,exports.EngineType=e.St,exports.EngineTypeModifier=e.xt,exports.LogLevel=e.Ut,exports.MINIMUM_COMPATIBLE_SERVER_API_VERSION=e.bt,exports.RFMDisplay=e.vt,exports.ServerError=e.Bt,exports.TimeoutError=e.zt,exports.UnauthorizedError=e.Rt,exports.aadHttpClientManager=e.Ft,exports.addAuditAdditionalInfo=e.et,exports.addConcepts=e.un,exports.addSessionId=e.tt,exports.addUrl=e.nt,exports.aggItemRegex=e._n,exports.aggregationItemStrictCompare=e.vn,exports.appInitializerFn=e.q,exports.bisect=e.gn,exports.buildPathsAndLevels=e.M,exports.clearSessionTokens=e.n,exports.configureLogger=e.Wt,exports.createHeaders=e.Ht,exports.createTimeoutController=e.kt,exports.createUserProfile=e.m,exports.debug=e.Gt,exports.del=e.Pt,exports.deleteUserProfileProperty=e.h,exports.deleteUserSettings=e.b,exports.deleteWebTokenCookie=e.i,exports.detectAuthMode=e.Z,exports.emitAuthenticatedEvent=e.Dn,exports.error=e.Kt,exports.escapeExpr=e.rt,exports.expiresSoon=e.Et,exports.extraColumns=e.gt,exports.fetchAggregation=e.Q,exports.fetchApp=e.J,exports.fetchAppPreLogin=e.Y,exports.fetchBulkQuery=e.N,exports.fetchChangePassword=e.y,exports.fetchDataset=e.W,exports.fetchDatasetList=e.G,exports.fetchDatasets=e.K,exports.fetchLabels=e.H,exports.fetchPreview=e.B,exports.fetchPreviewUrl=e.V,exports.fetchPrincipal=e.I,exports.fetchPrincipalList=e.L,exports.fetchPrincipalUserid=e.R,exports.fetchPrincipalUserids=e.z,exports.fetchQuery=e.P,exports.fetchQueryExport=e.j,exports.fetchQueryIntent=e.A,exports.fetchSendPasswordResetEmail=e.v,exports.fetchSimilarDocuments=e.k,exports.fetchSponsoredLinks=e.O,exports.fetchSuggest=e.T,exports.fetchSuggestField=e.E,exports.fetchSuggestQuery=e.D,exports.fetchTextChunks=e.w,exports.fetchUserProfile=e.g,exports.fetchUserSettings=e.x,exports.fetchVersion=e.p,exports.filter=e.ht,exports.get=e.Nt,exports.getConcepts=e.dn,exports.getCsrfToken=e.l,exports.getFiltersFromURI=e.Qt,exports.getFiltersFromUrl=e.$t,exports.getHelpIndexUrl=e.Xt,exports.getIdFromUrl=e.en,exports.getJWToken=e.c,exports.getMetadata=e.pt,exports.getMetadataWithValues=e.mt,exports.getOffsetFromDates=e.cn,exports.getQueryPageFromUrl=e.tn,exports.getQueryParamsFromUrl=e.nn,exports.getQueryTabFromUrl=e.rn,exports.getQueryTextFromUrl=e.in,exports.getRelativeDate=e.ln,exports.getTime=e.it,exports.getToken=e.s,exports.getUrlParamsFromQueryParams=e.an,exports.globalConfig=e.Cn,exports.guid=e.at,exports.handleResponse=e.Lt,exports.info=e.qt,exports.initializeAadHttpClient=e.It,exports.initializeAppConfig=e.X,exports.isArrayBuffer=e.ot,exports.isAuthenticated=e.t,exports.isBlob=e.st,exports.isDate=e.ct,exports.isExpired=e.Dt,exports.isJsonable=e.lt,exports.isNotInputEvent=e.sn,exports.isObject=e.ut,exports.isString=e.dt,exports.labels=e.U,exports.legacyBooleansToAuthMode=e.En,exports.login=e.a,exports.logout=e.r,exports.makeColumn=e._t,exports.notify=e.Yt,exports.openParentNodes=e.yn,exports.parseText=e.fn,exports.parseValueAndOperatorFromItem=e.bn,exports.patch=e.Mt,exports.patchUserProfile=e._,exports.patchUserSettings=e.S,exports.post=e.jt,exports.put=e.At,exports.queryParamsFromUrl=e.on,exports.removeConcept=e.pn,exports.removeConcepts=e.mn,exports.resolveToColumnName=e.wt,exports.rewriteText=e.hn,exports.saveUserSettings=e.C,exports.setGlobalConfig=e.wn,exports.setToken=e.u,exports.sha512=e.ft,exports.suggestionsToTreeAggregationNodes=e.xn,exports.sysLang=e.Zt,exports.toDate=e.Ot,exports.translateAggregationToDateOptions=e.Sn,exports.tryAutoAuthentication=e.o,exports.tryOAuthAuthentication=e.f,exports.trySAMLAuthentication=e.d,exports.warn=e.Jt,exports.withRetry=e.Tt;
@@ -0,0 +1,3 @@
1
+ export * from "..";
2
+ export * from "../web-api/helpers/aad-http-client-manager";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spfx/index.ts"],"names":[],"mappings":"AAAA,cAAc,IAAI,CAAC;AACnB,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { $ as e, $t as t, A as n, At as r, B as i, Bt as a, C as o, Cn as s, Ct as c, D as l, Dn as u, Dt as d, E as f, En as p, Et as m, F as h, Ft as g, G as _, Gt as v, H as y, Ht as b, I as x, It as S, J as C, Jt as w, K as T, Kt as E, L as D, Lt as O, M as k, Mt as A, N as j, Nt as M, O as N, Ot as P, P as F, Pt as I, Q as L, Qt as R, R as z, Rt as B, S as V, Sn as H, St as U, T as W, Tn as G, Tt as K, U as q, Ut as J, V as Y, Vt as X, W as Z, Wt as Q, X as $, Xt as ee, Y as te, Yt as ne, Z as re, Zt as ie, _ as ae, _n as oe, _t as se, a as ce, an as le, at as ue, b as de, bn as fe, bt as pe, c as me, cn as he, ct as ge, d as _e, dn as ve, dt as ye, en as be, et as xe, f as Se, fn as Ce, ft as we, g as Te, gn as Ee, gt as De, h as Oe, hn as ke, ht as Ae, i as je, in as Me, it as Ne, j as Pe, jt as Fe, k as Ie, kt as Le, l as Re, ln as ze, lt as Be, m as Ve, mn as He, mt as Ue, n as We, nn as Ge, nt as Ke, o as qe, on as Je, ot as Ye, p as Xe, pn as Ze, pt as Qe, q as $e, qt as et, r as tt, rn as nt, rt, s as it, sn as at, st as ot, t as st, tn as ct, tt as lt, u as ut, un as dt, ut as ft, v as pt, vn as mt, vt as ht, w as gt, wn as _t, wt as vt, x as yt, xn as bt, xt, y as St, yn as Ct, yt as wt, z as Tt, zt as Et } from "../src-BW4JX9K-.js";
2
+ export { h as API, X as ApiError, e as Audit, c as AuditEventType, G as AuthMode, wt as DidYouMeanKind, U as EngineType, xt as EngineTypeModifier, J as LogLevel, pe as MINIMUM_COMPATIBLE_SERVER_API_VERSION, ht as RFMDisplay, a as ServerError, Et as TimeoutError, B as UnauthorizedError, g as aadHttpClientManager, xe as addAuditAdditionalInfo, dt as addConcepts, lt as addSessionId, Ke as addUrl, oe as aggItemRegex, mt as aggregationItemStrictCompare, $e as appInitializerFn, Ee as bisect, k as buildPathsAndLevels, We as clearSessionTokens, Q as configureLogger, b as createHeaders, Le as createTimeoutController, Ve as createUserProfile, v as debug, I as del, Oe as deleteUserProfileProperty, de as deleteUserSettings, je as deleteWebTokenCookie, re as detectAuthMode, u as emitAuthenticatedEvent, E as error, rt as escapeExpr, m as expiresSoon, De as extraColumns, L as fetchAggregation, C as fetchApp, te as fetchAppPreLogin, j as fetchBulkQuery, St as fetchChangePassword, Z as fetchDataset, _ as fetchDatasetList, T as fetchDatasets, y as fetchLabels, i as fetchPreview, Y as fetchPreviewUrl, x as fetchPrincipal, D as fetchPrincipalList, z as fetchPrincipalUserid, Tt as fetchPrincipalUserids, F as fetchQuery, Pe as fetchQueryExport, n as fetchQueryIntent, pt as fetchSendPasswordResetEmail, Ie as fetchSimilarDocuments, N as fetchSponsoredLinks, W as fetchSuggest, f as fetchSuggestField, l as fetchSuggestQuery, gt as fetchTextChunks, Te as fetchUserProfile, yt as fetchUserSettings, Xe as fetchVersion, Ae as filter, M as get, ve as getConcepts, Re as getCsrfToken, R as getFiltersFromURI, t as getFiltersFromUrl, ee as getHelpIndexUrl, be as getIdFromUrl, me as getJWToken, Qe as getMetadata, Ue as getMetadataWithValues, he as getOffsetFromDates, ct as getQueryPageFromUrl, Ge as getQueryParamsFromUrl, nt as getQueryTabFromUrl, Me as getQueryTextFromUrl, ze as getRelativeDate, Ne as getTime, it as getToken, le as getUrlParamsFromQueryParams, s as globalConfig, ue as guid, O as handleResponse, et as info, S as initializeAadHttpClient, $ as initializeAppConfig, Ye as isArrayBuffer, st as isAuthenticated, ot as isBlob, ge as isDate, d as isExpired, Be as isJsonable, at as isNotInputEvent, ft as isObject, ye as isString, q as labels, p as legacyBooleansToAuthMode, ce as login, tt as logout, se as makeColumn, ne as notify, Ct as openParentNodes, Ce as parseText, fe as parseValueAndOperatorFromItem, A as patch, ae as patchUserProfile, V as patchUserSettings, Fe as post, r as put, Je as queryParamsFromUrl, Ze as removeConcept, He as removeConcepts, vt as resolveToColumnName, ke as rewriteText, o as saveUserSettings, _t as setGlobalConfig, ut as setToken, we as sha512, bt as suggestionsToTreeAggregationNodes, ie as sysLang, P as toDate, H as translateAggregationToDateOptions, qe as tryAutoAuthentication, Se as tryOAuthAuthentication, _e as trySAMLAuthentication, w as warn, K as withRetry };