@opencrvs/toolkit 2.0.0-rc.e94ba6c → 2.0.0-rc.e9eb54d

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 (117) hide show
  1. package/README.md +15 -0
  2. package/build.sh +5 -4
  3. package/create-countryconfig/index.js +50 -20
  4. package/create-countryconfig/package.json +12 -2
  5. package/dist/application-config/index.js +286 -123
  6. package/dist/cli.js +3219 -4778
  7. package/dist/commons/api/router.d.ts +3367 -217
  8. package/dist/commons/application-config/index.d.ts +1 -0
  9. package/dist/commons/conditionals/conditionals.d.ts +357 -7
  10. package/dist/commons/conditionals/validate.d.ts +52 -2
  11. package/dist/commons/events/ActionConfig.d.ts +204 -2
  12. package/dist/commons/events/ActionDocument.d.ts +6 -0
  13. package/dist/commons/events/ActionInput.d.ts +114 -0
  14. package/dist/commons/events/AdvancedSearchConfig.d.ts +354 -0
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
  16. package/dist/commons/events/Draft.d.ts +4 -2
  17. package/dist/commons/events/EventConfig.d.ts +2 -0
  18. package/dist/commons/events/EventDocument.d.ts +3 -0
  19. package/dist/commons/events/EventIndex.d.ts +25 -3
  20. package/dist/commons/events/EventMetadata.d.ts +26 -7
  21. package/dist/commons/events/FieldConfig.d.ts +388 -50
  22. package/dist/commons/events/FieldType.d.ts +1 -0
  23. package/dist/commons/events/FieldTypeMapping.d.ts +1 -1
  24. package/dist/commons/events/FieldValue.d.ts +6 -0
  25. package/dist/commons/events/WorkqueueConfig.d.ts +189 -150
  26. package/dist/commons/events/field.d.ts +53 -1
  27. package/dist/commons/events/index.d.ts +2 -0
  28. package/dist/commons/events/locations.d.ts +1 -0
  29. package/dist/commons/events/state/flags.d.ts +16 -0
  30. package/dist/commons/events/state/index.d.ts +8 -4
  31. package/dist/commons/events/state/utils.d.ts +21 -289
  32. package/dist/commons/events/utils.d.ts +13 -2
  33. package/dist/conditionals/index.js +63 -5
  34. package/dist/environment/custom-types.d.ts +33 -0
  35. package/dist/environment/custom-types.d.ts.map +1 -0
  36. package/dist/environment/custom-types.js +12 -0
  37. package/dist/environment/derived-variables.d.ts +134 -0
  38. package/dist/environment/derived-variables.d.ts.map +1 -0
  39. package/dist/environment/derived-variables.js +169 -0
  40. package/dist/environment/editor-questions.d.ts +4 -0
  41. package/dist/environment/editor-questions.d.ts.map +1 -0
  42. package/dist/environment/editor-questions.js +67 -0
  43. package/dist/environment/git.d.ts +5 -0
  44. package/dist/environment/git.d.ts.map +1 -0
  45. package/dist/environment/git.js +38 -0
  46. package/dist/environment/github.d.ts +26 -0
  47. package/dist/environment/github.d.ts.map +1 -0
  48. package/dist/environment/github.js +247 -0
  49. package/dist/environment/index.d.ts +5 -0
  50. package/dist/environment/index.d.ts.map +1 -0
  51. package/dist/environment/index.js +71 -0
  52. package/dist/environment/logger.d.ts +15 -0
  53. package/dist/environment/logger.d.ts.map +1 -0
  54. package/dist/environment/logger.js +25 -0
  55. package/dist/environment/manage-users.d.ts +11 -0
  56. package/dist/environment/manage-users.d.ts.map +1 -0
  57. package/dist/environment/manage-users.js +497 -0
  58. package/dist/environment/questions-helper.d.ts +15 -0
  59. package/dist/environment/questions-helper.d.ts.map +1 -0
  60. package/dist/environment/questions-helper.js +70 -0
  61. package/dist/environment/questions.d.ts +199 -0
  62. package/dist/environment/questions.d.ts.map +1 -0
  63. package/dist/environment/questions.js +412 -0
  64. package/dist/environment/setup-environment.d.ts +2 -0
  65. package/dist/environment/setup-environment.d.ts.map +1 -0
  66. package/dist/environment/setup-environment.js +794 -0
  67. package/dist/environment/ssh-keygen.d.ts +5 -0
  68. package/dist/environment/ssh-keygen.d.ts.map +1 -0
  69. package/dist/environment/ssh-keygen.js +21 -0
  70. package/dist/environment/swarm-to-k8s.d.ts +2 -0
  71. package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
  72. package/dist/environment/swarm-to-k8s.js +173 -0
  73. package/dist/environment/templates.d.ts +27 -0
  74. package/dist/environment/templates.d.ts.map +1 -0
  75. package/dist/environment/templates.js +163 -0
  76. package/dist/environment/update-workflows.d.ts +2 -0
  77. package/dist/environment/update-workflows.d.ts.map +1 -0
  78. package/dist/environment/update-workflows.js +169 -0
  79. package/dist/environment/users.d.ts +2 -0
  80. package/dist/environment/users.d.ts.map +1 -0
  81. package/dist/environment/users.js +112 -0
  82. package/dist/environment/utils.d.ts +18 -0
  83. package/dist/environment/utils.d.ts.map +1 -0
  84. package/dist/environment/utils.js +100 -0
  85. package/dist/events/index.js +1205 -295
  86. package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
  87. package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
  88. package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
  89. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +3 -0
  90. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +1 -0
  91. package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +110 -0
  92. package/dist/migrations/v2.0/index.d.ts.map +1 -1
  93. package/dist/migrations/v2.0/index.js +88 -4963
  94. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -1
  95. package/dist/migrations/v2.0/migrate-scopes.js +54 -30
  96. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
  97. package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
  98. package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
  99. package/dist/migrations/v2.1/index.d.ts +6 -0
  100. package/dist/migrations/v2.1/index.d.ts.map +1 -0
  101. package/dist/migrations/v2.1/index.js +218 -0
  102. package/dist/notification/index.js +1005 -162
  103. package/dist/scopes/index.d.ts +93 -7
  104. package/dist/scopes/index.js +20 -7
  105. package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
  106. package/dist/templates/charts-values/dependencies/values.yaml +83 -0
  107. package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
  108. package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -0
  109. package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
  110. package/dist/templates/charts-values/traefik/values.yaml +115 -0
  111. package/dist/templates/inventory/inventory.template.yml +100 -0
  112. package/dist/templates/inventory/production.example.yml +77 -0
  113. package/dist/templates/inventory/qa.example.yml +48 -0
  114. package/opencrvs-toolkit-2.0.0-rc.e9eb54d.tgz +0 -0
  115. package/package.json +20 -2
  116. package/tsconfig.tsbuildinfo +1 -1
  117. package/opencrvs-toolkit-2.0.0-rc.e94ba6c.tgz +0 -0
