@quadnix/octo-build 0.0.16 → 0.1.0

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 (199) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +25 -3
  3. package/dist/commands/apply/apply.command.d.ts +25 -0
  4. package/dist/commands/apply/apply.command.js +136 -0
  5. package/dist/commands/apply/apply.command.js.map +1 -0
  6. package/dist/commands/apply/index.d.ts +1 -0
  7. package/dist/commands/apply/index.js +2 -0
  8. package/dist/commands/apply/index.js.map +1 -0
  9. package/dist/commands/build/build.command.d.ts +1 -1
  10. package/dist/commands/build/build.command.js +4 -4
  11. package/dist/commands/build/build.command.js.map +1 -1
  12. package/dist/commands/build/main.d.ts +22 -0
  13. package/dist/commands/build/main.js +22 -0
  14. package/dist/commands/build/main.js.map +1 -1
  15. package/dist/commands/build/parsers/build-file.parser.d.ts +6 -0
  16. package/dist/commands/build/parsers/build-file.parser.js +6 -0
  17. package/dist/commands/build/parsers/build-file.parser.js.map +1 -1
  18. package/dist/commands/build/streams/stream-manager.d.ts +6 -0
  19. package/dist/commands/build/streams/stream-manager.js +7 -1
  20. package/dist/commands/build/streams/stream-manager.js.map +1 -1
  21. package/dist/commands/commit/commit.command.d.ts +22 -0
  22. package/dist/commands/commit/commit.command.js +94 -0
  23. package/dist/commands/commit/commit.command.js.map +1 -0
  24. package/dist/commands/commit/index.d.ts +1 -0
  25. package/dist/commands/commit/index.js +2 -0
  26. package/dist/commands/commit/index.js.map +1 -0
  27. package/dist/commands/create-anchor/create-anchor.command.js +1 -1
  28. package/dist/commands/create-anchor/create-anchor.command.js.map +1 -1
  29. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.d.ts +18 -3
  30. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js +29 -11
  31. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/index.js.map +1 -1
  32. package/dist/commands/create-anchor/generator-octo-anchor-template/generators/app/templates/anchors/anchor/anchor.schema.ts.ejs +9 -1
  33. package/dist/commands/create-app/create-app.command.d.ts +1 -1
  34. package/dist/commands/create-app/create-app.command.js +7 -3
  35. package/dist/commands/create-app/create-app.command.js.map +1 -1
  36. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.d.ts +17 -1
  37. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js +60 -18
  38. package/dist/commands/create-app/generator-octo-app-template/generators/app/index.js.map +1 -1
  39. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/README.md.ejs +60 -10
  40. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/gitignore.ejs +13 -0
  41. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/index.ts.ejs +19 -0
  42. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/package.json.ejs +9 -1
  43. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-dynamodb-service/octo.yaml.ejs +111 -0
  44. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/octo.yaml.ejs +198 -0
  45. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-s3-website/octo.yaml.ejs +14 -0
  46. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/tsconfig.json.ejs +0 -3
  47. package/dist/commands/{create-resource/create-resource.command.d.ts → create-external-resource/create-external-resource.command.d.ts} +1 -1
  48. package/dist/commands/create-external-resource/create-external-resource.command.js +64 -0
  49. package/dist/commands/create-external-resource/create-external-resource.command.js.map +1 -0
  50. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/index.d.ts +17 -2
  51. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/index.js +36 -35
  52. package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/index.js.map +1 -0
  53. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/actions/add.resource.action.ts.ejs +7 -16
  54. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/actions/delete.resource.action.ts.ejs +21 -3
  55. package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/templates/resources/resource/actions/update.resource.action.ts.ejs +63 -0
  56. package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/index.ts.ejs +1 -2
  57. package/dist/commands/create-external-resource/generator-octo-external-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +28 -0
  58. package/dist/commands/create-external-resource/index.d.ts +1 -0
  59. package/dist/commands/create-external-resource/index.js +2 -0
  60. package/dist/commands/create-external-resource/index.js.map +1 -0
  61. package/dist/commands/create-model/create-model.command.js +1 -1
  62. package/dist/commands/create-model/create-model.command.js.map +1 -1
  63. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.d.ts +17 -2
  64. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js +26 -9
  65. package/dist/commands/create-model/generator-octo-model-template/generators/app/index.js.map +1 -1
  66. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/model.ts.ejs +3 -1
  67. package/dist/commands/create-model/generator-octo-model-template/generators/app/templates/models/model/schema.ts.ejs +6 -1
  68. package/dist/commands/create-module/create-module.command.js +1 -1
  69. package/dist/commands/create-module/create-module.command.js.map +1 -1
  70. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.d.ts +17 -2
  71. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js +27 -10
  72. package/dist/commands/create-module/generator-octo-module-template/generators/app/index.js.map +1 -1
  73. package/dist/commands/create-overlay/create-overlay.command.js +4 -3
  74. package/dist/commands/create-overlay/create-overlay.command.js.map +1 -1
  75. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.d.ts +17 -2
  76. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js +26 -9
  77. package/dist/commands/create-overlay/generator-octo-overlay-template/generators/app/index.js.map +1 -1
  78. package/dist/commands/{create-cdk/create-cdk.command.d.ts → create-terraform-resource/create-terraform-resource.command.d.ts} +3 -3
  79. package/dist/commands/{create-resource/create-resource.command.js → create-terraform-resource/create-terraform-resource.command.js} +17 -11
  80. package/dist/commands/create-terraform-resource/create-terraform-resource.command.js.map +1 -0
  81. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.d.ts +25 -0
  82. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.js +71 -0
  83. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/index.js.map +1 -0
  84. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/index.schema.ts.ejs +43 -0
  85. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/index.ts.ejs +1 -0
  86. package/dist/commands/create-terraform-resource/generator-octo-terraform-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +83 -0
  87. package/dist/commands/create-terraform-resource/index.d.ts +1 -0
  88. package/dist/commands/create-terraform-resource/index.js +2 -0
  89. package/dist/commands/create-terraform-resource/index.js.map +1 -0
  90. package/dist/commands/generate/generate.command.d.ts +14 -0
  91. package/dist/commands/generate/generate.command.js +35 -0
  92. package/dist/commands/generate/generate.command.js.map +1 -0
  93. package/dist/commands/generate/index.d.ts +1 -0
  94. package/dist/commands/generate/index.js +2 -0
  95. package/dist/commands/generate/index.js.map +1 -0
  96. package/dist/commands/get-response/get-response.command.d.ts +18 -0
  97. package/dist/commands/get-response/get-response.command.js +39 -0
  98. package/dist/commands/get-response/get-response.command.js.map +1 -0
  99. package/dist/commands/get-response/index.d.ts +1 -0
  100. package/dist/commands/get-response/index.js +2 -0
  101. package/dist/commands/get-response/index.js.map +1 -0
  102. package/dist/commands/lock/index.d.ts +1 -0
  103. package/dist/commands/lock/index.js +2 -0
  104. package/dist/commands/lock/index.js.map +1 -0
  105. package/dist/commands/lock/lock.command.d.ts +13 -0
  106. package/dist/commands/lock/lock.command.js +28 -0
  107. package/dist/commands/lock/lock.command.js.map +1 -0
  108. package/dist/commands/run-action/index.d.ts +1 -0
  109. package/dist/commands/run-action/index.js +2 -0
  110. package/dist/commands/run-action/index.js.map +1 -0
  111. package/dist/commands/run-action/run-action.command.d.ts +12 -0
  112. package/dist/commands/run-action/run-action.command.js +46 -0
  113. package/dist/commands/run-action/run-action.command.js.map +1 -0
  114. package/dist/commands/unlock/index.d.ts +1 -0
  115. package/dist/commands/unlock/index.js +2 -0
  116. package/dist/commands/unlock/index.js.map +1 -0
  117. package/dist/commands/unlock/unlock.command.d.ts +18 -0
  118. package/dist/commands/unlock/unlock.command.js +51 -0
  119. package/dist/commands/unlock/unlock.command.js.map +1 -0
  120. package/dist/commands/validate/index.d.ts +1 -0
  121. package/dist/commands/validate/index.js +2 -0
  122. package/dist/commands/validate/index.js.map +1 -0
  123. package/dist/commands/validate/validate.command.d.ts +17 -0
  124. package/dist/commands/validate/validate.command.js +68 -0
  125. package/dist/commands/validate/validate.command.js.map +1 -0
  126. package/dist/index.js +20 -8
  127. package/dist/index.js.map +1 -1
  128. package/dist/resources/octo-v1.schema.json +86 -19
  129. package/dist/utilities/definition/yaml/yaml-definition.utility.d.ts +98 -10
  130. package/dist/utilities/definition/yaml/yaml-definition.utility.js +197 -66
  131. package/dist/utilities/definition/yaml/yaml-definition.utility.js.map +1 -1
  132. package/dist/utilities/octo/octo.utility.d.ts +48 -0
  133. package/dist/utilities/octo/octo.utility.js +144 -0
  134. package/dist/utilities/octo/octo.utility.js.map +1 -0
  135. package/dist/utilities/process/process.utility.d.ts +8 -0
  136. package/dist/utilities/process/process.utility.js +8 -0
  137. package/dist/utilities/process/process.utility.js.map +1 -1
  138. package/dist/utilities/project-index/project-index.utility.d.ts +27 -0
  139. package/dist/utilities/project-index/project-index.utility.js +71 -0
  140. package/dist/utilities/project-index/project-index.utility.js.map +1 -0
  141. package/dist/utilities/string/string.utility.d.ts +22 -0
  142. package/dist/utilities/string/string.utility.js +27 -0
  143. package/dist/utilities/string/string.utility.js.map +1 -1
  144. package/package.json +9 -8
  145. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/app.config.ts.ejs +0 -23
  146. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/env.ejs +0 -2
  147. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/main.ts.ejs +0 -24
  148. package/dist/commands/create-app/generator-octo-app-template/generators/app/templates/src/aws-ecs-server/module-definitions.ts.ejs +0 -201
  149. package/dist/commands/create-cdk/create-cdk.command.js +0 -70
  150. package/dist/commands/create-cdk/create-cdk.command.js.map +0 -1
  151. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.d.ts +0 -10
  152. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js +0 -107
  153. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/index.js.map +0 -1
  154. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/README.md.ejs +0 -23
  155. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/eslint.config.js.ejs +0 -337
  156. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitignore.ejs +0 -82
  157. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/gitkeep.ejs +0 -0
  158. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/package.json.ejs +0 -57
  159. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/prettierrc.ejs +0 -5
  160. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.schema.ts.ejs +0 -19
  161. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/anchors/app/app.anchor.ts.ejs +0 -17
  162. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/factories/dummy-credentials.factory.ts.ejs +0 -28
  163. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.spec.ts.ejs +0 -90
  164. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/dummy-app.module.ts.ejs +0 -16
  165. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.schema.ts.ejs +0 -10
  166. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/index.ts.ejs +0 -3
  167. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/actions/add-dummy-app.model.action.ts.ejs +0 -59
  168. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/modules/app/dummy-app/models/app/index.ts.ejs +0 -1
  169. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/actions/add-http-fetch.resource.action.ts.ejs +0 -55
  170. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/http-fetch.resource.ts.ejs +0 -12
  171. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.schema.ts.ejs +0 -35
  172. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/resources/http-fetch/index.ts.ejs +0 -3
  173. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/src/utilities/dummy/dummy.utility.ts.ejs +0 -11
  174. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.build.json.ejs +0 -11
  175. package/dist/commands/create-cdk/generator-octo-cdk-template/generators/app/templates/tsconfig.json.ejs +0 -39
  176. package/dist/commands/create-cdk/index.d.ts +0 -1
  177. package/dist/commands/create-cdk/index.js +0 -2
  178. package/dist/commands/create-cdk/index.js.map +0 -1
  179. package/dist/commands/create-resource/create-resource.command.js.map +0 -1
  180. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/index.js.map +0 -1
  181. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/update-tags.resource.action.ts.ejs +0 -86
  182. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/actions/validate.resource.action.ts.ejs +0 -40
  183. package/dist/commands/create-resource/generator-octo-resource-template/generators/app/templates/resources/resource/resource.ts.ejs +0 -12
  184. package/dist/commands/create-resource/index.d.ts +0 -1
  185. package/dist/commands/create-resource/index.js +0 -2
  186. package/dist/commands/create-resource/index.js.map +0 -1
  187. package/dist/commands/run/index.d.ts +0 -1
  188. package/dist/commands/run/index.js +0 -2
  189. package/dist/commands/run/index.js.map +0 -1
  190. package/dist/commands/run/run.command.d.ts +0 -11
  191. package/dist/commands/run/run.command.js +0 -83
  192. package/dist/commands/run/run.command.js.map +0 -1
  193. package/dist/commands/state/index.d.ts +0 -1
  194. package/dist/commands/state/index.js +0 -2
  195. package/dist/commands/state/index.js.map +0 -1
  196. package/dist/commands/state/state.command.d.ts +0 -14
  197. package/dist/commands/state/state.command.js +0 -79
  198. package/dist/commands/state/state.command.js.map +0 -1
  199. /package/dist/commands/{create-resource/generator-octo-resource-template → create-external-resource/generator-octo-external-resource-template}/generators/app/templates/resources/resource/index.schema.ts.ejs +0 -0
