@azrico/webobject 1.5.13 → 1.5.14

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.
@@ -126,6 +126,13 @@ export declare class WebObject extends SimpleObject {
126
126
  * default order of parameters : search,readonly,fetchID
127
127
  */
128
128
  static get_list(...p: any[]): Promise<Array<WebObject | any>>;
129
+ /**
130
+ * uses `get_list` and then saves the result to `gcache`
131
+ * then uses the `equals` function to return matched results
132
+ * @param search
133
+ * @returns
134
+ */
135
+ static get_list_cache(search?: any): Promise<Array<WebObject | any>>;
129
136
  /**
130
137
  * Get a list of web objects and convert them to basic objects
131
138
  * can be passed to client components
@@ -1448,6 +1448,59 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
1448
1448
  }
1449
1449
  return get_list;
1450
1450
  }()
1451
+ /**
1452
+ * uses `get_list` and then saves the result to `gcache`
1453
+ * then uses the `equals` function to return matched results
1454
+ * @param search
1455
+ * @returns
1456
+ */
1457
+ )
1458
+ }, {
1459
+ key: "get_list_cache",
1460
+ value: (function () {
1461
+ var _get_list_cache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(search) {
1462
+ var _this3 = this;
1463
+ var all_data;
1464
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1465
+ while (1) switch (_context27.prev = _context27.next) {
1466
+ case 0:
1467
+ _context27.next = 2;
1468
+ return _global.gcache.get_temp_cache(this.get_webpath(), /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1469
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1470
+ while (1) switch (_context26.prev = _context26.next) {
1471
+ case 0:
1472
+ _context26.next = 2;
1473
+ return _this3.get_list();
1474
+ case 2:
1475
+ return _context26.abrupt("return", _context26.sent);
1476
+ case 3:
1477
+ case "end":
1478
+ return _context26.stop();
1479
+ }
1480
+ }, _callee26);
1481
+ })));
1482
+ case 2:
1483
+ all_data = _context27.sent;
1484
+ if (search) {
1485
+ _context27.next = 5;
1486
+ break;
1487
+ }
1488
+ return _context27.abrupt("return", all_data);
1489
+ case 5:
1490
+ return _context27.abrupt("return", all_data.filter(function (s) {
1491
+ return _this3.equals(s, search);
1492
+ }));
1493
+ case 6:
1494
+ case "end":
1495
+ return _context27.stop();
1496
+ }
1497
+ }, _callee27, this);
1498
+ }));
1499
+ function get_list_cache(_x9) {
1500
+ return _get_list_cache.apply(this, arguments);
1501
+ }
1502
+ return get_list_cache;
1503
+ }()
1451
1504
  /**
1452
1505
  * Get a list of web objects and convert them to basic objects
1453
1506
  * can be passed to client components
@@ -1457,43 +1510,43 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
1457
1510
  }, {
1458
1511
  key: "get_basicList",
1459
1512
  value: (function () {
1460
- var _get_basicList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
1513
+ var _get_basicList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
1461
1514
  var itemlist,
1462
- _args27 = arguments;
1463
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1464
- while (1) switch (_context27.prev = _context27.next) {
1515
+ _args29 = arguments;
1516
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1517
+ while (1) switch (_context29.prev = _context29.next) {
1465
1518
  case 0:
1466
- _context27.next = 2;
1467
- return this.get_list.apply(this, _args27);
1519
+ _context29.next = 2;
1520
+ return this.get_list.apply(this, _args29);
1468
1521
  case 2:
1469
- itemlist = _context27.sent;
1470
- _context27.next = 5;
1522
+ itemlist = _context29.sent;
1523
+ _context29.next = 5;
1471
1524
  return Promise.all(itemlist.map( /*#__PURE__*/function () {
1472
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(r) {
1473
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1474
- while (1) switch (_context26.prev = _context26.next) {
1525
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(r) {
1526
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1527
+ while (1) switch (_context28.prev = _context28.next) {
1475
1528
  case 0:
1476
- _context26.next = 2;
1529
+ _context28.next = 2;
1477
1530
  return r.get_basicObject();
1478
1531
  case 2:
1479
- return _context26.abrupt("return", _context26.sent);
1532
+ return _context28.abrupt("return", _context28.sent);
1480
1533
  case 3:
1481
1534
  case "end":
1482
- return _context26.stop();
1535
+ return _context28.stop();
1483
1536
  }
1484
- }, _callee26);
1537
+ }, _callee28);
1485
1538
  }));
1486
- return function (_x9) {
1487
- return _ref2.apply(this, arguments);
1539
+ return function (_x10) {
1540
+ return _ref3.apply(this, arguments);
1488
1541
  };
1489
1542
  }()));
1490
1543
  case 5:
1491
- return _context27.abrupt("return", _context27.sent);
1544
+ return _context29.abrupt("return", _context29.sent);
1492
1545
  case 6:
1493
1546
  case "end":
1494
- return _context27.stop();
1547
+ return _context29.stop();
1495
1548
  }
1496
- }, _callee27, this);
1549
+ }, _callee29, this);
1497
1550
  }));
1498
1551
  function get_basicList() {
1499
1552
  return _get_basicList.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.5.13",
3
+ "version": "1.5.14",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",