@opencrvs/toolkit 1.9.12-rc.8638b48 → 1.9.12-rc.93fbfb9

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 (121) hide show
  1. package/build.sh +13 -0
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/application-config/index.d.ts +2 -0
  4. package/dist/application-config/index.d.ts.map +1 -0
  5. package/dist/application-config/index.js +135 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.d.ts.map +1 -0
  8. package/dist/cli.js +3237 -0
  9. package/dist/commons/api/router.d.ts +3386 -2248
  10. package/dist/commons/application-config/index.d.ts +82 -0
  11. package/dist/commons/conditionals/conditionals.d.ts +27 -3
  12. package/dist/commons/conditionals/validate.d.ts +13 -2
  13. package/dist/commons/events/ActionConfig.d.ts +415 -1555
  14. package/dist/commons/events/ActionDocument.d.ts +889 -1942
  15. package/dist/commons/events/ActionInput.d.ts +277 -1073
  16. package/dist/commons/events/ActionType.d.ts +91 -11
  17. package/dist/commons/events/AdvancedSearchConfig.d.ts +294 -1238
  18. package/dist/commons/events/AuditLog.d.ts +405 -0
  19. package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
  20. package/dist/commons/events/Conditional.d.ts +26 -38
  21. package/dist/commons/events/Constants.d.ts +1 -1
  22. package/dist/commons/events/CountryConfigQueryInput.d.ts +1592 -4471
  23. package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
  24. package/dist/commons/events/Draft.d.ts +73 -108
  25. package/dist/commons/events/DynamicFieldValue.d.ts +12 -78
  26. package/dist/commons/events/EventConfig.d.ts +35 -2250
  27. package/dist/commons/events/EventConfigInput.d.ts +0 -3
  28. package/dist/commons/events/EventDocument.d.ts +354 -1366
  29. package/dist/commons/events/EventIndex.d.ts +212 -1010
  30. package/dist/commons/events/EventInput.d.ts +3 -8
  31. package/dist/commons/events/EventMetadata.d.ts +130 -357
  32. package/dist/commons/events/FieldConfig.d.ts +2893 -12547
  33. package/dist/commons/events/FieldType.d.ts +26 -4
  34. package/dist/commons/events/FieldTypeMapping.d.ts +314 -906
  35. package/dist/commons/events/FieldValue.d.ts +149 -527
  36. package/dist/commons/events/FileUtils.d.ts +2 -2
  37. package/dist/commons/events/Flag.d.ts +67 -0
  38. package/dist/commons/events/FormConfig.d.ts +54 -721
  39. package/dist/commons/events/PageConfig.d.ts +58 -320
  40. package/dist/commons/events/PlainDate.d.ts +1 -1
  41. package/dist/commons/events/SummaryConfig.d.ts +14 -161
  42. package/dist/commons/events/TemplateConfig.d.ts +2 -3
  43. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  44. package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
  45. package/dist/commons/events/WorkqueueConfig.d.ts +2208 -7553
  46. package/dist/commons/events/deduplication.d.ts +3 -3
  47. package/dist/commons/events/defineConfig.d.ts +2 -233
  48. package/dist/commons/events/eventConfigValidation.d.ts +8 -0
  49. package/dist/commons/events/index.d.ts +3 -0
  50. package/dist/commons/events/locations.d.ts +57 -20
  51. package/dist/commons/events/scopes.d.ts +35 -34
  52. package/dist/commons/events/state/availableActions.d.ts +7 -2
  53. package/dist/commons/events/state/flags.d.ts +21 -3
  54. package/dist/commons/events/state/index.d.ts +30 -27
  55. package/dist/commons/events/state/utils.d.ts +191 -173
  56. package/dist/commons/events/test.utils.d.ts +52 -11
  57. package/dist/commons/events/transactions.d.ts +1 -1
  58. package/dist/commons/events/utils.d.ts +374 -429
  59. package/dist/commons/notification/UserNotifications.d.ts +61 -637
  60. package/dist/conditionals/index.d.ts.map +1 -1
  61. package/dist/conditionals/index.js +302 -14
  62. package/dist/events/deduplication.d.ts +3 -3
  63. package/dist/events/index.js +2853 -2127
  64. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
  65. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
  66. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
  67. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
  68. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
  69. package/dist/migrations/v2.0/convert-config-files-to-ts.js +829 -0
  70. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
  71. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
  72. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
  73. package/dist/migrations/v2.0/index.d.ts +7 -0
  74. package/dist/migrations/v2.0/index.d.ts.map +1 -0
  75. package/dist/migrations/v2.0/index.js +3176 -0
  76. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
  77. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
  78. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
  79. package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
  80. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
  81. package/dist/migrations/v2.0/migrate-scopes.js +282 -0
  82. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
  83. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
  84. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
  85. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
  86. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
  87. package/dist/migrations/v2.0/migrate-workqueue-configs.js +237 -0
  88. package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
  89. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
  90. package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
  91. package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
  92. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
  93. package/dist/migrations/v2.0/remove-demo-scope.js +75 -0
  94. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
  95. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
  96. package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
  97. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
  98. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
  99. package/dist/migrations/v2.0/remove-hearth-migrations.js +78 -0
  100. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
  101. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
  102. package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
  103. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
  104. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
  105. package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
  106. package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
  107. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
  108. package/dist/migrations/v2.0/rename-api-paths.js +188 -0
  109. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
  110. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
  111. package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
  112. package/dist/notification/index.d.ts.map +1 -1
  113. package/dist/notification/index.js +2088 -1790
  114. package/dist/scopes/index.d.ts +640 -353
  115. package/dist/scopes/index.d.ts.map +1 -1
  116. package/dist/scopes/index.js +340 -300
  117. package/opencrvs-toolkit-1.9.12-rc.93fbfb9.tgz +0 -0
  118. package/package.json +18 -8
  119. package/tsconfig.json +12 -2
  120. package/tsconfig.tsbuildinfo +1 -1
  121. 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."
