@opencrvs/toolkit 1.9.13-rc.72233cd → 1.9.13-rc.7491e0c

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.
Files changed (121) hide show
  1. package/build.sh +0 -13
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/commons/api/router.d.ts +4561 -3370
  4. package/dist/commons/conditionals/conditionals.d.ts +3 -27
  5. package/dist/commons/conditionals/validate.d.ts +3 -13
  6. package/dist/commons/events/ActionConfig.d.ts +1555 -415
  7. package/dist/commons/events/ActionDocument.d.ts +1941 -888
  8. package/dist/commons/events/ActionInput.d.ts +1277 -277
  9. package/dist/commons/events/ActionType.d.ts +11 -91
  10. package/dist/commons/events/AdvancedSearchConfig.d.ts +1496 -294
  11. package/dist/commons/events/CompositeFieldValue.d.ts +190 -30
  12. package/dist/commons/events/Conditional.d.ts +38 -26
  13. package/dist/commons/events/Constants.d.ts +1 -1
  14. package/dist/commons/events/CountryConfigQueryInput.d.ts +4471 -1592
  15. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  16. package/dist/commons/events/DeduplicationConfig.d.ts +171 -15
  17. package/dist/commons/events/Draft.d.ts +113 -72
  18. package/dist/commons/events/DynamicFieldValue.d.ts +78 -12
  19. package/dist/commons/events/EventConfig.d.ts +2420 -35
  20. package/dist/commons/events/EventConfigInput.d.ts +3 -0
  21. package/dist/commons/events/EventDocument.d.ts +1366 -354
  22. package/dist/commons/events/EventIndex.d.ts +1010 -212
  23. package/dist/commons/events/EventInput.d.ts +8 -3
  24. package/dist/commons/events/EventMetadata.d.ts +357 -130
  25. package/dist/commons/events/FieldConfig.d.ts +12890 -2890
  26. package/dist/commons/events/FieldType.d.ts +4 -26
  27. package/dist/commons/events/FieldTypeMapping.d.ts +906 -314
  28. package/dist/commons/events/FieldValue.d.ts +527 -149
  29. package/dist/commons/events/FileUtils.d.ts +2 -2
  30. package/dist/commons/events/FormConfig.d.ts +721 -54
  31. package/dist/commons/events/PageConfig.d.ts +320 -58
  32. package/dist/commons/events/PlainDate.d.ts +1 -1
  33. package/dist/commons/events/SummaryConfig.d.ts +161 -14
  34. package/dist/commons/events/TemplateConfig.d.ts +3 -2
  35. package/dist/commons/events/TranslationConfig.d.ts +2 -2
  36. package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
  37. package/dist/commons/events/WorkqueueConfig.d.ts +7480 -2135
  38. package/dist/commons/events/deduplication.d.ts +3 -3
  39. package/dist/commons/events/defineConfig.d.ts +247 -2
  40. package/dist/commons/events/index.d.ts +0 -3
  41. package/dist/commons/events/locations.d.ts +20 -57
  42. package/dist/commons/events/scopes.d.ts +34 -35
  43. package/dist/commons/events/state/availableActions.d.ts +2 -7
  44. package/dist/commons/events/state/flags.d.ts +3 -21
  45. package/dist/commons/events/state/index.d.ts +27 -30
  46. package/dist/commons/events/state/utils.d.ts +172 -190
  47. package/dist/commons/events/test.utils.d.ts +11 -52
  48. package/dist/commons/events/transactions.d.ts +1 -1
  49. package/dist/commons/events/utils.d.ts +274 -374
  50. package/dist/commons/notification/UserNotifications.d.ts +637 -61
  51. package/dist/conditionals/index.d.ts.map +1 -1
  52. package/dist/conditionals/index.js +14 -302
  53. package/dist/events/deduplication.d.ts +3 -3
  54. package/dist/events/index.js +2113 -2847
  55. package/dist/notification/index.d.ts.map +1 -1
  56. package/dist/notification/index.js +1769 -2073
  57. package/dist/scopes/index.d.ts +353 -640
  58. package/dist/scopes/index.d.ts.map +1 -1
  59. package/dist/scopes/index.js +300 -340
  60. package/package.json +3 -13
  61. package/tsconfig.json +2 -12
  62. package/tsconfig.tsbuildinfo +1 -1
  63. package/dist/application-config/index.d.ts +0 -2
  64. package/dist/application-config/index.d.ts.map +0 -1
  65. package/dist/application-config/index.js +0 -2128
  66. package/dist/cli.d.ts +0 -2
  67. package/dist/cli.d.ts.map +0 -1
  68. package/dist/cli.js +0 -3237
  69. package/dist/commons/application-config/index.d.ts +0 -84
  70. package/dist/commons/events/AuditLog.d.ts +0 -405
  71. package/dist/commons/events/Flag.d.ts +0 -67
  72. package/dist/commons/events/eventConfigValidation.d.ts +0 -8
  73. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
  74. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
  75. package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -405
  76. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
  77. package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
  78. package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -829
  79. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
  80. package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
  81. package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -159
  82. package/dist/migrations/v2.0/index.d.ts +0 -7
  83. package/dist/migrations/v2.0/index.d.ts.map +0 -1
  84. package/dist/migrations/v2.0/index.js +0 -3176
  85. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
  86. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
  87. package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -344
  88. package/dist/migrations/v2.0/migrate-scopes.d.ts +0 -3
  89. package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
  90. package/dist/migrations/v2.0/migrate-scopes.js +0 -282
  91. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
  92. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
  93. package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -268
  94. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
  95. package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
  96. package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -237
  97. package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
  98. package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
  99. package/dist/migrations/v2.0/remove-delete-actions.js +0 -157
  100. package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
  101. package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
  102. package/dist/migrations/v2.0/remove-demo-scope.js +0 -75
  103. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
  104. package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
  105. package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -97
  106. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
  107. package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
  108. package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -78
  109. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
  110. package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
  111. package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -110
  112. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
  113. package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
  114. package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -164
  115. package/dist/migrations/v2.0/rename-api-paths.d.ts +0 -3
  116. package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
  117. package/dist/migrations/v2.0/rename-api-paths.js +0 -188
  118. package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
  119. package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
  120. package/dist/migrations/v2.0/rename-location-parent-id.js +0 -181
  121. package/opencrvs-toolkit-1.9.13-rc.72233cd.tgz +0 -0
