@edge-base/react-native 0.1.2 → 0.1.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/dist/index.d.cts CHANGED
@@ -1098,7 +1098,7 @@ declare class ClientEdgeBase {
1098
1098
  * Select a DB block by namespace and optional instance ID (#133 §2).
1099
1099
  *
1100
1100
  * @example
1101
- * const posts = await client.db('shared').table('posts').where('status', '==', 'published').get();
1101
+ * const posts = await client.db('shared').table('posts').where('status', '==', 'published').getList();
1102
1102
  * client.db('shared').table('posts').onSnapshot((change) => { ... });
1103
1103
  */
1104
1104
  db(namespace: string, instanceId?: string): DbRef;
package/dist/index.d.ts CHANGED
@@ -1098,7 +1098,7 @@ declare class ClientEdgeBase {
1098
1098
  * Select a DB block by namespace and optional instance ID (#133 §2).
1099
1099
  *
1100
1100
  * @example
1101
- * const posts = await client.db('shared').table('posts').where('status', '==', 'published').get();
1101
+ * const posts = await client.db('shared').table('posts').where('status', '==', 'published').getList();
1102
1102
  * client.db('shared').table('posts').onSnapshot((change) => { ... });
1103
1103
  */
1104
1104
  db(namespace: string, instanceId?: string): DbRef;
package/dist/index.js CHANGED
@@ -752,7 +752,7 @@ var DatabaseLiveClient = class {
752
752
  (refreshToken) => refreshAccessToken(this.baseUrl, refreshToken)
753
753
  );
754
754
  if (!token) throw new EdgeBaseError(401, "No access token available. Sign in first.");
755
- this.sendRaw({ type: "auth", token, sdkVersion: "0.1.0" });
755
+ this.sendRaw({ type: "auth", token, sdkVersion: "0.1.4" });
756
756
  return new Promise((resolve, reject) => {
757
757
  const timeout = setTimeout(() => reject(new EdgeBaseError(401, "Auth timeout")), 1e4);
758
758
  const original = this.ws?.onmessage;
@@ -872,7 +872,7 @@ var DatabaseLiveClient = class {
872
872
  refreshAuth() {
873
873
  const token = this.tokenManager.currentAccessToken;
874
874
  if (!token || !this.ws || !this.connected) return;
875
- this.sendRaw({ type: "auth", token, sdkVersion: "0.1.0" });
875
+ this.sendRaw({ type: "auth", token, sdkVersion: "0.1.4" });
876
876
  }
877
877
  handleAuthStateChange(user) {
878
878
  if (user) {
@@ -1016,8 +1016,10 @@ function matchesDatabaseLiveChannel(channel, change, messageChannel) {
1016
1016
  }
1017
1017
  return parts[3] === change.table && change.docId === parts[4];
1018
1018
  }
1019
+ var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
1019
1020
  function deepSet(obj, path, value) {
1020
1021
  const parts = path.split(".");
1022
+ if (parts.some((p) => UNSAFE_KEYS.has(p))) return;
1021
1023
  let current = obj;
1022
1024
  for (let i = 0; i < parts.length - 1; i++) {
1023
1025
  const key = parts[i];
@@ -2863,7 +2865,7 @@ var ClientEdgeBase = class {
2863
2865
  * Select a DB block by namespace and optional instance ID (#133 §2).
2864
2866
  *
2865
2867
  * @example
2866
- * const posts = await client.db('shared').table('posts').where('status', '==', 'published').get();
2868
+ * const posts = await client.db('shared').table('posts').where('status', '==', 'published').getList();
2867
2869
  * client.db('shared').table('posts').onSnapshot((change) => { ... });
2868
2870
  */
2869
2871
  db(namespace, instanceId) {