@opencrvs/toolkit 2.1.0-rc.30bcbde → 2.1.0-rc.312fbd1
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 +3 -12
- package/build.sh +12 -4
- package/create-countryconfig/index.js +441 -59
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +362 -284
- package/dist/authentication/index.d.ts +66 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +765 -0
- package/dist/cli.js +3347 -1229
- package/dist/commons/api/router.d.ts +3942 -3310
- package/dist/commons/application-config/index.d.ts +6 -8
- package/dist/commons/conditionals/conditionals.d.ts +259 -2102
- package/dist/commons/conditionals/validate.d.ts +34 -8
- package/dist/commons/events/ActionConfig.d.ts +105 -114
- package/dist/commons/events/ActionDocument.d.ts +145 -125
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +62 -62
- package/dist/commons/events/AdvancedSearchConfig.d.ts +549 -513
- package/dist/commons/events/AuditLog.d.ts +190 -42
- 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 +27 -47
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +8 -5
- package/dist/commons/events/EventDocument.d.ts +518 -50
- package/dist/commons/events/EventIndex.d.ts +49 -72
- package/dist/commons/events/EventMetadata.d.ts +39 -49
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +440 -394
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +89 -89
- package/dist/commons/events/FieldValue.d.ts +15 -14
- package/dist/commons/events/Flag.d.ts +57 -15
- package/dist/commons/events/FormConfig.d.ts +6 -0
- package/dist/commons/events/PageConfig.d.ts +4 -0
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- 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 +817 -814
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +14 -2
- package/dist/commons/events/field.d.ts +78 -895
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +247 -14
- package/dist/commons/events/mocks.test.utils.d.ts +48 -4
- package/dist/commons/events/scopes.d.ts +25 -5
- 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 +104 -46
- package/dist/commons/events/utils.d.ts +149 -114
- package/dist/commons/notification/UserNotifications.d.ts +38 -23
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +349 -65
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- 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 +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +12 -1
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions.d.ts +75 -74
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.d.ts +1 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +589 -570
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +5 -9
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +21 -5
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.js +11 -13
- package/dist/environment/utils.d.ts +1 -13
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +5910 -5301
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +3 -10
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +149 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +455 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1556 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +2 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.js +161 -0
- package/dist/migrations/v2.1/remove-sentry.d.ts +3 -0
- package/dist/migrations/v2.1/remove-sentry.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-sentry.js +354 -0
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts +3 -0
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +1 -0
- package/dist/migrations/v2.1/rename-trigger-paths.js +216 -0
- package/dist/notification/index.js +1904 -1492
- package/dist/scopes/index.d.ts +736 -158
- package/dist/scopes/index.js +351 -65
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +43 -0
- package/dist/templates/charts-values/dependencies/values.yaml +8 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +10 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +102 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/template.d.ts +11 -0
- package/dist/translations/template.d.ts.map +1 -0
- package/dist/translations/template.js +100 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +510 -0
- package/opencrvs-toolkit-2.1.0-rc.312fbd1.tgz +0 -0
- package/package.json +13 -7
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/templates/inventory/production.example.yml +0 -77
- package/dist/templates/inventory/qa.example.yml +0 -48
- package/opencrvs-toolkit-2.1.0-rc.30bcbde.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
package/dist/csv.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.parseCsvLine = parseCsvLine;
|
|
14
|
+
exports.toCsvLine = toCsvLine;
|
|
15
|
+
exports.idOf = idOf;
|
|
16
|
+
exports.readCsvFile = readCsvFile;
|
|
17
|
+
exports.writeCsvFile = writeCsvFile;
|
|
18
|
+
exports.addRows = addRows;
|
|
19
|
+
/**
|
|
20
|
+
* Just enough CSV for the translation files codemods edit. They are read and
|
|
21
|
+
* written a line at a time rather than through a parser, so that adding two
|
|
22
|
+
* rows to a file of sixteen hundred produces a diff of two lines instead of a
|
|
23
|
+
* re-quoted rewrite of the whole thing.
|
|
24
|
+
*
|
|
25
|
+
* Rows spanning multiple lines are not supported, and none of the translation
|
|
26
|
+
* files contain any.
|
|
27
|
+
*/
|
|
28
|
+
const fs_1 = require("fs");
|
|
29
|
+
function parseCsvLine(line) {
|
|
30
|
+
const values = [];
|
|
31
|
+
let value = '';
|
|
32
|
+
let quoted = false;
|
|
33
|
+
for (let index = 0; index < line.length; index++) {
|
|
34
|
+
const character = line[index];
|
|
35
|
+
if (quoted) {
|
|
36
|
+
if (character !== '"') {
|
|
37
|
+
value += character;
|
|
38
|
+
}
|
|
39
|
+
else if (line[index + 1] === '"') {
|
|
40
|
+
value += '"';
|
|
41
|
+
index++;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
quoted = false;
|
|
45
|
+
}
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (character === '"') {
|
|
49
|
+
quoted = true;
|
|
50
|
+
}
|
|
51
|
+
else if (character === ',') {
|
|
52
|
+
values.push(value);
|
|
53
|
+
value = '';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
value += character;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
values.push(value);
|
|
60
|
+
return values;
|
|
61
|
+
}
|
|
62
|
+
function toCsvLine(values) {
|
|
63
|
+
return values
|
|
64
|
+
.map((value) => /["\n,]/.test(value) ? `"${value.replace(/"/g, '""')}"` : value)
|
|
65
|
+
.join(',');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The id of a row, which is its first column. Translation ids never contain a
|
|
69
|
+
* comma or a quote, so this does not need the parser.
|
|
70
|
+
*/
|
|
71
|
+
function idOf(line) {
|
|
72
|
+
const comma = line.indexOf(',');
|
|
73
|
+
// No comma: `slice(0, -1)` would eat the last character.
|
|
74
|
+
return comma === -1 ? line : line.slice(0, comma);
|
|
75
|
+
}
|
|
76
|
+
function readCsvFile(path) {
|
|
77
|
+
if (!(0, fs_1.existsSync)(path)) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const contents = (0, fs_1.readFileSync)(path, 'utf8');
|
|
81
|
+
const newline = contents.includes('\r\n') ? '\r\n' : '\n';
|
|
82
|
+
const trailingNewline = /\r?\n$/.test(contents);
|
|
83
|
+
const lines = contents.replace(/\r?\n$/, '').split(/\r?\n/);
|
|
84
|
+
// Trailing blank line leaves an empty entry. It sorts before every id, so
|
|
85
|
+
// the file reads as unsorted.
|
|
86
|
+
const body = lines.slice(1).filter((line) => line !== '');
|
|
87
|
+
return { header: lines[0], body, newline, trailingNewline };
|
|
88
|
+
}
|
|
89
|
+
function writeCsvFile(path, file) {
|
|
90
|
+
(0, fs_1.writeFileSync)(path, [file.header, ...file.body].join(file.newline) +
|
|
91
|
+
(file.trailingNewline ? file.newline : ''));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Adds the rows the file does not already have an id for, in place. Rows go in
|
|
95
|
+
* sorted position when the file is sorted by id, and at the end when it is not,
|
|
96
|
+
* so a country config that keeps its own order keeps it.
|
|
97
|
+
*
|
|
98
|
+
* Returns the ids that were added.
|
|
99
|
+
*/
|
|
100
|
+
function addRows(file, rows) {
|
|
101
|
+
const isSorted = file.body.every((line, index) => index === 0 || idOf(file.body[index - 1]) <= idOf(line));
|
|
102
|
+
const added = [];
|
|
103
|
+
for (const row of rows) {
|
|
104
|
+
const id = idOf(row);
|
|
105
|
+
if (file.body.some((line) => idOf(line) === id)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const insertAt = isSorted
|
|
109
|
+
? file.body.findIndex((line) => idOf(line) > id)
|
|
110
|
+
: -1;
|
|
111
|
+
if (insertAt === -1) {
|
|
112
|
+
file.body.push(row);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
file.body.splice(insertAt, 0, row);
|
|
116
|
+
}
|
|
117
|
+
added.push(id);
|
|
118
|
+
}
|
|
119
|
+
return added;
|
|
120
|
+
}
|
|
@@ -1,122 +1,122 @@
|
|
|
1
1
|
export declare const derivedVariables: readonly [{
|
|
2
|
-
readonly name:
|
|
3
|
-
readonly valueLabel:
|
|
4
|
-
readonly valueType:
|
|
5
|
-
readonly type:
|
|
6
|
-
readonly scope:
|
|
7
|
-
}, {
|
|
8
|
-
readonly name:
|
|
9
|
-
readonly valueLabel:
|
|
10
|
-
readonly valueType:
|
|
11
|
-
readonly type:
|
|
12
|
-
readonly scope:
|
|
13
|
-
}, {
|
|
14
|
-
readonly name:
|
|
15
|
-
readonly valueLabel:
|
|
16
|
-
readonly valueType:
|
|
17
|
-
readonly type:
|
|
18
|
-
readonly scope:
|
|
19
|
-
}, {
|
|
20
|
-
readonly name:
|
|
21
|
-
readonly valueLabel:
|
|
22
|
-
readonly valueType:
|
|
23
|
-
readonly type:
|
|
24
|
-
readonly scope:
|
|
25
|
-
}, {
|
|
26
|
-
readonly name:
|
|
27
|
-
readonly valueLabel:
|
|
28
|
-
readonly valueType:
|
|
29
|
-
readonly type:
|
|
30
|
-
readonly scope:
|
|
31
|
-
}, {
|
|
32
|
-
readonly name:
|
|
33
|
-
readonly valueLabel:
|
|
34
|
-
readonly valueType:
|
|
35
|
-
readonly type:
|
|
36
|
-
readonly scope:
|
|
37
|
-
}, {
|
|
38
|
-
readonly name:
|
|
39
|
-
readonly valueLabel:
|
|
40
|
-
readonly valueType:
|
|
41
|
-
readonly type:
|
|
42
|
-
readonly scope:
|
|
43
|
-
}, {
|
|
44
|
-
readonly name:
|
|
45
|
-
readonly valueLabel:
|
|
46
|
-
readonly valueType:
|
|
47
|
-
readonly type:
|
|
48
|
-
readonly scope:
|
|
49
|
-
}, {
|
|
50
|
-
readonly name:
|
|
51
|
-
readonly valueLabel:
|
|
52
|
-
readonly valueType:
|
|
53
|
-
readonly type:
|
|
54
|
-
readonly scope:
|
|
55
|
-
}, {
|
|
56
|
-
readonly name:
|
|
57
|
-
readonly valueLabel:
|
|
58
|
-
readonly valueType:
|
|
59
|
-
readonly type:
|
|
60
|
-
readonly scope:
|
|
61
|
-
}, {
|
|
62
|
-
readonly name:
|
|
63
|
-
readonly valueLabel:
|
|
64
|
-
readonly valueType:
|
|
65
|
-
readonly type:
|
|
66
|
-
readonly scope:
|
|
67
|
-
}, {
|
|
68
|
-
readonly name:
|
|
69
|
-
readonly valueLabel:
|
|
70
|
-
readonly valueType:
|
|
71
|
-
readonly type:
|
|
72
|
-
readonly scope:
|
|
73
|
-
}, {
|
|
74
|
-
readonly name:
|
|
75
|
-
readonly valueLabel:
|
|
76
|
-
readonly valueType:
|
|
77
|
-
readonly type:
|
|
78
|
-
readonly scope:
|
|
79
|
-
}, {
|
|
80
|
-
readonly name:
|
|
81
|
-
readonly valueLabel:
|
|
82
|
-
readonly valueType:
|
|
83
|
-
readonly type:
|
|
84
|
-
readonly scope:
|
|
85
|
-
}, {
|
|
86
|
-
readonly name:
|
|
87
|
-
readonly valueLabel:
|
|
88
|
-
readonly valueType:
|
|
89
|
-
readonly type:
|
|
90
|
-
readonly scope:
|
|
91
|
-
}, {
|
|
92
|
-
readonly name:
|
|
93
|
-
readonly valueLabel:
|
|
94
|
-
readonly valueType:
|
|
95
|
-
readonly type:
|
|
96
|
-
readonly scope:
|
|
97
|
-
}, {
|
|
98
|
-
readonly name:
|
|
99
|
-
readonly valueLabel:
|
|
100
|
-
readonly valueType:
|
|
101
|
-
readonly type:
|
|
102
|
-
readonly scope:
|
|
103
|
-
}, {
|
|
104
|
-
readonly name:
|
|
105
|
-
readonly valueLabel:
|
|
106
|
-
readonly valueType:
|
|
107
|
-
readonly type:
|
|
108
|
-
readonly scope:
|
|
109
|
-
}, {
|
|
110
|
-
readonly name:
|
|
111
|
-
readonly valueLabel:
|
|
112
|
-
readonly valueType:
|
|
113
|
-
readonly type:
|
|
114
|
-
readonly scope:
|
|
115
|
-
}, {
|
|
116
|
-
readonly name:
|
|
117
|
-
readonly valueLabel:
|
|
118
|
-
readonly valueType:
|
|
119
|
-
readonly type:
|
|
120
|
-
readonly scope:
|
|
2
|
+
readonly name: 'ACTIVATE_USERS';
|
|
3
|
+
readonly valueLabel: 'ACTIVATE_USERS';
|
|
4
|
+
readonly valueType: 'VARIABLE';
|
|
5
|
+
readonly type: 'disabled';
|
|
6
|
+
readonly scope: 'ENVIRONMENT';
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: 'COUNTRY_CONFIG_HOST';
|
|
9
|
+
readonly valueLabel: 'COUNTRY_CONFIG_HOST';
|
|
10
|
+
readonly valueType: 'VARIABLE';
|
|
11
|
+
readonly type: 'disabled';
|
|
12
|
+
readonly scope: 'ENVIRONMENT';
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: 'GATEWAY_HOST';
|
|
15
|
+
readonly valueLabel: 'GATEWAY_HOST';
|
|
16
|
+
readonly valueType: 'VARIABLE';
|
|
17
|
+
readonly type: 'disabled';
|
|
18
|
+
readonly scope: 'ENVIRONMENT';
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: 'CONTENT_SECURITY_POLICY_WILDCARD';
|
|
21
|
+
readonly valueLabel: 'CONTENT_SECURITY_POLICY_WILDCARD';
|
|
22
|
+
readonly valueType: 'VARIABLE';
|
|
23
|
+
readonly type: 'disabled';
|
|
24
|
+
readonly scope: 'ENVIRONMENT';
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: 'CLIENT_APP_URL';
|
|
27
|
+
readonly valueLabel: 'CLIENT_APP_URL';
|
|
28
|
+
readonly valueType: 'VARIABLE';
|
|
29
|
+
readonly type: 'disabled';
|
|
30
|
+
readonly scope: 'ENVIRONMENT';
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: 'LOGIN_URL';
|
|
33
|
+
readonly valueLabel: 'LOGIN_URL';
|
|
34
|
+
readonly valueType: 'VARIABLE';
|
|
35
|
+
readonly type: 'disabled';
|
|
36
|
+
readonly scope: 'ENVIRONMENT';
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: 'ELASTICSEARCH_SUPERUSER_PASSWORD';
|
|
39
|
+
readonly valueLabel: 'ELASTICSEARCH_SUPERUSER_PASSWORD';
|
|
40
|
+
readonly valueType: 'SECRET';
|
|
41
|
+
readonly type: 'disabled';
|
|
42
|
+
readonly scope: 'ENVIRONMENT';
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: 'KIBANA_SYSTEM_PASSWORD';
|
|
45
|
+
readonly valueLabel: 'KIBANA_SYSTEM_PASSWORD';
|
|
46
|
+
readonly valueType: 'SECRET';
|
|
47
|
+
readonly type: 'disabled';
|
|
48
|
+
readonly scope: 'ENVIRONMENT';
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: 'MINIO_ROOT_USER';
|
|
51
|
+
readonly valueLabel: 'MINIO_ROOT_USER';
|
|
52
|
+
readonly valueType: 'SECRET';
|
|
53
|
+
readonly type: 'disabled';
|
|
54
|
+
readonly scope: 'ENVIRONMENT';
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: 'MINIO_ROOT_PASSWORD';
|
|
57
|
+
readonly valueLabel: 'MINIO_ROOT_PASSWORD';
|
|
58
|
+
readonly valueType: 'SECRET';
|
|
59
|
+
readonly type: 'disabled';
|
|
60
|
+
readonly scope: 'ENVIRONMENT';
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: 'POSTGRES_USER';
|
|
63
|
+
readonly valueLabel: 'POSTGRES_USER';
|
|
64
|
+
readonly valueType: 'SECRET';
|
|
65
|
+
readonly type: 'disabled';
|
|
66
|
+
readonly scope: 'ENVIRONMENT';
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: 'POSTGRES_PASSWORD';
|
|
69
|
+
readonly valueLabel: 'POSTGRES_PASSWORD';
|
|
70
|
+
readonly valueType: 'SECRET';
|
|
71
|
+
readonly type: 'disabled';
|
|
72
|
+
readonly scope: 'ENVIRONMENT';
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: 'SUPER_USER_PASSWORD';
|
|
75
|
+
readonly valueLabel: 'SUPER_USER_PASSWORD';
|
|
76
|
+
readonly valueType: 'SECRET';
|
|
77
|
+
readonly type: 'disabled';
|
|
78
|
+
readonly scope: 'ENVIRONMENT';
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: 'ENCRYPTION_KEY';
|
|
81
|
+
readonly valueLabel: 'ENCRYPTION_KEY';
|
|
82
|
+
readonly valueType: 'SECRET';
|
|
83
|
+
readonly type: 'disabled';
|
|
84
|
+
readonly scope: 'ENVIRONMENT';
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: 'GH_ENCRYPTION_PASSWORD';
|
|
87
|
+
readonly valueLabel: 'GH_ENCRYPTION_PASSWORD';
|
|
88
|
+
readonly valueType: 'SECRET';
|
|
89
|
+
readonly type: 'disabled';
|
|
90
|
+
readonly scope: 'REPOSITORY';
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: 'BACKUP_ENCRYPTION_PASSPHRASE';
|
|
93
|
+
readonly valueLabel: 'BACKUP_ENCRYPTION_PASSPHRASE';
|
|
94
|
+
readonly valueType: 'SECRET';
|
|
95
|
+
readonly type: 'disabled';
|
|
96
|
+
readonly scope: 'ENVIRONMENT';
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: 'BACKUP_HOST_PRIVATE_KEY';
|
|
99
|
+
readonly valueLabel: 'BACKUP_HOST_PRIVATE_KEY';
|
|
100
|
+
readonly valueType: 'SECRET';
|
|
101
|
+
readonly type: 'disabled';
|
|
102
|
+
readonly scope: 'ENVIRONMENT';
|
|
103
|
+
}, {
|
|
104
|
+
readonly name: 'BACKUP_HOST_PUBLIC_KEY';
|
|
105
|
+
readonly valueLabel: 'BACKUP_HOST_PUBLIC_KEY';
|
|
106
|
+
readonly valueType: 'SECRET';
|
|
107
|
+
readonly type: 'disabled';
|
|
108
|
+
readonly scope: 'ENVIRONMENT';
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: 'RESTORE_ENVIRONMENT_NAME';
|
|
111
|
+
readonly valueLabel: 'RESTORE_ENVIRONMENT_NAME';
|
|
112
|
+
readonly valueType: 'VARIABLE';
|
|
113
|
+
readonly type: 'disabled';
|
|
114
|
+
readonly scope: 'ENVIRONMENT';
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: 'NOTIFICATION_TRANSPORT';
|
|
117
|
+
readonly valueLabel: 'NOTIFICATION_TRANSPORT';
|
|
118
|
+
readonly valueType: 'VARIABLE';
|
|
119
|
+
readonly type: 'disabled';
|
|
120
|
+
readonly scope: 'ENVIRONMENT';
|
|
121
121
|
}];
|
|
122
122
|
//# sourceMappingURL=derived-variables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derived-variables.d.ts","sourceRoot":"","sources":["../../src/environment/derived-variables.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"derived-variables.d.ts","sourceRoot":"","sources":["../../src/environment/derived-variables.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;aAEzB,IAAI,EAAE,gBAAgB;aACtB,UAAU,EAAE,gBAAgB;aAC5B,SAAS,EAAE,UAAU;aACrB,IAAI,EAAE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AAE,aAAa;EAEd,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function runEnvironmentInit(): Promise<void>;
|
|
2
|
+
export declare function runEnvironmentUpgrade(): Promise<void>;
|
|
2
3
|
export declare function runEnvironmentUpdateWorkflows(): Promise<void>;
|
|
3
4
|
export declare function runEnvironmentUsers(): Promise<void>;
|
|
4
5
|
export declare function runEnvironmentSwarmToK8s(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAyCA,wBAAsB,kBAAkB,kBAKvC;AAED,wBAAsB,qBAAqB,kBAI1C;AAED,wBAAsB,6BAA6B,kBAIlD;AAED,wBAAsB,mBAAmB,kBAIxC;AAED,wBAAsB,wBAAwB,kBAG7C"}
|
|
@@ -20,11 +20,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.runEnvironmentInit = runEnvironmentInit;
|
|
23
|
+
exports.runEnvironmentUpgrade = runEnvironmentUpgrade;
|
|
23
24
|
exports.runEnvironmentUpdateWorkflows = runEnvironmentUpdateWorkflows;
|
|
24
25
|
exports.runEnvironmentUsers = runEnvironmentUsers;
|
|
25
26
|
exports.runEnvironmentSwarmToK8s = runEnvironmentSwarmToK8s;
|
|
26
27
|
const fs_1 = require("fs");
|
|
27
28
|
const path_1 = require("path");
|
|
29
|
+
const paths_1 = require("./paths");
|
|
28
30
|
const REQUIRED_REPOSITORY_DIRECTORIES = [
|
|
29
31
|
'.github/workflows',
|
|
30
32
|
'environments',
|
|
@@ -46,7 +48,16 @@ function validateRepositoryStructure(repositoryRoot = process.cwd()) {
|
|
|
46
48
|
function runEnvironmentInit() {
|
|
47
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
50
|
validateRepositoryStructure();
|
|
49
|
-
|
|
51
|
+
(0, paths_1.assertNoOldInventoryLayout)();
|
|
52
|
+
const { runSetupEnvironment } = yield import('./setup-environment.js');
|
|
53
|
+
yield runSetupEnvironment();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function runEnvironmentUpgrade() {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
validateRepositoryStructure();
|
|
59
|
+
const { upgradeEnvironmentLayout } = yield import('./upgrade.js');
|
|
60
|
+
yield upgradeEnvironmentLayout();
|
|
50
61
|
});
|
|
51
62
|
}
|
|
52
63
|
function runEnvironmentUpdateWorkflows() {
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
export declare const log:
|
|
2
|
-
|
|
1
|
+
export declare const log: {
|
|
2
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
3
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
4
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
5
|
+
};
|
|
6
|
+
export declare const warn: {
|
|
7
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
8
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
9
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
10
|
+
};
|
|
3
11
|
export declare const success: (...args: any[]) => void;
|
|
4
|
-
export declare const info:
|
|
12
|
+
export declare const info: {
|
|
13
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
14
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
15
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
16
|
+
};
|
|
5
17
|
export declare const error: (...args: any[]) => void;
|
|
6
18
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/environment/logger.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/environment/logger.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,GAAG;;;;CAAc,CAAA;AAC9B,eAAO,MAAM,IAAI;;;;CAAe,CAAA;AAChC,eAAO,MAAM,OAAO,YAAa,GAAG,EAAE,SACI,CAAA;AAC1C,eAAO,MAAM,IAAI;;;;CAAe,CAAA;AAChC,eAAO,MAAM,KAAK,YAAa,GAAG,EAAE,SAA2C,CAAA"}
|
|
@@ -95,7 +95,7 @@ function updateInventoryFile(filePath, users) {
|
|
|
95
95
|
function parseInventoryFile(filePath) {
|
|
96
96
|
try {
|
|
97
97
|
const data = (0, utils_1.readYamlFile)(filePath);
|
|
98
|
-
return (0, templates_1.
|
|
98
|
+
return (0, templates_1.extractAndModifyUsers)(data);
|
|
99
99
|
}
|
|
100
100
|
catch (_a) {
|
|
101
101
|
return [];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const OLD_INVENTORY_DIR: string;
|
|
2
|
+
export declare const INVENTORY_FILE_NAME = "inventory.yml";
|
|
3
|
+
export declare function getEnvironmentInventoryPath(environment: string): string;
|
|
4
|
+
export declare function findOldInventoryFiles(): string[];
|
|
5
|
+
export declare function getEnvironmentNameFromOldInventoryPath(filePath: string): string;
|
|
6
|
+
export declare function assertNoOldInventoryLayout(): void;
|
|
7
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/environment/paths.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,iBAAiB,QAI7B,CAAA;AAED,eAAO,MAAM,mBAAmB,kBAAkB,CAAA;AAElD,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,UAE9D;AAED,wBAAgB,qBAAqB,aAEpC;AAED,wBAAgB,sCAAsC,CAAC,QAAQ,EAAE,MAAM,UAEtE;AAED,wBAAgB,0BAA0B,SAWzC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
+
}) : function(o, v) {
|
|
26
|
+
o["default"] = v;
|
|
27
|
+
});
|
|
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
|
+
})();
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.INVENTORY_FILE_NAME = exports.OLD_INVENTORY_DIR = void 0;
|
|
47
|
+
exports.getEnvironmentInventoryPath = getEnvironmentInventoryPath;
|
|
48
|
+
exports.findOldInventoryFiles = findOldInventoryFiles;
|
|
49
|
+
exports.getEnvironmentNameFromOldInventoryPath = getEnvironmentNameFromOldInventoryPath;
|
|
50
|
+
exports.assertNoOldInventoryLayout = assertNoOldInventoryLayout;
|
|
51
|
+
const path_1 = require("path");
|
|
52
|
+
const glob = __importStar(require("glob"));
|
|
53
|
+
exports.OLD_INVENTORY_DIR = (0, path_1.join)('infrastructure', 'server-setup', 'inventory');
|
|
54
|
+
exports.INVENTORY_FILE_NAME = 'inventory.yml';
|
|
55
|
+
function getEnvironmentInventoryPath(environment) {
|
|
56
|
+
return (0, path_1.join)('environments', environment, exports.INVENTORY_FILE_NAME);
|
|
57
|
+
}
|
|
58
|
+
function findOldInventoryFiles() {
|
|
59
|
+
return glob.sync((0, path_1.join)(exports.OLD_INVENTORY_DIR, '*.yml')).sort();
|
|
60
|
+
}
|
|
61
|
+
function getEnvironmentNameFromOldInventoryPath(filePath) {
|
|
62
|
+
return (0, path_1.basename)(filePath, '.yml');
|
|
63
|
+
}
|
|
64
|
+
function assertNoOldInventoryLayout() {
|
|
65
|
+
if (findOldInventoryFiles().length === 0) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
throw new Error([
|
|
69
|
+
`Old inventory layout detected at ${exports.OLD_INVENTORY_DIR}.`,
|
|
70
|
+
'Please run `yarn environment:upgrade` before running `yarn environment:init`.'
|
|
71
|
+
].join(' '));
|
|
72
|
+
}
|