@opencrvs/toolkit 2.1.0-rc.d13869e → 2.1.0-rc.d235243

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 (265) hide show
  1. package/README.md +3 -12
  2. package/build.sh +23 -5
  3. package/create-countryconfig/index.js +441 -59
  4. package/create-countryconfig/node_modules/.bin/degit +21 -0
  5. package/create-countryconfig/package.json +4 -1
  6. package/dist/application-config/index.js +362 -284
  7. package/dist/authentication/index.d.ts +66 -0
  8. package/dist/authentication/index.d.ts.map +1 -0
  9. package/dist/authentication/index.js +765 -0
  10. package/dist/cli.js +2119 -1321
  11. package/dist/commons/api/router.d.ts +940 -363
  12. package/dist/commons/application-config/index.d.ts +0 -2
  13. package/dist/commons/conditionals/conditionals.d.ts +6 -6
  14. package/dist/commons/conditionals/validate.d.ts +34 -8
  15. package/dist/commons/events/ActionConfig.d.ts +5 -14
  16. package/dist/commons/events/ActionDocument.d.ts +35 -15
  17. package/dist/commons/events/ActionInput.d.ts +4 -4
  18. package/dist/commons/events/ActionStatus.d.ts +14 -0
  19. package/dist/commons/events/AdvancedSearchConfig.d.ts +48 -12
  20. package/dist/commons/events/AuditLog.d.ts +148 -0
  21. package/dist/commons/events/Draft.d.ts +1 -21
  22. package/dist/commons/events/EventConfig.d.ts +3 -0
  23. package/dist/commons/events/EventDocument.d.ts +472 -4
  24. package/dist/commons/events/EventIndex.d.ts +3 -26
  25. package/dist/commons/events/EventMetadata.d.ts +1 -11
  26. package/dist/commons/events/EventStatus.d.ts +19 -0
  27. package/dist/commons/events/FieldConfig.d.ts +109 -63
  28. package/dist/commons/events/FieldTypeMapping.d.ts +17 -17
  29. package/dist/commons/events/FieldValue.d.ts +3 -2
  30. package/dist/commons/events/Flag.d.ts +42 -0
  31. package/dist/commons/events/FormConfig.d.ts +6 -0
  32. package/dist/commons/events/PageConfig.d.ts +4 -0
  33. package/dist/commons/events/PlainDate.d.ts +8 -0
  34. package/dist/commons/events/SummaryConfig.d.ts +249 -0
  35. package/dist/commons/events/WorkqueueConfig.d.ts +17 -14
  36. package/dist/commons/events/event.d.ts +12 -0
  37. package/dist/commons/events/index.d.ts +1 -0
  38. package/dist/commons/events/locationPayloads.d.ts +95 -0
  39. package/dist/commons/events/locations.d.ts +169 -26
  40. package/dist/commons/events/mocks.test.utils.d.ts +30 -0
  41. package/dist/commons/events/scopes.d.ts +21 -1
  42. package/dist/commons/events/test.utils.d.ts +78 -25
  43. package/dist/commons/events/utils.d.ts +39 -4
  44. package/dist/commons/notification/UserNotifications.d.ts +28 -13
  45. package/dist/commons/notification/dispatch.d.ts +10 -0
  46. package/dist/commons/notification/index.d.ts +1 -0
  47. package/dist/conditionals/index.js +349 -65
  48. package/dist/csv.d.ts +25 -0
  49. package/dist/csv.d.ts.map +1 -0
  50. package/dist/csv.js +120 -0
  51. package/dist/environment/derived-variables.d.ts +18 -0
  52. package/dist/environment/derived-variables.d.ts.map +1 -1
  53. package/dist/environment/derived-variables.js +21 -0
  54. package/dist/environment/index.d.ts +1 -0
  55. package/dist/environment/index.d.ts.map +1 -1
  56. package/dist/environment/index.js +12 -1
  57. package/dist/environment/logger.d.ts +15 -3
  58. package/dist/environment/logger.d.ts.map +1 -1
  59. package/dist/environment/manage-users.js +1 -1
  60. package/dist/environment/paths.d.ts +7 -0
  61. package/dist/environment/paths.d.ts.map +1 -0
  62. package/dist/environment/paths.js +72 -0
  63. package/dist/environment/questions.d.ts +16 -0
  64. package/dist/environment/questions.d.ts.map +1 -1
  65. package/dist/environment/questions.js +46 -15
  66. package/dist/environment/setup-environment.d.ts +1 -1
  67. package/dist/environment/setup-environment.d.ts.map +1 -1
  68. package/dist/environment/setup-environment.js +634 -560
  69. package/dist/environment/swarm-to-k8s.js +3 -4
  70. package/dist/environment/templates.d.ts +0 -1
  71. package/dist/environment/templates.d.ts.map +1 -1
  72. package/dist/environment/templates.js +5 -9
  73. package/dist/environment/update-workflows.d.ts.map +1 -1
  74. package/dist/environment/update-workflows.js +23 -6
  75. package/dist/environment/upgrade.d.ts +2 -0
  76. package/dist/environment/upgrade.d.ts.map +1 -0
  77. package/dist/environment/upgrade.js +82 -0
  78. package/dist/environment/users.js +11 -13
  79. package/dist/environment/utils.d.ts +0 -12
  80. package/dist/environment/utils.d.ts.map +1 -1
  81. package/dist/environment/utils.js +1 -28
  82. package/dist/events/index.js +7689 -7063
  83. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
  84. package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
  85. package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
  86. package/dist/migrations/v2.1/add-translations.d.ts +9 -0
  87. package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
  88. package/dist/migrations/v2.1/add-translations.js +149 -0
  89. package/dist/migrations/{v2.0/rename-api-paths.d.ts → v2.1/enable-telemetry.d.ts} +1 -1
  90. package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
  91. package/dist/migrations/v2.1/enable-telemetry.js +455 -0
  92. package/dist/migrations/v2.1/index.d.ts.map +1 -1
  93. package/dist/migrations/v2.1/index.js +47 -215
  94. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +14 -0
  95. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +1 -0
  96. package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +348 -0
  97. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +2 -0
  98. package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +1 -0
  99. package/dist/migrations/v2.1/remove-metabase-package-installs.js +161 -0
  100. package/dist/migrations/{v2.0/migrate-scopes.d.ts → v2.1/remove-sentry.d.ts} +1 -1
  101. package/dist/migrations/v2.1/remove-sentry.d.ts.map +1 -0
  102. package/dist/migrations/v2.1/remove-sentry.js +354 -0
  103. package/dist/migrations/{v2.0/create-events-index.d.ts → v2.1/rename-trigger-paths.d.ts} +1 -1
  104. package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +1 -0
  105. package/dist/migrations/{v2.0/rename-api-paths.js → v2.1/rename-trigger-paths.js} +69 -40
  106. package/dist/migrations/v2.1/template-files.d.ts +8 -0
  107. package/dist/migrations/v2.1/template-files.d.ts.map +1 -0
  108. package/dist/migrations/v2.1/template-files.js +49 -0
  109. package/dist/migrations/v2.1/upgrade-tilt.d.ts +8 -0
  110. package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +1 -0
  111. package/dist/migrations/v2.1/upgrade-tilt.js +139 -0
  112. package/dist/migrations/v2.2/add-e2e-tests.d.ts +19 -0
  113. package/dist/migrations/v2.2/add-e2e-tests.d.ts.map +1 -0
  114. package/dist/migrations/v2.2/add-e2e-tests.js +143 -0
  115. package/dist/migrations/v2.2/index.d.ts +6 -0
  116. package/dist/migrations/v2.2/index.d.ts.map +1 -0
  117. package/dist/migrations/v2.2/index.js +279 -0
  118. package/dist/migrations/v2.2/template-files.d.ts +8 -0
  119. package/dist/migrations/v2.2/template-files.d.ts.map +1 -0
  120. package/dist/migrations/v2.2/template-files.js +49 -0
  121. package/dist/migrations/v2.2/upgrade-tilt.d.ts +8 -0
  122. package/dist/migrations/v2.2/upgrade-tilt.d.ts.map +1 -0
  123. package/dist/migrations/v2.2/upgrade-tilt.js +139 -0
  124. package/dist/notification/index.js +1887 -1438
  125. package/dist/scopes/index.d.ts +614 -36
  126. package/dist/scopes/index.js +351 -65
  127. package/dist/telemetry/index.d.ts +45 -0
  128. package/dist/telemetry/index.d.ts.map +1 -0
  129. package/dist/telemetry/index.js +43 -0
  130. package/dist/templates/charts-values/dependencies/values.yaml +8 -0
  131. package/dist/templates/charts-values/opencrvs-services/values.yaml +10 -3
  132. package/dist/templates/charts-values/opentelemetry/values.yaml +102 -0
  133. package/dist/templates/charts-values/traefik/values.yaml +25 -12
  134. package/dist/templates/countryconfig-template/.tiltignore +1 -0
  135. package/dist/templates/countryconfig-template/Dockerfile.assets +7 -0
  136. package/dist/templates/countryconfig-template/Tiltfile +112 -0
  137. package/dist/templates/countryconfig-template/assets/README.md +1 -0
  138. package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +61 -0
  139. package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +455 -0
  140. package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +168 -0
  141. package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +67 -0
  142. package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +168 -0
  143. package/dist/templates/countryconfig-template/assets/metabase/README.md +34 -0
  144. package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +36 -0
  145. package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +46 -0
  146. package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +27737 -0
  147. package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +21 -0
  148. package/dist/templates/countryconfig-template/assets/metabase/package.json +13 -0
  149. package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +108 -0
  150. package/dist/templates/countryconfig-template/assets/metabase/run.sh +120 -0
  151. package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +40 -0
  152. package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +135 -0
  153. package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +108 -0
  154. package/dist/templates/countryconfig-template/e2e/README.md +36 -0
  155. package/dist/templates/countryconfig-template/e2e/constants.ts +28 -0
  156. package/dist/templates/countryconfig-template/e2e/login.e2e.ts +59 -0
  157. package/dist/templates/countryconfig-template/package.json +153 -0
  158. package/dist/templates/countryconfig-template/playwright.config.ts +42 -0
  159. package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +50 -0
  160. package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +35 -0
  161. package/dist/templates/countryconfig-template/tilt/common.tilt +159 -0
  162. package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +15 -0
  163. package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +56 -0
  164. package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +21 -0
  165. package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +38 -0
  166. package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +17 -0
  167. package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +16 -0
  168. package/dist/templates/countryconfig-template/tilt/lib.tilt +95 -0
  169. package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +136 -0
  170. package/dist/templates/inventory/inventory.template.yml +1 -3
  171. package/dist/translations/template.d.ts +11 -0
  172. package/dist/translations/template.d.ts.map +1 -0
  173. package/dist/translations/template.js +100 -0
  174. package/dist/verify/endpoints.d.ts +2 -0
  175. package/dist/verify/endpoints.d.ts.map +1 -0
  176. package/dist/verify/endpoints.js +510 -0
  177. package/opencrvs-toolkit-2.1.0-rc.d235243.tgz +0 -0
  178. package/package.json +13 -7
  179. package/tsconfig.build.json +11 -0
  180. package/tsconfig.build.tsbuildinfo +1 -0
  181. package/tsconfig.json +3 -0
  182. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
  183. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
  184. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -429
  185. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +0 -3
  186. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +0 -1
  187. package/dist/migrations/v2.0/add-resend-invite-notification.js +0 -373
  188. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +0 -22
  189. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +0 -1
  190. package/dist/migrations/v2.0/checkout-upstream-files.js +0 -146
  191. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
  192. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
  193. package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -838
  194. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
  195. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
  196. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -158
  197. package/dist/migrations/v2.0/create-events-index.d.ts.map +0 -1
  198. package/dist/migrations/v2.0/create-events-index.js +0 -325
  199. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +0 -11
  200. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +0 -1
  201. package/dist/migrations/v2.0/delete-infrastructure-directory.js +0 -123
  202. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +0 -3
  203. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +0 -1
  204. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +0 -110
  205. package/dist/migrations/v2.0/index.d.ts +0 -13
  206. package/dist/migrations/v2.0/index.d.ts.map +0 -1
  207. package/dist/migrations/v2.0/index.js +0 -103
  208. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
  209. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
  210. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -432
  211. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +0 -13
  212. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +0 -1
  213. package/dist/migrations/v2.0/merge-infrastructure-directory.js +0 -222
  214. package/dist/migrations/v2.0/migrate-application-config-url.d.ts +0 -3
  215. package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +0 -1
  216. package/dist/migrations/v2.0/migrate-application-config-url.js +0 -343
  217. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
  218. package/dist/migrations/v2.0/migrate-scopes.js +0 -305
  219. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
  220. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
  221. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -267
  222. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
  223. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
  224. package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -317
  225. package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
  226. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
  227. package/dist/migrations/v2.0/remove-delete-actions.js +0 -156
  228. package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
  229. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
  230. package/dist/migrations/v2.0/remove-demo-scope.js +0 -74
  231. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
  232. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
  233. package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -96
  234. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +0 -3
  235. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +0 -1
  236. package/dist/migrations/v2.0/remove-fhir-url-helpers.js +0 -163
  237. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
  238. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
  239. package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -87
  240. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +0 -3
  241. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +0 -1
  242. package/dist/migrations/v2.0/remove-old-statistics-service.js +0 -356
  243. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
  244. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
  245. package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -109
  246. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
  247. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
  248. package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -163
  249. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +0 -3
  250. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +0 -1
  251. package/dist/migrations/v2.0/remove-unused-environment-variables.js +0 -186
  252. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
  253. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
  254. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
  255. package/dist/migrations/v2.0/rename-location-parent-id.js +0 -180
  256. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +0 -3
  257. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +0 -1
  258. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +0 -195
  259. package/dist/migrations/v2.0/update-package-json.d.ts +0 -3
  260. package/dist/migrations/v2.0/update-package-json.d.ts.map +0 -1
  261. package/dist/migrations/v2.0/update-package-json.js +0 -105
  262. package/dist/templates/inventory/production.example.yml +0 -77
  263. package/dist/templates/inventory/qa.example.yml +0 -48
  264. package/opencrvs-toolkit-2.1.0-rc.d13869e.tgz +0 -0
  265. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,153 @@
