@izara_project/izara-core-generate-service-code 1.0.90 → 1.0.91

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 (55) hide show
  1. package/package.json +1 -1
  2. package/src/emit/crud/emitDynamicCrudFlowSchemas.js +2 -2
  3. package/src/emit/crud/templates/CreateAfterHookCallback_Main.ejs +6 -6
  4. package/src/emit/crud/templates/CreateBeforeHookCallback_Main.ejs +3 -3
  5. package/src/emit/crud/templates/CreateComplete_Main.ejs +22 -22
  6. package/src/emit/crud/templates/CreateEndpoint_Main.ejs +18 -18
  7. package/src/emit/crud/templates/CreateLogicalLib.ejs +47 -47
  8. package/src/emit/crud/templates/CreateNodeCallback_Main.ejs +24 -24
  9. package/src/emit/crud/templates/DeleteAfterHookCallback_Main.ejs +5 -5
  10. package/src/emit/crud/templates/DeleteBeforeHookCallback_Main.ejs +3 -3
  11. package/src/emit/crud/templates/DeleteComplete_Main.ejs +23 -23
  12. package/src/emit/crud/templates/DeleteEndpoint_Main.ejs +15 -15
  13. package/src/emit/crud/templates/DeleteLogicalLib.ejs +19 -19
  14. package/src/emit/crud/templates/FlowEndpointRbacCallback_Main.ejs +3 -3
  15. package/src/emit/crud/templates/UpdateAfterHookCallback_Main.ejs +5 -5
  16. package/src/emit/crud/templates/UpdateBeforeHookCallback_Main.ejs +3 -3
  17. package/src/emit/crud/templates/UpdateComplete_Main.ejs +22 -22
  18. package/src/emit/crud/templates/UpdateEndpoint_Main.ejs +15 -15
  19. package/src/emit/crud/templates/UpdateLogicalLib.ejs +33 -33
  20. package/src/emit/custom/templates/FlowEndpointRbacCallback_Main.ejs +7 -7
  21. package/src/emit/custom/templates/s3/ConfirmReserved_HdrSqs.ejs +3 -3
  22. package/src/emit/custom/templates/s3/ConfirmReserved_Main.ejs +3 -3
  23. package/src/emit/custom/templates/s3/CreatePreSignUrl_HdrSqs.ejs +3 -3
  24. package/src/emit/custom/templates/s3/CreatePreSignUrl_Main.ejs +4 -4
  25. package/src/emit/rbac/emitDynamicRbacFlowSchemas.js +26 -6
  26. package/src/emit/rbac/emitRbacApplicationArtifacts.js +40 -13
  27. package/src/emit/rbac/templates/UserRbacFlow_Main.ejs +13 -7
  28. package/src/emit/relationship/emitDynamicRelationshipFlowSchemas.js +1 -1
  29. package/src/emit/relationship/templates/ChangeRelationshipComplete_HdrSqs.ejs +2 -2
  30. package/src/emit/relationship/templates/ChangeRelationshipComplete_Main.ejs +6 -6
  31. package/src/emit/relationship/templates/ChangeRelationship_Main.ejs +17 -17
  32. package/src/emit/relationship/templates/CreateRelationshipComplete_HdrSqs.ejs +2 -2
  33. package/src/emit/relationship/templates/CreateRelationshipComplete_Main.ejs +6 -6
  34. package/src/emit/relationship/templates/CreateRelationship_Main.ejs +14 -14
  35. package/src/emit/relationship/templates/DeleteRelationshipComplete_HdrSqs.ejs +2 -2
  36. package/src/emit/relationship/templates/DeleteRelationshipComplete_Main.ejs +6 -6
  37. package/src/emit/relationship/templates/DeleteRelationship_Main.ejs +10 -10
  38. package/src/emit/relationship/templates/GetRelationshipComplete_HdrSqs.ejs +2 -2
  39. package/src/emit/relationship/templates/GetRelationshipComplete_Main.ejs +5 -5
  40. package/src/emit/relationship/templates/GetRelationship_Main.ejs +9 -9
  41. package/src/emit/relationship/templates/MoveRelationshipComplete_HdrSqs.ejs +2 -2
  42. package/src/emit/relationship/templates/MoveRelationshipComplete_Main.ejs +6 -6
  43. package/src/emit/relationship/templates/MoveRelationship_Main.ejs +15 -15
  44. package/src/emit/relationship/templates/UpdateRelationshipComplete_HdrSqs.ejs +2 -2
  45. package/src/emit/relationship/templates/UpdateRelationshipComplete_Main.ejs +6 -6
  46. package/src/emit/relationship/templates/UpdateRelationship_Main.ejs +11 -11
  47. package/src/emit/resource/emitResourceArtifacts.js +3 -7
  48. package/src/emit/shared/templates/FindData_Main.ejs +19 -19
  49. package/src/emit/shared/templates/PaginateProcessLogical_Main.ejs +3 -3
  50. package/src/emit/shared/templates/ProcessLogical_Main.ejs +15 -15
  51. package/test/createTargetRoleHandler.test.js +62 -4
  52. package/test/crudApplicationArtifacts.test.js +3 -3
  53. package/test/dynamicCrudFlowSchemas.test.js +2 -2
  54. package/test/dynamicRbacFlowSchemas.test.js +32 -4
  55. package/test/relationshipApplicationArtifacts.test.js +1 -1
