@izara_project/izara-market-library-service-schemas 1.0.77 → 1.0.78
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 +3 -2
- package/src/MainLibs/src/Consts.js +14 -1
- package/src/MainLibs/src/Utils.js +4 -3
- package/src/reStructure/GenerateResources.js +127 -0
- package/src/reStructure/GenerateTests.js +21 -22
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +2 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +1 -1
- package/src/reStructure/TemplateData/IntTest/generateResources/generateResources.js +76 -41
- package/src/reStructure/TemplateData/IntTest/generateTests/bashScript/data.js +45 -0
- package/src/reStructure/TemplateData/IntTest/generateTests/bashScript/template.ejs +0 -0
- package/src/reStructure/TemplateData/IntTest/generateTests/events/data.js +103 -100
- package/src/reStructure/TemplateData/IntTest/generateTests/events/templateEvents.ejs +8 -7
- package/src/reStructure/TemplateData/IntTest/generateTests/generateTemplate.js +59 -61
- package/src/reStructure/TemplateData/IntTest/generateTests/tests/data.js +168 -260
- package/src/reStructure/TemplateData/IntTest/generateTests/tests/templateTests.ejs +3 -1
- package/src/reStructure/TemplateData/IntTest/libs/{generateTestsLibs.js → libs.js} +82 -84
- package/src/reStructure/TemplateData/IntTest/upload/uploadIntTest.js +60 -0
- package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +1 -1
- package/src/reStructure/TemplateData/findData/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +3 -2
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +2 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +7 -7
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +1 -0
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +1 -0
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +1 -0
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogical/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +1 -1
- package/src.zip +0 -0
- package/src/reStructure/TemplateData/IntTest/generateResources/resources/data.js +0 -74
- package/src/reStructure/TemplateData/IntTest/generateResources.js +0 -144
- package/src/reStructure/TemplateData/IntTest/generateUpload/genetateTempleteUpload.js +0 -52
- package/src/reStructure/TemplateData/IntTest/generateUpload/upload/data.js +0 -40
- package/src/reStructure/TemplateData/IntTest/generateUpload/upload/libs/generateTestUploadLibs.js +0 -39
- package/src/reStructure/TemplateData/IntTest/generateUpload.js +0 -145
- /package/src/reStructure/TemplateData/IntTest/generateResources/{resources/templateresources.ejs → templateResources.ejs} +0 -0
|
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
19
19
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
|
-
import recordHandlerSharedLib from "@izara_project/izara-core-library-record-handler";
|
|
22
|
+
import { recordHandlerSharedLib } from "@izara_project/izara-core-library-record-handler";
|
|
23
23
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
24
24
|
|
|
25
25
|
import paginateProcessLogical from './PaginateProcessLogical_Main.js';
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema} from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import changeRelationshipComplete from './ChangeRelationshipComplete_Main.js';
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema} from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
|
@@ -98,7 +98,7 @@ let validator = {
|
|
|
98
98
|
//</globalVariable>)
|
|
99
99
|
|
|
100
100
|
// validate event params in middleware before into main function
|
|
101
|
-
|
|
101
|
+
validator = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validator);
|
|
102
102
|
// if need to validate authorizer or additional params , add code to hook tag below
|
|
103
103
|
|
|
104
104
|
//(<afterValidateWith>)
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs
CHANGED
|
@@ -25,8 +25,8 @@ import asyncFlowSharedLib from "@izara_project/izara-core-library-asynchronous-f
|
|
|
25
25
|
import dynamodbSharedLib from "@izara_project/izara-core-library-dynamodb";
|
|
26
26
|
|
|
27
27
|
import { sns } from "@izara_project/izara-core-library-external-request";
|
|
28
|
-
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib
|
|
29
|
-
|
|
28
|
+
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib, identifiersObject } from '@izara_project/izara-core-library-service-schemas'
|
|
29
|
+
const { findLinksByObjTypes } = relSchemaLib;
|
|
30
30
|
const {
|
|
31
31
|
getRelationshipSchemaWithCache,
|
|
32
32
|
getObjSchemaS3WithHierarchy
|
|
@@ -47,6 +47,7 @@ const {
|
|
|
47
47
|
TOPIC_NAME_GRAPH_HANDLER
|
|
48
48
|
} = constsGenerateCodeLibs;
|
|
49
49
|
|
|
50
|
+
|
|
50
51
|
//(<optionalRequire>)
|
|
51
52
|
//(</optionalRequire>)
|
|
52
53
|
/**
|
|
@@ -129,7 +130,7 @@ export default async function createRelationship(
|
|
|
129
130
|
const relationshipSchema = await getRelationshipSchemaWithCache(_izContext, relType);
|
|
130
131
|
_izContext.logger.debug("relationshipSchema: ", relationshipSchema);
|
|
131
132
|
|
|
132
|
-
const links = await findLinksByObjTypes(_izContext, [firstObject.objType, secondObject.objType], relationshipSchema.links)
|
|
133
|
+
const links = await findLinksByObjTypes.findLinksByObjTypes(_izContext, [firstObject.objType, secondObject.objType], relationshipSchema.links)
|
|
133
134
|
_izContext.logger.debug("links", links)
|
|
134
135
|
if (!links.length) {
|
|
135
136
|
errorsFound.push(`not found link between ${JSON.stringify({ firstObject: firstObject.objType })} ${JSON.stringify({ secondObject: secondObject.objType })}`)
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs
CHANGED
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import createRelationshipComplete from './CreateRelationshipComplete_Main.js';
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema} from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs
CHANGED
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import deleteRelationshipComplete from './DeleteRelationshipComplete_Main.js';
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js';
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs
CHANGED
|
@@ -27,7 +27,8 @@ import dynamodbSharedLib from "@izara_project/izara-core-library-dynamodb";
|
|
|
27
27
|
|
|
28
28
|
import { sns,lambda } from "@izara_project/izara-core-library-external-request";
|
|
29
29
|
|
|
30
|
-
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib
|
|
30
|
+
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib, identifiersObject } from '@izara_project/izara-core-library-service-schemas'
|
|
31
|
+
const { findLinksByObjTypes } = relSchemaLib;
|
|
31
32
|
|
|
32
33
|
const {
|
|
33
34
|
getRelationshipSchemaWithCache,
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs
CHANGED
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import getRelationshipComplete from './GetRelationshipComplete_Main.js';
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema} from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
|
@@ -26,7 +26,8 @@ import dynamodbSharedLib from "@izara_project/izara-core-library-dynamodb";
|
|
|
26
26
|
|
|
27
27
|
import { sns,lambda } from "@izara_project/izara-core-library-external-request";
|
|
28
28
|
|
|
29
|
-
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib
|
|
29
|
+
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib, identifiersObject } from '@izara_project/izara-core-library-service-schemas'
|
|
30
|
+
const { findLinksByObjTypes } = relSchemaLib;
|
|
30
31
|
|
|
31
32
|
const {
|
|
32
33
|
getRelationshipSchemaWithCache,
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import <%- functionName %> from './<%- functionName %>_Main.js';
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
|
|
21
21
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler, validatorSchema} from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs
CHANGED
|
@@ -27,7 +27,8 @@ import dynamodbSharedLib from "@izara_project/izara-core-library-dynamodb";
|
|
|
27
27
|
|
|
28
28
|
import { sns,lambda } from "@izara_project/izara-core-library-external-request";
|
|
29
29
|
|
|
30
|
-
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib
|
|
30
|
+
import { getObjectSchema, utils, serviceConfig, consts, relSchemaLib, identifiersObject } from '@izara_project/izara-core-library-service-schemas'
|
|
31
|
+
const { findLinksByObjTypes } = relSchemaLib;
|
|
31
32
|
|
|
32
33
|
const {
|
|
33
34
|
getRelationshipSchemaWithCache,
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs
CHANGED
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
import Logger from '@izara_project/izara-core-library-logger';
|
|
23
|
-
import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
|
|
23
|
+
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
24
24
|
|
|
25
25
|
import updateRelationshipComplete from './UpdateRelationshipComplete_Main.js';
|
|
26
26
|
|
package/src.zip
ADDED
|
Binary file
|
|
@@ -1,74 +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
|
-
// 'use strict';
|
|
19
|
-
|
|
20
|
-
// const path = require('path');
|
|
21
|
-
// const getObjectSchemas = require('@izara_project/izara-core-library-service-schemas').getObjectSchema
|
|
22
|
-
// const {
|
|
23
|
-
// getLocalConfig,
|
|
24
|
-
// directoryPath
|
|
25
|
-
// } = require('../../libs/generateTestsLibs')
|
|
26
|
-
|
|
27
|
-
// const templatePath = path.join(__dirname, "./templateresources.ejs")
|
|
28
|
-
// async function data(_izContext, srcPath) {
|
|
29
|
-
// console.log("srcPath", srcPath)
|
|
30
|
-
// let schemaPath = path.join(srcPath, "../../../schemas")
|
|
31
|
-
// let slsymlPath = path.join(srcPath, "../../../../sls_yaml/generatedCode/source/")
|
|
32
|
-
// let serviceTag = getLocalConfig(path.join(srcPath, "../../"), "iz_serviceTag")
|
|
33
|
-
// let functionPath = path.join(srcPath, "../../../../sls_yaml/")
|
|
34
|
-
// // console.log("serviceTag", serviceTag);
|
|
35
|
-
|
|
36
|
-
// // let allObjectSchema = await getObjectSchemas.getAllLocalObjectSchemasWithHierarchy(_izContext, schemaPath)
|
|
37
|
-
// let allObjectSchema = await getObjectSchemas.getAllLocalObjectSchemas(_izContext, schemaPath) // get ObjectSchemas Local
|
|
38
|
-
|
|
39
|
-
// let allObjectSchemas = allObjectSchema.records
|
|
40
|
-
|
|
41
|
-
// let tableNames = [];
|
|
42
|
-
// for (let objectSchema of allObjectSchemas) {
|
|
43
|
-
// // console.log("objectSchema", objectSchema)
|
|
44
|
-
// for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
45
|
-
// // console.log("storageResource_Data", storageResource)
|
|
46
|
-
// if (storageResource.storageType === "dynamoDB") {
|
|
47
|
-
// // console.log("storageResource_Data_Before_Push_Dynamo", storageResource)
|
|
48
|
-
// tableNames.push(storageResource.tableName)
|
|
49
|
-
// }
|
|
50
|
-
// }
|
|
51
|
-
// }
|
|
52
|
-
|
|
53
|
-
// let functionComponent = {}
|
|
54
|
-
// const generateFunctionComponent = directoryPath(slsymlPath);
|
|
55
|
-
// const mainFunctionComponent = directoryPath(functionPath);
|
|
56
|
-
|
|
57
|
-
// Object.assign(functionComponent, generateFunctionComponent, mainFunctionComponent)
|
|
58
|
-
|
|
59
|
-
// return {
|
|
60
|
-
// templatePath: templatePath,
|
|
61
|
-
// templateData: { tableNames, functionComponent },
|
|
62
|
-
// setting: {
|
|
63
|
-
// generateHookFile: false,
|
|
64
|
-
// savePath: path.join(srcPath, `../../${serviceTag}/sheardResources//`),
|
|
65
|
-
// saveFileName: 'resources',
|
|
66
|
-
// fileExtension: ".json",
|
|
67
|
-
// isAppend: false
|
|
68
|
-
// }
|
|
69
|
-
// }
|
|
70
|
-
// }
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// module.exports = data
|
|
@@ -1,144 +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
|
-
// 'use strict';
|
|
19
|
-
|
|
20
|
-
// const path = require("path");
|
|
21
|
-
// const { join, resolve } = require("path");
|
|
22
|
-
// const { readFileSync } = require("fs");
|
|
23
|
-
// // const templateConfig = require("./TemplateConfig");
|
|
24
|
-
// const {
|
|
25
|
-
// sourceMgr:
|
|
26
|
-
// {
|
|
27
|
-
// utils: {
|
|
28
|
-
// deleteFileInDir,
|
|
29
|
-
// },
|
|
30
|
-
// createSource: { createSource }
|
|
31
|
-
// }
|
|
32
|
-
// } = require('@izara_project/izara-market-library-service-schemas')
|
|
33
|
-
// // const { validatePathWithRootServicePath } = require('../libs/Libs')
|
|
34
|
-
// const { exec } = require('child_process');
|
|
35
|
-
|
|
36
|
-
// async function generateCodeWithTemplate(_izContext, savePath, settings) {
|
|
37
|
-
// try {
|
|
38
|
-
|
|
39
|
-
// // let packagePath = path.join(__dirname, "../../")
|
|
40
|
-
// // console.log({ packagePath });
|
|
41
|
-
// // --------- Prepare path -------------
|
|
42
|
-
// // point to app/src
|
|
43
|
-
// // let saveFilePath = join(packagePath, `../`);
|
|
44
|
-
|
|
45
|
-
// // point to root folder of service
|
|
46
|
-
// // let localServicePath = join(saveFilePath, "../../");
|
|
47
|
-
|
|
48
|
-
// //------ Start Create Source ------
|
|
49
|
-
|
|
50
|
-
// // collect all result of template data for execute createSource
|
|
51
|
-
// let allCreateSource = []
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// let generateTemplateData = require("./generateResources/generateResources")
|
|
55
|
-
// let createSourceResult = await generateTemplateData(_izContext, savePath, settings);
|
|
56
|
-
// // console.log({ createSourceResult })
|
|
57
|
-
// // Filter out empty or invalid objects before adding to allCreateSource
|
|
58
|
-
// if (Array.isArray(createSourceResult)) {
|
|
59
|
-
// const validResults = createSourceResult.filter(item =>
|
|
60
|
-
// item && item.templatePath && item.templateData && item.setting
|
|
61
|
-
// );
|
|
62
|
-
// allCreateSource.push(...validResults);
|
|
63
|
-
// }
|
|
64
|
-
// // console.log({ allCreateSource })
|
|
65
|
-
// // check each allCreateSource valid
|
|
66
|
-
// for (let item of allCreateSource) {
|
|
67
|
-
// // throw Error('Skipping invalid source item:', item);
|
|
68
|
-
// if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
69
|
-
// console.log('throw Error Skipping invalid source item:', item);
|
|
70
|
-
// throw Error('Skipping invalid source item:', item);
|
|
71
|
-
// }
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// const { templatePath, templateData, setting } = item;
|
|
75
|
-
// setting.checkCreateSourcePass = true;
|
|
76
|
-
|
|
77
|
-
// let [status, errors] = await createSource(
|
|
78
|
-
// readFileSync(templatePath, 'utf8'),
|
|
79
|
-
// templateData,
|
|
80
|
-
// setting,
|
|
81
|
-
// );
|
|
82
|
-
|
|
83
|
-
// if (status === false) {
|
|
84
|
-
// console.log('templatePath in generateCode', templatePath)
|
|
85
|
-
// throw Error(errors)
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
// // validatePathWithRootServicePath(localServicePath, setting.savePath)
|
|
89
|
-
// // await deleteFileInDir(setting.savePath);
|
|
90
|
-
// }
|
|
91
|
-
|
|
92
|
-
// // generate all source
|
|
93
|
-
// for (let item of allCreateSource) {
|
|
94
|
-
// // throw error if item is invalid
|
|
95
|
-
// if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
96
|
-
// console.log('Throwing invalid source item:', item);
|
|
97
|
-
// throw Error('Throwing invalid source item:', item);
|
|
98
|
-
// }
|
|
99
|
-
|
|
100
|
-
// const { templatePath, templateData, setting } = item;
|
|
101
|
-
// setting.checkCreateSourcePass = false;
|
|
102
|
-
|
|
103
|
-
// await createSource(
|
|
104
|
-
// readFileSync(templatePath, 'utf8'),
|
|
105
|
-
// templateData,
|
|
106
|
-
// setting,
|
|
107
|
-
// );
|
|
108
|
-
// }
|
|
109
|
-
|
|
110
|
-
// console.log('Generated all source files successfully');
|
|
111
|
-
|
|
112
|
-
// // exec(`bash ${path.join(packagePath, "./frontEnd/NpmBash.bash")}`, (error, stdout, stderr) => {
|
|
113
|
-
// // if (error) {
|
|
114
|
-
// // console.error(`
|
|
115
|
-
// // ${error.message}`);
|
|
116
|
-
// // return;
|
|
117
|
-
// // }
|
|
118
|
-
// // if (stderr) {
|
|
119
|
-
// // console.error(`${stderr}`);
|
|
120
|
-
// // return;
|
|
121
|
-
// // }
|
|
122
|
-
// // console.log(`${stdout}`);
|
|
123
|
-
// // });
|
|
124
|
-
// // return 'return values';
|
|
125
|
-
// } catch (error) {
|
|
126
|
-
// console.error('Error generating code:', error);
|
|
127
|
-
// throw error;
|
|
128
|
-
// }
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
|
-
// module.exports = {
|
|
132
|
-
// generateCodeWithTemplate
|
|
133
|
-
// }
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
// /*
|
|
137
|
-
// GenerateCode will iterate through templateConfig and generate each template dependOn each templateAndData\
|
|
138
|
-
|
|
139
|
-
// GenerateSchema now use for generate attribute tree only
|
|
140
|
-
// generateSchema can be modify use used depend on use case eg: some objectType have attribute tree inside addOn
|
|
141
|
-
// when generateSchema in own service need to generate ref objectRelationship only
|
|
142
|
-
// and attribute tree service can generate schema
|
|
143
|
-
|
|
144
|
-
// */
|
|
@@ -1,52 +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
|
-
// 'use strict';
|
|
19
|
-
|
|
20
|
-
// // Import required modules
|
|
21
|
-
// // console.log("generate main PropertyValue Schema");
|
|
22
|
-
// const { join } = require('path');
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// // const relationshipPropertyNodeSchema = require('./tests/data')
|
|
28
|
-
// const upload = require('./upload/data')
|
|
29
|
-
|
|
30
|
-
// /**
|
|
31
|
-
// * Generates code with templates for different actions
|
|
32
|
-
// * @param {Object} _izContext - Context object
|
|
33
|
-
// * @param {string} savePath - Path to the schema
|
|
34
|
-
// * @returns {Array} Array of generated code parameters
|
|
35
|
-
// */
|
|
36
|
-
// async function generateCodeWithTemplate(_izContext, savePath, settings) {
|
|
37
|
-
// try {
|
|
38
|
-
// // console.log("settings generateCodeWithTemplate", settings)
|
|
39
|
-
// let allCreateSource = [];
|
|
40
|
-
// const generateUpload = await upload(_izContext, savePath, settings)
|
|
41
|
-
// // console.log("generateResource_Template", generateResource);
|
|
42
|
-
// allCreateSource.push(
|
|
43
|
-
// // generateResource,
|
|
44
|
-
// )
|
|
45
|
-
// return allCreateSource;
|
|
46
|
-
// } catch (error) {
|
|
47
|
-
// _izContext.logger.error('Error generating code with template propertyNode schema:', error);
|
|
48
|
-
// return [];
|
|
49
|
-
// }
|
|
50
|
-
// }
|
|
51
|
-
|
|
52
|
-
// module.exports = generateCodeWithTemplate;
|
|
@@ -1,40 +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
|
-
'use strict';
|
|
19
|
-
|
|
20
|
-
const path = require('path');
|
|
21
|
-
|
|
22
|
-
const { getLocalConfig } = require("../../libs/generateTestsLibs")
|
|
23
|
-
const { uploadFolder } = require("./libs/generateTestUploadLibs")
|
|
24
|
-
|
|
25
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
|
-
const { NoRetryError } = require('@izara_project/izara-core-library-core');
|
|
27
|
-
|
|
28
|
-
async function data(_izContext, srcPath, settings) {
|
|
29
|
-
|
|
30
|
-
let serviceTag = getLocalConfig(path.join(srcPath, "../../"), "iz_serviceTag")
|
|
31
|
-
let pathUpload = settings.saveBucketPath.s3
|
|
32
|
-
const folderPath = path.resolve(__dirname, `../../../../../../src/generateIntegrationTest/${serviceTag}`);
|
|
33
|
-
const s3Prefix = `test_config/${pathUpload}/${serviceTag}/`;
|
|
34
|
-
const bucketName = "integrationtest-config-us-east-2";
|
|
35
|
-
let uploadFolderToS3 = await uploadFolder(bucketName, folderPath, s3Prefix)
|
|
36
|
-
// console.log("uploadFolderToS3", uploadFolderToS3);
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
module.exports = data
|
package/src/reStructure/TemplateData/IntTest/generateUpload/upload/libs/generateTestUploadLibs.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const { putObjectS3 } = require("@izara_project/izara-core-library-s3");
|
|
4
|
-
const Logger = require("@izara_project/izara-core-library-logger")
|
|
5
|
-
const _izContext = { Logger }
|
|
6
|
-
|
|
7
|
-
async function uploadFolder(bucketName, folderPath, s3Prefix) {
|
|
8
|
-
const entries = fs.readdirSync(folderPath, { withFileTypes: true });
|
|
9
|
-
for (const entry of entries) {
|
|
10
|
-
const fullPath = path.join(folderPath, entry.name);
|
|
11
|
-
const s3Key = path.join(s3Prefix, entry.name).replace(/\\/g, "/"); // path for user upload
|
|
12
|
-
|
|
13
|
-
if (entry.isDirectory()) {
|
|
14
|
-
await uploadFolder(bucketName, fullPath, s3Key);
|
|
15
|
-
} else {
|
|
16
|
-
|
|
17
|
-
const fileStream = fs.createReadStream(fullPath);
|
|
18
|
-
const params = {
|
|
19
|
-
Bucket: bucketName,
|
|
20
|
-
Key: s3Key,
|
|
21
|
-
Body: fileStream,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
const result = await putObjectS3(_izContext, params);
|
|
26
|
-
// console.log("Upload-Succuss:", s3Key, "ETag:", result.ETag);
|
|
27
|
-
console.log("Path-Upload ::", s3Key);
|
|
28
|
-
|
|
29
|
-
console.log("Upload-Succuss");
|
|
30
|
-
} catch (err) {
|
|
31
|
-
// console.error("Upload-Failed:", s3Key, err);
|
|
32
|
-
console.log("Upload-Failed");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
module.exports = {
|
|
38
|
-
uploadFolder
|
|
39
|
-
}
|