@auxilium/datalynk-client 1.3.2 → 1.3.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.
- package/README.md +106 -49
- package/dist/api.d.ts.map +1 -1
- package/dist/index.cjs +3897 -0
- package/dist/index.mjs +21 -4
- package/dist/pwa.d.ts +1 -0
- package/dist/pwa.d.ts.map +1 -1
- package/dist/service.worker.d.mts +2 -0
- package/dist/service.worker.d.mts.map +1 -0
- package/package.json +1 -1
- package/dist/index.js +0 -3876
- package/dist/service.worker.d.ts +0 -2
- package/dist/service.worker.d.ts.map +0 -1
- package/dist/service.worker.js +0 -22
- package/dist/service.worker.mjs +0 -21
package/dist/index.mjs
CHANGED
|
@@ -2305,6 +2305,9 @@ class PWA {
|
|
|
2305
2305
|
this.api = api;
|
|
2306
2306
|
}
|
|
2307
2307
|
// Holds the beforeinstallprompt event
|
|
2308
|
+
get headless() {
|
|
2309
|
+
return typeof window == "undefined";
|
|
2310
|
+
}
|
|
2308
2311
|
get iframe() {
|
|
2309
2312
|
return (parent == null ? void 0 : parent.location) != location;
|
|
2310
2313
|
}
|
|
@@ -2388,7 +2391,7 @@ class PWA {
|
|
|
2388
2391
|
link.href = `${base}/manifest?json=${encodeURIComponent(JSON.stringify(manifestObj))}`;
|
|
2389
2392
|
document.head.append(link);
|
|
2390
2393
|
}
|
|
2391
|
-
if (!this.iframe && !this.pwa && this.platform != "mac") setTimeout(() => {
|
|
2394
|
+
if (!this.headless && !this.iframe && !this.pwa && this.platform != "mac") setTimeout(() => {
|
|
2392
2395
|
const dismissedDate = localStorage.getItem(`${this.api.options.name}:pwa`);
|
|
2393
2396
|
if (settings.dismissExpiry > 0 && dismissedDate) {
|
|
2394
2397
|
const diffDays = (Date.now() - new Date(dismissedDate).getTime()) / (1e3 * 60 * 60 * 24);
|
|
@@ -3450,7 +3453,7 @@ class Superuser {
|
|
|
3450
3453
|
} });
|
|
3451
3454
|
}
|
|
3452
3455
|
}
|
|
3453
|
-
const version = "1.3.
|
|
3456
|
+
const version = "1.3.4";
|
|
3454
3457
|
class WebRtc {
|
|
3455
3458
|
constructor(api) {
|
|
3456
3459
|
__publicField(this, "ice");
|
|
@@ -3638,7 +3641,7 @@ const _Api = class _Api {
|
|
|
3638
3641
|
}
|
|
3639
3642
|
};
|
|
3640
3643
|
if (this.options.saveSession) {
|
|
3641
|
-
if (localStorage ==
|
|
3644
|
+
if (typeof localStorage == "undefined") return;
|
|
3642
3645
|
this.token = localStorage.getItem(this.localStorageKey) || null;
|
|
3643
3646
|
this.token$.pipe(distinctUntilChanged()).subscribe((token) => {
|
|
3644
3647
|
if (token) localStorage.setItem(this.localStorageKey, token);
|
|
@@ -3658,7 +3661,21 @@ const _Api = class _Api {
|
|
|
3658
3661
|
this.database = new Database("datalynk", this.options.offline);
|
|
3659
3662
|
(_b = this.options.offline) == null ? void 0 : _b.forEach((id) => this.slice(id));
|
|
3660
3663
|
if (this.options.serviceWorker && typeof navigator["serviceWorker"] != "undefined") {
|
|
3661
|
-
|
|
3664
|
+
(async () => {
|
|
3665
|
+
const init = () => {
|
|
3666
|
+
var _a2;
|
|
3667
|
+
(_a2 = navigator.serviceWorker.controller) == null ? void 0 : _a2.postMessage({ options: { ...this.options, url: this.url } });
|
|
3668
|
+
this.token$.subscribe((token) => {
|
|
3669
|
+
var _a3;
|
|
3670
|
+
return (_a3 = navigator.serviceWorker.controller) == null ? void 0 : _a3.postMessage({ token });
|
|
3671
|
+
});
|
|
3672
|
+
};
|
|
3673
|
+
await navigator.serviceWorker.getRegistration(this.options.serviceWorker).then((reg) => reg ?? navigator.serviceWorker.register(this.options.serviceWorker, { scope: "/", type: "module" }));
|
|
3674
|
+
navigator.serviceWorker.ready.then(() => {
|
|
3675
|
+
if (navigator.serviceWorker.controller) navigator.serviceWorker.ready.then(() => init());
|
|
3676
|
+
else navigator.serviceWorker.addEventListener("controllerchange", () => init(), { once: true });
|
|
3677
|
+
});
|
|
3678
|
+
})();
|
|
3662
3679
|
}
|
|
3663
3680
|
}
|
|
3664
3681
|
}
|
package/dist/pwa.d.ts
CHANGED
package/dist/pwa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,qBAAa,GAAG;
|
|
1
|
+
{"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,qBAAa,GAAG;IAuBH,OAAO,CAAC,QAAQ,CAAC,GAAG;IAtBzB,cAAc,EAAE,GAAG,CAAQ;IAElC,IAAI,QAAQ,IAAI,OAAO,CAAwC;IAE/D,IAAI,MAAM,IAAI,OAAO,CAAyC;IAE9D,IAAI,MAAM,IAAI,OAAO,CAAuD;IAE5E,IAAI,QAAQ,IAAI,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAQ1E;IAED,IAAI,GAAG,IAAI,OAAO,CAEjB;gBAE4B,GAAG,EAAE,GAAG;IAErC,OAAO,CAAC,iBAAiB;IAezB,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IAmE9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAgJzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.worker.d.mts","sourceRoot":"","sources":["../src/service.worker.mjs"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@auxilium/datalynk-client",
|
|
3
3
|
"description": "Datalynk client library",
|
|
4
4
|
"repository": "https://gitlab.auxiliumgroup.com/auxilium/datalynk/datalynk-client",
|
|
5
|
-
"version": "1.3.
|
|
5
|
+
"version": "1.3.4",
|
|
6
6
|
"author": "Zak Timson <zaktimson@gmail.com>",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "./dist/index.cjs",
|