@sesamy/sesamy-js 1.116.0 → 1.117.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.d.ts +3 -1
- package/dist/bootstrap.iife.js +1 -1
- package/dist/bootstrap.mjs +1 -1
- package/dist/sesamy-js.cjs +7 -7
- package/dist/sesamy-js.d.ts +22 -0
- package/dist/sesamy-js.iife.js +7 -7
- package/dist/sesamy-js.mjs +1094 -1056
- package/package.json +1 -1
package/dist/bootstrap.d.ts
CHANGED
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
export interface BootstrapOptions {
|
|
22
22
|
/**
|
|
23
23
|
* Your Sesamy client id. When provided, the bundle URL defaults to
|
|
24
|
-
* `https://scripts.sesamy.com/s/{clientId}/sesamy-js/{version}
|
|
24
|
+
* `https://scripts.sesamy.com/s/{clientId}/sesamy-js/{version}.js` (the
|
|
25
|
+
* `.js` suffix selects the IIFE build — the bootstrap injects a classic
|
|
26
|
+
* `<script>`, which cannot parse the ESM served at the bare URL). Either
|
|
25
27
|
* `clientId` or an explicit `src` is required.
|
|
26
28
|
*/
|
|
27
29
|
clientId?: string;
|
package/dist/bootstrap.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var sesamyBootstrap=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=e.namespace||`sesamy`,n=e.fallbackSrc,r=e.environment===`dev`?`scripts.sesamy.dev`:`scripts.sesamy.com`,i=e.src||`https://`+r+`/s/`+e.clientId+`/sesamy-js/`+(e.version||`stable`)
|
|
1
|
+
var sesamyBootstrap=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=e.namespace||`sesamy`,n=e.fallbackSrc,r=e.environment===`dev`?`scripts.sesamy.dev`:`scripts.sesamy.com`,i=e.src||`https://`+r+`/s/`+e.clientId+`/sesamy-js/`+(e.version||`stable`)+`.js`,a=window;if(!e.skipAuthPrefetch&&!a.__sesamyBoot){let t=null;try{let e=sessionStorage.getItem(`sesamy:userinfo`);if(e){let n=JSON.parse(e),r=n._cachedAt;r&&Date.now()-r<=36e5&&(t=n)}}catch{}t?a.__sesamyBoot=Promise.resolve(t):(`; `+document.cookie).indexOf(`; sesamy_is_authenticated=true`)>=0&&(a.__sesamyBoot=fetch((e.apiBaseUrl||``)+`/auth/userinfo`,{credentials:`include`,headers:{Accept:`application/json`}}).then(e=>e.ok?e.json():null).catch(()=>null))}let o=!1,s=()=>{if(o||!n||a[t])return;o=!0;let e=document.createElement(`script`);e.src=n,e.async=!0,document.head.appendChild(e)},c=document.createElement(`script`);c.src=i,c.async=!0,c.onerror=s,document.head.appendChild(c),n&&setTimeout(s,e.fallbackTimeoutMs||3e3)}function n(e){return`(`+t.toString()+`)(`+JSON.stringify(e)+`);`}if(typeof window<`u`){window.sesamyBootstrap=t;try{let e=document.getElementById(`sesamy-js`),n=e&&e.textContent?JSON.parse(e.textContent):null;n&&n.clientId&&t({clientId:n.clientId})}catch{}}return e.renderBootstrapScript=n,e.sesamyBootstrap=t,e})({});
|
package/dist/bootstrap.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/bootstrap.ts
|
|
2
2
|
function e(e) {
|
|
3
|
-
let t = e.namespace || "sesamy", n = e.fallbackSrc, r = e.environment === "dev" ? "scripts.sesamy.dev" : "scripts.sesamy.com", i = e.src || "https://" + r + "/s/" + e.clientId + "/sesamy-js/" + (e.version || "stable"), a = window;
|
|
3
|
+
let t = e.namespace || "sesamy", n = e.fallbackSrc, r = e.environment === "dev" ? "scripts.sesamy.dev" : "scripts.sesamy.com", i = e.src || "https://" + r + "/s/" + e.clientId + "/sesamy-js/" + (e.version || "stable") + ".js", a = window;
|
|
4
4
|
if (!e.skipAuthPrefetch && !a.__sesamyBoot) {
|
|
5
5
|
let t = null;
|
|
6
6
|
try {
|