@quadnix/octo 0.0.30 → 0.2.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 (383) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +117 -8
  3. package/dist/app.type.d.ts +277 -19
  4. package/dist/app.type.js +80 -9
  5. package/dist/app.type.js.map +1 -1
  6. package/dist/decorators/action.decorator.d.ts +10 -6
  7. package/dist/decorators/action.decorator.js +19 -6
  8. package/dist/decorators/action.decorator.js.map +1 -1
  9. package/dist/decorators/anchor.decorator.d.ts +12 -5
  10. package/dist/decorators/anchor.decorator.js +12 -5
  11. package/dist/decorators/anchor.decorator.js.map +1 -1
  12. package/dist/decorators/enable-hook.decorator.d.ts +1 -1
  13. package/dist/decorators/enable-hook.decorator.js +1 -1
  14. package/dist/decorators/factory.decorator.d.ts +18 -34
  15. package/dist/decorators/factory.decorator.js +18 -34
  16. package/dist/decorators/factory.decorator.js.map +1 -1
  17. package/dist/decorators/model.decorator.d.ts +4 -6
  18. package/dist/decorators/model.decorator.js +2 -7
  19. package/dist/decorators/model.decorator.js.map +1 -1
  20. package/dist/decorators/module.decorator.d.ts +16 -10
  21. package/dist/decorators/module.decorator.js +16 -10
  22. package/dist/decorators/module.decorator.js.map +1 -1
  23. package/dist/decorators/on-event.decorator.d.ts +7 -2
  24. package/dist/decorators/on-event.decorator.js +5 -0
  25. package/dist/decorators/on-event.decorator.js.map +1 -1
  26. package/dist/decorators/resource.decorator.d.ts +50 -1
  27. package/dist/decorators/resource.decorator.js +38 -1
  28. package/dist/decorators/resource.decorator.js.map +1 -1
  29. package/dist/decorators/validate.decorator.d.ts +15 -1
  30. package/dist/decorators/validate.decorator.js +15 -1
  31. package/dist/decorators/validate.decorator.js.map +1 -1
  32. package/dist/errors/container.error.d.ts +18 -0
  33. package/dist/errors/container.error.js +18 -0
  34. package/dist/errors/container.error.js.map +1 -1
  35. package/dist/errors/index.d.ts +1 -0
  36. package/dist/errors/index.js +1 -0
  37. package/dist/errors/index.js.map +1 -1
  38. package/dist/errors/module.error.d.ts +6 -0
  39. package/dist/errors/module.error.js +6 -0
  40. package/dist/errors/module.error.js.map +1 -1
  41. package/dist/errors/node.error.d.ts +56 -0
  42. package/dist/errors/node.error.js +56 -0
  43. package/dist/errors/node.error.js.map +1 -1
  44. package/dist/errors/schema.error.d.ts +14 -1
  45. package/dist/errors/schema.error.js +11 -1
  46. package/dist/errors/schema.error.js.map +1 -1
  47. package/dist/errors/terraform.error.d.ts +20 -0
  48. package/dist/errors/terraform.error.js +24 -0
  49. package/dist/errors/terraform.error.js.map +1 -0
  50. package/dist/errors/transaction.error.d.ts +93 -2
  51. package/dist/errors/transaction.error.js +83 -0
  52. package/dist/errors/transaction.error.js.map +1 -1
  53. package/dist/events/action.event.d.ts +8 -4
  54. package/dist/events/action.event.js +2 -4
  55. package/dist/events/action.event.js.map +1 -1
  56. package/dist/events/command.event.d.ts +43 -0
  57. package/dist/events/command.event.js +33 -0
  58. package/dist/events/command.event.js.map +1 -0
  59. package/dist/events/event.model.d.ts +26 -8
  60. package/dist/events/event.model.js +15 -7
  61. package/dist/events/event.model.js.map +1 -1
  62. package/dist/events/hook/commit.hook.event.d.ts +1 -7
  63. package/dist/events/hook/commit.hook.event.js +0 -6
  64. package/dist/events/hook/commit.hook.event.js.map +1 -1
  65. package/dist/events/hook/hook.event.d.ts +1 -3
  66. package/dist/events/hook/hook.event.js +0 -2
  67. package/dist/events/hook/hook.event.js.map +1 -1
  68. package/dist/events/hook/model.hook.event.d.ts +1 -7
  69. package/dist/events/hook/model.hook.event.js +0 -6
  70. package/dist/events/hook/model.hook.event.js.map +1 -1
  71. package/dist/events/hook/resource.hook.event.d.ts +1 -7
  72. package/dist/events/hook/resource.hook.event.js +0 -6
  73. package/dist/events/hook/resource.hook.event.js.map +1 -1
  74. package/dist/events/index.d.ts +5 -0
  75. package/dist/events/index.js +5 -0
  76. package/dist/events/index.js.map +1 -1
  77. package/dist/events/mode-result.event.d.ts +57 -0
  78. package/dist/events/mode-result.event.js +24 -0
  79. package/dist/events/mode-result.event.js.map +1 -0
  80. package/dist/events/mode.event.d.ts +61 -0
  81. package/dist/events/mode.event.js +32 -0
  82. package/dist/events/mode.event.js.map +1 -0
  83. package/dist/events/module.event.d.ts +7 -5
  84. package/dist/events/module.event.js +3 -4
  85. package/dist/events/module.event.js.map +1 -1
  86. package/dist/events/registration.event.d.ts +19 -15
  87. package/dist/events/registration.event.js +18 -14
  88. package/dist/events/registration.event.js.map +1 -1
  89. package/dist/events/serialization.event.d.ts +16 -13
  90. package/dist/events/serialization.event.js +15 -12
  91. package/dist/events/serialization.event.js.map +1 -1
  92. package/dist/events/state.event.d.ts +102 -0
  93. package/dist/events/state.event.js +69 -0
  94. package/dist/events/state.event.js.map +1 -0
  95. package/dist/events/terraform.event.d.ts +78 -0
  96. package/dist/events/terraform.event.js +55 -0
  97. package/dist/events/terraform.event.js.map +1 -0
  98. package/dist/events/transaction.event.d.ts +3 -40
  99. package/dist/events/transaction.event.js +1 -29
  100. package/dist/events/transaction.event.js.map +1 -1
  101. package/dist/functions/container/container.d.ts +54 -13
  102. package/dist/functions/container/container.js +64 -19
  103. package/dist/functions/container/container.js.map +1 -1
  104. package/dist/functions/container/test-container.d.ts +43 -29
  105. package/dist/functions/container/test-container.js +71 -43
  106. package/dist/functions/container/test-container.js.map +1 -1
  107. package/dist/functions/dependency/dependency.d.ts +84 -23
  108. package/dist/functions/dependency/dependency.js +84 -14
  109. package/dist/functions/dependency/dependency.js.map +1 -1
  110. package/dist/functions/diff/aggregate-resource-actions.d.ts +19 -0
  111. package/dist/functions/diff/aggregate-resource-actions.js +41 -0
  112. package/dist/functions/diff/aggregate-resource-actions.js.map +1 -0
  113. package/dist/functions/diff/diff-metadata.d.ts +21 -3
  114. package/dist/functions/diff/diff-metadata.js +18 -0
  115. package/dist/functions/diff/diff-metadata.js.map +1 -1
  116. package/dist/functions/diff/diff.d.ts +68 -7
  117. package/dist/functions/diff/diff.js +44 -3
  118. package/dist/functions/diff/diff.js.map +1 -1
  119. package/dist/functions/hook/commit.hook.d.ts +16 -1
  120. package/dist/functions/hook/commit.hook.js +21 -6
  121. package/dist/functions/hook/commit.hook.js.map +1 -1
  122. package/dist/functions/hook/model-action.hook.d.ts +16 -1
  123. package/dist/functions/hook/model-action.hook.js +21 -6
  124. package/dist/functions/hook/model-action.hook.js.map +1 -1
  125. package/dist/functions/hook/resource-action.hook.d.ts +16 -1
  126. package/dist/functions/hook/resource-action.hook.js +21 -6
  127. package/dist/functions/hook/resource-action.hook.js.map +1 -1
  128. package/dist/functions/node/node-action.abstract.d.ts +23 -2
  129. package/dist/functions/node/node-action.abstract.js +22 -8
  130. package/dist/functions/node/node-action.abstract.js.map +1 -1
  131. package/dist/functions/node/node.abstract.d.ts +56 -5
  132. package/dist/functions/node/node.abstract.js +106 -22
  133. package/dist/functions/node/node.abstract.js.map +1 -1
  134. package/dist/functions/node/node.interface.d.ts +3 -1
  135. package/dist/functions/schema/schema.d.ts +7 -0
  136. package/dist/functions/schema/schema.js +10 -1
  137. package/dist/functions/schema/schema.js.map +1 -1
  138. package/dist/index.d.ts +12 -6
  139. package/dist/index.js +9 -4
  140. package/dist/index.js.map +1 -1
  141. package/dist/index.type.d.ts +5 -0
  142. package/dist/index.type.js +2 -0
  143. package/dist/index.type.js.map +1 -0
  144. package/dist/main.d.ts +245 -14
  145. package/dist/main.js +377 -72
  146. package/dist/main.js.map +1 -1
  147. package/dist/models/account/account.model.d.ts +43 -7
  148. package/dist/models/account/account.model.js +56 -8
  149. package/dist/models/account/account.model.js.map +1 -1
  150. package/dist/models/account/account.schema.d.ts +13 -1
  151. package/dist/models/account/account.schema.js +12 -0
  152. package/dist/models/account/account.schema.js.map +1 -1
  153. package/dist/models/app/app.model.d.ts +13 -8
  154. package/dist/models/app/app.model.js +17 -32
  155. package/dist/models/app/app.model.js.map +1 -1
  156. package/dist/models/app/app.schema.d.ts +6 -0
  157. package/dist/models/app/app.schema.js +6 -0
  158. package/dist/models/app/app.schema.js.map +1 -1
  159. package/dist/models/deployment/deployment.model.d.ts +13 -1
  160. package/dist/models/deployment/deployment.model.js +16 -4
  161. package/dist/models/deployment/deployment.model.js.map +1 -1
  162. package/dist/models/deployment/deployment.schema.d.ts +6 -0
  163. package/dist/models/deployment/deployment.schema.js +6 -0
  164. package/dist/models/deployment/deployment.schema.js.map +1 -1
  165. package/dist/models/environment/environment.model.d.ts +15 -3
  166. package/dist/models/environment/environment.model.js +22 -10
  167. package/dist/models/environment/environment.model.js.map +1 -1
  168. package/dist/models/environment/environment.schema.d.ts +2 -0
  169. package/dist/models/environment/environment.schema.js +2 -0
  170. package/dist/models/environment/environment.schema.js.map +1 -1
  171. package/dist/models/execution/execution.model.d.ts +21 -3
  172. package/dist/models/execution/execution.model.js +47 -29
  173. package/dist/models/execution/execution.model.js.map +1 -1
  174. package/dist/models/execution/execution.schema.d.ts +11 -0
  175. package/dist/models/execution/execution.schema.js +11 -0
  176. package/dist/models/execution/execution.schema.js.map +1 -1
  177. package/dist/models/filesystem/filesystem.model.d.ts +27 -1
  178. package/dist/models/filesystem/filesystem.model.js +30 -4
  179. package/dist/models/filesystem/filesystem.model.js.map +1 -1
  180. package/dist/models/filesystem/filesystem.schema.d.ts +5 -0
  181. package/dist/models/filesystem/filesystem.schema.js +5 -0
  182. package/dist/models/filesystem/filesystem.schema.js.map +1 -1
  183. package/dist/models/image/image.model.d.ts +19 -5
  184. package/dist/models/image/image.model.js +25 -11
  185. package/dist/models/image/image.model.js.map +1 -1
  186. package/dist/models/image/image.schema.d.ts +8 -0
  187. package/dist/models/image/image.schema.js +8 -0
  188. package/dist/models/image/image.schema.js.map +1 -1
  189. package/dist/models/model-action.interface.d.ts +17 -4
  190. package/dist/models/model.abstract.d.ts +96 -1
  191. package/dist/models/model.abstract.js +107 -8
  192. package/dist/models/model.abstract.js.map +1 -1
  193. package/dist/models/model.interface.d.ts +3 -0
  194. package/dist/models/pipeline/pipeline.model.d.ts +14 -2
  195. package/dist/models/pipeline/pipeline.model.js +19 -7
  196. package/dist/models/pipeline/pipeline.model.js.map +1 -1
  197. package/dist/models/pipeline/pipeline.schema.d.ts +8 -0
  198. package/dist/models/pipeline/pipeline.schema.js +8 -0
  199. package/dist/models/pipeline/pipeline.schema.js.map +1 -1
  200. package/dist/models/region/region.model.d.ts +16 -1
  201. package/dist/models/region/region.model.js +19 -4
  202. package/dist/models/region/region.model.js.map +1 -1
  203. package/dist/models/region/region.schema.d.ts +6 -0
  204. package/dist/models/region/region.schema.js +6 -0
  205. package/dist/models/region/region.schema.js.map +1 -1
  206. package/dist/models/server/server.model.d.ts +15 -3
  207. package/dist/models/server/server.model.js +18 -6
  208. package/dist/models/server/server.model.js.map +1 -1
  209. package/dist/models/server/server.schema.d.ts +3 -1
  210. package/dist/models/server/server.schema.js +3 -1
  211. package/dist/models/server/server.schema.js.map +1 -1
  212. package/dist/models/service/service.model.d.ts +37 -6
  213. package/dist/models/service/service.model.js +65 -11
  214. package/dist/models/service/service.model.js.map +1 -1
  215. package/dist/models/service/service.schema.d.ts +48 -1
  216. package/dist/models/service/service.schema.js +56 -1
  217. package/dist/models/service/service.schema.js.map +1 -1
  218. package/dist/models/subnet/subnet.model.d.ts +27 -3
  219. package/dist/models/subnet/subnet.model.js +40 -16
  220. package/dist/models/subnet/subnet.model.js.map +1 -1
  221. package/dist/models/subnet/subnet.schema.d.ts +9 -0
  222. package/dist/models/subnet/subnet.schema.js +9 -0
  223. package/dist/models/subnet/subnet.schema.js.map +1 -1
  224. package/dist/modes/apply-transaction.d.ts +23 -0
  225. package/dist/modes/apply-transaction.js +25 -0
  226. package/dist/modes/apply-transaction.js.map +1 -0
  227. package/dist/modes/commit.mode.d.ts +54 -0
  228. package/dist/modes/commit.mode.js +235 -0
  229. package/dist/modes/commit.mode.js.map +1 -0
  230. package/dist/modes/generate.mode.d.ts +30 -0
  231. package/dist/modes/generate.mode.js +50 -0
  232. package/dist/modes/generate.mode.js.map +1 -0
  233. package/dist/modes/run-action.mode.d.ts +30 -0
  234. package/dist/modes/run-action.mode.js +140 -0
  235. package/dist/modes/run-action.mode.js.map +1 -0
  236. package/dist/modes/validate.mode.d.ts +186 -0
  237. package/dist/modes/validate.mode.js +558 -0
  238. package/dist/modes/validate.mode.js.map +1 -0
  239. package/dist/modules/module.abstract.d.ts +51 -0
  240. package/dist/modules/module.abstract.js +36 -0
  241. package/dist/modules/module.abstract.js.map +1 -1
  242. package/dist/modules/module.container.d.ts +43 -1
  243. package/dist/modules/module.container.js +77 -5
  244. package/dist/modules/module.container.js.map +1 -1
  245. package/dist/modules/test-module.container.d.ts +139 -25
  246. package/dist/modules/test-module.container.js +383 -199
  247. package/dist/modules/test-module.container.js.map +1 -1
  248. package/dist/overlays/anchor.abstract.d.ts +32 -1
  249. package/dist/overlays/anchor.abstract.js +42 -11
  250. package/dist/overlays/anchor.abstract.js.map +1 -1
  251. package/dist/overlays/anchor.schema.d.ts +21 -0
  252. package/dist/overlays/anchor.schema.js +21 -0
  253. package/dist/overlays/anchor.schema.js.map +1 -1
  254. package/dist/overlays/overlay-data.repository.d.ts +18 -0
  255. package/dist/overlays/overlay-data.repository.js +18 -0
  256. package/dist/overlays/overlay-data.repository.js.map +1 -1
  257. package/dist/overlays/overlay.abstract.d.ts +56 -1
  258. package/dist/overlays/overlay.abstract.js +79 -20
  259. package/dist/overlays/overlay.abstract.js.map +1 -1
  260. package/dist/overlays/overlay.schema.d.ts +20 -0
  261. package/dist/overlays/overlay.schema.js +20 -0
  262. package/dist/overlays/overlay.schema.js.map +1 -1
  263. package/dist/resources/resource-action.interface.d.ts +29 -3
  264. package/dist/resources/resource-data.repository.d.ts +63 -1
  265. package/dist/resources/resource-data.repository.js +94 -4
  266. package/dist/resources/resource-data.repository.js.map +1 -1
  267. package/dist/resources/resource.abstract.d.ts +163 -6
  268. package/dist/resources/resource.abstract.js +223 -59
  269. package/dist/resources/resource.abstract.js.map +1 -1
  270. package/dist/resources/resource.interface.d.ts +0 -2
  271. package/dist/resources/resource.schema.d.ts +39 -1
  272. package/dist/resources/resource.schema.js +38 -0
  273. package/dist/resources/resource.schema.js.map +1 -1
  274. package/dist/resources/terraform-resource.abstract.d.ts +44 -0
  275. package/dist/resources/terraform-resource.abstract.js +45 -0
  276. package/dist/resources/terraform-resource.abstract.js.map +1 -0
  277. package/dist/services/event/event.service.d.ts +32 -5
  278. package/dist/services/event/event.service.js +58 -16
  279. package/dist/services/event/event.service.js.map +1 -1
  280. package/dist/services/input/input.service.d.ts +82 -5
  281. package/dist/services/input/input.service.js +143 -12
  282. package/dist/services/input/input.service.js.map +1 -1
  283. package/dist/services/schema-translation/schema-translation.service.d.ts +9 -0
  284. package/dist/services/schema-translation/schema-translation.service.js +9 -0
  285. package/dist/services/schema-translation/schema-translation.service.js.map +1 -1
  286. package/dist/services/serialization/model/model-serialization.service.d.ts +25 -3
  287. package/dist/services/serialization/model/model-serialization.service.js +113 -62
  288. package/dist/services/serialization/model/model-serialization.service.js.map +1 -1
  289. package/dist/services/serialization/resource/resource-serialization.service.d.ts +36 -6
  290. package/dist/services/serialization/resource/resource-serialization.service.js +77 -28
  291. package/dist/services/serialization/resource/resource-serialization.service.js.map +1 -1
  292. package/dist/services/state-management/local.state-provider.d.ts +67 -4
  293. package/dist/services/state-management/local.state-provider.js +168 -41
  294. package/dist/services/state-management/local.state-provider.js.map +1 -1
  295. package/dist/services/state-management/remote.state-provider.d.ts +216 -0
  296. package/dist/services/state-management/remote.state-provider.js +645 -0
  297. package/dist/services/state-management/remote.state-provider.js.map +1 -0
  298. package/dist/services/state-management/state-management.service.d.ts +195 -17
  299. package/dist/services/state-management/state-management.service.js +259 -10
  300. package/dist/services/state-management/state-management.service.js.map +1 -1
  301. package/dist/services/state-management/state-provider.interface.d.ts +98 -3
  302. package/dist/services/state-management/state-provider.interface.js +14 -1
  303. package/dist/services/state-management/state-provider.interface.js.map +1 -1
  304. package/dist/services/state-management/terraform-state.service.d.ts +99 -0
  305. package/dist/services/state-management/terraform-state.service.js +197 -0
  306. package/dist/services/state-management/terraform-state.service.js.map +1 -0
  307. package/dist/services/state-management/test.state-provider.d.ts +42 -4
  308. package/dist/services/state-management/test.state-provider.js +77 -25
  309. package/dist/services/state-management/test.state-provider.js.map +1 -1
  310. package/dist/services/terraform/terraform.service.d.ts +480 -0
  311. package/dist/services/terraform/terraform.service.js +1082 -0
  312. package/dist/services/terraform/terraform.service.js.map +1 -0
  313. package/dist/services/terraform/terraform.type.d.ts +387 -0
  314. package/dist/services/terraform/terraform.type.js +579 -0
  315. package/dist/services/terraform/terraform.type.js.map +1 -0
  316. package/dist/services/transaction/transaction.service.d.ts +110 -10
  317. package/dist/services/transaction/transaction.service.js +570 -251
  318. package/dist/services/transaction/transaction.service.js.map +1 -1
  319. package/dist/services/validation/validation.service.d.ts +15 -3
  320. package/dist/services/validation/validation.service.js +12 -0
  321. package/dist/services/validation/validation.service.js.map +1 -1
  322. package/dist/utilities/array/array.utility.d.ts +3 -0
  323. package/dist/utilities/array/array.utility.js +3 -0
  324. package/dist/utilities/array/array.utility.js.map +1 -1
  325. package/dist/{functions → utilities}/diff/diff.utility.d.ts +19 -3
  326. package/dist/{functions → utilities}/diff/diff.utility.js +57 -41
  327. package/dist/utilities/diff/diff.utility.js.map +1 -0
  328. package/dist/utilities/file/file.utility.d.ts +16 -2
  329. package/dist/utilities/file/file.utility.js +23 -61
  330. package/dist/utilities/file/file.utility.js.map +1 -1
  331. package/dist/utilities/hcl/hcl.utility.d.ts +128 -0
  332. package/dist/utilities/hcl/hcl.utility.js +402 -0
  333. package/dist/utilities/hcl/hcl.utility.js.map +1 -0
  334. package/dist/utilities/http/http.utility.d.ts +57 -0
  335. package/dist/utilities/http/http.utility.js +98 -0
  336. package/dist/utilities/http/http.utility.js.map +1 -0
  337. package/dist/utilities/node/node.utility.d.ts +3 -0
  338. package/dist/utilities/node/node.utility.js +3 -0
  339. package/dist/utilities/node/node.utility.js.map +1 -1
  340. package/dist/utilities/object/object.utility.d.ts +12 -0
  341. package/dist/utilities/object/object.utility.js +12 -0
  342. package/dist/utilities/object/object.utility.js.map +1 -1
  343. package/dist/utilities/project/project.utility.d.ts +28 -0
  344. package/dist/utilities/project/project.utility.js +35 -0
  345. package/dist/utilities/project/project.utility.js.map +1 -0
  346. package/dist/utilities/string/string.utility.d.ts +41 -0
  347. package/dist/utilities/string/string.utility.js +65 -0
  348. package/dist/utilities/string/string.utility.js.map +1 -0
  349. package/dist/utilities/terraform/terraform.utility.d.ts +276 -0
  350. package/dist/utilities/terraform/terraform.utility.js +623 -0
  351. package/dist/utilities/terraform/terraform.utility.js.map +1 -0
  352. package/dist/utilities/test-helpers/test-classes.d.ts +36 -30
  353. package/dist/utilities/test-helpers/test-classes.js +38 -39
  354. package/dist/utilities/test-helpers/test-classes.js.map +1 -1
  355. package/dist/utilities/test-helpers/test-models.d.ts +8 -1
  356. package/dist/utilities/test-helpers/test-models.js +37 -12
  357. package/dist/utilities/test-helpers/test-models.js.map +1 -1
  358. package/dist/utilities/test-helpers/test-modes.d.ts +315 -0
  359. package/dist/utilities/test-helpers/test-modes.js +486 -0
  360. package/dist/utilities/test-helpers/test-modes.js.map +1 -0
  361. package/dist/utilities/test-helpers/test-modules.d.ts +47 -0
  362. package/dist/utilities/test-helpers/test-modules.js +85 -0
  363. package/dist/utilities/test-helpers/test-modules.js.map +1 -0
  364. package/dist/utilities/test-helpers/test-overlays.d.ts +20 -2
  365. package/dist/utilities/test-helpers/test-overlays.js +56 -6
  366. package/dist/utilities/test-helpers/test-overlays.js.map +1 -1
  367. package/dist/utilities/test-helpers/test-resources.d.ts +23 -3
  368. package/dist/utilities/test-helpers/test-resources.js +83 -23
  369. package/dist/utilities/test-helpers/test-resources.js.map +1 -1
  370. package/dist/utilities/validation/validation.utility.d.ts +24 -0
  371. package/dist/utilities/validation/validation.utility.js +24 -0
  372. package/dist/utilities/validation/validation.utility.js.map +1 -1
  373. package/package.json +12 -6
  374. package/dist/functions/diff/diff.utility.js.map +0 -1
  375. package/dist/services/capture/capture.service.d.ts +0 -19
  376. package/dist/services/capture/capture.service.js +0 -43
  377. package/dist/services/capture/capture.service.js.map +0 -1
  378. package/dist/services/state-management/local-encryption.state-provider.d.ts +0 -20
  379. package/dist/services/state-management/local-encryption.state-provider.js +0 -90
  380. package/dist/services/state-management/local-encryption.state-provider.js.map +0 -1
  381. package/dist/utilities/cidr/cidr.utility.d.ts +0 -10
  382. package/dist/utilities/cidr/cidr.utility.js +0 -51
  383. package/dist/utilities/cidr/cidr.utility.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"region.model.js","sourceRoot":"","sources":["../../../src/models/region/region.model.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;;GAaG;AAEI,IAAM,MAAM,cAAZ,MAAM,MAAO,SAAQ,MAA4B;IAGtD,YAAY,QAAgB;QAC1B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,WAAwB;QACrC,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC;YAAE,oBAAoB,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QAEnF,wBAAwB;QACxB,MAAM,YAAY,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAA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AAI,UAAU,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACM,UAAU;QACjB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CAAC,GAAI,IAAI,CAAC,WAA6B,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/G,CAAC;IAED;;OAEG;IACM,KAAK;QACZ,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;IACJ,CAAC;CACF,CAAA;AAxFY,MAAM;IADlB,KAAK,CAAS,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC;;GAClC,MAAM,CAwFlB"}
