@izara_project/izara-core-generate-service-code 1.0.96 → 1.0.98

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 (219) hide show
  1. package/index.js +2 -2
  2. package/package.json +2 -1
  3. package/src/compile/loadSchemas.js +44 -322
  4. package/src/compile/loadSchemasRemote.js +195 -0
  5. package/src/compile/schemaValidatorSetup.js +143 -0
  6. package/src/emit/{crud → application/crud}/emitCrudApplicationArtifacts.js +2 -2
  7. package/src/emit/{crud → application/crud}/generateCrudApplicationArtifacts.js +2 -2
  8. package/src/emit/{crud → application/crud}/generateDynamicCrudFlowSchemas.js +2 -2
  9. package/src/emit/{crud → application/crud}/templates/FlowEndpoint_HdrWbs.ejs +2 -2
  10. package/src/emit/{crud → application/crud}/templates/FlowMain_Wbs.ejs +2 -2
  11. package/src/emit/{custom → application/custom}/customFlowS3.js +1 -1
  12. package/src/emit/{custom → application/custom}/customFlowSteps.js +1 -1
  13. package/src/emit/{custom → application/custom}/customFlowTemplates.js +1 -1
  14. package/src/emit/{custom → application/custom}/emitCustomFlowApplicationArtifacts.js +1 -1
  15. package/src/emit/{custom → application/custom}/generateCustomFlowApplicationArtifacts.js +2 -2
  16. package/src/emit/{custom → application/custom}/templates/s3/CreateObject_Main.ejs +5 -2
  17. package/src/emit/{custom → application/custom}/templates/triggerCache/CheckTriggerCache_Main.ejs +2 -2
  18. package/src/emit/{rbac → application/rbac}/emitRbacApplicationArtifacts.js +2 -2
  19. package/src/emit/{rbac → application/rbac}/generateCreateTargetRoleHandler.js +2 -2
  20. package/src/emit/{rbac → application/rbac}/generateDynamicRbacFlowSchemas.js +2 -2
  21. package/src/emit/{relationship → application/relationship}/emitRelationshipApplicationArtifacts.js +3 -3
  22. package/src/emit/{relationship → application/relationship}/generateDynamicRelationshipFlowSchemas.js +2 -2
  23. package/src/emit/{relationship → application/relationship}/generateRelationshipApplicationArtifacts.js +2 -2
  24. package/src/emit/{relationship → application/relationship}/templates/ChangeRelationship_Main.ejs +3 -2
  25. package/src/emit/{relationship → application/relationship}/templates/CreateRelationship_Main.ejs +3 -2
  26. package/src/emit/{relationship → application/relationship}/templates/DeleteRelationship_Main.ejs +3 -2
  27. package/src/emit/{relationship → application/relationship}/templates/GetRelationship_Main.ejs +3 -2
  28. package/src/emit/{relationship → application/relationship}/templates/MoveRelationship_Main.ejs +3 -2
  29. package/src/emit/{relationship → application/relationship}/templates/UpdateRelationship_Main.ejs +3 -2
  30. package/src/emit/{system → application/system}/emitSystemFindDataArtifacts.js +1 -1
  31. package/src/emit/{system → application/system}/templates/RegisterComplete_Main.ejs +6 -2
  32. package/src/emit/{system → application/system}/templates/Register_Main.ejs +6 -2
  33. package/src/emit/{system → application/system}/templates/WebSocketComplete_Main.ejs +3 -3
  34. package/src/emit/{resource → infrastructure/resources}/generateResourceArtifacts.js +2 -2
  35. package/src/emit/{resource → infrastructure/resources}/iamResourceArtifacts.js +3 -3
  36. package/src/emit/{resource → infrastructure/resources}/resourceState.js +4 -4
  37. package/src/emit/{attributeTree → schemas/attributeTree}/emitAttributeTreeSchemas.js +14 -22
  38. package/src/emit/schemas/attributeTree/emitAttributeTreeTargetValueStandard.js +132 -0
  39. package/src/emit/schemas/ledger/emitLedgerSchemas.js +392 -0
  40. package/src/emit/schemas/ledger/templates/LedgerObjectSchema.ejs +3 -0
  41. package/src/emit/schemas/ledger/templates/LedgerRelationshipSchema.ejs +1 -0
  42. package/src/emit/schemas/propertyValue/emitPropertyValueSchemas.js +329 -0
  43. package/src/emit/{systemText → schemas/systemText}/emitSystemTextSchemas.js +1 -1
  44. package/src/generate.js +34 -308
  45. package/src/{generateIntTest.js → intTest/generateIntTest.js} +2 -2
  46. package/src/{generateResourceIntTest.js → intTest/generateResourceIntTest.js} +2 -2
  47. package/src/output/mergeHooks.js +69 -15
  48. package/src/plan/domainRegistry.js +307 -0
  49. package/task.md +132 -0
  50. package/test/helpers/testProject.js +127 -0
  51. package/test/helpers/testProject.test.js +57 -0
  52. package/test/{core.test.js → integration/core.test.js} +3 -3
  53. package/test/{graphDrivenFlowSchema.test.js → integration/graphDrivenFlowSchema.test.js} +1 -1
  54. package/test/{intTestApi.test.js → integration/intTestApi.test.js} +1 -1
  55. package/test/{publicApi.test.js → integration/publicApi.test.js} +55 -2
  56. package/test/{createTargetRoleHandler.test.js → unit/application/createTargetRoleHandler.test.js} +1 -1
  57. package/test/{crudApplicationArtifacts.test.js → unit/application/crudApplicationArtifacts.test.js} +1 -1
  58. package/test/{customFlowApplicationArtifacts.test.js → unit/application/customFlowApplicationArtifacts.test.js} +18 -9
  59. package/test/{relationshipApplicationArtifacts.test.js → unit/application/relationshipApplicationArtifacts.test.js} +31 -1
  60. package/test/{systemFindDataArtifacts.test.js → unit/application/systemFindDataArtifacts.test.js} +1 -1
  61. package/test/{functionYamlArtifact.test.js → unit/infrastructure/functionYamlArtifact.test.js} +1 -1
  62. package/test/{resourceArtifacts.test.js → unit/infrastructure/resourceArtifacts.test.js} +2 -1
  63. package/test/unit/output/mergeHooks.test.js +268 -0
  64. package/test/unit/schemas/attributeTreeDirectives.test.js +177 -0
  65. package/test/{attributeTreeSchemas.test.js → unit/schemas/attributeTreeSchemas.test.js} +46 -102
  66. package/test/{dynamicCrudFlowSchemas.test.js → unit/schemas/dynamicCrudFlowSchemas.test.js} +2 -2
  67. package/test/{dynamicRbacFlowSchemas.test.js → unit/schemas/dynamicRbacFlowSchemas.test.js} +1 -1
  68. package/test/{dynamicRelationshipFlowSchemas.test.js → unit/schemas/dynamicRelationshipFlowSchemas.test.js} +11 -1
  69. package/test/{errorSchemas.test.js → unit/schemas/errorSchemas.test.js} +2 -2
  70. package/test/unit/schemas/ledgerSchemas.test.js +289 -0
  71. package/test/unit/schemas/propertyValueSchemas.test.js +265 -0
  72. package/test/{systemTextSchemas.test.js → unit/schemas/systemTextSchemas.test.js} +24 -36
  73. package/src/emit/attributeTree/emitAttributeTreeTargetSchemas.js +0 -153
  74. package/src/emit/attributeTree/resolveTargetServicePath.js +0 -111
  75. package/src/emit/crud/loadLocalSchemaArrays.js +0 -4
  76. /package/src/emit/{coreFunction → application/coreFunction}/emitCoreFunctionArtifacts.js +0 -0
  77. /package/src/emit/{coreFunction → application/coreFunction}/templates/CoreFunction_Yaml.ejs +0 -0
  78. /package/src/emit/{coreFunction → application/coreFunction}/templates/CoreResource_Yaml.ejs +0 -0
  79. /package/src/emit/{coreFunction → application/coreFunction}/templates/GenerateSeedDataDynamo_HdrInv.ejs +0 -0
  80. /package/src/emit/{coreFunction → application/coreFunction}/templates/GenerateSeedDataDynamo_Main.ejs +0 -0
  81. /package/src/emit/{coreFunction → application/coreFunction}/templates/GenerateSeedDataGraphData_HdrInv.ejs +0 -0
  82. /package/src/emit/{coreFunction → application/coreFunction}/templates/GenerateSeedDataGraphData_Main.ejs +0 -0
  83. /package/src/emit/{coreFunction → application/coreFunction}/templates/GenerateSeedDataGraphSchema_HdrInv.ejs +0 -0
  84. /package/src/emit/{coreFunction → application/coreFunction}/templates/GenerateSeedDataGraphSchema_Main.ejs +0 -0
  85. /package/src/emit/{coreFunction → application/coreFunction}/templates/GeneratedGraphNodeSchemas.ejs +0 -0
  86. /package/src/emit/{coreFunction → application/coreFunction}/templates/GeneratedGraphRelSchemas.ejs +0 -0
  87. /package/src/emit/{coreFunction → application/coreFunction}/templates/GeneratedTableConfigs.ejs +0 -0
  88. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupConfig.ejs +0 -0
  89. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupRunner.ejs +0 -0
  90. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupRunner_initialSetup.ejs +0 -0
  91. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupRunner_seedDynamo.ejs +0 -0
  92. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupRunner_seedGraph.ejs +0 -0
  93. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupRunner_seedRemove.ejs +0 -0
  94. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetupRunner_uploadSchema.ejs +0 -0
  95. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetup_HdrInv.ejs +0 -0
  96. /package/src/emit/{coreFunction → application/coreFunction}/templates/InitialSetup_Main.ejs +0 -0
  97. /package/src/emit/{coreFunction → application/coreFunction}/templates/RemoveSeedDataDynamo_HdrInv.ejs +0 -0
  98. /package/src/emit/{coreFunction → application/coreFunction}/templates/RemoveSeedDataDynamo_Main.ejs +0 -0
  99. /package/src/emit/{coreFunction → application/coreFunction}/templates/UploadSchema_HdrInv.ejs +0 -0
  100. /package/src/emit/{coreFunction → application/coreFunction}/templates/UploadSchema_Main.ejs +0 -0
  101. /package/src/emit/{crud → application/crud}/crudActionPlan.js +0 -0
  102. /package/src/emit/{crud → application/crud}/dynamicCrudFlowSchemaTemplate.js +0 -0
  103. /package/src/emit/{crud → application/crud}/emitDynamicCrudFlowSchemas.js +0 -0
  104. /package/src/emit/{crud → application/crud}/templates/CreateAfterHookCallback_Main.ejs +0 -0
  105. /package/src/emit/{crud → application/crud}/templates/CreateBeforeHookCallback_Main.ejs +0 -0
  106. /package/src/emit/{crud → application/crud}/templates/CreateComplete_Main.ejs +0 -0
  107. /package/src/emit/{crud → application/crud}/templates/CreateConfirmComplete_Main.ejs +0 -0
  108. /package/src/emit/{crud → application/crud}/templates/CreateEndpoint_Main.ejs +0 -0
  109. /package/src/emit/{crud → application/crud}/templates/CreateLogicalLib.ejs +0 -0
  110. /package/src/emit/{crud → application/crud}/templates/CreateNodeCallback_Main.ejs +0 -0
  111. /package/src/emit/{crud → application/crud}/templates/DeleteAfterHookCallback_Main.ejs +0 -0
  112. /package/src/emit/{crud → application/crud}/templates/DeleteBeforeHookCallback_Main.ejs +0 -0
  113. /package/src/emit/{crud → application/crud}/templates/DeleteComplete_Main.ejs +0 -0
  114. /package/src/emit/{crud → application/crud}/templates/DeleteEndpoint_Main.ejs +0 -0
  115. /package/src/emit/{crud → application/crud}/templates/DeleteLogicalLib.ejs +0 -0
  116. /package/src/emit/{crud → application/crud}/templates/FlowEndpointRbacCallback_Main.ejs +0 -0
  117. /package/src/emit/{crud → application/crud}/templates/GetEndpoint_Main.ejs +0 -0
  118. /package/src/emit/{crud → application/crud}/templates/GetRangeEndpoint_Main.ejs +0 -0
  119. /package/src/emit/{crud → application/crud}/templates/UpdateAfterHookCallback_Main.ejs +0 -0
  120. /package/src/emit/{crud → application/crud}/templates/UpdateBeforeHookCallback_Main.ejs +0 -0
  121. /package/src/emit/{crud → application/crud}/templates/UpdateComplete_Main.ejs +0 -0
  122. /package/src/emit/{crud → application/crud}/templates/UpdateEndpoint_Main.ejs +0 -0
  123. /package/src/emit/{crud → application/crud}/templates/UpdateLogicalLib.ejs +0 -0
  124. /package/src/emit/{custom → application/custom}/customFlowPaths.js +0 -0
  125. /package/src/emit/{custom → application/custom}/customFlows.js +0 -0
  126. /package/src/emit/{custom → application/custom}/templates/FlowEndpointRbacCallback_Main.ejs +0 -0
  127. /package/src/emit/{custom → application/custom}/templates/FlowEndpoint_Main.ejs +0 -0
  128. /package/src/emit/{custom → application/custom}/templates/FlowStep_Main.ejs +0 -0
  129. /package/src/emit/{custom → application/custom}/templates/s3/ConfirmReserved_HdrSqs.ejs +0 -0
  130. /package/src/emit/{custom → application/custom}/templates/s3/ConfirmReserved_Main.ejs +0 -0
  131. /package/src/emit/{custom → application/custom}/templates/s3/CreateObject_HdrWbs.ejs +0 -0
  132. /package/src/emit/{custom → application/custom}/templates/s3/CreatePreSignUrl_HdrSqs.ejs +0 -0
  133. /package/src/emit/{custom → application/custom}/templates/s3/CreatePreSignUrl_Main.ejs +0 -0
  134. /package/src/emit/{custom → application/custom}/templates/s3/FlowHandler_HdrS3.ejs +0 -0
  135. /package/src/emit/{custom → application/custom}/templates/s3/ProcessS3File_Main.ejs +0 -0
  136. /package/src/emit/{custom → application/custom}/templates/s3/ReservedLimit_HdrSqs.ejs +0 -0
  137. /package/src/emit/{custom → application/custom}/templates/s3/ReservedLimit_Main.ejs +0 -0
  138. /package/src/emit/{custom → application/custom}/templates/triggerCache/CheckTriggerCache_HdrSqs.ejs +0 -0
  139. /package/src/emit/{custom → application/custom}/templates/triggerCache/TriggerCacheComplete_Main.ejs +0 -0
  140. /package/src/emit/{custom → application/custom}/templates/triggerCache/TriggerCache_Main.ejs +0 -0
  141. /package/src/emit/{rbac → application/rbac}/emitDynamicRbacFlowSchemas.js +0 -0
  142. /package/src/emit/{rbac → application/rbac}/rbacFlowTag.js +0 -0
  143. /package/src/emit/{rbac → application/rbac}/templates/CancelUsage_Main.ejs +0 -0
  144. /package/src/emit/{rbac → application/rbac}/templates/ConfirmUsage_Main.ejs +0 -0
  145. /package/src/emit/{rbac → application/rbac}/templates/CreateTargetRole_HdrSqs.ejs +0 -0
  146. /package/src/emit/{rbac → application/rbac}/templates/CreateTargetRole_Main.ejs +0 -0
  147. /package/src/emit/{rbac → application/rbac}/templates/DeleteTargetRole_Main.ejs +0 -0
  148. /package/src/emit/{rbac → application/rbac}/templates/DynamicRbacFlowSchema.ejs +0 -0
  149. /package/src/emit/{rbac → application/rbac}/templates/GetMyPermissions_Main.ejs +0 -0
  150. /package/src/emit/{rbac → application/rbac}/templates/GetTargetRole_Main.ejs +0 -0
  151. /package/src/emit/{rbac → application/rbac}/templates/ListRbac_HdrApi.ejs +0 -0
  152. /package/src/emit/{rbac → application/rbac}/templates/ListRbac_HdrSqs.ejs +0 -0
  153. /package/src/emit/{rbac → application/rbac}/templates/ListRbac_Main.ejs +0 -0
  154. /package/src/emit/{rbac → application/rbac}/templates/RbacMutation_Main.ejs +0 -0
  155. /package/src/emit/{rbac → application/rbac}/templates/ReservedDynamicUsage_Main.ejs +0 -0
  156. /package/src/emit/{rbac → application/rbac}/templates/UpdateTargetRole_Main.ejs +0 -0
  157. /package/src/emit/{rbac → application/rbac}/templates/UserRbacFlow_HdrSqs.ejs +0 -0
  158. /package/src/emit/{rbac → application/rbac}/templates/UserRbacFlow_Main.ejs +0 -0
  159. /package/src/emit/{rbac → application/rbac}/templates/UserRoleMutation_Main.ejs +0 -0
  160. /package/src/emit/{relationship → application/relationship}/emitDynamicRelationshipFlowSchemas.js +0 -0
  161. /package/src/emit/{relationship → application/relationship}/templates/ChangeRelationshipComplete_HdrSqs.ejs +0 -0
  162. /package/src/emit/{relationship → application/relationship}/templates/ChangeRelationshipComplete_Main.ejs +0 -0
  163. /package/src/emit/{relationship → application/relationship}/templates/CreateRelationshipComplete_HdrSqs.ejs +0 -0
  164. /package/src/emit/{relationship → application/relationship}/templates/CreateRelationshipComplete_Main.ejs +0 -0
  165. /package/src/emit/{relationship → application/relationship}/templates/DeleteRelationshipComplete_HdrSqs.ejs +0 -0
  166. /package/src/emit/{relationship → application/relationship}/templates/DeleteRelationshipComplete_Main.ejs +0 -0
  167. /package/src/emit/{relationship → application/relationship}/templates/GetRelationshipComplete_HdrSqs.ejs +0 -0
  168. /package/src/emit/{relationship → application/relationship}/templates/GetRelationshipComplete_Main.ejs +0 -0
  169. /package/src/emit/{relationship → application/relationship}/templates/MoveRelationshipComplete_HdrSqs.ejs +0 -0
  170. /package/src/emit/{relationship → application/relationship}/templates/MoveRelationshipComplete_Main.ejs +0 -0
  171. /package/src/emit/{relationship → application/relationship}/templates/UpdateRelationshipComplete_HdrSqs.ejs +0 -0
  172. /package/src/emit/{relationship → application/relationship}/templates/UpdateRelationshipComplete_Main.ejs +0 -0
  173. /package/src/emit/{system → application/system}/emitSystemWebSocketArtifacts.js +0 -0
  174. /package/src/emit/{system → application/system}/templates/RegisterComplete_HdrSqs.ejs +0 -0
  175. /package/src/emit/{system → application/system}/templates/RegisterComplete_Yaml.ejs +0 -0
  176. /package/src/emit/{system → application/system}/templates/RegisterWbs_Yaml.ejs +0 -0
  177. /package/src/emit/{system → application/system}/templates/Register_HdrWbs.ejs +0 -0
  178. /package/src/emit/{system → application/system}/templates/WebSocketComplete_HdrSqs.ejs +0 -0
  179. /package/src/emit/{system → application/system}/templates/WebSocketComplete_Yaml.ejs +0 -0
  180. /package/src/emit/{system → application/system}/templates/WebSocketConnect.ejs +0 -0
  181. /package/src/emit/{system → application/system}/templates/WebSocketConnect_Yaml.ejs +0 -0
  182. /package/src/emit/{function → infrastructure/functions}/functionYamlArtifact.js +0 -0
  183. /package/src/emit/{function → infrastructure/functions}/templates/ApiFunction_Yaml.ejs +0 -0
  184. /package/src/emit/{function → infrastructure/functions}/templates/EventBridgeFunction_Yaml.ejs +0 -0
  185. /package/src/emit/{function → infrastructure/functions}/templates/InvFunction_Yaml.ejs +0 -0
  186. /package/src/emit/{function → infrastructure/functions}/templates/S3Function_Yaml.ejs +0 -0
  187. /package/src/emit/{function → infrastructure/functions}/templates/SqsFunction_Yaml.ejs +0 -0
  188. /package/src/emit/{function → infrastructure/functions}/templates/WbsFunction_Yaml.ejs +0 -0
  189. /package/src/emit/{resource → infrastructure/resources}/dynamoResourceArtifacts.js +0 -0
  190. /package/src/emit/{resource → infrastructure/resources}/emitResourceArtifacts.js +0 -0
  191. /package/src/emit/{resource → infrastructure/resources}/resourceTemplate.js +0 -0
  192. /package/src/emit/{resource → infrastructure/resources}/s3ResourceArtifacts.js +0 -0
  193. /package/src/emit/{resource → infrastructure/resources}/sqsResourceArtifacts.js +0 -0
  194. /package/src/emit/{resource → infrastructure/resources}/templates/DynamoDBTable_Yaml.ejs +0 -0
  195. /package/src/emit/{resource → infrastructure/resources}/templates/FlowOut_Yaml.ejs +0 -0
  196. /package/src/emit/{resource → infrastructure/resources}/templates/GeneratedLambdaRoleServiceConfig.ejs +0 -0
  197. /package/src/emit/{resource → infrastructure/resources}/templates/ResourceSqsYaml.ejs +0 -0
  198. /package/src/emit/{resource → infrastructure/resources}/templates/ResourceYaml.ejs +0 -0
  199. /package/src/emit/{resource → infrastructure/resources}/templates/S3Bucket_Yaml.ejs +0 -0
  200. /package/src/emit/{resource → infrastructure/resources}/templates/S3Subscription_Yaml.ejs +0 -0
  201. /package/src/emit/{resource → infrastructure/resources}/templates/SharedResource_Yaml.ejs +0 -0
  202. /package/src/emit/{resource → infrastructure/resources}/templates/SystemDynamoDB_Yaml.ejs +0 -0
  203. /package/src/emit/{resource → infrastructure/resources}/templates/WebSocketSubscription_Yaml.ejs +0 -0
  204. /package/src/emit/{error → schemas/error}/emitErrorSchemas.js +0 -0
  205. /package/src/emit/{error → schemas/error}/templates/errorSchema.ejs +0 -0
  206. /package/src/emit/{systemText → schemas/systemText}/templates/SystemTextSchemas.ejs +0 -0
  207. /package/src/{generateResources/IntTest → intTest/generators}/consts.js +0 -0
  208. /package/src/{generateResources/IntTest → intTest/generators}/generateResources/generateResources.js +0 -0
  209. /package/src/{generateResources/IntTest → intTest/generators}/generateResources/templateResources.ejs +0 -0
  210. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/events/events.js +0 -0
  211. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/events/templateEvents.ejs +0 -0
  212. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/generateTemplate.js +0 -0
  213. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/pathIntTest/pathIntTest.js +0 -0
  214. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/pathIntTest/template.ejs +0 -0
  215. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/tests/templateTests.ejs +0 -0
  216. /package/src/{generateResources/IntTest → intTest/generators}/generateTests/tests/tests.js +0 -0
  217. /package/src/{generateResources/IntTest → intTest/generators}/libs/IntTestGenerateLib.js +0 -0
  218. /package/src/{generateResources/IntTest → intTest/generators}/upload/uploadIntTest.js +0 -0
  219. /package/src/{intTestGeneratorShared.js → intTest/intTestGeneratorShared.js} +0 -0
