@izara_project/izara-core-generate-service-code 1.0.3 → 1.0.5
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/index.js +0 -2
- package/package.json +1 -1
- package/src/TemplateData/EndpointPerService/mainFunction/create/template.ejs +31 -22
- package/src/TemplateData/EndpointPerService/mainFunction/update/template.ejs +18 -12
- package/src/TemplateData/flowSchema/flowSchemaMainFunction/data.js +1 -1
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +0 -1
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/DsqHandlerTemplate.ejs +15 -1
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +10 -1
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +1 -5
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +1 -6
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +15 -1
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +1 -2
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +10 -4
- package/src/GenerateSchema.js +0 -165
- package/src/SchemaConfig.js +0 -23
package/index.js
CHANGED
|
@@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
import createSource from './src/SourceManager/CreateSource.js';
|
|
19
19
|
import generateCode from './src/GenerateCode.js';
|
|
20
|
-
import generateSchema from './src/GenerateSchema.js';
|
|
21
20
|
import generateIntTest from './src/GenerateTests.js';
|
|
22
21
|
import generateResourceIntTest from './src/GenerateResources.js';
|
|
23
22
|
|
|
@@ -30,7 +29,6 @@ export {
|
|
|
30
29
|
createSource,
|
|
31
30
|
// main generateCode
|
|
32
31
|
generateCode,
|
|
33
|
-
generateSchema,
|
|
34
32
|
generateIntTest,
|
|
35
33
|
generateResourceIntTest,
|
|
36
34
|
// libs
|
package/package.json
CHANGED
|
@@ -357,18 +357,23 @@ export default async function createMain(
|
|
|
357
357
|
_izContext.logger.debug("objInstanceFull before send to Graph", objInstanceFullForGraph)
|
|
358
358
|
|
|
359
359
|
// allStorageTagComplete = false;
|
|
360
|
-
allAwaitingStepsId.push(
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
360
|
+
allAwaitingStepsId.push(
|
|
361
|
+
{
|
|
362
|
+
awaitingStepId: await asyncFlowSharedLib.createAwaitingStepId(
|
|
363
|
+
(hash({
|
|
364
|
+
objType: objType,
|
|
365
|
+
graphServerTag: storageTag,
|
|
366
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
367
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
368
|
+
})),
|
|
369
|
+
PREFIX.CREATE_OBJECT_ASYNC
|
|
370
|
+
),
|
|
371
|
+
//(<additionalAttributeCreateNode>)
|
|
372
|
+
additionalAttributes: {}
|
|
373
|
+
//(</additionalAttributeCreateNode>)
|
|
374
|
+
},
|
|
371
375
|
);
|
|
376
|
+
|
|
372
377
|
listOfObjectForCreates.push({
|
|
373
378
|
[storageTag]: {
|
|
374
379
|
objInstanceFull: {
|
|
@@ -388,17 +393,21 @@ export default async function createMain(
|
|
|
388
393
|
Object.assign(objInstanceFullForExternalTopic.fields, createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail))
|
|
389
394
|
_izContext.logger.debug("objInstanceFull before send to external topic", objInstanceFullForExternalTopic)
|
|
390
395
|
|
|
391
|
-
allAwaitingStepsId.push(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
396
|
+
allAwaitingStepsId.push(
|
|
397
|
+
{
|
|
398
|
+
awaitingStepId: await asyncFlowSharedLib.createAwaitingStepId(
|
|
399
|
+
(hash({
|
|
400
|
+
objType: objType,
|
|
401
|
+
graphServerTag: storageTag,
|
|
402
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
403
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
404
|
+
})),
|
|
405
|
+
PREFIX.CREATE_OBJECT_EXTERNAL_TOPIC
|
|
406
|
+
),
|
|
407
|
+
//(<additionalAttributeCreateExternalTopic>)
|
|
408
|
+
additionalAttributes: {}
|
|
409
|
+
//(</additionalAttributeCreateExternalTopic>)
|
|
410
|
+
}
|
|
402
411
|
);
|
|
403
412
|
|
|
404
413
|
let sendToCreateExternalTopic = {
|
|
@@ -270,19 +270,25 @@ export default async function updateMain(
|
|
|
270
270
|
return
|
|
271
271
|
} else {
|
|
272
272
|
|
|
273
|
+
//(<beforeUpdateNode>)
|
|
274
|
+
//(</beforeUpdateNode>)
|
|
275
|
+
|
|
273
276
|
awaitingStepIds.push( // createAwaitingStepId if updateGraph
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
277
|
+
{
|
|
278
|
+
awaitingStepId: asyncFlowSharedLib.createAwaitingStepId(
|
|
279
|
+
hash({
|
|
280
|
+
objectType: objType.objectType,
|
|
281
|
+
serviceTag: objType.serviceTag,
|
|
282
|
+
identifiers: identifiers,
|
|
283
|
+
fields: fields,
|
|
284
|
+
// correlationIds: _izContext.correlationIds.get("id")
|
|
285
|
+
}),
|
|
286
|
+
PREFIX.updateNode
|
|
287
|
+
),
|
|
288
|
+
//(<additionalAttributes>)
|
|
289
|
+
additionalAttributes: {}
|
|
290
|
+
//(</additionalAttributes>)
|
|
291
|
+
}
|
|
286
292
|
)
|
|
287
293
|
_izContext.logger.debug("awaitingStepIds", awaitingStepIds)
|
|
288
294
|
|
|
@@ -98,7 +98,7 @@ async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
|
98
98
|
tableName,
|
|
99
99
|
flowSchemaComplete,
|
|
100
100
|
triggerType,
|
|
101
|
-
queueName: `${createFlowTypeConcat(_izContext, { serviceTag: getLocalConfig('iz_serviceTag'), flowTag: flowSchema.flowTag })}_Main`
|
|
101
|
+
queueName: `${createFlowTypeConcat(_izContext, { serviceTag: getLocalConfig('iz_serviceTag'), flowTag: upperCase(flowSchema.flowTag) })}_Main`
|
|
102
102
|
},
|
|
103
103
|
setting: {
|
|
104
104
|
savePath: path.join(
|
package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js
CHANGED
|
@@ -63,7 +63,6 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
63
63
|
let functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
64
64
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
65
65
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
66
|
-
let route = upperCase(flowSchema.flowTag);
|
|
67
66
|
let queueName = upperCase(flowSchema.flowTag) + handlerType;
|
|
68
67
|
let objectSchema;
|
|
69
68
|
|
|
@@ -28,7 +28,21 @@ let perRecordsValidatorSchema = {
|
|
|
28
28
|
//(<validatorSchema>)
|
|
29
29
|
//(</validatorSchema>)
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
|
|
33
|
+
{
|
|
34
|
+
type: "object",
|
|
35
|
+
required: ['body', 'messageAttributes'],
|
|
36
|
+
properties: {
|
|
37
|
+
body: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
},
|
|
40
|
+
messageAttributes: {
|
|
41
|
+
type: 'object'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
));
|
|
32
46
|
|
|
33
47
|
export const main = middleware.wrap(async (event, context) => {
|
|
34
48
|
|
|
@@ -22,7 +22,7 @@ const __dirname = path.dirname(__filename);
|
|
|
22
22
|
import consts from '../../../../libs/Consts.js';
|
|
23
23
|
import utils from '../../../../libs/Utils.js';
|
|
24
24
|
|
|
25
|
-
const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
|
|
25
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, HANDLER } = consts;
|
|
26
26
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
|
|
27
27
|
|
|
28
28
|
const snsTemplatePath = path.join(
|
|
@@ -64,6 +64,15 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
|
|
|
64
64
|
|
|
65
65
|
let defaultDsqQueueDataList = [];
|
|
66
66
|
|
|
67
|
+
if (flowSchema.statusType === 'triggerCache') {
|
|
68
|
+
defaultDsqQueueDataList.push(
|
|
69
|
+
{
|
|
70
|
+
queueName: upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq)
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
// if (flowSchema.outputTopic) {
|
|
68
77
|
// if (flowSteps.includes("Out")) {
|
|
69
78
|
// if (flowSchema.outputTopic) {
|
package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js
CHANGED
|
@@ -41,11 +41,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
41
41
|
let functionName =
|
|
42
42
|
'CheckTriggerCache' + upperCase(flowSchema.flowTag) + 'Complete';
|
|
43
43
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
44
|
-
let queueName =
|
|
45
|
-
'CheckTriggerCache' +
|
|
46
|
-
upperCase(flowSchema.flowTag) +
|
|
47
|
-
'Complete' +
|
|
48
|
-
handlerType;
|
|
44
|
+
let queueName = 'CheckTriggerCache' + upperCase(flowSchema.flowTag) + 'Complete' + handlerType;
|
|
49
45
|
|
|
50
46
|
return {
|
|
51
47
|
templatePath: templatePath,
|
package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js
CHANGED
|
@@ -58,12 +58,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
58
58
|
queueName
|
|
59
59
|
},
|
|
60
60
|
setting: {
|
|
61
|
-
savePath: path.join(
|
|
62
|
-
srcPath,
|
|
63
|
-
SOURCE_PATH.flowSchema,
|
|
64
|
-
upperCase(flowSchema.flowTag),
|
|
65
|
-
'source/'
|
|
66
|
-
),
|
|
61
|
+
savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
|
|
67
62
|
saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
|
|
68
63
|
fileExtension: '.js',
|
|
69
64
|
isAppend: true
|
package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs
CHANGED
|
@@ -29,7 +29,21 @@ let perRecordsValidatorSchema = {
|
|
|
29
29
|
//(<validatorSchema>)
|
|
30
30
|
//(</validatorSchema>)
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
|
|
34
|
+
{
|
|
35
|
+
type: "object",
|
|
36
|
+
required: ['body', 'messageAttributes'],
|
|
37
|
+
properties: {
|
|
38
|
+
body: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
},
|
|
41
|
+
messageAttributes: {
|
|
42
|
+
type: 'object'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
));
|
|
33
47
|
|
|
34
48
|
export const main = middleware.wrap(async (event, context) => {
|
|
35
49
|
|
package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js
CHANGED
|
@@ -44,8 +44,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
44
44
|
let functionName =
|
|
45
45
|
'TriggerCache' + upperCase(flowSchema.flowTag) + 'Complete';
|
|
46
46
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
47
|
-
let queueName =
|
|
48
|
-
'TriggerCache' + upperCase(flowSchema.flowTag) + 'Complete' + handlerType;
|
|
47
|
+
let queueName = 'TriggerCache' + upperCase(flowSchema.flowTag) + 'Complete' + handlerType;
|
|
49
48
|
|
|
50
49
|
return {
|
|
51
50
|
templatePath: templatePath,
|
|
@@ -50,16 +50,22 @@ export default async function <%- functionName %>(
|
|
|
50
50
|
_izContext.logger.debug("<%- functionName %> requestParams", requestParams)
|
|
51
51
|
_izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
|
|
52
52
|
|
|
53
|
+
//(<beforeCheckTriggeredCache>)
|
|
54
|
+
//(</beforeCheckTriggeredCache>)
|
|
55
|
+
|
|
53
56
|
let checkTriggerResetedV2 = await triggeredCacheSharedLibV2.checkTriggerResetedV2(
|
|
54
57
|
_izContext,
|
|
55
58
|
{ // flowType
|
|
56
59
|
serviceTag: process.env.iz_serviceTag,
|
|
57
60
|
flowTag: "<%- flowTag %>"
|
|
58
61
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
//(<identifiers>)
|
|
63
|
+
{},
|
|
64
|
+
//(</identifiers>)// identifiers of objType in flowType
|
|
65
|
+
//(<uniqueRequestId>)
|
|
66
|
+
//(</uniqueRequestId>)
|
|
67
|
+
//(<settings>)
|
|
68
|
+
//(</settings>)
|
|
63
69
|
)
|
|
64
70
|
|
|
65
71
|
_izContext.logger.debug("checkTriggerResetedV2: ", checkTriggerResetedV2)
|
package/src/GenerateSchema.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { join } from 'path';
|
|
19
|
-
import { readFileSync } from 'fs';
|
|
20
|
-
|
|
21
|
-
import validatePathWithRootServicePath from './libs/GenerateCodeLibs.js';
|
|
22
|
-
|
|
23
|
-
import { schemaConfig } from './SchemaConfig.js';
|
|
24
|
-
|
|
25
|
-
import createSource from './SourceManager/CreateSource.js';
|
|
26
|
-
import utils from './libs/Utils.js'
|
|
27
|
-
|
|
28
|
-
const { deleteFileInDir } = utils;
|
|
29
|
-
|
|
30
|
-
async function generateSchema(
|
|
31
|
-
_izContext,
|
|
32
|
-
objSchemaPath,
|
|
33
|
-
generateSchemaSettings
|
|
34
|
-
) {
|
|
35
|
-
try {
|
|
36
|
-
// console.log('generateSchema', { objSchemaPath, generateSchemaSettings });
|
|
37
|
-
// --------- Prepare path -------------
|
|
38
|
-
// point to app/src
|
|
39
|
-
let saveFilePath = join(objSchemaPath, `../`);
|
|
40
|
-
// console.log("saveFilePath: ", saveFilePath);
|
|
41
|
-
|
|
42
|
-
// point to root folder of service
|
|
43
|
-
let localServicePath = join(saveFilePath, '../../');
|
|
44
|
-
// console.log("localServicePath: ", localServicePath);
|
|
45
|
-
|
|
46
|
-
//------ Start Create Source ------
|
|
47
|
-
|
|
48
|
-
// collect all result of template data for execute createSource
|
|
49
|
-
let allCreateSource = [];
|
|
50
|
-
// collect all path that need to empty before createSource
|
|
51
|
-
let allEmptyPath = new Set();
|
|
52
|
-
|
|
53
|
-
// Validate that all generateNames in generateSettings are present in the schemaConfig
|
|
54
|
-
const generateNameSet = new Set(Object.keys(schemaConfig.TemplateAndData));
|
|
55
|
-
|
|
56
|
-
// Find any missing generateNames that are not in the schemaConfig
|
|
57
|
-
let missingGenerateName = generateSchemaSettings.filter(
|
|
58
|
-
({ generateName }) => !generateNameSet.has(generateName)
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
// If there are missing generateNames, throw an error with the list of missing names
|
|
62
|
-
if (missingGenerateName.length) {
|
|
63
|
-
throw Error(
|
|
64
|
-
`Invalid generateName:[ ${missingGenerateName.map(({ generateName }) => generateName).join(', ')} ]`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// start create generateSchema depend on
|
|
69
|
-
for (const generateSetting of generateSchemaSettings) {
|
|
70
|
-
console.log('Loading template:', generateSetting.generateName);
|
|
71
|
-
console.log('Setting data:', generateSetting);
|
|
72
|
-
// console.log('schemaPath:', schemaConfig.TemplateAndData[generateSetting.generateName]);
|
|
73
|
-
// console.log('schemaPath:', join(__dirname, schemaConfig.TemplateAndData[generateSetting.generateName]));
|
|
74
|
-
|
|
75
|
-
// get generateSchema template depend on generateName
|
|
76
|
-
let generateSchemaData = (
|
|
77
|
-
await import(
|
|
78
|
-
join(
|
|
79
|
-
__dirname,
|
|
80
|
-
schemaConfig.TemplateAndData[generateSetting.generateName]
|
|
81
|
-
)
|
|
82
|
-
)
|
|
83
|
-
).default;
|
|
84
|
-
// sources[eventSourceTag] = await import(`../MiddlewareCore/EventSources/${eventSourceTag}.js`);
|
|
85
|
-
let createSourceResult = await generateSchemaData(
|
|
86
|
-
_izContext,
|
|
87
|
-
objSchemaPath,
|
|
88
|
-
generateSchemaSettings
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
// Filter out empty or invalid objects before adding to allCreateSource
|
|
92
|
-
if (Array.isArray(createSourceResult)) {
|
|
93
|
-
const validResults = createSourceResult.filter(
|
|
94
|
-
item => item && item.templatePath && item.templateData && item.setting
|
|
95
|
-
);
|
|
96
|
-
allCreateSource.push(...validResults);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// check each allCreateSource valid
|
|
101
|
-
for (let item of allCreateSource) {
|
|
102
|
-
// throw Error('Skipping invalid source item:', item);
|
|
103
|
-
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
104
|
-
console.log('throw Error Skipping invalid source item:', item);
|
|
105
|
-
throw Error('Skipping invalid source item:', item);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const {
|
|
109
|
-
templatePath,
|
|
110
|
-
templateData,
|
|
111
|
-
setting,
|
|
112
|
-
emptyPath: returnEmptyPath
|
|
113
|
-
} = item;
|
|
114
|
-
setting.checkCreateSourcePass = true;
|
|
115
|
-
|
|
116
|
-
let [status, errors] = await createSource(
|
|
117
|
-
readFileSync(templatePath, 'utf8'),
|
|
118
|
-
templateData,
|
|
119
|
-
setting
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
if (status === false) {
|
|
123
|
-
throw Error(errors);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
allEmptyPath.add(setting.savePath);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// validate path before empty folder
|
|
130
|
-
for (let emptyPath of allEmptyPath) {
|
|
131
|
-
// console.log("emptyPath: ", emptyPath);
|
|
132
|
-
validatePathWithRootServicePath(localServicePath, emptyPath);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
for (let emptyPath of allEmptyPath) {
|
|
136
|
-
await deleteFileInDir(emptyPath);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// generate all source
|
|
140
|
-
for (let item of allCreateSource) {
|
|
141
|
-
// throw error if item is invalid
|
|
142
|
-
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
143
|
-
console.log('Throwing invalid source item:', item);
|
|
144
|
-
throw Error('Throwing invalid source item:', item);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const { templatePath, templateData, setting } = item;
|
|
148
|
-
setting.checkCreateSourcePass = false;
|
|
149
|
-
|
|
150
|
-
await createSource(
|
|
151
|
-
readFileSync(templatePath, 'utf8'),
|
|
152
|
-
templateData,
|
|
153
|
-
setting
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
console.log('Generated all source files successfully');
|
|
158
|
-
return 'return values';
|
|
159
|
-
} catch (error) {
|
|
160
|
-
console.error('Error generating code:', error);
|
|
161
|
-
throw error;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export default generateSchema;
|
package/src/SchemaConfig.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export const schemaConfig = {
|
|
19
|
-
TemplateAndData: {
|
|
20
|
-
propertyValue: './TemplateData/propertyValueSchema/generateTemplateData.js'
|
|
21
|
-
},
|
|
22
|
-
Plugin: {}
|
|
23
|
-
};
|