@opencrvs/toolkit 2.1.0-rc.0066f38 → 2.1.0-rc.00fa07b

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 (83) hide show
  1. package/README.md +1 -0
  2. package/dist/application-config/index.js +3 -1
  3. package/dist/cli.js +174 -106
  4. package/dist/commons/api/router.d.ts +3428 -3360
  5. package/dist/commons/application-config/index.d.ts +6 -6
  6. package/dist/commons/conditionals/conditionals.d.ts +32 -323
  7. package/dist/commons/events/ActionConfig.d.ts +105 -105
  8. package/dist/commons/events/ActionDocument.d.ts +119 -119
  9. package/dist/commons/events/ActionInput.d.ts +0 -6
  10. package/dist/commons/events/ActionType.d.ts +62 -62
  11. package/dist/commons/events/AdvancedSearchConfig.d.ts +513 -507
  12. package/dist/commons/events/AuditLog.d.ts +79 -42
  13. package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
  14. package/dist/commons/events/Conditional.d.ts +3 -3
  15. package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
  16. package/dist/commons/events/Draft.d.ts +37 -37
  17. package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
  18. package/dist/commons/events/EventConfig.d.ts +5 -5
  19. package/dist/commons/events/EventDocument.d.ts +48 -48
  20. package/dist/commons/events/EventIndex.d.ts +62 -62
  21. package/dist/commons/events/EventMetadata.d.ts +40 -40
  22. package/dist/commons/events/FieldConfig.d.ts +341 -336
  23. package/dist/commons/events/FieldType.d.ts +51 -51
  24. package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
  25. package/dist/commons/events/FieldValue.d.ts +12 -12
  26. package/dist/commons/events/Flag.d.ts +15 -15
  27. package/dist/commons/events/TemplateConfig.d.ts +1 -1
  28. package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
  29. package/dist/commons/events/WorkqueueConfig.d.ts +826 -826
  30. package/dist/commons/events/deduplication.d.ts +1 -1
  31. package/dist/commons/events/event.d.ts +2 -2
  32. package/dist/commons/events/field.d.ts +69 -198
  33. package/dist/commons/events/index.d.ts +1 -0
  34. package/dist/commons/events/locationPayloads.d.ts +95 -0
  35. package/dist/commons/events/locations.d.ts +103 -6
  36. package/dist/commons/events/mocks.test.utils.d.ts +18 -4
  37. package/dist/commons/events/scopes.d.ts +4 -4
  38. package/dist/commons/events/state/index.d.ts +17 -17
  39. package/dist/commons/events/state/utils.d.ts +7 -7
  40. package/dist/commons/events/test.utils.d.ts +40 -43
  41. package/dist/commons/events/utils.d.ts +114 -114
  42. package/dist/commons/notification/UserNotifications.d.ts +10 -10
  43. package/dist/conditionals/index.js +1 -0
  44. package/dist/environment/derived-variables.d.ts +119 -131
  45. package/dist/environment/derived-variables.d.ts.map +1 -1
  46. package/dist/environment/derived-variables.js +0 -14
  47. package/dist/environment/index.d.ts +1 -0
  48. package/dist/environment/index.d.ts.map +1 -1
  49. package/dist/environment/index.js +10 -0
  50. package/dist/environment/logger.d.ts +3 -12
  51. package/dist/environment/logger.d.ts.map +1 -1
  52. package/dist/environment/manage-users.js +17 -7
  53. package/dist/environment/paths.d.ts +7 -0
  54. package/dist/environment/paths.d.ts.map +1 -0
  55. package/dist/environment/paths.js +72 -0
  56. package/dist/environment/questions.d.ts +75 -74
  57. package/dist/environment/questions.d.ts.map +1 -1
  58. package/dist/environment/setup-environment.js +10 -29
  59. package/dist/environment/swarm-to-k8s.js +17 -7
  60. package/dist/environment/templates.d.ts.map +1 -1
  61. package/dist/environment/templates.js +2 -1
  62. package/dist/environment/update-workflows.d.ts.map +1 -1
  63. package/dist/environment/update-workflows.js +34 -12
  64. package/dist/environment/upgrade.d.ts +2 -0
  65. package/dist/environment/upgrade.d.ts.map +1 -0
  66. package/dist/environment/upgrade.js +82 -0
  67. package/dist/environment/users.js +28 -20
  68. package/dist/environment/utils.d.ts +1 -1
  69. package/dist/environment/utils.js +17 -7
  70. package/dist/events/deduplication.d.ts +1 -1
  71. package/dist/events/index.js +150 -58
  72. package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
  73. package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
  74. package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
  75. package/dist/notification/index.js +147 -82
  76. package/dist/scopes/index.d.ts +148 -146
  77. package/dist/scopes/index.js +1 -0
  78. package/dist/templates/charts-values/dependencies/values.yaml +0 -3
  79. package/dist/templates/charts-values/opencrvs-services/values.yaml +0 -4
  80. package/opencrvs-toolkit-2.1.0-rc.00fa07b.tgz +0 -0
  81. package/package.json +5 -5
  82. package/tsconfig.tsbuildinfo +1 -1
  83. package/opencrvs-toolkit-2.1.0-rc.0066f38.tgz +0 -0
