@opencrvs/toolkit 2.0.0 → 2.1.0-rc.00fa07b
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 +16 -0
- package/build.sh +5 -4
- package/create-countryconfig/package.json +1 -1
- package/dist/application-config/index.js +32 -7
- package/dist/cli.js +3222 -4889
- package/dist/commons/api/router.d.ts +3561 -2890
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +32 -323
- package/dist/commons/events/ActionConfig.d.ts +302 -67
- package/dist/commons/events/ActionDocument.d.ts +155 -111
- package/dist/commons/events/ActionInput.d.ts +26 -6
- package/dist/commons/events/ActionType.d.ts +63 -58
- package/dist/commons/events/AdvancedSearchConfig.d.ts +513 -489
- package/dist/commons/events/AuditLog.d.ts +79 -40
- 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 +603 -561
- package/dist/commons/events/Draft.d.ts +37 -35
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +5 -3
- package/dist/commons/events/EventDocument.d.ts +66 -44
- package/dist/commons/events/EventIndex.d.ts +76 -51
- package/dist/commons/events/EventMetadata.d.ts +60 -34
- package/dist/commons/events/FieldConfig.d.ts +341 -321
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +100 -100
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/Flag.d.ts +15 -15
- 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 +840 -798
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +2 -2
- package/dist/commons/events/field.d.ts +69 -198
- 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 +104 -6
- package/dist/commons/events/mocks.test.utils.d.ts +18 -4
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/index.d.ts +23 -15
- package/dist/commons/events/state/utils.d.ts +15 -6
- package/dist/commons/events/test.utils.d.ts +44 -39
- package/dist/commons/events/utils.d.ts +127 -105
- package/dist/commons/notification/UserNotifications.d.ts +10 -10
- package/dist/conditionals/index.js +13 -5
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +122 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +155 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +67 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +247 -0
- package/dist/environment/index.d.ts +6 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +81 -0
- package/dist/environment/logger.d.ts +6 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +507 -0
- 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-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +200 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +412 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +775 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +21 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +183 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +164 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +191 -0
- 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.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +120 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +110 -0
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +422 -97
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +1 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/index.js +88 -5139
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +218 -0
- package/dist/notification/index.js +344 -110
- package/dist/scopes/index.d.ts +213 -117
- package/dist/scopes/index.js +13 -5
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +80 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +77 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +115 -0
- package/dist/templates/inventory/inventory.template.yml +100 -0
- package/dist/templates/inventory/production.example.yml +77 -0
- package/dist/templates/inventory/qa.example.yml +48 -0
- package/opencrvs-toolkit-2.1.0-rc.00fa07b.tgz +0 -0
- package/package.json +18 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -14,6 +14,22 @@ src/
|
|
|
14
14
|
|
|
15
15
|
## Getting started
|
|
16
16
|
|
|
17
|
+
### Manage GitHub environments
|
|
18
|
+
|
|
19
|
+
All commands should be executed within infrastructure repository.
|
|
20
|
+
|
|
21
|
+
Run `opencrvs environment init` from the root of a infrastructure
|
|
22
|
+
repository to create new GitHub environment. Command requires valid GitHub token.
|
|
23
|
+
|
|
24
|
+
Other environment operations are available as separate commands:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
opencrvs environment update-workflows
|
|
28
|
+
opencrvs environment upgrade
|
|
29
|
+
opencrvs environment users
|
|
30
|
+
opencrvs environment swarm-to-k8s
|
|
31
|
+
```
|
|
32
|
+
|
|
17
33
|
### Development using yarn link
|
|
18
34
|
|
|
19
35
|
```
|
package/build.sh
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
1
3
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
4
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
5
|
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
@@ -7,8 +9,6 @@
|
|
|
7
9
|
#
|
|
8
10
|
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
11
|
|
|
10
|
-
#!/bin/bash
|
|
11
|
-
|
|
12
12
|
set -e
|
|
13
13
|
|
|
14
14
|
rm -rf dist
|
|
@@ -51,8 +51,8 @@ mkdir -p ./dist/commons/application-config
|
|
|
51
51
|
cp -r ../commons/build/dist/common/application-config.d.ts ./dist/commons/application-config/index.d.ts
|
|
52
52
|
|
|
53
53
|
# Build migration CLI
|
|
54
|
-
npx esbuild src/migrations/v2.
|
|
55
|
-
chmod +x ./dist/migrations/v2.
|
|
54
|
+
npx esbuild src/migrations/v2.1/index.ts --bundle --format=cjs --outdir=./dist/migrations/v2.1 --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
|
|
55
|
+
chmod +x ./dist/migrations/v2.1/index.js
|
|
56
56
|
|
|
57
57
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
58
58
|
sed -i '' 's|@opencrvs/events/build/types|../commons/api|g' dist/api/index.d.ts
|
|
@@ -64,6 +64,7 @@ fi
|
|
|
64
64
|
|
|
65
65
|
# Build CLI
|
|
66
66
|
npx esbuild src/cli.ts --bundle --format=cjs --outdir=./dist --allow-overwrite --packages=external --banner:js="#!/usr/bin/env node"
|
|
67
|
+
cp -R src/environment/templates dist/templates
|
|
67
68
|
chmod +x ./dist/cli.js
|
|
68
69
|
|
|
69
70
|
echo "Build completed successfully."
|
|
@@ -520,6 +520,7 @@ var ActionType = {
|
|
|
520
520
|
MARK_AS_DUPLICATE: "MARK_AS_DUPLICATE",
|
|
521
521
|
MARK_AS_NOT_DUPLICATE: "MARK_AS_NOT_DUPLICATE",
|
|
522
522
|
ARCHIVE: "ARCHIVE",
|
|
523
|
+
UNARCHIVE: "UNARCHIVE",
|
|
523
524
|
// Record actions
|
|
524
525
|
PRINT_CERTIFICATE: "PRINT_CERTIFICATE",
|
|
525
526
|
REQUEST_CORRECTION: "REQUEST_CORRECTION",
|
|
@@ -539,6 +540,7 @@ var ConfirmableActions = [
|
|
|
539
540
|
ActionType.REGISTER,
|
|
540
541
|
ActionType.REJECT,
|
|
541
542
|
ActionType.ARCHIVE,
|
|
543
|
+
ActionType.UNARCHIVE,
|
|
542
544
|
ActionType.PRINT_CERTIFICATE,
|
|
543
545
|
ActionType.REQUEST_CORRECTION,
|
|
544
546
|
ActionType.APPROVE_CORRECTION,
|
|
@@ -557,6 +559,7 @@ var ActionTypes = z10.enum([
|
|
|
557
559
|
"MARK_AS_DUPLICATE",
|
|
558
560
|
"MARK_AS_NOT_DUPLICATE",
|
|
559
561
|
"ARCHIVE",
|
|
562
|
+
"UNARCHIVE",
|
|
560
563
|
"PRINT_CERTIFICATE",
|
|
561
564
|
"REQUEST_CORRECTION",
|
|
562
565
|
"REJECT_CORRECTION",
|
|
@@ -597,6 +600,7 @@ var WorkqueueActionType = ActionTypes.extract([
|
|
|
597
600
|
ActionType.REJECT,
|
|
598
601
|
ActionType.MARK_AS_DUPLICATE,
|
|
599
602
|
ActionType.ARCHIVE,
|
|
603
|
+
ActionType.UNARCHIVE,
|
|
600
604
|
ActionType.PRINT_CERTIFICATE,
|
|
601
605
|
ActionType.REQUEST_CORRECTION
|
|
602
606
|
]);
|
|
@@ -626,6 +630,7 @@ var RecordScopeTypeV2 = z11.enum([
|
|
|
626
630
|
"record.edit",
|
|
627
631
|
"record.reject",
|
|
628
632
|
"record.archive",
|
|
633
|
+
"record.unarchive",
|
|
629
634
|
"record.review-duplicates",
|
|
630
635
|
"record.register",
|
|
631
636
|
"record.print-certified-copies",
|
|
@@ -642,6 +647,7 @@ var PlainScopeType = z11.enum([
|
|
|
642
647
|
"integration.create",
|
|
643
648
|
"record.import",
|
|
644
649
|
"config.update-all",
|
|
650
|
+
"location.edit",
|
|
645
651
|
"attachment.upload",
|
|
646
652
|
"profile.electronic-signature",
|
|
647
653
|
"user.read-only-my-audit",
|
|
@@ -665,11 +671,13 @@ var scopeOptionsPlaceEvent = z11.object({
|
|
|
665
671
|
event: scopeByEvent,
|
|
666
672
|
placeOfEvent: JurisdictionFilter.optional()
|
|
667
673
|
}).describe("Options applicable to all record scopes.");
|
|
668
|
-
var
|
|
674
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
675
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
676
|
+
notifiedBy: UserFilter.optional(),
|
|
669
677
|
declaredIn: JurisdictionFilter.optional(),
|
|
670
678
|
declaredBy: UserFilter.optional()
|
|
671
679
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
672
|
-
var AllRecordScopeOptions =
|
|
680
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
673
681
|
registeredIn: JurisdictionFilter.optional(),
|
|
674
682
|
registeredBy: UserFilter.optional()
|
|
675
683
|
}).describe(
|
|
@@ -707,6 +715,8 @@ var ResolvedScopeOptionsPlaceEvent = z11.object({
|
|
|
707
715
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
708
716
|
);
|
|
709
717
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
718
|
+
notifiedIn: UUID.nullish(),
|
|
719
|
+
notifiedBy: z11.string().optional(),
|
|
710
720
|
declaredIn: UUID.nullish(),
|
|
711
721
|
declaredBy: z11.string().optional()
|
|
712
722
|
}).describe(
|
|
@@ -727,6 +737,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
727
737
|
"record.edit",
|
|
728
738
|
"record.reject",
|
|
729
739
|
"record.archive",
|
|
740
|
+
"record.unarchive",
|
|
730
741
|
"record.review-duplicates",
|
|
731
742
|
"record.register"
|
|
732
743
|
]);
|
|
@@ -752,7 +763,7 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
|
|
|
752
763
|
}),
|
|
753
764
|
z11.object({
|
|
754
765
|
type: ScopesWithDeclaredOptions,
|
|
755
|
-
options:
|
|
766
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
756
767
|
}),
|
|
757
768
|
z11.object({
|
|
758
769
|
type: ScopesWithFullOptions,
|
|
@@ -841,8 +852,9 @@ var EncodedScope = z11.string().brand("EncodedScope");
|
|
|
841
852
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
842
853
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
843
854
|
accessLevel: JurisdictionFilter.enum.all,
|
|
844
|
-
|
|
845
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
855
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
856
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
857
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
846
858
|
};
|
|
847
859
|
|
|
848
860
|
// ../commons/src/authentication.ts
|
|
@@ -960,6 +972,11 @@ var ArchiveAction = ActionBase.extend(
|
|
|
960
972
|
content: ReasonContent
|
|
961
973
|
}).shape
|
|
962
974
|
);
|
|
975
|
+
var UnarchiveAction = ActionBase.extend(
|
|
976
|
+
z13.object({
|
|
977
|
+
type: z13.literal(ActionType.UNARCHIVE)
|
|
978
|
+
}).shape
|
|
979
|
+
);
|
|
963
980
|
var CreatedAction = ActionBase.extend(
|
|
964
981
|
z13.object({
|
|
965
982
|
type: z13.literal(ActionType.CREATE)
|
|
@@ -973,9 +990,10 @@ var NotifiedAction = ActionBase.extend(
|
|
|
973
990
|
var EditAction = ActionBase.extend(
|
|
974
991
|
z13.object({
|
|
975
992
|
type: z13.literal(ActionType.EDIT),
|
|
993
|
+
/** @deprecated New Edit-actions should no longer contain content. This is kept for old 2.0 edits. */
|
|
976
994
|
content: z13.object({
|
|
977
995
|
comment: z13.string().describe("Comment for the edit action.").optional()
|
|
978
|
-
})
|
|
996
|
+
}).optional()
|
|
979
997
|
}).shape
|
|
980
998
|
);
|
|
981
999
|
var PrintContent = z13.object({
|
|
@@ -1026,6 +1044,7 @@ var ActionDocument = z13.discriminatedUnion("type", [
|
|
|
1026
1044
|
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1027
1045
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1028
1046
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1047
|
+
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1029
1048
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1030
1049
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1031
1050
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -1131,6 +1150,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1131
1150
|
)
|
|
1132
1151
|
});
|
|
1133
1152
|
var LegalStatuses = z15.object({
|
|
1153
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1134
1154
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1135
1155
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1136
1156
|
});
|
|
@@ -1190,6 +1210,8 @@ var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
|
|
|
1190
1210
|
var EventMetadataDateFieldIdInput = z15.enum([
|
|
1191
1211
|
"createdAt",
|
|
1192
1212
|
"updatedAt",
|
|
1213
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1214
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1193
1215
|
"legalStatuses.DECLARED.createdAt",
|
|
1194
1216
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1195
1217
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1198,6 +1220,8 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1198
1220
|
var EventMetadataDateFieldId = z15.enum([
|
|
1199
1221
|
"event.createdAt",
|
|
1200
1222
|
"event.updatedAt",
|
|
1223
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1224
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1201
1225
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1202
1226
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1203
1227
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1260,7 +1284,8 @@ var Range = import_v4.z.object({
|
|
|
1260
1284
|
});
|
|
1261
1285
|
var ContainsFlags = import_v4.z.object({
|
|
1262
1286
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1263
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1287
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1288
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1264
1289
|
}).meta({
|
|
1265
1290
|
id: "ContainsFlags"
|
|
1266
1291
|
});
|