@@ -1,3 +0,0 @@
1
- declare function main(): Promise<void>;
2
- export { main };
3
- //# sourceMappingURL=convert-paragraph-to-heading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-paragraph-to-heading.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/convert-paragraph-to-heading.ts"],"names":[],"mappings":"AAwJA,iBAAe,IAAI,kBA6ClB;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -1,159 +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: Convert `FieldType.PARAGRAPH` fields with a heading `fontVariant` to `FieldType.HEADING`,
28
- * and remove the `fontVariant` property from plain paragraphs.
29
- *
30
- * Usage:
31
- * ts-node -r tsconfig-paths/register src/migrations/v2.0/convert-paragraph-to-heading.ts
32
- *
33
- * What it does:
34
- * - Scans all TypeScript files under `src/`
35
- * - Finds every object literal whose `type` property is `FieldType.PARAGRAPH`
36
- * - Navigates `configuration.styles.fontVariant` on that object
37
- * - If `fontVariant` is one of 'h1' | 'h2' | 'h3' | 'h4':
38
- * changes `type` to `FieldType.HEADING`
39
- * - If `fontVariant` is absent, not a string literal, or any other value:
40
- * leaves `type` as `FieldType.PARAGRAPH` and removes the `fontVariant` property
41
- * - Saves the modified files in-place
42
- */
43
- const ts_morph_1 = require("ts-morph");
44
- const path_1 = __importDefault(require("path"));
45
- const _1 = require(".");
46
- const FIELD_TYPE_ENUM_NAME = 'FieldType';
47
- const PARAGRAPH_MEMBER_NAME = 'PARAGRAPH';
48
- const HEADING_MEMBER_NAME = 'HEADING';
49
- const TYPE_PROPERTY_NAME = 'type';
50
- const CONFIGURATION_PROPERTY_NAME = 'configuration';
51
- const STYLES_PROPERTY_NAME = 'styles';
52
- const FONT_VARIANT_PROPERTY_NAME = 'fontVariant';
53
- const HEADING_FONT_VARIANTS = new Set(['h1', 'h2', 'h3', 'h4']);
54
- function isParagraphType(typeInitializer) {
55
- if (!ts_morph_1.Node.isPropertyAccessExpression(typeInitializer))
56
- return false;
57
- const obj = typeInitializer.getExpression();
58
- const member = typeInitializer.getName();
59
- return (ts_morph_1.Node.isIdentifier(obj) &&
60
- obj.getText() === FIELD_TYPE_ENUM_NAME &&
61
- member === PARAGRAPH_MEMBER_NAME);
62
- }
63
- function getFontVariantProperty(obj) {
64
- const configProperty = obj.getProperty(CONFIGURATION_PROPERTY_NAME);
65
- if (!configProperty || !ts_morph_1.Node.isPropertyAssignment(configProperty))
66
- return null;
67
- const configInitializer = configProperty.getInitializer();
68
- if (!configInitializer || !ts_morph_1.Node.isObjectLiteralExpression(configInitializer))
69
- return null;
70
- const stylesProperty = configInitializer.getProperty(STYLES_PROPERTY_NAME);
71
- if (!stylesProperty || !ts_morph_1.Node.isPropertyAssignment(stylesProperty))
72
- return null;
73
- const stylesInitializer = stylesProperty.getInitializer();
74
- if (!stylesInitializer || !ts_morph_1.Node.isObjectLiteralExpression(stylesInitializer))
75
- return null;
76
- const fontVariantProperty = stylesInitializer.getProperty(FONT_VARIANT_PROPERTY_NAME);
77
- if (!fontVariantProperty || !ts_morph_1.Node.isPropertyAssignment(fontVariantProperty))
78
- return null;
79
- return fontVariantProperty;
80
- }
81
- function transformParagraphField(obj) {
82
- const typeProperty = obj.getProperty(TYPE_PROPERTY_NAME);
83
- if (!typeProperty || !ts_morph_1.Node.isPropertyAssignment(typeProperty))
84
- return null;
85
- const typeInitializer = typeProperty.getInitializer();
86
- if (!typeInitializer || !isParagraphType(typeInitializer))
87
- return null;
88
- const fontVariantProperty = getFontVariantProperty(obj);
89
- if (fontVariantProperty) {
90
- const fontVariantInitializer = fontVariantProperty.getInitializer();
91
- if (fontVariantInitializer &&
92
- ts_morph_1.Node.isStringLiteral(fontVariantInitializer) &&
93
- HEADING_FONT_VARIANTS.has(fontVariantInitializer.getLiteralValue())) {
94
- // fontVariant is h1–h4: promote to HEADING
95
- typeInitializer.replaceWithText(`${FIELD_TYPE_ENUM_NAME}.${HEADING_MEMBER_NAME}`);
96
- return 'converted-to-heading';
97
- }
98
- // fontVariant is present but not a heading variant: remove it
99
- fontVariantProperty.remove();
100
- return 'removed-font-variant';
101
- }
102
- // No fontVariant at all: nothing to do
103
- return null;
104
- }
105
- function processFile(filePath, project) {
106
- const sourceFile = project.getSourceFile(filePath);
107
- if (!sourceFile)
108
- return 0;
109
- let changedCount = 0;
110
- const objectLiterals = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
111
- for (const obj of objectLiterals) {
112
- const result = transformParagraphField(obj);
113
- if (result === 'converted-to-heading') {
114
- changedCount++;
115
- console.log(` [${path_1.default.relative((0, _1.getCwd)(), filePath)}] Converted PARAGRAPH with heading fontVariant to HEADING`);
116
- }
117
- else if (result === 'removed-font-variant') {
118
- changedCount++;
119
- console.log(` [${path_1.default.relative((0, _1.getCwd)(), filePath)}] Removed non-heading fontVariant from PARAGRAPH`);
120
- }
121
- }
122
- return changedCount;
123
- }
124
- function main() {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- const srcDir = path_1.default.join((0, _1.getCwd)(), 'src');
127
- console.log(`Scanning for FieldType.PARAGRAPH fields in: ${srcDir}\n`);
128
- const project = new ts_morph_1.Project({
129
- tsConfigFilePath: path_1.default.resolve(srcDir, '../tsconfig.json'),
130
- skipAddingFilesFromTsConfig: false
131
- });
132
- const sourceFiles = project.getSourceFiles().filter((sf) => {
133
- const fp = sf.getFilePath();
134
- return fp.includes('/src/') && !fp.includes('/node_modules/');
135
- });
136
- console.log(`Found ${sourceFiles.length} source file(s) to analyse.\n`);
137
- let totalChanged = 0;
138
- const modifiedFiles = [];
139
- for (const sourceFile of sourceFiles) {
140
- const filePath = sourceFile.getFilePath();
141
- const changed = processFile(filePath, project);
142
- if (changed > 0) {
143
- totalChanged += changed;
144
- modifiedFiles.push(filePath);
145
- }
146
- }
147
- if (modifiedFiles.length === 0) {
148
- console.log('No FieldType.PARAGRAPH fields with fontVariant found. Nothing to do.');
149
- return;
150
- }
151
- console.log(`\nSaving ${modifiedFiles.length} modified file(s)...`);
152
- for (const filePath of modifiedFiles) {
153
- const sourceFile = project.getSourceFileOrThrow(filePath);
154
- yield sourceFile.save();
155
- console.log(` Saved: ${path_1.default.relative((0, _1.getCwd)(), filePath)}`);
156
- }
157
- console.log(`\nDone. Processed ${totalChanged} FieldType.PARAGRAPH field(s).`);
158
- });
159
- }
@@ -1,7 +0,0 @@
1
- export declare function getCwd(): string;
2
- /**
3
- * Run the upgrade process for a given country config directory.
4
- * @param ccwd - The country config working directory.
5
- */
6
- export declare function runUpgrade(ccwd: string | undefined): Promise<void>;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AA4BA,wBAAgB,MAAM,WAMrB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,iBA2BxD"}