@@ -0,0 +1,51 @@
1
+ import { Container, StateManagementService } from '@quadnix/octo';
2
+ import chalk from 'chalk';
3
+ import { bootStateProvider, reportError } from '../../utilities/octo/octo.utility.js';
4
+ /**
5
+ * Releases the app lock.
6
+ *
7
+ * A run that finishes releases its own lock - `commit` always does, however it ends - so this is
8
+ * either for a run that never reached its commit, or for `--force` after one died holding the lock.
9
+ */
10
+ export const unlockCommand = {
11
+ builder: (yargs) => {
12
+ return yargs
13
+ .option('lockId', {
14
+ demandOption: false,
15
+ description: 'The lock ID to release, as printed by `octo lock`.',
16
+ type: 'string',
17
+ })
18
+ .option('force', {
19
+ default: false,
20
+ demandOption: false,
21
+ description: 'Release whatever lock is held, without knowing its ID. For a run that died holding one.',
22
+ type: 'boolean',
23
+ });
24
+ },
25
+ command: 'unlock',
26
+ describe: 'Release the app state lock.',
27
+ handler: async (argv) => {
28
+ const { force, lockId } = argv;
29
+ try {
30
+ if (!force && !lockId) {
31
+ throw new Error('Either --lockId or --force is required to unlock!');
32
+ }
33
+ await bootStateProvider();
34
+ const stateManagementService = await Container.getInstance().get(StateManagementService);
35
+ // Force reads the held lock and releases that, which is the only way through when the ID was
36
+ // lost with the run that took it.
37
+ const existingLockId = await stateManagementService.getAppLock();
38
+ if (!existingLockId) {
39
+ console.error(chalk.green('App is already unlocked.'));
40
+ return;
41
+ }
42
+ await stateManagementService.unlockApp(force ? existingLockId : lockId);
43
+ console.error(chalk.green(`App was unlocked, releasing lock ID "${existingLockId}".`));
44
+ }
45
+ catch (error) {
46
+ reportError(error);
47
+ process.exit(1);
48
+ }
49
+ },
50
+ };
51
+ //# sourceMappingURL=unlock.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unlock.command.js","sourceRoot":"","sources":["../../../src/commands/unlock/unlock.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAOtF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAAM,CAAC,QAAQ,EAAE;YAChB,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,QAAQ;SACf,CAAC;aACD,MAAM,CAAC,OAAO,EAAE;YACf,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,yFAAyF;YACtG,IAAI,EAAE,SAAS;SAChB,CAAC,CAAC;IACP,CAAC;IACD,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE,KAAK,EAAE,IAAgD,EAAiB,EAAE;QACjF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAE/B,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YAED,MAAM,iBAAiB,EAAE,CAAC;YAC1B,MAAM,sBAAsB,GAAG,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YAEzF,6FAA6F;YAC7F,kCAAkC;YAClC,MAAM,cAAc,GAAG,MAAM,sBAAsB,CAAC,UAAU,EAAE,CAAC;YACjE,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;gBACvD,OAAO;YACT,CAAC;YAED,MAAM,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAO,CAAC,CAAC;YACzE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,wCAAwC,cAAc,IAAI,CAAC,CAAC,CAAC;QACzF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -0,0 +1 @@
1
+ export { validateCommand } from './validate.command.js';
@@ -0,0 +1,2 @@
1
+ export { validateCommand } from './validate.command.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ArgumentsCamelCase, Argv } from 'yargs';
2
+ type ValidateCommandArguments = {
3
+ terraformBinary?: string;
4
+ terragruntBinary?: string;
5
+ terragruntDir: string;
6
+ timeoutInMs?: number;
7
+ };
8
+ /**
9
+ * Step 2 of the octo lifecycle. See {@link Octo.validate}.
10
+ */
11
+ export declare const validateCommand: {
12
+ builder: (yargs: Argv) => Argv;
13
+ command: string;
14
+ describe: string;
15
+ handler: (argv: ArgumentsCamelCase<ValidateCommandArguments>) => Promise<void>;
16
+ };
17
+ export {};
@@ -0,0 +1,68 @@
1
+ import { resolve } from 'path';
2
+ import { Container, TerraformUtility } from '@quadnix/octo';
3
+ import chalk from 'chalk';
4
+ import { bootOcto, prepareCallbackEnvironment, reportError } from '../../utilities/octo/octo.utility.js';
5
+ /**
6
+ * Step 2 of the octo lifecycle. See {@link Octo.validate}.
7
+ */
8
+ export const validateCommand = {
9
+ builder: (yargs) => {
10
+ return yargs
11
+ .option('terragruntDir', {
12
+ demandOption: true,
13
+ description: 'The generated Terragrunt directory to plan and validate.',
14
+ type: 'string',
15
+ })
16
+ .option('terraformBinary', {
17
+ demandOption: false,
18
+ description: 'Override the terraform/tofu binary terragrunt should invoke (sets TG_TF_PATH).',
19
+ type: 'string',
20
+ })
21
+ .option('terragruntBinary', {
22
+ demandOption: false,
23
+ description: 'Override the terragrunt binary/path to invoke.',
24
+ type: 'string',
25
+ })
26
+ .option('timeoutInMs', {
27
+ demandOption: false,
28
+ description: 'Override the per-command timeout, in milliseconds.',
29
+ type: 'number',
30
+ });
31
+ },
32
+ command: 'validate',
33
+ describe: "Step 2: validate the generated Terraform plans against Octo's resource diff.",
34
+ handler: async (argv) => {
35
+ const { terraformBinary, terragruntBinary, terragruntDir, timeoutInMs } = argv;
36
+ const resolvedDir = resolve(process.cwd(), terragruntDir);
37
+ try {
38
+ // A plan reads every `data "external"`, and each one shells back out to `octo get-response`.
39
+ prepareCallbackEnvironment();
40
+ const { app, octo } = await bootOcto();
41
+ const terraformUtility = await Container.getInstance().get(TerraformUtility, {
42
+ args: [{ terraformBinary, terragruntBinary, timeoutInMs }, true],
43
+ });
44
+ // A folder whose plan cannot be read is carried as an error rather than aborting the run. Octo
45
+ // reports the failure for a folder holding a module it tracks, and ignores one it does not know.
46
+ const planResult = await terraformUtility.plan(resolvedDir, { json: true });
47
+ // The report itself is rendered by whichever listeners the definition registers — none of
48
+ // them, and this command prints only its verdict. What survives here is the exit code, which
49
+ // is the CLI's own job and not a listener's.
50
+ const report = await octo.validate(app, planResult);
51
+ // Only being unable to read a folder is unsuccessful. Drift and unexplained changes are
52
+ // findings to act on, not exit codes.
53
+ //
54
+ // The verdict itself is not printed here - the listeners render the report, drift included,
55
+ // on stdout, and a `console.log` alongside pino lands out of order. What is left is the exit
56
+ // code, which is the CLI's own job, and the failure line on stderr.
57
+ if (report.failures.length > 0) {
58
+ console.error(chalk.red('\nValidation could not complete!'));
59
+ process.exit(1);
60
+ }
61
+ }
62
+ catch (error) {
63
+ reportError(error);
64
+ process.exit(1);
65
+ }
66
+ },
67
+ };
68
+ //# sourceMappingURL=validate.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.command.js","sourceRoot":"","sources":["../../../src/commands/validate/validate.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AASzG;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,CAAC,KAAW,EAAQ,EAAE;QAC7B,OAAO,KAAK;aACT,MAAM,CAAC,eAAe,EAAE;YACvB,YAAY,EAAE,IAAI;YAClB,WAA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AM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;YAEpD,wFAAwF;YACxF,sCAAsC;YACtC,EAAE;YACF,4FAA4F;YAC5F,6FAA6F;YAC7F,oEAAoE;YACpE,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC,CAAC;gBAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC"}
package/dist/index.js CHANGED
@@ -2,16 +2,22 @@
2
2
  import * as process from 'process';
