@auxilium/datalynk-client 1.3.5 → 1.3.6
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/api.d.ts +13 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/index.cjs +46 -49
- package/dist/index.mjs +46 -49
- package/dist/slice.d.ts +6 -4
- package/dist/slice.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -58,9 +58,9 @@ export type ApiOptions = {
|
|
|
58
58
|
};
|
|
59
59
|
/** Progressive Web App settings */
|
|
60
60
|
pwaSettings?: {
|
|
61
|
-
/** How long to wait before showing
|
|
61
|
+
/** How long to wait before showing the installation prompt (seconds). Default is 30 seconds */
|
|
62
62
|
timeout?: number;
|
|
63
|
-
/** Days until dismissed prompt can show again. If set to 0 it will trigger every refresh. (Default is 7 days) */
|
|
63
|
+
/** Days until the dismissed prompt can show again. If set to `0` it will trigger every refresh. (Default is 7 days) */
|
|
64
64
|
dismissExpiry?: number;
|
|
65
65
|
/** Show PWA install link on login screen. Default is False */
|
|
66
66
|
loginLink?: boolean;
|
|
@@ -72,6 +72,8 @@ export type ApiOptions = {
|
|
|
72
72
|
export interface ApiRequestOptions {
|
|
73
73
|
/** Skip bundling & caching */
|
|
74
74
|
noOptimize?: boolean;
|
|
75
|
+
/** Queue for network connection */
|
|
76
|
+
offline?: boolean;
|
|
75
77
|
/** Skip the token translating step */
|
|
76
78
|
raw?: boolean;
|
|
77
79
|
/** Set request token */
|
|
@@ -125,7 +127,7 @@ export declare class Api {
|
|
|
125
127
|
/** Options */
|
|
126
128
|
options: ApiOptions;
|
|
127
129
|
/** Created slices */
|
|
128
|
-
sliceCache: Map<number, Slice
|
|
130
|
+
sliceCache: Map<number, Slice>;
|
|
129
131
|
/** API URL */
|
|
130
132
|
url: string;
|
|
131
133
|
/** Client library version */
|
|
@@ -135,7 +137,7 @@ export declare class Api {
|
|
|
135
137
|
/** Get session info from JWT payload */
|
|
136
138
|
get jwtPayload(): JwtPayload | null;
|
|
137
139
|
private onlineOverride;
|
|
138
|
-
|
|
140
|
+
online$: BehaviorSubject<boolean>;
|
|
139
141
|
/** Check if we are connected */
|
|
140
142
|
get online(): boolean | null;
|
|
141
143
|
get offline(): boolean;
|
|
@@ -192,13 +194,16 @@ export declare class Api {
|
|
|
192
194
|
[key: string]: any;
|
|
193
195
|
}): Promise<any>;
|
|
194
196
|
/**
|
|
195
|
-
* Exact same as `request` method, but logs the response in the console automatically
|
|
197
|
+
* Exact same as the `request` method, but logs the response in the console automatically
|
|
196
198
|
*
|
|
197
199
|
* @param {object | string} data Datalynk request as object or string
|
|
198
200
|
* @param {ApiRequestOptions} options
|
|
199
201
|
* @returns {Promise<any>} Datalynk response
|
|
200
202
|
*/
|
|
201
203
|
debug<T = any>(data: any, options?: ApiRequestOptions): Promise<T>;
|
|
204
|
+
debug<T = any>(data: any, options: {
|
|
205
|
+
offline: true;
|
|
206
|
+
} & ApiRequestOptions): Promise<T | void>;
|
|
202
207
|
/**
|
|
203
208
|
* Send a request to Datalynk
|
|
204
209
|
*
|
|
@@ -212,6 +217,9 @@ export declare class Api {
|
|
|
212
217
|
* @returns {Promise<any>} Datalynk response or error
|
|
213
218
|
*/
|
|
214
219
|
request<T = any>(data: any, options?: ApiRequestOptions): Promise<T>;
|
|
220
|
+
request<T = any>(data: any, options: {
|
|
221
|
+
offline: true;
|
|
222
|
+
} & ApiRequestOptions): Promise<T | void>;
|
|
215
223
|
/**
|
|
216
224
|
* Create a slice object using the API
|
|
217
225
|
*
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,QAAQ,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,QAAQ,EAAQ,MAAM,gB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AE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE;QAAC,OAAO,EAAE,IAAI,CAAA;KAAC,GAAG,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IA2CnG;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,CAAC,SAAS,IAAI,GAAG,GAAG,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;CAIjE"}
|
package/dist/index.cjs
CHANGED
|
@@ -3066,7 +3066,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3066
3066
|
return this;
|
|
3067
3067
|
}
|
|
3068
3068
|
}
|
|
3069
|
-
class
|
|
3069
|
+
const _Slice = class _Slice {
|
|
3070
3070
|
/**
|
|
3071
3071
|
* An object to aid in constructing requests
|
|
3072
3072
|
*
|
|
@@ -3077,17 +3077,20 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3077
3077
|
__publicField(this, "table");
|
|
3078
3078
|
__publicField(this, "info");
|
|
3079
3079
|
__publicField(this, "loaded", false);
|
|
3080
|
-
__publicField(this, "pendingInsert", 0);
|
|
3081
|
-
/** Unsubscribe from changes, undefined if not subscribed */
|
|
3082
|
-
__publicField(this, "unsubscribe");
|
|
3083
3080
|
/** Cached slice data as an observable */
|
|
3084
3081
|
__publicField(this, "cache$", new BehaviorSubject([]));
|
|
3082
|
+
/** Unsubscribe from changes, undefined if not subscribed */
|
|
3083
|
+
__publicField(this, "unsubscribe");
|
|
3085
3084
|
var _a;
|
|
3086
3085
|
this.slice = slice;
|
|
3087
3086
|
this.api = api;
|
|
3088
3087
|
if (this.offlineEnabled) {
|
|
3089
3088
|
this.table = (_a = api.database) == null ? void 0 : _a.table(slice.toString());
|
|
3090
|
-
this.table.getAll().then((resp) =>
|
|
3089
|
+
this.table.getAll().then((resp) => {
|
|
3090
|
+
this.cache = resp;
|
|
3091
|
+
const lowest = resp.reduce((acc, r) => Math.min(acc, r.id), 0);
|
|
3092
|
+
if (lowest < _Slice.nextId) _Slice.nextId = lowest;
|
|
3093
|
+
}).finally(() => this.loaded = true);
|
|
3091
3094
|
this.cache$.pipe(skip(1)).subscribe(async (cache) => {
|
|
3092
3095
|
var _a2;
|
|
3093
3096
|
await ((_a2 = this.table) == null ? void 0 : _a2.clear());
|
|
@@ -3095,10 +3098,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3095
3098
|
var _a3;
|
|
3096
3099
|
return (_a3 = this.table) == null ? void 0 : _a3.put(c.id, c);
|
|
3097
3100
|
}));
|
|
3098
|
-
this.fixIncrement();
|
|
3099
3101
|
});
|
|
3100
3102
|
this.sync();
|
|
3101
|
-
|
|
3103
|
+
this.api.online$.subscribe(async (online) => {
|
|
3104
|
+
if (!online) return;
|
|
3102
3105
|
if (this.api.expired) await lastValueFrom(this.api.auth.user$.pipe(skip(1), takeWhile((u) => !u || this.api.expired, true)));
|
|
3103
3106
|
this.pushChanges();
|
|
3104
3107
|
});
|
|
@@ -3119,10 +3122,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3119
3122
|
var _a;
|
|
3120
3123
|
return (_a = this.api.database) == null ? void 0 : _a.includes(this.slice.toString());
|
|
3121
3124
|
}
|
|
3122
|
-
fixIncrement() {
|
|
3123
|
-
var _a;
|
|
3124
|
-
this.pendingInsert = ((_a = this.cache.toSorted(sortByProp("id")).pop()) == null ? void 0 : _a["id"]) || 0;
|
|
3125
|
-
}
|
|
3126
3125
|
execWrapper(call) {
|
|
3127
3126
|
const onlineExec = call.exec.bind(call);
|
|
3128
3127
|
return async () => {
|
|
@@ -3168,7 +3167,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3168
3167
|
} else if (request["$/slice/xinsert"]) {
|
|
3169
3168
|
const rows = request["$/slice/xinsert"]["rows"].map((r) => ({
|
|
3170
3169
|
...r,
|
|
3171
|
-
id:
|
|
3170
|
+
id: --_Slice.nextId,
|
|
3172
3171
|
_sync: "insert"
|
|
3173
3172
|
}));
|
|
3174
3173
|
this.cache = [...this.cache, ...rows];
|
|
@@ -3334,7 +3333,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3334
3333
|
call.exec = this.execWrapper(call);
|
|
3335
3334
|
return call.update(rows);
|
|
3336
3335
|
}
|
|
3337
|
-
}
|
|
3336
|
+
};
|
|
3337
|
+
__publicField(_Slice, "idMap", {});
|
|
3338
|
+
__publicField(_Slice, "nextId", 0);
|
|
3339
|
+
let Slice = _Slice;
|
|
3338
3340
|
class Socket {
|
|
3339
3341
|
constructor(api, options = {}) {
|
|
3340
3342
|
__publicField(this, "listeners", []);
|
|
@@ -3469,7 +3471,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3469
3471
|
} });
|
|
3470
3472
|
}
|
|
3471
3473
|
}
|
|
3472
|
-
const version = "1.3.
|
|
3474
|
+
const version = "1.3.6";
|
|
3473
3475
|
class WebRtc {
|
|
3474
3476
|
constructor(api) {
|
|
3475
3477
|
__publicField(this, "ice");
|
|
@@ -3643,7 +3645,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3643
3645
|
/** Client library version */
|
|
3644
3646
|
__publicField(this, "version", version);
|
|
3645
3647
|
__publicField(this, "onlineOverride", false);
|
|
3646
|
-
__publicField(this, "
|
|
3648
|
+
__publicField(this, "online$", new BehaviorSubject(typeof navigator == "undefined" ? true : navigator.onLine));
|
|
3647
3649
|
/** API Session token */
|
|
3648
3650
|
__publicField(this, "token$", new BehaviorSubject(void 0));
|
|
3649
3651
|
var _a, _b;
|
|
@@ -3679,20 +3681,28 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3679
3681
|
this.pwa = new PWA(this);
|
|
3680
3682
|
this.superuser = new Superuser(this);
|
|
3681
3683
|
this.webrtc = new WebRtc(this);
|
|
3684
|
+
this.database = new Database("datalynk", ["pending", ...this.options.offline || []]);
|
|
3685
|
+
this.online$.subscribe(async (online) => {
|
|
3686
|
+
var _a2;
|
|
3687
|
+
if (!online) return;
|
|
3688
|
+
const table = (_a2 = this.database) == null ? void 0 : _a2.table("pending");
|
|
3689
|
+
const keys = await (table == null ? void 0 : table.getAllKeys());
|
|
3690
|
+
await Promise.allSettled(keys.map(async (k) => {
|
|
3691
|
+
const r = await (table == null ? void 0 : table.get(k));
|
|
3692
|
+
await this.request(r).then(() => table == null ? void 0 : table.delete(k));
|
|
3693
|
+
}));
|
|
3694
|
+
});
|
|
3682
3695
|
if (typeof window !== "undefined") {
|
|
3683
|
-
const handleOffline = (state) => {
|
|
3684
|
-
this.
|
|
3685
|
-
this.offlineBanner();
|
|
3696
|
+
const handleOffline = (state = this.offline) => {
|
|
3697
|
+
if (this.online != state) this.online$.next(state);
|
|
3686
3698
|
};
|
|
3687
3699
|
window.addEventListener("online", () => handleOffline(true));
|
|
3688
3700
|
window.addEventListener("offline", () => handleOffline(false));
|
|
3689
|
-
this.
|
|
3690
|
-
this.offlineBanner();
|
|
3701
|
+
this.online$.subscribe(() => this.offlineBanner());
|
|
3691
3702
|
}
|
|
3692
3703
|
if ((_a = this.options.offline) == null ? void 0 : _a.length) {
|
|
3693
3704
|
this.pwa.setup();
|
|
3694
3705
|
if (typeof indexedDB == "undefined") throw new Error("Cannot enable offline support, indexedDB is not available in this environment");
|
|
3695
|
-
this.database = new Database("datalynk", this.options.offline);
|
|
3696
3706
|
(_b = this.options.offline) == null ? void 0 : _b.forEach((id) => this.slice(id));
|
|
3697
3707
|
if (this.options.serviceWorker && typeof navigator["serviceWorker"] != "undefined") {
|
|
3698
3708
|
(async () => {
|
|
@@ -3725,24 +3735,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3725
3735
|
}
|
|
3726
3736
|
/** Check if we are connected */
|
|
3727
3737
|
get online() {
|
|
3728
|
-
return this.
|
|
3738
|
+
return this.online$.getValue();
|
|
3729
3739
|
}
|
|
3730
3740
|
get offline() {
|
|
3731
|
-
return !this.
|
|
3741
|
+
return !this.online;
|
|
3732
3742
|
}
|
|
3733
3743
|
/** Override connection status */
|
|
3734
3744
|
set online(value) {
|
|
3735
3745
|
if (value == null) {
|
|
3736
3746
|
this.onlineOverride = false;
|
|
3737
|
-
this.
|
|
3747
|
+
this.online$.next(typeof navigator == "undefined" ? true : navigator.onLine);
|
|
3738
3748
|
} else {
|
|
3739
3749
|
this.onlineOverride = true;
|
|
3740
3750
|
if (value == this.online) return;
|
|
3741
|
-
this.
|
|
3751
|
+
this.online$.next(value);
|
|
3742
3752
|
if (value) this.startHeartbeat();
|
|
3743
3753
|
else this.stopHeartbeat();
|
|
3744
3754
|
}
|
|
3745
|
-
this.offlineBanner();
|
|
3746
3755
|
}
|
|
3747
3756
|
/** Logged in spoke */
|
|
3748
3757
|
get spoke() {
|
|
@@ -3766,6 +3775,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3766
3775
|
}),
|
|
3767
3776
|
body: JSON.stringify(_Api.translateTokens(req))
|
|
3768
3777
|
}).then(async (resp) => {
|
|
3778
|
+
const warning = resp.headers["X-Warning"];
|
|
3779
|
+
if (warning) console.warn(warning);
|
|
3769
3780
|
this.online = true;
|
|
3770
3781
|
let data = JSONAttemptParse(await resp.text());
|
|
3771
3782
|
if (!resp.ok || (data == null ? void 0 : data.error)) throw Object.assign(errorFromCode(resp.status, data.error), data);
|
|
@@ -3775,7 +3786,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3775
3786
|
}
|
|
3776
3787
|
async checkConnection() {
|
|
3777
3788
|
if (typeof navigator != "undefined" && !navigator.onLine) {
|
|
3778
|
-
this.
|
|
3789
|
+
this.online$.next(false);
|
|
3779
3790
|
return;
|
|
3780
3791
|
}
|
|
3781
3792
|
if (this.onlineOverride) return;
|
|
@@ -3783,9 +3794,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3783
3794
|
const timeout = setTimeout(() => controller.abort(), this.heartbeat.timeout);
|
|
3784
3795
|
try {
|
|
3785
3796
|
const response = await fetch(this.url + this.heartbeat.target, { signal: controller.signal });
|
|
3786
|
-
this.
|
|
3797
|
+
this.online$.next(response.ok);
|
|
3787
3798
|
} catch (error) {
|
|
3788
|
-
this.
|
|
3799
|
+
this.online$.next(false);
|
|
3789
3800
|
} finally {
|
|
3790
3801
|
clearTimeout(timeout);
|
|
3791
3802
|
}
|
|
@@ -3896,13 +3907,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3896
3907
|
{ "$_": "*" }
|
|
3897
3908
|
] }, {});
|
|
3898
3909
|
}
|
|
3899
|
-
/**
|
|
3900
|
-
* Exact same as `request` method, but logs the response in the console automatically
|
|
3901
|
-
*
|
|
3902
|
-
* @param {object | string} data Datalynk request as object or string
|
|
3903
|
-
* @param {ApiRequestOptions} options
|
|
3904
|
-
* @returns {Promise<any>} Datalynk response
|
|
3905
|
-
*/
|
|
3906
3910
|
debug(data, options = {}) {
|
|
3907
3911
|
return this.request(data, options).then((data2) => {
|
|
3908
3912
|
console.log(data2);
|
|
@@ -3912,20 +3916,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3912
3916
|
return err;
|
|
3913
3917
|
});
|
|
3914
3918
|
}
|
|
3915
|
-
/**
|
|
3916
|
-
* Send a request to Datalynk
|
|
3917
|
-
*
|
|
3918
|
-
* @example
|
|
3919
|
-
* ```ts
|
|
3920
|
-
* const response = await api.request('$/auth/current');
|
|
3921
|
-
* ```
|
|
3922
|
-
*
|
|
3923
|
-
* @param {object} data Request using Datalynk API syntax. Strings will be converted: '$/auth/current' -> {'$/auth/current': {}}
|
|
3924
|
-
* @param {ApiRequestOptions} options
|
|
3925
|
-
* @returns {Promise<any>} Datalynk response or error
|
|
3926
|
-
*/
|
|
3927
3919
|
request(data, options = {}) {
|
|
3920
|
+
var _a, _b;
|
|
3928
3921
|
data = typeof data == "string" ? { [data]: {} } : data;
|
|
3922
|
+
let key = JSON.stringify(data);
|
|
3923
|
+
if (this.offline) {
|
|
3924
|
+
(_b = (_a = this.database) == null ? void 0 : _a.table("pending")) == null ? void 0 : _b.add(data, key);
|
|
3925
|
+
return Promise.resolve();
|
|
3926
|
+
}
|
|
3929
3927
|
if (options.noOptimize) {
|
|
3930
3928
|
return new Promise((res, rej) => {
|
|
3931
3929
|
this._request(data, options).then((resp) => {
|
|
@@ -3933,7 +3931,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
3933
3931
|
}).catch((err) => rej(err));
|
|
3934
3932
|
});
|
|
3935
3933
|
}
|
|
3936
|
-
let key = JSON.stringify(data);
|
|
3937
3934
|
if (!this.pending[key]) {
|
|
3938
3935
|
this.pending[key] = new Promise((res, rej) => this.bundle.push({ data, res, rej }));
|
|
3939
3936
|
this.pending[key].catch().then(() => delete this.pending[key]);
|
package/dist/index.mjs
CHANGED
|
@@ -3062,7 +3062,7 @@ class ApiCall {
|
|
|
3062
3062
|
return this;
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
|
-
class
|
|
3065
|
+
const _Slice = class _Slice {
|
|
3066
3066
|
/**
|
|
3067
3067
|
* An object to aid in constructing requests
|
|
3068
3068
|
*
|
|
@@ -3073,17 +3073,20 @@ class Slice {
|
|
|
3073
3073
|
__publicField(this, "table");
|
|
3074
3074
|
__publicField(this, "info");
|
|
3075
3075
|
__publicField(this, "loaded", false);
|
|
3076
|
-
__publicField(this, "pendingInsert", 0);
|
|
3077
|
-
/** Unsubscribe from changes, undefined if not subscribed */
|
|
3078
|
-
__publicField(this, "unsubscribe");
|
|
3079
3076
|
/** Cached slice data as an observable */
|
|
3080
3077
|
__publicField(this, "cache$", new BehaviorSubject([]));
|
|
3078
|
+
/** Unsubscribe from changes, undefined if not subscribed */
|
|
3079
|
+
__publicField(this, "unsubscribe");
|
|
3081
3080
|
var _a;
|
|
3082
3081
|
this.slice = slice;
|
|
3083
3082
|
this.api = api;
|
|
3084
3083
|
if (this.offlineEnabled) {
|
|
3085
3084
|
this.table = (_a = api.database) == null ? void 0 : _a.table(slice.toString());
|
|
3086
|
-
this.table.getAll().then((resp) =>
|
|
3085
|
+
this.table.getAll().then((resp) => {
|
|
3086
|
+
this.cache = resp;
|
|
3087
|
+
const lowest = resp.reduce((acc, r) => Math.min(acc, r.id), 0);
|
|
3088
|
+
if (lowest < _Slice.nextId) _Slice.nextId = lowest;
|
|
3089
|
+
}).finally(() => this.loaded = true);
|
|
3087
3090
|
this.cache$.pipe(skip(1)).subscribe(async (cache) => {
|
|
3088
3091
|
var _a2;
|
|
3089
3092
|
await ((_a2 = this.table) == null ? void 0 : _a2.clear());
|
|
@@ -3091,10 +3094,10 @@ class Slice {
|
|
|
3091
3094
|
var _a3;
|
|
3092
3095
|
return (_a3 = this.table) == null ? void 0 : _a3.put(c.id, c);
|
|
3093
3096
|
}));
|
|
3094
|
-
this.fixIncrement();
|
|
3095
3097
|
});
|
|
3096
3098
|
this.sync();
|
|
3097
|
-
|
|
3099
|
+
this.api.online$.subscribe(async (online) => {
|
|
3100
|
+
if (!online) return;
|
|
3098
3101
|
if (this.api.expired) await lastValueFrom(this.api.auth.user$.pipe(skip(1), takeWhile((u) => !u || this.api.expired, true)));
|
|
3099
3102
|
this.pushChanges();
|
|
3100
3103
|
});
|
|
@@ -3115,10 +3118,6 @@ class Slice {
|
|
|
3115
3118
|
var _a;
|
|
3116
3119
|
return (_a = this.api.database) == null ? void 0 : _a.includes(this.slice.toString());
|
|
3117
3120
|
}
|
|
3118
|
-
fixIncrement() {
|
|
3119
|
-
var _a;
|
|
3120
|
-
this.pendingInsert = ((_a = this.cache.toSorted(sortByProp("id")).pop()) == null ? void 0 : _a["id"]) || 0;
|
|
3121
|
-
}
|
|
3122
3121
|
execWrapper(call) {
|
|
3123
3122
|
const onlineExec = call.exec.bind(call);
|
|
3124
3123
|
return async () => {
|
|
@@ -3164,7 +3163,7 @@ class Slice {
|
|
|
3164
3163
|
} else if (request["$/slice/xinsert"]) {
|
|
3165
3164
|
const rows = request["$/slice/xinsert"]["rows"].map((r) => ({
|
|
3166
3165
|
...r,
|
|
3167
|
-
id:
|
|
3166
|
+
id: --_Slice.nextId,
|
|
3168
3167
|
_sync: "insert"
|
|
3169
3168
|
}));
|
|
3170
3169
|
this.cache = [...this.cache, ...rows];
|
|
@@ -3330,7 +3329,10 @@ class Slice {
|
|
|
3330
3329
|
call.exec = this.execWrapper(call);
|
|
3331
3330
|
return call.update(rows);
|
|
3332
3331
|
}
|
|
3333
|
-
}
|
|
3332
|
+
};
|
|
3333
|
+
__publicField(_Slice, "idMap", {});
|
|
3334
|
+
__publicField(_Slice, "nextId", 0);
|
|
3335
|
+
let Slice = _Slice;
|
|
3334
3336
|
class Socket {
|
|
3335
3337
|
constructor(api, options = {}) {
|
|
3336
3338
|
__publicField(this, "listeners", []);
|
|
@@ -3465,7 +3467,7 @@ class Superuser {
|
|
|
3465
3467
|
} });
|
|
3466
3468
|
}
|
|
3467
3469
|
}
|
|
3468
|
-
const version = "1.3.
|
|
3470
|
+
const version = "1.3.6";
|
|
3469
3471
|
class WebRtc {
|
|
3470
3472
|
constructor(api) {
|
|
3471
3473
|
__publicField(this, "ice");
|
|
@@ -3639,7 +3641,7 @@ const _Api = class _Api {
|
|
|
3639
3641
|
/** Client library version */
|
|
3640
3642
|
__publicField(this, "version", version);
|
|
3641
3643
|
__publicField(this, "onlineOverride", false);
|
|
3642
|
-
__publicField(this, "
|
|
3644
|
+
__publicField(this, "online$", new BehaviorSubject(typeof navigator == "undefined" ? true : navigator.onLine));
|
|
3643
3645
|
/** API Session token */
|
|
3644
3646
|
__publicField(this, "token$", new BehaviorSubject(void 0));
|
|
3645
3647
|
var _a, _b;
|
|
@@ -3675,20 +3677,28 @@ const _Api = class _Api {
|
|
|
3675
3677
|
this.pwa = new PWA(this);
|
|
3676
3678
|
this.superuser = new Superuser(this);
|
|
3677
3679
|
this.webrtc = new WebRtc(this);
|
|
3680
|
+
this.database = new Database("datalynk", ["pending", ...this.options.offline || []]);
|
|
3681
|
+
this.online$.subscribe(async (online) => {
|
|
3682
|
+
var _a2;
|
|
3683
|
+
if (!online) return;
|
|
3684
|
+
const table = (_a2 = this.database) == null ? void 0 : _a2.table("pending");
|
|
3685
|
+
const keys = await (table == null ? void 0 : table.getAllKeys());
|
|
3686
|
+
await Promise.allSettled(keys.map(async (k) => {
|
|
3687
|
+
const r = await (table == null ? void 0 : table.get(k));
|
|
3688
|
+
await this.request(r).then(() => table == null ? void 0 : table.delete(k));
|
|
3689
|
+
}));
|
|
3690
|
+
});
|
|
3678
3691
|
if (typeof window !== "undefined") {
|
|
3679
|
-
const handleOffline = (state) => {
|
|
3680
|
-
this.
|
|
3681
|
-
this.offlineBanner();
|
|
3692
|
+
const handleOffline = (state = this.offline) => {
|
|
3693
|
+
if (this.online != state) this.online$.next(state);
|
|
3682
3694
|
};
|
|
3683
3695
|
window.addEventListener("online", () => handleOffline(true));
|
|
3684
3696
|
window.addEventListener("offline", () => handleOffline(false));
|
|
3685
|
-
this.
|
|
3686
|
-
this.offlineBanner();
|
|
3697
|
+
this.online$.subscribe(() => this.offlineBanner());
|
|
3687
3698
|
}
|
|
3688
3699
|
if ((_a = this.options.offline) == null ? void 0 : _a.length) {
|
|
3689
3700
|
this.pwa.setup();
|
|
3690
3701
|
if (typeof indexedDB == "undefined") throw new Error("Cannot enable offline support, indexedDB is not available in this environment");
|
|
3691
|
-
this.database = new Database("datalynk", this.options.offline);
|
|
3692
3702
|
(_b = this.options.offline) == null ? void 0 : _b.forEach((id) => this.slice(id));
|
|
3693
3703
|
if (this.options.serviceWorker && typeof navigator["serviceWorker"] != "undefined") {
|
|
3694
3704
|
(async () => {
|
|
@@ -3721,24 +3731,23 @@ const _Api = class _Api {
|
|
|
3721
3731
|
}
|
|
3722
3732
|
/** Check if we are connected */
|
|
3723
3733
|
get online() {
|
|
3724
|
-
return this.
|
|
3734
|
+
return this.online$.getValue();
|
|
3725
3735
|
}
|
|
3726
3736
|
get offline() {
|
|
3727
|
-
return !this.
|
|
3737
|
+
return !this.online;
|
|
3728
3738
|
}
|
|
3729
3739
|
/** Override connection status */
|
|
3730
3740
|
set online(value) {
|
|
3731
3741
|
if (value == null) {
|
|
3732
3742
|
this.onlineOverride = false;
|
|
3733
|
-
this.
|
|
3743
|
+
this.online$.next(typeof navigator == "undefined" ? true : navigator.onLine);
|
|
3734
3744
|
} else {
|
|
3735
3745
|
this.onlineOverride = true;
|
|
3736
3746
|
if (value == this.online) return;
|
|
3737
|
-
this.
|
|
3747
|
+
this.online$.next(value);
|
|
3738
3748
|
if (value) this.startHeartbeat();
|
|
3739
3749
|
else this.stopHeartbeat();
|
|
3740
3750
|
}
|
|
3741
|
-
this.offlineBanner();
|
|
3742
3751
|
}
|
|
3743
3752
|
/** Logged in spoke */
|
|
3744
3753
|
get spoke() {
|
|
@@ -3762,6 +3771,8 @@ const _Api = class _Api {
|
|
|
3762
3771
|
}),
|
|
3763
3772
|
body: JSON.stringify(_Api.translateTokens(req))
|
|
3764
3773
|
}).then(async (resp) => {
|
|
3774
|
+
const warning = resp.headers["X-Warning"];
|
|
3775
|
+
if (warning) console.warn(warning);
|
|
3765
3776
|
this.online = true;
|
|
3766
3777
|
let data = JSONAttemptParse(await resp.text());
|
|
3767
3778
|
if (!resp.ok || (data == null ? void 0 : data.error)) throw Object.assign(errorFromCode(resp.status, data.error), data);
|
|
@@ -3771,7 +3782,7 @@ const _Api = class _Api {
|
|
|
3771
3782
|
}
|
|
3772
3783
|
async checkConnection() {
|
|
3773
3784
|
if (typeof navigator != "undefined" && !navigator.onLine) {
|
|
3774
|
-
this.
|
|
3785
|
+
this.online$.next(false);
|
|
3775
3786
|
return;
|
|
3776
3787
|
}
|
|
3777
3788
|
if (this.onlineOverride) return;
|
|
@@ -3779,9 +3790,9 @@ const _Api = class _Api {
|
|
|
3779
3790
|
const timeout = setTimeout(() => controller.abort(), this.heartbeat.timeout);
|
|
3780
3791
|
try {
|
|
3781
3792
|
const response = await fetch(this.url + this.heartbeat.target, { signal: controller.signal });
|
|
3782
|
-
this.
|
|
3793
|
+
this.online$.next(response.ok);
|
|
3783
3794
|
} catch (error) {
|
|
3784
|
-
this.
|
|
3795
|
+
this.online$.next(false);
|
|
3785
3796
|
} finally {
|
|
3786
3797
|
clearTimeout(timeout);
|
|
3787
3798
|
}
|
|
@@ -3892,13 +3903,6 @@ const _Api = class _Api {
|
|
|
3892
3903
|
{ "$_": "*" }
|
|
3893
3904
|
] }, {});
|
|
3894
3905
|
}
|
|
3895
|
-
/**
|
|
3896
|
-
* Exact same as `request` method, but logs the response in the console automatically
|
|
3897
|
-
*
|
|
3898
|
-
* @param {object | string} data Datalynk request as object or string
|
|
3899
|
-
* @param {ApiRequestOptions} options
|
|
3900
|
-
* @returns {Promise<any>} Datalynk response
|
|
3901
|
-
*/
|
|
3902
3906
|
debug(data, options = {}) {
|
|
3903
3907
|
return this.request(data, options).then((data2) => {
|
|
3904
3908
|
console.log(data2);
|
|
@@ -3908,20 +3912,14 @@ const _Api = class _Api {
|
|
|
3908
3912
|
return err;
|
|
3909
3913
|
});
|
|
3910
3914
|
}
|
|
3911
|
-
/**
|
|
3912
|
-
* Send a request to Datalynk
|
|
3913
|
-
*
|
|
3914
|
-
* @example
|
|
3915
|
-
* ```ts
|
|
3916
|
-
* const response = await api.request('$/auth/current');
|
|
3917
|
-
* ```
|
|
3918
|
-
*
|
|
3919
|
-
* @param {object} data Request using Datalynk API syntax. Strings will be converted: '$/auth/current' -> {'$/auth/current': {}}
|
|
3920
|
-
* @param {ApiRequestOptions} options
|
|
3921
|
-
* @returns {Promise<any>} Datalynk response or error
|
|
3922
|
-
*/
|
|
3923
3915
|
request(data, options = {}) {
|
|
3916
|
+
var _a, _b;
|
|
3924
3917
|
data = typeof data == "string" ? { [data]: {} } : data;
|
|
3918
|
+
let key = JSON.stringify(data);
|
|
3919
|
+
if (this.offline) {
|
|
3920
|
+
(_b = (_a = this.database) == null ? void 0 : _a.table("pending")) == null ? void 0 : _b.add(data, key);
|
|
3921
|
+
return Promise.resolve();
|
|
3922
|
+
}
|
|
3925
3923
|
if (options.noOptimize) {
|
|
3926
3924
|
return new Promise((res, rej) => {
|
|
3927
3925
|
this._request(data, options).then((resp) => {
|
|
@@ -3929,7 +3927,6 @@ const _Api = class _Api {
|
|
|
3929
3927
|
}).catch((err) => rej(err));
|
|
3930
3928
|
});
|
|
3931
3929
|
}
|
|
3932
|
-
let key = JSON.stringify(data);
|
|
3933
3930
|
if (!this.pending[key]) {
|
|
3934
3931
|
this.pending[key] = new Promise((res, rej) => this.bundle.push({ data, res, rej }));
|
|
3935
3932
|
this.pending[key].catch().then(() => delete this.pending[key]);
|
package/dist/slice.d.ts
CHANGED
|
@@ -231,14 +231,17 @@ export declare class ApiCall<T extends Meta = any> {
|
|
|
231
231
|
export declare class Slice<T extends Meta = any> {
|
|
232
232
|
private slice;
|
|
233
233
|
private api;
|
|
234
|
+
static idMap: {
|
|
235
|
+
[key: number]: number;
|
|
236
|
+
};
|
|
237
|
+
static nextId: number;
|
|
234
238
|
private table?;
|
|
235
239
|
private info?;
|
|
236
240
|
private loaded;
|
|
237
|
-
private pendingInsert;
|
|
238
|
-
/** Unsubscribe from changes, undefined if not subscribed */
|
|
239
|
-
unsubscribe?: Unsubscribe | null;
|
|
240
241
|
/** Cached slice data as an observable */
|
|
241
242
|
cache$: BehaviorSubject<T[]>;
|
|
243
|
+
/** Unsubscribe from changes, undefined if not subscribed */
|
|
244
|
+
unsubscribe?: Unsubscribe | null;
|
|
242
245
|
/** Cached slice data */
|
|
243
246
|
get cache(): T[];
|
|
244
247
|
/** Set cached data & alert subscribers */
|
|
@@ -252,7 +255,6 @@ export declare class Slice<T extends Meta = any> {
|
|
|
252
255
|
* @param {Api} api Api to send the requests through
|
|
253
256
|
*/
|
|
254
257
|
constructor(slice: number | string, api: Api);
|
|
255
|
-
private fixIncrement;
|
|
256
258
|
private execWrapper;
|
|
257
259
|
pushChanges(): Promise<void>;
|
|
258
260
|
/**
|
package/dist/slice.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../src/slice.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAiC,MAAM,MAAM,CAAC;AACrE,OAAO,EAAC,GAAG,EAAE,iBAAiB,EAAC,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAE,SAAS,EAAC,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAmB,WAAW,EAAC,MAAM,UAAU,CAAC;AAEvD,qBAAa,OAAO,CAAC,CAAC,SAAS,IAAI,GAAG,GAAG;IAmB5B,OAAO,CAAC,QAAQ,CAAC,GAAG;aAAuB,KAAK,EAAE,MAAM,GAAG,MAAM;IAlB7E,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,CAAgB;IACjC,OAAO,CAAC,OAAO,CAAW;IAE1B,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,0BAA0B;IAC1B,IAAI,GAAG;;;OAQN;gBAE4B,GAAG,EAAE,GAAG,EAAkB,KAAK,EAAE,MAAM,GAAG,MAAM;IAE7E;;;;;;;;;OASG;IACH,KAAK;oBA0Ga,MAAM,EAAE,GAAG,IAAI;gBACnB;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;SAAE,GAAG,IAAI;MA3GnC;IAEpB;;;;;;;;;;;OAWG;IACH,GAAG,IAAI,IAAI;IAOX;;;;;;;;;;OAUG;IACH,KAAK,CAAC,GAAG,GAAE,MAAM,GAAG,MAAa,GAAG,IAAI;IAMxC;;;;OAIG;IACH,KAAK,CAAC,OAAO,UAAO,GAAG,IAAI;IA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ACH,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAO7B;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE;CAKpB"}
|
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.6",
|
|
6
6
|
"author": "Zak Timson <zaktimson@gmail.com>",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "./dist/index.cjs",
|