@izara_project/izara-market-library-service-schemas 1.0.35 → 1.0.36

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 (111) hide show
  1. package/package.json +1 -1
  2. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +2 -1
  3. package/src/MainLibs/src/Consts.js +8 -8
  4. package/src/MainLibs/src/GenerateCodeUtils.js +2 -0
  5. package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/generateTemplateData.js +35 -20
  6. package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/data.js +84 -0
  7. package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/tempReferenceRelationshipSchema.ejs +9 -0
  8. package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/relationshipSchema/data.js +1 -1
  9. package/src/reStructure/SchemaConfig.js +1 -4
  10. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +701 -0
  11. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +34 -162
  12. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +2 -0
  13. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +3 -4
  14. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +2 -0
  15. package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +38 -12
  16. package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +5 -2
  17. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +22 -14
  18. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +4 -1
  19. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +68 -33
  20. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +1 -1
  21. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +1 -1
  22. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -1
  23. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +12 -4
  24. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +13 -8
  25. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/data.js +16 -13
  26. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/template.ejs +9 -9
  27. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/handler/data.js +1 -1
  28. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/template.ejs +7 -9
  29. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/dynamoDB/register.js +82 -0
  30. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/data.js +1 -1
  31. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/template.ejs +34 -1
  32. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/storedCacheTemplate.ejs +10 -33
  33. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/data.js +5 -5
  34. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/template.ejs +6 -6
  35. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/data.js +26 -4
  36. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/template.ejs +5 -5
  37. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/handler/template.ejs +7 -8
  38. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/template.ejs +118 -16
  39. package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +83 -44
  40. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +4 -5
  41. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +1 -7
  42. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +2 -3
  43. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +2 -4
  44. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/data.js +31 -3
  45. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +4 -4
  46. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +7 -8
  47. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/template.ejs +13 -13
  48. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/data.js +4 -4
  49. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/template.ejs +44 -69
  50. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +4 -6
  51. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +2 -2
  52. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +2 -9
  53. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/template.ejs +40 -87
  54. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +5 -4
  55. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +2 -10
  56. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +17 -3
  57. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +2 -2
  58. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +6 -2
  59. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +49 -84
  60. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +55 -10
  61. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +1 -1
  62. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +2 -2
  63. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
  64. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +20 -7
  65. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +24 -33
  66. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data.js +20 -5
  67. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/template.ejs +1 -3
  68. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/data.js +2 -2
  69. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/template.ejs +5 -5
  70. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/data.js +5 -3
  71. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/template.ejs +7 -5
  72. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +6 -3
  73. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +0 -2
  74. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +2 -2
  75. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +3 -3
  76. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +8 -3
  77. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +17 -11
  78. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +14 -8
  79. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +4 -1
  80. package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +50 -42
  81. package/src/reStructure/TemplateData/generateRole/createSharedResource.js +3 -2
  82. package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +3 -0
  83. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +9 -8
  84. package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +5 -1
  85. package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +2 -1
  86. package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -0
  87. package/src/reStructure/TemplateData/{propertyNodeSchema → propertyValueSchema}/generateTemplateData.js +4 -4
  88. package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +131 -0
  89. package/src/reStructure/TemplateData/{propertyNodeSchema/relationshipPropertyNodeSchema → propertyValueSchema/relationshipPropertyValueSchema}/data.js +32 -55
  90. package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/tempRelationship.ejs +13 -0
  91. package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/templateRelationshipPropertyValueSchema.ejs +7 -0
  92. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +2 -1
  93. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +2 -1
  94. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +2 -1
  95. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +5 -5
  96. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +5 -4
  97. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -1
  98. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +4 -4
  99. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +4 -3
  100. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -1
  101. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +2 -1
  102. package/src/reStructure/TemplateData/resourceYaml/dynamodb/template.ejs +1 -3
  103. package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +61 -0
  104. package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +13 -4
  105. package/src/reStructure/TemplateData/propertyNodeSchema/objectPropertyNodeSchema/data.js +0 -151
  106. package/src/reStructure/TemplateData/propertyNodeSchema/relationshipPropertyNodeSchema/templateRelationshipPropertyNodeSchema.ejs +0 -7
  107. /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/attributeLinkTemplate.ejs +0 -0
  108. /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/data.js +0 -0
  109. /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/request.json +0 -0
  110. /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/relationshipSchema/template.ejs +0 -0
  111. /package/src/reStructure/TemplateData/{propertyNodeSchema/objectPropertyNodeSchema/templateObjectPropertyNodeSchema.ejs → propertyValueSchema/objectPropertyValueSchema/templateObjectPropertyValueSchema.ejs} +0 -0