@@ -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"}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/application-config/index.ts
31
+ var application_config_exports = {};
32
+ __export(application_config_exports, {
33
+ ApplicationConfig: () => ApplicationConfig,
34
+ BackgroundConfig: () => BackgroundConfig,
35
+ ClientConfig: () => ClientConfig,
36
+ LoginConfig: () => LoginConfig,
37
+ SearchCriteria: () => SearchCriteria,
38
+ defineApplicationConfig: () => defineApplicationConfig,
39
+ defineClientConfig: () => defineClientConfig,
40
+ defineLoginConfig: () => defineLoginConfig
41
+ });
42
+ module.exports = __toCommonJS(application_config_exports);
43
+
44
+ // ../commons/src/application-config.ts
45
+ var z2 = __toESM(require("zod/v4"));
46
+
47
+ // ../commons/src/events/TranslationConfig.ts
48
+ var z = __toESM(require("zod/v4"));
49
+ var TranslationConfig = z.object({
50
+ id: z.string().describe(
51
+ "The identifier of the translation referred in translation CSV files"
52
+ ),
53
+ defaultMessage: z.string().describe("Default translation message"),
54
+ description: z.string().describe(
55
+ "Describe the translation for a translator to be able to identify it."
56
+ )
57
+ }).meta({
58
+ description: "Translation configuration",
59
+ id: "TranslationConfig"
60
+ });
61
+
62
+ // ../commons/src/application-config.ts
63
+ var SearchCriteria = z2.enum([
64
+ "TRACKING_ID",
65
+ "REGISTRATION_NUMBER",
66
+ "NATIONAL_ID",
67
+ "NAME",
68
+ "PHONE_NUMBER",
69
+ "EMAIL"
70
+ ]);
71
+ var ApplicationConfig = z2.object({
72
+ APPLICATION_NAME: z2.string(),
73
+ COUNTRY_LOGO: z2.object({
74
+ fileName: z2.string(),
75
+ file: z2.string()
76
+ }),
77
+ SYSTEM_IANA_TIMEZONE: z2.string(),
78
+ CURRENCY: z2.object({
79
+ languagesAndCountry: z2.array(z2.string()),
80
+ isoCode: z2.string()
81
+ }),
82
+ ADMIN_STRUCTURE: z2.array(
83
+ z2.object({
84
+ id: z2.string(),
85
+ label: TranslationConfig
86
+ })
87
+ ),
88
+ PHONE_NUMBER_PATTERN: z2.string().or(z2.instanceof(RegExp)),
89
+ USER_NOTIFICATION_DELIVERY_METHOD: z2.string(),
90
+ INFORMANT_NOTIFICATION_DELIVERY_METHOD: z2.string(),
91
+ SEARCH_DEFAULT_CRITERIA: SearchCriteria.optional().default("TRACKING_ID")
92
+ });
93
+ var defineApplicationConfig = (config) => {
94
+ return ApplicationConfig.parse(config);
95
+ };
96
+ var BackgroundConfig = z2.object({
97
+ backgroundColor: z2.string().optional(),
98
+ backgroundImage: z2.string().optional(),
99
+ imageFit: z2.string().optional()
100
+ }).refine(
101
+ (data) => !!(data.backgroundColor || data.backgroundImage),
102
+ "backgroundColor and backgroundImage cannot be empty at the same time"
103
+ );
104
+ var LoginConfig = z2.object({
105
+ COUNTRY: z2.string(),
106
+ LANGUAGES: z2.array(z2.string()),
107
+ USER_NOTIFICATION_DELIVERY_METHOD: z2.string(),
108
+ INFORMANT_NOTIFICATION_DELIVERY_METHOD: z2.string(),
109
+ PHONE_NUMBER_PATTERN: z2.string().or(z2.instanceof(RegExp)),
110
+ LOGIN_BACKGROUND: BackgroundConfig,
111
+ SENTRY: z2.string().optional()
112
+ });
113
+ var defineLoginConfig = (config) => {
114
+ return LoginConfig.parse(config);
115
+ };
116
+ var ClientConfig = z2.object({
117
+ COUNTRY: z2.string(),
118
+ LANGUAGES: z2.array(z2.string()),
119
+ SENTRY: z2.string().optional(),
120
+ REGISTER_BACKGROUND: BackgroundConfig,
121
+ DASHBOARDS: z2.array(
122
+ z2.object({
123
+ id: z2.string(),
124
+ title: TranslationConfig,
125
+ url: z2.string(),
126
+ context: z2.object({
127
+ auth: z2.literal("REQUEST_AUTH_TOKEN")
128
+ }).optional()
129
+ })
130
+ ),
131
+ FEATURES: z2.object({ V2_EVENTS: z2.boolean().optional().default(true) }).optional().default({ V2_EVENTS: true })
132
+ });
133
+ var defineClientConfig = (config) => {
134
+ return ClientConfig.parse(config);
135
+ };
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}