@scout9/app 1.0.0-alpha.0.3.5 → 1.0.0-alpha.0.3.7
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/{dev-9397b4c2.cjs → dev-689cc6fd.cjs} +2 -2
- package/dist/{index-d6cc7b04.cjs → index-0b4fa4ce.cjs} +5 -5
- package/dist/index.cjs +2 -2
- package/dist/{multipart-parser-2dee7d84.cjs → multipart-parser-4603e570.cjs} +2 -2
- package/dist/testing-tools.cjs +1 -1
- package/package.json +1 -1
- package/src/core/templates/app.js +30 -11
|
@@ -29993,7 +29993,7 @@ common.createRequestFunction = createRequestFunction;
|
|
|
29993
29993
|
var configuration = {};
|
|
29994
29994
|
|
|
29995
29995
|
var name$1 = "@scout9/admin";
|
|
29996
|
-
var version$2 = "1.0.0-alpha.0.0.
|
|
29996
|
+
var version$2 = "1.0.0-alpha.0.0.50";
|
|
29997
29997
|
var description$1 = "";
|
|
29998
29998
|
var main$2 = "./build/index.js";
|
|
29999
29999
|
var types$1 = "./build/index.d.ts";
|
|
@@ -35019,7 +35019,7 @@ function _loadUserPackageJson() {
|
|
|
35019
35019
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
35020
35020
|
_context2.t0 = JSON;
|
|
35021
35021
|
_context2.next = 10;
|
|
35022
|
-
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('dev-
|
|
35022
|
+
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('dev-689cc6fd.js', document.baseURI).href))), 'utf-8');
|
|
35023
35023
|
case 10:
|
|
35024
35024
|
_context2.t1 = _context2.sent;
|
|
35025
35025
|
pkg = _context2.t0.parse.call(_context2.t0, _context2.t1);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var spirits = require("./spirits-5c9243a1.cjs");
|
|
4
|
-
var dev = require("./dev-
|
|
4
|
+
var dev = require("./dev-689cc6fd.cjs");
|
|
5
5
|
var macros = require("./macros-7c18e049.cjs");
|
|
6
6
|
var require$$0 = require('fs');
|
|
7
7
|
var require$$2$1 = require('events');
|
|
@@ -29483,7 +29483,7 @@ class Body {
|
|
|
29483
29483
|
}
|
|
29484
29484
|
const {
|
|
29485
29485
|
toFormData
|
|
29486
|
-
} = await Promise.resolve().then(function () { return require("./multipart-parser-
|
|
29486
|
+
} = await Promise.resolve().then(function () { return require("./multipart-parser-4603e570.cjs"); });
|
|
29487
29487
|
return toFormData(this.body, ct);
|
|
29488
29488
|
}
|
|
29489
29489
|
|
|
@@ -41892,7 +41892,7 @@ function _loadUserPackageJson() {
|
|
|
41892
41892
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
41893
41893
|
_context.t0 = JSON;
|
|
41894
41894
|
_context.next = 10;
|
|
41895
|
-
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
41895
|
+
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-0b4fa4ce.js', document.baseURI).href))), 'utf-8');
|
|
41896
41896
|
case 10:
|
|
41897
41897
|
_context.t1 = _context.sent;
|
|
41898
41898
|
pkg = _context.t0.parse.call(_context.t0, _context.t1);
|
|
@@ -43115,7 +43115,7 @@ var ProjectFiles = /*#__PURE__*/function () {
|
|
|
43115
43115
|
return ProjectFiles;
|
|
43116
43116
|
}();
|
|
43117
43117
|
|
|
43118
|
-
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43118
|
+
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-0b4fa4ce.js', document.baseURI).href)));
|
|
43119
43119
|
var __dirname$1 = path__default["default"].dirname(__filename$1);
|
|
43120
43120
|
function zipDirectory(source, out) {
|
|
43121
43121
|
var archive = archiver$1('tar', {
|
|
@@ -43330,7 +43330,7 @@ function _buildApp() {
|
|
|
43330
43330
|
case 11:
|
|
43331
43331
|
_context4.t0 = JSON;
|
|
43332
43332
|
_context4.next = 14;
|
|
43333
|
-
return fs__default["default"].readFile(new URL(templatePackagePath, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43333
|
+
return fs__default["default"].readFile(new URL(templatePackagePath, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-0b4fa4ce.js', document.baseURI).href))), 'utf-8');
|
|
43334
43334
|
case 14:
|
|
43335
43335
|
_context4.t1 = _context4.sent;
|
|
43336
43336
|
packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require("./index-
|
|
6
|
-
var dev = require("./dev-
|
|
5
|
+
var index = require("./index-0b4fa4ce.cjs");
|
|
6
|
+
var dev = require("./dev-689cc6fd.cjs");
|
|
7
7
|
require("./spirits-5c9243a1.cjs");
|
|
8
8
|
require("./macros-7c18e049.cjs");
|
|
9
9
|
require('fs');
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require('node:fs');
|
|
4
4
|
require('node:path');
|
|
5
|
-
var index = require("./index-
|
|
5
|
+
var index = require("./index-0b4fa4ce.cjs");
|
|
6
6
|
require("./spirits-5c9243a1.cjs");
|
|
7
|
-
require("./dev-
|
|
7
|
+
require("./dev-689cc6fd.cjs");
|
|
8
8
|
require('util');
|
|
9
9
|
require('stream');
|
|
10
10
|
require('path');
|
package/dist/testing-tools.cjs
CHANGED
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ const cache = new ServerCache();
|
|
|
72
72
|
cache.reset();
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
const handleError = (e, res = undefined) => {
|
|
75
|
+
const handleError = (e, res = undefined, tag = undefined, body = undefined) => {
|
|
76
76
|
let name = e?.name || 'Runtime Error';
|
|
77
77
|
let message = e?.message || 'Unknown error';
|
|
78
78
|
let code = typeof e?.code === 'number'
|
|
@@ -94,11 +94,22 @@ const handleError = (e, res = undefined) => {
|
|
|
94
94
|
message = response.body;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
if (body) {
|
|
98
|
+
console.log(colors.grey(JSON.stringify(body, null, 2)));
|
|
99
|
+
}
|
|
100
|
+
if (tag && typeof tag === 'string') {
|
|
101
|
+
message = `${tag}: ${message}`;
|
|
102
|
+
}
|
|
103
|
+
if (typeof e?.constructor?.name === 'string') {
|
|
104
|
+
message = `(${e?.constructor?.name}) ${message}`;
|
|
105
|
+
}
|
|
97
106
|
console.log(colors.red(`${colors.bold(`${code} Error`)}: ${message}`));
|
|
98
107
|
if ('stack' in e) {
|
|
99
|
-
console.log(colors.grey(e.stack));
|
|
108
|
+
console.log('STACK:', colors.grey(e.stack));
|
|
109
|
+
}
|
|
110
|
+
if (body) {
|
|
111
|
+
console.log('INPUT:', colors.grey(JSON.stringify(body, null, 2)));
|
|
100
112
|
}
|
|
101
|
-
console.log(colors);
|
|
102
113
|
if (res) {
|
|
103
114
|
res.writeHead(code, {'Content-Type': 'application/json'});
|
|
104
115
|
res.end(JSON.stringify({
|
|
@@ -213,14 +224,13 @@ app.post(dev ? '/dev/workflow' : '/', async (req, res) => {
|
|
|
213
224
|
status: 'Invalid WorkflowEvent Input'
|
|
214
225
|
});
|
|
215
226
|
} else {
|
|
216
|
-
error
|
|
217
|
-
handleError(error, res);
|
|
227
|
+
handleError(error, res, 'Workflow Template Event Parse Error', req.body.event);
|
|
218
228
|
}
|
|
219
229
|
return;
|
|
220
230
|
}
|
|
221
231
|
|
|
222
232
|
if (!workflowEvent) {
|
|
223
|
-
handleError(new Error('No workflowEvent defined'), res);
|
|
233
|
+
handleError(new Error('No workflowEvent defined'), res, req.body.event, 'Workflow Template Event No Event');
|
|
224
234
|
}
|
|
225
235
|
let response;
|
|
226
236
|
try {
|
|
@@ -233,8 +243,19 @@ app.post(dev ? '/dev/workflow' : '/', async (req, res) => {
|
|
|
233
243
|
}
|
|
234
244
|
})
|
|
235
245
|
} catch (error) {
|
|
236
|
-
error
|
|
237
|
-
|
|
246
|
+
if (error instanceof ZodError) {
|
|
247
|
+
handleZodError({
|
|
248
|
+
error,
|
|
249
|
+
name: 'Workflow Template Event Request Parse Error',
|
|
250
|
+
body: req.body.event,
|
|
251
|
+
bodyLabel: 'Provided WorkflowEvent',
|
|
252
|
+
code: 400,
|
|
253
|
+
res,
|
|
254
|
+
status: 'Invalid WorkflowEvent Input'
|
|
255
|
+
});
|
|
256
|
+
} else {
|
|
257
|
+
handleError(error, res, 'Workflow Template Runtime Error', workflowEvent);
|
|
258
|
+
}
|
|
238
259
|
return;
|
|
239
260
|
}
|
|
240
261
|
|
|
@@ -262,8 +283,7 @@ app.post(dev ? '/dev/workflow' : '/', async (req, res) => {
|
|
|
262
283
|
status: 'Invalid WorkflowResponse Output'
|
|
263
284
|
});
|
|
264
285
|
} else {
|
|
265
|
-
error
|
|
266
|
-
handleError(error, res);
|
|
286
|
+
handleError(error, res, 'Workflow Template Runtime Parse Error', response);
|
|
267
287
|
}
|
|
268
288
|
}
|
|
269
289
|
});
|
|
@@ -522,7 +542,6 @@ if (dev) {
|
|
|
522
542
|
}
|
|
523
543
|
}
|
|
524
544
|
} catch (e) {
|
|
525
|
-
console.error(e);
|
|
526
545
|
handleError(e);
|
|
527
546
|
}
|
|
528
547
|
});
|