@@ -87,7 +87,7 @@ export default async function findData(
87
87
  }
88
88
  };
89
89
 
90
- let errorsFound = [];
90
+ let foundErrors = [];
91
91
 
92
92
  let standardErrorParams = [
93
93
  _izContext,
@@ -139,8 +139,8 @@ export default async function findData(
139
139
  _izContext.logger.debug('objInstanceBase: ', objInstanceBase)
140
140
 
141
141
  if (!objInstanceBase) {
142
- errorsFound.push(`can't get data in dynamo by ${identifiersBase}`)
143
- standardErrorParams.push(errorsFound)
142
+ foundErrors.push(`can't get data in dynamo by ${identifiersBase}`)
143
+ standardErrorParams.push(foundErrors)
144
144
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
145
145
  return {
146
146
  returnResponse: 'FindData cannot get data in dynamo'
@@ -148,8 +148,8 @@ export default async function findData(
148
148
  }
149
149
 
150
150
  if (!objInstanceBase.hasOwnProperty(fieldName.fieldName)) {
151
- errorsFound.push(`data in dynamoDB have no ${fieldName.fieldName}`)
152
- standardErrorParams.push(errorsFound)
151
+ foundErrors.push(`data in dynamoDB have no ${fieldName.fieldName}`)
152
+ standardErrorParams.push(foundErrors)
153
153
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
154
154
  return {
155
155
  returnResponse: 'Data have no fieldName'
@@ -195,8 +195,8 @@ export default async function findData(
195
195
  _izContext.logger.debug('objInstanceBase: ', objInstanceBase)
196
196
 
197
197
  if (!objInstanceBase) {
198
- errorsFound.push(`can't get data in dynamo by ${identifiersBase}`)
199
- standardErrorParams.push(errorsFound)
198
+ foundErrors.push(`can't get data in dynamo by ${identifiersBase}`)
199
+ standardErrorParams.push(foundErrors)
200
200
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
201
201
  return {
202
202
  returnResponse: 'FindData cannot get data in dynamo'
@@ -204,8 +204,8 @@ export default async function findData(
204
204
  }
205
205
 
206
206
  if (!objInstanceBase.hasOwnProperty(fieldName.fieldName)) {
207
- errorsFound.push(`data in dynamoDB have no ${fieldName.fieldName}`)
208
- standardErrorParams.push(errorsFound)
207
+ foundErrors.push(`data in dynamoDB have no ${fieldName.fieldName}`)
208
+ standardErrorParams.push(foundErrors)
209
209
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
210
210
  return {
211
211
  returnResponse: 'Data have no fieldName'
@@ -255,8 +255,8 @@ export default async function findData(
255
255
  _izContext.logger.debug('getDataByGraph: ', getDataByGraph)
256
256
 
257
257
  if (!getDataByGraph) {
258
- errorsFound.push(`can't get data of ${objType.objectType} in graph`)
259
- standardErrorParams.push(errorsFound)
258
+ foundErrors.push(`can't get data of ${objType.objectType} in graph`)
259
+ standardErrorParams.push(foundErrors)
260
260
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
261
261
  return {
262
262
  returnResponse: 'FindData cannot get data in graph'
@@ -271,8 +271,8 @@ export default async function findData(
271
271
 
272
272
  <% if (graphDetail.getInIdentifiers) { %>
273
273
  if (!objInstanceFull.identifiers.hasOwnProperty(fieldName.fieldName)) {
274
- errorsFound.push(`nodeProperties have no this ${fieldName.fieldName}`)
275
- standardErrorParams.push(errorsFound)
274
+ foundErrors.push(`nodeProperties have no this ${fieldName.fieldName}`)
275
+ standardErrorParams.push(foundErrors)
276
276
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
277
277
  return {
278
278
  returnResponse: 'Data have no fieldName'
@@ -283,8 +283,8 @@ export default async function findData(
283
283
  _izContext.logger.debug('this fieldName is identifier, get dataValue in identifiers: ', dataValue)
284
284
  <% } else { %>
285
285
  if (!objInstanceFull.fields.hasOwnProperty(fieldName.fieldName)) {
286
- errorsFound.push(`nodeProperties have no this ${fieldName.fieldName}`)
287
- standardErrorParams.push(errorsFound)
286
+ foundErrors.push(`nodeProperties have no this ${fieldName.fieldName}`)
287
+ standardErrorParams.push(foundErrors)
288
288
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
289
289
  return {
290
290
  returnResponse: 'Data have no fieldName'
@@ -314,8 +314,8 @@ export default async function findData(
314
314
  else
315
315
 
316
316
  <% } %> {
317
- errorsFound.push('unrecognized fieldName')
318
- standardErrorParams.push(errorsFound)
317
+ foundErrors.push('unrecognized fieldName')
318
+ standardErrorParams.push(foundErrors)
319
319
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
320
320
  return;
321
321
  }
@@ -326,8 +326,8 @@ export default async function findData(
326
326
  else
327
327
 
328
328
  <% } %> {
329
- errorsFound.push('unrecognized objectType')
330
- standardErrorParams.push(errorsFound)
329
+ foundErrors.push('unrecognized objectType')
330
+ standardErrorParams.push(foundErrors)
331
331
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
332
332
  return {
333
333
  returnResponse: 'Function FindData Error'
@@ -98,7 +98,7 @@ export default async function paginateProcessLogical(
98
98
  };
99
99
  }
100
100
 
101
- let errorsFound = [];
101
+ let foundErrors = [];
102
102
  let standardErrorParams = [
103
103
  _izContext,
104
104
  logicalResultId,
@@ -153,8 +153,8 @@ export default async function paginateProcessLogical(
153
153
 
154
154
  if (!startKey && queryDatas.Items.length == 0) {
155
155
  _izContext.logger.debug(`can't find data in table ${tableName}`);
156
- errorsFound.push(`can't find data in table ${tableName}`);
157
- standardErrorParams.push(errorsFound);
156
+ foundErrors.push(`can't find data in table ${tableName}`);
157
+ standardErrorParams.push(foundErrors);
158
158
  await logicalResultsSharedLib.completeLogicalResultsMain(
159
159
  ...standardErrorParams
160
160
  );
@@ -96,7 +96,7 @@ export default async function processLogical(
96
96
  };
97
97
  }
98
98
 
99
- let errorsFound = [];
99
+ let foundErrors = [];
100
100
 
101
101
  let standardErrorParams = [
102
102
  _izContext,
@@ -114,16 +114,16 @@ export default async function processLogical(
114
114
  element.comparison
115
115
  )
116
116
  ) {
117
- errorsFound.push('comparison is not possible comparison');
117
+ foundErrors.push('comparison is not possible comparison');
118
118
  }
119
119
 
120
120
  // validate partitionKeyValues
121
121
  if (!element.hasOwnProperty('partitionKeyValues')) {
122
122
  _izContext.logger.debug('element not have partitionKeyValues');
123
- errorsFound.push('element not have partitionKeyValues');
123
+ foundErrors.push('element not have partitionKeyValues');
124
124
  } else if (Object.keys(element.partitionKeyValues).length === 0) {
125
125
  _izContext.logger.debug('partitionKeyValues is empty');
126
- errorsFound.push('partitionKeyValues is empty');
126
+ foundErrors.push('partitionKeyValues is empty');
127
127
  }
128
128
 
129
129
  const objectSchemas = await getObjectSchema.getObjSchemaS3WithHierarchy(
@@ -186,7 +186,7 @@ export default async function processLogical(
186
186
  if (element.hasOwnProperty('sortKeyValues')) {
187
187
  continue;
188
188
  } else {
189
- errorsFound.push(
189
+ foundErrors.push(
190
190
  'schema error: dynamo storageResource set to groupByPartitionKeyField but no sortKey'
191
191
  );
192
192
  break;
@@ -219,7 +219,7 @@ export default async function processLogical(
219
219
  }
220
220
 
221
221
  if (!tableName) {
222
- errorsFound.push('no valid dynamo storageResource found');
222
+ foundErrors.push('no valid dynamo storageResource found');
223
223
  }
224
224
 
225
225
  if (
@@ -230,19 +230,19 @@ export default async function processLogical(
230
230
  _izContext.logger.debug(
231
231
  'element have sortKeyValues but cannot find sortKey in object schemas'
232
232
  );
233
- errorsFound.push(
233
+ foundErrors.push(
234
234
  'element have sortKeyValues but cannot find sortKey in object schemas'
235
235
  );
236
236
  }
237
237
 
238
- if (errorsFound.length > 0) {
239
- _izContext.logger.debug('Have errorsFound: ', errorsFound);
240
- standardErrorParams.push(errorsFound);
238
+ if (foundErrors.length > 0) {
239
+ _izContext.logger.debug('Have foundErrors: ', foundErrors);
240
+ standardErrorParams.push(foundErrors);
241
241
  await logicalResultsSharedLib.completeLogicalResultsMain(
242
242
  ...standardErrorParams
243
243
  );
244
244
  return {
245
- returnResponse: 'Have errorsFound'
245
+ returnResponse: 'Have foundErrors'
246
246
  };
247
247
  }
248
248
 
@@ -332,8 +332,8 @@ export default async function processLogical(
332
332
 
333
333
  if (queryDatas.Items.length == 0) {
334
334
  _izContext.logger.debug(`can't find data in ${tableName}`);
335
- errorsFound.push(`can't find data in ${tableName}`);
336
- standardErrorParams.push(errorsFound);
335
+ foundErrors.push(`can't find data in ${tableName}`);
336
+ standardErrorParams.push(foundErrors);
337
337
  await logicalResultsSharedLib.completeLogicalResultsMain(
338
338
  ...standardErrorParams
339
339
  );
@@ -411,8 +411,8 @@ export default async function processLogical(
411
411
  );
412
412
  } else {
413
413
  _izContext.logger.debug(`can't find data in ${tableName}`);
414
- errorsFound.push(`can't find data in ${tableName}`);
415
- standardErrorParams.push(errorsFound);
414
+ foundErrors.push(`can't find data in ${tableName}`);
415
+ standardErrorParams.push(foundErrors);
416
416
  await logicalResultsSharedLib.completeLogicalResultsMain(
417
417
  ...standardErrorParams
418
418
  );
@@ -36,7 +36,7 @@ test('generates RBAC own-topic WebSocket entries alongside their SQS handlers',
36
36
  const rootPath = await createProject(true);
37
37
  const result = await generateCreateTargetRoleHandler(rootPath);
38
38
 
39
- assert.equal(result.files.length, 59);
39
+ assert.equal(result.files.length, 60);
40
40
  assert.match(
41
41
  await readFile(join(rootPath, result.files[0].path), 'utf8'),
42
42
  /CreateTargetRole/
@@ -118,7 +118,55 @@ test('generates RBAC own-topic WebSocket entries alongside their SQS handlers',
118
118
  assert.match(validatorRbac, /return l2Hit;/);
119
119
  assert.match(validatorRbac, /return cacheResult;/);
120
120
  assert.doesNotMatch(validatorRbac, /L1 Cache hit:[^;]+;\s*return;/);
121
- assert.doesNotMatch(validatorRbac, /L2 Cache hit:[^;]+;\s*return;/);
121
+ const validatorHdrInv = await readFile(
122
+ join(
123
+ rootPath,
124
+ 'app/src/generatedCode/FlowRbac/ValidatorRbac/source/ValidatorRbac_HdrInv.js'
125
+ ),
126
+ 'utf8'
127
+ );
128
+ assert.match(
129
+ validatorHdrInv,
130
+ /import ValidatorRbac from '\.\/ValidatorRbac_Main\.js';/
131
+ );
132
+ assert.match(
133
+ validatorHdrInv,
134
+ /middleware\.setValidatorSchema\(validatorSchema\);/
135
+ );
136
+ assert.match(
137
+ validatorHdrInv,
138
+ /await ValidatorRbac\(event\._izContext, \.\.\.passOnProperties\);/
139
+ );
140
+
141
+ const validatorHdrApi = await readFile(
142
+ join(
143
+ rootPath,
144
+ 'app/src/generatedCode/FlowRbac/ValidatorRbac/source/ValidatorRbac_HdrApi.js'
145
+ ),
146
+ 'utf8'
147
+ );
148
+ assert.match(
149
+ validatorHdrApi,
150
+ /import ValidatorRbac from '\.\/ValidatorRbac_Main\.js';/
151
+ );
152
+ assert.match(
153
+ validatorHdrApi,
154
+ /middleware\.setValidatorSchema\(validatorSchema, { noAuthorizer: true }\);/
155
+ );
156
+ assert.match(
157
+ validatorHdrApi,
158
+ /await ValidatorRbac\(\s*event\._izContext,\s*\.\.\.passOnProperties\s*\);/
159
+ );
160
+
161
+ await assert.rejects(
162
+ readFile(
163
+ join(
164
+ rootPath,
165
+ 'app/src/generatedCode/FlowRbac/ValidatorRbac/source/ValidatorRbac_HdrSqs.js'
166
+ )
167
+ )
168
+ );
169
+
122
170
  assert.match(
123
171
  await readFile(
124
172
  join(
@@ -133,6 +181,16 @@ test('generates RBAC own-topic WebSocket entries alongside their SQS handlers',
133
181
  join(rootPath, 'app/sls_yaml/generatedCode/source/flow-rbac.yml'),
134
182
  'utf8'
135
183
  );
184
+ assert.match(
185
+ rbacYaml,
186
+ /ValidatorRbacHdrInv:\n\s+handler: src\/generatedCode\/FlowRbac\/ValidatorRbac\/source\/ValidatorRbac_HdrInv\.main/
187
+ );
188
+ assert.match(
189
+ rbacYaml,
190
+ /ValidatorRbacHdrApi:\n\s+handler: src\/generatedCode\/FlowRbac\/ValidatorRbac\/source\/ValidatorRbac_HdrApi\.main/
191
+ );
192
+ assert.doesNotMatch(rbacYaml, /ValidatorRbacHdrSqs:/);
193
+
136
194
  const limitYaml = await readFile(
137
195
  join(rootPath, 'app/sls_yaml/generatedCode/source/flow-limits.yml'),
138
196
  'utf8'
@@ -161,7 +219,7 @@ test('removes CreateTargetRole handler when RBAC is removed', async () => {
161
219
  await generateCreateTargetRoleHandler(rootPath);
162
220
  await writeFile(
163
221
  objectPath,
164
- "export default { objectType: 'user', addOnDataStructure: [] };\n"
222
+ "export default { objectType: 'user', generatedBy: 'user', fieldNames: { userId: { type: 'string', canUpdate: false, storageResourceTags: ['main'] } }, identifiers: [{ type: 'partitionKey', fieldName: 'userId' }], storageResources: { main: { storageType: 'dynamoDB', tableName: 'Users' } }, addOnDataStructure: [] };\n"
165
223
  );
166
224
 
167
225
  assert.deepEqual((await generateCreateTargetRoleHandler(rootPath)).files, []);
@@ -196,7 +254,7 @@ async function createProject(hasRbac) {
196
254
  await mkdir(directory, { recursive: true });
197
255
  await writeFile(
198
256
  join(directory, 'User.js'),
199
- `export default { objectType: 'user', fieldNames: [], identifiers: [], addOnDataStructure: ${addOns} };\n`
257
+ `export default { objectType: 'user', generatedBy: 'user', fieldNames: { userId: { type: 'string', canUpdate: false, storageResourceTags: ['main'] } }, identifiers: [{ type: 'partitionKey', fieldName: 'userId' }], storageResources: { main: { storageType: 'dynamoDB', tableName: 'Users' } }, addOnDataStructure: ${addOns} };\n`
200
258
  );
201
259
  return rootPath;
202
260
  }
@@ -44,7 +44,7 @@ test('emits CRUD handlers and function YAML from schema data without reading gen
44
44
  assert.match(createMain, /CreateLogicalLib/);
45
45
  assert.match(
46
46
  createMain,
47
- /validateFieldNames\(_izContext, requestParams, objectSchemas, errorsFound\)/
47
+ /validateFieldNames\(_izContext, requestParams, objectSchemas, foundErrors\)/
48
48
  );
49
49
  assert.doesNotMatch(
50
50
  createMain,
@@ -59,12 +59,12 @@ test('emits CRUD handlers and function YAML from schema data without reading gen
59
59
  );
60
60
  assert.match(
61
61
  createLogicalLib,
62
- /export async function resolveAndGenerateIdentifiers\(\s*_izContext,\s*requestParams,\s*objectSchema,\s*errorsFound\s*\)/
62
+ /export async function resolveAndGenerateIdentifiers\(\s*_izContext,\s*requestParams,\s*objectSchema,\s*foundErrors\s*\)/
63
63
  );
64
64
  assert.match(createLogicalLib, /return \{\s*objectSchemas\s*\};/);
65
65
  assert.match(
66
66
  createLogicalLib,
67
- /export function validateFieldNames\(\s*_izContext,\s*requestParams,\s*objectSchemas,\s*errorsFound\s*\)/
67
+ /export function validateFieldNames\(\s*_izContext,\s*requestParams,\s*objectSchemas,\s*foundErrors\s*\)/
68
68
  );
69
69
  assert.doesNotMatch(
70
70
  createLogicalLib,
@@ -197,7 +197,7 @@ test('uses CreateNodeCallback step when Graph storage is present with sync RBAC'
197
197
  'returnValue',
198
198
  'parentFlowId',
199
199
  'status',
200
- 'errorsFound',
200
+ 'foundErrors',
201
201
  'graphServiceTag'
202
202
  ]);
203
203
  });
@@ -237,7 +237,7 @@ test('chains Start and Complete for Update with RBAC and Graph', async () => {
237
237
  'returnValue',
238
238
  'parentFlowId',
239
239
  'status',
240
- 'errorsFound',
240
+ 'foundErrors',
241
241
  'graphServiceTag'
242
242
  ]);
243
243
  });
@@ -67,8 +67,36 @@ test('generates shared and object-specific RBAC flow schemas', async () => {
67
67
  properties: ['returnResult'],
68
68
  messageAttributes: []
69
69
  });
70
- assert.deepEqual(user.event, ['ownTopic']);
71
- assert.equal(user.steps, undefined);
70
+ assert.deepEqual(user.event, ['lambdaSyncInv', 'lambdaSyncApi']);
71
+ assert.equal(user.initiateBy, 'systemWithUser');
72
+ assert.deepEqual(user.stepProperties, {
73
+ parentFlowId: {
74
+ propertyName: 'parentFlowId',
75
+ type: 'string'
76
+ },
77
+ flowTypeConcat: {
78
+ propertyName: 'flowTypeConcat',
79
+ type: 'string'
80
+ },
81
+ parameterGroups: {
82
+ propertyName: 'parameterGroups',
83
+ type: 'object'
84
+ }
85
+ });
86
+ assert.deepEqual(user.stepMessageAttributes, {
87
+ submittedByUserId: {
88
+ propertyName: 'x-correlation-submitted-by-user-id',
89
+ type: 'string'
90
+ }
91
+ });
92
+ assert.deepEqual(user.flowSteps[0].properties, [
93
+ { key: 'parentFlowId', required: false },
94
+ { key: 'flowTypeConcat', required: true },
95
+ { key: 'parameterGroups', default: {} }
96
+ ]);
97
+ assert.deepEqual(user.flowSteps[0].messageAttributes, [
98
+ { key: 'submittedByUserId', required: false }
99
+ ]);
72
100
 
73
101
  const confirmUsage = await readGeneratedFlow(
74
102
  rootPath,
@@ -98,7 +126,7 @@ test('removes RBAC schemas when the last RBAC object is removed', async () => {
98
126
  await generateDynamicRbacFlowSchemas(rootPath, { serviceTag: 'UserAccount' });
99
127
  await writeFile(
100
128
  objectPath,
101
- "export default { objectType: 'user', addOnDataStructure: [] };\n"
129
+ "export default { objectType: 'user', generatedBy: 'user', fieldNames: { userId: { type: 'string', canUpdate: false, storageResourceTags: ['main'] } }, identifiers: [{ type: 'partitionKey', fieldName: 'userId' }], storageResources: { main: { storageType: 'dynamoDB', tableName: 'Users' } }, addOnDataStructure: [] };\n"
102
130
  );
103
131
 
104
132
  const result = await generateDynamicRbacFlowSchemas(rootPath);
@@ -160,7 +188,7 @@ async function createProject({ hasRbac = false } = {}) {
160
188
  await mkdir(objectDirectory, { recursive: true });
161
189
  await writeFile(
162
190
  join(objectDirectory, 'User.js'),
163
- `export default { objectType: 'user', fieldNames: [], identifiers: [], addOnDataStructure: ${hasRbac ? "[{ type: 'rbac' }]" : '[]'} };\n`
191
+ `export default { objectType: 'user', generatedBy: 'user', fieldNames: { userId: { type: 'string', canUpdate: false, storageResourceTags: ['main'] } }, identifiers: [{ type: 'partitionKey', fieldName: 'userId' }], storageResources: { main: { storageType: 'dynamoDB', tableName: 'Users' } }, addOnDataStructure: ${hasRbac ? "[{ type: 'rbac' }]" : '[]'} };\n`
164
192
  );
165
193
  return rootPath;
166
194
  }
@@ -115,7 +115,7 @@ test('emits relationship action and complete handlers with data-first function Y
115
115
  );
116
116
  assert.match(
117
117
  createCompleteContent,
118
- /const {\s*returnValue,\s*parentFlowId,\s*status,\s*errorsFound,\s*graphServiceTag\s*} = requestParams;/
118
+ /const {\s*returnValue,\s*parentFlowId,\s*status,\s*foundErrors,\s*graphServiceTag\s*} = requestParams;/
119
119
  );
120
120
  assert.doesNotMatch(
121
121
  createCompleteContent,