@@ -0,0 +1,307 @@
1
+ import {
2
+ crudApplicationManagedPaths,
3
+ emitCrudApplicationArtifacts
4
+ } from '../emit/application/crud/emitCrudApplicationArtifacts.js';
5
+ import {
6
+ dynamicCrudFlowSchemaPaths,
7
+ emitDynamicCrudFlowSchemas
8
+ } from '../emit/application/crud/emitDynamicCrudFlowSchemas.js';
9
+ import {
10
+ customFlowApplicationManagedPaths,
11
+ emitCustomFlowApplicationArtifacts
12
+ } from '../emit/application/custom/emitCustomFlowApplicationArtifacts.js';
13
+ import {
14
+ emitDynamicRbacFlowSchemas,
15
+ rbacFlowSchemaManagedPaths
16
+ } from '../emit/application/rbac/emitDynamicRbacFlowSchemas.js';
17
+ import {
18
+ emitRbacApplicationArtifacts,
19
+ rbacApplicationManagedPaths
20
+ } from '../emit/application/rbac/emitRbacApplicationArtifacts.js';
21
+ import {
22
+ dynamicRelationshipFlowSchemaManagedPaths,
23
+ emitDynamicRelationshipFlowSchemas
24
+ } from '../emit/application/relationship/emitDynamicRelationshipFlowSchemas.js';
25
+ import {
26
+ emitRelationshipApplicationArtifacts,
27
+ relationshipApplicationManagedPaths
28
+ } from '../emit/application/relationship/emitRelationshipApplicationArtifacts.js';
29
+ import {
30
+ emitSystemWebSocketArtifacts,
31
+ systemWebSocketManagedPaths
32
+ } from '../emit/application/system/emitSystemWebSocketArtifacts.js';
33
+ import {
34
+ emitSystemFindDataArtifacts,
35
+ findDataManagedPaths
36
+ } from '../emit/application/system/emitSystemFindDataArtifacts.js';
37
+ import {
38
+ emitCoreFunctionArtifacts,
39
+ coreFunctionManagedPaths
40
+ } from '../emit/application/coreFunction/emitCoreFunctionArtifacts.js';
41
+ import {
42
+ emitResourceArtifacts,
43
+ resourceArtifactPaths
44
+ } from '../emit/infrastructure/resources/emitResourceArtifacts.js';
45
+ import {
46
+ emitSystemTextSchemas,
47
+ systemTextSchemaManagedPaths
48
+ } from '../emit/schemas/systemText/emitSystemTextSchemas.js';
49
+ import {
50
+ emitAttributeTreeObjectSchemas,
51
+ emitAttributeTreeRelationshipSchemas,
52
+ attributeTreeObjectSchemaManagedPaths,
53
+ attributeTreeRelationshipSchemaManagedPaths
54
+ } from '../emit/schemas/attributeTree/emitAttributeTreeSchemas.js';
55
+ import {
56
+ emitAttributeTreeTargetValueStandard,
57
+ attributeTreeTargetValueStandardManagedPaths
58
+ } from '../emit/schemas/attributeTree/emitAttributeTreeTargetValueStandard.js';
59
+ import {
60
+ emitLedgerObjectSchemas,
61
+ emitLedgerRelationshipSchemas,
62
+ ledgerObjectSchemaManagedPaths,
63
+ ledgerRelationshipSchemaManagedPaths
64
+ } from '../emit/schemas/ledger/emitLedgerSchemas.js';
65
+ import {
66
+ emitPropertyValueObjectSchemas,
67
+ emitPropertyValueRelationshipSchemas,
68
+ propertyValueObjectSchemaManagedPaths,
69
+ propertyValueRelationshipSchemaManagedPaths
70
+ } from '../emit/schemas/propertyValue/emitPropertyValueSchemas.js';
71
+ import {
72
+ emitErrorSchemas,
73
+ errorSchemaManagedPaths
74
+ } from '../emit/schemas/error/emitErrorSchemas.js';
75
+
76
+ export async function resolveEmissionGroups(context) {
77
+ const {
78
+ project,
79
+ objects,
80
+ relationships,
81
+ flows,
82
+ notifications,
83
+ errors,
84
+ directives = [],
85
+ objectGraphServiceTags,
86
+ relationshipGraphServiceTags,
87
+ logger
88
+ } = context;
89
+
90
+ const [
91
+ crud,
92
+ relationship,
93
+ rbac,
94
+ system,
95
+ findData,
96
+ resource,
97
+ coreFunction,
98
+ systemText,
99
+ errorSchemas,
100
+ ledgerObjectArtifacts,
101
+ ledgerRelationshipArtifacts
102
+ ] = await Promise.all([
103
+ emitCrudApplicationArtifacts({
104
+ objects,
105
+ flows,
106
+ serviceTag: project.serviceTag,
107
+ logger
108
+ }),
109
+ emitRelationshipApplicationArtifacts({
110
+ relationships,
111
+ flows,
112
+ serviceTag: project.serviceTag
113
+ }),
114
+ emitRbacApplicationArtifacts(objects),
115
+ emitSystemWebSocketArtifacts(flows, {
116
+ includeRelationshipOwnTopic: true,
117
+ objects,
118
+ relationships
119
+ }),
120
+ emitSystemFindDataArtifacts(objects),
121
+ emitResourceArtifacts({ objects, relationships, flows }),
122
+ emitCoreFunctionArtifacts({
123
+ project,
124
+ objects,
125
+ relationships,
126
+ flows,
127
+ objectGraphServiceTags,
128
+ relationshipGraphServiceTags
129
+ }),
130
+ emitSystemTextSchemas({
131
+ project,
132
+ objects,
133
+ relationships,
134
+ flows,
135
+ notifications
136
+ }),
137
+ emitErrorSchemas({
138
+ project,
139
+ errors,
140
+ objectGraphServiceTags
141
+ }),
142
+ emitLedgerObjectSchemas({
143
+ objects,
144
+ serviceTag: project.serviceTag
145
+ }),
146
+ emitLedgerRelationshipSchemas({
147
+ objects,
148
+ serviceTag: project.serviceTag
149
+ })
150
+ ]);
151
+
152
+ const custom = await emitCustomFlowApplicationArtifacts(flows, {
153
+ objects
154
+ });
155
+
156
+ let systemFunctions = [];
157
+ if (system.functions) {
158
+ systemFunctions = systemFunctions.concat(system.functions);
159
+ }
160
+ if (findData.functions) {
161
+ systemFunctions = systemFunctions.concat(findData.functions);
162
+ }
163
+
164
+ let findDataArtifacts = [];
165
+ if (findData.artifacts) {
166
+ findDataArtifacts = [...findData.artifacts];
167
+ }
168
+
169
+ if (systemFunctions.length > 0) {
170
+ findDataArtifacts.push({
171
+ path: 'app/sls_yaml/generatedCode/source/flow-system.yml',
172
+ content: systemFunctions.join('\n\n')
173
+ });
174
+ }
175
+
176
+ let resolvedCoreFunctionManagedPaths = coreFunctionManagedPaths;
177
+ if (typeof coreFunctionManagedPaths === 'function') {
178
+ resolvedCoreFunctionManagedPaths = coreFunctionManagedPaths({
179
+ project,
180
+ objects,
181
+ relationships,
182
+ flows,
183
+ objectGraphServiceTags,
184
+ relationshipGraphServiceTags
185
+ });
186
+ }
187
+
188
+ const rbacFlowArtifacts = await emitDynamicRbacFlowSchemas({
189
+ objects,
190
+ serviceTag: project.serviceTag
191
+ });
192
+
193
+ return [
194
+ {
195
+ scope: 'crud-flow-schemas',
196
+ managedPaths: dynamicCrudFlowSchemaPaths,
197
+ artifacts: emitDynamicCrudFlowSchemas({ objects, flows, logger })
198
+ },
199
+ {
200
+ scope: 'relationship-flow-schemas',
201
+ managedPaths: dynamicRelationshipFlowSchemaManagedPaths(relationships),
202
+ artifacts: emitDynamicRelationshipFlowSchemas({ relationships })
203
+ },
204
+ {
205
+ scope: 'rbac-flow-schemas',
206
+ managedPaths: rbacFlowSchemaManagedPaths(objects),
207
+ artifacts: rbacFlowArtifacts
208
+ },
209
+ {
210
+ scope: 'attribute-tree-target-value-standard',
211
+ managedPaths: attributeTreeTargetValueStandardManagedPaths(directives),
212
+ artifacts: emitAttributeTreeTargetValueStandard({ directives })
213
+ },
214
+ {
215
+ scope: 'attribute-tree-object-schemas',
216
+ managedPaths: attributeTreeObjectSchemaManagedPaths(objects),
217
+ artifacts: emitAttributeTreeObjectSchemas({
218
+ objects,
219
+ serviceTag: project.serviceTag
220
+ })
221
+ },
222
+ {
223
+ scope: 'attribute-tree-relationship-schemas',
224
+ managedPaths: attributeTreeRelationshipSchemaManagedPaths(objects),
225
+ artifacts: emitAttributeTreeRelationshipSchemas({
226
+ objects,
227
+ serviceTag: project.serviceTag
228
+ })
229
+ },
230
+ {
231
+ scope: 'ledger-object-schemas',
232
+ managedPaths: ledgerObjectSchemaManagedPaths(objects),
233
+ artifacts: ledgerObjectArtifacts
234
+ },
235
+ {
236
+ scope: 'ledger-relationship-schemas',
237
+ managedPaths: ledgerRelationshipSchemaManagedPaths(objects),
238
+ artifacts: ledgerRelationshipArtifacts
239
+ },
240
+ {
241
+ scope: 'property-value-object-schemas',
242
+ managedPaths: propertyValueObjectSchemaManagedPaths(objects),
243
+ artifacts: emitPropertyValueObjectSchemas({
244
+ objects,
245
+ serviceTag: project.serviceTag
246
+ })
247
+ },
248
+ {
249
+ scope: 'property-value-relationship-schemas',
250
+ managedPaths: propertyValueRelationshipSchemaManagedPaths(objects),
251
+ artifacts: emitPropertyValueRelationshipSchemas({
252
+ objects,
253
+ serviceTag: project.serviceTag
254
+ })
255
+ },
256
+ {
257
+ scope: 'crud-application',
258
+ managedPaths: crudApplicationManagedPaths(),
259
+ artifacts: crud
260
+ },
261
+ {
262
+ scope: 'relationship-application',
263
+ managedPaths: relationshipApplicationManagedPaths(),
264
+ artifacts: relationship
265
+ },
266
+ {
267
+ scope: 'rbac-application',
268
+ managedPaths: rbacApplicationManagedPaths(objects),
269
+ artifacts: rbac
270
+ },
271
+ {
272
+ scope: 'system-websocket',
273
+ managedPaths: systemWebSocketManagedPaths(),
274
+ artifacts: system.artifacts
275
+ },
276
+ {
277
+ scope: 'system-find-data',
278
+ managedPaths: findDataManagedPaths(),
279
+ artifacts: findDataArtifacts
280
+ },
281
+ {
282
+ scope: 'custom-flow-application',
283
+ managedPaths: customFlowApplicationManagedPaths(flows, { objects }),
284
+ artifacts: custom
285
+ },
286
+ {
287
+ scope: 'shared-resources',
288
+ managedPaths: resourceArtifactPaths,
289
+ artifacts: resource
290
+ },
291
+ {
292
+ scope: 'core-function',
293
+ managedPaths: resolvedCoreFunctionManagedPaths,
294
+ artifacts: coreFunction
295
+ },
296
+ {
297
+ scope: 'system-text-schemas',
298
+ managedPaths: systemTextSchemaManagedPaths(),
299
+ artifacts: systemText
300
+ },
301
+ {
302
+ scope: 'error-schemas',
303
+ managedPaths: errorSchemaManagedPaths(errors),
304
+ artifacts: errorSchemas
305
+ }
306
+ ];
307
+ }
package/task.md ADDED
@@ -0,0 +1,132 @@
1
+ # Task Checklist: Attribute Tree Per-Repo Code Generation Refactoring
2
+
3
+ > **Canonical Architecture Plan**: [[10.Systems/GenerateServiceCode/30-Generation/Task Roadmap - Attribute Tree Per-Repo Generation Refactoring|Task Roadmap in Obsidian]]
4
+ > **Selected Design**: **Option C (`GenerateDirectives/`)** + **Style 1 (`generatedCode/<domain>/`)**
5
+ > **Repository**: `IzaraCore-SupportServices-GenerateServiceCode-Seagame`
6
+
7
+ ---
8
+
9
+ ## 🎯 Target Architecture: Style 1 (`generatedCode/<domain>/`)
10
+
11
+ ### Target Service (e.g. `SellOfferTermValueStandard`)
12
+ ```text
13
+ app/src/schemas/
14
+ ├── GenerateDirectives/
15
+ │ └── sellOfferTermValueStandard.js <-- [Directive] Developer creates this
16
+ │
17
+ ├── ObjectSchemas/
18
+ │ └── generatedCode/
19
+ │ ├── attributeTree/
20
+ │ │ └── sellOfferTermValueStandard.js <-- [Emitted by TASK-02]
21
+ │ └── propertyValue/
22
+ │ ├── sellOfferTermValueStandardPropertyLabel.js <-- [Emitted by PropertyValue addOn]
23
+ │ └── sellOfferTermValueStandardPropertyValue.js <-- [Emitted by PropertyValue addOn]
24
+ │
25
+ └── RelationshipSchemas/
26
+ └── generatedCode/
27
+ └── propertyValue/
28
+ ├── hasSellOfferTermValueStandardPropertyValue.js
29
+ ├── disabledSellOfferTermValueStandardPropertyValue.js
30
+ └── isSellOfferTermValueStandardPropertyLabel.js
31
+ ```
32
+
33
+ ### Source Service (Self-Repo)
34
+ ```text
35
+ app/src/schemas/
36
+ ├── ObjectSchemas/
37
+ │ ├── sellOffer.js <-- Source ObjectSchema
38
+ │ └── generatedCode/
39
+ │ └── attributeTree/
40
+ │ ├── sellOfferTermLink.js
41
+ │ ├── sellOfferTermValue.js
42
+ │ └── sellOfferTermLabel.js
43
+ │
44
+ └── RelationshipSchemas/
45
+ └── generatedCode/
46
+ └── attributeTree/
47
+ ├── hasSellOfferTermLink.js
48
+ ├── disabledSellOfferTermLink.js
49
+ ├── isSellOfferTerm.js
50
+ └── isSellOfferTermLabel.js
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 📋 Implementation Checklist
56
+
57
+ - [x] **TASK-01: Recursive Schema Loading & Directives Loader**
58
+ - **File**: `src/compile/loadSchemas.js`
59
+ - **Action**:
60
+ 1. Update `loadLocalSchemaDirectory(project, directoryName, options)` to recursively find all `.js` files within subdirectories (supporting `ObjectSchemas/generatedCode/**` and `RelationshipSchemas/generatedCode/**`).
61
+ 2. Export `loadGenerateDirectives(project, options)` calling `loadLocalSchemaDirectory(project, 'GenerateDirectives', options)`.
62
+ - **Acceptance Criteria**: `loadLocalSchemaDirectory(project, 'ObjectSchemas')` discovers and validates schemas nested inside `generatedCode/attributeTree/` and `generatedCode/propertyValue/`. Returns `[]` when `GenerateDirectives` folder is missing.
63
+
64
+ - [x] **TASK-02: Target ValueStandard Schema Emitter**
65
+ - **File**: `src/emit/schemas/attributeTree/emitAttributeTreeTargetValueStandard.js` (NEW)
66
+ - **Action**:
67
+ 1. Filter `directives` for `directive.type === 'attributeTreeTarget'`.
68
+ 2. Emit `{tag}ValueStandard.js` to `app/src/schemas/ObjectSchemas/generatedCode/attributeTree/${tag}ValueStandard.js`.
69
+ 3. Include preservation hook `//(<addOnDataStructure${tag}ValueStandard>)` with commented `propertyValue` addOn template.
70
+ 4. Export `attributeTreeTargetValueStandardManagedPaths(directives)`.
71
+ - **Acceptance Criteria**: Emitted file adheres strictly to Izara backend syntax rules and matches Style 1 output path.
72
+
73
+ - [x] **TASK-03: Align AttributeTree Self-Repo Emitter to Style 1**
74
+ - **File**: `src/emit/schemas/attributeTree/emitAttributeTreeSchemas.js`
75
+ - **Action**:
76
+ 1. Update ObjectSchema emission paths from `generatedAttributeTree/` to `generatedCode/attributeTree/`.
77
+ 2. Update RelationshipSchema emission paths from `generatedAttributeTree/` to `generatedCode/attributeTree/`.
78
+ 3. Update `attributeTreeObjectSchemaManagedPaths` and `attributeTreeRelationshipSchemaManagedPaths`.
79
+ - **Acceptance Criteria**: Self-repo attributeTree schemas output cleanly into `generatedCode/attributeTree/`.
80
+
81
+ - [x] **TASK-04: Align PropertyValue Emitter to Style 1**
82
+ - **File**: `src/emit/schemas/propertyValue/emitPropertyValueSchemas.js`
83
+ - **Action**:
84
+ 1. Update ObjectSchema emission paths from `generatedPropertyValue/` to `generatedCode/propertyValue/`.
85
+ 2. Update RelationshipSchema emission paths from `generatedPropertyValue/` to `generatedCode/propertyValue/`.
86
+ 3. Update `propertyValueObjectSchemaManagedPaths` and `propertyValueRelationshipSchemaManagedPaths`.
87
+ - **Acceptance Criteria**: PropertyValue schemas output cleanly into `generatedCode/propertyValue/`.
88
+
89
+ - [x] **TASK-05: Register Managed Scopes in Domain Registry**
90
+ - **File**: `src/plan/domainRegistry.js`
91
+ - **Action**:
92
+ 1. Import `emitAttributeTreeTargetValueStandard` and `attributeTreeTargetValueStandardManagedPaths`.
93
+ 2. Register new scope `attribute-tree-target-value-standard`.
94
+ 3. Pass `directives` into `resolveEmissionGroups(context)`.
95
+ - **Acceptance Criteria**: All 5 dynamic schema scopes registered and tracked in `.generate-service-code-v2-managed.json`.
96
+
97
+ - [x] **TASK-06: Decouple Generation Pipeline in `src/generate.js`**
98
+ - **File**: `src/generate.js`
99
+ - **Action**:
100
+ 1. Load directives: `const directives = await loadGenerateDirectives(project, schemaLoadOptions);`.
101
+ 2. Pass `directives` to `resolveEmissionGroups`.
102
+ 3. Delete lines 104-111 (`targetFiles = await _emitTargetServiceAttributeTreeSchemas(...)`).
103
+ 4. Delete lines 129-186 (`_emitTargetServiceAttributeTreeSchemas` function definition).
104
+ - **Acceptance Criteria**: Zero cross-repo filesystem writes. Generator operates strictly within `workspaceOutputRoot`.
105
+
106
+ - [x] **TASK-07: Delete Legacy Cross-Repo Files**
107
+ - **Files to Delete**:
108
+ - `src/emit/schemas/attributeTree/resolveTargetServicePath.js`
109
+ - `src/emit/schemas/attributeTree/emitAttributeTreeTargetSchemas.js`
110
+ - **Action**: Remove dead files and any unused imports.
111
+ - **Acceptance Criteria**: `git status` shows clean file deletions.
112
+
113
+ - [x] **TASK-08: Unit & Integration Test Verification**
114
+ - **Files**:
115
+ - `test/unit/schemas/attributeTreeDirectives.test.js` (NEW)
116
+ - `test/unit/schemas/attributeTreeSchemas.test.js` (Update paths)
117
+ - `test/unit/schemas/propertyValueSchemas.test.js` (Update paths)
118
+ - **Verification Command**: `npm test`
119
+ - **Acceptance Criteria**: All 198+ tests pass with zero regression.
120
+
121
+ - [x] **TASK-09: End-to-End Cascading Verification**
122
+ - **Action**: Verify two-phase generation locally:
123
+ 1. Target service with directive -> generates `sellOfferTermValueStandard.js`.
124
+ 2. Target service uncomments `propertyValue` -> generates PropertyLabel, PropertyValue, and 3 Relationship schemas.
125
+ - **Acceptance Criteria**: Zero cross-repo dependency required.
126
+
127
+ - [x] **TASK-10: Synchronize Vault & Taiga Documentation**
128
+ - **Vault Files**:
129
+ - `10.Systems/GenerateServiceCode/20-Schema/Dynamic Schema.md`
130
+ - `40.Vault/Operations/timeline-log.md`
131
+ - `40.Vault/Memory/active-context.md`
132
+ - **Taiga Wiki**: Update `generatecode` wiki page.
@@ -0,0 +1,127 @@
1
+ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
2
+ import { tmpdir } from 'node:os';
3
+ import { dirname, join } from 'node:path';
4
+
5
+ const trackedRoots = new Set();
6
+
7
+ /**
8
+ * Creates a temporary project directory with standard Izara service structure.
9
+ *
10
+ * @param {Object} [options]
11
+ * @param {string} [options.rootPath] - Existing root path to re-use
12
+ * @param {string} [options.prefix] - Temp folder prefix (default: 'izara-test-')
13
+ * @param {string} [options.serviceName] - Service name in config
14
+ * @param {string} [options.serviceTag] - Custom serviceTag in config
15
+ * @param {string} [options.serverlessConfig] - Custom serverless.config.yml content
16
+ * @param {Object} [options.schemas] - Schemas map e.g. { ObjectSchemas: { 'Order.js': '...' } }
17
+ * @returns {Promise<string>} The project root path
18
+ */
19
+ export async function createTestProject({
20
+ rootPath: existingRoot,
21
+ prefix = 'izara-test-',
22
+ serviceName = 'TestService',
23
+ serviceTag = 'TestService',
24
+ serverlessConfig,
25
+ schemas = {}
26
+ } = {}) {
27
+ let rootPath = existingRoot;
28
+ if (!rootPath) {
29
+ rootPath = await mkdtemp(join(tmpdir(), prefix));
30
+ }
31
+ trackedRoots.add(rootPath);
32
+
33
+ const schemaRoot = join(rootPath, 'app/src/schemas');
34
+ await mkdir(join(schemaRoot, 'ObjectSchemas'), { recursive: true });
35
+ await mkdir(join(schemaRoot, 'RelationshipSchemas'), { recursive: true });
36
+ await mkdir(join(schemaRoot, 'FlowSchemas'), { recursive: true });
37
+ await mkdir(join(schemaRoot, 'ErrorSchemas'), { recursive: true });
38
+ await mkdir(join(rootPath, 'config'), { recursive: true });
39
+
40
+ let configContent = serverlessConfig;
41
+ if (!configContent) {
42
+ configContent =
43
+ `service: ${serviceName}\n` +
44
+ `custom:\n` +
45
+ ` serviceTag: ${serviceTag}\n`;
46
+ }
47
+ await writeFile(
48
+ join(rootPath, 'config/serverless.config.yml'),
49
+ configContent,
50
+ 'utf8'
51
+ );
52
+
53
+ const schemaCategories = [
54
+ 'ObjectSchemas',
55
+ 'RelationshipSchemas',
56
+ 'FlowSchemas',
57
+ 'ErrorSchemas'
58
+ ];
59
+
60
+ for (const category of schemaCategories) {
61
+ const files = schemas[category];
62
+ if (files && typeof files === 'object') {
63
+ for (const [filename, content] of Object.entries(files)) {
64
+ await writeProjectFile(
65
+ rootPath,
66
+ join('app/src/schemas', category, filename),
67
+ content
68
+ );
69
+ }
70
+ }
71
+ }
72
+
73
+ for (const [key, content] of Object.entries(schemas)) {
74
+ if (!schemaCategories.includes(key) && typeof content === 'string') {
75
+ await writeProjectFile(
76
+ rootPath,
77
+ join('app/src/schemas', key),
78
+ content
79
+ );
80
+ }
81
+ }
82
+
83
+ return rootPath;
84
+ }
85
+
86
+ /**
87
+ * Tracks an external directory path for cleanupTestProjects.
88
+ *
89
+ * @param {string} rootPath - Directory path to track
90
+ * @returns {string} The tracked path
91
+ */
92
+ export function trackTestProject(rootPath) {
93
+ trackedRoots.add(rootPath);
94
+ return rootPath;
95
+ }
96
+
97
+ /**
98
+ * Writes a file relative to the project root.
99
+ */
100
+ export async function writeProjectFile(rootPath, relativePath, content) {
101
+ const targetPath = join(rootPath, relativePath);
102
+ await mkdir(dirname(targetPath), { recursive: true });
103
+ await writeFile(targetPath, content, 'utf8');
104
+ return targetPath;
105
+ }
106
+
107
+ /**
108
+ * Reads a file relative to the project root.
109
+ */
110
+ export async function readProjectFile(rootPath, relativePath) {
111
+ return await readFile(join(rootPath, relativePath), 'utf8');
112
+ }
113
+
114
+ /**
115
+ * Cleans up all tracked temporary project directories.
116
+ */
117
+ export async function cleanupTestProjects() {
118
+ const roots = Array.from(trackedRoots);
119
+ trackedRoots.clear();
120
+ for (const root of roots) {
121
+ try {
122
+ await rm(root, { recursive: true, force: true });
123
+ } catch (err) {
124
+ // Ignore cleanup errors
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,57 @@
1
+ import assert from 'node:assert/strict';
2
+ import { stat } from 'node:fs/promises';
3
+ import test, { after } from 'node:test';
4
+
5
+ import {
6
+ createTestProject,
7
+ writeProjectFile,
8
+ readProjectFile,
9
+ cleanupTestProjects
10
+ } from './testProject.js';
11
+
12
+ after(async () => {
13
+ await cleanupTestProjects();
14
+ });
15
+
16
+ test('createTestProject creates directories and serverless config', async () => {
17
+ const rootPath = await createTestProject({
18
+ serviceName: 'DemoService',
19
+ serviceTag: 'DemoTag'
20
+ });
21
+
22
+ const config = await readProjectFile(
23
+ rootPath,
24
+ 'config/serverless.config.yml'
25
+ );
26
+ assert.match(config, /service: DemoService/);
27
+ assert.match(config, /serviceTag: DemoTag/);
28
+
29
+ const customFile = 'app/src/schemas/ObjectSchemas/Demo.js';
30
+ await writeProjectFile(
31
+ rootPath,
32
+ customFile,
33
+ 'export default [{ objectType: "demo" }];'
34
+ );
35
+
36
+ const readBack = await readProjectFile(rootPath, customFile);
37
+ assert.match(readBack, /objectType: "demo"/);
38
+
39
+ const stats = await stat(rootPath);
40
+ assert.equal(stats.isDirectory(), true);
41
+ });
42
+
43
+ test('createTestProject populates initial schemas map', async () => {
44
+ const rootPath = await createTestProject({
45
+ schemas: {
46
+ ObjectSchemas: {
47
+ 'Item.js': 'export default [{ objectType: "item" }];'
48
+ }
49
+ }
50
+ });
51
+
52
+ const content = await readProjectFile(
53
+ rootPath,
54
+ 'app/src/schemas/ObjectSchemas/Item.js'
55
+ );
56
+ assert.match(content, /objectType: "item"/);
57
+ });
@@ -11,9 +11,9 @@ import { tmpdir } from 'node:os';
11
11
  import { dirname, join } from 'node:path';
12
12
  import test from 'node:test';
13
13
 
14
- import { buildGenerationPlan } from '../src/plan/buildGenerationPlan.js';
15
- import { commitArtifacts } from '../src/output/commitArtifacts.js';
16
- import { compileProject } from '../src/compile/compileProject.js';
14
+ import { buildGenerationPlan } from '../../src/plan/buildGenerationPlan.js';
15
+ import { commitArtifacts } from '../../src/output/commitArtifacts.js';
16
+ import { compileProject } from '../../src/compile/compileProject.js';
17
17
 
18
18
  test('compiles a request and commits only declared relative artifacts', async () => {
19
19
  const outputPath = await mkdtemp(join(tmpdir(), 'generate-service-code-v2-'));
@@ -1,6 +1,6 @@
1
1
  import test from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import { validateFlowSchema } from '../src/compile/flowValidator.js';
3
+ import { validateFlowSchema } from '../../src/compile/flowValidator.js';
4
4
 
5
5
  test('validateFlowSchema passes for valid Graph-Driven FlowSchema', () => {
6
6
  const validSchema = {
@@ -4,7 +4,7 @@ import os from 'node:os';
4
4
  import path from 'node:path';
5
5
  import test from 'node:test';
6
6
 
7
- import { generateIntTest, generateResourceIntTest } from '../index.js';
7
+ import { generateIntTest, generateResourceIntTest } from '../../index.js';
8
8
 
9
9
  test('exports IntTest generators and requires a service tag', async () => {
10
10
  const rootPath = await mkdtemp(