@opencrvs/toolkit 2.1.0 → 2.2.0-rc.3af310b
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 -12
- package/create-countryconfig/package.json +1 -1
- package/dist/application-config/index.js +36 -4
- package/dist/authentication/index.js +14 -2
- package/dist/cli.js +961 -2033
- 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 +146 -20
- 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 -18
- package/dist/commons/events/Draft.d.ts +2 -0
- package/dist/commons/events/EventConfig.d.ts +36 -6
- package/dist/commons/events/EventDocument.d.ts +88 -0
- package/dist/commons/events/EventIndex.d.ts +41 -4
- package/dist/commons/events/EventMetadata.d.ts +23 -1
- package/dist/commons/events/EventStatus.d.ts +1 -0
- package/dist/commons/events/FieldConfig.d.ts +10 -0
- package/dist/commons/events/Flag.d.ts +0 -6
- package/dist/commons/events/WorkqueueConfig.d.ts +224 -33
- package/dist/commons/events/eventConfigValidation.d.ts +26 -1
- package/dist/commons/events/notificationFormFallback.d.ts +10 -0
- package/dist/commons/events/scopes.d.ts +2 -0
- package/dist/commons/events/state/flags.d.ts +1 -1
- 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 +31 -1
- package/dist/commons/events/utils.d.ts +53 -20
- package/dist/conditionals/index.js +14 -2
- package/dist/environment/derived-variables.d.ts +24 -0
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +28 -0
- package/dist/environment/dockerhub.d.ts +15 -0
- package/dist/environment/dockerhub.d.ts.map +1 -0
- package/dist/environment/dockerhub.js +104 -0
- package/dist/environment/questions.js +1 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +70 -12
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/events/index.js +461 -83
- package/dist/migrations/index.d.ts +9 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +847 -0
- package/dist/migrations/move-declaration-to-declare-action.d.ts +38 -0
- package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -0
- package/dist/migrations/move-declaration-to-declare-action.js +377 -0
- package/dist/migrations/{v2.1 → persistent}/add-translations.d.ts +7 -1
- package/dist/migrations/persistent/add-translations.d.ts.map +1 -0
- package/dist/migrations/{v2.1 → persistent}/add-translations.js +14 -12
- package/dist/migrations/persistent/check-upgrade-path.d.ts +36 -0
- package/dist/migrations/persistent/check-upgrade-path.d.ts.map +1 -0
- package/dist/migrations/persistent/check-upgrade-path.js +105 -0
- package/dist/migrations/persistent/update-toolkit-dependency.d.ts +7 -0
- package/dist/migrations/persistent/update-toolkit-dependency.d.ts.map +1 -0
- package/dist/migrations/persistent/update-toolkit-dependency.js +77 -0
- package/dist/migrations/read-declaration-through-helper.d.ts +39 -0
- package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -0
- package/dist/migrations/read-declaration-through-helper.js +257 -0
- package/dist/migrations/replace-incomplete-flag.d.ts +26 -0
- package/dist/migrations/replace-incomplete-flag.d.ts.map +1 -0
- package/dist/migrations/replace-incomplete-flag.js +126 -0
- package/dist/notification/index.js +401 -100
- package/dist/scopes/index.d.ts +29 -39
- package/dist/scopes/index.js +14 -2
- package/dist/templates/charts-values/dependencies/values.yaml +1 -1
- package/dist/templates/charts-values/opencrvs-services/values.yaml +1 -2
- package/dist/templates/charts-values/traefik/values.yaml +4 -3
- package/opencrvs-toolkit-2.2.0-rc.3af310b.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +0 -3
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +0 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +0 -234
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +0 -3
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +0 -1
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +0 -511
- package/dist/migrations/v2.1/add-translations.d.ts.map +0 -1
- package/dist/migrations/v2.1/enable-telemetry.d.ts +0 -3
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +0 -1
- package/dist/migrations/v2.1/enable-telemetry.js +0 -455
- package/dist/migrations/v2.1/index.d.ts +0 -6
- package/dist/migrations/v2.1/index.d.ts.map +0 -1
- package/dist/migrations/v2.1/index.js +0 -2170
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +0 -14
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +0 -1
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +0 -348
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +0 -2
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +0 -1
- package/dist/migrations/v2.1/remove-metabase-package-installs.js +0 -161
- package/dist/migrations/v2.1/remove-sentry.d.ts +0 -3
- package/dist/migrations/v2.1/remove-sentry.d.ts.map +0 -1
- package/dist/migrations/v2.1/remove-sentry.js +0 -354
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts +0 -3
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +0 -1
- package/dist/migrations/v2.1/rename-trigger-paths.js +0 -216
- package/dist/migrations/v2.1/template-files.d.ts +0 -8
- package/dist/migrations/v2.1/template-files.d.ts.map +0 -1
- package/dist/migrations/v2.1/template-files.js +0 -49
- package/dist/migrations/v2.1/upgrade-tilt.d.ts +0 -8
- package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +0 -1
- package/dist/migrations/v2.1/upgrade-tilt.js +0 -139
- package/dist/templates/countryconfig-template/.tiltignore +0 -1
- package/dist/templates/countryconfig-template/Dockerfile.assets +0 -7
- package/dist/templates/countryconfig-template/Tiltfile +0 -112
- package/dist/templates/countryconfig-template/assets/README.md +0 -1
- package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +0 -61
- package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +0 -455
- package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +0 -168
- package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +0 -67
- package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +0 -168
- package/dist/templates/countryconfig-template/assets/metabase/README.md +0 -34
- package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +0 -36
- package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +0 -46
- package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +0 -27737
- package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +0 -21
- package/dist/templates/countryconfig-template/assets/metabase/package.json +0 -13
- package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +0 -108
- package/dist/templates/countryconfig-template/assets/metabase/run.sh +0 -120
- package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +0 -40
- package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +0 -135
- package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +0 -108
- package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +0 -50
- package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +0 -35
- package/dist/templates/countryconfig-template/tilt/common.tilt +0 -145
- package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +0 -15
- package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +0 -56
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +0 -21
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +0 -38
- package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +0 -17
- package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +0 -16
- package/dist/templates/countryconfig-template/tilt/lib.tilt +0 -95
- package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +0 -136
- package/opencrvs-toolkit-2.1.0.tgz +0 -0
|
@@ -1,234 +0,0 @@
|
|
|
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: Add explicit `APPROVE_CORRECTION` / `REJECT_CORRECTION` action
|
|
28
|
-
* configs when `REQUEST_CORRECTION` has `flags` and/or `conditionals`.
|
|
29
|
-
*
|
|
30
|
-
* Usage:
|
|
31
|
-
* ts-node -r tsconfig-paths/register src/migrations/v2.1/add-explicit-correction-flags.ts
|
|
32
|
-
*
|
|
33
|
-
* Why:
|
|
34
|
-
* `getActionConfig()` used to alias `APPROVE_CORRECTION` and
|
|
35
|
-
* `REJECT_CORRECTION` to whatever was configured on `REQUEST_CORRECTION`
|
|
36
|
-
* (label, flags, conditionals). As of v2.1, each resolves to its own
|
|
37
|
-
* independent config, so `flags`/`conditionals` configured only on
|
|
38
|
-
* `REQUEST_CORRECTION` would silently stop applying when an
|
|
39
|
-
* `APPROVE_CORRECTION`/`REJECT_CORRECTION` action is accepted. See
|
|
40
|
-
* CHANGELOG.md ("APPROVE_CORRECTION / REJECT_CORRECTION no longer inherit
|
|
41
|
-
* REQUEST_CORRECTION's config").
|
|
42
|
-
*
|
|
43
|
-
* What it does:
|
|
44
|
-
* - Scans all TypeScript files under `src/`
|
|
45
|
-
* - Finds every `defineConfig({ ... })` call expression
|
|
46
|
-
* - Inside the `actions` array, locates the `REQUEST_CORRECTION` action
|
|
47
|
-
* - If it has a non-empty `flags` and/or `conditionals` array, inserts
|
|
48
|
-
* sibling `APPROVE_CORRECTION` and `REJECT_CORRECTION` action objects
|
|
49
|
-
* (carrying over the same `flags`/`conditionals`) immediately after it,
|
|
50
|
-
* unless an action of that type already exists in the array
|
|
51
|
-
* - Saves the modified files in-place
|
|
52
|
-
*/
|
|
53
|
-
const ts_morph_1 = require("ts-morph");
|
|
54
|
-
const path_1 = __importDefault(require("path"));
|
|
55
|
-
const DEFINE_CONFIG_NAME = 'defineConfig';
|
|
56
|
-
const ACTIONS_PROPERTY_NAME = 'actions';
|
|
57
|
-
const TYPE_PROPERTY_NAME = 'type';
|
|
58
|
-
const FLAGS_PROPERTY_NAME = 'flags';
|
|
59
|
-
const CONDITIONALS_PROPERTY_NAME = 'conditionals';
|
|
60
|
-
const ACTION_TYPE_ENUM_NAME = 'ActionType';
|
|
61
|
-
const REQUEST_CORRECTION_TYPE = 'REQUEST_CORRECTION';
|
|
62
|
-
const CORRECTION_ACTIONS_TO_ADD = [
|
|
63
|
-
{
|
|
64
|
-
actionType: 'APPROVE_CORRECTION',
|
|
65
|
-
labelId: 'v2.events.correction.approve.label',
|
|
66
|
-
defaultMessage: 'Approve correction',
|
|
67
|
-
description: 'Label for the approve correction action'
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
actionType: 'REJECT_CORRECTION',
|
|
71
|
-
labelId: 'v2.events.correction.reject.label',
|
|
72
|
-
defaultMessage: 'Reject correction',
|
|
73
|
-
description: 'Label for the reject correction action'
|
|
74
|
-
}
|
|
75
|
-
];
|
|
76
|
-
/**
|
|
77
|
-
* Returns true if the object's `type` property matches the given type name.
|
|
78
|
-
* Handles both `ActionType.X` and the string literal `'X'` forms.
|
|
79
|
-
*/
|
|
80
|
-
function isActionOfType(obj, typeName) {
|
|
81
|
-
const typeProperty = obj.getProperty(TYPE_PROPERTY_NAME);
|
|
82
|
-
if (!typeProperty || !ts_morph_1.Node.isPropertyAssignment(typeProperty))
|
|
83
|
-
return false;
|
|
84
|
-
const typeInit = typeProperty.getInitializer();
|
|
85
|
-
if (!typeInit)
|
|
86
|
-
return false;
|
|
87
|
-
if (ts_morph_1.Node.isPropertyAccessExpression(typeInit)) {
|
|
88
|
-
return (typeInit.getExpression().getText() === ACTION_TYPE_ENUM_NAME &&
|
|
89
|
-
typeInit.getName() === typeName);
|
|
90
|
-
}
|
|
91
|
-
if (ts_morph_1.Node.isStringLiteral(typeInit)) {
|
|
92
|
-
return typeInit.getLiteralValue() === typeName;
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Returns whether `type` is written as `ActionType.X` (enum access) or as a
|
|
98
|
-
* bare string literal, so newly inserted actions can mirror the same style.
|
|
99
|
-
*/
|
|
100
|
-
function getTypeInitializerStyle(obj) {
|
|
101
|
-
const typeProperty = obj.getProperty(TYPE_PROPERTY_NAME);
|
|
102
|
-
if (typeProperty && ts_morph_1.Node.isPropertyAssignment(typeProperty)) {
|
|
103
|
-
const typeInit = typeProperty.getInitializer();
|
|
104
|
-
if (typeInit && ts_morph_1.Node.isPropertyAccessExpression(typeInit))
|
|
105
|
-
return 'enum';
|
|
106
|
-
}
|
|
107
|
-
return 'string';
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Returns the source text of `obj[propName]` if it's an array literal with
|
|
111
|
-
* at least one element, otherwise undefined.
|
|
112
|
-
*/
|
|
113
|
-
function getNonEmptyArrayPropertyText(obj, propName) {
|
|
114
|
-
const prop = obj.getProperty(propName);
|
|
115
|
-
if (!prop || !ts_morph_1.Node.isPropertyAssignment(prop))
|
|
116
|
-
return undefined;
|
|
117
|
-
const init = prop.getInitializer();
|
|
118
|
-
if (!init || !ts_morph_1.Node.isArrayLiteralExpression(init))
|
|
119
|
-
return undefined;
|
|
120
|
-
if (init.getElements().length === 0)
|
|
121
|
-
return undefined;
|
|
122
|
-
return init.getText();
|
|
123
|
-
}
|
|
124
|
-
function buildCorrectionActionText(spec, typeStyle, flagsText, conditionalsText) {
|
|
125
|
-
const typeText = typeStyle === 'enum'
|
|
126
|
-
? `${ACTION_TYPE_ENUM_NAME}.${spec.actionType}`
|
|
127
|
-
: `'${spec.actionType}'`;
|
|
128
|
-
const lines = [
|
|
129
|
-
`type: ${typeText}`,
|
|
130
|
-
`label: {
|
|
131
|
-
id: '${spec.labelId}',
|
|
132
|
-
defaultMessage: '${spec.defaultMessage}',
|
|
133
|
-
description: '${spec.description}'
|
|
134
|
-
}`
|
|
135
|
-
];
|
|
136
|
-
if (flagsText) {
|
|
137
|
-
lines.push(`${FLAGS_PROPERTY_NAME}: ${flagsText}`);
|
|
138
|
-
}
|
|
139
|
-
if (conditionalsText) {
|
|
140
|
-
lines.push(`${CONDITIONALS_PROPERTY_NAME}: ${conditionalsText}`);
|
|
141
|
-
}
|
|
142
|
-
return `{\n ${lines.join(',\n ')}\n}`;
|
|
143
|
-
}
|
|
144
|
-
function processFile(filePath, project) {
|
|
145
|
-
const sourceFile = project.getSourceFile(filePath);
|
|
146
|
-
if (!sourceFile)
|
|
147
|
-
return 0;
|
|
148
|
-
let changes = 0;
|
|
149
|
-
const relPath = path_1.default.relative(process.cwd(), filePath);
|
|
150
|
-
const callExpressions = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
151
|
-
for (const call of callExpressions) {
|
|
152
|
-
const expression = call.getExpression();
|
|
153
|
-
if (!ts_morph_1.Node.isIdentifier(expression) ||
|
|
154
|
-
expression.getText() !== DEFINE_CONFIG_NAME) {
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
const args = call.getArguments();
|
|
158
|
-
if (args.length === 0)
|
|
159
|
-
continue;
|
|
160
|
-
const configArg = args[0];
|
|
161
|
-
if (!ts_morph_1.Node.isObjectLiteralExpression(configArg))
|
|
162
|
-
continue;
|
|
163
|
-
const actionsProperty = configArg.getProperty(ACTIONS_PROPERTY_NAME);
|
|
164
|
-
if (!actionsProperty || !ts_morph_1.Node.isPropertyAssignment(actionsProperty))
|
|
165
|
-
continue;
|
|
166
|
-
const actionsInitializer = actionsProperty.getInitializer();
|
|
167
|
-
if (!actionsInitializer ||
|
|
168
|
-
!ts_morph_1.Node.isArrayLiteralExpression(actionsInitializer))
|
|
169
|
-
continue;
|
|
170
|
-
const elements = actionsInitializer.getElements();
|
|
171
|
-
const requestCorrectionIndex = elements.findIndex((el) => ts_morph_1.Node.isObjectLiteralExpression(el) &&
|
|
172
|
-
isActionOfType(el, REQUEST_CORRECTION_TYPE));
|
|
173
|
-
if (requestCorrectionIndex === -1)
|
|
174
|
-
continue;
|
|
175
|
-
const requestCorrection = elements[requestCorrectionIndex];
|
|
176
|
-
const flagsText = getNonEmptyArrayPropertyText(requestCorrection, FLAGS_PROPERTY_NAME);
|
|
177
|
-
const conditionalsText = getNonEmptyArrayPropertyText(requestCorrection, CONDITIONALS_PROPERTY_NAME);
|
|
178
|
-
// Nothing on REQUEST_CORRECTION that approve/reject would need to inherit.
|
|
179
|
-
if (!flagsText && !conditionalsText)
|
|
180
|
-
continue;
|
|
181
|
-
const typeStyle = getTypeInitializerStyle(requestCorrection);
|
|
182
|
-
let insertAt = requestCorrectionIndex + 1;
|
|
183
|
-
for (const spec of CORRECTION_ACTIONS_TO_ADD) {
|
|
184
|
-
const alreadyPresent = actionsInitializer
|
|
185
|
-
.getElements()
|
|
186
|
-
.some((el) => ts_morph_1.Node.isObjectLiteralExpression(el) &&
|
|
187
|
-
isActionOfType(el, spec.actionType));
|
|
188
|
-
if (alreadyPresent)
|
|
189
|
-
continue;
|
|
190
|
-
const text = buildCorrectionActionText(spec, typeStyle, flagsText, conditionalsText);
|
|
191
|
-
actionsInitializer.insertElement(insertAt, text);
|
|
192
|
-
insertAt++;
|
|
193
|
-
changes++;
|
|
194
|
-
console.log(` [${relPath}] Added ${spec.actionType} action carrying over REQUEST_CORRECTION's flags/conditionals`);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return changes;
|
|
198
|
-
}
|
|
199
|
-
function main() {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
const srcDir = path_1.default.join(process.cwd(), 'src');
|
|
202
|
-
console.log(`Scanning for defineConfig calls in: ${srcDir}\n`);
|
|
203
|
-
const project = new ts_morph_1.Project({
|
|
204
|
-
tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
|
|
205
|
-
skipAddingFilesFromTsConfig: false
|
|
206
|
-
});
|
|
207
|
-
const sourceFiles = project.getSourceFiles().filter((sf) => {
|
|
208
|
-
const fp = sf.getFilePath();
|
|
209
|
-
return fp.includes('/src/') && !fp.includes('/node_modules/');
|
|
210
|
-
});
|
|
211
|
-
console.log(`Found ${sourceFiles.length} source file(s) to analyse.\n`);
|
|
212
|
-
let totalChanges = 0;
|
|
213
|
-
const modifiedFiles = [];
|
|
214
|
-
for (const sourceFile of sourceFiles) {
|
|
215
|
-
const filePath = sourceFile.getFilePath();
|
|
216
|
-
const changes = processFile(filePath, project);
|
|
217
|
-
if (changes > 0) {
|
|
218
|
-
totalChanges += changes;
|
|
219
|
-
modifiedFiles.push(filePath);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (modifiedFiles.length === 0) {
|
|
223
|
-
console.log('No REQUEST_CORRECTION actions with flags/conditionals found. Nothing to do.');
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
console.log(`\nSaving ${modifiedFiles.length} modified file(s)...`);
|
|
227
|
-
for (const filePath of modifiedFiles) {
|
|
228
|
-
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
229
|
-
yield sourceFile.save();
|
|
230
|
-
console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
|
|
231
|
-
}
|
|
232
|
-
console.log(`\nDone. Added ${totalChanges} correction action config(s) across ${modifiedFiles.length} file(s).`);
|
|
233
|
-
});
|
|
234
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-recovery-link-notifications.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.1/add-recovery-link-notifications.ts"],"names":[],"mappings":"AAopBA,iBAAe,IAAI,kBA0ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|