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

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.70",
3
+ "version": "1.0.71",
4
4
  "description": "Schemas for Izara Market project",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -197,7 +197,6 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
197
197
  for (const flowSchema of allLocalFlowSchemas.records) {
198
198
  // console.log("flowSchema in Generate TemplateData", flowSchema);
199
199
  const webSocketGenerateCodeLibs = createWebSocketGenerateCodeLibs(_izContext, flowSchema, saveFilePath)
200
-
201
200
  createSourceParams.push(...webSocketGenerateCodeLibs)
202
201
  if (!flowSchema.event.includes("s3")) {
203
202
  const flowSchemaEndpointMainFunction = await createFlowSchemaEndpointMainFunction(_izContext, flowSchema, saveFilePath);
@@ -207,6 +206,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
207
206
  // event has [s3, extTopic, ownTopic, eventBridge, lambdaSync]
208
207
  for (const event of flowSchema.event) {
209
208
  if (event.includes("s3")) {
209
+
210
210
  const reservedDataTable = createReservedDataMainTable(_izContext, saveFilePath);
211
211
  const bucketS3 = createBucketS3(_izContext, flowSchema, saveFilePath)
212
212
 
@@ -232,7 +232,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
232
232
 
233
233
  const processAfterUploadFunctionYmlS3 = createProcessAfterUploadS3FunctionYmlS3(_izContext, flowSchema, saveFilePath);
234
234
  // const processAfterUploadFunctionYamlHdrDsq = createProcessAfterUploadS3FunctionYmlDsq(_izContext, saveFilePath);
235
- const processAfterUploadSqs = createProcessAfterUploadS3Queue(_izContext, saveFilePath);
235
+ // const processAfterUploadSqs = createProcessAfterUploadS3Queue(_izContext, saveFilePath);
236
236
  const processAfterUploadHandlerS3 = createProcessAfterUploadS3HandlerS3(_izContext, flowSchema, saveFilePath);
237
237
  // const processAfterUploadHandlerDsq = createProcessAfterUploadS3HandlerDsq(_izContext, saveFilePath);
238
238
  const processAfterUploadMainFunction = createProcessAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
@@ -270,7 +270,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
270
270
 
271
271
  const processAfterUploadResources = [
272
272
  ...processAfterUploadFunctionYmlS3,
273
- ...processAfterUploadSqs,
273
+ // ...processAfterUploadSqs,
274
274
  ...processAfterUploadHandlerS3,
275
275
  ...processAfterUploadMainFunction
276
276
  // Commented resources kept for reference
@@ -303,6 +303,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
303
303
  );
304
304
 
305
305
  } else if (event.includes("extTopic")) {
306
+
306
307
  // ** External Topic ** //
307
308
  const externalSqsFunctionYaml = await createExternalSqsFunctionYaml(_izContext, flowSchema, saveFilePath);
308
309
  const externalSqsHandler = await createExternalSqsHandler(_izContext, flowSchema, saveFilePath);
@@ -358,6 +359,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
358
359
  createSourceParams.push(...ownTopicResources);
359
360
 
360
361
  } else if (event.includes("eventBridge")) {
362
+
361
363
  const flowSchemaEventBridgeHandler = createFlowSchemaEventBridgeHandler(_izContext, flowSchema, saveFilePath);
362
364
  const flowSchemaEventBridgeMainFunction = createFlowSchemaEventBridgeMainFunction(_izContext, flowSchema, saveFilePath);
363
365
  const flowSchemaEventBridgeFunctionYaml = createFlowSchemaEventBridgeFunctionYaml(_izContext, flowSchema, saveFilePath);
@@ -373,6 +375,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
373
375
  console.log("event eventBridge generated")
374
376
  createSourceParams.push(...eventBridgeResources);
375
377
  } else if (event.includes("lambdaSyncInv")) {
378
+
376
379
  const flowSchemaLambdaSyncFunctionYamlInv = createFlowSchemaLambdaSyncFunctionYamlInv(_izContext, flowSchema, saveFilePath);
377
380
  const flowSchemaLambdaSyncHandlerInv = createFlowSchemaLambdaSyncHandlerInv(_izContext, flowSchema, saveFilePath);
378
381
  // const flowSchemaLambdaSyncMainFunctionInv = createFlowSchemaLambdaSyncMainFunctionInv(_izContext, flowSchema, saveFilePath);
@@ -434,18 +437,21 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
434
437
  createSourceParams.push(...flowSchemaOwnTopicFlowStep)
435
438
 
436
439
  if (flowSchema.statusType === "triggerCache") {
437
- const functionYaml = await Promise.all(
438
- Object.entries(createFlowSchemaTriggerCacheFunctionYaml).flatMap(([type, functionYaml]) => functionYaml(_izContext, flowSchema, saveFilePath)));
440
+ const functionYaml = (await Promise.all(Object.entries(createFlowSchemaTriggerCacheFunctionYaml).map(([type, functionYaml]) => functionYaml(_izContext, flowSchema, saveFilePath)))).flat();
439
441
  const mainFunction = Object.entries(createFlowSchemaTriggerCacheMainFunction).flatMap(([type, mainFunction]) => mainFunction(_izContext, flowSchema, saveFilePath));
440
442
  const handler = Object.entries(createFlowSchemaTriggerCacheHandler).flatMap(([type, handler]) => handler(_izContext, flowSchema, saveFilePath));
441
443
  const queue = createFlowSchemaTriggerCacheQueue(flowSchema, saveFilePath);
442
-
444
+ // console.log("functionYaml", JSON.stringify(...functionYaml, null, 2))
443
445
  createSourceParams.push(...functionYaml, ...mainFunction, ...handler, ...queue)
446
+ // console.log("createSourceParams triggerCache", JSON.stringify(createSourceParams, null, 2))
447
+ console.log("mainFunction triggerCache", JSON.stringify(mainFunction, null, 2))
448
+ console.log("handler triggerCache", JSON.stringify(handler, null, 2))
444
449
  console.log("Generate triggerCache component")
445
450
  }
446
451
  }
447
452
 
448
453
  if (allLocalFlowSchemas.records.length) {
454
+
449
455
  console.log("flowSchema Register");
450
456
  const flowSchemaRegisterHandlerComplete = createFlowSchemaRegisterHandlerComplete(_izContext, saveFilePath);
451
457
  const flowSchemaRegisterMainComplete = await createFlowSchemaRegisterMainCompleteFunc(_izContext, allLocalFlowSchemas, saveFilePath);
@@ -51,7 +51,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
51
51
  queueName
52
52
  },
53
53
  setting: {
54
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag)),
54
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
55
55
  saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
56
56
  fileExtension: ".js",
57
57
  isAppend: true
@@ -49,7 +49,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
49
49
  flowTag: flowSchema.flowTag
50
50
  },
51
51
  setting: {
52
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag)),
52
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
53
53
  saveFileName: `${upperCase(functionName)}_Main`,
54
54
  fileExtension: ".js",
55
55
  isAppend: true
@@ -51,7 +51,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
51
51
  queueName
52
52
  },
53
53
  setting: {
54
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag)),
54
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
55
55
  saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
56
56
  fileExtension: ".js",
57
57
  isAppend: true
@@ -48,7 +48,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
48
48
  queueName
49
49
  },
50
50
  setting: {
51
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag)),
51
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
52
52
  saveFileName: `${upperCase(functionName)}_Main`,
53
53
  fileExtension: ".js",
54
54
  isAppend: true
@@ -51,7 +51,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
51
51
  queueName
52
52
  },
53
53
  setting: {
54
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag)),
54
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
55
55
  saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
56
56
  fileExtension: ".js",
57
57
  isAppend: true
@@ -49,7 +49,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
49
49
  flowTag: flowSchema.flowTag
50
50
  },
51
51
  setting: {
52
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag)),
52
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
53
53
  saveFileName: `${upperCase(functionName)}_Main`,
54
54
  fileExtension: ".js",
55
55
  isAppend: true