@xata.io/client 0.0.0-alpha.ve99ba43 → 0.0.0-alpha.veb4417f

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.cjs CHANGED
@@ -1142,9 +1142,7 @@ function isIdentifiable(x) {
1142
1142
  return isObject(x) && isString(x?.id);
1143
1143
  }
1144
1144
  function isXataRecord(x) {
1145
- const record = x;
1146
- const metadata = record?.getMetadata();
1147
- return isIdentifiable(x) && isObject(metadata) && typeof metadata.version === "number";
1145
+ return isIdentifiable(x) && typeof x?.xata === "object" && typeof x?.xata?.version === "number";
1148
1146
  }
1149
1147
 
1150
1148
  function isSortFilterString(value) {
@@ -1534,8 +1532,7 @@ const transformObjectLinks = (object) => {
1534
1532
  };
1535
1533
  const initObject = (db, schema, table, object) => {
1536
1534
  const result = {};
1537
- const { xata, ...rest } = object ?? {};
1538
- Object.assign(result, rest);
1535
+ Object.assign(result, object);
1539
1536
  const { columns } = schema.tables.find(({ name }) => name === table) ?? {};
1540
1537
  if (!columns)
1541
1538
  console.error(`Table ${table} not found in schema`);
@@ -1571,10 +1568,7 @@ const initObject = (db, schema, table, object) => {
1571
1568
  result.delete = function() {
1572
1569
  return db[table].delete(result["id"]);
1573
1570
  };
1574
- result.getMetadata = function() {
1575
- return xata;
1576
- };
1577
- for (const prop of ["read", "update", "delete", "getMetadata"]) {
1571
+ for (const prop of ["read", "update", "delete"]) {
1578
1572
  Object.defineProperty(result, prop, { enumerable: false });
1579
1573
  }
1580
1574
  Object.freeze(result);