@niledatabase/server 3.0.0-alpha.21 → 3.0.0-alpha.22
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.
|
@@ -1543,105 +1543,107 @@ function _fetch2() {
|
|
|
1543
1543
|
case 18:
|
|
1544
1544
|
response = _context.sent;
|
|
1545
1545
|
if (!(response && response.status >= 200 && response.status < 300)) {
|
|
1546
|
-
_context.next =
|
|
1546
|
+
_context.next = 42;
|
|
1547
1547
|
break;
|
|
1548
1548
|
}
|
|
1549
1549
|
if (!(typeof response.clone === 'function')) {
|
|
1550
|
-
_context.next =
|
|
1550
|
+
_context.next = 41;
|
|
1551
1551
|
break;
|
|
1552
1552
|
}
|
|
1553
1553
|
_context.prev = 21;
|
|
1554
1554
|
_context.t0 = info;
|
|
1555
|
-
_context.
|
|
1555
|
+
_context.t1 = JSON;
|
|
1556
|
+
_context.next = 26;
|
|
1556
1557
|
return response.clone().json();
|
|
1557
|
-
case
|
|
1558
|
-
_context.
|
|
1559
|
-
_context.
|
|
1560
|
-
|
|
1561
|
-
_context.
|
|
1558
|
+
case 26:
|
|
1559
|
+
_context.t2 = _context.sent;
|
|
1560
|
+
_context.t3 = _context.t1.stringify.call(_context.t1, _context.t2);
|
|
1561
|
+
_context.t4 = "[fetch][response] " + _context.t3;
|
|
1562
|
+
(0, _context.t0)(_context.t4);
|
|
1563
|
+
_context.next = 41;
|
|
1562
1564
|
break;
|
|
1563
|
-
case
|
|
1564
|
-
_context.prev =
|
|
1565
|
-
_context.
|
|
1566
|
-
_context.
|
|
1567
|
-
_context.next =
|
|
1565
|
+
case 32:
|
|
1566
|
+
_context.prev = 32;
|
|
1567
|
+
_context.t5 = _context["catch"](21);
|
|
1568
|
+
_context.t6 = info;
|
|
1569
|
+
_context.next = 37;
|
|
1568
1570
|
return response.clone().text();
|
|
1569
|
-
case
|
|
1570
|
-
_context.
|
|
1571
|
-
_context.
|
|
1572
|
-
_context.
|
|
1573
|
-
e: _context.
|
|
1571
|
+
case 37:
|
|
1572
|
+
_context.t7 = _context.sent;
|
|
1573
|
+
_context.t8 = "[fetch][response] " + _context.t7;
|
|
1574
|
+
_context.t9 = {
|
|
1575
|
+
e: _context.t5
|
|
1574
1576
|
};
|
|
1575
|
-
(0, _context.
|
|
1576
|
-
case
|
|
1577
|
+
(0, _context.t6)(_context.t8, _context.t9);
|
|
1578
|
+
case 41:
|
|
1577
1579
|
return _context.abrupt("return", response);
|
|
1578
|
-
case
|
|
1580
|
+
case 42:
|
|
1579
1581
|
if (!((response == null ? void 0 : response.status) === 404)) {
|
|
1580
|
-
_context.next =
|
|
1582
|
+
_context.next = 44;
|
|
1581
1583
|
break;
|
|
1582
1584
|
}
|
|
1583
1585
|
return _context.abrupt("return", new ResponseError('Not found', {
|
|
1584
1586
|
status: 404
|
|
1585
1587
|
}));
|
|
1586
|
-
case
|
|
1588
|
+
case 44:
|
|
1587
1589
|
if (!((response == null ? void 0 : response.status) === 401)) {
|
|
1588
|
-
_context.next =
|
|
1590
|
+
_context.next = 46;
|
|
1589
1591
|
break;
|
|
1590
1592
|
}
|
|
1591
1593
|
return _context.abrupt("return", new ResponseError('Unauthorized', {
|
|
1592
1594
|
status: 401
|
|
1593
1595
|
}));
|
|
1594
|
-
case
|
|
1596
|
+
case 46:
|
|
1595
1597
|
if (!((response == null ? void 0 : response.status) === 405)) {
|
|
1596
|
-
_context.next =
|
|
1598
|
+
_context.next = 48;
|
|
1597
1599
|
break;
|
|
1598
1600
|
}
|
|
1599
1601
|
return _context.abrupt("return", new ResponseError('Method not allowed', {
|
|
1600
1602
|
status: 405
|
|
1601
1603
|
}));
|
|
1602
|
-
case
|
|
1604
|
+
case 48:
|
|
1603
1605
|
errorHandler = typeof (response == null ? void 0 : response.clone) === 'function' ? response.clone() : null;
|
|
1604
1606
|
msg = '';
|
|
1605
|
-
_context.prev =
|
|
1606
|
-
_context.next =
|
|
1607
|
+
_context.prev = 50;
|
|
1608
|
+
_context.next = 53;
|
|
1607
1609
|
return response == null ? void 0 : response.json();
|
|
1608
|
-
case
|
|
1610
|
+
case 53:
|
|
1609
1611
|
res = _context.sent;
|
|
1610
|
-
_context.next =
|
|
1612
|
+
_context.next = 64;
|
|
1611
1613
|
break;
|
|
1612
|
-
case
|
|
1613
|
-
_context.prev =
|
|
1614
|
-
_context.
|
|
1614
|
+
case 56:
|
|
1615
|
+
_context.prev = 56;
|
|
1616
|
+
_context.t10 = _context["catch"](50);
|
|
1615
1617
|
if (!errorHandler) {
|
|
1616
|
-
_context.next =
|
|
1618
|
+
_context.next = 63;
|
|
1617
1619
|
break;
|
|
1618
1620
|
}
|
|
1619
|
-
_context.next =
|
|
1621
|
+
_context.next = 61;
|
|
1620
1622
|
return errorHandler.text();
|
|
1621
|
-
case
|
|
1623
|
+
case 61:
|
|
1622
1624
|
msg = _context.sent;
|
|
1623
1625
|
if (msg) {
|
|
1624
1626
|
error("[fetch][response] status: " + errorHandler.status + "]", {
|
|
1625
1627
|
message: msg
|
|
1626
1628
|
});
|
|
1627
1629
|
}
|
|
1628
|
-
case
|
|
1630
|
+
case 63:
|
|
1629
1631
|
if (!msg) {
|
|
1630
1632
|
error('[fetch][response]', {
|
|
1631
|
-
e: _context.
|
|
1633
|
+
e: _context.t10
|
|
1632
1634
|
});
|
|
1633
1635
|
}
|
|
1634
|
-
case
|
|
1636
|
+
case 64:
|
|
1635
1637
|
if (!msg) {
|
|
1636
|
-
_context.next =
|
|
1638
|
+
_context.next = 66;
|
|
1637
1639
|
break;
|
|
1638
1640
|
}
|
|
1639
1641
|
return _context.abrupt("return", new ResponseError(msg, {
|
|
1640
1642
|
status: errorHandler == null ? void 0 : errorHandler.status
|
|
1641
1643
|
}));
|
|
1642
|
-
case
|
|
1644
|
+
case 66:
|
|
1643
1645
|
if (!(res && 'message' in res)) {
|
|
1644
|
-
_context.next =
|
|
1646
|
+
_context.next = 70;
|
|
1645
1647
|
break;
|
|
1646
1648
|
}
|
|
1647
1649
|
_res = res, message = _res.message;
|
|
@@ -1649,9 +1651,9 @@ function _fetch2() {
|
|
|
1649
1651
|
return _context.abrupt("return", new ResponseError(message, {
|
|
1650
1652
|
status: 400
|
|
1651
1653
|
}));
|
|
1652
|
-
case
|
|
1654
|
+
case 70:
|
|
1653
1655
|
if (!(res && 'errors' in res)) {
|
|
1654
|
-
_context.next =
|
|
1656
|
+
_context.next = 74;
|
|
1655
1657
|
break;
|
|
1656
1658
|
}
|
|
1657
1659
|
_res2 = res, _res2$errors = _res2.errors, _message = _res2$errors[0];
|
|
@@ -1659,18 +1661,18 @@ function _fetch2() {
|
|
|
1659
1661
|
return _context.abrupt("return", new ResponseError(_message, {
|
|
1660
1662
|
status: 400
|
|
1661
1663
|
}));
|
|
1662
|
-
case
|
|
1664
|
+
case 74:
|
|
1663
1665
|
error("[fetch][response] status: " + (errorHandler == null ? void 0 : errorHandler.status) + "] UNHANDLED ERROR", {
|
|
1664
1666
|
res: res
|
|
1665
1667
|
});
|
|
1666
1668
|
return _context.abrupt("return", new ResponseError(null, {
|
|
1667
1669
|
status: (_response$status = response == null ? void 0 : response.status) != null ? _response$status : 500
|
|
1668
1670
|
}));
|
|
1669
|
-
case
|
|
1671
|
+
case 76:
|
|
1670
1672
|
case "end":
|
|
1671
1673
|
return _context.stop();
|
|
1672
1674
|
}
|
|
1673
|
-
}, _callee, null, [[21,
|
|
1675
|
+
}, _callee, null, [[21, 32], [50, 56]]);
|
|
1674
1676
|
}));
|
|
1675
1677
|
return _fetch2.apply(this, arguments);
|
|
1676
1678
|
}
|