@opencrvs/toolkit 2.1.0 → 2.2.0-rc.90ed9cd
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/build.sh +2 -2
- package/create-countryconfig/package.json +1 -1
- package/dist/application-config/index.js +36 -3
- package/dist/authentication/index.js +14 -1
- package/dist/cli.js +294 -1967
- package/dist/commons/api/router.d.ts +1374 -71
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/ActionConfig.d.ts +133 -0
- package/dist/commons/events/ActionDocument.d.ts +88 -0
- package/dist/commons/events/ActionInput.d.ts +52 -0
- package/dist/commons/events/ActionType.d.ts +11 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +12 -0
- package/dist/commons/events/AuditLog.d.ts +4 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +192 -0
- package/dist/commons/events/Draft.d.ts +2 -0
- package/dist/commons/events/EventConfig.d.ts +26 -6
- package/dist/commons/events/EventDocument.d.ts +88 -0
- package/dist/commons/events/EventIndex.d.ts +41 -0
- package/dist/commons/events/EventMetadata.d.ts +23 -0
- package/dist/commons/events/EventStatus.d.ts +1 -0
- package/dist/commons/events/FieldConfig.d.ts +10 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +216 -10
- package/dist/commons/events/eventConfigValidation.d.ts +17 -1
- package/dist/commons/events/scopes.d.ts +2 -0
- package/dist/commons/events/state/index.d.ts +10 -2
- package/dist/commons/events/state/utils.d.ts +11 -1
- package/dist/commons/events/test.utils.d.ts +28 -1
- package/dist/commons/events/utils.d.ts +43 -15
- package/dist/conditionals/index.js +14 -1
- package/dist/environment/derived-variables.d.ts +18 -0
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +22 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +29 -10
- package/dist/events/index.js +302 -68
- package/dist/migrations/add-translations.d.ts +15 -0
- package/dist/migrations/add-translations.d.ts.map +1 -0
- package/dist/migrations/{v2.1/add-translations.js → add-translations.js} +16 -14
- package/dist/migrations/v2.1/index.js +35 -2155
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +3 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +1 -1
- package/dist/migrations/v2.1/upgrade-tilt.d.ts +3 -0
- package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +1 -1
- package/dist/migrations/v2.2/index.d.ts +6 -0
- package/dist/migrations/v2.2/index.d.ts.map +1 -0
- package/dist/migrations/v2.2/index.js +456 -0
- package/dist/migrations/v2.2/read-declaration-through-helper.d.ts +39 -0
- package/dist/migrations/v2.2/read-declaration-through-helper.d.ts.map +1 -0
- package/dist/migrations/v2.2/read-declaration-through-helper.js +257 -0
- package/dist/notification/index.js +279 -88
- package/dist/scopes/index.d.ts +29 -6
- package/dist/scopes/index.js +14 -1
- package/dist/templates/charts-values/traefik/values.yaml +2 -3
- package/opencrvs-toolkit-2.2.0-rc.90ed9cd.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/migrations/v2.1/add-translations.d.ts +0 -9
- package/dist/migrations/v2.1/add-translations.d.ts.map +0 -1
- package/opencrvs-toolkit-2.1.0.tgz +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CsvFile } from '../csv';
|
|
2
|
+
/**
|
|
3
|
+
* The rows of the template that the local file has no id for, expressed in the
|
|
4
|
+
* local file's columns.
|
|
5
|
+
*/
|
|
6
|
+
export declare function rowsToAdd(local: CsvFile, template: CsvFile): string[];
|
|
7
|
+
/**
|
|
8
|
+
* @param targetVersion the major.minor the country config is upgraded to, e.g. `2.2`.
|
|
9
|
+
*/
|
|
10
|
+
declare function main(targetVersion: string): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* @knipignore
|
|
13
|
+
*/
|
|
14
|
+
export { main };
|
|
15
|
+
//# sourceMappingURL=add-translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-translations.d.ts","sourceRoot":"","sources":["../../src/migrations/add-translations.ts"],"names":[],"mappings":"AAkCA,OAAO,EACL,OAAO,EAMR,MAAM,QAAQ,CAAA;AAYf;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,CAgBrE;AAqED;;GAEG;AACH,iBAAe,IAAI,CAAC,aAAa,EAAE,MAAM,iBA2BxC;AAED;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -29,8 +29,9 @@ exports.main = main;
|
|
|
29
29
|
* config.
|
|
30
30
|
*
|
|
31
31
|
* Unlike every other codemod, this one carries no list of what it changes, and
|
|
32
|
-
* should not need editing again
|
|
33
|
-
*
|
|
32
|
+
* should not need editing again: every version's upgrade runs it, passing the
|
|
33
|
+
* version it upgrades to. Its input is `client.csv` and `login.csv` from
|
|
34
|
+
* the country config template of that version, fetched from
|
|
34
35
|
* GitHub; whatever rows those files have gained, this adds. A pull request that
|
|
35
36
|
* introduces a translation key therefore only has to add it to the template —
|
|
36
37
|
* `packages/countryconfig-template/src/translations/` — which the
|
|
@@ -45,11 +46,9 @@ exports.main = main;
|
|
|
45
46
|
* empty cell for one it has nothing for.
|
|
46
47
|
*/
|
|
47
48
|
const path_1 = __importDefault(require("path"));
|
|
48
|
-
const csv_1 = require("
|
|
49
|
-
const template_1 = require("
|
|
49
|
+
const csv_1 = require("../csv");
|
|
50
|
+
const template_1 = require("../translations/template");
|
|
50
51
|
const APPLICATIONS = ['client', 'login'];
|
|
51
|
-
/** The version this folder upgrades a country config to. */
|
|
52
|
-
const TARGET_VERSION = '2.1';
|
|
53
52
|
const skipped = [];
|
|
54
53
|
function warnSkipped(message) {
|
|
55
54
|
skipped.push(message);
|
|
@@ -73,7 +72,7 @@ function rowsToAdd(local, template) {
|
|
|
73
72
|
}));
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
|
-
function updateApplication(cwd, refs, application) {
|
|
75
|
+
function updateApplication(cwd, targetVersion, refs, application) {
|
|
77
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
77
|
const relativePath = `src/translations/${application}.csv`;
|
|
79
78
|
const local = (0, csv_1.readCsvFile)(path_1.default.join(cwd, relativePath));
|
|
@@ -83,7 +82,7 @@ function updateApplication(cwd, refs, application) {
|
|
|
83
82
|
}
|
|
84
83
|
const fetched = yield (0, template_1.fetchTemplate)(refs, application);
|
|
85
84
|
if (!fetched) {
|
|
86
|
-
warnSkipped(`No ${application}.csv found in the ${
|
|
85
|
+
warnSkipped(`No ${application}.csv found in the ${targetVersion} country config template on GitHub; ${application}.csv not updated`);
|
|
87
86
|
return;
|
|
88
87
|
}
|
|
89
88
|
const template = readTemplate(fetched.contents);
|
|
@@ -113,26 +112,29 @@ function readTemplate(contents) {
|
|
|
113
112
|
};
|
|
114
113
|
}
|
|
115
114
|
/** Refs to read the template from. Undefined when GitHub cannot be asked. */
|
|
116
|
-
function listRefs() {
|
|
115
|
+
function listRefs(targetVersion) {
|
|
117
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
117
|
try {
|
|
119
|
-
return yield (0, template_1.candidateRefs)(
|
|
118
|
+
return yield (0, template_1.candidateRefs)(targetVersion);
|
|
120
119
|
}
|
|
121
120
|
catch (error) {
|
|
122
|
-
warnSkipped(`Could not list the ${
|
|
121
|
+
warnSkipped(`Could not list the ${targetVersion} refs on GitHub (${error.message}); translations not added`);
|
|
123
122
|
return undefined;
|
|
124
123
|
}
|
|
125
124
|
});
|
|
126
125
|
}
|
|
127
|
-
|
|
126
|
+
/**
|
|
127
|
+
* @param targetVersion the major.minor the country config is upgraded to, e.g. `2.2`.
|
|
128
|
+
*/
|
|
129
|
+
function main(targetVersion) {
|
|
128
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
131
|
const cwd = process.cwd();
|
|
130
132
|
console.log('Adding the translation keys core gained this version...\n');
|
|
131
|
-
const refs = yield listRefs();
|
|
133
|
+
const refs = yield listRefs(targetVersion);
|
|
132
134
|
if (refs) {
|
|
133
135
|
for (const application of APPLICATIONS) {
|
|
134
136
|
try {
|
|
135
|
-
yield updateApplication(cwd, refs, application);
|
|
137
|
+
yield updateApplication(cwd, targetVersion, refs, application);
|
|
136
138
|
}
|
|
137
139
|
catch (error) {
|
|
138
140
|
warnSkipped(`Could not read ${application}.csv from the country config template on GitHub (${error.message}); ${application}.csv not updated`);
|