@izara_project/izara-core-generate-service-code 1.0.40 → 1.0.41

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-core-generate-service-code",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "Code for locally generating per service files",
5
5
  "author": "Sven Mason <thebarbariansven@gmail.com>",
6
6
  "license": "AGPL-3.0-or-later",
@@ -21,10 +21,13 @@ import { middlewareHandler as middleware, validatorSchema, consts, response } fr
21
21
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
22
22
  import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
23
23
  import { objectHash as hash } from '@izara_project/izara-shared-core';
24
- import { postToConnection } from '../../../../libs/source/GenerateCodeLibs.js';
25
- import <%- functionName %> from './<%- functionName %>_Main.js';
26
24
  import { utils, getObjectSchema } from "@izara_project/izara-core-library-service-schemas";
27
- const { createFlowTypeConcat } = utils
25
+ const { createFlowTypeConcat } = utils;
26
+
27
+ import { webSocket } from '@izara_project/izara-core-library-external-request';
28
+ const { postToConnection } = webSocket;
29
+
30
+ import <%- functionName %> from './<%- functionName %>_Main.js';
28
31
 
29
32
  export const main = middleware.wrap(async (event, context) => {
30
33
 
@@ -23,13 +23,13 @@ import { getObjectSchema } from '@izara_project/izara-core-library-service-schem
23
23
  import snsSharedLib from '@izara_project/izara-core-library-sns';
24
24
  import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
25
25
  import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
26
- import { sns } from '@izara_project/izara-core-library-external-request';
26
+ import { sns, webSocket } from '@izara_project/izara-core-library-external-request';
27
27
 
28
28
  import { NoRetryError } from '@izara_project/izara-core-library-core';
29
29
  import { consts as coreConsts } from "@izara_project/izara-middleware";
30
30
  import { consts as generateCodeConsts } from '@izara_project/izara-core-generate-service-code';
31
31
  const { TOPIC_NAME_GENERATE_CODE } = generateCodeConsts;
32
- import { postToConnection } from '../../../../libs/source/GenerateCodeLibs.js';
32
+ const { postToConnection } = webSocket;
33
33
 
34
34
  //(<optionalRequire>)
35
35
  //(</optionalRequire>)
@@ -66,7 +66,11 @@ export default async function <%- functionName %> (
66
66
  serviceTag: process.env.iz_serviceTag,
67
67
  })
68
68
 
69
- _izContext.logger.debug("flowSchema", flowSchema)
69
+ _izContext.logger.debug("flowSchema", flowSchema);
70
+
71
+ if (flowSchema.initiateBy === 'user') {
72
+ _izContext.correlationIds.set(coreConsts.USER_AGENT, 'webSocket');
73
+ };
70
74
 
71
75
  let connectionId = _izContext.correlationIds.get(coreConsts.CONNECTION_ID);
72
76
 
@@ -20,7 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  import { middlewareHandler as middleware, consts, response } from "@izara_project/izara-middleware";
21
21
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
22
22
  import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
23
- import { postToConnection } from '../../../../libs/source/GenerateCodeLibs.js';
23
+ import { webSocket } from '@izara_project/izara-core-library-external-request';
24
+ const { postToConnection } = webSocket;
24
25
  import { utils } from "@izara_project/izara-core-library-service-schemas";
25
26
  const { createFlowTypeConcat } = utils
26
27
 
@@ -16,9 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
 
18
18
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
19
- import { consts as coreConsts } from '@izara_project/izara-middleware'
19
+ import { consts as coreConsts } from '@izara_project/izara-middleware';
20
+ import { webSocket } from '@izara_project/izara-core-library-external-request';
21
+ const { postToConnection } = webSocket;
20
22
 
21
- import { postToConnection } from '../../../../libs/source/GenerateCodeLibs.js'
22
23
  export async function webSocketTaskComplete(
23
24
  _izContext,
24
25
  updateItem
@@ -21,14 +21,15 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
21
21
  import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
22
22
  import snsSharedLib from '@izara_project/izara-core-library-sns';
23
23
  import asyncFlowSharedLib from "@izara_project/izara-core-library-asynchronous-flow";
24
- import { sns } from '@izara_project/izara-core-library-external-request';
24
+ import { sns, webSocket } from '@izara_project/izara-core-library-external-request';
25
25
  import { consts as generateCodeConsts } from '@izara_project/izara-core-generate-service-code';
26
26
  import { consts as coreConsts } from '@izara_project/izara-middleware';
27
27
  import { objectHash as hash } from '@izara_project/izara-shared-core';
28
28
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
29
- import { processStaticLimit, postToConnection } from '../../../../libs/source/GenerateCodeLibs.js';
29
+ import { processStaticLimit } from '../../../../libs/source/GenerateCodeLibs.js';
30
30
  import { utils } from "@izara_project/izara-core-library-service-schemas";
31
31
  const { createFlowTypeConcat } = utils
32
+ const { postToConnection } = webSocket;
32
33
 
33
34
  //(<optionalRequired>)
34
35
  //(</optionalRequired>)
@@ -24,8 +24,8 @@ import { getObjectSchema, identifiersObject } from '@izara_project/izara-core-li
24
24
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
25
25
  import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
26
26
 
27
- import { lambda } from '@izara_project/izara-core-library-external-request';
28
- import { postToConnection } from "../../../libs/source/GenerateCodeLibs.js";
27
+ import { lambda, webSocket } from '@izara_project/izara-core-library-external-request';
28
+ const { postToConnection } = webSocket;
29
29
 
30
30
  /**
31
31
  * description of function.
@@ -22,7 +22,9 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
22
22
 
23
23
  import registerMain from './Register_Main.js';
24
24
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
25
- import { postToConnection } from "../../../libs/source/GenerateCodeLibs.js";
25
+
26
+ import { webSocket } from '@izara_project/izara-core-library-external-request';
27
+ const { postToConnection } = webSocket;
26
28
 
27
29
  export const main = middleware.wrap(async (event, context) => {
28
30
 
@@ -20,13 +20,12 @@ along with this program. If not, see
20
20
 
21
21
  import { objectHash as hash } from '@izara_project/izara-shared-core';
22
22
  import { getObjectSchema, identifiersObject } from '@izara_project/izara-core-library-service-schemas';
23
- import lodash from 'lodash'
24
23
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
25
24
  import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
26
- import { lambda } from '@izara_project/izara-core-library-external-request'
25
+ import { lambda, webSocket } from '@izara_project/izara-core-library-external-request'
27
26
  import { NoRetryError } from '@izara_project/izara-core-library-core';
28
27
  import { consts } from '@izara_project/izara-middleware';
29
- import { postToConnection } from '../../../libs/source/GenerateCodeLibs'
28
+ const { postToConnection } = webSocket;
30
29
 
31
30
  /**
32
31
  *
@@ -123,7 +122,7 @@ export default async function registerMain(
123
122
  }
124
123
  identifier = identifier;
125
124
  } else {
126
- let pureRequestParams = lodash.cloneDeep(requestParams);
125
+ let pureRequestParams = structuredClone(requestParams);
127
126
  delete pureRequestParams.flowTag
128
127
  identifier = pureRequestParams
129
128
  }
@@ -24,7 +24,8 @@ import { getObjectSchema, utils } from '@izara_project/izara-core-library-servic
24
24
  const { createFlowTypeConcat } = utils;
25
25
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
26
26
 
27
- import { postToConnection } from "../../../libs/source/GenerateCodeLibs.js";
27
+ import { webSocket } from '@izara_project/izara-core-library-external-request';
28
+ const { postToConnection } = webSocket;
28
29
 
29
30
  //(<optionalRequire>)
30
31
  //(</optionalRequire>)
@@ -54,7 +54,7 @@ async function data(_izContext, data, appPath) {
54
54
  };
55
55
 
56
56
  if (!childFlow) {
57
- throw new NoRetryError(`can't get ${childFlow.flowTag} from s3 or local`);
57
+ throw new NoRetryError(`can't get ${childFlow} from s3 or local`);
58
58
  };
59
59
 
60
60
  if (childFlow && childFlow.hasOwnProperty('objType')) {
@@ -442,14 +442,16 @@ function resolveHandlerConfig(data, flowStepConfig, additionalResourcePermission
442
442
  if (handleLogic === 'awaitingMultipleSteps') {
443
443
  handler = HANDLER.hdrSqs;
444
444
  additionalResourcePermission.push(awaitingMultipleStepsRole())
445
- additionalResourcePermission.push(createIamRole({
446
- [RESOURCE_CLASSES.sns]: Object.values(SNS_RESOURCE)
447
- },
445
+ additionalResourcePermission.push(createSqsResource(
448
446
  [
449
- externalResourceYaml(
450
- RESOURCE_CLASSES.sns,
451
- `${childFlow.flowTag}_In`,
452
- childFlow.serviceTag)
447
+ upperCase(flowTag) +
448
+ upperCase(flowStepName) +
449
+ upperCase(flowStepConfig.settings.handleLogic) +
450
+ upperCase(HANDLER.hdrSqs),
451
+ upperCase(flowTag) +
452
+ upperCase(flowStepName) +
453
+ upperCase(flowStepConfig.settings.handleLogic) +
454
+ upperCase(HANDLER.hdrSqs) + "DLQ"
453
455
  ]
454
456
  ))
455
457
  } else if (handleLogic === 'paginated') {