@opencrvs/toolkit 2.0.0-rc.fc7f7fc → 2.0.0-rc.fef9d21
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/dist/cli.js +1383 -142
- package/dist/commons/api/router.d.ts +42 -63
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +3 -4
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +3 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-resend-invite-notification.js +373 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +19 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +17 -13
- 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 +4 -5
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +4 -5
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -1
- package/dist/migrations/v2.0/create-events-index.js +1 -2
- 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 +8 -4
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +1351 -139
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +5 -6
- 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.map +1 -1
- package/dist/migrations/v2.0/migrate-scopes.js +6 -7
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +3 -4
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +3 -4
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +3 -4
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +2 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +3 -4
- 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.map +1 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +1 -2
- 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.map +1 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +3 -4
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +3 -4
- 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.map +1 -1
- package/dist/migrations/v2.0/rename-api-paths.js +3 -4
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +3 -4
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +1 -2
- 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/opencrvs-toolkit-2.0.0-rc.fef9d21.tgz +0 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0-rc.fc7f7fc.tgz +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.main = main;
|
|
23
|
+
/**
|
|
24
|
+
* Codemod: Remove the local `infrastructure/` directory.
|
|
25
|
+
*
|
|
26
|
+
* Used by the v1.9 → v2.0 upgrade when the country config does NOT deploy
|
|
27
|
+
* via Docker Swarm. In that case the `infrastructure/` directory shipped
|
|
28
|
+
* with opencrvs-countryconfig is no longer needed and can be removed.
|
|
29
|
+
*
|
|
30
|
+
* Usage:
|
|
31
|
+
* ts-node -r tsconfig-paths/register src/migrations/v2.0/delete-infrastructure-directory.ts
|
|
32
|
+
*
|
|
33
|
+
* What it does:
|
|
34
|
+
* 1. Stages deletion of all tracked files under `infrastructure/` via
|
|
35
|
+
* `git rm -rf --ignore-unmatch -- infrastructure/`. This both removes
|
|
36
|
+
* the files from the working tree and records the deletion in the
|
|
37
|
+
* index, so it shows up in the upgrade commit alongside the other
|
|
38
|
+
* codemod changes.
|
|
39
|
+
* 2. Cleans up any untracked files / empty directory that `git rm` left
|
|
40
|
+
* behind, so the path is fully gone from the working tree.
|
|
41
|
+
*
|
|
42
|
+
* Caveats:
|
|
43
|
+
* - Destructive: any local edits to `infrastructure/` are lost. Run on a
|
|
44
|
+
* clean working tree (or after committing your local changes).
|
|
45
|
+
* - If `infrastructure/` doesn't exist, this codemod is a no-op.
|
|
46
|
+
* - Requires git to be installed and the country config working directory
|
|
47
|
+
* to be a git repo.
|
|
48
|
+
*/
|
|
49
|
+
const fs_1 = require("fs");
|
|
50
|
+
const path_1 = require("path");
|
|
51
|
+
const checkout_upstream_files_1 = require("./checkout-upstream-files");
|
|
52
|
+
const INFRASTRUCTURE_DIR = 'infrastructure';
|
|
53
|
+
function main() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const fullPath = (0, path_1.join)(process.cwd(), INFRASTRUCTURE_DIR);
|
|
56
|
+
if (!(0, fs_1.existsSync)(fullPath)) {
|
|
57
|
+
console.log(`'${INFRASTRUCTURE_DIR}/' not found in ${process.cwd()} — nothing to delete.`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
console.log(`Deleting '${INFRASTRUCTURE_DIR}/'...\n`);
|
|
61
|
+
(0, checkout_upstream_files_1.assertIsGitRepo)();
|
|
62
|
+
// `git rm -rf --ignore-unmatch` removes tracked files (working tree + index)
|
|
63
|
+
// and is a no-op for paths with no tracked entries, so it's safe to run
|
|
64
|
+
// even when `infrastructure/` exists only as untracked files.
|
|
65
|
+
(0, checkout_upstream_files_1.runGit)(['rm', '-rf', '--ignore-unmatch', '--', `${INFRASTRUCTURE_DIR}/`], {
|
|
66
|
+
silent: true
|
|
67
|
+
});
|
|
68
|
+
console.log(` Staged deletion of tracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
69
|
+
// `git rm` leaves untracked files (and any now-empty directory) on disk;
|
|
70
|
+
// remove whatever's left so the path is fully gone.
|
|
71
|
+
if ((0, fs_1.existsSync)(fullPath)) {
|
|
72
|
+
(0, fs_1.rmSync)(fullPath, { recursive: true, force: true });
|
|
73
|
+
console.log(` Removed remaining untracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
74
|
+
}
|
|
75
|
+
console.log(`\n Done. Review the staged deletion with: git diff --cached -- '${INFRASTRUCTURE_DIR}/'`);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export declare function getCwd(): string;
|
|
2
1
|
/**
|
|
3
|
-
* Run the upgrade process for
|
|
4
|
-
*
|
|
2
|
+
* Run the upgrade process for the country config in the current working
|
|
3
|
+
* directory.
|
|
4
|
+
*
|
|
5
|
+
* @param dockerSwarm - When true, the local `infrastructure/` directory is
|
|
6
|
+
* merged with upstream changes (Docker Swarm deployments still need it).
|
|
7
|
+
* When false (the default), `infrastructure/` is deleted entirely, since
|
|
8
|
+
* non-Swarm deployments no longer ship it.
|
|
5
9
|
*/
|
|
6
|
-
export declare function runUpgrade(
|
|
10
|
+
export declare function runUpgrade(dockerSwarm: boolean): Promise<void>;
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AAqCA;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBA+BpD"}
|