@innspel/core 0.7.0 → 0.9.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/{chunk-EDOTPUMZ.js → chunk-YXWPKEC7.js} +3 -3
- package/dist/{chunk-EDOTPUMZ.js.map → chunk-YXWPKEC7.js.map} +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/telemetri.cjs +1 -1
- package/dist/telemetri.cjs.map +1 -1
- package/dist/telemetri.d.cts +1 -1
- package/dist/telemetri.d.ts +1 -1
- package/dist/telemetri.js +1 -1
- package/dist/{typer-CZIalpLn.d.cts → typer-CC_TqepX.d.cts} +23 -1
- package/dist/{typer-CZIalpLn.d.ts → typer-CC_TqepX.d.ts} +23 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1274,7 +1274,7 @@ async function lastOppTilLagring(fetchImpl, presign, body, signal) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
|
|
1276
1276
|
// src/versjon.ts
|
|
1277
|
-
var VERSJON = "0.
|
|
1277
|
+
var VERSJON = "0.9.0";
|
|
1278
1278
|
|
|
1279
1279
|
// src/klient.ts
|
|
1280
1280
|
var STANDARD_TIMEOUT_MS = 1e4;
|
|
@@ -1341,6 +1341,18 @@ function validerOpsjoner(o) {
|
|
|
1341
1341
|
"mangler eller er ikke en funksjon"
|
|
1342
1342
|
);
|
|
1343
1343
|
}
|
|
1344
|
+
if (o.connectivity !== void 0) {
|
|
1345
|
+
krev(
|
|
1346
|
+
typeof o.connectivity?.isOnline === "function",
|
|
1347
|
+
"connectivity.isOnline",
|
|
1348
|
+
"mangler eller er ikke en funksjon. Gi et objekt med isOnline() og valgfri subscribe(), eller utelat opsjonen \u2014 se docs/sdk/README.md, \xABNettstatus\xBB"
|
|
1349
|
+
);
|
|
1350
|
+
krev(
|
|
1351
|
+
o.connectivity.subscribe === void 0 || typeof o.connectivity.subscribe === "function",
|
|
1352
|
+
"connectivity.subscribe",
|
|
1353
|
+
"er valgfri, men m\xE5 v\xE6re en funksjon som gir en avmelding tilbake"
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1344
1356
|
}
|
|
1345
1357
|
function tilApiFeil(status, kropp, response) {
|
|
1346
1358
|
const body = kropp ?? {};
|
|
@@ -1477,9 +1489,13 @@ function init(options) {
|
|
|
1477
1489
|
(rad) => sendN\u00E5({ type: rad.type, text: rad.text }, rad.clientRef, kontekst),
|
|
1478
1490
|
telemetri
|
|
1479
1491
|
);
|
|
1492
|
+
options.connectivity?.subscribe?.((online) => {
|
|
1493
|
+
if (online) void flushK\u00F8().catch(() => void 0);
|
|
1494
|
+
});
|
|
1480
1495
|
const innspel = {
|
|
1481
1496
|
version: VERSJON,
|
|
1482
1497
|
isAnonymous: anonym,
|
|
1498
|
+
connectivity: options.connectivity ?? null,
|
|
1483
1499
|
settings,
|
|
1484
1500
|
context: kontekst,
|
|
1485
1501
|
async loadSettings() {
|