@@ -1,5 +1,5 @@
1
1
  export declare const UPSTREAM_URL = "https://github.com/opencrvs/opencrvs-countryconfig.git";
2
- export declare const UPSTREAM_BRANCH = "release-v2.0.0";
2
+ export declare const UPSTREAM_BRANCH = "release/2.0.0";
3
3
  /**
4
4
  * Runs a git command in the country config working directory.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;AAE1D,eAAO,MAAM,eAAe,mBAAmB,CAAA;AAc/C;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAO9C;AAED,wBAAgB,eAAe,IAAI,IAAI,CAMtC;AAID,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;AAE1D,eAAO,MAAM,eAAe,kBAAkB,CAAA;AAc9C;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAO9C;AAED,wBAAgB,eAAe,IAAI,IAAI,CAMtC;AAID,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -59,7 +59,7 @@ exports.main = main;
59
59
  */
60
60
  const child_process_1 = require("child_process");
61
61
  exports.UPSTREAM_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git';
62
- exports.UPSTREAM_BRANCH = 'release-v2.0.0';
62
+ exports.UPSTREAM_BRANCH = 'release/2.0.0';
63
63
  // Remote name used only for the duration of this codemod. Prefixed to avoid
64
64
  // clashing with remotes the user may have (origin, upstream, etc.).
65
65
  const TEMP_REMOTE = 'opencrvs-upgrade-v19-v20-codemod';
