@carbonorm/carbonnode 2.0.10 → 2.0.11
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/package.json
CHANGED
|
@@ -38,7 +38,7 @@ const Get = restRequest<GetCustomAndRequiredFields, i{{TABLE_NAME_SHORT_PASCAL_C
|
|
|
38
38
|
},{{#REACT_IMPORT}}
|
|
39
39
|
responseCallback: (response, _request) => {
|
|
40
40
|
const responseData = response?.data?.rest;
|
|
41
|
-
{{
|
|
41
|
+
{{CARBON_REACT_INSTANCE}}.updateRestfulObjectArrays<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>(Array.isArray(responseData) ? responseData : [responseData], "{{TABLE_NAME_SHORT}}", C6.{{TABLE_NAME_SHORT}}.PRIMARY_SHORT as (keyof i{{TABLE_NAME_SHORT_PASCAL_CASE}})[])
|
|
42
42
|
}{{/REACT_IMPORT}}
|
|
43
43
|
});
|
|
44
44
|
|
|
@@ -48,8 +48,8 @@ type PutRequestTableOverrides = {}
|
|
|
48
48
|
|
|
49
49
|
{{#REACT_IMPORT}}
|
|
50
50
|
export function putState(response : AxiosResponse<iPutC6RestResponse<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>>, request : iAPI<Modify<i{{TABLE_NAME_SHORT_PASCAL_CASE}}, PutRequestTableOverrides>> & PutCustomAndRequiredFields) {
|
|
51
|
-
{{REACT_IMPORT}}.updateRestfulObjectArrays<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>(
|
|
52
|
-
|
|
51
|
+
{{REACT_IMPORT}}.updateRestfulObjectArrays<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>([
|
|
52
|
+
{{CARBON_REACT_INSTANCE}}.removeInvalidKeys<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>({
|
|
53
53
|
...request,
|
|
54
54
|
...response?.data?.rest,
|
|
55
55
|
}, C6.TABLES)
|
|
@@ -81,7 +81,7 @@ type PostRequestTableOverrides = {}
|
|
|
81
81
|
request[{{TABLE_NAME_SHORT}}.PRIMARY_SHORT[0]] = id
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
{{
|
|
84
|
+
{{CARBON_REACT_INSTANCE}}.updateRestfulObjectArrays<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>(
|
|
85
85
|
undefined !== request.dataInsertMultipleRows
|
|
86
86
|
? request.dataInsertMultipleRows.map((request, index) => {
|
|
87
87
|
return removeInvalidKeys<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>({
|
|
@@ -101,8 +101,7 @@ type PostRequestTableOverrides = {}
|
|
|
101
101
|
}{{/REACT_IMPORT}}
|
|
102
102
|
|
|
103
103
|
const Post = restRequest<PostCustomAndRequiredFields, i{{TABLE_NAME_SHORT_PASCAL_CASE}}, PostRequestTableOverrides, iPostC6RestResponse<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>, RestTableNames>({
|
|
104
|
-
C6: C6,
|
|
105
|
-
instance: {{CARBON_REACT_INSTANCE}}{{/REACT_IMPORT}}
|
|
104
|
+
C6: C6,
|
|
106
105
|
restURL: {{{REST_URL_EXPRESSION}}},
|
|
107
106
|
tableName: {{TABLE_NAME_SHORT}}.TABLE_NAME,
|
|
108
107
|
requestMethod: POST,
|
|
@@ -119,14 +118,13 @@ type DeleteCustomAndRequiredFields = {}
|
|
|
119
118
|
type DeleteRequestTableOverrides = {}
|
|
120
119
|
|
|
121
120
|
{{#REACT_IMPORT}}export function deleteState(_response : AxiosResponse<iDeleteC6RestResponse<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>>, request : iAPI<Modify<i{{TABLE_NAME_SHORT_PASCAL_CASE}}, DeleteRequestTableOverrides>> & DeleteCustomAndRequiredFields) {
|
|
122
|
-
{{
|
|
121
|
+
{{CARBON_REACT_INSTANCE}}.deleteRestfulObjectArrays<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>([
|
|
123
122
|
request
|
|
124
123
|
], "{{TABLE_NAME_SHORT}}", {{TABLE_NAME_SHORT}}.PRIMARY_SHORT as (keyof i{{TABLE_NAME_SHORT_PASCAL_CASE}})[])
|
|
125
124
|
}{{/REACT_IMPORT}}
|
|
126
125
|
|
|
127
126
|
const Delete = restRequest<DeleteCustomAndRequiredFields, i{{TABLE_NAME_SHORT_PASCAL_CASE}}, DeleteRequestTableOverrides, iDeleteC6RestResponse<i{{TABLE_NAME_SHORT_PASCAL_CASE}}>, RestTableNames>({
|
|
128
|
-
C6: C6,
|
|
129
|
-
instance: {{CARBON_REACT_INSTANCE}}{{/REACT_IMPORT}}
|
|
127
|
+
C6: C6,
|
|
130
128
|
restURL: {{{REST_URL_EXPRESSION}}},
|
|
131
129
|
tableName: {{TABLE_NAME_SHORT}}.TABLE_NAME,
|
|
132
130
|
requestMethod: DELETE,
|
|
@@ -203,9 +203,9 @@ var parseSQLToTypeScript = function (sql) {
|
|
|
203
203
|
}
|
|
204
204
|
var REACT_IMPORT = false, CARBON_REACT_INSTANCE = false;
|
|
205
205
|
if (argMap['--react'] || false) {
|
|
206
|
-
var reactArgSplit = argMap['--react'];
|
|
207
|
-
if (reactArgSplit.length !== 2
|
|
208
|
-
console.error("React requires two arguments, the import and the carbon react instance statement. Example: --react 'import CustomCarbonReactApplication from \"src/CustomCarbonReactApplication\"; CustomCarbonReactApplication
|
|
206
|
+
var reactArgSplit = argMap['--react'].split(';');
|
|
207
|
+
if (reactArgSplit.length !== 2) {
|
|
208
|
+
console.error("React requires two arguments, the import and the carbon react instance statement. Example: --react 'import CustomCarbonReactApplication from \"src/CustomCarbonReactApplication.tsx\"; CustomCarbonReactApplication'");
|
|
209
209
|
process.exit(1);
|
|
210
210
|
}
|
|
211
211
|
_c = __read(reactArgSplit, 2), REACT_IMPORT = _c[0], CARBON_REACT_INSTANCE = _c[1];
|
|
@@ -271,10 +271,10 @@ const parseSQLToTypeScript = (sql: string) => {
|
|
|
271
271
|
|
|
272
272
|
if (argMap['--react'] || false) {
|
|
273
273
|
|
|
274
|
-
const reactArgSplit = argMap['--react'];
|
|
274
|
+
const reactArgSplit = argMap['--react'].split(';')
|
|
275
275
|
|
|
276
|
-
if (reactArgSplit.length !== 2
|
|
277
|
-
console.error("React requires two arguments, the import and the carbon react instance statement. Example: --react 'import CustomCarbonReactApplication from \"src/CustomCarbonReactApplication\"; CustomCarbonReactApplication
|
|
276
|
+
if (reactArgSplit.length !== 2) {
|
|
277
|
+
console.error("React requires two arguments, the import and the carbon react instance statement. Example: --react 'import CustomCarbonReactApplication from \"src/CustomCarbonReactApplication.tsx\"; CustomCarbonReactApplication'");
|
|
278
278
|
process.exit(1);
|
|
279
279
|
}
|
|
280
280
|
|