@@ -1,151 +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
- console.log("=== property node schema ===");
21
-
22
- const path = require('path');
23
- const fs = require('fs');
24
- const {
25
- SOURCE_PATH,
26
- ADD_ON_DATA_STRUCTURE_TYPE,
27
- ATTRIBUTE_TAG,
28
- fieldNameSetting,
29
- FIELD_NAME_TPYE,
30
- PROPERTYNODE_TAG,
31
- SAVE_FILE_NAME
32
- } = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
33
-
34
- const templatePath = path.join(__dirname, "./templateObjectPropertyNodeSchema.ejs");
35
-
36
- const modules = {
37
- validateAddOnDataStructure: require('../../../libs/ValidateAddOnDataStructure')
38
- };
39
- const yaml = require("yaml")
40
- const objectschemaLocalByPath = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
41
- const Consts = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts')
42
- // const objectSchemasBySrc = srcPath
43
- async function data(_izContext, settings, srcPath) {
44
-
45
- const configPath = path.join(srcPath, '../../config/serverless.config.yml');
46
- const serverlessConfig = fs.readFileSync(configPath, 'utf8');
47
- const config = yaml.parse(serverlessConfig);
48
- const serviceTag = config.main_config.iz_serviceTag;
49
- const objectSchemaPath = path.join(srcPath, "schemas")
50
- // /home/dogsrcute/Programming mint/BackEnd-Service/workspace_by_work/attributee/empty-education/app/src/
51
-
52
- let allObjectSchemas = await objectschemaLocalByPath.getAllLocalObjectSchemas(
53
- _izContext,
54
- objectSchemaPath
55
- );
56
- _izContext.logger.debug("allObjectSchemas =>>", allObjectSchemas);
57
-
58
- if (allObjectSchemas.records.length == 0) {
59
- throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
60
- };
61
-
62
-
63
- let propertyNodeObjectSchemas = [];
64
- let createSources = [];
65
-
66
- for (const objectSchema of allObjectSchemas.records) {
67
-
68
- let objectType = objectSchema.objectType;
69
-
70
- // validate only addOnndataStructure is type propertyNode.
71
-
72
- if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
73
- console.log(`Not have data in addOnDataStructure in objectType:${objectType} ,continute nextObjectSchema`);
74
- continue;
75
- };
76
-
77
- for (let eachAddOnDataStructure of objectSchema.addOnDataStructure) {
78
-
79
- if (eachAddOnDataStructure.type !== Consts.ADD_ON_DATA_STRUCTURE_TYPE.propertyNode) {
80
- console.log("continute, not type propertyNode next addOnDataStructure")
81
- continue
82
- };
83
-
84
- const storageResources = objectSchema.storageResources; // storageResource from main objectType
85
- const storageResourceTag = Object.keys(storageResources); // storage ResourceTag from main objectType
86
- const compositeKeyDeliminator = objectSchema.compositeKeyDeliminator;
87
-
88
- propertyNodeObjectSchemas.push(
89
- { // {subject}property
90
- objectType: objectType + PROPERTYNODE_TAG.property,
91
- fieldNames: {
92
- [objectType + PROPERTYNODE_TAG.property + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
93
- },
94
- identifiers: [
95
- {
96
- type: "identifier",
97
- fieldName: objectType + PROPERTYNODE_TAG.property + "Id"
98
- }
99
- ]
100
- },
101
- { // {subject}propertyLabel
102
- objectType: objectType + PROPERTYNODE_TAG.propertyLabel,
103
- fieldNames: {
104
- [objectType + PROPERTYNODE_TAG.propertyLabel + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
105
- },
106
- identifiers: [
107
- {
108
- type: "identifier",
109
- fieldName: objectType + PROPERTYNODE_TAG.propertyLabel + "Id"
110
- }
111
- ]
112
- }
113
- );
114
-
115
- for (let propertyNodeObjectSchema of propertyNodeObjectSchemas) {
116
- Object.assign(propertyNodeObjectSchema, {
117
- storageResources: storageResources, // add storageResources
118
- compositeKeyDeliminator: compositeKeyDeliminator
119
- })
120
- for (let attributeTreeFieldName of Object.values(propertyNodeObjectSchema.fieldNames)) {
121
- Object.assign(attributeTreeFieldName, { storageResourceTags: storageResourceTag }) // add storageResourceTags for each fieldName
122
- }
123
- };
124
- for (const propertyNodeObjectSchema of propertyNodeObjectSchemas) {
125
- createSources.push({
126
- templatePath: templatePath,
127
- templateData: {
128
- fieldNames: JSON.stringify(propertyNodeObjectSchema.fieldNames, null, 2),
129
- identifiers: JSON.stringify(propertyNodeObjectSchema.identifiers, null, 2),
130
- objectType: propertyNodeObjectSchema.objectType,
131
- storageResources: JSON.stringify(propertyNodeObjectSchema.storageResources, null, 2),
132
- compositeKeyDeliminator: propertyNodeObjectSchema.compositeKeyDeliminator
133
- },
134
- setting: {
135
- savePath: path.join(srcPath, SOURCE_PATH.generatedPropertyNode, propertyNodeObjectSchema.objectType + "/"),
136
- hookPath: path.join(srcPath, "schemaHook", "propertyNode", propertyNodeObjectSchema.objectType, "/"),
137
- saveFileName: SAVE_FILE_NAME.objectSchema,
138
- fileExtension: ".js",
139
- isAppend: false
140
- }
141
- })
142
- };
143
-
144
-
145
- };//End loop addOn
146
- }; //End loop objectSchema
147
-
148
- return createSources;
149
- }
150
-
151
- module.exports = data
@@ -1,7 +0,0 @@
1
- module.exports = [
2
- <% datas.forEach(data => { %>
3
- {
4
- <%- data.relationshipTag %>: <%- JSON.stringify(data.relationshipProperties,null,2) %>
5
- },
6
- <% }) %>
7
- ]