@auxilium/datalynk-client 1.2.9 → 1.2.92

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/index.js CHANGED
@@ -2391,6 +2391,7 @@ class PWA {
2391
2391
  const backdrop = document.createElement("div");
2392
2392
  backdrop.classList.add("pwa-prompt-backdrop");
2393
2393
  const prompt = document.createElement("div");
2394
+ prompt.classList.add("pwa-prompt");
2394
2395
  prompt.innerHTML = `
2395
2396
  <div style="display: flex; padding: 1rem; align-items: center">
2396
2397
  <img src="https://datalynk-client.scarborough.auxilium.world/logo.png" alt="Logo" style="height: 40px; width: auto; margin-right: .5rem;" />
@@ -3370,7 +3371,7 @@ class Superuser {
3370
3371
  } });
3371
3372
  }
3372
3373
  }
3373
- const version = "1.2.9";
3374
+ const version = "1.2.92";
3374
3375
  class WebRtc {
3375
3376
  constructor(api) {
3376
3377
  __publicField(this, "ice");
package/dist/index.mjs CHANGED
@@ -2389,6 +2389,7 @@ class PWA {
2389
2389
  const backdrop = document.createElement("div");
2390
2390
  backdrop.classList.add("pwa-prompt-backdrop");
2391
2391
  const prompt = document.createElement("div");
2392
+ prompt.classList.add("pwa-prompt");
2392
2393
  prompt.innerHTML = `
2393
2394
  <div style="display: flex; padding: 1rem; align-items: center">
2394
2395
  <img src="https://datalynk-client.scarborough.auxilium.world/logo.png" alt="Logo" style="height: 40px; width: auto; margin-right: .5rem;" />
@@ -3368,7 +3369,7 @@ class Superuser {
3368
3369
  } });
3369
3370
  }
3370
3371
  }
3371
- const version = "1.2.9";
3372
+ const version = "1.2.92";
3372
3373
  class WebRtc {
3373
3374
  constructor(api) {
3374
3375
  __publicField(this, "ice");
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;IAqBH,OAAO,CAAC,QAAQ,CAAC,GAAG;IApBhC,OAAO,CAAC,cAAc,CAAa;IAEnC,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;IAQrC,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IAsC9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAgJzC"}
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;IAqBH,OAAO,CAAC,QAAQ,CAAC,GAAG;IApBhC,OAAO,CAAC,cAAc,CAAa;IAEnC,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;IAQrC,oBAAoB;IACd,KAAK,CAAC,QAAQ,GAAE,GAAQ;IAsC9B,qCAAqC;IAC/B,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK;CAiJzC"}
@@ -3,13 +3,24 @@ const cache = "datalynk";
3
3
  self.addEventListener("fetch", (event) => {
4
4
  const request = event.request;
5
5
  if (navigator.onLine) {
6
- event.respondWith(fetch(request).then((response) => {
7
- const responseClone = response.clone();
8
- if (request.url.startsWith(self.location.origin) || request.url.startsWith("https://datalynk-client"))
9
- caches.open(cache).then((cache2) => cache2.put(request, responseClone));
10
- return response;
11
- }));
6
+ event.respondWith(
7
+ fetch(request).then((response) => {
8
+ if (response && response.status === 200 && (request.url.startsWith(self.location.origin) || request.url.startsWith("https://datalynk-client"))) {
9
+ const responseClone = response.clone();
10
+ caches.open(cache).then((cache2) => cache2.put(request, responseClone));
11
+ }
12
+ return response;
13
+ }).catch(() => {
14
+ return caches.match(request).then(
15
+ (cachedResponse) => cachedResponse || new Response("You are offline", { status: 503, statusText: "Service Unavailable" })
16
+ );
17
+ })
18
+ );
12
19
  } else {
13
- event.respondWith(caches.match(request).then((cachedResponse) => cachedResponse || new Response("You are offline", { status: 503, statusText: "Service Unavailable" })));
20
+ event.respondWith(
21
+ caches.match(request).then(
22
+ (cachedResponse) => cachedResponse || new Response("You are offline", { status: 503, statusText: "Service Unavailable" })
23
+ )
24
+ );
14
25
  }
15
26
  });
@@ -2,13 +2,24 @@ const cache = "datalynk";
2
2
  self.addEventListener("fetch", (event) => {
3
3
  const request = event.request;
4
4
  if (navigator.onLine) {
5
- event.respondWith(fetch(request).then((response) => {
6
- const responseClone = response.clone();
7
- if (request.url.startsWith(self.location.origin) || request.url.startsWith("https://datalynk-client"))
8
- caches.open(cache).then((cache2) => cache2.put(request, responseClone));
9
- return response;
10
- }));
5
+ event.respondWith(
6
+ fetch(request).then((response) => {
7
+ if (response && response.status === 200 && (request.url.startsWith(self.location.origin) || request.url.startsWith("https://datalynk-client"))) {
8
+ const responseClone = response.clone();
9
+ caches.open(cache).then((cache2) => cache2.put(request, responseClone));
10
+ }
11
+ return response;
12
+ }).catch(() => {
13
+ return caches.match(request).then(
14
+ (cachedResponse) => cachedResponse || new Response("You are offline", { status: 503, statusText: "Service Unavailable" })
15
+ );
16
+ })
17
+ );
11
18
  } else {
12
- event.respondWith(caches.match(request).then((cachedResponse) => cachedResponse || new Response("You are offline", { status: 503, statusText: "Service Unavailable" })));
19
+ event.respondWith(
20
+ caches.match(request).then(
21
+ (cachedResponse) => cachedResponse || new Response("You are offline", { status: 503, statusText: "Service Unavailable" })
22
+ )
23
+ );
13
24
  }
14
25
  });
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.2.9",
5
+ "version": "1.2.92",
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",
7
7
  "private": false,
8
8
  "main": "./dist/index.cjs",