3
3
  import chalk from 'chalk';
4
4
  import yargs from 'yargs/yargs';
5
+ import { applyCommand } from './commands/apply/index.js';
5
6
  import { buildCommand } from './commands/build/index.js';
7
+ import { commitCommand } from './commands/commit/index.js';
6
8
  import { createAnchorCommand } from './commands/create-anchor/index.js';
7
9
  import { createAppCommand } from './commands/create-app/index.js';
8
- import { createCdkCommand } from './commands/create-cdk/index.js';
10
+ import { createExternalResourceCommand } from './commands/create-external-resource/index.js';
9
11
  import { createModelCommand } from './commands/create-model/index.js';
10
12
  import { createModuleCommand } from './commands/create-module/index.js';
11
13
  import { createOverlayCommand } from './commands/create-overlay/index.js';
12
- import { createResourceCommand } from './commands/create-resource/index.js';
13
- import { runCommand } from './commands/run/index.js';
14
- import { stateCommand } from './commands/state/index.js';
14
+ import { createTerraformResourceCommand } from './commands/create-terraform-resource/index.js';
15
+ import { generateCommand } from './commands/generate/index.js';
16
+ import { getResponseCommand } from './commands/get-response/index.js';
17
+ import { lockCommand } from './commands/lock/index.js';
18
+ import { runActionCommand } from './commands/run-action/index.js';
19
+ import { unlockCommand } from './commands/unlock/index.js';
20
+ import { validateCommand } from './commands/validate/index.js';
15
21
  const PROGRAM_NAME = 'octo';
