@opencrvs/toolkit 1.9.13-rc.f1fdcea → 2.0.0-beta

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 (157) hide show
  1. package/build.sh +13 -0
  2. package/create-countryconfig/index.js +73 -0
  3. package/create-countryconfig/package.json +11 -0
  4. package/dist/api/index.d.ts.map +1 -1
  5. package/dist/application-config/index.d.ts +2 -0
  6. package/dist/application-config/index.d.ts.map +1 -0
  7. package/dist/application-config/index.js +2158 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +4974 -0
  11. package/dist/commons/api/router.d.ts +3497 -2348
  12. package/dist/commons/application-config/index.d.ts +96 -0
  13. package/dist/commons/conditionals/conditionals.d.ts +27 -3
  14. package/dist/commons/conditionals/validate.d.ts +13 -2
  15. package/dist/commons/events/ActionConfig.d.ts +415 -1555
  16. package/dist/commons/events/ActionDocument.d.ts +888 -1941
  17. package/dist/commons/events/ActionInput.d.ts +277 -1073
  18. package/dist/commons/events/ActionType.d.ts +91 -11
  19. package/dist/commons/events/AdvancedSearchConfig.d.ts +294 -1496
  20. package/dist/commons/events/AuditLog.d.ts +407 -0
  21. package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
  22. package/dist/commons/events/Conditional.d.ts +26 -38
  23. package/dist/commons/events/Constants.d.ts +1 -1
  24. package/dist/commons/events/CountryConfigQueryInput.d.ts +1592 -4471
  25. package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
  26. package/dist/commons/events/Draft.d.ts +72 -107
  27. package/dist/commons/events/DynamicFieldValue.d.ts +12 -78
  28. package/dist/commons/events/EventConfig.d.ts +37 -2420
  29. package/dist/commons/events/EventConfigInput.d.ts +0 -3
  30. package/dist/commons/events/EventDocument.d.ts +354 -1366
  31. package/dist/commons/events/EventIndex.d.ts +212 -1010
  32. package/dist/commons/events/EventInput.d.ts +3 -8
  33. package/dist/commons/events/EventMetadata.d.ts +130 -357
  34. package/dist/commons/events/FieldConfig.d.ts +2902 -12901
  35. package/dist/commons/events/FieldType.d.ts +26 -4
  36. package/dist/commons/events/FieldTypeMapping.d.ts +314 -906
  37. package/dist/commons/events/FieldValue.d.ts +149 -527
  38. package/dist/commons/events/FileUtils.d.ts +2 -2
  39. package/dist/commons/events/Flag.d.ts +67 -0
  40. package/dist/commons/events/FormConfig.d.ts +54 -721
  41. package/dist/commons/events/PageConfig.d.ts +58 -320
  42. package/dist/commons/events/PlainDate.d.ts +1 -1
  43. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  44. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  45. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  46. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  47. package/dist/commons/events/WorkqueueConfig.d.ts +2208 -7553
  48. package/dist/commons/events/deduplication.d.ts +3 -3
  49. package/dist/commons/events/defineConfig.d.ts +2 -247
  50. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  51. package/dist/commons/events/index.d.ts +3 -0
  52. package/dist/commons/events/locations.d.ts +93 -19
  53. package/dist/commons/events/mocks.test.utils.d.ts +19 -0
  54. package/dist/commons/events/scopes.d.ts +56 -32
  55. package/dist/commons/events/state/availableActions.d.ts +7 -2
  56. package/dist/commons/events/state/flags.d.ts +21 -3
  57. package/dist/commons/events/state/index.d.ts +30 -27
  58. package/dist/commons/events/state/utils.d.ts +190 -172
  59. package/dist/commons/events/test.utils.d.ts +52 -11
  60. package/dist/commons/events/transactions.d.ts +1 -1
  61. package/dist/commons/events/utils.d.ts +374 -443
  62. package/dist/commons/notification/UserNotifications.d.ts +76 -637
  63. package/dist/conditionals/index.d.ts.map +1 -1
  64. package/dist/conditionals/index.js +332 -14
  65. package/dist/events/deduplication.d.ts +3 -3
  66. package/dist/events/index.js +2989 -2121
  67. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
  68. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
  69. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +429 -0
  70. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
  71. package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
  72. package/dist/migrations/v2.0/add-resend-invite-notification.js +373 -0
  73. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +22 -0
  74. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -0
  75. package/dist/migrations/v2.0/checkout-upstream-files.js +147 -0
  76. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
  77. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
  78. package/dist/migrations/v2.0/convert-config-files-to-ts.js +828 -0
  79. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
  80. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
  81. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +158 -0
  82. package/dist/migrations/v2.0/create-events-index.d.ts +3 -0
  83. package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -0
  84. package/dist/migrations/v2.0/create-events-index.js +325 -0
  85. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +3 -0
  86. package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
  87. package/dist/migrations/v2.0/delete-infrastructure-directory.js +77 -0
  88. package/dist/migrations/v2.0/index.d.ts +11 -0
  89. package/dist/migrations/v2.0/index.d.ts.map +1 -0
  90. package/dist/migrations/v2.0/index.js +4884 -0
  91. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
  92. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
  93. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +432 -0
  94. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +3 -0
  95. package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
  96. package/dist/migrations/v2.0/merge-infrastructure-directory.js +221 -0
  97. package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
  98. package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
  99. package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
  100. package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
  101. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
  102. package/dist/migrations/v2.0/migrate-scopes.js +281 -0
  103. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
  104. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
  105. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +267 -0
  106. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
  107. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
  108. package/dist/migrations/v2.0/migrate-workqueue-configs.js +236 -0
  109. package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
  110. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
  111. package/dist/migrations/v2.0/remove-delete-actions.js +156 -0
  112. package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
  113. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
  114. package/dist/migrations/v2.0/remove-demo-scope.js +74 -0
  115. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
  116. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
  117. package/dist/migrations/v2.0/remove-deprecated-imports.js +96 -0
  118. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
  119. package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
  120. package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
  121. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
  122. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
  123. package/dist/migrations/v2.0/remove-hearth-migrations.js +77 -0
  124. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
  125. package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
  126. package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
  127. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
  128. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
  129. package/dist/migrations/v2.0/remove-pending-certification-flag.js +109 -0
  130. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
  131. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
  132. package/dist/migrations/v2.0/remove-review-from-register-action.js +163 -0
  133. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
  134. package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
  135. package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
  136. package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
  137. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
  138. package/dist/migrations/v2.0/rename-api-paths.js +187 -0
  139. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
  140. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
  141. package/dist/migrations/v2.0/rename-location-parent-id.js +180 -0
  142. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +3 -0
  143. package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -0
  144. package/dist/migrations/v2.0/simplify-analytics-precalculations.js +195 -0
  145. package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
  146. package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
  147. package/dist/migrations/v2.0/update-package-json.js +105 -0
  148. package/dist/notification/index.d.ts.map +1 -1
  149. package/dist/notification/index.js +2112 -1770
  150. package/dist/scopes/index.d.ts +716 -352
  151. package/dist/scopes/index.d.ts.map +1 -1
  152. package/dist/scopes/index.js +374 -299
  153. package/opencrvs-toolkit-2.0.0-beta.tgz +0 -0
  154. package/package.json +18 -8
  155. package/tsconfig.json +12 -2
  156. package/tsconfig.tsbuildinfo +1 -1
  157. package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
