@squiz/job-runner-lib 1.66.1

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 (826) hide show
  1. package/.env.example +1 -0
  2. package/CHANGELOG.md +726 -0
  3. package/build.js +17 -0
  4. package/jest.config.ts +24 -0
  5. package/jest.integration.config.ts +27 -0
  6. package/lib/TestHelpers.d.ts +18 -0
  7. package/lib/TestHelpers.js +97 -0
  8. package/lib/TestHelpers.js.map +1 -0
  9. package/lib/domains/__test__/createPackage.d.ts +3 -0
  10. package/lib/domains/__test__/createPackage.js +45 -0
  11. package/lib/domains/__test__/createPackage.js.map +1 -0
  12. package/lib/domains/__test__/loadAllUnitTestComponents.d.ts +3 -0
  13. package/lib/domains/__test__/loadAllUnitTestComponents.js +63 -0
  14. package/lib/domains/__test__/loadAllUnitTestComponents.js.map +1 -0
  15. package/lib/domains/component/component-context/__mocks__/mockedManifestModel.d.ts +3 -0
  16. package/lib/domains/component/component-context/__mocks__/mockedManifestModel.js +33 -0
  17. package/lib/domains/component/component-context/__mocks__/mockedManifestModel.js.map +1 -0
  18. package/lib/domains/component/component-context/__mocks__/mockedUriObj.d.ts +3 -0
  19. package/lib/domains/component/component-context/__mocks__/mockedUriObj.js +38 -0
  20. package/lib/domains/component/component-context/__mocks__/mockedUriObj.js.map +1 -0
  21. package/lib/domains/component/component-context/__mocks__/mockedUriObjPreview.d.ts +3 -0
  22. package/lib/domains/component/component-context/__mocks__/mockedUriObjPreview.js +38 -0
  23. package/lib/domains/component/component-context/__mocks__/mockedUriObjPreview.js.map +1 -0
  24. package/lib/domains/component/component-context/createComponentContextualFunctions.d.ts +23 -0
  25. package/lib/domains/component/component-context/createComponentContextualFunctions.js +75 -0
  26. package/lib/domains/component/component-context/createComponentContextualFunctions.js.map +1 -0
  27. package/lib/domains/component/component-context/createComponentContextualFunctions.spec.d.ts +1 -0
  28. package/lib/domains/component/component-context/createComponentContextualFunctions.spec.js +248 -0
  29. package/lib/domains/component/component-context/createComponentContextualFunctions.spec.js.map +1 -0
  30. package/lib/domains/component/errors/ComponentError.d.ts +12 -0
  31. package/lib/domains/component/errors/ComponentError.js +20 -0
  32. package/lib/domains/component/errors/ComponentError.js.map +1 -0
  33. package/lib/domains/component/errors/JobError.d.ts +10 -0
  34. package/lib/domains/component/errors/JobError.js +18 -0
  35. package/lib/domains/component/errors/JobError.js.map +1 -0
  36. package/lib/domains/component/index.d.ts +13 -0
  37. package/lib/domains/component/index.js +30 -0
  38. package/lib/domains/component/index.js.map +1 -0
  39. package/lib/domains/component/models/Component.d.ts +7 -0
  40. package/lib/domains/component/models/Component.js +13 -0
  41. package/lib/domains/component/models/Component.js.map +1 -0
  42. package/lib/domains/component/models/Component.spec.d.ts +1 -0
  43. package/lib/domains/component/models/Component.spec.js +18 -0
  44. package/lib/domains/component/models/Component.spec.js.map +1 -0
  45. package/lib/domains/component/models/ComponentVersion.d.ts +18 -0
  46. package/lib/domains/component/models/ComponentVersion.js +35 -0
  47. package/lib/domains/component/models/ComponentVersion.js.map +1 -0
  48. package/lib/domains/component/models/ComponentVersion.spec.d.ts +1 -0
  49. package/lib/domains/component/models/ComponentVersion.spec.js +55 -0
  50. package/lib/domains/component/models/ComponentVersion.spec.js.map +1 -0
  51. package/lib/domains/component/repositories/ComponentRepository.d.ts +12 -0
  52. package/lib/domains/component/repositories/ComponentRepository.integration.spec.d.ts +1 -0
  53. package/lib/domains/component/repositories/ComponentRepository.integration.spec.js +111 -0
  54. package/lib/domains/component/repositories/ComponentRepository.integration.spec.js.map +1 -0
  55. package/lib/domains/component/repositories/ComponentRepository.js +28 -0
  56. package/lib/domains/component/repositories/ComponentRepository.js.map +1 -0
  57. package/lib/domains/component/repositories/ComponentVersionRepository.d.ts +21 -0
  58. package/lib/domains/component/repositories/ComponentVersionRepository.integration.spec.d.ts +1 -0
  59. package/lib/domains/component/repositories/ComponentVersionRepository.integration.spec.js +378 -0
  60. package/lib/domains/component/repositories/ComponentVersionRepository.integration.spec.js.map +1 -0
  61. package/lib/domains/component/repositories/ComponentVersionRepository.js +83 -0
  62. package/lib/domains/component/repositories/ComponentVersionRepository.js.map +1 -0
  63. package/lib/domains/component/services/ComponentService.d.ts +40 -0
  64. package/lib/domains/component/services/ComponentService.integration.spec.d.ts +1 -0
  65. package/lib/domains/component/services/ComponentService.integration.spec.js +614 -0
  66. package/lib/domains/component/services/ComponentService.integration.spec.js.map +1 -0
  67. package/lib/domains/component/services/ComponentService.js +254 -0
  68. package/lib/domains/component/services/ComponentService.js.map +1 -0
  69. package/lib/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.d.ts +12 -0
  70. package/lib/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.js +15 -0
  71. package/lib/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.js.map +1 -0
  72. package/lib/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.spec.d.ts +1 -0
  73. package/lib/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.spec.js +75 -0
  74. package/lib/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.spec.js.map +1 -0
  75. package/lib/domains/component/utils/getComponentFileSystemFolder.d.ts +1 -0
  76. package/lib/domains/component/utils/getComponentFileSystemFolder.js +12 -0
  77. package/lib/domains/component/utils/getComponentFileSystemFolder.js.map +1 -0
  78. package/lib/domains/component/utils/getComponentFileSystemFolder.spec.d.ts +1 -0
  79. package/lib/domains/component/utils/getComponentFileSystemFolder.spec.js +13 -0
  80. package/lib/domains/component/utils/getComponentFileSystemFolder.spec.js.map +1 -0
  81. package/lib/domains/component/utils/getComponentName.d.ts +1 -0
  82. package/lib/domains/component/utils/getComponentName.js +8 -0
  83. package/lib/domains/component/utils/getComponentName.js.map +1 -0
  84. package/lib/domains/component/utils/getComponentName.spec.d.ts +1 -0
  85. package/lib/domains/component/utils/getComponentName.spec.js +9 -0
  86. package/lib/domains/component/utils/getComponentName.spec.js.map +1 -0
  87. package/lib/domains/component/utils/moveFilesAndDirectories.d.ts +1 -0
  88. package/lib/domains/component/utils/moveFilesAndDirectories.js +33 -0
  89. package/lib/domains/component/utils/moveFilesAndDirectories.js.map +1 -0
  90. package/lib/domains/component/utils/moveFilesAndDirectories.spec.d.ts +1 -0
  91. package/lib/domains/component/utils/moveFilesAndDirectories.spec.js +52 -0
  92. package/lib/domains/component/utils/moveFilesAndDirectories.spec.js.map +1 -0
  93. package/lib/domains/component/web-models/ComponentForWeb.d.ts +11 -0
  94. package/lib/domains/component/web-models/ComponentForWeb.js +3 -0
  95. package/lib/domains/component/web-models/ComponentForWeb.js.map +1 -0
  96. package/lib/domains/component/web-models/ComponentVersionWebModel.d.ts +15 -0
  97. package/lib/domains/component/web-models/ComponentVersionWebModel.js +3 -0
  98. package/lib/domains/component/web-models/ComponentVersionWebModel.js.map +1 -0
  99. package/lib/domains/component/web-models/ComponentsForWeb.d.ts +17 -0
  100. package/lib/domains/component/web-models/ComponentsForWeb.js +3 -0
  101. package/lib/domains/component/web-models/ComponentsForWeb.js.map +1 -0
  102. package/lib/domains/component-set/errors/InvalidEnvironmentVariablesError.d.ts +5 -0
  103. package/lib/domains/component-set/errors/InvalidEnvironmentVariablesError.js +14 -0
  104. package/lib/domains/component-set/errors/InvalidEnvironmentVariablesError.js.map +1 -0
  105. package/lib/domains/component-set/index.d.ts +13 -0
  106. package/lib/domains/component-set/index.js +30 -0
  107. package/lib/domains/component-set/index.js.map +1 -0
  108. package/lib/domains/component-set/models/ComponentSet.d.ts +20 -0
  109. package/lib/domains/component-set/models/ComponentSet.js +28 -0
  110. package/lib/domains/component-set/models/ComponentSet.js.map +1 -0
  111. package/lib/domains/component-set/models/ComponentSet.spec.d.ts +1 -0
  112. package/lib/domains/component-set/models/ComponentSet.spec.js +45 -0
  113. package/lib/domains/component-set/models/ComponentSet.spec.js.map +1 -0
  114. package/lib/domains/component-set/models/ComponentSetComponentVersion.d.ts +23 -0
  115. package/lib/domains/component-set/models/ComponentSetComponentVersion.js +29 -0
  116. package/lib/domains/component-set/models/ComponentSetComponentVersion.js.map +1 -0
  117. package/lib/domains/component-set/models/ComponentSetComponentVersion.spec.d.ts +1 -0
  118. package/lib/domains/component-set/models/ComponentSetComponentVersion.spec.js +83 -0
  119. package/lib/domains/component-set/models/ComponentSetComponentVersion.spec.js.map +1 -0
  120. package/lib/domains/component-set/models/ComponentSetComponentVersionEditable.d.ts +12 -0
  121. package/lib/domains/component-set/models/ComponentSetComponentVersionEditable.js +57 -0
  122. package/lib/domains/component-set/models/ComponentSetComponentVersionEditable.js.map +1 -0
  123. package/lib/domains/component-set/models/ComponentSetComponentVersionEditable.spec.d.ts +1 -0
  124. package/lib/domains/component-set/models/ComponentSetComponentVersionEditable.spec.js +60 -0
  125. package/lib/domains/component-set/models/ComponentSetComponentVersionEditable.spec.js.map +1 -0
  126. package/lib/domains/component-set/models/ComponentSetComponentVersionExcluded.d.ts +11 -0
  127. package/lib/domains/component-set/models/ComponentSetComponentVersionExcluded.js +17 -0
  128. package/lib/domains/component-set/models/ComponentSetComponentVersionExcluded.js.map +1 -0
  129. package/lib/domains/component-set/models/ComponentSetComponentVersionExcluded.spec.d.ts +1 -0
  130. package/lib/domains/component-set/models/ComponentSetComponentVersionExcluded.spec.js +34 -0
  131. package/lib/domains/component-set/models/ComponentSetComponentVersionExcluded.spec.js.map +1 -0
  132. package/lib/domains/component-set/models/ComponentSetRule.d.ts +12 -0
  133. package/lib/domains/component-set/models/ComponentSetRule.js +50 -0
  134. package/lib/domains/component-set/models/ComponentSetRule.js.map +1 -0
  135. package/lib/domains/component-set/models/ComponentSetRule.spec.d.ts +1 -0
  136. package/lib/domains/component-set/models/ComponentSetRule.spec.js +29 -0
  137. package/lib/domains/component-set/models/ComponentSetRule.spec.js.map +1 -0
  138. package/lib/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.d.ts +10 -0
  139. package/lib/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.integration.spec.d.ts +1 -0
  140. package/lib/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.integration.spec.js +127 -0
  141. package/lib/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.integration.spec.js.map +1 -0
  142. package/lib/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.js +37 -0
  143. package/lib/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.js.map +1 -0
  144. package/lib/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.d.ts +10 -0
  145. package/lib/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.integration.spec.d.ts +1 -0
  146. package/lib/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.integration.spec.js +127 -0
  147. package/lib/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.integration.spec.js.map +1 -0
  148. package/lib/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.js +37 -0
  149. package/lib/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.js.map +1 -0
  150. package/lib/domains/component-set/repositories/ComponentSetComponentVersionRepository.d.ts +10 -0
  151. package/lib/domains/component-set/repositories/ComponentSetComponentVersionRepository.integration.spec.d.ts +1 -0
  152. package/lib/domains/component-set/repositories/ComponentSetComponentVersionRepository.integration.spec.js +163 -0
  153. package/lib/domains/component-set/repositories/ComponentSetComponentVersionRepository.integration.spec.js.map +1 -0
  154. package/lib/domains/component-set/repositories/ComponentSetComponentVersionRepository.js +22 -0
  155. package/lib/domains/component-set/repositories/ComponentSetComponentVersionRepository.js.map +1 -0
  156. package/lib/domains/component-set/repositories/ComponentSetRepository.d.ts +13 -0
  157. package/lib/domains/component-set/repositories/ComponentSetRepository.integration.spec.d.ts +1 -0
  158. package/lib/domains/component-set/repositories/ComponentSetRepository.integration.spec.js +161 -0
  159. package/lib/domains/component-set/repositories/ComponentSetRepository.integration.spec.js.map +1 -0
  160. package/lib/domains/component-set/repositories/ComponentSetRepository.js +48 -0
  161. package/lib/domains/component-set/repositories/ComponentSetRepository.js.map +1 -0
  162. package/lib/domains/component-set/repositories/ComponentSetRuleRepository.d.ts +13 -0
  163. package/lib/domains/component-set/repositories/ComponentSetRuleRepository.integration.spec.d.ts +1 -0
  164. package/lib/domains/component-set/repositories/ComponentSetRuleRepository.integration.spec.js +88 -0
  165. package/lib/domains/component-set/repositories/ComponentSetRuleRepository.integration.spec.js.map +1 -0
  166. package/lib/domains/component-set/repositories/ComponentSetRuleRepository.js +55 -0
  167. package/lib/domains/component-set/repositories/ComponentSetRuleRepository.js.map +1 -0
  168. package/lib/domains/component-set/services/ComponentSetRuleService.d.ts +10 -0
  169. package/lib/domains/component-set/services/ComponentSetRuleService.integration.spec.d.ts +1 -0
  170. package/lib/domains/component-set/services/ComponentSetRuleService.integration.spec.js +107 -0
  171. package/lib/domains/component-set/services/ComponentSetRuleService.integration.spec.js.map +1 -0
  172. package/lib/domains/component-set/services/ComponentSetRuleService.js +23 -0
  173. package/lib/domains/component-set/services/ComponentSetRuleService.js.map +1 -0
  174. package/lib/domains/component-set/services/ComponentSetService.d.ts +37 -0
  175. package/lib/domains/component-set/services/ComponentSetService.js +13 -0
  176. package/lib/domains/component-set/services/ComponentSetService.js.map +1 -0
  177. package/lib/domains/component-set/services/ComponentSetService.spec.d.ts +1 -0
  178. package/lib/domains/component-set/services/ComponentSetService.spec.js +120 -0
  179. package/lib/domains/component-set/services/ComponentSetService.spec.js.map +1 -0
  180. package/lib/domains/component-set/services/ComponentSetServiceForLocalDev.d.ts +24 -0
  181. package/lib/domains/component-set/services/ComponentSetServiceForLocalDev.js +85 -0
  182. package/lib/domains/component-set/services/ComponentSetServiceForLocalDev.js.map +1 -0
  183. package/lib/domains/component-set/services/ComponentSetServiceForLocalDev.spec.d.ts +1 -0
  184. package/lib/domains/component-set/services/ComponentSetServiceForLocalDev.spec.js +141 -0
  185. package/lib/domains/component-set/services/ComponentSetServiceForLocalDev.spec.js.map +1 -0
  186. package/lib/domains/component-set/services/ComponentSetServiceForProduction.d.ts +53 -0
  187. package/lib/domains/component-set/services/ComponentSetServiceForProduction.integration.spec.d.ts +1 -0
  188. package/lib/domains/component-set/services/ComponentSetServiceForProduction.integration.spec.js +2565 -0
  189. package/lib/domains/component-set/services/ComponentSetServiceForProduction.integration.spec.js.map +1 -0
  190. package/lib/domains/component-set/services/ComponentSetServiceForProduction.js +601 -0
  191. package/lib/domains/component-set/services/ComponentSetServiceForProduction.js.map +1 -0
  192. package/lib/domains/component-set/services/EnvironmentVariables.d.ts +1 -0
  193. package/lib/domains/component-set/services/EnvironmentVariables.js +3 -0
  194. package/lib/domains/component-set/services/EnvironmentVariables.js.map +1 -0
  195. package/lib/domains/component-set/services/Headers.d.ts +1 -0
  196. package/lib/domains/component-set/services/Headers.js +3 -0
  197. package/lib/domains/component-set/services/Headers.js.map +1 -0
  198. package/lib/domains/component-set/services/RuntimeComponentSet.d.ts +6 -0
  199. package/lib/domains/component-set/services/RuntimeComponentSet.js +3 -0
  200. package/lib/domains/component-set/services/RuntimeComponentSet.js.map +1 -0
  201. package/lib/domains/component-set/web-models/ComponentSetComponentVersionForWeb.d.ts +5 -0
  202. package/lib/domains/component-set/web-models/ComponentSetComponentVersionForWeb.js +3 -0
  203. package/lib/domains/component-set/web-models/ComponentSetComponentVersionForWeb.js.map +1 -0
  204. package/lib/domains/component-set/web-models/ComponentSetForWeb.d.ts +64 -0
  205. package/lib/domains/component-set/web-models/ComponentSetForWeb.js +22 -0
  206. package/lib/domains/component-set/web-models/ComponentSetForWeb.js.map +1 -0
  207. package/lib/domains/content/index.d.ts +4 -0
  208. package/lib/domains/content/index.js +21 -0
  209. package/lib/domains/content/index.js.map +1 -0
  210. package/lib/domains/content/services/ComponentContentSchemaService.d.ts +9 -0
  211. package/lib/domains/content/services/ComponentContentSchemaService.js +45 -0
  212. package/lib/domains/content/services/ComponentContentSchemaService.js.map +1 -0
  213. package/lib/domains/content/services/ComponentContentSchemaService.spec.d.ts +1 -0
  214. package/lib/domains/content/services/ComponentContentSchemaService.spec.js +240 -0
  215. package/lib/domains/content/services/ComponentContentSchemaService.spec.js.map +1 -0
  216. package/lib/domains/content/services/ContentItemService.d.ts +7 -0
  217. package/lib/domains/content/services/ContentItemService.js +36 -0
  218. package/lib/domains/content/services/ContentItemService.js.map +1 -0
  219. package/lib/domains/content/services/ContentItemService.spec.d.ts +1 -0
  220. package/lib/domains/content/services/ContentItemService.spec.js +95 -0
  221. package/lib/domains/content/services/ContentItemService.spec.js.map +1 -0
  222. package/lib/domains/content/services/DynamicContentItemService.d.ts +8 -0
  223. package/lib/domains/content/services/DynamicContentItemService.js +31 -0
  224. package/lib/domains/content/services/DynamicContentItemService.js.map +1 -0
  225. package/lib/domains/content/services/DynamicContentItemService.spec.d.ts +1 -0
  226. package/lib/domains/content/services/DynamicContentItemService.spec.js +81 -0
  227. package/lib/domains/content/services/DynamicContentItemService.spec.js.map +1 -0
  228. package/lib/domains/content/utils/getContentSchemaName.d.ts +1 -0
  229. package/lib/domains/content/utils/getContentSchemaName.js +8 -0
  230. package/lib/domains/content/utils/getContentSchemaName.js.map +1 -0
  231. package/lib/domains/content/utils/getContentSchemaName.spec.d.ts +1 -0
  232. package/lib/domains/content/utils/getContentSchemaName.spec.js +9 -0
  233. package/lib/domains/content/utils/getContentSchemaName.spec.js.map +1 -0
  234. package/lib/domains/db/ComponentConnectionManager.d.ts +3 -0
  235. package/lib/domains/db/ComponentConnectionManager.js +3 -0
  236. package/lib/domains/db/ComponentConnectionManager.js.map +1 -0
  237. package/lib/domains/db/ComponentRepositories.d.ts +19 -0
  238. package/lib/domains/db/ComponentRepositories.js +23 -0
  239. package/lib/domains/db/ComponentRepositories.js.map +1 -0
  240. package/lib/domains/db/createConnectionManager.d.ts +5 -0
  241. package/lib/domains/db/createConnectionManager.js +16 -0
  242. package/lib/domains/db/createConnectionManager.js.map +1 -0
  243. package/lib/domains/db/index.d.ts +3 -0
  244. package/lib/domains/db/index.js +20 -0
  245. package/lib/domains/db/index.js.map +1 -0
  246. package/lib/domains/db/migration-list.d.ts +2 -0
  247. package/lib/domains/db/migration-list.js +19 -0
  248. package/lib/domains/db/migration-list.js.map +1 -0
  249. package/lib/domains/job/ParsePartitionKey/ParsePartitionKey.d.ts +2 -0
  250. package/lib/domains/job/ParsePartitionKey/ParsePartitionKey.js +24 -0
  251. package/lib/domains/job/ParsePartitionKey/ParsePartitionKey.js.map +1 -0
  252. package/lib/domains/job/ParsePartitionKey/ParsePartitionKey.spec.d.ts +5 -0
  253. package/lib/domains/job/ParsePartitionKey/ParsePartitionKey.spec.js +24 -0
  254. package/lib/domains/job/ParsePartitionKey/ParsePartitionKey.spec.js.map +1 -0
  255. package/lib/domains/job/ParsePartitionKey/index.d.ts +1 -0
  256. package/lib/domains/job/ParsePartitionKey/index.js +18 -0
  257. package/lib/domains/job/ParsePartitionKey/index.js.map +1 -0
  258. package/lib/domains/job/constants/JobExecutionStatus.constants.d.ts +8 -0
  259. package/lib/domains/job/constants/JobExecutionStatus.constants.js +12 -0
  260. package/lib/domains/job/constants/JobExecutionStatus.constants.js.map +1 -0
  261. package/lib/domains/job/constants/QueryParams.d.ts +14 -0
  262. package/lib/domains/job/constants/QueryParams.js +19 -0
  263. package/lib/domains/job/constants/QueryParams.js.map +1 -0
  264. package/lib/domains/job/constants/Repository.constants.d.ts +12 -0
  265. package/lib/domains/job/constants/Repository.constants.js +15 -0
  266. package/lib/domains/job/constants/Repository.constants.js.map +1 -0
  267. package/lib/domains/job/core/dynamoClient.mock.d.ts +8 -0
  268. package/lib/domains/job/core/dynamoClient.mock.js +32 -0
  269. package/lib/domains/job/core/dynamoClient.mock.js.map +1 -0
  270. package/lib/domains/job/core/pagination/index.d.ts +3 -0
  271. package/lib/domains/job/core/pagination/index.js +20 -0
  272. package/lib/domains/job/core/pagination/index.js.map +1 -0
  273. package/lib/domains/job/core/pagination/model/PageQuery.d.ts +28 -0
  274. package/lib/domains/job/core/pagination/model/PageQuery.js +7 -0
  275. package/lib/domains/job/core/pagination/model/PageQuery.js.map +1 -0
  276. package/lib/domains/job/core/pagination/model/PaginationInfo.d.ts +35 -0
  277. package/lib/domains/job/core/pagination/model/PaginationInfo.js +7 -0
  278. package/lib/domains/job/core/pagination/model/PaginationInfo.js.map +1 -0
  279. package/lib/domains/job/core/pagination/model/PaginationKey.d.ts +2 -0
  280. package/lib/domains/job/core/pagination/model/PaginationKey.js +3 -0
  281. package/lib/domains/job/core/pagination/model/PaginationKey.js.map +1 -0
  282. package/lib/domains/job/core/pagination/model/PaginationLinks.d.ts +27 -0
  283. package/lib/domains/job/core/pagination/model/PaginationLinks.js +7 -0
  284. package/lib/domains/job/core/pagination/model/PaginationLinks.js.map +1 -0
  285. package/lib/domains/job/core/pagination/model/PaginationQueryParams.d.ts +14 -0
  286. package/lib/domains/job/core/pagination/model/PaginationQueryParams.js +3 -0
  287. package/lib/domains/job/core/pagination/model/PaginationQueryParams.js.map +1 -0
  288. package/lib/domains/job/core/pagination/model/PaginationQueryResponse.d.ts +24 -0
  289. package/lib/domains/job/core/pagination/model/PaginationQueryResponse.js +7 -0
  290. package/lib/domains/job/core/pagination/model/PaginationQueryResponse.js.map +1 -0
  291. package/lib/domains/job/core/pagination/model/PaginationResponse.d.ts +43 -0
  292. package/lib/domains/job/core/pagination/model/PaginationResponse.js +7 -0
  293. package/lib/domains/job/core/pagination/model/PaginationResponse.js.map +1 -0
  294. package/lib/domains/job/core/pagination/model/PaginationTypes.d.ts +39 -0
  295. package/lib/domains/job/core/pagination/model/PaginationTypes.js +29 -0
  296. package/lib/domains/job/core/pagination/model/PaginationTypes.js.map +1 -0
  297. package/lib/domains/job/core/pagination/model/index.d.ts +8 -0
  298. package/lib/domains/job/core/pagination/model/index.js +25 -0
  299. package/lib/domains/job/core/pagination/model/index.js.map +1 -0
  300. package/lib/domains/job/core/pagination/services/PaginationService.d.ts +41 -0
  301. package/lib/domains/job/core/pagination/services/PaginationService.js +129 -0
  302. package/lib/domains/job/core/pagination/services/PaginationService.js.map +1 -0
  303. package/lib/domains/job/core/pagination/services/PaginationService.spec.d.ts +5 -0
  304. package/lib/domains/job/core/pagination/services/PaginationService.spec.js +179 -0
  305. package/lib/domains/job/core/pagination/services/PaginationService.spec.js.map +1 -0
  306. package/lib/domains/job/core/pagination/services/index.d.ts +1 -0
  307. package/lib/domains/job/core/pagination/services/index.js +18 -0
  308. package/lib/domains/job/core/pagination/services/index.js.map +1 -0
  309. package/lib/domains/job/core/pagination/utils/PaginationUtils.d.ts +48 -0
  310. package/lib/domains/job/core/pagination/utils/PaginationUtils.js +139 -0
  311. package/lib/domains/job/core/pagination/utils/PaginationUtils.js.map +1 -0
  312. package/lib/domains/job/core/pagination/utils/PaginationUtils.spec.d.ts +5 -0
  313. package/lib/domains/job/core/pagination/utils/PaginationUtils.spec.js +212 -0
  314. package/lib/domains/job/core/pagination/utils/PaginationUtils.spec.js.map +1 -0
  315. package/lib/domains/job/core/pagination/utils/index.d.ts +1 -0
  316. package/lib/domains/job/core/pagination/utils/index.js +18 -0
  317. package/lib/domains/job/core/pagination/utils/index.js.map +1 -0
  318. package/lib/domains/job/errors/BadRequestError.d.ts +15 -0
  319. package/lib/domains/job/errors/BadRequestError.js +23 -0
  320. package/lib/domains/job/errors/BadRequestError.js.map +1 -0
  321. package/lib/domains/job/errors/Error.constants.d.ts +32 -0
  322. package/lib/domains/job/errors/Error.constants.js +36 -0
  323. package/lib/domains/job/errors/Error.constants.js.map +1 -0
  324. package/lib/domains/job/errors/ErrorWithHttpStatusCode.d.ts +16 -0
  325. package/lib/domains/job/errors/ErrorWithHttpStatusCode.js +23 -0
  326. package/lib/domains/job/errors/ErrorWithHttpStatusCode.js.map +1 -0
  327. package/lib/domains/job/errors/ExecutionStatusError.d.ts +3 -0
  328. package/lib/domains/job/errors/ExecutionStatusError.js +11 -0
  329. package/lib/domains/job/errors/ExecutionStatusError.js.map +1 -0
  330. package/lib/domains/job/errors/InternalServerError.d.ts +15 -0
  331. package/lib/domains/job/errors/InternalServerError.js +23 -0
  332. package/lib/domains/job/errors/InternalServerError.js.map +1 -0
  333. package/lib/domains/job/errors/NotFoundError.d.ts +14 -0
  334. package/lib/domains/job/errors/NotFoundError.js +22 -0
  335. package/lib/domains/job/errors/NotFoundError.js.map +1 -0
  336. package/lib/domains/job/errors/NotImplementedError.d.ts +15 -0
  337. package/lib/domains/job/errors/NotImplementedError.js +23 -0
  338. package/lib/domains/job/errors/NotImplementedError.js.map +1 -0
  339. package/lib/domains/job/errors/UnprocessableContent.d.ts +15 -0
  340. package/lib/domains/job/errors/UnprocessableContent.js +23 -0
  341. package/lib/domains/job/errors/UnprocessableContent.js.map +1 -0
  342. package/lib/domains/job/errors/index.d.ts +8 -0
  343. package/lib/domains/job/errors/index.js +25 -0
  344. package/lib/domains/job/errors/index.js.map +1 -0
  345. package/lib/domains/job/index.d.ts +16 -0
  346. package/lib/domains/job/index.js +33 -0
  347. package/lib/domains/job/index.js.map +1 -0
  348. package/lib/domains/job/manifest/JobManifestTypes.d.ts +126 -0
  349. package/lib/domains/job/manifest/JobManifestTypes.js +7 -0
  350. package/lib/domains/job/manifest/JobManifestTypes.js.map +1 -0
  351. package/lib/domains/job/manifest/JobManifestV1.d.ts +17 -0
  352. package/lib/domains/job/manifest/JobManifestV1.js +58 -0
  353. package/lib/domains/job/manifest/JobManifestV1.js.map +1 -0
  354. package/lib/domains/job/manifest/JobManifestV1.spec.d.ts +1 -0
  355. package/lib/domains/job/manifest/JobManifestV1.spec.js +136 -0
  356. package/lib/domains/job/manifest/JobManifestV1.spec.js.map +1 -0
  357. package/lib/domains/job/manifest/index.d.ts +5 -0
  358. package/lib/domains/job/manifest/index.js +22 -0
  359. package/lib/domains/job/manifest/index.js.map +1 -0
  360. package/lib/domains/job/manifest/mocks/JobManifest.mock.d.ts +7 -0
  361. package/lib/domains/job/manifest/mocks/JobManifest.mock.js +36 -0
  362. package/lib/domains/job/manifest/mocks/JobManifest.mock.js.map +1 -0
  363. package/lib/domains/job/manifest/mocks/JobManifestDto.mock.d.ts +7 -0
  364. package/lib/domains/job/manifest/mocks/JobManifestDto.mock.js +48 -0
  365. package/lib/domains/job/manifest/mocks/JobManifestDto.mock.js.map +1 -0
  366. package/lib/domains/job/manifest/mocks/JobManifestRecord.mock.d.ts +7 -0
  367. package/lib/domains/job/manifest/mocks/JobManifestRecord.mock.js +38 -0
  368. package/lib/domains/job/manifest/mocks/JobManifestRecord.mock.js.map +1 -0
  369. package/lib/domains/job/manifest/mocks/JobManifestRequest.mock.d.ts +6 -0
  370. package/lib/domains/job/manifest/mocks/JobManifestRequest.mock.js +29 -0
  371. package/lib/domains/job/manifest/mocks/JobManifestRequest.mock.js.map +1 -0
  372. package/lib/domains/job/model/Base/Base.d.ts +40 -0
  373. package/lib/domains/job/model/Base/Base.js +3 -0
  374. package/lib/domains/job/model/Base/Base.js.map +1 -0
  375. package/lib/domains/job/model/Base/index.d.ts +1 -0
  376. package/lib/domains/job/model/Base/index.js +18 -0
  377. package/lib/domains/job/model/Base/index.js.map +1 -0
  378. package/lib/domains/job/model/Job/Job.d.ts +85 -0
  379. package/lib/domains/job/model/Job/Job.js +7 -0
  380. package/lib/domains/job/model/Job/Job.js.map +1 -0
  381. package/lib/domains/job/model/Job/index.d.ts +5 -0
  382. package/lib/domains/job/model/Job/index.js +22 -0
  383. package/lib/domains/job/model/Job/index.js.map +1 -0
  384. package/lib/domains/job/model/Job/mocks/Job.mock.d.ts +7 -0
  385. package/lib/domains/job/model/Job/mocks/Job.mock.js +28 -0
  386. package/lib/domains/job/model/Job/mocks/Job.mock.js.map +1 -0
  387. package/lib/domains/job/model/Job/mocks/JobDto.mock.d.ts +7 -0
  388. package/lib/domains/job/model/Job/mocks/JobDto.mock.js +39 -0
  389. package/lib/domains/job/model/Job/mocks/JobDto.mock.js.map +1 -0
  390. package/lib/domains/job/model/Job/mocks/JobRecord.mock.d.ts +7 -0
  391. package/lib/domains/job/model/Job/mocks/JobRecord.mock.js +29 -0
  392. package/lib/domains/job/model/Job/mocks/JobRecord.mock.js.map +1 -0
  393. package/lib/domains/job/model/Job/mocks/JobRequest.mock.d.ts +6 -0
  394. package/lib/domains/job/model/Job/mocks/JobRequest.mock.js +21 -0
  395. package/lib/domains/job/model/Job/mocks/JobRequest.mock.js.map +1 -0
  396. package/lib/domains/job/model/JobContext/JobContext.d.ts +87 -0
  397. package/lib/domains/job/model/JobContext/JobContext.js +7 -0
  398. package/lib/domains/job/model/JobContext/JobContext.js.map +1 -0
  399. package/lib/domains/job/model/JobContext/index.d.ts +5 -0
  400. package/lib/domains/job/model/JobContext/index.js +22 -0
  401. package/lib/domains/job/model/JobContext/index.js.map +1 -0
  402. package/lib/domains/job/model/JobContext/mocks/JobContext.mock.d.ts +7 -0
  403. package/lib/domains/job/model/JobContext/mocks/JobContext.mock.js +35 -0
  404. package/lib/domains/job/model/JobContext/mocks/JobContext.mock.js.map +1 -0
  405. package/lib/domains/job/model/JobContext/mocks/JobContextDto.mock.d.ts +7 -0
  406. package/lib/domains/job/model/JobContext/mocks/JobContextDto.mock.js +46 -0
  407. package/lib/domains/job/model/JobContext/mocks/JobContextDto.mock.js.map +1 -0
  408. package/lib/domains/job/model/JobContext/mocks/JobContextRecord.mock.d.ts +7 -0
  409. package/lib/domains/job/model/JobContext/mocks/JobContextRecord.mock.js +34 -0
  410. package/lib/domains/job/model/JobContext/mocks/JobContextRecord.mock.js.map +1 -0
  411. package/lib/domains/job/model/JobContext/mocks/JobContextRequest.mock.d.ts +6 -0
  412. package/lib/domains/job/model/JobContext/mocks/JobContextRequest.mock.js +25 -0
  413. package/lib/domains/job/model/JobContext/mocks/JobContextRequest.mock.js.map +1 -0
  414. package/lib/domains/job/model/JobExecution/JobExecution.d.ts +189 -0
  415. package/lib/domains/job/model/JobExecution/JobExecution.js +7 -0
  416. package/lib/domains/job/model/JobExecution/JobExecution.js.map +1 -0
  417. package/lib/domains/job/model/JobExecution/index.d.ts +5 -0
  418. package/lib/domains/job/model/JobExecution/index.js +22 -0
  419. package/lib/domains/job/model/JobExecution/index.js.map +1 -0
  420. package/lib/domains/job/model/JobExecution/mocks/JobExecution.mock.d.ts +7 -0
  421. package/lib/domains/job/model/JobExecution/mocks/JobExecution.mock.js +45 -0
  422. package/lib/domains/job/model/JobExecution/mocks/JobExecution.mock.js.map +1 -0
  423. package/lib/domains/job/model/JobExecution/mocks/JobExecutionDto.mock.d.ts +7 -0
  424. package/lib/domains/job/model/JobExecution/mocks/JobExecutionDto.mock.js +64 -0
  425. package/lib/domains/job/model/JobExecution/mocks/JobExecutionDto.mock.js.map +1 -0
  426. package/lib/domains/job/model/JobExecution/mocks/JobExecutionRecord.mock.d.ts +7 -0
  427. package/lib/domains/job/model/JobExecution/mocks/JobExecutionRecord.mock.js +48 -0
  428. package/lib/domains/job/model/JobExecution/mocks/JobExecutionRecord.mock.js.map +1 -0
  429. package/lib/domains/job/model/JobExecution/mocks/JobExecutionRequest.mock.d.ts +6 -0
  430. package/lib/domains/job/model/JobExecution/mocks/JobExecutionRequest.mock.js +25 -0
  431. package/lib/domains/job/model/JobExecution/mocks/JobExecutionRequest.mock.js.map +1 -0
  432. package/lib/domains/job/repository/AbstractRepository.d.ts +73 -0
  433. package/lib/domains/job/repository/AbstractRepository.js +174 -0
  434. package/lib/domains/job/repository/AbstractRepository.js.map +1 -0
  435. package/lib/domains/job/repository/JobContextRepository/JobContextRepository.d.ts +24 -0
  436. package/lib/domains/job/repository/JobContextRepository/JobContextRepository.js +169 -0
  437. package/lib/domains/job/repository/JobContextRepository/JobContextRepository.js.map +1 -0
  438. package/lib/domains/job/repository/JobContextRepository/JobContextRepository.spec.d.ts +5 -0
  439. package/lib/domains/job/repository/JobContextRepository/JobContextRepository.spec.js +246 -0
  440. package/lib/domains/job/repository/JobContextRepository/JobContextRepository.spec.js.map +1 -0
  441. package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.d.ts +47 -0
  442. package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.js +276 -0
  443. package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.js.map +1 -0
  444. package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.spec.d.ts +5 -0
  445. package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.spec.js +296 -0
  446. package/lib/domains/job/repository/JobExecutionRepository/JobExecutionRepository.spec.js.map +1 -0
  447. package/lib/domains/job/repository/JobManifestRepository/JobManifestRepository.d.ts +16 -0
  448. package/lib/domains/job/repository/JobManifestRepository/JobManifestRepository.js +133 -0
  449. package/lib/domains/job/repository/JobManifestRepository/JobManifestRepository.js.map +1 -0
  450. package/lib/domains/job/repository/JobManifestRepository/JobManifestRepository.spec.d.ts +5 -0
  451. package/lib/domains/job/repository/JobManifestRepository/JobManifestRepository.spec.js +162 -0
  452. package/lib/domains/job/repository/JobManifestRepository/JobManifestRepository.spec.js.map +1 -0
  453. package/lib/domains/job/repository/JobRepository/JobRepository.d.ts +30 -0
  454. package/lib/domains/job/repository/JobRepository/JobRepository.js +189 -0
  455. package/lib/domains/job/repository/JobRepository/JobRepository.js.map +1 -0
  456. package/lib/domains/job/repository/JobRepository/JobRepository.spec.d.ts +5 -0
  457. package/lib/domains/job/repository/JobRepository/JobRepository.spec.js +270 -0
  458. package/lib/domains/job/repository/JobRepository/JobRepository.spec.js.map +1 -0
  459. package/lib/domains/job/repository/index.d.ts +5 -0
  460. package/lib/domains/job/repository/index.js +22 -0
  461. package/lib/domains/job/repository/index.js.map +1 -0
  462. package/lib/domains/job/repository/mocks/mockIoc.d.ts +5 -0
  463. package/lib/domains/job/repository/mocks/mockIoc.js +40 -0
  464. package/lib/domains/job/repository/mocks/mockIoc.js.map +1 -0
  465. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.d.ts +13 -0
  466. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.defs.d.ts +39 -0
  467. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.defs.js +3 -0
  468. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.defs.js.map +1 -0
  469. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.js +139 -0
  470. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.js.map +1 -0
  471. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.spec.d.ts +1 -0
  472. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.spec.js +78 -0
  473. package/lib/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.spec.js.map +1 -0
  474. package/lib/domains/job/services/index.d.ts +1 -0
  475. package/lib/domains/job/services/index.js +18 -0
  476. package/lib/domains/job/services/index.js.map +1 -0
  477. package/lib/domains/job/singletonProvider.d.ts +6 -0
  478. package/lib/domains/job/singletonProvider.js +14 -0
  479. package/lib/domains/job/singletonProvider.js.map +1 -0
  480. package/lib/domains/job/transientProvider.d.ts +6 -0
  481. package/lib/domains/job/transientProvider.js +14 -0
  482. package/lib/domains/job/transientProvider.js.map +1 -0
  483. package/lib/domains/job/utils/SlackClient/SlackClient.d.ts +44 -0
  484. package/lib/domains/job/utils/SlackClient/SlackClient.js +113 -0
  485. package/lib/domains/job/utils/SlackClient/SlackClient.js.map +1 -0
  486. package/lib/domains/job/utils/SlackClient/SlackClient.spec.d.ts +5 -0
  487. package/lib/domains/job/utils/SlackClient/SlackClient.spec.js +116 -0
  488. package/lib/domains/job/utils/SlackClient/SlackClient.spec.js.map +1 -0
  489. package/lib/domains/job/utils/SlackClient/types/SlackClient.types.d.ts +56 -0
  490. package/lib/domains/job/utils/SlackClient/types/SlackClient.types.js +28 -0
  491. package/lib/domains/job/utils/SlackClient/types/SlackClient.types.js.map +1 -0
  492. package/lib/domains/job/utils/SortByTimeQueued/SortByTimeQueued.d.ts +9 -0
  493. package/lib/domains/job/utils/SortByTimeQueued/SortByTimeQueued.js +21 -0
  494. package/lib/domains/job/utils/SortByTimeQueued/SortByTimeQueued.js.map +1 -0
  495. package/lib/domains/job/utils/SortByTimeQueued/SortByTimeQueued.spec.d.ts +5 -0
  496. package/lib/domains/job/utils/SortByTimeQueued/SortByTimeQueued.spec.js +26 -0
  497. package/lib/domains/job/utils/SortByTimeQueued/SortByTimeQueued.spec.js.map +1 -0
  498. package/lib/domains/job/utils/index.d.ts +3 -0
  499. package/lib/domains/job/utils/index.js +20 -0
  500. package/lib/domains/job/utils/index.js.map +1 -0
  501. package/lib/domains/manifest/AbstractManifest.d.ts +38 -0
  502. package/lib/domains/manifest/AbstractManifest.js +45 -0
  503. package/lib/domains/manifest/AbstractManifest.js.map +1 -0
  504. package/lib/domains/manifest/ManifestModel.d.ts +7 -0
  505. package/lib/domains/manifest/ManifestModel.js +3 -0
  506. package/lib/domains/manifest/ManifestModel.js.map +1 -0
  507. package/lib/domains/manifest/ManifestV1.d.ts +18 -0
  508. package/lib/domains/manifest/ManifestV1.js +124 -0
  509. package/lib/domains/manifest/ManifestV1.js.map +1 -0
  510. package/lib/domains/manifest/ManifestV1.spec.d.ts +1 -0
  511. package/lib/domains/manifest/ManifestV1.spec.js +347 -0
  512. package/lib/domains/manifest/ManifestV1.spec.js.map +1 -0
  513. package/lib/domains/manifest/errors/ManifestLocationError.d.ts +5 -0
  514. package/lib/domains/manifest/errors/ManifestLocationError.js +13 -0
  515. package/lib/domains/manifest/errors/ManifestLocationError.js.map +1 -0
  516. package/lib/domains/manifest/errors/ManifestValidationError.d.ts +3 -0
  517. package/lib/domains/manifest/errors/ManifestValidationError.js +12 -0
  518. package/lib/domains/manifest/errors/ManifestValidationError.js.map +1 -0
  519. package/lib/domains/manifest/index.d.ts +16 -0
  520. package/lib/domains/manifest/index.js +33 -0
  521. package/lib/domains/manifest/index.js.map +1 -0
  522. package/lib/domains/manifest/services/AbstractManifestService.d.ts +49 -0
  523. package/lib/domains/manifest/services/AbstractManifestService.js +235 -0
  524. package/lib/domains/manifest/services/AbstractManifestService.js.map +1 -0
  525. package/lib/domains/manifest/services/AbstractManifestService.spec.d.ts +1 -0
  526. package/lib/domains/manifest/services/AbstractManifestService.spec.js +301 -0
  527. package/lib/domains/manifest/services/AbstractManifestService.spec.js.map +1 -0
  528. package/lib/domains/manifest/services/ComponentFunctionService.d.ts +35 -0
  529. package/lib/domains/manifest/services/ComponentFunctionService.js +129 -0
  530. package/lib/domains/manifest/services/ComponentFunctionService.js.map +1 -0
  531. package/lib/domains/manifest/services/ComponentFunctionService.spec.d.ts +1 -0
  532. package/lib/domains/manifest/services/ComponentFunctionService.spec.js +567 -0
  533. package/lib/domains/manifest/services/ComponentFunctionService.spec.js.map +1 -0
  534. package/lib/domains/manifest/services/ComponentInputValidationService.d.ts +5 -0
  535. package/lib/domains/manifest/services/ComponentInputValidationService.js +11 -0
  536. package/lib/domains/manifest/services/ComponentInputValidationService.js.map +1 -0
  537. package/lib/domains/manifest/services/ComponentSchemaValidationService.d.ts +5 -0
  538. package/lib/domains/manifest/services/ComponentSchemaValidationService.js +11 -0
  539. package/lib/domains/manifest/services/ComponentSchemaValidationService.js.map +1 -0
  540. package/lib/domains/manifest/services/JobFunctionService.d.ts +12 -0
  541. package/lib/domains/manifest/services/JobFunctionService.js +23 -0
  542. package/lib/domains/manifest/services/JobFunctionService.js.map +1 -0
  543. package/lib/domains/manifest/services/JobFunctionService.spec.d.ts +1 -0
  544. package/lib/domains/manifest/services/JobFunctionService.spec.js +132 -0
  545. package/lib/domains/manifest/services/JobFunctionService.spec.js.map +1 -0
  546. package/lib/domains/manifest/services/ManifestServiceForDev.d.ts +18 -0
  547. package/lib/domains/manifest/services/ManifestServiceForDev.js +83 -0
  548. package/lib/domains/manifest/services/ManifestServiceForDev.js.map +1 -0
  549. package/lib/domains/manifest/services/ManifestServiceForDev.spec.d.ts +1 -0
  550. package/lib/domains/manifest/services/ManifestServiceForDev.spec.js +184 -0
  551. package/lib/domains/manifest/services/ManifestServiceForDev.spec.js.map +1 -0
  552. package/lib/domains/manifest/services/ManifestServiceForProduction.d.ts +12 -0
  553. package/lib/domains/manifest/services/ManifestServiceForProduction.js +81 -0
  554. package/lib/domains/manifest/services/ManifestServiceForProduction.js.map +1 -0
  555. package/lib/domains/manifest/services/ManifestServiceForProduction.spec.d.ts +1 -0
  556. package/lib/domains/manifest/services/ManifestServiceForProduction.spec.js +81 -0
  557. package/lib/domains/manifest/services/ManifestServiceForProduction.spec.js.map +1 -0
  558. package/lib/domains/manifest/utils/assertFuncEntryFilesAreValid.d.ts +3 -0
  559. package/lib/domains/manifest/utils/assertFuncEntryFilesAreValid.js +14 -0
  560. package/lib/domains/manifest/utils/assertFuncEntryFilesAreValid.js.map +1 -0
  561. package/lib/domains/manifest/utils/assertStaticFilesAreValid.d.ts +3 -0
  562. package/lib/domains/manifest/utils/assertStaticFilesAreValid.js +27 -0
  563. package/lib/domains/manifest/utils/assertStaticFilesAreValid.js.map +1 -0
  564. package/lib/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.d.ts +2 -0
  565. package/lib/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.js +16 -0
  566. package/lib/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.js.map +1 -0
  567. package/lib/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.spec.d.ts +1 -0
  568. package/lib/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.spec.js +111 -0
  569. package/lib/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.spec.js.map +1 -0
  570. package/lib/domains/manifest/utils/getAndAssertJobManifestVersion.d.ts +3 -0
  571. package/lib/domains/manifest/utils/getAndAssertJobManifestVersion.js +28 -0
  572. package/lib/domains/manifest/utils/getAndAssertJobManifestVersion.js.map +1 -0
  573. package/lib/domains/manifest/utils/getAndAssertJobManifestVersion.spec.d.ts +1 -0
  574. package/lib/domains/manifest/utils/getAndAssertJobManifestVersion.spec.js +115 -0
  575. package/lib/domains/manifest/utils/getAndAssertJobManifestVersion.spec.js.map +1 -0
  576. package/lib/domains/manifest/utils/getAndAssertManifestVersion.d.ts +3 -0
  577. package/lib/domains/manifest/utils/getAndAssertManifestVersion.js +23 -0
  578. package/lib/domains/manifest/utils/getAndAssertManifestVersion.js.map +1 -0
  579. package/lib/domains/manifest/utils/getAndAssertManifestVersion.spec.d.ts +1 -0
  580. package/lib/domains/manifest/utils/getAndAssertManifestVersion.spec.js +109 -0
  581. package/lib/domains/manifest/utils/getAndAssertManifestVersion.spec.js.map +1 -0
  582. package/lib/domains/manifest/utils/isValidManifestVersion.d.ts +2 -0
  583. package/lib/domains/manifest/utils/isValidManifestVersion.js +12 -0
  584. package/lib/domains/manifest/utils/isValidManifestVersion.js.map +1 -0
  585. package/lib/domains/manifest/utils/isValidManifestVersion.spec.d.ts +1 -0
  586. package/lib/domains/manifest/utils/isValidManifestVersion.spec.js +19 -0
  587. package/lib/domains/manifest/utils/isValidManifestVersion.spec.js.map +1 -0
  588. package/lib/domains/url/convertFunctionStaticFilesToFqdn.d.ts +1 -0
  589. package/lib/domains/url/convertFunctionStaticFilesToFqdn.js +22 -0
  590. package/lib/domains/url/convertFunctionStaticFilesToFqdn.js.map +1 -0
  591. package/lib/domains/url/convertFunctionStaticFilesToFqdn.spec.d.ts +1 -0
  592. package/lib/domains/url/convertFunctionStaticFilesToFqdn.spec.js +16 -0
  593. package/lib/domains/url/convertFunctionStaticFilesToFqdn.spec.js.map +1 -0
  594. package/lib/domains/url/convertFunctionStaticFilesToFqdnForPreview.d.ts +1 -0
  595. package/lib/domains/url/convertFunctionStaticFilesToFqdnForPreview.js +22 -0
  596. package/lib/domains/url/convertFunctionStaticFilesToFqdnForPreview.js.map +1 -0
  597. package/lib/domains/url/convertFunctionStaticFilesToFqdnForPreview.spec.d.ts +1 -0
  598. package/lib/domains/url/convertFunctionStaticFilesToFqdnForPreview.spec.js +16 -0
  599. package/lib/domains/url/convertFunctionStaticFilesToFqdnForPreview.spec.js.map +1 -0
  600. package/lib/domains/url/index.d.ts +1 -0
  601. package/lib/domains/url/index.js +18 -0
  602. package/lib/domains/url/index.js.map +1 -0
  603. package/lib/index.d.ts +9 -0
  604. package/lib/index.js +39 -0
  605. package/lib/index.js.map +1 -0
  606. package/lib/jest-global-setup.d.ts +3 -0
  607. package/lib/jest-global-setup.js +22 -0
  608. package/lib/jest-global-setup.js.map +1 -0
  609. package/package.json +59 -0
  610. package/src/TestHelpers.ts +111 -0
  611. package/src/custom-types.d.ts +7 -0
  612. package/src/domains/__test__/createPackage.ts +48 -0
  613. package/src/domains/__test__/loadAllUnitTestComponents.ts +73 -0
  614. package/src/domains/component/component-context/__mocks__/mockedManifestModel.ts +30 -0
  615. package/src/domains/component/component-context/__mocks__/mockedUriObj.ts +38 -0
  616. package/src/domains/component/component-context/__mocks__/mockedUriObjPreview.ts +38 -0
  617. package/src/domains/component/component-context/createComponentContextualFunctions.spec.ts +299 -0
  618. package/src/domains/component/component-context/createComponentContextualFunctions.ts +108 -0
  619. package/src/domains/component/errors/ComponentError.ts +22 -0
  620. package/src/domains/component/errors/JobError.ts +20 -0
  621. package/src/domains/component/index.ts +17 -0
  622. package/src/domains/component/models/Component.spec.ts +21 -0
  623. package/src/domains/component/models/Component.ts +16 -0
  624. package/src/domains/component/models/ComponentVersion.spec.ts +77 -0
  625. package/src/domains/component/models/ComponentVersion.ts +55 -0
  626. package/src/domains/component/repositories/ComponentRepository.integration.spec.ts +148 -0
  627. package/src/domains/component/repositories/ComponentRepository.ts +37 -0
  628. package/src/domains/component/repositories/ComponentVersionRepository.integration.spec.ts +523 -0
  629. package/src/domains/component/repositories/ComponentVersionRepository.ts +138 -0
  630. package/src/domains/component/services/ComponentService.integration.spec.ts +721 -0
  631. package/src/domains/component/services/ComponentService.ts +350 -0
  632. package/src/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.spec.ts +78 -0
  633. package/src/domains/component/services/content-item-uri-resolver/ComponentContentUriResolverForPreview.ts +18 -0
  634. package/src/domains/component/utils/getComponentFileSystemFolder.spec.ts +8 -0
  635. package/src/domains/component/utils/getComponentFileSystemFolder.ts +5 -0
  636. package/src/domains/component/utils/getComponentName.spec.ts +7 -0
  637. package/src/domains/component/utils/getComponentName.ts +3 -0
  638. package/src/domains/component/utils/moveFilesAndDirectories.spec.ts +62 -0
  639. package/src/domains/component/utils/moveFilesAndDirectories.ts +27 -0
  640. package/src/domains/component/web-models/ComponentForWeb.ts +11 -0
  641. package/src/domains/component/web-models/ComponentVersionWebModel.ts +16 -0
  642. package/src/domains/component/web-models/ComponentsForWeb.ts +17 -0
  643. package/src/domains/component-set/errors/InvalidEnvironmentVariablesError.ts +11 -0
  644. package/src/domains/component-set/index.ts +18 -0
  645. package/src/domains/component-set/models/ComponentSet.spec.ts +66 -0
  646. package/src/domains/component-set/models/ComponentSet.ts +67 -0
  647. package/src/domains/component-set/models/ComponentSetComponentVersion.spec.ts +106 -0
  648. package/src/domains/component-set/models/ComponentSetComponentVersion.ts +54 -0
  649. package/src/domains/component-set/models/ComponentSetComponentVersionEditable.spec.ts +82 -0
  650. package/src/domains/component-set/models/ComponentSetComponentVersionEditable.ts +46 -0
  651. package/src/domains/component-set/models/ComponentSetComponentVersionExcluded.spec.ts +46 -0
  652. package/src/domains/component-set/models/ComponentSetComponentVersionExcluded.ts +26 -0
  653. package/src/domains/component-set/models/ComponentSetRule.spec.ts +39 -0
  654. package/src/domains/component-set/models/ComponentSetRule.ts +37 -0
  655. package/src/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.integration.spec.ts +172 -0
  656. package/src/domains/component-set/repositories/ComponentSetComponentVersionEditableRepository.ts +47 -0
  657. package/src/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.integration.spec.ts +172 -0
  658. package/src/domains/component-set/repositories/ComponentSetComponentVersionExcludedRepository.ts +47 -0
  659. package/src/domains/component-set/repositories/ComponentSetComponentVersionRepository.integration.spec.ts +229 -0
  660. package/src/domains/component-set/repositories/ComponentSetComponentVersionRepository.ts +37 -0
  661. package/src/domains/component-set/repositories/ComponentSetRepository.integration.spec.ts +199 -0
  662. package/src/domains/component-set/repositories/ComponentSetRepository.ts +68 -0
  663. package/src/domains/component-set/repositories/ComponentSetRuleRepository.integration.spec.ts +107 -0
  664. package/src/domains/component-set/repositories/ComponentSetRuleRepository.ts +40 -0
  665. package/src/domains/component-set/services/ComponentSetRuleService.integration.spec.ts +137 -0
  666. package/src/domains/component-set/services/ComponentSetRuleService.ts +34 -0
  667. package/src/domains/component-set/services/ComponentSetService.spec.ts +144 -0
  668. package/src/domains/component-set/services/ComponentSetService.ts +82 -0
  669. package/src/domains/component-set/services/ComponentSetServiceForLocalDev.spec.ts +209 -0
  670. package/src/domains/component-set/services/ComponentSetServiceForLocalDev.ts +111 -0
  671. package/src/domains/component-set/services/ComponentSetServiceForProduction.integration.spec.ts +2898 -0
  672. package/src/domains/component-set/services/ComponentSetServiceForProduction.ts +839 -0
  673. package/src/domains/component-set/services/EnvironmentVariables.ts +1 -0
  674. package/src/domains/component-set/services/Headers.ts +1 -0
  675. package/src/domains/component-set/services/RuntimeComponentSet.ts +7 -0
  676. package/src/domains/component-set/web-models/ComponentSetComponentVersionForWeb.ts +7 -0
  677. package/src/domains/component-set/web-models/ComponentSetForWeb.ts +83 -0
  678. package/src/domains/content/index.ts +4 -0
  679. package/src/domains/content/services/ComponentContentSchemaService.spec.ts +264 -0
  680. package/src/domains/content/services/ComponentContentSchemaService.ts +53 -0
  681. package/src/domains/content/services/ContentItemService.spec.ts +108 -0
  682. package/src/domains/content/services/ContentItemService.ts +34 -0
  683. package/src/domains/content/services/DynamicContentItemService.spec.ts +97 -0
  684. package/src/domains/content/services/DynamicContentItemService.ts +30 -0
  685. package/src/domains/content/utils/getContentSchemaName.spec.ts +7 -0
  686. package/src/domains/content/utils/getContentSchemaName.ts +7 -0
  687. package/src/domains/db/ComponentConnectionManager.ts +4 -0
  688. package/src/domains/db/ComponentRepositories.ts +31 -0
  689. package/src/domains/db/createConnectionManager.ts +24 -0
  690. package/src/domains/db/index.ts +3 -0
  691. package/src/domains/db/migration-list.ts +16 -0
  692. package/src/domains/job/ParsePartitionKey/ParsePartitionKey.spec.ts +27 -0
  693. package/src/domains/job/ParsePartitionKey/ParsePartitionKey.ts +19 -0
  694. package/src/domains/job/ParsePartitionKey/index.ts +1 -0
  695. package/src/domains/job/constants/JobExecutionStatus.constants.ts +9 -0
  696. package/src/domains/job/constants/QueryParams.ts +16 -0
  697. package/src/domains/job/constants/Repository.constants.ts +18 -0
  698. package/src/domains/job/core/dynamoClient.mock.ts +34 -0
  699. package/src/domains/job/core/pagination/index.ts +3 -0
  700. package/src/domains/job/core/pagination/model/PageQuery.ts +31 -0
  701. package/src/domains/job/core/pagination/model/PaginationInfo.ts +40 -0
  702. package/src/domains/job/core/pagination/model/PaginationKey.ts +4 -0
  703. package/src/domains/job/core/pagination/model/PaginationLinks.ts +30 -0
  704. package/src/domains/job/core/pagination/model/PaginationQueryParams.ts +15 -0
  705. package/src/domains/job/core/pagination/model/PaginationQueryResponse.ts +27 -0
  706. package/src/domains/job/core/pagination/model/PaginationResponse.ts +48 -0
  707. package/src/domains/job/core/pagination/model/PaginationTypes.ts +45 -0
  708. package/src/domains/job/core/pagination/model/index.ts +8 -0
  709. package/src/domains/job/core/pagination/services/PaginationService.spec.ts +248 -0
  710. package/src/domains/job/core/pagination/services/PaginationService.ts +142 -0
  711. package/src/domains/job/core/pagination/services/index.ts +1 -0
  712. package/src/domains/job/core/pagination/utils/PaginationUtils.spec.ts +263 -0
  713. package/src/domains/job/core/pagination/utils/PaginationUtils.ts +156 -0
  714. package/src/domains/job/core/pagination/utils/index.ts +1 -0
  715. package/src/domains/job/errors/BadRequestError.ts +19 -0
  716. package/src/domains/job/errors/Error.constants.ts +34 -0
  717. package/src/domains/job/errors/ErrorWithHttpStatusCode.ts +16 -0
  718. package/src/domains/job/errors/ExecutionStatusError.ts +3 -0
  719. package/src/domains/job/errors/InternalServerError.ts +19 -0
  720. package/src/domains/job/errors/NotFoundError.ts +19 -0
  721. package/src/domains/job/errors/NotImplementedError.ts +19 -0
  722. package/src/domains/job/errors/UnprocessableContent.ts +19 -0
  723. package/src/domains/job/errors/index.ts +8 -0
  724. package/src/domains/job/index.ts +21 -0
  725. package/src/domains/job/manifest/JobManifestTypes.ts +145 -0
  726. package/src/domains/job/manifest/JobManifestV1.spec.ts +148 -0
  727. package/src/domains/job/manifest/JobManifestV1.ts +60 -0
  728. package/src/domains/job/manifest/index.ts +5 -0
  729. package/src/domains/job/manifest/mocks/JobManifest.mock.ts +35 -0
  730. package/src/domains/job/manifest/mocks/JobManifestDto.mock.ts +46 -0
  731. package/src/domains/job/manifest/mocks/JobManifestRecord.mock.ts +37 -0
  732. package/src/domains/job/manifest/mocks/JobManifestRequest.mock.ts +30 -0
  733. package/src/domains/job/model/Base/Base.ts +44 -0
  734. package/src/domains/job/model/Base/index.ts +1 -0
  735. package/src/domains/job/model/Job/Job.ts +98 -0
  736. package/src/domains/job/model/Job/index.ts +5 -0
  737. package/src/domains/job/model/Job/mocks/Job.mock.ts +26 -0
  738. package/src/domains/job/model/Job/mocks/JobDto.mock.ts +37 -0
  739. package/src/domains/job/model/Job/mocks/JobRecord.mock.ts +28 -0
  740. package/src/domains/job/model/Job/mocks/JobRequest.mock.ts +20 -0
  741. package/src/domains/job/model/JobContext/JobContext.ts +101 -0
  742. package/src/domains/job/model/JobContext/index.ts +5 -0
  743. package/src/domains/job/model/JobContext/mocks/JobContext.mock.ts +34 -0
  744. package/src/domains/job/model/JobContext/mocks/JobContextDto.mock.ts +46 -0
  745. package/src/domains/job/model/JobContext/mocks/JobContextRecord.mock.ts +32 -0
  746. package/src/domains/job/model/JobContext/mocks/JobContextRequest.mock.ts +26 -0
  747. package/src/domains/job/model/JobExecution/JobExecution.ts +220 -0
  748. package/src/domains/job/model/JobExecution/index.ts +5 -0
  749. package/src/domains/job/model/JobExecution/mocks/JobExecution.mock.ts +43 -0
  750. package/src/domains/job/model/JobExecution/mocks/JobExecutionDto.mock.ts +62 -0
  751. package/src/domains/job/model/JobExecution/mocks/JobExecutionRecord.mock.ts +47 -0
  752. package/src/domains/job/model/JobExecution/mocks/JobExecutionRequest.mock.ts +26 -0
  753. package/src/domains/job/repository/AbstractRepository.ts +219 -0
  754. package/src/domains/job/repository/JobContextRepository/JobContextRepository.spec.ts +301 -0
  755. package/src/domains/job/repository/JobContextRepository/JobContextRepository.ts +168 -0
  756. package/src/domains/job/repository/JobExecutionRepository/JobExecutionRepository.spec.ts +371 -0
  757. package/src/domains/job/repository/JobExecutionRepository/JobExecutionRepository.ts +293 -0
  758. package/src/domains/job/repository/JobManifestRepository/JobManifestRepository.spec.ts +222 -0
  759. package/src/domains/job/repository/JobManifestRepository/JobManifestRepository.ts +120 -0
  760. package/src/domains/job/repository/JobRepository/JobRepository.spec.ts +337 -0
  761. package/src/domains/job/repository/JobRepository/JobRepository.ts +188 -0
  762. package/src/domains/job/repository/index.ts +5 -0
  763. package/src/domains/job/repository/mocks/mockIoc.ts +42 -0
  764. package/src/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.defs.ts +40 -0
  765. package/src/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.spec.ts +95 -0
  766. package/src/domains/job/services/JobExecutionTaskService/JobExecutionTaskService.ts +138 -0
  767. package/src/domains/job/services/index.ts +1 -0
  768. package/src/domains/job/singletonProvider.ts +12 -0
  769. package/src/domains/job/transientProvider.ts +12 -0
  770. package/src/domains/job/utils/SlackClient/SlackClient.spec.ts +176 -0
  771. package/src/domains/job/utils/SlackClient/SlackClient.ts +132 -0
  772. package/src/domains/job/utils/SlackClient/types/SlackClient.types.ts +70 -0
  773. package/src/domains/job/utils/SortByTimeQueued/SortByTimeQueued.spec.ts +28 -0
  774. package/src/domains/job/utils/SortByTimeQueued/SortByTimeQueued.ts +21 -0
  775. package/src/domains/job/utils/index.ts +3 -0
  776. package/src/domains/manifest/AbstractManifest.ts +57 -0
  777. package/src/domains/manifest/ManifestModel.ts +9 -0
  778. package/src/domains/manifest/ManifestV1.spec.ts +436 -0
  779. package/src/domains/manifest/ManifestV1.ts +146 -0
  780. package/src/domains/manifest/errors/ManifestLocationError.ts +9 -0
  781. package/src/domains/manifest/errors/ManifestValidationError.ts +7 -0
  782. package/src/domains/manifest/index.ts +18 -0
  783. package/src/domains/manifest/services/AbstractManifestService.spec.ts +427 -0
  784. package/src/domains/manifest/services/AbstractManifestService.ts +316 -0
  785. package/src/domains/manifest/services/ComponentFunctionService.spec.ts +683 -0
  786. package/src/domains/manifest/services/ComponentFunctionService.ts +178 -0
  787. package/src/domains/manifest/services/ComponentInputValidationService.ts +22 -0
  788. package/src/domains/manifest/services/ComponentSchemaValidationService.ts +22 -0
  789. package/src/domains/manifest/services/JobFunctionService.spec.ts +165 -0
  790. package/src/domains/manifest/services/JobFunctionService.ts +25 -0
  791. package/src/domains/manifest/services/ManifestServiceForDev.spec.ts +199 -0
  792. package/src/domains/manifest/services/ManifestServiceForDev.ts +96 -0
  793. package/src/domains/manifest/services/ManifestServiceForProduction.spec.ts +90 -0
  794. package/src/domains/manifest/services/ManifestServiceForProduction.ts +98 -0
  795. package/src/domains/manifest/utils/assertFuncEntryFilesAreValid.ts +19 -0
  796. package/src/domains/manifest/utils/assertStaticFilesAreValid.ts +37 -0
  797. package/src/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.spec.ts +121 -0
  798. package/src/domains/manifest/utils/assertStaticFilesHaveAbsolutePath.ts +15 -0
  799. package/src/domains/manifest/utils/getAndAssertJobManifestVersion.spec.ts +145 -0
  800. package/src/domains/manifest/utils/getAndAssertJobManifestVersion.ts +31 -0
  801. package/src/domains/manifest/utils/getAndAssertManifestVersion.spec.ts +134 -0
  802. package/src/domains/manifest/utils/getAndAssertManifestVersion.ts +27 -0
  803. package/src/domains/manifest/utils/isValidManifestVersion.spec.ts +19 -0
  804. package/src/domains/manifest/utils/isValidManifestVersion.ts +9 -0
  805. package/src/domains/url/convertFunctionStaticFilesToFqdn.spec.ts +24 -0
  806. package/src/domains/url/convertFunctionStaticFilesToFqdn.ts +25 -0
  807. package/src/domains/url/convertFunctionStaticFilesToFqdnForPreview.spec.ts +48 -0
  808. package/src/domains/url/convertFunctionStaticFilesToFqdnForPreview.ts +25 -0
  809. package/src/domains/url/index.ts +1 -0
  810. package/src/index.ts +10 -0
  811. package/src/jest-global-setup.ts +20 -0
  812. package/src/migrations/20220704054051_initial.sql +19 -0
  813. package/src/migrations/20220718172237_adding_component_sets.sql +23 -0
  814. package/src/migrations/20220728113941_add_env_vars_field.sql +1 -0
  815. package/src/migrations/20220817113300_removing_null_props_from_jsonb.sql +41 -0
  816. package/src/migrations/20221027151225_dummy.sql +2 -0
  817. package/src/migrations/20221117151200_add_detail_columns_to_component_version.js +49 -0
  818. package/src/migrations/20221220151200_add_required_to_manifests.js +61 -0
  819. package/src/migrations/20221222151200_add_required_to_manifests.js +138 -0
  820. package/src/migrations/20223525103556_component_set_rule.sql +19 -0
  821. package/src/migrations/20230111095522_update_environment_property.js +72 -0
  822. package/src/migrations/20230203084900_ensure_static_root_exists.js +57 -0
  823. package/src/migrations/20230210143300_lowercase_all_uri_names.js +106 -0
  824. package/src/migrations/20230217151212_component_set_component_version_updates.sql +38 -0
  825. package/src/migrations/20230218121212_add_component_set_rules.js +31 -0
  826. package/tsconfig.json +16 -0
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { faker } from '@faker-js/faker/locale/en';
7
+ import { PARTITION_KEYS } from '../../../constants/Repository.constants';
8
+ import { JobContextRecord } from '../JobContext';
9
+
10
+ export const createMockJobContextRecord = (partialRecord: Partial<JobContextRecord> = {}): JobContextRecord => {
11
+ const contextName = faker.lorem.word();
12
+ const numOfEnvVars = faker.number.int({ max: 5, min: 1 });
13
+ const environment: Record<string, string> = {};
14
+ const description = faker.lorem.words();
15
+ for (let i = 0; i < numOfEnvVars; i++) {
16
+ const key = faker.lorem.word(); // Generate a random key
17
+ const value = faker.lorem.word(); // Generate a random value
18
+ environment[key] = value;
19
+ }
20
+ return {
21
+ environment,
22
+ description,
23
+ pk: PARTITION_KEYS.context,
24
+ sk: contextName,
25
+ ...partialRecord,
26
+ };
27
+ };
28
+
29
+ export const createMockJobContextRecords = (size?: number): Array<JobContextRecord> => {
30
+ const randomSize = size ?? faker.number.int({ max: 3, min: 1 });
31
+ return Array.from({ length: randomSize }).map(() => createMockJobContextRecord());
32
+ };
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { faker } from '@faker-js/faker/locale/en';
7
+ import { CreateJobContextRequest } from '../JobContext';
8
+
9
+ export const createMockCreateJobContextRequest = (
10
+ partialRecord: Partial<CreateJobContextRequest> = {},
11
+ ): CreateJobContextRequest => {
12
+ const numOfEnvVars = faker.number.int({ max: 5, min: 1 });
13
+ const environment: Record<string, string> = {};
14
+
15
+ for (let i = 0; i < numOfEnvVars; i++) {
16
+ const key = faker.lorem.word(); // Generate a random key
17
+ const value = faker.lorem.word(); // Generate a random value
18
+ environment[`${key}`] = value;
19
+ }
20
+ return {
21
+ contextName: faker.lorem.word(),
22
+ environment,
23
+ description: faker.lorem.words(),
24
+ ...partialRecord,
25
+ };
26
+ };
@@ -0,0 +1,220 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { JobExecutionStatus } from '../../constants/JobExecutionStatus.constants';
7
+ import { JobExecutionPk } from '../../constants/Repository.constants';
8
+ import { AttributeValue } from '@aws-sdk/client-dynamodb';
9
+
10
+ /**
11
+ * JobExecution interface.
12
+ * @export
13
+ * @interface JobExecution
14
+ */
15
+ export interface JobExecution {
16
+ /**
17
+ * The id of the job execution.
18
+ * @type {string}
19
+ * @memberof JobExecution
20
+ */
21
+ id: string;
22
+
23
+ /**
24
+ * The name of the job.
25
+ * @type {string}
26
+ * @memberof JobExecution
27
+ */
28
+ jobName: string;
29
+
30
+ /**
31
+ * The id of the context to run the job against.
32
+ * @type {string}
33
+ * @memberof JobExecution
34
+ */
35
+ context: string;
36
+
37
+ /**
38
+ * The status of the job run.
39
+ * @type {string}
40
+ * @memberof JobExecution
41
+ */
42
+ status: JobExecutionStatus;
43
+
44
+ /**
45
+ * The time the job execution was added to the queue.
46
+ * @type {string}
47
+ * @memberof JobExecution
48
+ */
49
+ timeQueued: string;
50
+
51
+ /**
52
+ * The version of the job script to execute.
53
+ * @type {(string)}
54
+ * @memberof JobExecution
55
+ */
56
+ version: string;
57
+
58
+ /**
59
+ * The ECS task ID of the job run.
60
+ * @type {(string | null)}
61
+ * @memberof JobExecution
62
+ */
63
+ ecsTaskId: string | null;
64
+
65
+ /**
66
+ * The time the job run was started.
67
+ * @type {(string | null)}
68
+ * @memberof JobExecution
69
+ */
70
+ timeStarted: string | null;
71
+
72
+ /**
73
+ * The time the job run was finished.
74
+ * @type {(string | null)}
75
+ * @memberof JobExecution
76
+ */
77
+ timeFinished: string | null;
78
+
79
+ /**
80
+ * The input to the job.
81
+ * @type {any}
82
+ * @memberof JobExecution
83
+ */
84
+ input: any;
85
+
86
+ /**
87
+ * The DynamoDB record type (dynamic, 'jobExecution-<jobName>').
88
+ * @type {JobExecutionPk}
89
+ * @memberof JobExecution
90
+ */
91
+ type: JobExecutionPk;
92
+ }
93
+
94
+ /**
95
+ * The JobExecution record attributes stored in DynamoDB.
96
+ * @export
97
+ * @interface JobExecutionRecord
98
+ */
99
+ export interface JobExecutionRecord {
100
+ /**
101
+ * The partition key (dynamic, 'jobExecution-<jobName>').
102
+ * @type {JobExecutionPk}
103
+ * @memberof JobExecutionRecord
104
+ */
105
+ pk: JobExecutionPk;
106
+
107
+ /**
108
+ * The sort key ('timeQueued-id').
109
+ * @type {string}
110
+ * @memberof JobExecutionRecord
111
+ */
112
+ sk: string;
113
+
114
+ /**
115
+ * The name of the job to execute.
116
+ * @type {string}
117
+ * @memberof JobExecutionRecord
118
+ */
119
+ jobName: string;
120
+
121
+ /**
122
+ * The id of the job execution.
123
+ * @type {string}
124
+ * @memberof JobExecutionRecord
125
+ */
126
+ id: string;
127
+
128
+ /**
129
+ * The time the job execution was added to the queue.
130
+ * @type {string}
131
+ * @memberof JobExecutionRecord
132
+ */
133
+ timeQueued: string;
134
+
135
+ /**
136
+ * The id of the context to run the job against.
137
+ * @type {string}
138
+ * @memberof JobExecutionRecord
139
+ */
140
+ context: string;
141
+
142
+ /**
143
+ * The status of the job run.
144
+ * @type {JobExecutionStatus}
145
+ * @memberof JobExecutionRecord
146
+ */
147
+ status: JobExecutionStatus;
148
+
149
+ /**
150
+ * The version of the job script to execute.
151
+ * @type @type {(string)}
152
+ * @memberof JobExecutionRecord
153
+ */
154
+ version: string;
155
+
156
+ /**
157
+ * The ECS task ID of the job run.
158
+ * @type @type {(string | null)}
159
+ * @memberof JobExecutionRecord
160
+ */
161
+ ecsTaskId: string | null;
162
+
163
+ /**
164
+ * The time the job run was started.
165
+ * @type @type {(string | null)}
166
+ * @memberof JobExecutionRecord
167
+ */
168
+ timeStarted: string | null;
169
+
170
+ /**
171
+ * The time the job run was finished.
172
+ * @type {(string | null)}
173
+ * @memberof JobExecutionRecord
174
+ */
175
+ timeFinished: string | null;
176
+
177
+ /**
178
+ * The input to the job.
179
+ * @type {any}
180
+ * @memberof JobExecutionRecord
181
+ */
182
+ input: any;
183
+ }
184
+
185
+ export type JobExecutionDto = Record<keyof JobExecutionRecord, AttributeValue>;
186
+
187
+ /**
188
+ * The request body for adding an item to the job queue (POST /job/begin).
189
+ * @export
190
+ */
191
+ export type BeginJobExecutionRequest = Pick<JobExecution, 'jobName' | 'context'> & Partial<Pick<JobExecution, 'input'>>;
192
+
193
+ /**
194
+ * The parameters for creating a job execution entity in the DB.
195
+ * @export
196
+ */
197
+ export type CreateJobExecutionRequest = Pick<JobExecution, 'jobName' | 'version' | 'context'> &
198
+ Partial<Pick<JobExecution, 'input'>>;
199
+
200
+ /**
201
+ * The request body for terminating a job in the job queue (POST /job/terminate).
202
+ * @export
203
+ */
204
+ export interface TerminateJobExecutionRequest {
205
+ jobName: string;
206
+ executionId: string;
207
+ reason: string;
208
+ }
209
+
210
+ /**
211
+ * The parameters for listing job executions.
212
+ * @export
213
+ */
214
+ export type ListJobExecutionParameters = Partial<Pick<JobExecution, 'jobName' | 'status'>>;
215
+
216
+ /**
217
+ * The parameters for updating job executions.
218
+ * @export
219
+ */
220
+ export type UpdateJobExecutionParameters = Partial<Omit<JobExecution, 'id' | 'jobName' | 'timeQueued' | 'type'>>;
@@ -0,0 +1,5 @@
1
+ export * from './JobExecution';
2
+ export * from './mocks/JobExecution.mock';
3
+ export * from './mocks/JobExecutionDto.mock';
4
+ export * from './mocks/JobExecutionRecord.mock';
5
+ export * from './mocks/JobExecutionRequest.mock';
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { JOB_EXECUTION_STATUS } from '../../../constants/JobExecutionStatus.constants';
7
+ import { PARTITION_KEYS } from '../../../constants/Repository.constants';
8
+ import { faker } from '@faker-js/faker/locale/en';
9
+ import { JobExecution } from '../JobExecution';
10
+
11
+ export const createMockJobExecution = (partialRecord: Partial<JobExecution> = {}): JobExecution => {
12
+ const version = Array.from({ length: 3 })
13
+ .map(() => faker.number.int())
14
+ .join('.');
15
+ const input = faker.helpers.arrayElement([
16
+ faker.datatype.boolean(),
17
+ faker.lorem.word(),
18
+ faker.number.int(),
19
+ { [faker.lorem.word()]: faker.lorem.words() },
20
+ null,
21
+ ]);
22
+ const jobName = faker.lorem.word();
23
+ const timeQueued = new Date().toISOString();
24
+ return {
25
+ context: faker.string.uuid(),
26
+ ecsTaskId: null,
27
+ id: `${timeQueued}-${faker.string.uuid()}`,
28
+ jobName,
29
+ status: JOB_EXECUTION_STATUS.queued,
30
+ timeFinished: null,
31
+ timeQueued,
32
+ timeStarted: null,
33
+ type: `${PARTITION_KEYS.jobExecution}-${jobName}`,
34
+ version,
35
+ input,
36
+ ...partialRecord,
37
+ };
38
+ };
39
+
40
+ export const createMockJobExecutions = (size?: number): Array<JobExecution> => {
41
+ const randomSize = size ?? faker.number.int({ max: 3, min: 1 });
42
+ return Array.from({ length: randomSize }).map(() => createMockJobExecution());
43
+ };
@@ -0,0 +1,62 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { JOB_EXECUTION_STATUS } from '../../../constants/JobExecutionStatus.constants';
7
+ import { PARTITION_KEYS } from '../../../constants/Repository.constants';
8
+ import { faker } from '@faker-js/faker/locale/en';
9
+ import { JobExecutionDto, JobExecutionRecord } from '../JobExecution';
10
+
11
+ export const createMockJobExecutionDto = (partialRecord: Partial<JobExecutionRecord> = {}): JobExecutionDto => {
12
+ const jobName = faker.lorem.word();
13
+ const timeQueued = faker.date.recent().toISOString();
14
+ const id = `${timeQueued}-${faker.string.uuid()}`;
15
+ const version = Array.from({ length: 3 })
16
+ .map(() => faker.number.int())
17
+ .join('.');
18
+ const input = faker.helpers.arrayElement([
19
+ faker.datatype.boolean(),
20
+ faker.lorem.word(),
21
+ faker.number.int(),
22
+ { [faker.lorem.word()]: faker.lorem.words },
23
+ null,
24
+ undefined,
25
+ ]);
26
+
27
+ return {
28
+ context: {
29
+ S: partialRecord.context ?? faker.string.uuid(),
30
+ },
31
+ ecsTaskId: partialRecord.ecsTaskId ? { S: partialRecord.ecsTaskId } : { NULL: true },
32
+ id: {
33
+ S: partialRecord.id ?? id,
34
+ },
35
+ jobName: {
36
+ S: partialRecord.jobName ?? jobName,
37
+ },
38
+ pk: {
39
+ S: partialRecord.pk ?? `${PARTITION_KEYS.jobExecution}-${partialRecord.jobName ?? jobName}`,
40
+ },
41
+ sk: {
42
+ S: partialRecord.sk ?? `${timeQueued}-${id}`,
43
+ },
44
+ status: {
45
+ S: partialRecord.status ?? faker.helpers.arrayElement(Object.values(JOB_EXECUTION_STATUS)),
46
+ },
47
+ timeFinished: partialRecord.timeFinished ? { S: partialRecord.timeFinished } : { NULL: true },
48
+ timeQueued: {
49
+ S: partialRecord.timeQueued ?? timeQueued,
50
+ },
51
+ timeStarted: partialRecord.timeStarted ? { S: partialRecord.timeStarted } : { NULL: true },
52
+ version: {
53
+ S: partialRecord.version ?? version,
54
+ },
55
+ input: input ? { S: JSON.stringify(input) } : { NULL: true },
56
+ };
57
+ };
58
+
59
+ export const createMockJobExecutionDtos = (size?: number): Array<JobExecutionDto> => {
60
+ const randomSize = size ?? faker.number.int({ max: 3, min: 1 });
61
+ return Array.from({ length: randomSize }).map(() => createMockJobExecutionDto());
62
+ };
@@ -0,0 +1,47 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { JOB_EXECUTION_STATUS } from '../../../constants/JobExecutionStatus.constants';
7
+ import { PARTITION_KEYS } from '../../../constants/Repository.constants';
8
+ import { faker } from '@faker-js/faker/locale/en';
9
+ import { JobExecutionRecord } from '../JobExecution';
10
+
11
+ export const createMockJobExecutionRecord = (partialRecord: Partial<JobExecutionRecord> = {}): JobExecutionRecord => {
12
+ const jobName = faker.lorem.word();
13
+ const id = faker.string.uuid();
14
+ const timeQueued = faker.date.recent().toISOString();
15
+ const version = Array.from({ length: 3 })
16
+ .map(() => faker.number.int())
17
+ .join('.');
18
+ const input = faker.helpers.arrayElement([
19
+ faker.datatype.boolean(),
20
+ faker.lorem.word(),
21
+ faker.number.int(),
22
+ { [faker.lorem.word()]: faker.lorem.words },
23
+ null,
24
+ undefined,
25
+ ]);
26
+
27
+ return {
28
+ context: faker.string.uuid(),
29
+ ecsTaskId: null,
30
+ id: id,
31
+ jobName: jobName,
32
+ pk: `${PARTITION_KEYS.jobExecution}-${jobName}`,
33
+ sk: `${timeQueued}-${id}`,
34
+ status: faker.helpers.objectValue(JOB_EXECUTION_STATUS),
35
+ timeFinished: null,
36
+ timeQueued: timeQueued,
37
+ timeStarted: null,
38
+ version,
39
+ input,
40
+ ...partialRecord,
41
+ };
42
+ };
43
+
44
+ export const createMockJobExecutionRecords = (size?: number): Array<JobExecutionRecord> => {
45
+ const randomSize = size ?? faker.number.int({ max: 3, min: 1 });
46
+ return Array.from({ length: randomSize }).map(() => createMockJobExecutionRecord());
47
+ };
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+
6
+ import { faker } from '@faker-js/faker/locale/en';
7
+ import { BeginJobExecutionRequest } from '../JobExecution';
8
+
9
+ export const createMockBeginJobExecutionRequest = (
10
+ partialRecord: Partial<BeginJobExecutionRequest> = {},
11
+ ): BeginJobExecutionRequest => {
12
+ const input = faker.helpers.arrayElement([
13
+ faker.datatype.boolean(),
14
+ faker.lorem.word(),
15
+ faker.number.int(),
16
+ { [faker.lorem.word()]: faker.lorem.words() },
17
+ null,
18
+ ]);
19
+
20
+ return {
21
+ context: faker.string.uuid(),
22
+ jobName: faker.lorem.word(),
23
+ input,
24
+ ...partialRecord,
25
+ };
26
+ };
@@ -0,0 +1,219 @@
1
+ /*!
2
+ * @license
3
+ * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
+ */
5
+ import { injectable } from 'inversify';
6
+ import 'reflect-metadata';
7
+ import {
8
+ AttributeValue,
9
+ DeleteItemCommand,
10
+ DeleteItemCommandInput,
11
+ DynamoDBClient,
12
+ GetItemCommand,
13
+ GetItemCommandInput,
14
+ PutItemCommand,
15
+ ScanCommand,
16
+ ScanCommandInput,
17
+ ScanCommandOutput,
18
+ UpdateItemCommand,
19
+ UpdateItemCommandInput,
20
+ } from '@aws-sdk/client-dynamodb';
21
+ import { parsePartitionKey } from '../ParsePartitionKey';
22
+ import { PartitionKey } from '../constants/Repository.constants';
23
+ import { BaseDto, BaseItem } from '../../job/model/Base/Base';
24
+
25
+ /**
26
+ * Generic abstract class for representing repositories interacting with DynamoDB.
27
+ * @export
28
+ * @abstract
29
+ * @class Repository
30
+ * @template T The entity definition.
31
+ * @template U The corresponding DB record attributes for the entity.
32
+ */
33
+ @injectable()
34
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
35
+ export abstract class Repository<T extends BaseItem, U extends BaseDto> {
36
+ protected pk: PartitionKey;
37
+ protected tableName: string;
38
+
39
+ public constructor(protected dynamoDbClient: DynamoDBClient) {
40
+ // HACK: workaround to address inheritance issue in InversifyJS
41
+ // Reference: https://github.com/inversify/InversifyJS/blob/master/wiki/inheritance.md
42
+
43
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
44
+ // @ts-ignore @ts-2322
45
+ this.pk = null;
46
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
47
+ // @ts-ignore @ts-2322
48
+ this.tableName = null;
49
+ }
50
+
51
+ /**
52
+ * Save item into database.
53
+ * @abstract
54
+ * @param {*} input The item to store.
55
+ * @returns {Promise<T>} The item stored.
56
+ * @memberof Repository
57
+ */
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ async create(input: T): Promise<T> {
60
+ const dynamoDbRecord = this.convertToDynamoDbItem(input);
61
+
62
+ await this.dynamoDbClient.send(
63
+ new PutItemCommand({
64
+ Item: dynamoDbRecord,
65
+ TableName: this.tableName,
66
+ }),
67
+ );
68
+
69
+ return input;
70
+ }
71
+
72
+ /**
73
+ * Get one record from database.
74
+ * @abstract
75
+ * @param {string} sk The sort key used to identify the record.
76
+ * @returns {Promise<T | null>} The retrieved record.
77
+ * @memberof Repository
78
+ */
79
+ async findOne(sk: string): Promise<T | null> {
80
+ const params: GetItemCommandInput = {
81
+ Key: {
82
+ pk: { S: parsePartitionKey(this.pk) },
83
+ sk: { S: sk },
84
+ },
85
+ TableName: this.tableName,
86
+ };
87
+ const res = await this.dynamoDbClient.send(new GetItemCommand(params));
88
+ return res.Item ? this.convertToItem(res.Item as U) : null;
89
+ }
90
+
91
+ /**
92
+ * Get list of records from database.
93
+ * @abstract
94
+ * @returns {Promise<Array<T>>} The retrieved records.
95
+ * @memberof Repository
96
+ */
97
+ async list(): Promise<Array<T>> {
98
+ const params: ScanCommandInput = {
99
+ ExpressionAttributeNames: {
100
+ '#pk': 'pk',
101
+ },
102
+ ExpressionAttributeValues: {
103
+ ':pk': { S: this.pk },
104
+ },
105
+ FilterExpression: '#pk = :pk',
106
+ TableName: this.tableName,
107
+ };
108
+
109
+ // Apply pagination for the scan.
110
+ // By default, the Scan operation processes data sequentially.
111
+ // DynamoDB returns data in increments of 1 MB increments.
112
+
113
+ let startKey; /* Indicator of where to paginate from. */
114
+ const results: Array<Record<string, AttributeValue>> = [];
115
+
116
+ // Iterate through pages until no more results are found.
117
+ while (startKey !== null) {
118
+ const res: ScanCommandOutput = await this.dynamoDbClient.send(
119
+ new ScanCommand({ ...params, ExclusiveStartKey: startKey }),
120
+ );
121
+
122
+ if (!res) {
123
+ // Stop paginating if result is unexpected.
124
+ startKey = null;
125
+ } else {
126
+ results.push(...(res.Items ?? []));
127
+
128
+ // If no more results, set key to null to terminate loop
129
+ startKey = res.LastEvaluatedKey ?? null;
130
+ }
131
+ }
132
+
133
+ return results.length ? results.map((item) => this.convertToItem(item as U)) : [];
134
+ }
135
+
136
+ /**
137
+ * Update record in database.
138
+ * @param {string} sk The sort key used to identify the record.
139
+ * @param {Partial<T>} input The (partial) record to update.
140
+ * @returns {Promise<T | null>} The updated record.
141
+ * @memberof Repository
142
+ */
143
+ async update(sk: string, input: Partial<T>): Promise<T | null> {
144
+ // Initialise update command
145
+ const updateParams: UpdateItemCommandInput = {
146
+ Key: {
147
+ pk: { S: this.pk },
148
+ sk: { S: sk },
149
+ },
150
+ ReturnValues: 'ALL_NEW',
151
+ TableName: this.tableName,
152
+ };
153
+
154
+ const expressionAttributeNames: Record<string, string> = {};
155
+ const expressionAttributeValues: Record<string, AttributeValue> = {};
156
+
157
+ // To avoid conflict with reserved keywords, refer to attributes with an additional '#' prefix
158
+ for (const key of Object.keys(input)) {
159
+ if (input[key as keyof Partial<T>] === null) {
160
+ expressionAttributeNames[`#${key}`] = key;
161
+ expressionAttributeValues[`:${key}`] = { NULL: true };
162
+ } else {
163
+ const val: string = input[key as keyof Partial<T>] as string;
164
+ expressionAttributeNames[`#${key}`] = key;
165
+ expressionAttributeValues[`:${key}`] = { S: val };
166
+ }
167
+ }
168
+
169
+ const updateExpressionPairs = Object.keys(input).map((key) => `#${key} = :${key}`);
170
+ const updateExpression = `SET ${updateExpressionPairs.join(', ')}`;
171
+
172
+ updateParams.ExpressionAttributeNames = expressionAttributeNames;
173
+ updateParams.ExpressionAttributeValues = expressionAttributeValues;
174
+ updateParams.UpdateExpression = updateExpression;
175
+
176
+ const updateItemCommand = new UpdateItemCommand(updateParams);
177
+ const updatedRecord = await this.dynamoDbClient.send(updateItemCommand);
178
+
179
+ return updatedRecord.Attributes ? this.convertToItem(updatedRecord.Attributes as U) : null;
180
+ }
181
+
182
+ /**
183
+ * Delete record from database.
184
+ * @abstract
185
+ * @param {string} sk The sort key used to identify the record.
186
+ * @returns {void}
187
+ * @memberof Repository
188
+ */
189
+ async delete(sk: string): Promise<void> {
190
+ const deleteCommandParams: DeleteItemCommandInput = {
191
+ Key: {
192
+ pk: { S: this.pk },
193
+ sk: { S: sk },
194
+ },
195
+ TableName: this.tableName,
196
+ };
197
+
198
+ await this.dynamoDbClient.send(new DeleteItemCommand(deleteCommandParams));
199
+ return;
200
+ }
201
+
202
+ /**
203
+ * Convert the DynanomDB attributes of the entity into a DynamoDB item.
204
+ * @abstract
205
+ * @param {U} attributes The DynamoDB item attributes to convert.
206
+ * @returns {Record<keyof U, AttributeValue>} The DynamoDB record.
207
+ * @memberof Repository
208
+ */
209
+ protected abstract convertToDynamoDbItem(item: T): Record<keyof U, AttributeValue>;
210
+
211
+ /**
212
+ * Convert DynamoDB item to entity.
213
+ * @abstract
214
+ * @param {Record<string, AttributeValue>} record The record to convert.
215
+ * @returns {T} The converted entity.
216
+ * @memberof Repository
217
+ */
218
+ protected abstract convertToItem(record: U): T;
219
+ }