@open-norantec/herbal 2.0.0-alpha.1 → 2.0.0-alpha.3
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/dist/clients/typescript-client.class.js +3 -0
- package/dist/core.js +12 -11
- package/package.json +1 -1
|
@@ -210,6 +210,8 @@ var TypeScriptClient = (function (_super) {
|
|
|
210
210
|
return __generator(this, function (_a) {
|
|
211
211
|
switch (_a.label) {
|
|
212
212
|
case 0:
|
|
213
|
+
if (!schema)
|
|
214
|
+
return [2, 'unknown'];
|
|
213
215
|
interfaceName = "Interface".concat(Math.random().toString(36).slice(2));
|
|
214
216
|
return [4, (0, json_schema_to_typescript_1.compile)(schema, interfaceName, {
|
|
215
217
|
format: true,
|
|
@@ -221,6 +223,7 @@ var TypeScriptClient = (function (_super) {
|
|
|
221
223
|
semi: true,
|
|
222
224
|
trailingComma: 'none',
|
|
223
225
|
},
|
|
226
|
+
cwd: process.cwd(),
|
|
224
227
|
}).then(function (code) {
|
|
225
228
|
return code
|
|
226
229
|
.trim()
|
package/dist/core.js
CHANGED
|
@@ -219,12 +219,14 @@ var MethodPool = (function () {
|
|
|
219
219
|
'200': {
|
|
220
220
|
description: 'Response for method ' + name,
|
|
221
221
|
content: {
|
|
222
|
-
'application/json':
|
|
223
|
-
.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
'application/json': {
|
|
223
|
+
schema: utilities_1.z
|
|
224
|
+
.object({
|
|
225
|
+
data: config.options.outputSchema,
|
|
226
|
+
token: utilities_1.z.string().nullable(),
|
|
227
|
+
})
|
|
228
|
+
.toJSONSchema(),
|
|
229
|
+
},
|
|
228
230
|
},
|
|
229
231
|
},
|
|
230
232
|
},
|
|
@@ -310,7 +312,7 @@ function HerbalGuard(options) {
|
|
|
310
312
|
var _a, e_1, _b, _c;
|
|
311
313
|
var _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
312
314
|
return __awaiter(this, void 0, void 0, function () {
|
|
313
|
-
var sequelizeInstance, transaction, request, response, traceId, chunks, _o, request_1, request_1_1, chunk, e_1_1, _p, parsedBody, rawHandlerName, handlerPropertype, handlerName, methodPool, authAdapters, error_2, _i, authAdapters_1, AuthAdapterClass, adapter, authenticateResult, error_3, _q;
|
|
315
|
+
var sequelizeInstance, transaction, request, response, traceId, chunks, _o, request_1, request_1_1, chunk, e_1_1, _p, parsedBody, rawHandlerName, handlerPropertype, handlerName, methodPool, authAdapters, shouldHaveTransaction, error_2, _i, authAdapters_1, AuthAdapterClass, adapter, authenticateResult, error_3, _q;
|
|
314
316
|
var _this = this;
|
|
315
317
|
return __generator(this, function (_r) {
|
|
316
318
|
switch (_r.label) {
|
|
@@ -384,9 +386,8 @@ function HerbalGuard(options) {
|
|
|
384
386
|
authAdapters = (_h = methodPool === null || methodPool === void 0 ? void 0 : methodPool.getAuthAdapters) === null || _h === void 0 ? void 0 : _h.call(methodPool, handlerName);
|
|
385
387
|
if (authAdapters === null)
|
|
386
388
|
authAdapters = auth_adapter_decorator_1.AuthAdapters.getAdapters(handlerPropertype, handlerName);
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
!((_j = methodPool === null || methodPool === void 0 ? void 0 : methodPool.transactionDisabled) === null || _j === void 0 ? void 0 : _j.call(methodPool, handlerName)))) return [3, 20];
|
|
389
|
+
shouldHaveTransaction = !decorators_1.NoTransaction.isDisabled(handlerPropertype, rawHandlerName) && !((_j = methodPool === null || methodPool === void 0 ? void 0 : methodPool.transactionDisabled) === null || _j === void 0 ? void 0 : _j.call(methodPool, handlerName));
|
|
390
|
+
if (!(!(sequelizeInstance instanceof Error) && shouldHaveTransaction)) return [3, 20];
|
|
390
391
|
_r.label = 16;
|
|
391
392
|
case 16:
|
|
392
393
|
_r.trys.push([16, 18, , 19]);
|
|
@@ -404,7 +405,7 @@ function HerbalGuard(options) {
|
|
|
404
405
|
return [3, 19];
|
|
405
406
|
case 19: return [3, 21];
|
|
406
407
|
case 20:
|
|
407
|
-
if (
|
|
408
|
+
if (!shouldHaveTransaction) {
|
|
408
409
|
this.getLogger().log("[trace:".concat(request === null || request === void 0 ? void 0 : request.traceId, ":transaction] Transaction is disabled for this route: ").concat(handlerName));
|
|
409
410
|
}
|
|
410
411
|
_r.label = 21;
|