@onehat/data 1.6.10 → 1.6.11

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.
@@ -722,6 +722,7 @@ describe('Repository Base', function() {
722
722
  // undeleteByRange
723
723
  // undeleteBy
724
724
  // undeleteById
725
+ // undeleteDeleted
725
726
 
726
727
  });
727
728
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.6.10",
3
+ "version": "1.6.11",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1479,7 +1479,7 @@ export default class Repository extends EventEmitter {
1479
1479
  }
1480
1480
 
1481
1481
  /**
1482
- * Deletes a single Entity by its index (zero-indexed) on the current page
1482
+ * Undelete a single Entity by its index (zero-indexed) on the current page
1483
1483
  * @param {integer} ix - Index
1484
1484
  * @return {object} entity - Entity
1485
1485
  */
@@ -1488,7 +1488,7 @@ export default class Repository extends EventEmitter {
1488
1488
  }
1489
1489
 
1490
1490
  /**
1491
- * Deletes multiple Entities by their range of indices
1491
+ * Undelete multiple Entities by their range of indices
1492
1492
  * (zero-indexed) on the current page
1493
1493
  * @param {integer} startIx - Index
1494
1494
  * @param {integer} endIx - Index (inclusive)
@@ -1499,7 +1499,7 @@ export default class Repository extends EventEmitter {
1499
1499
  }
1500
1500
 
1501
1501
  /**
1502
- * Remove multiple Entities by supplied filter function
1502
+ * Undelete multiple Entities by supplied filter function
1503
1503
  * @param {function} fn - Filter function to apply to all entities
1504
1504
  * @return {Entity[]} Entities that passed through filter
1505
1505
  */
@@ -1508,7 +1508,7 @@ export default class Repository extends EventEmitter {
1508
1508
  }
1509
1509
 
1510
1510
  /**
1511
- * Remove a single Entity by its id
1511
+ * Undelete a single Entity by its id
1512
1512
  * @param {integer} id - id of record to retrieve
1513
1513
  * @return {Entity} The Entity with matching id
1514
1514
  */
@@ -1516,6 +1516,14 @@ export default class Repository extends EventEmitter {
1516
1516
  await this.undelete(this.getById(id));
1517
1517
  }
1518
1518
 
1519
+ /**
1520
+ * Undelete all deleted Entities
1521
+ * @return {Entity[]} Entities that passed through filter
1522
+ */
1523
+ undeleteDeleted = async () => {
1524
+ await this.undelete(this.getDeleted());
1525
+ }
1526
+
1519
1527
 
1520
1528
 
1521
1529