@@ -1,6 +1,12 @@
1
1
  /**
2
+ * Schema of the {@link Region} model.
3
+ *
2
4
  * @group Models/Region
3
5
  */
4
6
  export declare class RegionSchema {
7
+ /**
8
+ * The ID of the region, unique within its {@link Account}.
9
+ * It is not required to be the cloud provider's region name - a module maps it to one.
10
+ */
5
11
  regionId: string;
6
12
  }
@@ -10,10 +10,16 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { Validate } from '../../decorators/validate.decorator.js';
11
11
  import { Schema } from '../../functions/schema/schema.js';
12
12
  /**
13
+ * Schema of the {@link Region} model.
14
+ *
13
15
  * @group Models/Region
14
16
  */
15
17
  export class RegionSchema {
16
18
  constructor() {
19
+ /**
20
+ * The ID of the region, unique within its {@link Account}.
21
+ * It is not required to be the cloud provider's region name - a module maps it to one.
22
+ */
17
23
  this.regionId = Schema();
18
24
  }
19
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"region.schema.js","sourceRoot":"","sources":["../../../src/models/region/region.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QAEE,aAAQ,GAAG,MAAM,EAAU,CAAC;IAC9B,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,CAAC;;8CACjE"}
1
+ {"version":3,"file":"region.schema.js","sourceRoot":"","sources":["../../../src/models/region/region.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAAzB;QACE;;;WAGG;QAEH,aAAQ,GAAG,MAAM,EAAU,CAAC;IAC9B,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,CAAC;;8CACjE"}
@@ -3,8 +3,8 @@ import { Deployment } from '../deployment/deployment.model.js';
3
3
  import { AModel } from '../model.abstract.js';
4
4
  import { ServerSchema } from './server.schema.js';
5
5
  /**
6
- * A Server model is a representation of the logical microservice.
7
- * E.g. frontend, backend, database, payment-service, etc.
6
+ * A Server model is a representation of one logical service.
7
+ * E.g. website, backend, database, payment-service, etc.
8
8
  *
9
9
  * @example
10
10
  * ```ts
@@ -17,12 +17,24 @@ import { ServerSchema } from './server.schema.js';
17
17
  */
18
18
  export declare class Server extends AModel<ServerSchema, Server> {
19
19
  readonly serverKey: string;
20
+ /**
21
+ * @param serverKey The name of the server, unique within the app.
22
+ */
20
23
  constructor(serverKey: string);
24
+ /**
25
+ * @internal
26
+ */
27
+ static unSynth(server: ServerSchema, deReferenceContext: (context: string) => Promise<UnknownModel>): Promise<Server>;
21
28
  /**
22
29
  * To add a {@link Deployment}.
23
30
  */
24
31
  addDeployment(deployment: Deployment): void;
32
+ /**
33
+ * @internal
34
+ */
25
35
  setContext(): string | undefined;
36
+ /**
37
+ * @internal
38
+ */
26
39
  synth(): ServerSchema;
27
- static unSynth(server: ServerSchema, deReferenceContext: (context: string) => Promise<UnknownModel>): Promise<Server>;
28
40
  }
@@ -15,8 +15,8 @@ import { Deployment } from '../deployment/deployment.model.js';
15
15
  import { AModel } from '../model.abstract.js';
16
16
  import { ServerSchema } from './server.schema.js';
17
17
  /**
18
- * A Server model is a representation of the logical microservice.
19
- * E.g. frontend, backend, database, payment-service, etc.
18
+ * A Server model is a representation of one logical service.
19
+ * E.g. website, backend, database, payment-service, etc.
20
20
  *
21
21
  * @example
22
22
  * ```ts
@@ -28,10 +28,20 @@ import { ServerSchema } from './server.schema.js';
28
28
  * @see Definition of [Default Models](/docs/fundamentals/models#default-models).
29
29
  */
30
30
  let Server = Server_1 = class Server extends AModel {
31
+ /**
32
+ * @param serverKey The name of the server, unique within the app.
33
+ */
31
34
  constructor(serverKey) {
32
35
  super();
33
36
  this.serverKey = serverKey;
34
37
  }
38
+ /**
39
+ * @internal
40
+ */
41
+ static async unSynth(server, deReferenceContext) {
42
+ assert(!!deReferenceContext);
43
+ return new Server_1(server.serverKey);
44
+ }
35
45
  /**
36
46
  * To add a {@link Deployment}.
37
47
  */
@@ -46,6 +56,9 @@ let Server = Server_1 = class Server extends AModel {
46
56
  }
47
57
  this.addChild('serverKey', deployment, 'deploymentTag');
48
58
  }
59
+ /**
60
+ * @internal
61
+ */
49
62
  setContext() {
50
63
  const parents = this.getParents();
51
64
  const app = parents['app']?.[0]?.to;
@@ -54,15 +67,14 @@ let Server = Server_1 = class Server extends AModel {
54
67
  }
55
68
  return [`${this.constructor.NODE_NAME}=${this.serverKey}`, app.getContext()].join(',');
56
69
  }
70
+ /**
71
+ * @internal
72
+ */
57
73
  synth() {
58
74
  return {
59
75
  serverKey: this.serverKey,
60
76
  };
61
77
  }
62
- static async unSynth(server, deReferenceContext) {
63
- assert(!!deReferenceContext);
64
- return new Server_1(server.serverKey);
65
- }
66
78
  };
67
79
  Server = Server_1 = __decorate([
68
80
  Model('@octo', 'server', ServerSchema),
@@ -1 +1 @@
1
- {"version":3,"file":"server.model.js","sourceRoot":"","sources":["../../../src/models/server/server.model.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;;;;;;;GAYG;AAEI,IAAM,MAAM,cAAZ,MAAM,MAAO,SAAQ,MAA4B;IAGtD,YAAY,SAAiB;QAC3B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,UAAsB;QAClC,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC5D,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC;YAAE,oBAAoB,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAEjF,wBAAwB;QACxB,MAAM,WAAW,GAAG,oBA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4B,EAAE,IAAI,CAAC,CAAC;QAC3D,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;IAED;;OAEG;IACM,UAAU;QACjB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CAAC,GAAI,IAAI,CAAC,WAA6B,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5G,CAAC;IAED;;OAEG;IACM,KAAK;QACZ,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF,CAAA;AA1DY,MAAM;IADlB,KAAK,CAAS,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC;;GAClC,MAAM,CA0DlB"}
@@ -1,9 +1,11 @@
1
1
  /**
2
+ * Schema of the {@link Server} model.
3
+ *
2
4
  * @group Models/Server
3
5
  */
4
6
  export declare class ServerSchema {
5
7
  /**
6
- * The name of the server.
8
+ * The name of the server, unique within the {@link App}.
7
9
  */
8
10
  serverKey: string;
9
11
  }
@@ -10,12 +10,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { Validate } from '../../decorators/validate.decorator.js';
11
11
  import { Schema } from '../../functions/schema/schema.js';
12
12
  /**
13
+ * Schema of the {@link Server} model.
14
+ *
13
15
  * @group Models/Server
14
16
  */
15
17
  export class ServerSchema {
16
18
  constructor() {
17
19
  /**
18
- * The name of the server.
20
+ * The name of the server, unique within the {@link App}.
19
21
  */
20
22
  this.serverKey = Schema();
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.schema.js","sourceRoot":"","sources":["../../../src/models/server/server.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QACE;;WAEG;QAEH,cAAS,GAAG,MAAM,EAAU,CAAC;IAC/B,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,CAAC;;+CAChE"}
1
+ {"version":3,"file":"server.schema.js","sourceRoot":"","sources":["../../../src/models/server/server.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAAzB;QACE;;WAEG;QAEH,cAAS,GAAG,MAAM,EAAU,CAAC;IAC/B,CAAC;CAAA;AADC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,EAAE,CAAC;;+CAChE"}
@@ -1,13 +1,22 @@
1
+ import type { UnknownModel } from '../../app.type.js';
1
2
  import { AModel } from '../model.abstract.js';
2
- import { ServiceSchema } from './service.schema.js';
3
+ import { ServiceSchema, type ServiceType } from './service.schema.js';
3
4
  /**
4
- * A Service model can be any third-party service that your application relies on.
5
- * What separates them from Server is that Services are hosted and managed outside of your infrastructure.
6
- * An external Redis server on the cloud, or a managed Kafka queue from AWS, are a few examples.
5
+ * A Service model is any piece of infrastructure your application uses that is not compute: a table,
6
+ * a bucket, a load balancer, a CDN. It sits under whichever nodes it belongs to - a region, a subnet,
7
+ * or another service - named when it is built, and carries a `type` and a free-text `label`.
8
+ *
9
+ * `Service` is only useful when extended - a subclass adds the fields the service actually needs,
10
+ * spreads `super.synth()` into its own `synth()`, and rebuilds its parents in `unSynth()`.
7
11
  *
8
12
  * @example
9
13
  * ```ts
10
- * const service = new Service('MyService');
14
+ * @Model<MyQueue>('@example', 'service', MyQueueSchema)
15
+ * export class MyQueue extends Service {
16
+ * constructor(queueName: string, region: Region) {
17
+ * super(`${queueName}-queue`, [region], ServiceType.OTHER, 'sqs');
18
+ * }
19
+ * }
11
20
  * ```
12
21
  *
13
22
  * @group Models/Service
@@ -15,8 +24,30 @@ import { ServiceSchema } from './service.schema.js';
15
24
  * @see Definition of [Default Models](/docs/fundamentals/models#default-models).
16
25
  */
17
26
  export declare class Service extends AModel<ServiceSchema, Service> {
27
+ /**
28
+ * What the service actually is, in free text, e.g. `dynamodb`.
29
+ */
30
+ readonly label: string;
18
31
  readonly serviceId: string;
19
- constructor(serviceId: string);
32
+ /**
33
+ * What kind of thing the service is.
34
+ */
35
+ readonly type: ServiceType;
36
+ private readonly parentCount;
37
+ /**
38
+ * @param serviceId The ID of the service, unique among the services of each of its parents.
39
+ * @param parents The models this service is attached under. They are fixed for its lifetime.
40
+ * @param type What kind of thing the service is.
41
+ * @param label What the service actually is, in free text, e.g. `dynamodb`.
42
+ * @throws {@link ModelError} If no parent is given, or a parent already has a service with this ID.
43
+ */
44
+ constructor(serviceId: string, parents: UnknownModel[], type: ServiceType, label: string);
45
+ /**
46
+ * @internal
47
+ */
20
48
  setContext(): string | undefined;
49
+ /**
50
+ * @internal
51
+ */
21
52
  synth(): ServiceSchema;
22
53
  }
@@ -13,13 +13,21 @@ import { ModelError } from '../../errors/index.js';
13
13
  import { AModel } from '../model.abstract.js';
14
14
  import { ServiceSchema } from './service.schema.js';
15
15
  /**
16
- * A Service model can be any third-party service that your application relies on.
17
- * What separates them from Server is that Services are hosted and managed outside of your infrastructure.
18
- * An external Redis server on the cloud, or a managed Kafka queue from AWS, are a few examples.
16
+ * A Service model is any piece of infrastructure your application uses that is not compute: a table,
17
+ * a bucket, a load balancer, a CDN. It sits under whichever nodes it belongs to - a region, a subnet,
18
+ * or another service - named when it is built, and carries a `type` and a free-text `label`.
19
+ *
20
+ * `Service` is only useful when extended - a subclass adds the fields the service actually needs,
21
+ * spreads `super.synth()` into its own `synth()`, and rebuilds its parents in `unSynth()`.
19
22
  *
20
23
  * @example
21
24
  * ```ts
22
- * const service = new Service('MyService');
25
+ * @Model<MyQueue>('@example', 'service', MyQueueSchema)
26
+ * export class MyQueue extends Service {
27
+ * constructor(queueName: string, region: Region) {
28
+ * super(`${queueName}-queue`, [region], ServiceType.OTHER, 'sqs');
29
+ * }
30
+ * }
23
31
  * ```
24
32
  *
25
33
  * @group Models/Service
@@ -27,25 +35,71 @@ import { ServiceSchema } from './service.schema.js';
27
35
  * @see Definition of [Default Models](/docs/fundamentals/models#default-models).
28
36
  */
29
37
  let Service = Service_1 = class Service extends AModel {
30
- constructor(serviceId) {
38
+ /**
39
+ * @param serviceId The ID of the service, unique among the services of each of its parents.
40
+ * @param parents The models this service is attached under. They are fixed for its lifetime.
41
+ * @param type What kind of thing the service is.
42
+ * @param label What the service actually is, in free text, e.g. `dynamodb`.
43
+ * @throws {@link ModelError} If no parent is given, or a parent already has a service with this ID.
44
+ */
45
+ constructor(serviceId, parents, type, label) {
31
46
  super();
47
+ this.label = label;
48
+ this.parentCount = parents.length;
32
49
  this.serviceId = serviceId;
50
+ this.type = type;
51
+ // Validate parents.
52
+ if (parents.length === 0) {
53
+ throw new ModelError('Service must have at least one parent!', this);
54
+ }
55
+ const parentFields = parents.map((p) => p.deriveDependencyField());
56
+ if (parentFields.some((f) => f === undefined)) {
57
+ throw new ModelError('Service parent must be attached to the graph!', this);
58
+ }
59
+ // Check for duplicates.
60
+ for (const parent of parents) {
61
+ const services = (parent.getChildren('service')['service'] || []).map((d) => d.to);
62
+ if (services.some((s) => s.serviceId === serviceId)) {
63
+ throw new ModelError('Service already exists!', this);
64
+ }
65
+ }
66
+ // Attach to every parent.
67
+ for (const [index, parent] of parents.entries()) {
68
+ parent.addChild(parentFields[index], this, 'serviceId');
69
+ }
33
70
  }
71
+ /**
72
+ * @internal
73
+ */
34
74
  setContext() {
35
- const parents = this.getParents();
36
- const app = parents['app']?.[0]?.to;
37
- if (!app) {
75
+ const parents = Object.values(this.getParents()).flat();
76
+ if (parents.length < this.parentCount) {
38
77
  return undefined;
39
78
  }
40
- return [`${this.constructor.NODE_NAME}=${this.serviceId}`, app.getContext()].join(',');
79
+ return [
80
+ `${this.constructor.NODE_NAME}=${this.serviceId}`,
81
+ ...parents.map((d) => d.to.getContext()).sort(),
82
+ ].join(',');
41
83
  }
84
+ /**
85
+ * @internal
86
+ */
42
87
  synth() {
43
- throw new ModelError('Method not implemented! Use subclass', this);
88
+ const parentContexts = Object.values(this.getParents())
89
+ .flat()
90
+ .map((d) => d.to.getContext())
91
+ .sort();
92
+ return {
93
+ label: this.label,
94
+ parents: parentContexts.map((context) => ({ context })),
95
+ serviceId: this.serviceId,
96
+ type: this.type,
97
+ };
44
98
  }
45
99
  };
46
100
  Service = Service_1 = __decorate([
47
101
  Model('@octo', 'service', ServiceSchema),
48
- __metadata("design:paramtypes", [String])
102
+ __metadata("design:paramtypes", [String, Array, String, String])
49
103
  ], Service);
50
104
  export { Service };
51
105
  //# sourceMappingURL=service.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.model.js","sourceRoot":"","sources":["../../../src/models/service/service.model.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AAEI,IAAM,OA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QAC3D,CAAC;IACH,CAAC;IAED;;OAEG;IACM,UAAU;QACjB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACxD,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YACtC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO;YACL,GAAI,IAAI,CAAC,WAA8B,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE;YACrE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE;SAChD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACd,CAAC;IAED;;OAEG;IACM,KAAK;QACZ,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;aACpD,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;aAC7B,IAAI,EAAE,CAAC;QAEV,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;YACvD,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;CACF,CAAA;AAlFY,OAAO;IADnB,KAAK,CAAU,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC;;GACrC,OAAO,CAkFnB"}
@@ -1,9 +1,56 @@
1
+ import type { IModelReference } from '../model.interface.js';
1
2
  /**
3
+ * What kind of thing a {@link Service} is.
4
+ *
5
+ * @group Models/Service
6
+ */
7
+ export declare enum ServiceType {
8
+ /**
9
+ * A cache, such as Redis.
10
+ */
11
+ CACHE = "cache",
12
+ /**
13
+ * A database, such as a DynamoDB table.
14
+ */
15
+ DATABASE = "database",
16
+ /**
17
+ * A global entry point that serves what is connected behind it, such as a CDN or an API gateway.
18
+ */
19
+ GATEWAY = "gateway",
20
+ /**
21
+ * Spreads traffic across servers, such as an application load balancer.
22
+ */
23
+ LOAD_BALANCER = "load-balancer",
24
+ /**
25
+ * Anything the other types do not describe.
26
+ */
27
+ OTHER = "other",
28
+ /**
29
+ * Storage for files or objects, such as an S3 bucket.
30
+ */
31
+ STORAGE = "storage"
32
+ }
33
+ /**
34
+ * Schema of the {@link Service} model.
35
+ * Child classes extend this schema to declare whatever the service needs.
36
+ *
2
37
  * @group Models/Service
3
38
  */
4
39
  export declare class ServiceSchema {
5
40
  /**
6
- * The ID of the service.
41
+ * What the service actually is, in free text, e.g. `dynamodb`.
42
+ */
43
+ label: string;
44
+ /**
45
+ * The models this service is attached under.
46
+ */
47
+ parents: IModelReference[];
48
+ /**
49
+ * The ID of the service, unique among the services of each of its parents.
7
50
  */
8
51
  serviceId: string;
52
+ /**
53
+ * What kind of thing the service is. See {@link ServiceType}.
54
+ */
55
+ type: ServiceType;
9
56
  }
@@ -10,18 +10,73 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  import { Validate } from '../../decorators/validate.decorator.js';
11
11
  import { Schema } from '../../functions/schema/schema.js';
12
12
  /**
13
+ * What kind of thing a {@link Service} is.
14
+ *
15
+ * @group Models/Service
16
+ */
17
+ export var ServiceType;
18
+ (function (ServiceType) {
19
+ /**
20
+ * A cache, such as Redis.
21
+ */
22
+ ServiceType["CACHE"] = "cache";
23
+ /**
24
+ * A database, such as a DynamoDB table.
25
+ */
26
+ ServiceType["DATABASE"] = "database";
27
+ /**
28
+ * A global entry point that serves what is connected behind it, such as a CDN or an API gateway.
29
+ */
30
+ ServiceType["GATEWAY"] = "gateway";
31
+ /**
32
+ * Spreads traffic across servers, such as an application load balancer.
33
+ */
34
+ ServiceType["LOAD_BALANCER"] = "load-balancer";
35
+ /**
36
+ * Anything the other types do not describe.
37
+ */
38
+ ServiceType["OTHER"] = "other";
39
+ /**
40
+ * Storage for files or objects, such as an S3 bucket.
41
+ */
42
+ ServiceType["STORAGE"] = "storage";
43
+ })(ServiceType || (ServiceType = {}));
44
+ /**
45
+ * Schema of the {@link Service} model.
46
+ * Child classes extend this schema to declare whatever the service needs.
47
+ *
13
48
  * @group Models/Service
14
49
  */
15
50
  export class ServiceSchema {
16
51
  constructor() {
17
52
  /**
18
- * The ID of the service.
53
+ * What the service actually is, in free text, e.g. `dynamodb`.
54
+ */
55
+ this.label = Schema();
56
+ /**
57
+ * The models this service is attached under.
58
+ */
59
+ this.parents = Schema();
60
+ /**
61
+ * The ID of the service, unique among the services of each of its parents.
19
62
  */
20
63
  this.serviceId = Schema();
64
+ /**
65
+ * What kind of thing the service is. See {@link ServiceType}.
66
+ */
67
+ this.type = Schema();
21
68
  }
22
69
  }
70
+ __decorate([
71
+ Validate({ options: { maxLength: 64, minLength: 2, regex: /^[a-zA-Z0-9][\w.-]*[a-zA-Z0-9]$/ } }),
72
+ __metadata("design:type", Object)
73
+ ], ServiceSchema.prototype, "label", void 0);
23
74
  __decorate([
24
75
  Validate({ options: { maxLength: 128, minLength: 2, regex: /^[a-zA-Z0-9][\w.-]*[a-zA-Z0-9]$/ } }),
25
76
  __metadata("design:type", Object)
26
77
  ], ServiceSchema.prototype, "serviceId", void 0);
78
+ __decorate([
79
+ Validate({ options: { custom: (value) => Object.values(ServiceType).includes(value) } }),
80
+ __metadata("design:type", Object)
81
+ ], ServiceSchema.prototype, "type", void 0);
27
82
  //# sourceMappingURL=service.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.schema.js","sourceRoot":"","sources":["../../../src/models/service/service.schema.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MA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,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,EAAE,CAAC;;gDACrE;AAM7B;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,KAAkB,EAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;;2CAClF"}
@@ -18,10 +18,8 @@ import { SubnetSchema, SubnetType } from './subnet.schema.js';
18
18
  * @see Definition of [Default Models](/docs/fundamentals/models#default-models).
19
19
  */
20
20
  export declare class Subnet extends AModel<SubnetSchema, Subnet> {
21
- private options;
22
21
  readonly subnetId: string;
23
22
  readonly subnetName: string;
24
- constructor(region: Region, name: string);
25
23
  /**
26
24
  * To block/disable intra-network communication within self.
27
25
  * When this is set to `true`,
@@ -31,12 +29,38 @@ export declare class Subnet extends AModel<SubnetSchema, Subnet> {
31
29
  * @experimental
32
30
  */
33
31
  get disableSubnetIntraNetwork(): boolean;
32
+ /**
33
+ * @internal
34
+ */
34
35
  set disableSubnetIntraNetwork(disableSubnetIntraNetwork: boolean);
36
+ /**
37
+ * Whether this subnet is reachable from the internet.
38
+ *
39
+ * @defaultValue {@link SubnetType.PRIVATE}
40
+ */
35
41
  get subnetType(): SubnetType;
42
+ /**
43
+ * @internal
44
+ */
36
45
  set subnetType(subnetType: SubnetType);
46
+ private options;
47
+ /**
48
+ * @param region The region this subnet belongs to.
49
+ * @param name The name of the subnet. The subnet's ID is derived from the region and this name.
50
+ */
51
+ constructor(region: Region, name: string);
52
+ /**
53
+ * @internal
54
+ */
55
+ static unSynth(subnet: SubnetSchema, deReferenceContext: (context: string) => Promise<UnknownModel>): Promise<Subnet>;
56
+ /**
57
+ * @internal
58
+ */
37
59
  setContext(): string | undefined;
60
+ /**
61
+ * @internal
62
+ */
38
63
  synth(): SubnetSchema;
39
- static unSynth(subnet: SubnetSchema, deReferenceContext: (context: string) => Promise<UnknownModel>): Promise<Subnet>;
40
64
  /**
41
65
  * To update the networking rules of this subnet to allow or deny connectivity from another subnet.
42
66
  * The networking rules are uni-directional,
@@ -28,15 +28,6 @@ import { SubnetSchema, SubnetType } from './subnet.schema.js';
28
28
  * @see Definition of [Default Models](/docs/fundamentals/models#default-models).
29
29
  */
30
30
  let Subnet = Subnet_1 = class Subnet extends AModel {
31
- constructor(region, name) {
32
- super();
33
- this.options = {
34
- disableSubnetIntraNetwork: false,
35
- subnetType: SubnetType.PRIVATE,
36
- };
37
- this.subnetId = region.regionId + '-' + name;
38
- this.subnetName = name;
39
- }
40
31
  /**
41
32
  * To block/disable intra-network communication within self.
42
33
  * When this is set to `true`,
@@ -48,15 +39,52 @@ let Subnet = Subnet_1 = class Subnet extends AModel {
48
39
  get disableSubnetIntraNetwork() {
49
40
  return this.options.disableSubnetIntraNetwork;
50
41
  }
42
+ /**
43
+ * @internal
44
+ */
51
45
  set disableSubnetIntraNetwork(disableSubnetIntraNetwork) {
52
46
  this.options.disableSubnetIntraNetwork = disableSubnetIntraNetwork;
53
47
  }
48
+ /**
49
+ * Whether this subnet is reachable from the internet.
50
+ *
51
+ * @defaultValue {@link SubnetType.PRIVATE}
52
+ */
54
53
  get subnetType() {
55
54
  return this.options.subnetType;
56
55
  }
56
+ /**
57
+ * @internal
58
+ */
57
59
  set subnetType(subnetType) {
58
60
  this.options.subnetType = subnetType || SubnetType.PRIVATE;
59
61
  }
62
+ /**
63
+ * @param region The region this subnet belongs to.
64
+ * @param name The name of the subnet. The subnet's ID is derived from the region and this name.
65
+ */
66
+ constructor(region, name) {
67
+ super();
68
+ this.options = {
69
+ disableSubnetIntraNetwork: false,
70
+ subnetType: SubnetType.PRIVATE,
71
+ };
72
+ this.subnetId = region.regionId + '-' + name;
73
+ this.subnetName = name;
74
+ }
75
+ /**
76
+ * @internal
77
+ */
78
+ static async unSynth(subnet, deReferenceContext) {
79
+ const region = (await deReferenceContext(subnet.region.context));
80
+ const newSubnet = new Subnet_1(region, subnet.subnetName);
81
+ newSubnet.disableSubnetIntraNetwork = subnet.options.disableSubnetIntraNetwork;
82
+ newSubnet.subnetType = subnet.options.subnetType;
83
+ return newSubnet;
84
+ }
85
+ /**
86
+ * @internal
87
+ */
60
88
  setContext() {
61
89
  const parents = this.getParents();
62
90
  const region = parents['region']?.[0]?.to;
@@ -65,6 +93,9 @@ let Subnet = Subnet_1 = class Subnet extends AModel {
65
93
  }
66
94
  return [`${this.constructor.NODE_NAME}=${this.subnetId}`, region.getContext()].join(',');
67
95
  }
96
+ /**
97
+ * @internal
98
+ */
68
99
  synth() {
69
100
  const parents = this.getParents();
70
101
  const region = parents['region'][0].to;
@@ -75,13 +106,6 @@ let Subnet = Subnet_1 = class Subnet extends AModel {
75
106
  subnetName: this.subnetName,
76
107
  };
77
108
  }
78
- static async unSynth(subnet, deReferenceContext) {
79
- const region = (await deReferenceContext(subnet.region.context));
80
- const newSubnet = new Subnet_1(region, subnet.subnetName);
81
- newSubnet.disableSubnetIntraNetwork = subnet.options.disableSubnetIntraNetwork;
82
- newSubnet.subnetType = subnet.options.subnetType;
83
- return newSubnet;
84
- }
85
109
  /**
86
110
  * To update the networking rules of this subnet to allow or deny connectivity from another subnet.
87
111
  * The networking rules are uni-directional,