@auxilium/datalynk-client 0.6.14 → 0.7.1

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 CHANGED
@@ -11,6 +11,7 @@ Datalynk client library to integrate JavaScript clients with the Datalynk API.
11
11
  - [Table of Contents](#Table-of-Contents)
12
12
  - [Quick Start](#quick-start)
13
13
  - [Documentation](#documentation)
14
+ - [API Documentation](https://auxilium.pages.gitlab.auxiliumgroup.com/datalynk/datalynk-client)
14
15
  - [Integration](#integration)
15
16
  - [Angular](#integration)
16
17
  - [Node / Vue](#integration)
@@ -45,7 +46,7 @@ const resp = await api.request({'$/auth/current':{}});
45
46
 
46
47
  ## Documentation
47
48
 
48
- The full documentation can be found [here](./docs/Home.md).
49
+ [Full API Documentation](https://auxilium.pages.gitlab.auxiliumgroup.com/datalynk/datalynk-client)
49
50
 
50
51
  <details>
51
52
  <summary>
package/dist/index.cjs CHANGED
@@ -660,8 +660,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
660
660
  return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
661
661
  },
662
662
  clearTimeout: function(handle) {
663
- var delegate = timeoutProvider.delegate;
664
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
663
+ return clearTimeout(handle);
665
664
  },
666
665
  delegate: void 0
667
666
  };
@@ -1551,7 +1550,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1551
1550
  * @returns {Promise<any>} Session information returned from login request
1552
1551
  */
1553
1552
  login(spoke, login, password, twoFactor) {
1554
- return fetch(`${this.api.url}login`, {
1553
+ return fetch(`${this.api.url + "login"}`, {
1555
1554
  method: "POST",
1556
1555
  body: St(ot({
1557
1556
  realm: spoke.trim(),
@@ -1573,7 +1572,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1573
1572
  * @return {Promise<any>}
1574
1573
  */
1575
1574
  loginGuest() {
1576
- return fetch(`${this.api.url}guest`).then(async (resp) => {
1575
+ return fetch(`${this.api.url.replace("/api/", "/guest/")}`).then(async (resp) => {
1577
1576
  const data = await resp.json().catch(() => ({}));
1578
1577
  if (!resp.ok || data["error"]) throw Object.assign(kt(resp.status, data.error) || {}, data);
1579
1578
  this.api.token = data["token"];
@@ -2065,9 +2064,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2065
2064
  if (on) {
2066
2065
  new Slice(this.slice, this.api).select().exec().rows().then((rows) => this.cache = rows);
2067
2066
  if (!this.unsubscribe) this.unsubscribe = this.api.socket.sliceEvents(this.slice, (event) => {
2068
- const ids = [...event.data.insert, ...event.data.update];
2067
+ const ids = [...event.data.new, ...event.data.changed];
2069
2068
  new Slice(this.slice, this.api).select(ids).exec().rows().then((rows) => this.cache = [...this.cache.filter((c2) => c2.id != null && !ids.includes(c2.id)), ...rows]);
2070
- this.cache = this.cache.filter((v2) => v2.id && !event.data.remove.includes(v2.id));
2069
+ this.cache = this.cache.filter((v2) => v2.id && !event.data.lost.includes(v2.id));
2071
2070
  });
2072
2071
  return this.cache$;
2073
2072
  } else if (this.unsubscribe) {
package/dist/index.mjs CHANGED
@@ -656,8 +656,7 @@ var timeoutProvider = {
656
656
  return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));
657
657
  },
658
658
  clearTimeout: function(handle) {
659
- var delegate = timeoutProvider.delegate;
660
- return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
659
+ return clearTimeout(handle);
661
660
  },
662
661
  delegate: void 0
663
662
  };
@@ -1547,7 +1546,7 @@ class Auth {
1547
1546
  * @returns {Promise<any>} Session information returned from login request
1548
1547
  */
1549
1548
  login(spoke, login, password, twoFactor) {
1550
- return fetch(`${this.api.url}login`, {
1549
+ return fetch(`${this.api.url + "login"}`, {
1551
1550
  method: "POST",
1552
1551
  body: St(ot({
1553
1552
  realm: spoke.trim(),
@@ -1569,7 +1568,7 @@ class Auth {
1569
1568
  * @return {Promise<any>}
1570
1569
  */
1571
1570
  loginGuest() {
1572
- return fetch(`${this.api.url}guest`).then(async (resp) => {
1571
+ return fetch(`${this.api.url.replace("/api/", "/guest/")}`).then(async (resp) => {
1573
1572
  const data = await resp.json().catch(() => ({}));
1574
1573
  if (!resp.ok || data["error"]) throw Object.assign(kt(resp.status, data.error) || {}, data);
1575
1574
  this.api.token = data["token"];
@@ -2061,9 +2060,9 @@ class Slice {
2061
2060
  if (on) {
2062
2061
  new Slice(this.slice, this.api).select().exec().rows().then((rows) => this.cache = rows);
2063
2062
  if (!this.unsubscribe) this.unsubscribe = this.api.socket.sliceEvents(this.slice, (event) => {
2064
- const ids = [...event.data.insert, ...event.data.update];
2063
+ const ids = [...event.data.new, ...event.data.changed];
2065
2064
  new Slice(this.slice, this.api).select(ids).exec().rows().then((rows) => this.cache = [...this.cache.filter((c2) => c2.id != null && !ids.includes(c2.id)), ...rows]);
2066
- this.cache = this.cache.filter((v2) => v2.id && !event.data.remove.includes(v2.id));
2065
+ this.cache = this.cache.filter((v2) => v2.id && !event.data.lost.includes(v2.id));
2067
2066
  });
2068
2067
  return this.cache$;
2069
2068
  } else if (this.unsubscribe) {
package/dist/socket.d.ts CHANGED
@@ -8,9 +8,10 @@ export type SocketEvent<T> = {
8
8
  };
9
9
  export type SocketEventSlice = SocketEvent<{
10
10
  slice: number;
11
- insert: number[];
12
- update: number[];
13
- remove: number[];
11
+ tx: string;
12
+ new: number[];
13
+ lost: number[];
14
+ changed: number[];
14
15
  }>;
15
16
  /** Connection options */
16
17
  export type SocketOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../src/socket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAA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AAO,SAAQ;IA+BvB;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,GAAG;IAIjB;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAAC,GAAG,WAAW;CAelH"}
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": "0.6.14",
5
+ "version": "0.7.1",
6
6
  "author": "Zak Timson <zaktimson@gmail.com>",
7
7
  "private": false,
8
8
  "main": "./dist/index.cjs",
@@ -25,15 +25,13 @@
25
25
  "watch": "vite build --watch"
26
26
  },
27
27
  "dependencies": {
28
- "@ztimson/utils": "0.16.9",
28
+ "@ztimson/utils": "0.16.10",
29
29
  "rxjs": "^7.8.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^20.14.10",
33
- "@types/read": "^0.0.32",
34
33
  "ts-node": "^10.9.2",
35
34
  "typedoc": "^0.26.7",
36
- "typedoc-plugin-markdown": "^4.2.7",
37
35
  "typescript": "^5.5.3",
38
36
  "vite": "^5.0.12",
39
37
  "vite-plugin-dts": "^3.7.2"