@rocketmakers/orbit-capsule-utils 0.18.0 → 2.0.0-beta.10

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 (420) hide show
  1. package/README.md +3 -49
  2. package/lib/bootstrap/boot.d.ts +7 -10
  3. package/lib/bootstrap/boot.d.ts.map +1 -0
  4. package/lib/bootstrap/boot.js +26 -24
  5. package/lib/bootstrap/boot.js.map +1 -1
  6. package/lib/bootstrap/common.d.ts +2 -13
  7. package/lib/bootstrap/common.d.ts.map +1 -0
  8. package/lib/bootstrap/common.js +2 -48
  9. package/lib/bootstrap/common.js.map +1 -1
  10. package/lib/bootstrap/createExpressApp.d.ts +9 -3
  11. package/lib/bootstrap/createExpressApp.d.ts.map +1 -0
  12. package/lib/bootstrap/createExpressApp.js +18 -42
  13. package/lib/bootstrap/createExpressApp.js.map +1 -1
  14. package/lib/bootstrap/index.d.ts +2 -2
  15. package/lib/bootstrap/index.d.ts.map +1 -0
  16. package/lib/bootstrap/index.js +1 -2
  17. package/lib/bootstrap/index.js.map +1 -1
  18. package/lib/bootstrap/ioc/index.d.ts +3 -0
  19. package/lib/bootstrap/ioc/index.d.ts.map +1 -0
  20. package/lib/bootstrap/ioc/index.js +6 -0
  21. package/lib/bootstrap/ioc/index.js.map +1 -0
  22. package/lib/bootstrap/ioc/register.d.ts +5 -0
  23. package/lib/bootstrap/ioc/register.d.ts.map +1 -0
  24. package/lib/bootstrap/ioc/register.js +16 -0
  25. package/lib/bootstrap/ioc/register.js.map +1 -0
  26. package/lib/bootstrap/ioc/tsoaIoc.d.ts +9 -0
  27. package/lib/bootstrap/ioc/tsoaIoc.d.ts.map +1 -0
  28. package/lib/bootstrap/ioc/tsoaIoc.helper.d.ts +4 -0
  29. package/lib/bootstrap/ioc/tsoaIoc.helper.d.ts.map +1 -0
  30. package/lib/bootstrap/ioc/tsoaIoc.helper.js +15 -0
  31. package/lib/bootstrap/ioc/tsoaIoc.helper.js.map +1 -0
  32. package/lib/bootstrap/ioc/tsoaIoc.js +12 -0
  33. package/lib/bootstrap/ioc/tsoaIoc.js.map +1 -0
  34. package/lib/bootstrap/ioc/types.d.ts +10 -0
  35. package/lib/bootstrap/ioc/types.d.ts.map +1 -0
  36. package/lib/{core/dto.js → bootstrap/ioc/types.js} +1 -1
  37. package/lib/bootstrap/ioc/types.js.map +1 -0
  38. package/lib/config/app.d.ts +9 -58
  39. package/lib/config/app.d.ts.map +1 -0
  40. package/lib/config/app.js +9 -133
  41. package/lib/config/app.js.map +1 -1
  42. package/lib/config/environment.generated.d.ts +7 -0
  43. package/lib/config/environment.generated.d.ts.map +1 -0
  44. package/lib/config/environment.generated.js +25 -0
  45. package/lib/config/environment.generated.js.map +1 -0
  46. package/lib/config/index.d.ts +2 -0
  47. package/lib/config/index.d.ts.map +1 -0
  48. package/lib/config/index.js +1 -0
  49. package/lib/config/index.js.map +1 -1
  50. package/lib/database/connectionFactory.d.ts +5 -1
  51. package/lib/database/connectionFactory.d.ts.map +1 -0
  52. package/lib/database/connectionFactory.js +6 -7
  53. package/lib/database/connectionFactory.js.map +1 -1
  54. package/lib/database/index.d.ts +1 -7
  55. package/lib/database/index.d.ts.map +1 -0
  56. package/lib/database/index.js +0 -7
  57. package/lib/database/index.js.map +1 -1
  58. package/lib/index.d.ts +2 -10
  59. package/lib/index.d.ts.map +1 -0
  60. package/lib/index.js +1 -10
  61. package/lib/index.js.map +1 -1
  62. package/lib/middleware/errors.d.ts +2 -1
  63. package/lib/middleware/errors.d.ts.map +1 -0
  64. package/lib/middleware/errors.js +16 -12
  65. package/lib/middleware/errors.js.map +1 -1
  66. package/lib/middleware/index.d.ts +1 -1
  67. package/lib/middleware/index.d.ts.map +1 -0
  68. package/lib/middleware/index.js +0 -1
  69. package/lib/middleware/index.js.map +1 -1
  70. package/lib/rest/health.d.ts +7 -0
  71. package/lib/rest/health.d.ts.map +1 -0
  72. package/lib/{controllers → rest}/health.js +16 -16
  73. package/lib/rest/health.js.map +1 -0
  74. package/lib/rest/index.d.ts +2 -0
  75. package/lib/rest/index.d.ts.map +1 -0
  76. package/lib/{controllers → rest}/index.js +0 -0
  77. package/lib/rest/index.js.map +1 -0
  78. package/lib/tsconfig.tsbuildinfo +1 -22111
  79. package/lib/utils/capsules.d.ts +11 -0
  80. package/lib/utils/capsules.d.ts.map +1 -0
  81. package/lib/utils/capsules.js +31 -0
  82. package/lib/utils/capsules.js.map +1 -0
  83. package/lib/utils/index.d.ts +2 -10
  84. package/lib/utils/index.d.ts.map +1 -0
  85. package/lib/utils/index.js +1 -10
  86. package/lib/utils/index.js.map +1 -1
  87. package/package.json +51 -72
  88. package/.npm-version +0 -1
  89. package/check-npm.js +0 -37
  90. package/lib/_tests/assertHelpers/array.d.ts +0 -1
  91. package/lib/_tests/assertHelpers/array.js +0 -22
  92. package/lib/_tests/assertHelpers/array.js.map +0 -1
  93. package/lib/_tests/assertHelpers/authorisation.d.ts +0 -9
  94. package/lib/_tests/assertHelpers/authorisation.js +0 -94
  95. package/lib/_tests/assertHelpers/authorisation.js.map +0 -1
  96. package/lib/_tests/assertHelpers/context.d.ts +0 -3
  97. package/lib/_tests/assertHelpers/context.js +0 -13
  98. package/lib/_tests/assertHelpers/context.js.map +0 -1
  99. package/lib/_tests/assertHelpers/core.d.ts +0 -2
  100. package/lib/_tests/assertHelpers/core.js +0 -39
  101. package/lib/_tests/assertHelpers/core.js.map +0 -1
  102. package/lib/_tests/assertHelpers/string.d.ts +0 -4
  103. package/lib/_tests/assertHelpers/string.js +0 -81
  104. package/lib/_tests/assertHelpers/string.js.map +0 -1
  105. package/lib/_tests/assertHelpers/validation.d.ts +0 -14
  106. package/lib/_tests/assertHelpers/validation.js +0 -60
  107. package/lib/_tests/assertHelpers/validation.js.map +0 -1
  108. package/lib/_tests/common.d.ts +0 -5
  109. package/lib/_tests/common.js +0 -32
  110. package/lib/_tests/common.js.map +0 -1
  111. package/lib/_tests/factories/context.d.ts +0 -43
  112. package/lib/_tests/factories/context.js +0 -142
  113. package/lib/_tests/factories/context.js.map +0 -1
  114. package/lib/_tests/factories/transaction.d.ts +0 -2
  115. package/lib/_tests/factories/transaction.js +0 -8
  116. package/lib/_tests/factories/transaction.js.map +0 -1
  117. package/lib/_tests/services/claims/claims.test.d.ts +0 -1
  118. package/lib/_tests/services/claims/claims.test.js +0 -51
  119. package/lib/_tests/services/claims/claims.test.js.map +0 -1
  120. package/lib/_tests/services/encryption/encryptDecrypt.test.d.ts +0 -1
  121. package/lib/_tests/services/encryption/encryptDecrypt.test.js +0 -104
  122. package/lib/_tests/services/encryption/encryptDecrypt.test.js.map +0 -1
  123. package/lib/_tests/services/encryption/mockedService.d.ts +0 -6
  124. package/lib/_tests/services/encryption/mockedService.js +0 -12
  125. package/lib/_tests/services/encryption/mockedService.js.map +0 -1
  126. package/lib/_tests/tasks/factories/scheduledTask.d.ts +0 -2
  127. package/lib/_tests/tasks/factories/scheduledTask.js +0 -23
  128. package/lib/_tests/tasks/factories/scheduledTask.js.map +0 -1
  129. package/lib/_tests/tasks/factories/task.d.ts +0 -3
  130. package/lib/_tests/tasks/factories/task.js +0 -23
  131. package/lib/_tests/tasks/factories/task.js.map +0 -1
  132. package/lib/_tests/tasks/services/taskService/index.test.d.ts +0 -1
  133. package/lib/_tests/tasks/services/taskService/index.test.js +0 -9
  134. package/lib/_tests/tasks/services/taskService/index.test.js.map +0 -1
  135. package/lib/_tests/tasks/services/taskService/mockedService.d.ts +0 -25
  136. package/lib/_tests/tasks/services/taskService/mockedService.js +0 -60
  137. package/lib/_tests/tasks/services/taskService/mockedService.js.map +0 -1
  138. package/lib/_tests/tasks/services/taskService/process.d.ts +0 -1
  139. package/lib/_tests/tasks/services/taskService/process.js +0 -127
  140. package/lib/_tests/tasks/services/taskService/process.js.map +0 -1
  141. package/lib/_tests/tasks/services/taskService/schedule.d.ts +0 -1
  142. package/lib/_tests/tasks/services/taskService/schedule.js +0 -100
  143. package/lib/_tests/tasks/services/taskService/schedule.js.map +0 -1
  144. package/lib/_tests/tracing/decorators/tracing.test.d.ts +0 -1
  145. package/lib/_tests/tracing/decorators/tracing.test.js +0 -44
  146. package/lib/_tests/tracing/decorators/tracing.test.js.map +0 -1
  147. package/lib/_tests/utils/array.test.d.ts +0 -1
  148. package/lib/_tests/utils/array.test.js +0 -105
  149. package/lib/_tests/utils/array.test.js.map +0 -1
  150. package/lib/_tests/utils/dates.test.d.ts +0 -1
  151. package/lib/_tests/utils/dates.test.js +0 -63
  152. package/lib/_tests/utils/dates.test.js.map +0 -1
  153. package/lib/_tests/utils/errors.d.ts +0 -6
  154. package/lib/_tests/utils/errors.js +0 -30
  155. package/lib/_tests/utils/errors.js.map +0 -1
  156. package/lib/auth/authorisation.d.ts +0 -22
  157. package/lib/auth/authorisation.js +0 -198
  158. package/lib/auth/authorisation.js.map +0 -1
  159. package/lib/auth/claims.d.ts +0 -4
  160. package/lib/auth/claims.js +0 -11
  161. package/lib/auth/claims.js.map +0 -1
  162. package/lib/auth/context.d.ts +0 -23
  163. package/lib/auth/context.js +0 -58
  164. package/lib/auth/context.js.map +0 -1
  165. package/lib/auth/index.d.ts +0 -7
  166. package/lib/auth/index.js +0 -11
  167. package/lib/auth/index.js.map +0 -1
  168. package/lib/auth/interfaces.d.ts +0 -5
  169. package/lib/auth/interfaces.js +0 -3
  170. package/lib/auth/interfaces.js.map +0 -1
  171. package/lib/auth/session.d.ts +0 -15
  172. package/lib/auth/session.js +0 -3
  173. package/lib/auth/session.js.map +0 -1
  174. package/lib/auth/tokenParser.d.ts +0 -21
  175. package/lib/auth/tokenParser.js +0 -120
  176. package/lib/auth/tokenParser.js.map +0 -1
  177. package/lib/auth/user.d.ts +0 -63
  178. package/lib/auth/user.js +0 -27
  179. package/lib/auth/user.js.map +0 -1
  180. package/lib/bootstrap/kernel.d.ts +0 -24
  181. package/lib/bootstrap/kernel.js +0 -76
  182. package/lib/bootstrap/kernel.js.map +0 -1
  183. package/lib/bootstrap/request.d.ts +0 -41
  184. package/lib/bootstrap/request.js +0 -50
  185. package/lib/bootstrap/request.js.map +0 -1
  186. package/lib/build/config.d.ts +0 -20
  187. package/lib/build/config.js +0 -3
  188. package/lib/build/config.js.map +0 -1
  189. package/lib/build/index.d.ts +0 -1
  190. package/lib/build/index.js +0 -5
  191. package/lib/build/index.js.map +0 -1
  192. package/lib/controllers/health.d.ts +0 -7
  193. package/lib/controllers/health.js.map +0 -1
  194. package/lib/controllers/index.d.ts +0 -1
  195. package/lib/controllers/index.js.map +0 -1
  196. package/lib/core/arrays.d.ts +0 -1
  197. package/lib/core/arrays.js +0 -3
  198. package/lib/core/arrays.js.map +0 -1
  199. package/lib/core/dto.d.ts +0 -26
  200. package/lib/core/dto.js.map +0 -1
  201. package/lib/core/errors.d.ts +0 -51
  202. package/lib/core/errors.js +0 -155
  203. package/lib/core/errors.js.map +0 -1
  204. package/lib/core/index.d.ts +0 -7
  205. package/lib/core/index.js +0 -11
  206. package/lib/core/index.js.map +0 -1
  207. package/lib/core/opaqueTypes.d.ts +0 -12
  208. package/lib/core/opaqueTypes.js +0 -8
  209. package/lib/core/opaqueTypes.js.map +0 -1
  210. package/lib/core/pagination.d.ts +0 -32
  211. package/lib/core/pagination.js +0 -66
  212. package/lib/core/pagination.js.map +0 -1
  213. package/lib/core/query.d.ts +0 -21
  214. package/lib/core/query.js +0 -17
  215. package/lib/core/query.js.map +0 -1
  216. package/lib/core/serverError.d.ts +0 -42
  217. package/lib/core/serverError.js +0 -86
  218. package/lib/core/serverError.js.map +0 -1
  219. package/lib/core/types.d.ts +0 -37
  220. package/lib/core/types.js +0 -46
  221. package/lib/core/types.js.map +0 -1
  222. package/lib/database/columns.d.ts +0 -5
  223. package/lib/database/columns.js +0 -14
  224. package/lib/database/columns.js.map +0 -1
  225. package/lib/database/dataContext.d.ts +0 -14
  226. package/lib/database/dataContext.js +0 -26
  227. package/lib/database/dataContext.js.map +0 -1
  228. package/lib/database/entities.d.ts +0 -10
  229. package/lib/database/entities.js +0 -29
  230. package/lib/database/entities.js.map +0 -1
  231. package/lib/database/query.d.ts +0 -3
  232. package/lib/database/query.js +0 -51
  233. package/lib/database/query.js.map +0 -1
  234. package/lib/database/relationsBuilder.d.ts +0 -6
  235. package/lib/database/relationsBuilder.js +0 -33
  236. package/lib/database/relationsBuilder.js.map +0 -1
  237. package/lib/database/repository.d.ts +0 -32
  238. package/lib/database/repository.js +0 -157
  239. package/lib/database/repository.js.map +0 -1
  240. package/lib/database/select.d.ts +0 -4
  241. package/lib/database/select.js +0 -27
  242. package/lib/database/select.js.map +0 -1
  243. package/lib/database/transformers.d.ts +0 -12
  244. package/lib/database/transformers.js +0 -38
  245. package/lib/database/transformers.js.map +0 -1
  246. package/lib/graphql/GraphqlController.d.ts +0 -12
  247. package/lib/graphql/GraphqlController.js +0 -81
  248. package/lib/graphql/GraphqlController.js.map +0 -1
  249. package/lib/graphql/index.d.ts +0 -4
  250. package/lib/graphql/index.js +0 -8
  251. package/lib/graphql/index.js.map +0 -1
  252. package/lib/graphql/init.d.ts +0 -9
  253. package/lib/graphql/init.js +0 -51
  254. package/lib/graphql/init.js.map +0 -1
  255. package/lib/graphql/registrations.d.ts +0 -7
  256. package/lib/graphql/registrations.js +0 -16
  257. package/lib/graphql/registrations.js.map +0 -1
  258. package/lib/graphql/types/InputTypes/index.d.ts +0 -2
  259. package/lib/graphql/types/InputTypes/index.js +0 -6
  260. package/lib/graphql/types/InputTypes/index.js.map +0 -1
  261. package/lib/graphql/types/InputTypes/paging.d.ts +0 -5
  262. package/lib/graphql/types/InputTypes/paging.js +0 -20
  263. package/lib/graphql/types/InputTypes/paging.js.map +0 -1
  264. package/lib/graphql/types/InputTypes/query.d.ts +0 -7
  265. package/lib/graphql/types/InputTypes/query.js +0 -36
  266. package/lib/graphql/types/InputTypes/query.js.map +0 -1
  267. package/lib/graphql/types/ObjectTypes/index.d.ts +0 -2
  268. package/lib/graphql/types/ObjectTypes/index.js +0 -6
  269. package/lib/graphql/types/ObjectTypes/index.js.map +0 -1
  270. package/lib/graphql/types/ObjectTypes/paging.d.ts +0 -6
  271. package/lib/graphql/types/ObjectTypes/paging.js +0 -24
  272. package/lib/graphql/types/ObjectTypes/paging.js.map +0 -1
  273. package/lib/graphql/types/ObjectTypes/user.d.ts +0 -26
  274. package/lib/graphql/types/ObjectTypes/user.js +0 -114
  275. package/lib/graphql/types/ObjectTypes/user.js.map +0 -1
  276. package/lib/graphql/types/index.d.ts +0 -2
  277. package/lib/graphql/types/index.js +0 -6
  278. package/lib/graphql/types/index.js.map +0 -1
  279. package/lib/middleware/health.d.ts +0 -4
  280. package/lib/middleware/health.js +0 -15
  281. package/lib/middleware/health.js.map +0 -1
  282. package/lib/notify/decorator.d.ts +0 -6
  283. package/lib/notify/decorator.js +0 -8
  284. package/lib/notify/decorator.js.map +0 -1
  285. package/lib/notify/index.d.ts +0 -1
  286. package/lib/notify/index.js +0 -5
  287. package/lib/notify/index.js.map +0 -1
  288. package/lib/public/api-clients/auditClientApi.d.ts +0 -165
  289. package/lib/public/api-clients/auditClientApi.js +0 -255
  290. package/lib/public/api-clients/auditClientApi.js.map +0 -1
  291. package/lib/public/api-clients/authClientApi.d.ts +0 -585
  292. package/lib/public/api-clients/authClientApi.js +0 -555
  293. package/lib/public/api-clients/authClientApi.js.map +0 -1
  294. package/lib/public/api-clients/notifyClientApi.d.ts +0 -435
  295. package/lib/public/api-clients/notifyClientApi.js +0 -386
  296. package/lib/public/api-clients/notifyClientApi.js.map +0 -1
  297. package/lib/public/api-clients/storageClientApi.d.ts +0 -345
  298. package/lib/public/api-clients/storageClientApi.js +0 -340
  299. package/lib/public/api-clients/storageClientApi.js.map +0 -1
  300. package/lib/services/client.d.ts +0 -2
  301. package/lib/services/client.js +0 -38
  302. package/lib/services/client.js.map +0 -1
  303. package/lib/services/encryption.d.ts +0 -20
  304. package/lib/services/encryption.js +0 -74
  305. package/lib/services/encryption.js.map +0 -1
  306. package/lib/services/identity.d.ts +0 -7
  307. package/lib/services/identity.js +0 -41
  308. package/lib/services/identity.js.map +0 -1
  309. package/lib/services/index.d.ts +0 -8
  310. package/lib/services/index.js +0 -12
  311. package/lib/services/index.js.map +0 -1
  312. package/lib/services/jsonSchema.d.ts +0 -7
  313. package/lib/services/jsonSchema.js +0 -22
  314. package/lib/services/jsonSchema.js.map +0 -1
  315. package/lib/services/time.d.ts +0 -21
  316. package/lib/services/time.js +0 -20
  317. package/lib/services/time.js.map +0 -1
  318. package/lib/services/token.d.ts +0 -5
  319. package/lib/services/token.js +0 -17
  320. package/lib/services/token.js.map +0 -1
  321. package/lib/services/transaction.d.ts +0 -7
  322. package/lib/services/transaction.js +0 -11
  323. package/lib/services/transaction.js.map +0 -1
  324. package/lib/services/uuidGenerator.d.ts +0 -7
  325. package/lib/services/uuidGenerator.js +0 -11
  326. package/lib/services/uuidGenerator.js.map +0 -1
  327. package/lib/tasks/configTypes.d.ts +0 -3
  328. package/lib/tasks/configTypes.js +0 -3
  329. package/lib/tasks/configTypes.js.map +0 -1
  330. package/lib/tasks/data/ScheduledTaskRepository.d.ts +0 -14
  331. package/lib/tasks/data/ScheduledTaskRepository.js +0 -64
  332. package/lib/tasks/data/ScheduledTaskRepository.js.map +0 -1
  333. package/lib/tasks/data/TaskRepository.d.ts +0 -17
  334. package/lib/tasks/data/TaskRepository.js +0 -69
  335. package/lib/tasks/data/TaskRepository.js.map +0 -1
  336. package/lib/tasks/data/entities/ScheduledTask.d.ts +0 -10
  337. package/lib/tasks/data/entities/ScheduledTask.js +0 -33
  338. package/lib/tasks/data/entities/ScheduledTask.js.map +0 -1
  339. package/lib/tasks/data/entities/Task.d.ts +0 -13
  340. package/lib/tasks/data/entities/Task.js +0 -46
  341. package/lib/tasks/data/entities/Task.js.map +0 -1
  342. package/lib/tasks/data/repositories.d.ts +0 -18
  343. package/lib/tasks/data/repositories.js +0 -3
  344. package/lib/tasks/data/repositories.js.map +0 -1
  345. package/lib/tasks/data/types/opaqueTypes.d.ts +0 -3
  346. package/lib/tasks/data/types/opaqueTypes.js +0 -3
  347. package/lib/tasks/data/types/opaqueTypes.js.map +0 -1
  348. package/lib/tasks/data/types/scheduledTaskTypes.d.ts +0 -11
  349. package/lib/tasks/data/types/scheduledTaskTypes.js +0 -3
  350. package/lib/tasks/data/types/scheduledTaskTypes.js.map +0 -1
  351. package/lib/tasks/data/types/taskTypes.d.ts +0 -18
  352. package/lib/tasks/data/types/taskTypes.js +0 -10
  353. package/lib/tasks/data/types/taskTypes.js.map +0 -1
  354. package/lib/tasks/index.d.ts +0 -3
  355. package/lib/tasks/index.js +0 -7
  356. package/lib/tasks/index.js.map +0 -1
  357. package/lib/tasks/services/TaskService.d.ts +0 -19
  358. package/lib/tasks/services/TaskService.js +0 -107
  359. package/lib/tasks/services/TaskService.js.map +0 -1
  360. package/lib/tasks/services/index.d.ts +0 -16
  361. package/lib/tasks/services/index.js +0 -3
  362. package/lib/tasks/services/index.js.map +0 -1
  363. package/lib/tasks/validators/index.d.ts +0 -2
  364. package/lib/tasks/validators/index.js +0 -6
  365. package/lib/tasks/validators/index.js.map +0 -1
  366. package/lib/tasks/validators/scheduledTaskValidators.d.ts +0 -5
  367. package/lib/tasks/validators/scheduledTaskValidators.js +0 -12
  368. package/lib/tasks/validators/scheduledTaskValidators.js.map +0 -1
  369. package/lib/tasks/validators/taskValidators.d.ts +0 -5
  370. package/lib/tasks/validators/taskValidators.js +0 -15
  371. package/lib/tasks/validators/taskValidators.js.map +0 -1
  372. package/lib/tracing/decorator.d.ts +0 -19
  373. package/lib/tracing/decorator.js +0 -101
  374. package/lib/tracing/decorator.js.map +0 -1
  375. package/lib/tracing/index.d.ts +0 -3
  376. package/lib/tracing/index.js +0 -7
  377. package/lib/tracing/index.js.map +0 -1
  378. package/lib/tracing/init.d.ts +0 -4
  379. package/lib/tracing/init.js +0 -24
  380. package/lib/tracing/init.js.map +0 -1
  381. package/lib/tracing/middleware.d.ts +0 -3
  382. package/lib/tracing/middleware.js +0 -15
  383. package/lib/tracing/middleware.js.map +0 -1
  384. package/lib/utils/array.d.ts +0 -1
  385. package/lib/utils/array.js +0 -19
  386. package/lib/utils/array.js.map +0 -1
  387. package/lib/utils/base64.d.ts +0 -1
  388. package/lib/utils/base64.js +0 -12
  389. package/lib/utils/base64.js.map +0 -1
  390. package/lib/utils/context.d.ts +0 -16
  391. package/lib/utils/context.js +0 -21
  392. package/lib/utils/context.js.map +0 -1
  393. package/lib/utils/dates.d.ts +0 -12
  394. package/lib/utils/dates.js +0 -46
  395. package/lib/utils/dates.js.map +0 -1
  396. package/lib/utils/errors.d.ts +0 -4
  397. package/lib/utils/errors.js +0 -24
  398. package/lib/utils/errors.js.map +0 -1
  399. package/lib/utils/httpErrors.d.ts +0 -7
  400. package/lib/utils/httpErrors.js +0 -9
  401. package/lib/utils/httpErrors.js.map +0 -1
  402. package/lib/utils/number.d.ts +0 -4
  403. package/lib/utils/number.js +0 -21
  404. package/lib/utils/number.js.map +0 -1
  405. package/lib/utils/object.d.ts +0 -6
  406. package/lib/utils/object.js +0 -40
  407. package/lib/utils/object.js.map +0 -1
  408. package/lib/utils/random.d.ts +0 -13
  409. package/lib/utils/random.js +0 -41
  410. package/lib/utils/random.js.map +0 -1
  411. package/lib/utils/string.d.ts +0 -3
  412. package/lib/utils/string.js +0 -32
  413. package/lib/utils/string.js.map +0 -1
  414. package/lib/validation/index.d.ts +0 -1
  415. package/lib/validation/index.js +0 -5
  416. package/lib/validation/index.js.map +0 -1
  417. package/lib/validation/validators.d.ts +0 -32
  418. package/lib/validation/validators.js +0 -158
  419. package/lib/validation/validators.js.map +0 -1
  420. package/tsconfig.json +0 -35
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./paging"), exports);
5
- tslib_1.__exportStar(require("./user"), exports);
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../capsules/shared/graphql/types/ObjectTypes/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,iDAAuB"}
@@ -1,6 +0,0 @@
1
- import { ISearchResponsePaging } from '../../../core';
2
- export declare class Paging implements ISearchResponsePaging {
3
- current: string;
4
- next?: string;
5
- previous?: string;
6
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Paging = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- let Paging = class Paging {
7
- };
8
- tslib_1.__decorate([
9
- type_graphql_1.Field({ description: 'Current page' }),
10
- tslib_1.__metadata("design:type", String)
11
- ], Paging.prototype, "current", void 0);
12
- tslib_1.__decorate([
13
- type_graphql_1.Field({ description: 'Next page if present', nullable: true }),
14
- tslib_1.__metadata("design:type", String)
15
- ], Paging.prototype, "next", void 0);
16
- tslib_1.__decorate([
17
- type_graphql_1.Field({ description: 'Previous page if not first page', nullable: true }),
18
- tslib_1.__metadata("design:type", String)
19
- ], Paging.prototype, "previous", void 0);
20
- Paging = tslib_1.__decorate([
21
- type_graphql_1.ObjectType()
22
- ], Paging);
23
- exports.Paging = Paging;
24
- //# sourceMappingURL=paging.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paging.js","sourceRoot":"","sources":["../../../../../../capsules/shared/graphql/types/ObjectTypes/paging.ts"],"names":[],"mappings":";;;;AAAA,+CAAiD;AAIjD,IAAa,MAAM,GAAnB,MAAa,MAAM;CASlB,CAAA;AAPC;IADC,oBAAK,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;;uCACtB;AAGjB;IADC,oBAAK,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oCACjD;AAGd;IADC,oBAAK,CAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACxD;AARP,MAAM;IADlB,yBAAU,EAAE;GACA,MAAM,CASlB;AATY,wBAAM"}
@@ -1,26 +0,0 @@
1
- import { IByUnknown, IByAnon, UserType, IByUser, UserId, IBySystem } from '../../../auth';
2
- import { ICreatable, DateTimeString, IUpdatable } from '../../../core';
3
- export declare class ByUnknown implements IByUnknown {
4
- type: 'unknown';
5
- }
6
- export declare class ByAnon implements IByAnon {
7
- type: UserType.anonymous;
8
- }
9
- export declare class ByUser implements IByUser {
10
- type: UserType.user;
11
- userId: UserId;
12
- impersonator?: UserId;
13
- }
14
- export declare class BySystem implements IBySystem {
15
- type: UserType.system;
16
- userId?: UserId;
17
- }
18
- export declare const ByWho: ByUnknown | ByAnon | ByUser | BySystem;
19
- export declare abstract class Creatable implements ICreatable {
20
- createdOn: DateTimeString;
21
- createdBy: typeof ByWho;
22
- }
23
- export declare abstract class UpdatableCreatable extends Creatable implements IUpdatable {
24
- updatedOn: DateTimeString;
25
- updatedBy: typeof ByWho;
26
- }
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdatableCreatable = exports.Creatable = exports.ByWho = exports.BySystem = exports.ByUser = exports.ByAnon = exports.ByUnknown = void 0;
4
- const tslib_1 = require("tslib");
5
- const type_graphql_1 = require("type-graphql");
6
- const auth_1 = require("../../../auth");
7
- const utils_1 = require("../../../utils");
8
- let ByUnknown = class ByUnknown {
9
- };
10
- tslib_1.__decorate([
11
- type_graphql_1.Field({ description: 'Unknown user-type [SHOULD NEVER SEE THIS TYPE]' }),
12
- tslib_1.__metadata("design:type", String)
13
- ], ByUnknown.prototype, "type", void 0);
14
- ByUnknown = tslib_1.__decorate([
15
- type_graphql_1.ObjectType()
16
- ], ByUnknown);
17
- exports.ByUnknown = ByUnknown;
18
- let ByAnon = class ByAnon {
19
- };
20
- tslib_1.__decorate([
21
- type_graphql_1.Field(() => auth_1.UserType, { description: 'Anonymous user-type' }),
22
- tslib_1.__metadata("design:type", String)
23
- ], ByAnon.prototype, "type", void 0);
24
- ByAnon = tslib_1.__decorate([
25
- type_graphql_1.ObjectType()
26
- ], ByAnon);
27
- exports.ByAnon = ByAnon;
28
- let ByUser = class ByUser {
29
- };
30
- tslib_1.__decorate([
31
- type_graphql_1.Field(() => auth_1.UserType, { description: 'User user-type' }),
32
- tslib_1.__metadata("design:type", String)
33
- ], ByUser.prototype, "type", void 0);
34
- tslib_1.__decorate([
35
- type_graphql_1.Field(() => type_graphql_1.ID, { description: 'User ID', nullable: true }),
36
- tslib_1.__metadata("design:type", String)
37
- ], ByUser.prototype, "userId", void 0);
38
- tslib_1.__decorate([
39
- type_graphql_1.Field(() => type_graphql_1.ID, { description: 'Impersonator User ID', nullable: true }),
40
- tslib_1.__metadata("design:type", String)
41
- ], ByUser.prototype, "impersonator", void 0);
42
- ByUser = tslib_1.__decorate([
43
- type_graphql_1.ObjectType()
44
- ], ByUser);
45
- exports.ByUser = ByUser;
46
- let BySystem = class BySystem {
47
- };
48
- tslib_1.__decorate([
49
- type_graphql_1.Field(() => auth_1.UserType, { description: 'System user-type' }),
50
- tslib_1.__metadata("design:type", String)
51
- ], BySystem.prototype, "type", void 0);
52
- tslib_1.__decorate([
53
- type_graphql_1.Field(() => type_graphql_1.ID, { description: 'Impersonated User ID', defaultValue: '[NOT_SPECIFIED]' }),
54
- tslib_1.__metadata("design:type", String)
55
- ], BySystem.prototype, "userId", void 0);
56
- BySystem = tslib_1.__decorate([
57
- type_graphql_1.ObjectType()
58
- ], BySystem);
59
- exports.BySystem = BySystem;
60
- exports.ByWho = type_graphql_1.createUnionType({
61
- name: 'ByWho',
62
- description: 'Object indicated with user type created the entity',
63
- types: [ByUnknown, ByAnon, ByUser, BySystem],
64
- resolveType: (value) => {
65
- const { type } = value;
66
- switch (type) {
67
- case auth_1.UserType.anonymous: {
68
- return ByAnon;
69
- }
70
- case auth_1.UserType.user: {
71
- return ByUser;
72
- }
73
- case auth_1.UserType.system: {
74
- return BySystem;
75
- }
76
- case 'unknown':
77
- return ByUnknown;
78
- default: {
79
- utils_1.assertNever(type, `Unsupported user type: ${type}`);
80
- break;
81
- }
82
- }
83
- return undefined;
84
- },
85
- });
86
- let Creatable = class Creatable {
87
- };
88
- tslib_1.__decorate([
89
- type_graphql_1.Field({ description: 'Date time string representing creation time' }),
90
- tslib_1.__metadata("design:type", String)
91
- ], Creatable.prototype, "createdOn", void 0);
92
- tslib_1.__decorate([
93
- type_graphql_1.Field(() => exports.ByWho, { description: 'Description of identity that created this entity' }),
94
- tslib_1.__metadata("design:type", Object)
95
- ], Creatable.prototype, "createdBy", void 0);
96
- Creatable = tslib_1.__decorate([
97
- type_graphql_1.ObjectType()
98
- ], Creatable);
99
- exports.Creatable = Creatable;
100
- let UpdatableCreatable = class UpdatableCreatable extends Creatable {
101
- };
102
- tslib_1.__decorate([
103
- type_graphql_1.Field({ description: 'Date time string representing last updated time' }),
104
- tslib_1.__metadata("design:type", String)
105
- ], UpdatableCreatable.prototype, "updatedOn", void 0);
106
- tslib_1.__decorate([
107
- type_graphql_1.Field(() => exports.ByWho, { description: 'Description of identity that last updated this entity' }),
108
- tslib_1.__metadata("design:type", Object)
109
- ], UpdatableCreatable.prototype, "updatedBy", void 0);
110
- UpdatableCreatable = tslib_1.__decorate([
111
- type_graphql_1.ObjectType()
112
- ], UpdatableCreatable);
113
- exports.UpdatableCreatable = UpdatableCreatable;
114
- //# sourceMappingURL=user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../../../capsules/shared/graphql/types/ObjectTypes/user.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- export * from './InputTypes';
2
- export * from './ObjectTypes';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./InputTypes"), exports);
5
- tslib_1.__exportStar(require("./ObjectTypes"), exports);
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../capsules/shared/graphql/types/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,wDAA8B"}
@@ -1,4 +0,0 @@
1
- /// <reference types="bunyan" />
2
- import { Request, Response, NextFunction } from 'express';
3
- import { Logger } from '@rocketmakers/log';
4
- export declare function healthCheck(logger: Logger, path: string): (req: Request, res: Response, next: NextFunction) => void;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.healthCheck = void 0;
4
- function healthCheck(logger, path) {
5
- logger.trace(`Adding health check at ${path}`);
6
- return (req, res, next) => {
7
- if (req.path === path) {
8
- res.status(204).send();
9
- return;
10
- }
11
- next();
12
- };
13
- }
14
- exports.healthCheck = healthCheck;
15
- //# sourceMappingURL=health.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.js","sourceRoot":"","sources":["../../../../capsules/shared/middleware/health.ts"],"names":[],"mappings":";;;AAGA,SAAgB,WAAW,CAAC,MAAc,EAAE,IAAY;IACtD,MAAM,CAAC,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;QACzD,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YACvB,OAAO;SACR;QACD,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AATD,kCASC"}
@@ -1,6 +0,0 @@
1
- interface INotifyDefinitionConfiguration {
2
- isIgnorable?: boolean;
3
- groupTag?: string;
4
- }
5
- export declare function notifyRegister(_name: string, _config?: INotifyDefinitionConfiguration): ClassDecorator;
6
- export {};
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.notifyRegister = void 0;
4
- function notifyRegister(_name, _config) {
5
- return () => { };
6
- }
7
- exports.notifyRegister = notifyRegister;
8
- //# sourceMappingURL=decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../../capsules/shared/notify/decorator.ts"],"names":[],"mappings":";;;AAaA,SAAgB,cAAc,CAAC,KAAa,EAAE,OAAwC;IACpF,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;AAClB,CAAC;AAFD,wCAEC"}
@@ -1 +0,0 @@
1
- export * from './decorator';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./decorator"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../capsules/shared/notify/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B"}
@@ -1,165 +0,0 @@
1
- export declare const UnknownServerErrorAppCode = "UnknownServerError";
2
- export declare abstract class ApiErrorBase<TAppCode extends string = string> extends Error {
3
- appCode: TAppCode;
4
- developerMessage?: string | undefined;
5
- constructor(appCode: TAppCode, message: string, developerMessage?: string | undefined);
6
- }
7
- export interface IErrorRegistration<TError extends {
8
- appCode: string;
9
- }, TData> {
10
- appCode: string;
11
- status: number;
12
- toJson: (e: TError) => TData;
13
- fromJson: (d: TData) => TError;
14
- }
15
- export declare class ApiError {
16
- static errors: IErrorRegistration<any, any>[];
17
- static registerCore(): void;
18
- static isApiError(testError: any): testError is ApiErrorBase<any>;
19
- static register<TErrorConstructor extends new (...args: any[]) => {
20
- appCode: string;
21
- developerMessage?: string;
22
- }>(_error: TErrorConstructor, status: number): {
23
- transit<TKeys extends Exclude<keyof InstanceType<TErrorConstructor>, "developerMessage" | "appCode">>(...keys: TKeys[]): {
24
- recreate(fromJson: (d: Pick<InstanceType<TErrorConstructor>, TKeys>) => InstanceType<TErrorConstructor>): ClassDecorator;
25
- };
26
- };
27
- static createApiError(data: any): any;
28
- }
29
- export declare class UnknownServerError extends ApiErrorBase<typeof UnknownServerErrorAppCode> {
30
- data: any;
31
- constructor(data: any, developerMessage?: string);
32
- }
33
- export declare class UnauthorisedError extends ApiErrorBase<'UnauthorisedError'> {
34
- constructor(message: string, developerMessage?: string);
35
- }
36
- export declare class RequestEntityTooLargeError extends ApiErrorBase<'RequestEntityTooLargeError'> {
37
- expected: number;
38
- length: number;
39
- limit: number;
40
- constructor(message: string, expected: number, length: number, limit: number);
41
- }
42
- export declare class NotFoundError extends ApiErrorBase<'NotFoundError'> {
43
- constructor(message: string, developerMessage?: string);
44
- }
45
- export declare class BadRequestError extends ApiErrorBase<'BadRequestError'> {
46
- constructor(message: string, developerMessage?: string);
47
- }
48
- export declare class ForbiddenError extends ApiErrorBase<'ForbiddenError'> {
49
- constructor(message: string, developerMessage?: string);
50
- }
51
- export interface IValidationErrorMessages {
52
- developer: string;
53
- friendly?: string;
54
- }
55
- export interface IValidationErrorDetail {
56
- attribute?: string;
57
- path: string;
58
- value: any;
59
- messages: IValidationErrorMessages;
60
- }
61
- export declare class ValidationError extends ApiErrorBase<'ValidationError'> {
62
- errors: IValidationErrorDetail[];
63
- constructor(errors: IValidationErrorDetail[], developerMessage?: string);
64
- }
65
- export declare class ConfigurationError extends ApiErrorBase<'ConfigurationError'> {
66
- constructor(message: string, developerMessage?: string);
67
- }
68
- export declare class ConflictError extends ApiErrorBase<'ConflictError'> {
69
- constructor(message: string, developerMessage?: string);
70
- }
71
- export declare class ArgumentError extends ApiErrorBase<'ArgumentError'> {
72
- parameter: string;
73
- constructor(parameter: string, developerMessage?: string);
74
- }
75
- export declare type OrbitError = UnknownServerError | UnauthorisedError | RequestEntityTooLargeError | NotFoundError | BadRequestError | ForbiddenError | ValidationError | ConfigurationError | ConflictError | ArgumentError;
76
- export declare type AuditEndpointName = OpaqueString<'AuditEndpointName'>;
77
- export declare type OpaqueString<Key extends string> = string & {
78
- __opaque: Key;
79
- };
80
- export interface IPostgresEndpointConfig {
81
- kind: 'postgres';
82
- }
83
- export interface ISqlServerEndpointConfig {
84
- kind: 'mssql';
85
- }
86
- export declare type EndpointConfig = IPostgresEndpointConfig | ISqlServerEndpointConfig;
87
- export interface IEndpointRegistration {
88
- endpointName: AuditEndpointName;
89
- config: EndpointConfig;
90
- }
91
- export declare type AuditEventName = OpaqueString<'AuditEventName'>;
92
- export declare type AuditEntryPayloadVersion = OpaqueString<'AuditEntryPayloadVersion'>;
93
- export interface IJsonSchema {
94
- }
95
- export interface IEventRegistration {
96
- eventName: AuditEventName;
97
- payloadVersion: AuditEntryPayloadVersion;
98
- payloadSchema: IJsonSchema;
99
- }
100
- export declare type ServiceName = OpaqueString<'ServiceName'>;
101
- export declare type UserId = OpaqueString<'UserId'>;
102
- export declare type Complexity = any;
103
- export declare type CursorResult = any | void | boolean;
104
- export declare type AggregationCursorResult = any | void;
105
- export declare type AuditEntryPayload = any;
106
- export declare type ValueType = any;
107
- export interface IAuditEntry {
108
- serviceName: ServiceName;
109
- authUserId: UserId;
110
- payloadVersion: AuditEntryPayloadVersion;
111
- payload: AuditEntryPayload;
112
- }
113
- export declare type AuditEntryId = OpaqueString<'AuditEntryId'>;
114
- export declare type DateTimeString = OpaqueString<'DateTime'>;
115
- export interface IAuditEntryCreated extends IAuditEntry {
116
- id: AuditEntryId;
117
- timestamp: DateTimeString;
118
- }
119
- export interface HeaderMap {
120
- [k: string]: string;
121
- }
122
- export interface IFetcher {
123
- request<T>(url: string, verb: string, contentType: string, body?: any, headers?: HeaderMap): Promise<T>;
124
- buildQueryString(query?: any): string;
125
- requestValidate?(routeUniqueName: string, paramValues: {
126
- body?: any;
127
- params?: any;
128
- query?: any;
129
- }): Promise<void>;
130
- }
131
- export declare class Qs {
132
- private static buildQueryStringKeyValueItem;
133
- static buildQueryStringKeyValue(key: string, value: any): string;
134
- static buildQueryString(query?: any, buildQueryStringValue?: (key: string, value: any) => string): string;
135
- }
136
- export declare function optionalParam(parameter: any, key: string): string;
137
- export declare class AuditController {
138
- private fetcher;
139
- constructor(fetcher: IFetcher);
140
- registerEndpoint: (body: IEndpointRegistration, headers?: HeaderMap | undefined) => Promise<void>;
141
- registerEvent: (body: IEventRegistration, params: {
142
- endpointName: AuditEndpointName;
143
- }, headers?: HeaderMap | undefined) => Promise<void>;
144
- createEntry: (body: IAuditEntry, params: {
145
- endpointName: AuditEndpointName;
146
- eventName: AuditEventName;
147
- }, headers?: HeaderMap | undefined) => Promise<IAuditEntryCreated>;
148
- }
149
- export declare class TransactionalHealthController {
150
- private fetcher;
151
- constructor(fetcher: IFetcher);
152
- health: (headers?: HeaderMap | undefined) => Promise<void>;
153
- }
154
- export declare class HealthController {
155
- private fetcher;
156
- constructor(fetcher: IFetcher);
157
- health: (headers?: HeaderMap | undefined) => Promise<void>;
158
- }
159
- export declare class ApiClient {
160
- private fetcher;
161
- constructor(fetcher: IFetcher);
162
- audit: AuditController;
163
- transactionalHealth: TransactionalHealthController;
164
- health: HealthController;
165
- }