@@ -25,13 +25,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
25
25
  }) : function(o, v) {
26
26
  o["default"] = v;
27
27
  });
28
- var __importStar = (this && this.__importStar) || function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
35
45
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
46
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
47
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -52,6 +62,7 @@ const path = __importStar(require("path"));
52
62
  const kleur_1 = __importDefault(require("kleur"));
53
63
  const manage_users_1 = require("./manage-users");
54
64
  const logger_1 = require("./logger");
65
+ const paths_1 = require("./paths");
55
66
  function select(options) {
56
67
  return __awaiter(this, void 0, void 0, function* () {
57
68
  const inquirer = yield import('@inquirer/prompts');
@@ -66,32 +77,29 @@ function select(options) {
66
77
  * * @returns {string} Inventory file
67
78
  */
68
79
  function selectInventoryFile() {
69
- return __awaiter(this, arguments, void 0, function* (dirPath = './infrastructure/server-setup/inventory/') {
80
+ return __awaiter(this, arguments, void 0, function* (dirPath = './environments') {
70
81
  // Check if directory exists
71
82
  if (!fs.existsSync(dirPath)) {
72
83
  (0, logger_1.warn)(`⚠️ No environment configuration directory found at ${dirPath}`);
73
84
  (0, logger_1.warn)('Hint: If this is a new infrastructure repository, run `opencrvs environment init` first.');
74
85
  return null;
75
86
  }
76
- // Read and filter files
77
- const files = fs
87
+ const environments = fs
78
88
  .readdirSync(dirPath)
79
- .filter((file) => {
80
- const filePath = path.join(dirPath, file);
81
- const isFile = fs.statSync(filePath).isFile();
82
- const ext = path.extname(file).slice(1).toLowerCase();
83
- return isFile && (ext === 'yml' || ext === 'yaml');
89
+ .filter((entry) => {
90
+ const filePath = path.join(dirPath, entry);
91
+ return (fs.statSync(filePath).isDirectory() &&
92
+ fs.existsSync((0, paths_1.getEnvironmentInventoryPath)(entry)));
84
93
  })
85
94
  .sort();
86
- if (files.length === 0) {
95
+ if (environments.length === 0) {
87
96
  (0, logger_1.warn)(`⚠️ No environment configuration files found at ${dirPath}`);
88
97
  (0, logger_1.warn)('Hint: If this is a new infrastructure repository, run `opencrvs environment init` first.');
89
98
  return null;
90
99
  }
91
- // Create choices - remove extension from display
92
- const choices = files.map((file) => ({
93
- name: path.basename(file, path.extname(file)),
94
- value: path.join(dirPath, file)
100
+ const choices = environments.map((environment) => ({
101
+ name: environment,
102
+ value: (0, paths_1.getEnvironmentInventoryPath)(environment)
95
103
  }));
96
104
  const selectedFile = yield select({
97
105
  message: 'Select environment (inventory file) to load users:',
@@ -1,7 +1,7 @@
1
1
  import { Secret, Variable } from './github';
2
2
  import { Answers } from './custom-types';
3
3
  export declare function generateLongPassword(): string;
4
- export declare function findExistingValue<T extends string>(name: string, type: T, scope: 'ENVIRONMENT' | 'REPOSITORY', existingValues: Array<Secret | Variable>): (T extends "SECRET" ? Secret : T extends "VARIABLE" ? Variable : never) | undefined;
4
+ export declare function findExistingValue<T extends string>(name: string, type: T, scope: 'ENVIRONMENT' | 'REPOSITORY', existingValues: Array<Secret | Variable>): (T extends 'SECRET' ? Secret : T extends 'VARIABLE' ? Variable : never) | undefined;
5
5
  /**
6
6
  * Merges and stores secrets in `.env.{environment}` file.
7
7
  * Updates existing variables, preserves unchanged ones, adds new ones.
@@ -25,13 +25,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
25
25
  }) : function(o, v) {
26
26
  o["default"] = v;
27
27
  });
28
- var __importStar = (this && this.__importStar) || function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
35
45
  var __importDefault = (this && this.__importDefault) || function (mod) {
36
46
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
47
  };
@@ -59,8 +59,8 @@ export declare function field(fieldId: string): {
59
59
  fieldId: string;
60
60
  type: "dateRange";
61
61
  options: {
62
- days: number;
63
62
  pivot?: number | undefined;
63
+ days: number;
64
64
  boost?: number | undefined;
65
65
  matchAgainst?: string | undefined;
66
66
  };