@powersync/common 1.40.0 → 1.41.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/index.d.cts CHANGED
@@ -1748,7 +1748,6 @@ declare class Schema<S extends SchemaType = SchemaType> {
1748
1748
  }[];
1749
1749
  raw_tables: RawTable[];
1750
1750
  };
1751
- private convertToClassicTables;
1752
1751
  }
1753
1752
 
1754
1753
  interface PowerSyncBackendConnector {
@@ -50,6 +50,5 @@ export declare class Schema<S extends SchemaType = SchemaType> {
50
50
  }[];
51
51
  raw_tables: RawTable[];
52
52
  };
53
- private convertToClassicTables;
54
53
  }
55
54
  export {};
@@ -25,8 +25,9 @@ export class Schema {
25
25
  this.tables = tables;
26
26
  }
27
27
  else {
28
- this.props = tables;
29
- this.tables = this.convertToClassicTables(this.props);
28
+ // Update the table entries with the provided table name key
29
+ this.props = Object.fromEntries(Object.entries(tables).map(([tableName, table]) => [tableName, table.copyWithName(tableName)]));
30
+ this.tables = Object.values(this.props);
30
31
  }
31
32
  this.rawTables = [];
32
33
  }
@@ -52,14 +53,8 @@ export class Schema {
52
53
  }
53
54
  toJSON() {
54
55
  return {
55
- // This is required because "name" field is not present in TableV2
56
56
  tables: this.tables.map((t) => t.toJSON()),
57
57
  raw_tables: this.rawTables
58
58
  };
59
59
  }
60
- convertToClassicTables(props) {
61
- return Object.entries(props).map(([name, table]) => {
62
- return table.copyWithName(name);
63
- });
64
- }
65
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powersync/common",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"