@izara_project/izara-market-library-service-schemas 1.0.51 → 1.0.52
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 +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +12 -1
- package/src/reStructure/TemplateData/EndpointPerService/yaml/template.ejs +16 -6
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +9 -9
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +8 -8
package/package.json
CHANGED
|
@@ -182,6 +182,16 @@ async function createParamForCreateSource(_izContext, allObjSchemas, action, han
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
let resourceApis = [];
|
|
186
|
+
if (action === "get", handler === HANDLER.hdrApi) {
|
|
187
|
+
for (const objectSchema of allObjSchemas.records) {
|
|
188
|
+
resourceApis.push({
|
|
189
|
+
event: objectSchema.objectType,
|
|
190
|
+
method: httpEvent(action)
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
185
195
|
return {
|
|
186
196
|
templatePath: templatePath,
|
|
187
197
|
templateData: {
|
|
@@ -191,7 +201,8 @@ async function createParamForCreateSource(_izContext, allObjSchemas, action, han
|
|
|
191
201
|
event: event,
|
|
192
202
|
roleName: groupBy,
|
|
193
203
|
action: action,
|
|
194
|
-
functionNameConfig
|
|
204
|
+
functionNameConfig,
|
|
205
|
+
resourceApis
|
|
195
206
|
},
|
|
196
207
|
setting: {
|
|
197
208
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -8,12 +8,22 @@
|
|
|
8
8
|
arn: <%- event %>
|
|
9
9
|
batchSize: 10
|
|
10
10
|
<%_ } else if (handlerType === "hdrApi") { _%>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<%_ resourceApis.forEach(resourceApi => { _%>
|
|
12
|
+
- http:
|
|
13
|
+
path: <%- firstLetterUpperCase(resourceApi.event) %>/<%- action %>
|
|
14
|
+
method: <%- resourceApi.method %>
|
|
15
|
+
# authorizer:
|
|
16
|
+
# name: arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:UserAccountTestAuthorizerServiceSchema
|
|
17
|
+
#<#<%- firstLetterUpperCase(resourceApi.event) _%><%- firstLetterUpperCase(handlerType) %>AppLevelAuthorizer#>
|
|
18
|
+
#<#/<%- firstLetterUpperCase(resourceApi.event) _%><%- firstLetterUpperCase(handlerType) %>AppLevelAuthorizer#>
|
|
19
|
+
- http:
|
|
20
|
+
path: <%- firstLetterUpperCase(resourceApi.event) %>/<%- action %>/{targetUserId}
|
|
21
|
+
method: <%- resourceApi.method %>
|
|
22
|
+
# authorizer:
|
|
23
|
+
# name: arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:UserAccountTestAuthorizerServiceSchema
|
|
24
|
+
#<#<%- firstLetterUpperCase(resourceApi.event) _%><%- firstLetterUpperCase(handlerType) %>UserLevelAuthorizer#>
|
|
25
|
+
#<#/<%- firstLetterUpperCase(resourceApi.event) _%><%- firstLetterUpperCase(handlerType) %>UserLevelAuthorizer#>
|
|
26
|
+
<%_ }) _%>
|
|
17
27
|
<%_ } _%>
|
|
18
28
|
role: <%- firstLetterUpperCase(roleName) _%>Role
|
|
19
29
|
#<#<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>IamRole#>
|
|
@@ -24,10 +24,10 @@ const fs = require('fs');
|
|
|
24
24
|
const {
|
|
25
25
|
SOURCE_PATH,
|
|
26
26
|
fieldNameSetting,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
FIELD_NAME_TYPE,
|
|
28
|
+
PROPERTY_VALUE_TAG,
|
|
29
29
|
SAVE_FILE_NAME
|
|
30
|
-
} = require('
|
|
30
|
+
} = require('../../../../MainLibs/src/Consts');
|
|
31
31
|
|
|
32
32
|
const templatePath = path.join(__dirname, "./templateObjectPropertyValueSchema.ejs");
|
|
33
33
|
|
|
@@ -71,26 +71,26 @@ async function data(_izContext, settings, srcPath) {
|
|
|
71
71
|
|
|
72
72
|
propertyValueObjectSchemas.push(
|
|
73
73
|
{ // {subject}property
|
|
74
|
-
objectType: propertyValueTag +
|
|
74
|
+
objectType: propertyValueTag + PROPERTY_VALUE_TAG.property,
|
|
75
75
|
fieldNames: {
|
|
76
|
-
[propertyValueTag +
|
|
76
|
+
[propertyValueTag + PROPERTY_VALUE_TAG.property + "Id"]: fieldNameSetting(FIELD_NAME_TYPE.randomOnCreateFieldName),
|
|
77
77
|
},
|
|
78
78
|
identifiers: [
|
|
79
79
|
{
|
|
80
80
|
type: "identifier",
|
|
81
|
-
fieldName: propertyValueTag +
|
|
81
|
+
fieldName: propertyValueTag + PROPERTY_VALUE_TAG.property + "Id"
|
|
82
82
|
}
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
85
|
{ // {subject}propertyLabel
|
|
86
|
-
objectType: propertyValueTag +
|
|
86
|
+
objectType: propertyValueTag + PROPERTY_VALUE_TAG.propertyLabel,
|
|
87
87
|
fieldNames: {
|
|
88
|
-
[propertyValueTag +
|
|
88
|
+
[propertyValueTag + PROPERTY_VALUE_TAG.propertyLabel + "Id"]: fieldNameSetting(FIELD_NAME_TYPE.randomOnCreateFieldName),
|
|
89
89
|
},
|
|
90
90
|
identifiers: [
|
|
91
91
|
{
|
|
92
92
|
type: "identifier",
|
|
93
|
-
fieldName: propertyValueTag +
|
|
93
|
+
fieldName: propertyValueTag + PROPERTY_VALUE_TAG.propertyLabel + "Id"
|
|
94
94
|
}
|
|
95
95
|
]
|
|
96
96
|
}
|
package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js
CHANGED
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const {
|
|
23
23
|
SOURCE_PATH,
|
|
24
24
|
PREFIX_RELATIONSHIP,
|
|
25
|
-
|
|
25
|
+
PROPERTY_VALUE_TAG,
|
|
26
26
|
SAVE_FILE_NAME
|
|
27
27
|
} = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
28
28
|
|
|
@@ -92,7 +92,7 @@ function createSourceParams(_izContext, objectSchema, settings, srcPath) {
|
|
|
92
92
|
|
|
93
93
|
attributeRelationships.push(
|
|
94
94
|
{ // has{objectType}propertyValue
|
|
95
|
-
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(propertyValue) +
|
|
95
|
+
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(propertyValue) + PROPERTY_VALUE_TAG.property,
|
|
96
96
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
97
97
|
{
|
|
98
98
|
serviceTag: serviceTag,
|
|
@@ -102,7 +102,7 @@ function createSourceParams(_izContext, objectSchema, settings, srcPath) {
|
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
serviceTag: serviceTag,
|
|
105
|
-
objectType: propertyValue +
|
|
105
|
+
objectType: propertyValue + PROPERTY_VALUE_TAG.property,
|
|
106
106
|
linkType: "many",
|
|
107
107
|
requiredOnCreate: true
|
|
108
108
|
},
|
|
@@ -112,7 +112,7 @@ function createSourceParams(_izContext, objectSchema, settings, srcPath) {
|
|
|
112
112
|
},
|
|
113
113
|
// disabled{objectType}propertyValue
|
|
114
114
|
{
|
|
115
|
-
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(propertyValue) +
|
|
115
|
+
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(propertyValue) + PROPERTY_VALUE_TAG.property,
|
|
116
116
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
117
117
|
{
|
|
118
118
|
serviceTag: serviceTag,
|
|
@@ -122,7 +122,7 @@ function createSourceParams(_izContext, objectSchema, settings, srcPath) {
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
serviceTag: serviceTag,
|
|
125
|
-
objectType: propertyValue +
|
|
125
|
+
objectType: propertyValue + PROPERTY_VALUE_TAG.property,
|
|
126
126
|
linkType: "many",
|
|
127
127
|
requiredOnCreate: false
|
|
128
128
|
},
|
|
@@ -132,17 +132,17 @@ function createSourceParams(_izContext, objectSchema, settings, srcPath) {
|
|
|
132
132
|
},
|
|
133
133
|
|
|
134
134
|
{ // is{objectType}PropertyLabel
|
|
135
|
-
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(propertyValue) +
|
|
135
|
+
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(propertyValue) + PROPERTY_VALUE_TAG.propertyLabel,
|
|
136
136
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
137
137
|
{
|
|
138
138
|
serviceTag: serviceTag,
|
|
139
|
-
objectType: propertyValue +
|
|
139
|
+
objectType: propertyValue + PROPERTY_VALUE_TAG.property,
|
|
140
140
|
linkType: "many",
|
|
141
141
|
requiredOnCreate: true
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
serviceTag: serviceTag,
|
|
145
|
-
objectType: propertyValue +
|
|
145
|
+
objectType: propertyValue + PROPERTY_VALUE_TAG.propertyLabel,
|
|
146
146
|
linkType: "one",
|
|
147
147
|
requiredOnCreate: false
|
|
148
148
|
},
|