@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.
Files changed (75) hide show
  1. package/package.json +3 -2
  2. package/src/MainLibs/src/Consts.js +14 -1
  3. package/src/MainLibs/src/Utils.js +4 -3
  4. package/src/reStructure/GenerateResources.js +127 -0
  5. package/src/reStructure/GenerateTests.js +21 -22
  6. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +2 -1
  7. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +1 -1
  8. package/src/reStructure/TemplateData/IntTest/generateResources/generateResources.js +76 -41
  9. package/src/reStructure/TemplateData/IntTest/generateTests/bashScript/data.js +45 -0
  10. package/src/reStructure/TemplateData/IntTest/generateTests/bashScript/template.ejs +0 -0
  11. package/src/reStructure/TemplateData/IntTest/generateTests/events/data.js +103 -100
  12. package/src/reStructure/TemplateData/IntTest/generateTests/events/templateEvents.ejs +8 -7
  13. package/src/reStructure/TemplateData/IntTest/generateTests/generateTemplate.js +59 -61
  14. package/src/reStructure/TemplateData/IntTest/generateTests/tests/data.js +168 -260
  15. package/src/reStructure/TemplateData/IntTest/generateTests/tests/templateTests.ejs +3 -1
  16. package/src/reStructure/TemplateData/IntTest/libs/{generateTestsLibs.js → libs.js} +82 -84
  17. package/src/reStructure/TemplateData/IntTest/upload/uploadIntTest.js +60 -0
  18. package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +1 -1
  19. package/src/reStructure/TemplateData/findData/handler/template.ejs +1 -1
  20. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +1 -1
  21. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +1 -1
  22. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +1 -1
  23. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +3 -2
  24. package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +1 -1
  25. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +2 -1
  26. package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +7 -7
  27. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +1 -1
  28. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
  29. package/src/reStructure/TemplateData/flowSchema/flowStep/handler/template.ejs +1 -1
  30. package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +1 -1
  31. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +1 -1
  32. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +1 -1
  33. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +1 -0
  34. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +1 -1
  35. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +1 -0
  36. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +1 -0
  37. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +1 -1
  38. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +1 -1
  39. package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +1 -1
  40. package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +1 -1
  41. package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +1 -1
  42. package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +1 -1
  43. package/src/reStructure/TemplateData/processLogical/handler/template.ejs +1 -1
  44. package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +1 -1
  45. package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +1 -1
  46. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  47. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  48. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +1 -1
  49. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  50. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +2 -2
  51. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +4 -3
  52. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +1 -1
  53. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  54. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  55. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +1 -1
  56. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  57. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  58. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -1
  59. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +1 -1
  60. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  61. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  62. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +2 -1
  63. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +1 -1
  64. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  65. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  66. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -1
  67. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +1 -1
  68. package/src.zip +0 -0
  69. package/src/reStructure/TemplateData/IntTest/generateResources/resources/data.js +0 -74
  70. package/src/reStructure/TemplateData/IntTest/generateResources.js +0 -144
  71. package/src/reStructure/TemplateData/IntTest/generateUpload/genetateTempleteUpload.js +0 -52
  72. package/src/reStructure/TemplateData/IntTest/generateUpload/upload/data.js +0 -40
  73. package/src/reStructure/TemplateData/IntTest/generateUpload/upload/libs/generateTestUploadLibs.js +0 -39
  74. package/src/reStructure/TemplateData/IntTest/generateUpload.js +0 -145
  75. /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
- validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema);
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>)
@@ -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 as findLinksByObjTypes, identifiersObject } from '@izara_project/izara-core-library-service-schemas'
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 })}`)
@@ -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>)
@@ -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>)
@@ -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 as findLinksByObjTypes ,identifiersObject } from '@izara_project/izara-core-library-service-schemas'
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,
@@ -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 as findLinksByObjTypes ,identifiersObject } from '@izara_project/izara-core-library-service-schemas'
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>)
@@ -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 as findLinksByObjTypes ,identifiersObject } from '@izara_project/izara-core-library-service-schemas'
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,
@@ -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
@@ -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
- }