@@ -0,0 +1,3 @@
1
+ declare function main(): Promise<void>;
2
+ export { main };
3
+ //# sourceMappingURL=fix-accept-requested-registration-function-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-accept-requested-registration-function-type.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/fix-accept-requested-registration-function-type.ts"],"names":[],"mappings":"AAuFA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -0,0 +1,110 @@
1
+ "use strict";
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.main = main;
26
+ /**
27
+ * Codemod: In `acceptRequestedRegistration`, update the `action` parameter type from:
28
+ * action: ActionInput
29
+ * to:
30
+ * action: Extract<ActionInput, { type?: 'REGISTER' }>
31
+ *
32
+ * What it does:
33
+ * - Scans all TypeScript files under `src/`
34
+ * - Finds `acceptRequestedRegistration` (function declaration or const assignment)
35
+ * - Rewrites only the `action` parameter when its type is exactly `ActionInput`
36
+ * - Saves modified files in-place
37
+ */
38
+ /* eslint-disable no-console */
39
+ const ts_morph_1 = require("ts-morph");
40
+ const path_1 = __importDefault(require("path"));
41
+ const TARGET_FUNCTION_NAME = 'acceptRequestedRegistration';
42
+ const ACTION_PARAMETER_NAME = 'action';
43
+ const OLD_TYPE = 'ActionInput';
44
+ const NEW_TYPE = "Extract<ActionInput, { type?: 'REGISTER' }>";
45
+ function isAcceptRequestedRegistrationParameter(parameter) {
46
+ const functionDeclaration = parameter.getFirstAncestorByKind(ts_morph_1.SyntaxKind.FunctionDeclaration);
47
+ if ((functionDeclaration === null || functionDeclaration === void 0 ? void 0 : functionDeclaration.getName()) === TARGET_FUNCTION_NAME) {
48
+ return true;
49
+ }
50
+ const arrowFunction = parameter.getFirstAncestorByKind(ts_morph_1.SyntaxKind.ArrowFunction);
51
+ const variableDeclaration = arrowFunction === null || arrowFunction === void 0 ? void 0 : arrowFunction.getFirstAncestorByKind(ts_morph_1.SyntaxKind.VariableDeclaration);
52
+ return (variableDeclaration === null || variableDeclaration === void 0 ? void 0 : variableDeclaration.getName()) === TARGET_FUNCTION_NAME;
53
+ }
54
+ function processFile(filePath, project) {
55
+ const sourceFile = project.getSourceFile(filePath);
56
+ if (!sourceFile)
57
+ return 0;
58
+ let updatedCount = 0;
59
+ for (const parameter of sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.Parameter)) {
60
+ if (parameter.getName() !== ACTION_PARAMETER_NAME) {
61
+ continue;
62
+ }
63
+ if (!isAcceptRequestedRegistrationParameter(parameter)) {
64
+ continue;
65
+ }
66
+ const typeNode = parameter.getTypeNode();
67
+ if (!typeNode || typeNode.getText() !== OLD_TYPE) {
68
+ continue;
69
+ }
70
+ parameter.setType(NEW_TYPE);
71
+ updatedCount++;
72
+ console.log(` [${path_1.default.relative(process.cwd(), filePath)}] Updated '${ACTION_PARAMETER_NAME}' in ${TARGET_FUNCTION_NAME} to ${NEW_TYPE}`);
73
+ }
74
+ return updatedCount;
75
+ }
76
+ function main() {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const srcDir = path_1.default.join(process.cwd(), 'src');
79
+ console.log(`Scanning for ${TARGET_FUNCTION_NAME} in: ${srcDir}\n`);
80
+ const project = new ts_morph_1.Project({
81
+ tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
82
+ skipAddingFilesFromTsConfig: false
83
+ });
84
+ const sourceFiles = project.getSourceFiles().filter((sf) => {
85
+ const filePath = sf.getFilePath();
86
+ return filePath.includes('/src/') && !filePath.includes('/node_modules/');
87
+ });
88
+ let totalUpdated = 0;
89
+ const modifiedFiles = [];
90
+ for (const sourceFile of sourceFiles) {
91
+ const filePath = sourceFile.getFilePath();
92
+ const updated = processFile(filePath, project);
93
+ if (updated > 0) {
94
+ totalUpdated += updated;
95
+ modifiedFiles.push(filePath);
96
+ }
97
+ }
98
+ if (modifiedFiles.length === 0) {
99
+ console.log(`No '${ACTION_PARAMETER_NAME}: ${OLD_TYPE}' parameter in ${TARGET_FUNCTION_NAME} found. Nothing to do.`);
100
+ return;
101
+ }
102
+ console.log(`\nSaving ${modifiedFiles.length} modified file(s)...`);
103
+ for (const filePath of modifiedFiles) {
104
+ const sourceFile = project.getSourceFileOrThrow(filePath);
105
+ yield sourceFile.save();
106
+ console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
107
+ }
108
+ console.log(`\nDone. Updated ${totalUpdated} parameter type annotation(s) in ${TARGET_FUNCTION_NAME}.`);
109
+ });
110
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AA6CA;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBAgCpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AA8CA;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBAiCpD"}