@baasix/sdk 0.1.15 → 0.1.17

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
@@ -558,6 +558,7 @@ await baasix.schemas.create({
558
558
  name: 'Product',
559
559
  timestamps: true,
560
560
  paranoid: true, // Soft deletes
561
+ tenantScoped: true, // Tenant-scoped by default; set false for global/shared collections
561
562
  fields: {
562
563
  id: {
563
564
  type: 'UUID',
package/dist/index.cjs CHANGED
@@ -1570,13 +1570,16 @@ var ItemsModule = class {
1570
1570
  /**
1571
1571
  * Restore a soft-deleted item
1572
1572
  *
1573
+ * Only works for collections with `paranoid: true`. Clears the `deletedAt`
1574
+ * timestamp so the record reappears in normal queries.
1575
+ *
1573
1576
  * @example
1574
1577
  * ```typescript
1575
1578
  * await items.restore('product-uuid');
1576
1579
  * ```
1577
1580
  */
1578
1581
  async restore(id) {
1579
- await this.update(id, { deletedAt: null });
1582
+ await this.client.post(`/items/${this.collection}/${id}/restore`);
1580
1583
  }
1581
1584
  /**
1582
1585
  * Aggregate data with grouping
@@ -2088,6 +2091,7 @@ var SchemasModule = class {
2088
2091
  * name: 'Order',
2089
2092
  * timestamps: true,
2090
2093
  * paranoid: true,
2094
+ * tenantScoped: true,
2091
2095
  * fields: {
2092
2096
  * id: {
2093
2097
  * type: 'UUID',