16
22
  const parser = yargs(process.argv.slice(2))
17
23
  .scriptName(PROGRAM_NAME)
@@ -23,13 +29,19 @@ const parser = yargs(process.argv.slice(2))
23
29
  .alias('v', 'version');
24
30
  parser.command(createAnchorCommand);
25
31
  parser.command(createAppCommand);
26
- parser.command(createCdkCommand);
32
+ parser.command(createExternalResourceCommand);
27
33
  parser.command(createModelCommand);
28
34
  parser.command(createModuleCommand);
29
35
  parser.command(createOverlayCommand);
30
- parser.command(createResourceCommand);
36
+ parser.command(createTerraformResourceCommand);
37
+ parser.command(applyCommand);
31
38
  parser.command(buildCommand);
32
- parser.command(runCommand);
33
- parser.command(stateCommand);
39
+ parser.command(commitCommand);
40
+ parser.command(generateCommand);
41
+ parser.command(getResponseCommand);
42
+ parser.command(lockCommand);
43
+ parser.command(runActionCommand);
44
+ parser.command(unlockCommand);
45
+ parser.command(validateCommand);
34
46
  await parser.argv;
35
47
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,M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E;KACT,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAEzB,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACpC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACjC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC9C,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnC,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACpC,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACrC,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC/C,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAC7B,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAC7B,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAC9B,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAChC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AAC5B,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACjC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AAC9B,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAEhC,MAAM,MAAM,CAAC,IAAI,CAAC"}
@@ -81,6 +81,9 @@
81
81
  {
82
82
  "additionalProperties": false,
83
83
  "properties": {
84
+ "reportDir": {
85
+ "type": "string"
86
+ },
84
87
  "type": {
85
88
  "const": "HtmlReportEventListener",
86
89
  "type": "string"
@@ -92,6 +95,13 @@
92
95
  {
93
96
  "additionalProperties": false,
94
97
  "properties": {
98
+ "colorize": {
99
+ "type": "boolean"
100
+ },
101
+ "level": {
102
+ "enum": ["debug", "error", "fatal", "info", "silent", "trace", "warn"],
103
+ "type": "string"
104
+ },
95
105
  "type": {
96
106
  "const": "LoggingEventListener",
97
107
  "type": "string"
@@ -149,31 +159,88 @@
149
159
  "type": "object"
150
160
  }
151
161
  ]
152
- },
153
- "transactionOptions": {
154
- "additionalProperties": false,
155
- "properties": {
156
- "yieldModelDiffs": {
157
- "default": false,
158
- "type": "boolean"
162
+ }
163
+ },
164
+ "required": ["stateProvider"],
165
+ "type": "object"
166
+ },
167
+ "tags": {
168
+ "items": {
169
+ "additionalProperties": false,
170
+ "properties": {
171
+ "scope": {
172
+ "additionalProperties": false,
173
+ "properties": {
174
+ "moduleId": {
175
+ "type": "string"
176
+ }
159
177
  },
160
- "yieldModelTransaction": {
161
- "default": false,
162
- "type": "boolean"
178
+ "type": "object"
179
+ },
180
+ "tags": {
181
+ "additionalProperties": {
182
+ "type": "string"
183
+ },
184
+ "type": "object"
185
+ }
186
+ },
187
+ "required": ["tags"],
188
+ "type": "object"
189
+ },
190
+ "type": "array"
191
+ },
192
+ "terraform": {
193
+ "additionalProperties": false,
194
+ "properties": {
195
+ "providers": {
196
+ "items": {
197
+ "additionalProperties": false,
198
+ "properties": {
199
+ "accountId": {
200
+ "type": "string"
201
+ },
202
+ "accountName": {
203
+ "type": "string"
204
+ },
205
+ "providerType": {
206
+ "type": "string"
207
+ },
208
+ "regionId": {
209
+ "type": "string"
210
+ },
211
+ "setRegionAttribute": {
212
+ "type": "boolean"
213
+ },
214
+ "spec": {
215
+ "type": "object"
216
+ }
163
217
  },
164
- "yieldResourceDiffs": {
165
- "default": false,
166
- "type": "boolean"
218
+ "required": ["accountId", "providerType", "regionId"],
219
+ "type": "object"
220
+ },
221
+ "type": "array"
222
+ },
223
+ "requiredProviders": {
224
+ "additionalProperties": {
225
+ "additionalProperties": false,
226
+ "properties": {
227
+ "minVersion": {
228
+ "type": "string"
229
+ },
230
+ "source": {
231
+ "type": "string"
232
+ }
167
233
  },
168
- "yieldResourceTransaction": {
169
- "default": false,
170
- "type": "boolean"
171
- }
234
+ "required": ["source"],
235
+ "type": "object"
172
236
  },
173
237
  "type": "object"
238
+ },
239
+ "requiredVersion": {
240
+ "type": "string"
174
241
  }
175
242
  },
176
- "required": ["stateProvider"],
243
+ "required": ["providers", "requiredProviders", "requiredVersion"],
177
244
  "type": "object"
178
245
  },
179
246
  "version": {
@@ -181,7 +248,7 @@
181
248
  "type": "number"
182
249
  }
183
250
  },
184
- "required": ["imports", "modules", "settings", "version"],
251
+ "required": ["imports", "modules", "settings", "terraform", "version"],
185
252
  "title": "Octo V1 Definition Schema",
186
253
  "type": "object"
187
254
  }
@@ -1,10 +1,34 @@
1
- import { type Constructable, LocalEncryptionStateProvider, LocalStateProvider, TestStateProvider } from '@quadnix/octo';
1
+ import { type Constructable, LocalEncryptionStateProvider, LocalStateProvider, type Octo, TestStateProvider } from '@quadnix/octo';
2
2
  import type { HtmlReportEventListener } from '@quadnix/octo-event-listeners/html-report';
3
3
  import type { LoggingEventListener } from '@quadnix/octo-event-listeners/logging';
4
+ /**
5
+ * Reads `octo.yml` and turns each section into the values {@link Octo} is booted with.
6
+ */
4
7
  export declare class YamlDefinitionUtility {
5
8
  private readonly definition;
9
+ /**
10
+ * The directory holding the definition file. Everything the definition names by relative path is
11
+ * resolved against this, not against `process.cwd()`: `octo run-action` is invoked by terraform
12
+ * from inside a terragrunt cache directory, so the cwd there is neither the project nor stable.
13
+ */
14
+ private readonly definitionDir;
15
+ /**
16
+ * @param definitionFilePath Path to the definition file.
17
+ * @throws If the file is unreadable, or fails schema validation.
18
+ */
6
19
  constructor(definitionFilePath: string);
20
+ /**
21
+ * Substitutes `${env.KEY}` references in a value with what the definition's `env` block declares.
22
+ *
23
+ * Arrays and objects are walked, because a module input is as nested as its schema: a reference
24
+ * can sit inside a list of images, or a key of an object, as readily as at the top level.
25
+ *
26
+ * @throws If a value holds one of its own ancestors, which no substitution over it terminates on.
27
+ */
7
28
  resolveEnvironmentValue<T>(value: unknown): T;
29
+ /**
30
+ * Imports the hook callbacks the definition names, in the shape {@link Octo.registerHooks} takes.
31
+ */
8
32
  resolveHooks(): Promise<{
9
33
  postCommitHooks?: {
10
34
  handle: any;
@@ -29,19 +53,35 @@ export declare class YamlDefinitionUtility {
29
53
  handle: any;
30
54
  }[];
31
55
  }>;
56
+ /**
57
+ * Imports every module class the definition's `imports` block names.
58
+ */
32
59
  resolveImports(): Promise<{
33
60
  className: Constructable<any>;
34
61
  }[]>;
35
- resolveListeners(): Promise<{
62
+ /**
63
+ * @param logDestination Where the logging listener writes. `run-action` passes `stderr`, because
64
+ * terraform's `data "external"` protocol requires that command's stdout to carry only the response
65
+ * JSON.
66
+ */
67
+ resolveListeners({ logDestination }?: {
68
+ logDestination?: 'stderr' | 'stdout';
69
+ }): Promise<{
36
70
  args?: unknown[];
37
71
  metadata?: Record<string, string>;
38
72
  type: Constructable<HtmlReportEventListener | LoggingEventListener>;
39
73
  }[]>;
74
+ /**
75
+ * Pairs each `modules` entry with its imported class, and resolves its inputs.
76
+ */
40
77
  resolveModules(imports: Awaited<ReturnType<YamlDefinitionUtility['resolveImports']>>): {
41
78
  moduleClass: Constructable<any>;
42
79
  moduleId: string;
43
80
  moduleInputs: Record<string, unknown>;
44
81
  }[];
82
+ /**
83
+ * Builds the {@link IStateProvider} the definition asks for.
84
+ */
45
85
  resolveStateProvider(): {
46
86
  type: LocalEncryptionStateProvider;
47
87
  } | {
@@ -49,14 +89,62 @@ export declare class YamlDefinitionUtility {
49
89
  } | {
50
90
  type: TestStateProvider;
51
91
  };
52
- resolveTransactionOptions(): {
53
- appLockId: string | undefined;
54
- enableResourceCapture: boolean;
55
- enableResourceValidation: boolean;
56
- yieldModelDiffs: boolean;
57
- yieldModelTransaction: boolean;
58
- yieldResourceDiffs: boolean;
59
- yieldResourceTransaction: boolean;
92
+ /**
93
+ * The tag registrations the definition declares, in the shape {@link Octo.registerTags} takes.
94
+ *
95
+ * A `scope` naming a `moduleId` reaches that module's resources; an absent or empty one reaches
96
+ * every resource of the run.
97
+ */
98
+ resolveTags(): Parameters<Octo['registerTags']>[0];
99
+ /**
100
+ * The terraform version, required providers, and provider blocks the definition declares.
101
+ */
102
+ resolveTerraformOptions(): {
103
+ providers: {
104
+ accountId: string;
105
+ accountName: string | undefined;
106
+ providerType: string;
107
+ regionId: string;
108
+ setRegionAttribute: boolean | undefined;
109
+ spec: Record<string, unknown>;
110
+ }[];
111
+ requiredProviders: Record<string, {
112
+ minVersion?: string;
113
+ source: string;
114
+ }>;
115
+ requiredVersion: string;
60
116
  };
117
+ /**
118
+ * Substitutes one `${env.KEY}` reference with what the definition's `env` block declares for that
119
+ * key, read in the kind the block gives it. Anything holding no reference is returned as it came.
120
+ */
121
+ private resolveEnvironmentReference;
122
+ /**
123
+ * Resolves a definition-file import specifier to something `import()` can load.
124
+ *
125
+ * A relative path resolves against the **definition file's own directory**. It cannot resolve
126
+ * against the current working directory: terraform invokes `octo run-action` from inside a
127
+ * terragrunt cache directory, so a definition saying `./dist/index.js` - which is what every
128
+ * generated app says - would be looked for under the cache and never found.
129
+ *
130
+ * A bare specifier resolves against the **user's project root**, not octo-build's own install
131
+ * directory - node would otherwise resolve it from wherever octo-build happens to live. A flat
132
+ * `node_modules` hides that; a linked store does not, and there the user's own dependencies are
133
+ * invisible.
134
+ */
135
+ private resolveImportPath;
136
+ /**
137
+ * Walks a value, substituting every `${env.KEY}` reference it holds at any depth.
138
+ *
139
+ * `ancestors` is the chain currently being walked rather than everything already seen. A YAML
140
+ * anchor used in two places points one node at two parents, which resolves twice and is no cycle;
141
+ * a node reappearing beneath itself is one, and walking it never ends.
142
+ *
143
+ * @throws If a value holds one of its own ancestors.
144
+ */
145
+ private resolveNestedEnvironmentValue;
146
+ /**
147
+ * Checks the definition against `octo-v1.schema.json`.
148
+ */
61
149
  private validateDefinition;
62
150
  }