@opencrvs/toolkit 1.9.13-rc.fc5374d → 2.0.0-rc.153df7b
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 +13 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/application-config/index.d.ts +2 -0
- package/dist/application-config/index.d.ts.map +1 -0
- package/dist/application-config/index.js +2128 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +4527 -0
- package/dist/commons/api/router.d.ts +3450 -2302
- package/dist/commons/application-config/index.d.ts +84 -0
- package/dist/commons/conditionals/conditionals.d.ts +27 -3
- package/dist/commons/conditionals/validate.d.ts +13 -3
- package/dist/commons/events/ActionConfig.d.ts +415 -1555
- package/dist/commons/events/ActionDocument.d.ts +888 -1941
- package/dist/commons/events/ActionInput.d.ts +277 -1073
- package/dist/commons/events/ActionType.d.ts +91 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +294 -1496
- package/dist/commons/events/AuditLog.d.ts +407 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
- package/dist/commons/events/Conditional.d.ts +26 -38
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1592 -4471
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
- package/dist/commons/events/Draft.d.ts +72 -107
- package/dist/commons/events/DynamicFieldValue.d.ts +12 -78
- package/dist/commons/events/EventConfig.d.ts +37 -2420
- package/dist/commons/events/EventConfigInput.d.ts +0 -3
- package/dist/commons/events/EventDocument.d.ts +354 -1366
- package/dist/commons/events/EventIndex.d.ts +212 -1010
- package/dist/commons/events/EventInput.d.ts +3 -8
- package/dist/commons/events/EventMetadata.d.ts +130 -357
- package/dist/commons/events/FieldConfig.d.ts +2892 -12892
- package/dist/commons/events/FieldType.d.ts +26 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +314 -906
- package/dist/commons/events/FieldValue.d.ts +149 -527
- package/dist/commons/events/FileUtils.d.ts +2 -2
- package/dist/commons/events/Flag.d.ts +67 -0
- package/dist/commons/events/FormConfig.d.ts +54 -721
- package/dist/commons/events/PageConfig.d.ts +58 -320
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +2 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +2208 -7553
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +2 -247
- package/dist/commons/events/eventConfigValidation.d.ts +8 -0
- package/dist/commons/events/index.d.ts +3 -0
- package/dist/commons/events/locations.d.ts +57 -20
- package/dist/commons/events/scopes.d.ts +36 -35
- package/dist/commons/events/state/availableActions.d.ts +7 -2
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +30 -27
- package/dist/commons/events/state/utils.d.ts +190 -172
- package/dist/commons/events/test.utils.d.ts +52 -11
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +373 -273
- package/dist/commons/notification/UserNotifications.d.ts +76 -637
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +302 -14
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2861 -2115
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +404 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +22 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -0
- package/dist/migrations/v2.0/checkout-upstream-files.js +147 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +828 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +158 -0
- package/dist/migrations/v2.0/create-events-index.d.ts +3 -0
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -0
- package/dist/migrations/v2.0/create-events-index.js +325 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +3 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +77 -0
- package/dist/migrations/v2.0/index.d.ts +11 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -0
- package/dist/migrations/v2.0/index.js +4437 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +343 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +3 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -0
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +221 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-application-config-url.js +342 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-scopes.js +281 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +267 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +236 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-delete-actions.js +156 -0
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-demo-scope.js +74 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.js +96 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +3 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +163 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.js +77 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +3 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-old-statistics-service.js +356 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +109 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.js +163 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +3 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +186 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-api-paths.js +187 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-location-parent-id.js +180 -0
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +3 -0
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -0
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +195 -0
- package/dist/migrations/v2.0/update-package-json.d.ts +3 -0
- package/dist/migrations/v2.0/update-package-json.d.ts.map +1 -0
- package/dist/migrations/v2.0/update-package-json.js +105 -0
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +2082 -1767
- package/dist/scopes/index.d.ts +640 -353
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +340 -300
- package/opencrvs-toolkit-2.0.0-rc.153df7b.tgz +0 -0
- package/package.json +18 -8
- package/tsconfig.json +12 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
|
@@ -0,0 +1,186 @@
|
|
|
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: Remove environment variables that are no longer consumed by
|
|
28
|
+
* country config code in v2.0.
|
|
29
|
+
*
|
|
30
|
+
* Targets:
|
|
31
|
+
* - APPLICATION_CONFIG_URL
|
|
32
|
+
* - FHIR_URL
|
|
33
|
+
* - CONFIRM_REGISTRATION_URL
|
|
34
|
+
*
|
|
35
|
+
* What it does:
|
|
36
|
+
* 1. In `src/environment.ts`, removes the matching properties from the
|
|
37
|
+
* `cleanEnv(process.env, { ... })` schema object.
|
|
38
|
+
* 2. In `src/constants.ts`, removes the matching top-level `const`
|
|
39
|
+
* declarations — by name OR by `env.<NAME>` reference (so that
|
|
40
|
+
* country forks that renamed the constant but still read the same env
|
|
41
|
+
* var are also cleaned up).
|
|
42
|
+
*
|
|
43
|
+
* Caveats:
|
|
44
|
+
* - Removing these constants may produce TypeScript errors at usage
|
|
45
|
+
* sites elsewhere in `src/` (e.g. files that imported `FHIR_URL` from
|
|
46
|
+
* `@countryconfig/constants`). Those usages are intentionally left
|
|
47
|
+
* for the developer to resolve, since the right replacement is
|
|
48
|
+
* country-specific.
|
|
49
|
+
* - The codemod is a no-op when the target files or properties don't
|
|
50
|
+
* exist (e.g. the country config has already removed them).
|
|
51
|
+
*/
|
|
52
|
+
const path_1 = __importDefault(require("path"));
|
|
53
|
+
const ts_morph_1 = require("ts-morph");
|
|
54
|
+
const UNUSED_ENV_VARS = new Set([
|
|
55
|
+
'APPLICATION_CONFIG_URL',
|
|
56
|
+
'FHIR_URL',
|
|
57
|
+
'CONFIRM_REGISTRATION_URL'
|
|
58
|
+
]);
|
|
59
|
+
const ENVIRONMENT_FILE_RELATIVE = 'src/environment.ts';
|
|
60
|
+
const CONSTANTS_FILE_RELATIVE = 'src/constants.ts';
|
|
61
|
+
/**
|
|
62
|
+
* Strip matching properties from the `cleanEnv(process.env, { ... })` call
|
|
63
|
+
* in `src/environment.ts`. Returns the names that were removed.
|
|
64
|
+
*/
|
|
65
|
+
function cleanEnvironmentFile(project, filePath) {
|
|
66
|
+
var _a;
|
|
67
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
68
|
+
if (!sourceFile)
|
|
69
|
+
return [];
|
|
70
|
+
const removed = [];
|
|
71
|
+
// IMPORTANT: never iterate all call expressions while mutating this object.
|
|
72
|
+
// Removing a property deletes nested `url(...)` nodes, and touching those
|
|
73
|
+
// forgotten nodes later causes `InvalidOperationError`.
|
|
74
|
+
const cleanEnvCall = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.CallExpression).find((call) => {
|
|
75
|
+
const expr = call.getExpression();
|
|
76
|
+
return ts_morph_1.Node.isIdentifier(expr) && expr.getText() === 'cleanEnv';
|
|
77
|
+
});
|
|
78
|
+
if (!cleanEnvCall)
|
|
79
|
+
return removed;
|
|
80
|
+
const schemaArg = (_a = cleanEnvCall
|
|
81
|
+
.getArguments()[1]) === null || _a === void 0 ? void 0 : _a.asKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
|
|
82
|
+
if (!schemaArg)
|
|
83
|
+
return removed;
|
|
84
|
+
// Remove by explicit property-name lookup to avoid iterating over a live
|
|
85
|
+
// node list while mutating the object literal.
|
|
86
|
+
for (const name of UNUSED_ENV_VARS) {
|
|
87
|
+
const prop = schemaArg.getProperty(name);
|
|
88
|
+
if (!prop)
|
|
89
|
+
continue;
|
|
90
|
+
if (prop.isKind(ts_morph_1.SyntaxKind.PropertyAssignment) ||
|
|
91
|
+
prop.isKind(ts_morph_1.SyntaxKind.ShorthandPropertyAssignment)) {
|
|
92
|
+
prop.remove();
|
|
93
|
+
removed.push(name);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return removed;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Match `env.<NAME>` in an initializer (allowing surrounding parens / `as`
|
|
100
|
+
* casts that ts-morph emits in `getText()` as e.g. `(env.X as string)`).
|
|
101
|
+
* Returns the env var name if matched, or null.
|
|
102
|
+
*/
|
|
103
|
+
function extractEnvAccess(initText) {
|
|
104
|
+
if (!initText)
|
|
105
|
+
return null;
|
|
106
|
+
const match = /\benv\.([A-Z][A-Z0-9_]*)\b/.exec(initText);
|
|
107
|
+
return match ? match[1] : null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Strip top-level `const` declarations in `src/constants.ts` whose name is
|
|
111
|
+
* in `UNUSED_ENV_VARS` OR whose initializer reads `env.<NAME>` for one of
|
|
112
|
+
* those names. Returns the declaration names that were removed.
|
|
113
|
+
*/
|
|
114
|
+
function cleanConstantsFile(project, filePath) {
|
|
115
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
116
|
+
if (!sourceFile)
|
|
117
|
+
return [];
|
|
118
|
+
const removed = [];
|
|
119
|
+
for (const stmt of [...sourceFile.getVariableStatements()]) {
|
|
120
|
+
const declarations = [...stmt.getDeclarations()];
|
|
121
|
+
const declarationsToRemove = declarations.filter((decl) => {
|
|
122
|
+
var _a;
|
|
123
|
+
const name = decl.getName();
|
|
124
|
+
const accessedEnvVar = extractEnvAccess((_a = decl.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText());
|
|
125
|
+
return (UNUSED_ENV_VARS.has(name) ||
|
|
126
|
+
(accessedEnvVar !== null && UNUSED_ENV_VARS.has(accessedEnvVar)));
|
|
127
|
+
});
|
|
128
|
+
if (declarationsToRemove.length === 0)
|
|
129
|
+
continue;
|
|
130
|
+
// Resolve all names before mutating the AST; once a declaration or its
|
|
131
|
+
// parent statement is removed, ts-morph marks old nodes as forgotten.
|
|
132
|
+
const namesToRemove = declarationsToRemove.map((decl) => decl.getName());
|
|
133
|
+
removed.push(...namesToRemove);
|
|
134
|
+
if (declarationsToRemove.length === declarations.length) {
|
|
135
|
+
// All declarations in this statement are unused → drop the whole line
|
|
136
|
+
// (handles the dominant pattern: `export const X = env.X`).
|
|
137
|
+
stmt.remove();
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Mixed statement (e.g. `const A = env.A, B = somethingElse`) — keep
|
|
141
|
+
// the survivors by removing matching declarators in place.
|
|
142
|
+
for (const decl of declarationsToRemove) {
|
|
143
|
+
decl.remove();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return removed;
|
|
148
|
+
}
|
|
149
|
+
function main() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const project = new ts_morph_1.Project({
|
|
152
|
+
tsConfigFilePath: path_1.default.resolve(process.cwd(), 'tsconfig.json'),
|
|
153
|
+
skipAddingFilesFromTsConfig: false
|
|
154
|
+
});
|
|
155
|
+
console.log(`Removing unused environment variable(s) (${[...UNUSED_ENV_VARS].join(', ')})...\n`);
|
|
156
|
+
const envFilePath = path_1.default.join(process.cwd(), ENVIRONMENT_FILE_RELATIVE);
|
|
157
|
+
const constsFilePath = path_1.default.join(process.cwd(), CONSTANTS_FILE_RELATIVE);
|
|
158
|
+
const envRemoved = cleanEnvironmentFile(project, envFilePath);
|
|
159
|
+
if (envRemoved.length > 0) {
|
|
160
|
+
yield project.getSourceFileOrThrow(envFilePath).save();
|
|
161
|
+
console.log(` [${ENVIRONMENT_FILE_RELATIVE}] Removed schema entr${envRemoved.length === 1 ? 'y' : 'ies'}: ${envRemoved.join(', ')}`);
|
|
162
|
+
}
|
|
163
|
+
else if (project.getSourceFile(envFilePath)) {
|
|
164
|
+
console.log(` [${ENVIRONMENT_FILE_RELATIVE}] No matching schema entries — nothing to remove.`);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.log(` [${ENVIRONMENT_FILE_RELATIVE}] File not found — skipping.`);
|
|
168
|
+
}
|
|
169
|
+
const constsRemoved = cleanConstantsFile(project, constsFilePath);
|
|
170
|
+
if (constsRemoved.length > 0) {
|
|
171
|
+
yield project.getSourceFileOrThrow(constsFilePath).save();
|
|
172
|
+
console.log(` [${CONSTANTS_FILE_RELATIVE}] Removed declaration(s): ${constsRemoved.join(', ')}`);
|
|
173
|
+
}
|
|
174
|
+
else if (project.getSourceFile(constsFilePath)) {
|
|
175
|
+
console.log(` [${CONSTANTS_FILE_RELATIVE}] No matching declarations — nothing to remove.`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
console.log(` [${CONSTANTS_FILE_RELATIVE}] File not found — skipping.`);
|
|
179
|
+
}
|
|
180
|
+
if (envRemoved.length === 0 && constsRemoved.length === 0) {
|
|
181
|
+
console.log('\nNothing to do.');
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
console.log(`\nDone. NOTE: usages of these constants elsewhere in 'src/' may now produce TypeScript errors and need manual review.`);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-api-paths.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/rename-api-paths.ts"],"names":[],"mappings":"AAuJA,iBAAe,IAAI,kBAgDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,187 @@
|
|
|
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: Rename Hapi route `path` values inside route configuration objects.
|
|
28
|
+
*
|
|
29
|
+
* Usage:
|
|
30
|
+
* ts-node -r tsconfig-paths/register src/migrations/v2.0/rename-api-paths.ts
|
|
31
|
+
*
|
|
32
|
+
* What it does:
|
|
33
|
+
* - Scans all TypeScript files under `src/`
|
|
34
|
+
* - Finds every object literal that looks like a Hapi route config, i.e. one that
|
|
35
|
+
* has both a `method` property whose value is a recognised HTTP verb (or an array
|
|
36
|
+
* of them) and a `path` property whose value is a string literal
|
|
37
|
+
* - Applies every rename listed in PATH_RENAMES to the `path` value
|
|
38
|
+
* - Saves the modified files in-place
|
|
39
|
+
*
|
|
40
|
+
* Adding new renames:
|
|
41
|
+
* Add an entry to the PATH_RENAMES map below. Keys are the old path strings,
|
|
42
|
+
* values are the new path strings. Exact string matching is used — no wildcards.
|
|
43
|
+
*/
|
|
44
|
+
const ts_morph_1 = require("ts-morph");
|
|
45
|
+
const path_1 = __importDefault(require("path"));
|
|
46
|
+
// ─── Path rename table ────────────────────────────────────────────────────────
|
|
47
|
+
// Add new renames here as further API paths are changed between versions.
|
|
48
|
+
const PATH_RENAMES = {
|
|
49
|
+
'/events': '/config/events',
|
|
50
|
+
'/application-config': '/config/application',
|
|
51
|
+
'/workqueue': '/config/workqueues',
|
|
52
|
+
'/locations': '/config/locations',
|
|
53
|
+
'/users': '/config/users',
|
|
54
|
+
'/roles': '/config/roles'
|
|
55
|
+
};
|
|
56
|
+
// ─── Constants ────────────────────────────────────────────────────────────────
|
|
57
|
+
const METHOD_PROPERTY_NAME = 'method';
|
|
58
|
+
const PATH_PROPERTY_NAME = 'path';
|
|
59
|
+
const HTTP_VERBS = new Set([
|
|
60
|
+
'GET',
|
|
61
|
+
'POST',
|
|
62
|
+
'PUT',
|
|
63
|
+
'PATCH',
|
|
64
|
+
'DELETE',
|
|
65
|
+
'OPTIONS',
|
|
66
|
+
'HEAD',
|
|
67
|
+
'*'
|
|
68
|
+
]);
|
|
69
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
70
|
+
/**
|
|
71
|
+
* Returns true when the given object literal looks like a Hapi route config.
|
|
72
|
+
*
|
|
73
|
+
* A route config must have:
|
|
74
|
+
* - a `method` property whose value is either a recognised HTTP verb string
|
|
75
|
+
* literal, or an array literal whose elements are all recognised verb strings
|
|
76
|
+
* - a `path` property whose value is a string literal
|
|
77
|
+
*/
|
|
78
|
+
function isRouteConfig(obj) {
|
|
79
|
+
// ── method check ────────────────────────────────────────────────────────────
|
|
80
|
+
const methodProp = obj.getProperty(METHOD_PROPERTY_NAME);
|
|
81
|
+
if (!methodProp || !ts_morph_1.Node.isPropertyAssignment(methodProp))
|
|
82
|
+
return false;
|
|
83
|
+
const methodInit = methodProp.getInitializer();
|
|
84
|
+
if (!methodInit)
|
|
85
|
+
return false;
|
|
86
|
+
if (ts_morph_1.Node.isStringLiteral(methodInit)) {
|
|
87
|
+
if (!HTTP_VERBS.has(methodInit.getLiteralValue().toUpperCase()))
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
else if (ts_morph_1.Node.isArrayLiteralExpression(methodInit)) {
|
|
91
|
+
const allVerbs = methodInit
|
|
92
|
+
.getElements()
|
|
93
|
+
.every((el) => ts_morph_1.Node.isStringLiteral(el) &&
|
|
94
|
+
HTTP_VERBS.has(el.getLiteralValue().toUpperCase()));
|
|
95
|
+
if (!allVerbs)
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
// ── path check ──────────────────────────────────────────────────────────────
|
|
102
|
+
const pathProp = obj.getProperty(PATH_PROPERTY_NAME);
|
|
103
|
+
if (!pathProp || !ts_morph_1.Node.isPropertyAssignment(pathProp))
|
|
104
|
+
return false;
|
|
105
|
+
const pathInit = pathProp.getInitializer();
|
|
106
|
+
return !!pathInit && ts_morph_1.Node.isStringLiteral(pathInit);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Applies PATH_RENAMES to the `path` property of a confirmed route config object.
|
|
110
|
+
* Returns the new path string if a rename was applied, or null if no change was made.
|
|
111
|
+
*/
|
|
112
|
+
function renameRoutePath(obj) {
|
|
113
|
+
const pathProp = obj.getProperty(PATH_PROPERTY_NAME);
|
|
114
|
+
if (!pathProp || !ts_morph_1.Node.isPropertyAssignment(pathProp))
|
|
115
|
+
return null;
|
|
116
|
+
const pathInit = pathProp.getInitializer();
|
|
117
|
+
if (!pathInit || !ts_morph_1.Node.isStringLiteral(pathInit))
|
|
118
|
+
return null;
|
|
119
|
+
const oldPath = pathInit.getLiteralValue();
|
|
120
|
+
const newPath = PATH_RENAMES[oldPath];
|
|
121
|
+
if (!newPath)
|
|
122
|
+
return null;
|
|
123
|
+
pathInit.replaceWithText(`'${newPath}'`);
|
|
124
|
+
return newPath;
|
|
125
|
+
}
|
|
126
|
+
// ─── File processor ──────────────────────────────────────────────────────────
|
|
127
|
+
function processFile(filePath, project) {
|
|
128
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
129
|
+
if (!sourceFile)
|
|
130
|
+
return 0;
|
|
131
|
+
let renamedCount = 0;
|
|
132
|
+
const relPath = path_1.default.relative(process.cwd(), filePath);
|
|
133
|
+
// Collect candidates first to avoid iterating a mutating tree
|
|
134
|
+
const candidates = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
|
|
135
|
+
for (const obj of candidates) {
|
|
136
|
+
if (!isRouteConfig(obj))
|
|
137
|
+
continue;
|
|
138
|
+
const newPath = renameRoutePath(obj);
|
|
139
|
+
if (newPath) {
|
|
140
|
+
renamedCount++;
|
|
141
|
+
console.log(` [${relPath}] Renamed route path → '${newPath}'`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return renamedCount;
|
|
145
|
+
}
|
|
146
|
+
// ─── Entry point ─────────────────────────────────────────────────────────────
|
|
147
|
+
function main() {
|
|
148
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
const srcDir = path_1.default.join(process.cwd(), 'src');
|
|
150
|
+
console.log(`Scanning for Hapi route configs in: ${srcDir}\n`);
|
|
151
|
+
console.log('Active path renames:');
|
|
152
|
+
for (const [from, to] of Object.entries(PATH_RENAMES)) {
|
|
153
|
+
console.log(` '${from}' → '${to}'`);
|
|
154
|
+
}
|
|
155
|
+
console.log();
|
|
156
|
+
const project = new ts_morph_1.Project({
|
|
157
|
+
tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
|
|
158
|
+
skipAddingFilesFromTsConfig: false
|
|
159
|
+
});
|
|
160
|
+
const sourceFiles = project.getSourceFiles().filter((sf) => {
|
|
161
|
+
const fp = sf.getFilePath();
|
|
162
|
+
return fp.includes('/src/') && !fp.includes('/node_modules/');
|
|
163
|
+
});
|
|
164
|
+
console.log(`Found ${sourceFiles.length} source file(s) to analyse.\n`);
|
|
165
|
+
let totalRenamed = 0;
|
|
166
|
+
const modifiedFiles = [];
|
|
167
|
+
for (const sourceFile of sourceFiles) {
|
|
168
|
+
const filePath = sourceFile.getFilePath();
|
|
169
|
+
const renamed = processFile(filePath, project);
|
|
170
|
+
if (renamed > 0) {
|
|
171
|
+
totalRenamed += renamed;
|
|
172
|
+
modifiedFiles.push(filePath);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (modifiedFiles.length === 0) {
|
|
176
|
+
console.log('No matching route paths found. Nothing to do.');
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
console.log(`\nSaving ${modifiedFiles.length} modified file(s)...`);
|
|
180
|
+
for (const filePath of modifiedFiles) {
|
|
181
|
+
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
182
|
+
yield sourceFile.save();
|
|
183
|
+
console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
|
|
184
|
+
}
|
|
185
|
+
console.log(`\nDone. Renamed ${totalRenamed} route path(s).`);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-location-parent-id.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/rename-location-parent-id.ts"],"names":[],"mappings":"AAmJA,iBAAe,IAAI,kBAiDlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,180 @@
|
|
|
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: Rename `parentId` to `administrativeAreaId` on `Location` typed expressions.
|
|
28
|
+
*
|
|
29
|
+
* Usage:
|
|
30
|
+
* ts-node -r tsconfig-paths/register src/migrations/v2.0/rename-location-parent-id.ts
|
|
31
|
+
*
|
|
32
|
+
* What it does:
|
|
33
|
+
* - Scans all TypeScript files under `src/`
|
|
34
|
+
* - Finds every property access expression whose property name is `parentId`
|
|
35
|
+
* - Uses the TypeScript type checker to resolve the type of the object being accessed
|
|
36
|
+
* - Only renames to `administrativeAreaId` when the type (or any union constituent) is
|
|
37
|
+
* the OpenCRVS `Location` type, identified via three strategies in order:
|
|
38
|
+
* 1. Alias symbol name equals 'Location' (works when TypeScript preserves alias info)
|
|
39
|
+
* 2. Direct symbol name equals 'Location'
|
|
40
|
+
* 3. Structural fallback: the type is an object with the property set that uniquely
|
|
41
|
+
* identifies the OpenCRVS Location shape (id, name, externalId, locationType, and
|
|
42
|
+
* either administrativeAreaId or parentId)
|
|
43
|
+
* - Skips `parentId` accesses on any other type (e.g. plain objects, other interfaces)
|
|
44
|
+
* - Saves the modified files in-place
|
|
45
|
+
*/
|
|
46
|
+
const ts_morph_1 = require("ts-morph");
|
|
47
|
+
const path_1 = __importDefault(require("path"));
|
|
48
|
+
const OLD_PROPERTY_NAME = 'parentId';
|
|
49
|
+
const NEW_PROPERTY_NAME = 'administrativeAreaId';
|
|
50
|
+
const LOCATION_TYPE_NAME = 'Location';
|
|
51
|
+
// Properties that together uniquely identify the OpenCRVS Location type.
|
|
52
|
+
// Used as a structural fallback when TypeScript loses the alias name through
|
|
53
|
+
// re-export chains (e.g. z.infer<…> re-exported via @opencrvs/toolkit/events).
|
|
54
|
+
const LOCATION_STRUCTURAL_PROPS = [
|
|
55
|
+
'id',
|
|
56
|
+
'name',
|
|
57
|
+
'externalId',
|
|
58
|
+
'locationType'
|
|
59
|
+
];
|
|
60
|
+
// At least one of these must also be present (old name or new name)
|
|
61
|
+
const LOCATION_AREA_ID_PROPS = ['administrativeAreaId', 'parentId'];
|
|
62
|
+
// ─── Type helpers ─────────────────────────────────────────────────────────────
|
|
63
|
+
/**
|
|
64
|
+
* Returns true if a single (non-union) type resolves to the OpenCRVS Location type.
|
|
65
|
+
*
|
|
66
|
+
* Three strategies are tried in order so that the check remains robust across
|
|
67
|
+
* different TypeScript/ts-morph resolution paths:
|
|
68
|
+
*
|
|
69
|
+
* 1. Alias symbol name — works when TypeScript preserves the `type Location =
|
|
70
|
+
* z.infer<typeof Location>` alias through the re-export chain.
|
|
71
|
+
* 2. Direct symbol name — works when the type is represented by a named interface
|
|
72
|
+
* or class rather than an alias.
|
|
73
|
+
* 3. Structural match — fallback for when both symbol lookups fail (e.g. the
|
|
74
|
+
* alias is lost because the type was re-exported through a barrel or because
|
|
75
|
+
* z.infer<…> fully unwraps the alias). Checks for the combination of
|
|
76
|
+
* properties that uniquely identify the OpenCRVS Location shape.
|
|
77
|
+
*/
|
|
78
|
+
function isSingleLocationType(t) {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
// Strategy 1: alias symbol (zod-inferred type aliases surface here)
|
|
81
|
+
if (((_a = t.getAliasSymbol()) === null || _a === void 0 ? void 0 : _a.getName()) === LOCATION_TYPE_NAME)
|
|
82
|
+
return true;
|
|
83
|
+
// Strategy 2: direct symbol (plain interface / class)
|
|
84
|
+
if (((_b = t.getSymbol()) === null || _b === void 0 ? void 0 : _b.getName()) === LOCATION_TYPE_NAME)
|
|
85
|
+
return true;
|
|
86
|
+
// Strategy 3: structural fallback
|
|
87
|
+
if (t.isObject()) {
|
|
88
|
+
const propNames = new Set(t.getProperties().map((p) => p.getName()));
|
|
89
|
+
const hasCorePropNames = LOCATION_STRUCTURAL_PROPS.every((p) => propNames.has(p));
|
|
90
|
+
const hasAreaIdProp = LOCATION_AREA_ID_PROPS.some((p) => propNames.has(p));
|
|
91
|
+
if (hasCorePropNames && hasAreaIdProp)
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns true when the type of `node` is (or has a union constituent that is)
|
|
98
|
+
* the OpenCRVS Location type.
|
|
99
|
+
* Handles:
|
|
100
|
+
* - `Location`
|
|
101
|
+
* - `Location | undefined` (optional / nullable)
|
|
102
|
+
* - `Location | null | undefined`
|
|
103
|
+
*/
|
|
104
|
+
function isLocationType(node) {
|
|
105
|
+
let type;
|
|
106
|
+
try {
|
|
107
|
+
type = node.getType();
|
|
108
|
+
}
|
|
109
|
+
catch (_a) {
|
|
110
|
+
// getType() can throw on malformed/unresolvable nodes — skip them
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (isSingleLocationType(type))
|
|
114
|
+
return true;
|
|
115
|
+
// Walk union constituents (Location | undefined, Location | null, …)
|
|
116
|
+
for (const constituent of type.getUnionTypes()) {
|
|
117
|
+
if (isSingleLocationType(constituent))
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
// ─── File processor ──────────────────────────────────────────────────────────
|
|
123
|
+
function processFile(filePath, project) {
|
|
124
|
+
const sourceFile = project.getSourceFile(filePath);
|
|
125
|
+
if (!sourceFile)
|
|
126
|
+
return 0;
|
|
127
|
+
let renamedCount = 0;
|
|
128
|
+
// Collect all matching nodes first to avoid mutating the tree while iterating
|
|
129
|
+
const candidates = sourceFile
|
|
130
|
+
.getDescendantsOfKind(ts_morph_1.SyntaxKind.PropertyAccessExpression)
|
|
131
|
+
.filter((propAccess) => propAccess.getName() === OLD_PROPERTY_NAME);
|
|
132
|
+
for (const propAccess of candidates) {
|
|
133
|
+
const obj = propAccess.getExpression();
|
|
134
|
+
if (!isLocationType(obj))
|
|
135
|
+
continue;
|
|
136
|
+
// Rename only the identifier node (the part after the dot) to preserve
|
|
137
|
+
// surrounding whitespace and optional-chain tokens (?.)
|
|
138
|
+
propAccess.getNameNode().replaceWithText(NEW_PROPERTY_NAME);
|
|
139
|
+
renamedCount++;
|
|
140
|
+
console.log(` [${path_1.default.relative(process.cwd(), filePath)}] Renamed Location.${OLD_PROPERTY_NAME} → Location.${NEW_PROPERTY_NAME}`);
|
|
141
|
+
}
|
|
142
|
+
return renamedCount;
|
|
143
|
+
}
|
|
144
|
+
// ─── Entry point ─────────────────────────────────────────────────────────────
|
|
145
|
+
function main() {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const srcDir = path_1.default.join(process.cwd(), 'src');
|
|
148
|
+
console.log(`Scanning for Location.${OLD_PROPERTY_NAME} references in: ${srcDir}\n`);
|
|
149
|
+
const project = new ts_morph_1.Project({
|
|
150
|
+
tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
|
|
151
|
+
skipAddingFilesFromTsConfig: false
|
|
152
|
+
});
|
|
153
|
+
const sourceFiles = project.getSourceFiles().filter((sf) => {
|
|
154
|
+
const fp = sf.getFilePath();
|
|
155
|
+
return fp.includes('/src/') && !fp.includes('/node_modules/');
|
|
156
|
+
});
|
|
157
|
+
console.log(`Found ${sourceFiles.length} source file(s) to analyse.\n`);
|
|
158
|
+
let totalRenamed = 0;
|
|
159
|
+
const modifiedFiles = [];
|
|
160
|
+
for (const sourceFile of sourceFiles) {
|
|
161
|
+
const filePath = sourceFile.getFilePath();
|
|
162
|
+
const renamed = processFile(filePath, project);
|
|
163
|
+
if (renamed > 0) {
|
|
164
|
+
totalRenamed += renamed;
|
|
165
|
+
modifiedFiles.push(filePath);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (modifiedFiles.length === 0) {
|
|
169
|
+
console.log(`No Location.${OLD_PROPERTY_NAME} references found. Nothing to do.`);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
console.log(`\nSaving ${modifiedFiles.length} modified file(s)...`);
|
|
173
|
+
for (const filePath of modifiedFiles) {
|
|
174
|
+
const sourceFile = project.getSourceFileOrThrow(filePath);
|
|
175
|
+
yield sourceFile.save();
|
|
176
|
+
console.log(` Saved: ${path_1.default.relative(process.cwd(), filePath)}`);
|
|
177
|
+
}
|
|
178
|
+
console.log(`\nDone. Renamed ${totalRenamed} Location.${OLD_PROPERTY_NAME} reference(s) to Location.${NEW_PROPERTY_NAME}.`);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simplify-analytics-precalculations.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/simplify-analytics-precalculations.ts"],"names":[],"mappings":"AAqLA,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAyCnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|