@ai0x0/utils 0.0.21 → 0.0.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.
- package/es/backend/route-operation/delete-operation.js +8 -7
- package/es/backend/route-operation/get-list-operation.js +6 -5
- package/es/backend/route-operation/get-operation.js +6 -5
- package/es/backend/route-operation/post-operation.js +6 -5
- package/es/backend/route-operation/put-operation.js +8 -7
- package/lib/backend/route-operation/delete-operation.js +2 -0
- package/lib/backend/route-operation/get-list-operation.js +1 -0
- package/lib/backend/route-operation/get-operation.js +1 -0
- package/lib/backend/route-operation/post-operation.js +1 -0
- package/lib/backend/route-operation/put-operation.js +2 -0
- package/package.json +1 -1
|
@@ -73,18 +73,19 @@ export var createDeleteOperation = function createDeleteOperation(_ref) {
|
|
|
73
73
|
case 21:
|
|
74
74
|
_context.prev = 21;
|
|
75
75
|
_context.t1 = _context["catch"](0);
|
|
76
|
-
_context.
|
|
76
|
+
if (!(_context.t1 instanceof HttpError)) console.error(_context.t1);
|
|
77
|
+
_context.next = 26;
|
|
77
78
|
return onError === null || onError === void 0 ? void 0 : onError(_context.t1);
|
|
78
|
-
case
|
|
79
|
+
case 26:
|
|
79
80
|
response = _context.sent;
|
|
80
81
|
if (!response) {
|
|
81
|
-
_context.next =
|
|
82
|
+
_context.next = 29;
|
|
82
83
|
break;
|
|
83
84
|
}
|
|
84
85
|
return _context.abrupt("return", response);
|
|
85
|
-
case
|
|
86
|
+
case 29:
|
|
86
87
|
if (!(_context.t1 instanceof HttpError)) {
|
|
87
|
-
_context.next =
|
|
88
|
+
_context.next = 31;
|
|
88
89
|
break;
|
|
89
90
|
}
|
|
90
91
|
return _context.abrupt("return", TypedNextResponse.json({
|
|
@@ -92,9 +93,9 @@ export var createDeleteOperation = function createDeleteOperation(_ref) {
|
|
|
92
93
|
}, {
|
|
93
94
|
status: _context.t1.status
|
|
94
95
|
}));
|
|
95
|
-
case 30:
|
|
96
|
-
throw _context.t1;
|
|
97
96
|
case 31:
|
|
97
|
+
throw _context.t1;
|
|
98
|
+
case 32:
|
|
98
99
|
case "end":
|
|
99
100
|
return _context.stop();
|
|
100
101
|
}
|
|
@@ -94,18 +94,19 @@ export var createGetListOperation = function createGetListOperation(_ref) {
|
|
|
94
94
|
case 26:
|
|
95
95
|
_context.prev = 26;
|
|
96
96
|
_context.t2 = _context["catch"](0);
|
|
97
|
-
_context.
|
|
97
|
+
console.error(_context.t2);
|
|
98
|
+
_context.next = 31;
|
|
98
99
|
return onError === null || onError === void 0 ? void 0 : onError(_context.t2);
|
|
99
|
-
case
|
|
100
|
+
case 31:
|
|
100
101
|
response = _context.sent;
|
|
101
102
|
if (!response) {
|
|
102
|
-
_context.next =
|
|
103
|
+
_context.next = 36;
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
return _context.abrupt("return", response);
|
|
106
|
-
case 35:
|
|
107
|
-
throw _context.t2;
|
|
108
107
|
case 36:
|
|
108
|
+
throw _context.t2;
|
|
109
|
+
case 37:
|
|
109
110
|
case "end":
|
|
110
111
|
return _context.stop();
|
|
111
112
|
}
|
|
@@ -94,18 +94,19 @@ export var createGetOperation = function createGetOperation(_ref) {
|
|
|
94
94
|
case 27:
|
|
95
95
|
_context.prev = 27;
|
|
96
96
|
_context.t2 = _context["catch"](0);
|
|
97
|
-
_context.
|
|
97
|
+
console.error(_context.t2);
|
|
98
|
+
_context.next = 32;
|
|
98
99
|
return onError === null || onError === void 0 ? void 0 : onError(_context.t2);
|
|
99
|
-
case
|
|
100
|
+
case 32:
|
|
100
101
|
response = _context.sent;
|
|
101
102
|
if (!response) {
|
|
102
|
-
_context.next =
|
|
103
|
+
_context.next = 37;
|
|
103
104
|
break;
|
|
104
105
|
}
|
|
105
106
|
return _context.abrupt("return", response);
|
|
106
|
-
case 36:
|
|
107
|
-
throw _context.t2;
|
|
108
107
|
case 37:
|
|
108
|
+
throw _context.t2;
|
|
109
|
+
case 38:
|
|
109
110
|
case "end":
|
|
110
111
|
return _context.stop();
|
|
111
112
|
}
|
|
@@ -111,18 +111,19 @@ export var createPostOperation = function createPostOperation(_ref) {
|
|
|
111
111
|
case 35:
|
|
112
112
|
_context.prev = 35;
|
|
113
113
|
_context.t6 = _context["catch"](0);
|
|
114
|
-
_context.
|
|
114
|
+
console.error(_context.t6);
|
|
115
|
+
_context.next = 40;
|
|
115
116
|
return onError === null || onError === void 0 ? void 0 : onError(_context.t6);
|
|
116
|
-
case
|
|
117
|
+
case 40:
|
|
117
118
|
response = _context.sent;
|
|
118
119
|
if (!response) {
|
|
119
|
-
_context.next =
|
|
120
|
+
_context.next = 45;
|
|
120
121
|
break;
|
|
121
122
|
}
|
|
122
123
|
return _context.abrupt("return", response);
|
|
123
|
-
case 44:
|
|
124
|
-
throw _context.t6;
|
|
125
124
|
case 45:
|
|
125
|
+
throw _context.t6;
|
|
126
|
+
case 46:
|
|
126
127
|
case "end":
|
|
127
128
|
return _context.stop();
|
|
128
129
|
}
|
|
@@ -106,18 +106,19 @@ export var createPutOperation = function createPutOperation(_ref) {
|
|
|
106
106
|
case 33:
|
|
107
107
|
_context.prev = 33;
|
|
108
108
|
_context.t6 = _context["catch"](0);
|
|
109
|
-
_context.
|
|
109
|
+
if (!(_context.t6 instanceof HttpError)) console.error(_context.t6);
|
|
110
|
+
_context.next = 38;
|
|
110
111
|
return onError === null || onError === void 0 ? void 0 : onError(_context.t6);
|
|
111
|
-
case
|
|
112
|
+
case 38:
|
|
112
113
|
response = _context.sent;
|
|
113
114
|
if (!response) {
|
|
114
|
-
_context.next =
|
|
115
|
+
_context.next = 41;
|
|
115
116
|
break;
|
|
116
117
|
}
|
|
117
118
|
return _context.abrupt("return", response);
|
|
118
|
-
case
|
|
119
|
+
case 41:
|
|
119
120
|
if (!(_context.t6 instanceof HttpError)) {
|
|
120
|
-
_context.next =
|
|
121
|
+
_context.next = 43;
|
|
121
122
|
break;
|
|
122
123
|
}
|
|
123
124
|
return _context.abrupt("return", TypedNextResponse.json({
|
|
@@ -125,9 +126,9 @@ export var createPutOperation = function createPutOperation(_ref) {
|
|
|
125
126
|
}, {
|
|
126
127
|
status: _context.t6.status
|
|
127
128
|
}));
|
|
128
|
-
case 42:
|
|
129
|
-
throw _context.t6;
|
|
130
129
|
case 43:
|
|
130
|
+
throw _context.t6;
|
|
131
|
+
case 44:
|
|
131
132
|
case "end":
|
|
132
133
|
return _context.stop();
|
|
133
134
|
}
|
|
@@ -90,6 +90,7 @@ var createGetOperation = ({
|
|
|
90
90
|
}
|
|
91
91
|
return import_next_rest_framework.TypedNextResponse.json(result, { status: 200 });
|
|
92
92
|
} catch (e) {
|
|
93
|
+
console.error(e);
|
|
93
94
|
const response = await (onError == null ? void 0 : onError(e));
|
|
94
95
|
if (response) {
|
|
95
96
|
return response;
|
|
@@ -78,6 +78,7 @@ var createPostOperation = ({
|
|
|
78
78
|
const data = onSuccess ? await onSuccess(raw) : raw;
|
|
79
79
|
return import_next_rest_framework.TypedNextResponse.json(data, { status: 200 });
|
|
80
80
|
} catch (e) {
|
|
81
|
+
console.error(e);
|
|
81
82
|
const response = await (onError == null ? void 0 : onError(e));
|
|
82
83
|
if (response) {
|
|
83
84
|
return response;
|
|
@@ -87,6 +87,8 @@ var createPutOperation = ({
|
|
|
87
87
|
const data = onSuccess ? await onSuccess(raw) : raw;
|
|
88
88
|
return import_next_rest_framework.TypedNextResponse.json(data, { status: 200 });
|
|
89
89
|
} catch (e) {
|
|
90
|
+
if (!(e instanceof import_errors.HttpError))
|
|
91
|
+
console.error(e);
|
|
90
92
|
const response = await (onError == null ? void 0 : onError(e));
|
|
91
93
|
if (response) {
|
|
92
94
|
return response;
|