1
+ {
2
+ "name": "@opencrvs/countryconfig-template",
3
+ "version": "2.0.0",
4
+ "description": "OpenCRVS country configuration template for forking new country configurations",
5
+ "os": [
6
+ "darwin",
7
+ "linux"
8
+ ],
9
+ "engines": {
10
+ "node": "22.x.x"
11
+ },
12
+ "license": "MPL-2.0",
13
+ "packageManager": "pnpm@10.34.5",
14
+ "scripts": {
15
+ "dev": "pnpm start",
16
+ "test": "vitest",
17
+ "test:compilation": "tsc --noEmit",
18
+ "e2e": "playwright test",
19
+ "e2e:ui": "playwright test --ui",
20
+ "e2e:dev": "cross-env NODE_ENV=development playwright test --ui",
21
+ "lint": "eslint -c eslint.config.js",
22
+ "setup-analytics": "docker exec -i -e POSTGRES_HOST=localhost -e POSTGRES_PORT=5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e ANALYTICS_POSTGRES_USER=events_analytics -e ANALYTICS_POSTGRES_PASSWORD=analytics_password postgres bash -s < ./assets/postgres/setup-analytics.sh",
23
+ "db:clear:all": "bash assets/clear-all-data-dev.sh && pnpm setup-analytics",
24
+ "start": "pnpm setup-analytics && cross-env NODE_ENV=development NODE_OPTIONS=--dns-result-order=ipv4first nodemon --watch src --exec tsx src/index.ts",
25
+ "start:tilt": "cross-env NODE_ENV=development NODE_OPTIONS=--dns-result-order=ipv4first nodemon --watch src --exec tsx src/index.ts",
26
+ "start:prod": "tsx src/index.ts",
27
+ "metabase": "bash assets/metabase/run-dev.sh",
28
+ "deploy": "bash assets/deployment/deploy.sh",
29
+ "restore-snapshot": "bash assets/backups/restore-snapshot.sh",
30
+ "snapshot": "bash assets/backups/backup.sh",
31
+ "port-forward": "bash assets/port-forward.sh",
32
+ "environment:init": "tsx assets/environments/setup-environment.ts",
33
+ "environment:upgrade": "pnpm environment:init",
34
+ "extract:translations": "tsx src/check-translations.ts",
35
+ "sort-translations": "cross-env NODE_ENV=development tsx src/sort-translations.ts"
36
+ },
37
+ "devDependencies": {
38
+ "@inquirer/editor": "^1.2.13",
39
+ "@octokit/core": "4.2.1",
40
+ "@playwright/test": "1.61.1",
41
+ "@types/handlebars": "^4.1.0",
42
+ "@types/hapi__inert": "5.2.1",
43
+ "@types/inquirer": "^9.0.7",
44
+ "@types/libsodium-wrappers": "^0.7.10",
45
+ "@types/pg": "^8.15.5",
46
+ "@types/prompts": "^2.4.9",
47
+ "@types/react-intl": "^3.0.0",
48
+ "@eslint/eslintrc": "^3.3.1",
49
+ "@eslint/js": "^9.23.0",
50
+ "@typescript-eslint/eslint-plugin": "8.63.0",
51
+ "@typescript-eslint/parser": "8.63.0",
52
+ "cypress-xpath": "^2.0.1",
53
+ "eslint": "^9.23.0",
54
+ "eslint-plugin-import": "^2.31.0",
55
+ "inquirer": "^9.2.12",
56
+ "js-yaml": "^4.1.0",
57
+ "kleur": "^4.1.5",
58
+ "libsodium-wrappers": "^0.7.13",
59
+ "globals": "^16.0.0",
60
+ "lint-staged": "^7.1.0",
61
+ "node-ssh": "^13.2.0",
62
+ "nodemon": "^2.0.22",
63
+ "pino-pretty": "^11.0.0",
64
+ "prettier": "^3.4.2",
65
+ "react-intl": "^6.4.3",
66
+ "ts-morph": "^27.0.2",
67
+ "vite": "^8.1.5",
68
+ "vite-tsconfig-paths": "^4.3.2",
69
+ "vitest": "^4.1.10"
70
+ },
71
+ "dependencies": {
72
+ "@faker-js/faker": "^6.0.0-alpha.5",
73
+ "@hapi/boom": "^9.1.1",
74
+ "@hapi/hapi": "^20.0.1",
75
+ "@hapi/inert": "^7.0.0",
76
+ "@opencrvs/toolkit": "2.1.0",
77
+ "@types/chalk": "^2.2.0",
78
+ "@types/csv2json": "^1.4.0",
79
+ "@types/fhir": "^0.0.30",
80
+ "@types/geojson": "^7946.0.4",
81
+ "@types/hapi__boom": "^9.0.1",
82
+ "@types/hapi__hapi": "^20.0.0",
83
+ "@types/jwt-decode": "^2.2.1",
84
+ "@types/lodash": "^4.14.117",
85
+ "@types/luxon": "^3.7.1",
86
+ "@types/node": "^18.19.1",
87
+ "@types/node-fetch": "^2.6.2",
88
+ "@types/nodemailer": "^6.4.14",
89
+ "@types/stream-json": "^1.7.8",
90
+ "@typescript/api": "npm:typescript@6.0.3",
91
+ "app-module-path": "^2.2.0",
92
+ "chalk": "^2.4.1",
93
+ "cross-env": "^6.0.3",
94
+ "csv-stringify": "^6.4.6",
95
+ "csv2json": "^2.0.2",
96
+ "date-fns": "^2.28.0",
97
+ "dotenv": "^16.4.5",
98
+ "elastic-apm-node": "^3.29.0",
99
+ "envalid": "^8.0.0",
100
+ "esbuild": "^0.18.9",
101
+ "handlebars": "^4.7.9",
102
+ "hapi-auth-jwt2": "10.4.0",
103
+ "hapi-pino": "^9.0.0",
104
+ "joi": "^17.4.0",
105
+ "jwt-decode": "^2.2.0",
106
+ "kysely": "^0.28.14",
107
+ "lodash": "^4.18.1",
108
+ "luxon": "^3.7.1",
109
+ "nanoid": "3",
110
+ "node-fetch": "^2.6.1",
111
+ "nodemailer": "^7.0.11",
112
+ "opener": "^1.5.1",
113
+ "pg": "^8.16.3",
114
+ "pino": "^7.0.0",
115
+ "pkg-up": "^3.1.0",
116
+ "prompts": "^2.4.2",
117
+ "short-uid": "^0.1.0",
118
+ "stream-json": "^3.0.0",
119
+ "tsconfig-paths": "^3.8.0",
120
+ "tsx": "^4.15.7",
121
+ "typescript": "7.0.2",
122
+ "uuid": "^11.1.0",
123
+ "zod": "^4.4.3"
124
+ },
125
+ "lint-staged": {
126
+ "src/**/*.{ts,graphql}": [
127
+ "sh -c 'pnpm extract:translations'",
128
+ "eslint --fix",
129
+ "prettier --write",
130
+ "git add"
131
+ ],
132
+ "src/translations/*.csv": [
133
+ "pnpm sort-translations",
134
+ "git add"
135
+ ]
136
+ },
137
+ "resolutions": {
138
+ "acorn": "^6.4.1",
139
+ "braces": "^3.0.3",
140
+ "cross-spawn": "^7.0.5",
141
+ "flatted": "^3.4.2",
142
+ "form-data": "^4.0.4",
143
+ "jws": "^3.2.3",
144
+ "minimatch": "^3.1.4",
145
+ "picomatch": "^2.3.2",
146
+ "rollup": "^4.59.0",
147
+ "semver": "^7.5.2",
148
+ "handlebars": "4.7.9",
149
+ "lodash": "4.18.1",
150
+ "@hapi/content": ">=6.0.1",
151
+ "@trpc/server": ">=11.8.0"
152
+ }
153
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * This Source Code Form is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5
+ *
6
+ * OpenCRVS is also distributed under the terms of the Civil Registration
7
+ * & Healthcare Disclaimer located at http://opencrvs.org/license.
8
+ *
9
+ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
10
+ */
11
+ import { defineConfig, devices } from '@playwright/test'
12
+
13
+ // Let's Encrypt staging certificates are not publicly trusted
14
+ const ignoreHTTPSErrors = !!process.env.CI
15
+
16
+ /**
17
+ * See https://playwright.dev/docs/test-configuration.
18
+ * Run by the infrastructure repository's e2e.yml workflow after every deployment
19
+ * to an environment that has E2E_ENABLED=true.
20
+ */
21
+ export default defineConfig({
22
+ testDir: './e2e',
23
+ // Not *.spec.ts, so that vitest doesn't collect these
24
+ testMatch: '**/*.e2e.ts',
25
+ timeout: 90000,
26
+ fullyParallel: true,
27
+ forbidOnly: !!process.env.CI,
28
+ retries: process.env.CI ? 2 : 0,
29
+ workers: process.env.CI ? 1 : undefined,
30
+ reporter: [['html', { open: 'never' }], ['list']],
31
+ use: {
32
+ screenshot: 'only-on-failure',
33
+ trace: 'retain-on-failure',
34
+ ignoreHTTPSErrors
35
+ },
36
+ projects: [
37
+ {
38
+ name: 'chromium',
39
+ use: { ...devices['Desktop Chrome'], ignoreHTTPSErrors }
40
+ }
41
+ ]
42
+ })
@@ -0,0 +1,50 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ Write-Host "Running data cleanup"
11
+
12
+ $Namespace = "opencrvs-dev"
13
+
14
+ $Jobs = @(
15
+ "data-cleanup",
16
+ "postgres-on-deploy",
17
+ "data-migration",
18
+ "data-migration-analytics",
19
+ "data-seed",
20
+ "elasticsearch-reindex"
21
+ )
22
+
23
+ foreach ($Job in $Jobs) {
24
+ kubectl delete job $Job -n $Namespace --ignore-not-found
25
+
26
+ if ($Job -eq "data-seed") {
27
+ kubectl delete pod -l app=events -n $Namespace
28
+ }
29
+
30
+ tilt trigger $Job
31
+
32
+ Start-Sleep -Seconds 10
33
+
34
+ kubectl wait `
35
+ --for=condition=complete `
36
+ --timeout=300s `
37
+ "job/$Job" `
38
+ -n $Namespace
39
+
40
+ if ($LASTEXITCODE -ne 0) {
41
+ Write-Error "Job $Job failed or timed out"
42
+ exit 1
43
+ }
44
+
45
+ Write-Host "======================== Job $Job completed ==============================="
46
+
47
+ kubectl logs "job/$Job" -n $Namespace
48
+ }
49
+
50
+ Write-Host "Cleanup was successful"
@@ -0,0 +1,35 @@
1
+ #!/bin/bash
2
+
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+ #
7
+ # OpenCRVS is also distributed under the terms of the Civil Registration
8
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
9
+ #
10
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
11
+
12
+ echo "Running data cleanup"
13
+
14
+ jobs=(
15
+ "data-cleanup"
16
+ 'postgres-on-deploy'
17
+ 'data-migration'
18
+ 'data-migration-analytics'
19
+ 'data-seed'
20
+ 'elasticsearch-reindex'
21
+ )
22
+
23
+ for job in "${jobs[@]}"; do
24
+ kubectl delete job $job -n opencrvs-dev --ignore-not-found
25
+ if [ "$job" == "data-seed" ]; then
26
+ kubectl delete pod -lapp=events -n opencrvs-dev
27
+ fi
28
+ tilt trigger $job
29
+ sleep 10
30
+ kubectl wait --for=condition=complete --timeout=300s job/$job -n opencrvs-dev
31
+ echo "======================== Job $job completed ==============================="
32
+ kubectl logs job/$job -n opencrvs-dev
33
+ done
34
+
35
+ echo "Cleanup was successful"
@@ -0,0 +1,159 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ ############################################################
11
+ # What common Tiltfile does?:
12
+ # - Traefik deployment
13
+ # - Group resources by label on UI: http://localhost:10350/
14
+
15
+ ########################################################
16
+ # Load extensions for namespace and helm operations
17
+ load('ext://namespace', 'namespace_create', 'namespace_inject')
18
+ load('ext://helm_resource', 'helm_resource', 'helm_repo')
19
+
20
+
21
+ secret_settings(disable_scrub=True)
22
+ ########################################################
23
+ # Traefik Deployment
24
+ print("🚀 Deploying traefik...")
25
+ namespace_create('traefik')
26
+ traefik_tilt_label = '5.Traefik'
27
+
28
+ # Which local Kubernetes you're running Tilt against:
29
+ # "orbstack" (default) - OrbStack/Docker Desktop expose LoadBalancer
30
+ # services on localhost automatically.
31
+ # "minikube" - minikube doesn't expose LoadBalancer/NodePort
32
+ # services to the host on its own (EXTERNAL-IP stays
33
+ # <pending> without a separate `minikube tunnel` /
34
+ # `minikube service` process), so we deploy Traefik
35
+ # with a NodePort values file instead
36
+
37
+ current_k8s_context = k8s_context()
38
+ detected_local_k8s = "minikube" if "minikube" in current_k8s_context else "orbstack"
39
+ local_k8s = os.getenv("LOCAL_K8S", detected_local_k8s)
40
+ print("☸️ Kubernetes context: {} (local_k8s={})".format(current_k8s_context, local_k8s))
41
+
42
+ # values-minikube.yaml only contains what differs from values.yaml (NodePort
43
+ # instead of LoadBalancer, a pinned port). Helm merges multiple --values files
44
+ # in order, so on minikube we layer both instead of duplicating the file.
45
+ traefik_values_files = ["values.yaml"]
46
+ if local_k8s == "minikube":
47
+ traefik_values_files.append("values-minikube.yaml")
48
+
49
+ override_values_file = os.getenv("TRAEFIK_VALUES_FILE", "")
50
+ if override_values_file:
51
+ traefik_values_files = [override_values_file]
52
+
53
+ print("🔀 Using traefik values file(s): {}".format(", ".join(traefik_values_files)))
54
+
55
+ # Install Traefik GW
56
+ helm_repo('traefik-repo', 'https://traefik.github.io/charts', labels=[traefik_tilt_label])
57
+ helm_resource(
58
+ 'traefik',
59
+ 'traefik-repo/traefik',
60
+ namespace='traefik',
61
+ resource_deps=['traefik-repo'],
62
+ flags=[
63
+ '--version=39.0.0',
64
+ '--create-namespace',
65
+ ] + ['--values=./examples/traefik/{}'.format(f) for f in traefik_values_files],
66
+ )
67
+ # OpenCRVS application has traefik CRDs IngressRoute
68
+ # and Middleware, so we need to add traefik as dependency
69
+ # to all workloads that use them
70
+ traefik_deps = [
71
+ 'client',
72
+ 'countryconfig',
73
+ 'gateway',
74
+ 'login',
75
+ 'minio'
76
+ ]
77
+
78
+ k8s_resource("traefik", labels=[traefik_tilt_label])
79
+
80
+ # Add labels to traefik resources
81
+ traefik_ingress_objects = ["{}-route:ingressroute".format(dep) for dep in traefik_deps] + ['internal-routes:ingressroute']
82
+ traefik_middleware_objects = ["sts-and-basic-response-headers:middleware", "enable-compression:middleware", "block-internal-routes:middleware"]
83
+ k8s_resource(
84
+ objects=traefik_ingress_objects,
85
+ new_name='traefik-ingress-routes',
86
+ resource_deps=['traefik'],
87
+ labels=[traefik_tilt_label]
88
+ )
89
+ k8s_resource(
90
+ objects=traefik_middleware_objects,
91
+ new_name='traefik-middleware',
92
+ resource_deps=['traefik'],
93
+ labels=[traefik_tilt_label]
94
+ )
95
+
96
+ ######################################################
97
+ # Add labels to resources to OpenCRVS services
98
+ tilt_label = '4.Dependencies'
99
+ dependencies = [
100
+ 'elasticsearch',
101
+ 'minio',
102
+ 'redis',
103
+ 'postgres',
104
+ ]
105
+
106
+ for workload in dependencies:
107
+ k8s_resource(workload, labels=[tilt_label])
108
+
109
+ ######################################################
110
+ # Add labels to resources to OpenCRVS services
111
+ tilt_label = '1.OpenCRVS'
112
+
113
+ opensrvs_predeploy_jobs = [
114
+ 'postgres-on-deploy',
115
+ 'data-migration',
116
+ 'data-migration-analytics'
117
+ ]
118
+
119
+ opensrvs_services = [
120
+ 'auth',
121
+ 'client',
122
+ 'countryconfig',
123
+ 'documents',
124
+ 'events',
125
+ 'gateway',
126
+ 'login',
127
+ ]
128
+
129
+ opensrvs_postdeploy_jobs = [
130
+ 'elasticsearch-reindex',
131
+ ]
132
+
133
+ job_label = '3.Jobs'
134
+ previous_jobs = []
135
+ for job in opensrvs_predeploy_jobs:
136
+ if previous_jobs:
137
+ k8s_resource(job, labels=[job_label], resource_deps=dependencies + previous_jobs)
138
+ else:
139
+ k8s_resource(job, labels=[job_label], resource_deps=dependencies + previous_jobs)
140
+ previous_jobs.append(job)
141
+
142
+ for workload in opensrvs_services:
143
+ k8s_resource(workload, labels=[tilt_label], resource_deps=dependencies + opensrvs_predeploy_jobs)
144
+ for job in opensrvs_postdeploy_jobs:
145
+ k8s_resource(job, labels=[job_label], resource_deps=opensrvs_services)
146
+
147
+
148
+ if os.path.exists('playwright.config.ts'):
149
+ domain = 'opencrvs.localhost'
150
+ local_resource(
151
+ 'e2e-tests',
152
+ cmd='npx playwright install chromium && npx playwright test',
153
+ # The local environment is served over plain HTTP
154
+ env={'DOMAIN': domain, 'SCHEME': 'http'},
155
+ trigger_mode=TRIGGER_MODE_MANUAL,
156
+ auto_init=False,
157
+ allow_parallel=True,
158
+ labels=['6.Tests']
159
+ )
@@ -0,0 +1,15 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ hostname: opencrvs.localhost
11
+
12
+ ingress:
13
+ ssl_enabled: false
14
+
15
+ storage_type: host_path
@@ -0,0 +1,56 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ ingress:
11
+ ssl_enabled: false
12
+
13
+ env:
14
+ OPENCRVS_ENVIRONMENT: development
15
+
16
+ credentials:
17
+ super_user_password: password
18
+
19
+ # OpenCRVS core image tag:
20
+ platform:
21
+ tag: v2.0.0
22
+
23
+ countryconfig:
24
+ image:
25
+ tag: v2.0.0
26
+
27
+ # Horizontal Pod Autoscaler (HPA) configuration:
28
+ # Disabled by default for local environment.
29
+ hpa:
30
+ enabled: false
31
+
32
+ # Pod Disruption Budget (PDB) configuration:
33
+ # Disabled by default for local environment.
34
+ pdb:
35
+ enabled: false
36
+
37
+ # Dashboards is disabled by default to allow easy deployment on Apple Silicon
38
+ # If you are using x86 device, feel free to enable:
39
+ dashboards:
40
+ enabled: false
41
+
42
+ # Expose services on Node port
43
+ service_type: NodePort
44
+
45
+ data_seed:
46
+ enabled: false
47
+ env:
48
+ ACTIVATE_USERS: true
49
+
50
+ auth:
51
+ env:
52
+ TWO_FA_ENABLED: false
53
+
54
+ events:
55
+ env:
56
+ TWO_FA_ENABLED: false
@@ -0,0 +1,21 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+ #
10
+ # Minikube-only overrides, layered on top of values.yaml (see tilt/common.tilt,
11
+ # which passes both --values files to helm when the active context is minikube).
12
+ #
13
+ # minikube doesn't expose LoadBalancer services to the host on its own, so we
14
+ # switch to NodePort here, pinned to what
15
+ # `minikube start --ports=80:30080` publishes onto the host.
16
+ service:
17
+ type: NodePort
18
+
19
+ ports:
20
+ web:
21
+ nodePort: 30080
@@ -0,0 +1,38 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ # Overwriting https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml
11
+ namespaceOverride: "traefik"
12
+ logs:
13
+ general:
14
+ level: "INFO"
15
+ format: "common"
16
+ access:
17
+ enabled: true
18
+ ingressRoute:
19
+ dashboard:
20
+ enabled: false
21
+
22
+ tlsStore: {}
23
+
24
+ providers:
25
+ kubernetesCRD:
26
+ enabled: true
27
+ kubernetesIngress:
28
+ enabled: true
29
+ kubernetesGateway:
30
+ enabled: false
31
+ service:
32
+ enabled: true
33
+ single: false
34
+
35
+ ports:
36
+ web:
37
+ port: 8000
38
+ protocol: TCP
@@ -0,0 +1,17 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ ##################################################################################
11
+ # Use this file to customize helm chart behavior
12
+ # Please make sure your custom changes doesn't conflict with values.yaml
13
+ ##################################################################################
14
+
15
+ # Country specific overrides for the dependencies chart in local Tilt development.
16
+ # Applied on top of tilt/examples/dependencies/values.yaml and never overwritten by
17
+ # 'opencrvs upgrade'.
@@ -0,0 +1,16 @@
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
+ #
5
+ # OpenCRVS is also distributed under the terms of the Civil Registration
6
+ # & Healthcare Disclaimer located at http://opencrvs.org/license.
7
+ #
8
+ # Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
9
+
10
+ ##################################################################################
11
+ # Use this file to customize helm chart behavior
12
+ # Please make sure your custom changes doesn't conflict with values.yaml
13
+ ##################################################################################
14
+ # Country specific overrides for the opencrvs-services chart in local Tilt development.
15
+ # Applied on top of tilt/examples/opencrvs-services/values.yaml and never overwritten by
16
+ # 'opencrvs upgrade'.