@carbonorm/carbonreact 3.3.14 → 3.4.0

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.
@@ -105,7 +105,9 @@ var fs = require('fs');
105
105
  Object.keys(apiRequest[testName]).forEach(function (restCallInfo) {
106
106
  apiRequest[testName][restCallInfo].forEach(function (singleSqlInfoObject) {
107
107
  if (true === singleSqlInfoObject['CarbonPHP\\Restful\\RestSettings::$externalRestfulRequestsAPI']) {
108
- validExternalRequests.push(singleSqlInfoObject);
108
+ singleSqlInfoObject.stmt.debugDumpParams = singleSqlInfoObject.stmt.debugDumpParams.slice(0, 2);
109
+ // change this to only the sql statement
110
+ validExternalRequests.push(singleSqlInfoObject.stmt);
109
111
  }
110
112
  });
111
113
  });
@@ -57,15 +57,19 @@ interface iApiResponseLine {
57
57
  any,
58
58
  any
59
59
  ],
60
- "stmt": [
61
- string, // sql
62
- {
63
- [key: string]: string,
64
- }
65
- ]
60
+ "stmt": {
61
+ // ['stmt']['sql']
62
+ sql: string, // sql
63
+ injections: { [inectionNumber: string]: string },
64
+ debugDumpParams: string[]
65
+ }
66
66
  }
67
67
 
68
68
 
69
+ interface iRestfulTestFile {
70
+ [testName: string]: iApiResponseLine[]
71
+ }
72
+
69
73
  const util = require('util');
70
74
 
71
75
  const exec = util.promisify(require('child_process').exec);
@@ -75,7 +79,7 @@ const fs = require('fs');
75
79
  (async () => {
76
80
 
77
81
 
78
- let jsonValidSqlFiles: any[] = [],
82
+ let jsonValidSqlFiles: iRestfulTestFile[] = [],
79
83
  validExternalRequests: iApiResponseLine[] = [];
80
84
 
81
85
 
@@ -117,7 +121,10 @@ const fs = require('fs');
117
121
 
118
122
  if (true === singleSqlInfoObject['CarbonPHP\\Restful\\RestSettings::$externalRestfulRequestsAPI']) {
119
123
 
120
- validExternalRequests.push(singleSqlInfoObject)
124
+ singleSqlInfoObject.stmt.debugDumpParams = singleSqlInfoObject.stmt.debugDumpParams.slice(0,2)
125
+
126
+ // change this to only the sql statement
127
+ validExternalRequests.push(singleSqlInfoObject.stmt)
121
128
 
122
129
  }
123
130
 
package/dist/index.cjs.js CHANGED
@@ -4,8 +4,8 @@ var react = require('react');
4
4
  var carbonnode = require('@carbonorm/carbonnode');
5
5
  var reactRouterDom = require('react-router-dom');
6
6
  var reactToastify = require('react-toastify');
7
- var classNames = require('classnames');
8
7
  var OutsideClickHandler = require('react-outside-click-handler');
8
+ var classNames = require('classnames');
9
9
  var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
10
10
  var reactFontawesome = require('@fortawesome/react-fontawesome');
11
11
  var Skeleton = require('react-loading-skeleton');
@@ -1396,7 +1396,16 @@ var BackendThrowable = () => {
1396
1396
  const bootstrap = CarbonReact.instance;
1397
1397
  const currentThrowable = bootstrap.state.backendThrowable[0];
1398
1398
  console.log([bootstrap.state.backendThrowable, currentThrowable]);
1399
- return jsxRuntime_1("div", { className: styles.maintenanceHero, children: jsxRuntime_1("h1", { className: styles.httpStatusCode, children: currentThrowable?.status || 500 }) });
1399
+ return jsxRuntime_2("div", { className: styles.maintenanceHero, children: [jsxRuntime_1("h1", { className: styles.httpStatusCode, children: currentThrowable?.status || 500 }), jsxRuntime_1(OutsideClickHandler, { onOutsideClick: () => bootstrap.setState(currentState => ({ backendThrowable: currentState.backendThrowable.slice(1) })), children: jsxRuntime_1("div", { className: styles.centeredContainer, children: Object.keys(currentThrowable).map((key, index) => {
1400
+ const valueIsString = typeof currentThrowable[key] === 'string';
1401
+ const valueIsCode = 'THROWN NEAR' === key;
1402
+ return jsxRuntime_2("div", { children: [jsxRuntime_2("div", { className: styles.errorTextGeneral, children: [" > ", jsxRuntime_1("span", { className: styles.errorKeys, children: key }), ":", valueIsString
1403
+ ? (valueIsCode ? jsxRuntime_1("div", { style: { backgroundColor: 'black', fontSize: 'xx-small' }, dangerouslySetInnerHTML: { __html: currentThrowable[key] } }) :
1404
+ jsxRuntime_2("i", { className: styles.errorValues, children: ["\"", currentThrowable[key], "\""] }))
1405
+ : ''] }), valueIsString
1406
+ ? ''
1407
+ : jsxRuntime_1("pre", { className: styles.errorPre, children: JSON.stringify(currentThrowable[key], undefined, 4) })] }, index);
1408
+ }) }) })] });
1400
1409
  };
1401
1410
 
1402
1411
  const range = n => new Array(n).fill(0).map((_, idx) => idx);