@carbonorm/carbonnode 1.2.5 → 1.2.6

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.
@@ -26,6 +26,11 @@ export type tC6Tables = {
26
26
  [key: string]: any;
27
27
  });
28
28
  };
29
+ export type tWsLiveUpdate = {
30
+ PUT: Function;
31
+ POST: Function;
32
+ DELETE: Function;
33
+ };
29
34
  export interface C6RestfulModel<RestShortTableNames extends string = string> {
30
35
  TABLE_NAME: RestShortTableNames;
31
36
  PRIMARY: string[];
@@ -41,9 +46,4 @@ export interface C6RestfulModel<RestShortTableNames extends string = string> {
41
46
  TABLE_REFERENCED_BY: {
42
47
  [columnName: string]: iConstraint[];
43
48
  };
44
- REST_STATE_OPERATIONS: {
45
- PUT: Function;
46
- POST: Function;
47
- DELETE: Function;
48
- };
49
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbonorm/carbonnode",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "browser": "dist/index.umd.js",
@@ -14,9 +14,9 @@ const fillString = 'string' + randomString + randomInt;
14
14
  **/
15
15
 
16
16
  const Test_Data: i{{TABLE_NAME_SHORT_PASCAL_CASE}} = {
17
- {{#each TYPE_VALIDATION}}
18
- {{#SKIP_COLUMN_IN_POST}}{{COLUMN_NAME}}: {{#TYPESCRIPT_TYPE_IS_STRING}}fillString.substring(0, {{MAX_LENGTH}}){{/TYPESCRIPT_TYPE_IS_STRING}}{{#TYPESCRIPT_TYPE_IS_NUMBER}}randomInt,{{/TYPESCRIPT_TYPE_IS_NUMBER}}{{/SKIP_COLUMN_IN_POST}}
19
- {{/each}}
17
+ {{#each TYPE_VALIDATION}}{{#SKIP_COLUMN_IN_POST}}
18
+ {{COLUMN_NAME}}: {{#TYPESCRIPT_TYPE_IS_STRING}}fillString{{#MAX_LENGTH}}.substring(0, {{MAX_LENGTH}}){{/MAX_LENGTH}}{{/TYPESCRIPT_TYPE_IS_STRING}}{{#TYPESCRIPT_TYPE_IS_NUMBER}}randomInt{{/TYPESCRIPT_TYPE_IS_NUMBER}},
19
+ {{/SKIP_COLUMN_IN_POST}}{{/each}}
20
20
  }
21
21
 
22
22
  export default Test_Data;
@@ -0,0 +1,22 @@
1
+ import {
2
+ tWsLiveUpdate
3
+ } from "@carbonorm/carbonnode";
4
+
5
+ {{#TABLES}}
6
+ import { putState{{TABLE_NAME_SHORT_PASCAL_CASE}}, postState{{TABLE_NAME_SHORT_PASCAL_CASE}}, deleteState{{TABLE_NAME_SHORT_PASCAL_CASE}} } from "./{{TABLE_NAME_SHORT_PASCAL_CASE}}";
7
+ {{/TABLES}}
8
+
9
+ const wsLiveUpdates: tWsLiveUpdate = {
10
+ {{#TABLES}}
11
+ {{TABLE_NAME_SHORT}}: {
12
+ PUT: putState{{TABLE_NAME_SHORT_PASCAL_CASE}},
13
+ POST: postState{{TABLE_NAME_SHORT_PASCAL_CASE}},
14
+ DELETE: deleteState{{TABLE_NAME_SHORT_PASCAL_CASE}},
15
+ },
16
+ {{/TABLES}}
17
+ };
18
+
19
+
20
+ export default wsLiveUpdates;
21
+
22
+
@@ -290,6 +290,8 @@ fs.writeFileSync(path.join(process.cwd(), 'C6MySqlDump.json'), JSON.stringify(ta
290
290
  // import this file src/assets/handlebars/C6.tsx.handlebars for a mustache template
291
291
  var c6Template = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/C6.tsx.handlebars'), 'utf-8');
292
292
  fs.writeFileSync(path.join(MySQLDump.OUTPUT_DIR, 'C6.tsx'), Handlebars.compile(c6Template)(tableData));
293
+ var wsLiveUpdatesTemplate = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/WsLiveUpdates.tsx.handlebars'), 'utf-8');
294
+ fs.writeFileSync(path.join(MySQLDump.OUTPUT_DIR, 'WsLiveUpdates.tsx'), Handlebars.compile(wsLiveUpdatesTemplate)(tableData));
293
295
  var template = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/Table.tsx.handlebars'), 'utf-8');
294
296
  var testTemplate = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/Table.test.tsx.handlebars'), 'utf-8');
295
297
  Object.values(tableData.TABLES).map(function (tableData, key) {
@@ -381,6 +381,10 @@ const c6Template = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/C6
381
381
 
382
382
  fs.writeFileSync(path.join(MySQLDump.OUTPUT_DIR, 'C6.tsx'), Handlebars.compile(c6Template)(tableData));
383
383
 
384
+ const wsLiveUpdatesTemplate = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/WsLiveUpdates.tsx.handlebars'), 'utf-8');
385
+
386
+ fs.writeFileSync(path.join(MySQLDump.OUTPUT_DIR, 'WsLiveUpdates.tsx'), Handlebars.compile(wsLiveUpdatesTemplate)(tableData));
387
+
384
388
  const template = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/Table.tsx.handlebars'), 'utf-8');
385
389
 
386
390
  const testTemplate = fs.readFileSync(path.resolve(__dirname, 'assets/handlebars/Table.test.tsx.handlebars'), 'utf-8');
@@ -30,6 +30,8 @@ export interface iConstraint {
30
30
 
31
31
  export type tC6Tables = { [key: string]: (C6RestfulModel & { [key: string]: any }) }
32
32
 
33
+ export type tWsLiveUpdate = { PUT: Function, POST: Function, DELETE: Function };
34
+
33
35
  export interface C6RestfulModel<RestShortTableNames extends string = string> {
34
36
  TABLE_NAME: RestShortTableNames,
35
37
  PRIMARY: string[],
@@ -39,5 +41,4 @@ export interface C6RestfulModel<RestShortTableNames extends string = string> {
39
41
  TYPE_VALIDATION: {[key: string]: iTypeValidation},
40
42
  TABLE_REFERENCES: {[columnName: string]: iConstraint[]},
41
43
  TABLE_REFERENCED_BY: {[columnName: string]: iConstraint[]},
42
- REST_STATE_OPERATIONS: { PUT: Function, POST: Function, DELETE: Function },
43
44
  }