@izara_project/izara-market-library-service-schemas 1.0.71 → 1.0.72

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_project/izara-market-library-service-schemas",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "Schemas for Izara Market project",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,7 +24,7 @@
24
24
  "@izara_project/izara-core-library-core": "^1.0.20",
25
25
  "@izara_project/izara-core-library-external-request": "^1.0.20",
26
26
  "@izara_project/izara-core-library-logger": "^1.0.7",
27
- "@izara_project/izara-core-library-service-schemas": "^1.0.95",
27
+ "@izara_project/izara-core-library-service-schemas": "^1.0.96",
28
28
  "@izara_project/izara-core-library-sns": "^1.0.6",
29
29
  "@izara_project/izara-core-library-sqs": "^1.0.4",
30
30
  "@izara_project/izara-shared": "^1.0.126",
@@ -133,8 +133,13 @@ module.exports.createMain = async (
133
133
  parentObject = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, objectSchema.extendObjType)
134
134
  }
135
135
 
136
- let userAgent = _izContext.correlationIds.get(middlewareConsts.USER_AGENT)
137
- _izContext.logger.debug("userAgent::", userAgent);
136
+ let userAgent = false;
137
+ let directInvoke = false;
138
+ if (_izContext.correlationIds.get(middlewareConsts.USER_AGENT)) {
139
+ userAgent = true;
140
+ } else if (requestParams.hasOwnProperty("__context__") && requestParams.izEventSource.eventSourceTag === "DirectInvoke") {
141
+ directInvoke = true;
142
+ }
138
143
 
139
144
  let createDataDetails = await createDataDetailsLib(
140
145
  _izContext,
@@ -472,10 +477,27 @@ module.exports.createMain = async (
472
477
  objInstanceFullForGraph,
473
478
  requestParams.relationships || [],
474
479
  Date.now(),
475
- { updatePropertiesOnMatch: false }
480
+ {
481
+ updatePropertiesOnMatch: false
482
+ }
476
483
  )
477
484
  return createNodeResult
478
485
 
486
+ } else if (directInvoke) {
487
+ _izContext.logger.debug("Direction Invoke case will invoke GraphHandlerInv")
488
+ let createNodeResult = await graphSharedLibs.createNodeV2(
489
+ _izContext,
490
+ graphServiceName,
491
+ objType,
492
+ objInstanceFullForGraph,
493
+ requestParams.relationships,
494
+ Date.now(),
495
+ {
496
+ updatePropertiesOnMatch: false
497
+ }
498
+ );
499
+
500
+ return createNodeResult;
479
501
  } else {
480
502
  _izContext.logger.debug("not have userAgent will send Message to GraphHandler")
481
503
  messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
@@ -7,9 +7,11 @@
7
7
  bucket: <%- bucketName %>
8
8
  event: s3:ObjectCreated:*
9
9
  existing: true
10
- # rules:
11
- # - prefix: uploads/
12
- # - suffix: .csv
10
+ rules:
11
+ #<#<%- functionName %><%- handlerType %>rules#>
12
+ #<#/<%- functionName %><%- handlerType %>rules#>
13
+ - prefix: uploads/
14
+ - suffix: .csv
13
15
  forceDeploy: true
14
16
  role: <%- roleName %>Role
15
17
  #<#<%- functionName %><%- handlerType %>IamRole#>
@@ -81,7 +81,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
81
81
  return {
82
82
  templatePath: templatePath,
83
83
  templateData: {
84
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(functionName), "source/"),
84
+ resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(flowSchema.flowTag), "source/"),
85
85
  functionName,
86
86
  handlerType,
87
87
  additionalResourcePermission,
@@ -46,7 +46,6 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
46
46
  return {
47
47
  templatePath: templatePath,
48
48
  templateData: {
49
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(functionName), "source/"),
50
49
  functionName,
51
50
  queueName
52
51
  },
@@ -81,7 +81,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
81
81
  return {
82
82
  templatePath: templatePath,
83
83
  templateData: {
84
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(functionName), "source/"),
84
+ resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(flowSchema.flowTag), "source/"),
85
85
  functionName,
86
86
  handlerType,
87
87
  additionalResourcePermission,
@@ -46,7 +46,6 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
46
46
  return {
47
47
  templatePath: templatePath,
48
48
  templateData: {
49
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(functionName), "source/"),
50
49
  functionName,
51
50
  queueName
52
51
  },
@@ -81,7 +81,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
81
81
  return {
82
82
  templatePath: templatePath,
83
83
  templateData: {
84
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(functionName), "source/"),
84
+ resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(flowSchema.flowTag), "source/"),
85
85
  functionName,
86
86
  handlerType,
87
87
  additionalResourcePermission,
@@ -46,7 +46,6 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
46
46
  return {
47
47
  templatePath: templatePath,
48
48
  templateData: {
49
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(functionName), "source/"),
50
49
  functionName,
51
50
  queueName
52
51
  },
@@ -96,7 +96,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
96
96
  passOnProperties.push(record.body.Message.errorsFound)
97
97
  passOnProperties.push(record.body.Message.graphServiceTag)
98
98
  passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
99
- // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
99
+ // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callingFlow
100
100
  record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
101
101
 
102
102
  // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)