@opencrvs/toolkit 2.0.0 → 2.1.0-rc.05eb1de
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 +15 -0
- package/build.sh +5 -4
- package/create-countryconfig/package.json +1 -1
- package/dist/application-config/index.js +29 -6
- package/dist/cli.js +3186 -4921
- package/dist/commons/api/router.d.ts +729 -126
- package/dist/commons/conditionals/conditionals.d.ts +1592 -40
- package/dist/commons/events/ActionConfig.d.ts +230 -2
- package/dist/commons/events/ActionDocument.d.ts +44 -0
- package/dist/commons/events/ActionInput.d.ts +26 -0
- package/dist/commons/events/ActionType.d.ts +6 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +18 -0
- package/dist/commons/events/AuditLog.d.ts +2 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +42 -0
- package/dist/commons/events/Draft.d.ts +2 -0
- package/dist/commons/events/EventConfig.d.ts +2 -0
- package/dist/commons/events/EventDocument.d.ts +22 -0
- package/dist/commons/events/EventIndex.d.ts +25 -0
- package/dist/commons/events/EventMetadata.d.ts +26 -0
- package/dist/commons/events/FieldConfig.d.ts +15 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +44 -2
- package/dist/commons/events/field.d.ts +722 -34
- package/dist/commons/events/locations.d.ts +1 -0
- package/dist/commons/events/scopes.d.ts +1 -0
- package/dist/commons/events/state/index.d.ts +8 -0
- package/dist/commons/events/state/utils.d.ts +9 -0
- package/dist/commons/events/test.utils.d.ts +9 -1
- package/dist/commons/events/utils.d.ts +15 -1
- package/dist/conditionals/index.js +12 -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 +134 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +169 -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 +5 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +71 -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/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 +199 -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 +794 -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 +163 -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 +179 -0
- package/dist/environment/users.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +122 -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/index.js +245 -29
- 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/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 +184 -19
- package/dist/scopes/index.d.ts +96 -2
- package/dist/scopes/index.js +12 -5
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +83 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +81 -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.05eb1de.tgz +0 -0
- package/package.json +16 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/opencrvs-toolkit-2.0.0.tgz +0 -0
package/README.md
CHANGED
|
@@ -14,6 +14,21 @@ 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 users
|
|
29
|
+
opencrvs environment swarm-to-k8s
|
|
30
|
+
```
|
|
31
|
+
|
|
17
32
|
### Development using yarn link
|
|
18
33
|
|
|
19
34
|
```
|
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",
|
|
@@ -665,11 +670,13 @@ var scopeOptionsPlaceEvent = z11.object({
|
|
|
665
670
|
event: scopeByEvent,
|
|
666
671
|
placeOfEvent: JurisdictionFilter.optional()
|
|
667
672
|
}).describe("Options applicable to all record scopes.");
|
|
668
|
-
var
|
|
673
|
+
var scopeOptionsDeclaredOrNotified = scopeOptionsPlaceEvent.extend({
|
|
674
|
+
notifiedIn: JurisdictionFilter.optional(),
|
|
675
|
+
notifiedBy: UserFilter.optional(),
|
|
669
676
|
declaredIn: JurisdictionFilter.optional(),
|
|
670
677
|
declaredBy: UserFilter.optional()
|
|
671
678
|
}).describe("Options applicable to actions that may take place after DECLARE");
|
|
672
|
-
var AllRecordScopeOptions =
|
|
679
|
+
var AllRecordScopeOptions = scopeOptionsDeclaredOrNotified.extend({
|
|
673
680
|
registeredIn: JurisdictionFilter.optional(),
|
|
674
681
|
registeredBy: UserFilter.optional()
|
|
675
682
|
}).describe(
|
|
@@ -707,6 +714,8 @@ var ResolvedScopeOptionsPlaceEvent = z11.object({
|
|
|
707
714
|
"Resolved options applicable to all record scopes, with location ID instead of jurisdiction filter."
|
|
708
715
|
);
|
|
709
716
|
var ResolvedScopeOptionsDeclared = ResolvedScopeOptionsPlaceEvent.extend({
|
|
717
|
+
notifiedIn: UUID.nullish(),
|
|
718
|
+
notifiedBy: z11.string().optional(),
|
|
710
719
|
declaredIn: UUID.nullish(),
|
|
711
720
|
declaredBy: z11.string().optional()
|
|
712
721
|
}).describe(
|
|
@@ -727,6 +736,7 @@ var ScopesWithDeclaredOptions = RecordScopeTypeV2.extract([
|
|
|
727
736
|
"record.edit",
|
|
728
737
|
"record.reject",
|
|
729
738
|
"record.archive",
|
|
739
|
+
"record.unarchive",
|
|
730
740
|
"record.review-duplicates",
|
|
731
741
|
"record.register"
|
|
732
742
|
]);
|
|
@@ -752,7 +762,7 @@ var RecordScopeV2 = z11.discriminatedUnion("type", [
|
|
|
752
762
|
}),
|
|
753
763
|
z11.object({
|
|
754
764
|
type: ScopesWithDeclaredOptions,
|
|
755
|
-
options:
|
|
765
|
+
options: scopeOptionsDeclaredOrNotified.optional()
|
|
756
766
|
}),
|
|
757
767
|
z11.object({
|
|
758
768
|
type: ScopesWithFullOptions,
|
|
@@ -841,8 +851,9 @@ var EncodedScope = z11.string().brand("EncodedScope");
|
|
|
841
851
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
842
852
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
843
853
|
accessLevel: JurisdictionFilter.enum.all,
|
|
844
|
-
|
|
845
|
-
declaredIn: JurisdictionFilter.enum.all
|
|
854
|
+
notifiedIn: JurisdictionFilter.enum.all,
|
|
855
|
+
declaredIn: JurisdictionFilter.enum.all,
|
|
856
|
+
registeredIn: JurisdictionFilter.enum.all
|
|
846
857
|
};
|
|
847
858
|
|
|
848
859
|
// ../commons/src/authentication.ts
|
|
@@ -960,6 +971,11 @@ var ArchiveAction = ActionBase.extend(
|
|
|
960
971
|
content: ReasonContent
|
|
961
972
|
}).shape
|
|
962
973
|
);
|
|
974
|
+
var UnarchiveAction = ActionBase.extend(
|
|
975
|
+
z13.object({
|
|
976
|
+
type: z13.literal(ActionType.UNARCHIVE)
|
|
977
|
+
}).shape
|
|
978
|
+
);
|
|
963
979
|
var CreatedAction = ActionBase.extend(
|
|
964
980
|
z13.object({
|
|
965
981
|
type: z13.literal(ActionType.CREATE)
|
|
@@ -1026,6 +1042,7 @@ var ActionDocument = z13.discriminatedUnion("type", [
|
|
|
1026
1042
|
MarkNotDuplicateAction.meta({ id: "MarkNotDuplicateAction" }),
|
|
1027
1043
|
MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
|
|
1028
1044
|
ArchiveAction.meta({ id: "ArchiveAction" }),
|
|
1045
|
+
UnarchiveAction.meta({ id: "UnarchiveAction" }),
|
|
1029
1046
|
NotifiedAction.meta({ id: "NotifiedAction" }),
|
|
1030
1047
|
RegisterAction.meta({ id: "RegisterAction" }),
|
|
1031
1048
|
DeclareAction.meta({ id: "DeclareAction" }),
|
|
@@ -1131,6 +1148,7 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
|
|
|
1131
1148
|
)
|
|
1132
1149
|
});
|
|
1133
1150
|
var LegalStatuses = z15.object({
|
|
1151
|
+
[EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
|
|
1134
1152
|
[EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
|
|
1135
1153
|
[EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
|
|
1136
1154
|
});
|
|
@@ -1190,6 +1208,8 @@ var EventMetadataKeys = z15.enum(EventMetadataKeysArray);
|
|
|
1190
1208
|
var EventMetadataDateFieldIdInput = z15.enum([
|
|
1191
1209
|
"createdAt",
|
|
1192
1210
|
"updatedAt",
|
|
1211
|
+
"legalStatuses.NOTIFIED.createdAt",
|
|
1212
|
+
"legalStatuses.NOTIFIED.acceptedAt",
|
|
1193
1213
|
"legalStatuses.DECLARED.createdAt",
|
|
1194
1214
|
"legalStatuses.DECLARED.acceptedAt",
|
|
1195
1215
|
"legalStatuses.REGISTERED.createdAt",
|
|
@@ -1198,6 +1218,8 @@ var EventMetadataDateFieldIdInput = z15.enum([
|
|
|
1198
1218
|
var EventMetadataDateFieldId = z15.enum([
|
|
1199
1219
|
"event.createdAt",
|
|
1200
1220
|
"event.updatedAt",
|
|
1221
|
+
"event.legalStatuses.NOTIFIED.createdAt",
|
|
1222
|
+
"event.legalStatuses.NOTIFIED.acceptedAt",
|
|
1201
1223
|
"event.legalStatuses.DECLARED.createdAt",
|
|
1202
1224
|
"event.legalStatuses.DECLARED.acceptedAt",
|
|
1203
1225
|
"event.legalStatuses.REGISTERED.createdAt",
|
|
@@ -1260,7 +1282,8 @@ var Range = import_v4.z.object({
|
|
|
1260
1282
|
});
|
|
1261
1283
|
var ContainsFlags = import_v4.z.object({
|
|
1262
1284
|
anyOf: import_v4.z.array(Flag).optional(),
|
|
1263
|
-
noneOf: import_v4.z.array(Flag).optional()
|
|
1285
|
+
noneOf: import_v4.z.array(Flag).optional(),
|
|
1286
|
+
allOf: import_v4.z.array(Flag).optional()
|
|
1264
1287
|
}).meta({
|
|
1265
1288
|
id: "ContainsFlags"
|
|
1266
1289
|
});
|