@azrico/webobject 1.5.14 → 1.5.16
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.
|
@@ -132,7 +132,13 @@ export declare class WebObject extends SimpleObject {
|
|
|
132
132
|
* @param search
|
|
133
133
|
* @returns
|
|
134
134
|
*/
|
|
135
|
-
static get_list_cache(search?: any): Promise<Array<WebObject
|
|
135
|
+
static get_list_cache(search?: any): Promise<Array<WebObject>>;
|
|
136
|
+
/**
|
|
137
|
+
* uses `get_list_cache` then the `equals` function to return matched result
|
|
138
|
+
* @param search
|
|
139
|
+
* @returns
|
|
140
|
+
*/
|
|
141
|
+
static get_single_cache(search: any): Promise<WebObject | undefined>;
|
|
136
142
|
/**
|
|
137
143
|
* Get a list of web objects and convert them to basic objects
|
|
138
144
|
* can be passed to client components
|
|
@@ -1329,7 +1329,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1329
1329
|
search,
|
|
1330
1330
|
readonly,
|
|
1331
1331
|
fetchID,
|
|
1332
|
-
|
|
1332
|
+
result,
|
|
1333
1333
|
params,
|
|
1334
1334
|
_args24 = arguments;
|
|
1335
1335
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
@@ -1366,21 +1366,21 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1366
1366
|
__searchid: search
|
|
1367
1367
|
}, readonly, fetchID);
|
|
1368
1368
|
case 14:
|
|
1369
|
-
|
|
1369
|
+
result = _context24.sent;
|
|
1370
1370
|
return _context24.abrupt("break", 20);
|
|
1371
1371
|
case 16:
|
|
1372
1372
|
_context24.next = 18;
|
|
1373
1373
|
return this.get_list(search, readonly, fetchID);
|
|
1374
1374
|
case 18:
|
|
1375
|
-
|
|
1375
|
+
result = _context24.sent;
|
|
1376
1376
|
return _context24.abrupt("break", 20);
|
|
1377
1377
|
case 20:
|
|
1378
|
-
if (
|
|
1379
|
-
if (!(0, _object.object_isEmpty)(
|
|
1380
|
-
|
|
1381
|
-
WebObject.setReadonly(
|
|
1378
|
+
if (result) result = (0, _object.array_first)(result);
|
|
1379
|
+
if (!(0, _object.object_isEmpty)(result)) {
|
|
1380
|
+
result = this.ensure(this, result);
|
|
1381
|
+
WebObject.setReadonly(result, readonly);
|
|
1382
1382
|
}
|
|
1383
|
-
return _context24.abrupt("return",
|
|
1383
|
+
return _context24.abrupt("return", result);
|
|
1384
1384
|
case 23:
|
|
1385
1385
|
case "end":
|
|
1386
1386
|
return _context24.stop();
|
|
@@ -1501,6 +1501,37 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
return get_list_cache;
|
|
1503
1503
|
}()
|
|
1504
|
+
/**
|
|
1505
|
+
* uses `get_list_cache` then the `equals` function to return matched result
|
|
1506
|
+
* @param search
|
|
1507
|
+
* @returns
|
|
1508
|
+
*/
|
|
1509
|
+
)
|
|
1510
|
+
}, {
|
|
1511
|
+
key: "get_single_cache",
|
|
1512
|
+
value: (function () {
|
|
1513
|
+
var _get_single_cache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(search) {
|
|
1514
|
+
var _this4 = this;
|
|
1515
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
1516
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1517
|
+
case 0:
|
|
1518
|
+
_context28.next = 2;
|
|
1519
|
+
return this.get_list_cache();
|
|
1520
|
+
case 2:
|
|
1521
|
+
return _context28.abrupt("return", _context28.sent.find(function (s) {
|
|
1522
|
+
return _this4.equals(s, search);
|
|
1523
|
+
}));
|
|
1524
|
+
case 3:
|
|
1525
|
+
case "end":
|
|
1526
|
+
return _context28.stop();
|
|
1527
|
+
}
|
|
1528
|
+
}, _callee28, this);
|
|
1529
|
+
}));
|
|
1530
|
+
function get_single_cache(_x10) {
|
|
1531
|
+
return _get_single_cache.apply(this, arguments);
|
|
1532
|
+
}
|
|
1533
|
+
return get_single_cache;
|
|
1534
|
+
}()
|
|
1504
1535
|
/**
|
|
1505
1536
|
* Get a list of web objects and convert them to basic objects
|
|
1506
1537
|
* can be passed to client components
|
|
@@ -1510,43 +1541,43 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1510
1541
|
}, {
|
|
1511
1542
|
key: "get_basicList",
|
|
1512
1543
|
value: (function () {
|
|
1513
|
-
var _get_basicList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1544
|
+
var _get_basicList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
1514
1545
|
var itemlist,
|
|
1515
|
-
|
|
1516
|
-
return _regeneratorRuntime().wrap(function
|
|
1517
|
-
while (1) switch (
|
|
1546
|
+
_args30 = arguments;
|
|
1547
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
1548
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1518
1549
|
case 0:
|
|
1519
|
-
|
|
1520
|
-
return this.get_list.apply(this,
|
|
1550
|
+
_context30.next = 2;
|
|
1551
|
+
return this.get_list.apply(this, _args30);
|
|
1521
1552
|
case 2:
|
|
1522
|
-
itemlist =
|
|
1523
|
-
|
|
1553
|
+
itemlist = _context30.sent;
|
|
1554
|
+
_context30.next = 5;
|
|
1524
1555
|
return Promise.all(itemlist.map( /*#__PURE__*/function () {
|
|
1525
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1526
|
-
return _regeneratorRuntime().wrap(function
|
|
1527
|
-
while (1) switch (
|
|
1556
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(r) {
|
|
1557
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
1558
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1528
1559
|
case 0:
|
|
1529
|
-
|
|
1560
|
+
_context29.next = 2;
|
|
1530
1561
|
return r.get_basicObject();
|
|
1531
1562
|
case 2:
|
|
1532
|
-
return
|
|
1563
|
+
return _context29.abrupt("return", _context29.sent);
|
|
1533
1564
|
case 3:
|
|
1534
1565
|
case "end":
|
|
1535
|
-
return
|
|
1566
|
+
return _context29.stop();
|
|
1536
1567
|
}
|
|
1537
|
-
},
|
|
1568
|
+
}, _callee29);
|
|
1538
1569
|
}));
|
|
1539
|
-
return function (
|
|
1570
|
+
return function (_x11) {
|
|
1540
1571
|
return _ref3.apply(this, arguments);
|
|
1541
1572
|
};
|
|
1542
1573
|
}()));
|
|
1543
1574
|
case 5:
|
|
1544
|
-
return
|
|
1575
|
+
return _context30.abrupt("return", _context30.sent);
|
|
1545
1576
|
case 6:
|
|
1546
1577
|
case "end":
|
|
1547
|
-
return
|
|
1578
|
+
return _context30.stop();
|
|
1548
1579
|
}
|
|
1549
|
-
},
|
|
1580
|
+
}, _callee30, this);
|
|
1550
1581
|
}));
|
|
1551
1582
|
function get_basicList() {
|
|
1552
1583
|
return _get_basicList.apply(this, arguments);
|