@opencrvs/toolkit 2.1.0-rc.00fa07b → 2.1.0-rc.023dec8
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.
- package/README.md +0 -1
- package/dist/application-config/index.js +0 -1
- package/dist/cli.js +58 -174
- package/dist/commons/api/router.d.ts +1514 -1618
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +2102 -259
- package/dist/commons/events/ActionConfig.d.ts +105 -105
- package/dist/commons/events/ActionDocument.d.ts +113 -113
- package/dist/commons/events/ActionType.d.ts +62 -62
- package/dist/commons/events/AdvancedSearchConfig.d.ts +507 -513
- package/dist/commons/events/AuditLog.d.ts +42 -79
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +590 -590
- package/dist/commons/events/Draft.d.ts +37 -37
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +5 -5
- package/dist/commons/events/EventDocument.d.ts +46 -46
- package/dist/commons/events/EventIndex.d.ts +62 -62
- package/dist/commons/events/EventMetadata.d.ts +40 -40
- package/dist/commons/events/FieldConfig.d.ts +337 -342
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/Flag.d.ts +15 -15
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +820 -820
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +895 -78
- package/dist/commons/events/index.d.ts +0 -1
- package/dist/commons/events/locations.d.ts +6 -103
- package/dist/commons/events/mocks.test.utils.d.ts +4 -18
- package/dist/commons/events/scopes.d.ts +4 -4
- package/dist/commons/events/state/index.d.ts +17 -17
- package/dist/commons/events/state/utils.d.ts +7 -7
- package/dist/commons/events/test.utils.d.ts +40 -40
- package/dist/commons/events/utils.d.ts +114 -114
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/conditionals/index.js +0 -1
- package/dist/environment/derived-variables.d.ts +119 -119
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/index.d.ts +0 -1
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +0 -10
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/questions.d.ts +74 -75
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +15 -10
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +1 -2
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +5 -17
- package/dist/environment/users.js +13 -11
- package/dist/environment/utils.d.ts +1 -1
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +52 -147
- package/dist/migrations/v2.0/migrate-application-config-url.js +3 -4
- package/dist/notification/index.js +77 -144
- package/dist/scopes/index.d.ts +146 -148
- package/dist/scopes/index.js +0 -1
- package/opencrvs-toolkit-2.1.0-rc.023dec8.tgz +0 -0
- package/package.json +5 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/commons/events/locationPayloads.d.ts +0 -95
- package/dist/environment/paths.d.ts +0 -7
- package/dist/environment/paths.d.ts.map +0 -1
- package/dist/environment/paths.js +0 -72
- package/dist/environment/upgrade.d.ts +0 -2
- package/dist/environment/upgrade.d.ts.map +0 -1
- package/dist/environment/upgrade.js +0 -82
- package/opencrvs-toolkit-2.1.0-rc.00fa07b.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/environment/templates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/environment/templates.ts"],"names":[],"mappings":"AAsBA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAKvC;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAYpD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CAWpD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CASnD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,EAAE,CAStD;AAGD;;;;GAIG;AACH;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QA0CzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QA4BzE"}
|
|
@@ -34,7 +34,6 @@ exports.generateInventory = generateInventory;
|
|
|
34
34
|
const fs_1 = __importDefault(require("fs"));
|
|
35
35
|
const path_1 = __importDefault(require("path"));
|
|
36
36
|
const logger_1 = require("./logger");
|
|
37
|
-
const paths_1 = require("./paths");
|
|
38
37
|
const handlebars_1 = __importDefault(require("handlebars"));
|
|
39
38
|
// Register a helper to increment numbers
|
|
40
39
|
handlebars_1.default.registerHelper('data_label_idx', function (value) {
|
|
@@ -150,7 +149,7 @@ function copyChartsValues(env, values) {
|
|
|
150
149
|
function generateInventory(env, values) {
|
|
151
150
|
// Template and output paths
|
|
152
151
|
const templatePath = path_1.default.join(__dirname, 'templates', 'inventory', 'inventory.template.yml');
|
|
153
|
-
const outputPath = path_1.default.
|
|
152
|
+
const outputPath = path_1.default.join(process.cwd(), 'infrastructure', 'server-setup', 'inventory', `${env}.yml`);
|
|
154
153
|
const templateFile = fs_1.default.readFileSync(templatePath, 'utf-8');
|
|
155
154
|
const template = handlebars_1.default.compile(templateFile);
|
|
156
155
|
values['single_node'] =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-workflows.d.ts","sourceRoot":"","sources":["../../src/environment/update-workflows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-workflows.d.ts","sourceRoot":"","sources":["../../src/environment/update-workflows.ts"],"names":[],"mappings":"AAgHA,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAgDhE"}
|
|
@@ -60,21 +60,12 @@ const path_1 = require("path");
|
|
|
60
60
|
const glob = __importStar(require("glob"));
|
|
61
61
|
const yaml = __importStar(require("js-yaml"));
|
|
62
62
|
const logger_1 = require("./logger");
|
|
63
|
-
const paths_1 = require("./paths");
|
|
64
|
-
function isDirectory(path) {
|
|
65
|
-
try {
|
|
66
|
-
return (0, fs_1.statSync)(path).isDirectory();
|
|
67
|
-
}
|
|
68
|
-
catch (_a) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
63
|
function extractInfrastructureNames() {
|
|
73
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const files = glob.sync(
|
|
75
|
-
const infraEnvironments = files.map((file) => (0, path_1.basename)(
|
|
65
|
+
const files = glob.sync('infrastructure/server-setup/inventory/*.yml');
|
|
66
|
+
const infraEnvironments = files.map((file) => (0, path_1.basename)(file, '.yml'));
|
|
76
67
|
if (infraEnvironments.length === 0) {
|
|
77
|
-
console.log(
|
|
68
|
+
console.log('⚠️ Warning: No environment directories found in infrastructure/server-setup/inventory/');
|
|
78
69
|
return [];
|
|
79
70
|
}
|
|
80
71
|
(0, logger_1.log)('🔍 Found infrastructure configurations:', infraEnvironments.join(', '));
|
|
@@ -86,11 +77,8 @@ function extractEnvironmentNames() {
|
|
|
86
77
|
const entries = yield (0, promises_1.readdir)('environments');
|
|
87
78
|
// Filter only directories
|
|
88
79
|
const environments = entries.filter((entry) => {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
return (isDirectory(environmentPath) &&
|
|
92
|
-
(0, fs_1.existsSync)(opencrvsServicesPath) &&
|
|
93
|
-
isDirectory(opencrvsServicesPath));
|
|
80
|
+
const fullPath = (0, path_1.join)('environments', entry);
|
|
81
|
+
return (0, fs_1.statSync)(fullPath).isDirectory();
|
|
94
82
|
});
|
|
95
83
|
if (environments.length === 0) {
|
|
96
84
|
console.log('⚠️ Warning: No environment directories found in environments/');
|
|
@@ -62,7 +62,6 @@ const path = __importStar(require("path"));
|
|
|
62
62
|
const kleur_1 = __importDefault(require("kleur"));
|
|
63
63
|
const manage_users_1 = require("./manage-users");
|
|
64
64
|
const logger_1 = require("./logger");
|
|
65
|
-
const paths_1 = require("./paths");
|
|
66
65
|
function select(options) {
|
|
67
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
67
|
const inquirer = yield import('@inquirer/prompts');
|
|
@@ -77,29 +76,32 @@ function select(options) {
|
|
|
77
76
|
* * @returns {string} Inventory file
|
|
78
77
|
*/
|
|
79
78
|
function selectInventoryFile() {
|
|
80
|
-
return __awaiter(this, arguments, void 0, function* (dirPath = './
|
|
79
|
+
return __awaiter(this, arguments, void 0, function* (dirPath = './infrastructure/server-setup/inventory/') {
|
|
81
80
|
// Check if directory exists
|
|
82
81
|
if (!fs.existsSync(dirPath)) {
|
|
83
82
|
(0, logger_1.warn)(`⚠️ No environment configuration directory found at ${dirPath}`);
|
|
84
83
|
(0, logger_1.warn)('Hint: If this is a new infrastructure repository, run `opencrvs environment init` first.');
|
|
85
84
|
return null;
|
|
86
85
|
}
|
|
87
|
-
|
|
86
|
+
// Read and filter files
|
|
87
|
+
const files = fs
|
|
88
88
|
.readdirSync(dirPath)
|
|
89
|
-
.filter((
|
|
90
|
-
const filePath = path.join(dirPath,
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
.filter((file) => {
|
|
90
|
+
const filePath = path.join(dirPath, file);
|
|
91
|
+
const isFile = fs.statSync(filePath).isFile();
|
|
92
|
+
const ext = path.extname(file).slice(1).toLowerCase();
|
|
93
|
+
return isFile && (ext === 'yml' || ext === 'yaml');
|
|
93
94
|
})
|
|
94
95
|
.sort();
|
|
95
|
-
if (
|
|
96
|
+
if (files.length === 0) {
|
|
96
97
|
(0, logger_1.warn)(`⚠️ No environment configuration files found at ${dirPath}`);
|
|
97
98
|
(0, logger_1.warn)('Hint: If this is a new infrastructure repository, run `opencrvs environment init` first.');
|
|
98
99
|
return null;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
// Create choices - remove extension from display
|
|
102
|
+
const choices = files.map((file) => ({
|
|
103
|
+
name: path.basename(file, path.extname(file)),
|
|
104
|
+
value: path.join(dirPath, file)
|
|
103
105
|
}));
|
|
104
106
|
const selectedFile = yield select({
|
|
105
107
|
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
|
|
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.
|
|
@@ -59,8 +59,8 @@ export declare function field(fieldId: string): {
|
|
|
59
59
|
fieldId: string;
|
|
60
60
|
type: "dateRange";
|
|
61
61
|
options: {
|
|
62
|
-
pivot?: number | undefined;
|
|
63
62
|
days: number;
|
|
63
|
+
pivot?: number | undefined;
|
|
64
64
|
boost?: number | undefined;
|
|
65
65
|
matchAgainst?: string | undefined;
|
|
66
66
|
};
|