package/build.sh CHANGED
@@ -45,6 +45,15 @@ npx esbuild src/notification/index.ts --bundle --format=cjs --outdir=./dist/noti
45
45
  mkdir -p ./dist/commons/notification
46
46
  cp -r ../commons/build/dist/common/notification/*.d.ts ./dist/commons/notification
47
47
 
48
+ # Build application config
49
+ npx esbuild src/application-config/index.ts --bundle --format=cjs --outdir=./dist/application-config --allow-overwrite --packages=external
50
+ mkdir -p ./dist/commons/application-config
51
+ cp -r ../commons/build/dist/common/application-config.d.ts ./dist/commons/application-config/index.d.ts
52
+
53
+ # Build migration CLI
54
+ npx esbuild src/migrations/v2.0/index.ts --bundle --format=cjs --outdir=./dist/migrations/v2.0 --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
55
+ chmod +x ./dist/migrations/v2.0/index.js
56
+
48
57
  if [[ "$OSTYPE" == "darwin"* ]]; then
49
58
  sed -i '' 's|@opencrvs/events/build/types|../commons/api|g' dist/api/index.d.ts
50
59
  find dist -type f -exec sed -i '' 's|@opencrvs/commons|../commons|g' {} +
@@ -53,4 +62,8 @@ else
53
62
  find dist -type f -exec sed -i 's|@opencrvs/commons|../commons|g' {} +
54
63
  fi
55
64
 
65
+ # Build CLI
66
+ npx esbuild src/cli.ts --bundle --format=cjs --outdir=./dist --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
67
+ chmod +x ./dist/cli.js
68
+
56
69
  echo "Build completed successfully."
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+
3
+ /*
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ *
8
+ * OpenCRVS is also distributed under the terms of the Civil Registration
9
+ * & Healthcare Disclaimer located at http://opencrvs.org/license.
10
+ *
11
+ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
12
+ */
13
+
14
+ const { execSync } = require('child_process')
15
+ const path = require('path')
16
+ const fs = require('fs')
17
+
18
+ const REPO_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git'
19
+
20
+ const projectName = process.argv[2]
21
+
22
+ if (!projectName) {
23
+ console.error(
24
+ 'Please specify a project name:\n\n npm create @opencrvs/countryconfig <project-name>\n'
25
+ )
26
+ process.exit(1)
27
+ }
28
+
29
+ const targetDir = path.resolve(process.cwd(), projectName)
30
+
31
+ if (fs.existsSync(targetDir)) {
32
+ console.error(`Error: Directory "${projectName}" already exists.`)
33
+ process.exit(1)
34
+ }
35
+
36
+ console.log(`\nScaffolding OpenCRVS country config in ./${projectName}...\n`)
37
+
38
+ try {
39
+ execSync(`git clone --depth 1 ${REPO_URL} ${projectName}`, {
40
+ stdio: 'inherit'
41
+ })
42
+ } catch (err) {
43
+ console.error('Failed to clone the repository:', err.message)
44
+ process.exit(1)
45
+ }
46
+
47
+ try {
48
+ fs.rmSync(path.join(targetDir, '.git'), { recursive: true, force: true })
49
+ } catch (err) {
50
+ console.error('Failed to remove .git directory:', err.message)
51
+ process.exit(1)
52
+ }
53
+
54
+ const pkgPath = path.join(targetDir, 'package.json')
55
+ if (fs.existsSync(pkgPath)) {
56
+ try {
57
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
58
+ pkg.name = projectName
59
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
60
+ } catch (err) {
61
+ console.error('Failed to update package.json:', err.message)
62
+ process.exit(1)
63
+ }
64
+ } else {
65
+ console.warn(
66
+ `Warning: No package.json found in the cloned repository. Project name was not updated.`
67
+ )
68
+ }
69
+
70
+ console.log(`\nDone! To get started:\n`)
71
+ console.log(` cd ${projectName}`)
72
+ console.log(` git init`)
73
+ console.log(` npm install\n`)
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@opencrvs/create-countryconfig",
3
+ "version": "1.0.0",
4
+ "description": "Scaffold a new OpenCRVS country configuration",
5
+ "bin": {
6
+ "create-countryconfig": "./index.js"
7
+ },
8
+ "files": ["index.js"],
9
+ "keywords": ["opencrvs", "countryconfig", "create"],
10
+ "license": "MPL-2.0"
11
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,cAAc,CAAA;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAE/D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,UAAU,MAAM,EAAE,GACxB,gBAAgB,CAAC,SAAS,CAAC,CAc7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,cAAc,CAAA;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAE/D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,UAAU,MAAM,EAAE,GACxB,gBAAgB,CAAC,SAAS,CAAC,CAc7B"}
@@ -0,0 +1,2 @@
1
+ export * from '../commons/application-config';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application-config/index.ts"],"names":[],"mappings":"AAUA,cAAc,sCAAsC,CAAA"}