@carbonorm/carbonreact 3.2.4 → 3.2.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.
@@ -0,0 +1,85 @@
1
+
2
+ interface iApiResponseLine {
3
+ "method": "GET" | "PUT" | "POST" | "DELETE",
4
+ "table": string,
5
+ "CarbonPHP\\Restful\\RestSettings::$externalRestfulRequestsAPI": boolean,
6
+ "argv": [
7
+ any[],
8
+ any,
9
+ any
10
+ ],
11
+ "stmt": [
12
+ string, // sql
13
+ {
14
+ [key: string]: string,
15
+ }
16
+ ]
17
+ }
18
+
19
+
20
+ const util = require('util');
21
+
22
+ const exec = util.promisify(require('child_process').exec);
23
+
24
+ const fs = require('fs');
25
+
26
+ const path = require("path");
27
+
28
+ (async () => {
29
+
30
+ const theDirectory = './logs/rest/'; // or whatever directory you want to read
31
+
32
+ let all: any[] = [],
33
+ validExternalRequests: iApiResponseLine[] = [];
34
+
35
+
36
+ const ManifestFile = 'validSQL.json';
37
+
38
+ fs.readdirSync(theDirectory).forEach((file) => {
39
+
40
+ if (file === ManifestFile) {
41
+
42
+ return;
43
+
44
+ }
45
+
46
+ const resource = require(`${theDirectory}/${file}`);
47
+
48
+ all.push(resource);
49
+
50
+ });
51
+
52
+ all.forEach(apiRequest => {
53
+
54
+ Object.keys(apiRequest).forEach(testName => {
55
+
56
+ Object.keys(apiRequest[testName]).forEach(mysqlRestCall => {
57
+
58
+ apiRequest[testName][mysqlRestCall].forEach(singleSqlInfoObject => {
59
+
60
+ if (true === singleSqlInfoObject['CarbonPHP\\Restful\\RestSettings::$externalRestfulRequestsAPI']) {
61
+
62
+ validExternalRequests.push(singleSqlInfoObject)
63
+
64
+ }
65
+
66
+ })
67
+
68
+ })
69
+
70
+ });
71
+
72
+ });
73
+
74
+
75
+ // @link https://stackoverflow.com/questions/12941083/execute-and-get-the-output-of-a-shell-command-in-node-js
76
+ const {stdout} = await exec('git rev-parse HEAD')
77
+
78
+ const revision = stdout.trim();
79
+
80
+ fs.writeFileSync(theDirectory + ManifestFile, JSON.stringify({
81
+ "revision": revision,
82
+ "valid": validExternalRequests
83
+ }, undefined, 4));
84
+
85
+ })()
@@ -54,6 +54,7 @@ declare const CarbonReact: {
54
54
  } & any, any & iCarbonReactState>;
55
55
  lastLocation: string;
56
56
  whyDidYouRender: boolean;
57
+ getState<S_1>(): S_1;
57
58
  contextType?: import("react").Context<any> | undefined;
58
59
  };
59
60
  export default CarbonReact;
package/dist/index.cjs.js CHANGED
@@ -3882,6 +3882,9 @@ var CarbonReact = (_a = /** @class */ (function (_super) {
3882
3882
  * components' tend to be shorter syntactically and bonus points if it's stateless.
3883
3883
  **/
3884
3884
  }
3885
+ class_1.getState = function () {
3886
+ return CarbonReact.instance.state;
3887
+ };
3885
3888
  class_1.prototype.shouldComponentUpdate = function (nextProps, nextState, _nextContext) {
3886
3889
  changed(this.constructor.name + ' (DigApi)', 'props', this.props, nextProps);
3887
3890
  changed(this.constructor.name + ' (DigApi)', 'state', this.state, nextState);