@opencrvs/toolkit 1.9.13-rc.9f087e5 → 1.9.13-rc.a0186ec
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 +0 -13
- package/dist/api/index.d.ts.map +1 -1
- package/dist/commons/api/router.d.ts +2101 -3232
- package/dist/commons/conditionals/conditionals.d.ts +3 -27
- package/dist/commons/conditionals/validate.d.ts +2 -13
- package/dist/commons/events/ActionConfig.d.ts +1555 -415
- package/dist/commons/events/ActionDocument.d.ts +1941 -888
- package/dist/commons/events/ActionInput.d.ts +1073 -277
- package/dist/commons/events/ActionType.d.ts +11 -91
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1496 -294
- package/dist/commons/events/CompositeFieldValue.d.ts +190 -30
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4471 -1592
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +171 -15
- package/dist/commons/events/Draft.d.ts +107 -72
- package/dist/commons/events/DynamicFieldValue.d.ts +78 -12
- package/dist/commons/events/EventConfig.d.ts +2420 -35
- package/dist/commons/events/EventConfigInput.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +1366 -354
- package/dist/commons/events/EventIndex.d.ts +1010 -212
- package/dist/commons/events/EventInput.d.ts +8 -3
- package/dist/commons/events/EventMetadata.d.ts +357 -130
- package/dist/commons/events/FieldConfig.d.ts +12899 -2890
- package/dist/commons/events/FieldType.d.ts +4 -26
- package/dist/commons/events/FieldTypeMapping.d.ts +906 -314
- package/dist/commons/events/FieldValue.d.ts +527 -149
- package/dist/commons/events/FileUtils.d.ts +2 -2
- package/dist/commons/events/FormConfig.d.ts +721 -54
- package/dist/commons/events/PageConfig.d.ts +320 -58
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -2
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7480 -2135
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +247 -2
- package/dist/commons/events/index.d.ts +0 -3
- package/dist/commons/events/locations.d.ts +20 -57
- package/dist/commons/events/scopes.d.ts +34 -35
- package/dist/commons/events/state/availableActions.d.ts +2 -7
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +27 -30
- package/dist/commons/events/state/utils.d.ts +172 -190
- package/dist/commons/events/test.utils.d.ts +11 -52
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +443 -374
- package/dist/commons/notification/UserNotifications.d.ts +637 -61
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +14 -302
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2107 -2838
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1770 -2073
- package/dist/scopes/index.d.ts +353 -640
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +300 -340
- package/package.json +8 -18
- package/tsconfig.json +2 -9
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/application-config/index.d.ts +0 -2
- package/dist/application-config/index.d.ts.map +0 -1
- package/dist/application-config/index.js +0 -2128
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -2422
- package/dist/commons/application-config/index.d.ts +0 -84
- package/dist/commons/events/AuditLog.d.ts +0 -405
- package/dist/commons/events/Flag.d.ts +0 -67
- package/dist/commons/events/eventConfigValidation.d.ts +0 -8
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -405
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -753
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -159
- package/dist/migrations/v2.0/index.d.ts +0 -7
- package/dist/migrations/v2.0/index.d.ts.map +0 -1
- package/dist/migrations/v2.0/index.js +0 -2361
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -344
- package/dist/migrations/v2.0/migrate-scopes.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-scopes.js +0 -281
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -268
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +0 -157
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -97
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -110
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -164
- package/dist/migrations/v2.0/rename-api-paths.d.ts +0 -3
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-api-paths.js +0 -188
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +0 -181
- package/opencrvs-toolkit-1.9.13-rc.9f087e5.tgz +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { EventDocument } from '../events/EventDocument';
|
|
2
2
|
import { EventState } from '../events/ActionDocument';
|
|
3
|
-
import { ITokenPayload as TokenPayload } from '../authentication';
|
|
3
|
+
import { ITokenPayload as TokenPayload, Scope } from '../authentication';
|
|
4
4
|
import { PartialSchema as AjvJSONSchemaType } from 'ajv/dist/types/json-schema';
|
|
5
5
|
import { userSerializer } from '../events/serializers/user/serializer';
|
|
6
6
|
import { UUID } from '../uuid';
|
|
7
7
|
import { todayDateTimeValueSerializer } from '../events/serializers/date/serializer';
|
|
8
|
-
import { EventStatus } from '../events/EventMetadata';
|
|
9
8
|
import { FieldReference } from '../events/FieldConfig';
|
|
10
9
|
/** @knipignore */
|
|
11
10
|
export type JSONSchema = {
|
|
@@ -30,11 +29,7 @@ export type FormConditionalParameters = CommonConditionalParameters & {
|
|
|
30
29
|
id: UUID;
|
|
31
30
|
}>;
|
|
32
31
|
};
|
|
33
|
-
export type
|
|
34
|
-
$flags: string[];
|
|
35
|
-
$status: EventStatus;
|
|
36
|
-
};
|
|
37
|
-
export type ConditionalParameters = UserConditionalParameters | EventConditionalParameters | FormConditionalParameters | EventStateConditionalParameters;
|
|
32
|
+
export type ConditionalParameters = UserConditionalParameters | EventConditionalParameters | FormConditionalParameters;
|
|
38
33
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
39
34
|
type AjvJSONSchema = AjvJSONSchemaType<UnionToIntersection<ConditionalParameters>>;
|
|
40
35
|
/**
|
|
@@ -76,7 +71,7 @@ export declare const now: typeof todayDateTimeValueSerializer;
|
|
|
76
71
|
* Generate conditional rules for user.
|
|
77
72
|
*/
|
|
78
73
|
export declare const user: typeof userSerializer & {
|
|
79
|
-
hasScope: (scope:
|
|
74
|
+
hasScope: (scope: Scope) => JSONSchema;
|
|
80
75
|
hasRole: (role: string) => JSONSchema;
|
|
81
76
|
isOnline: () => JSONSchema;
|
|
82
77
|
locationLevel: (adminLevelId: string) => {
|
|
@@ -84,28 +79,9 @@ export declare const user: typeof userSerializer & {
|
|
|
84
79
|
$location: string;
|
|
85
80
|
};
|
|
86
81
|
};
|
|
87
|
-
scope: (scope: import("../scopes").ScopeType) => {
|
|
88
|
-
attribute: (option: import("../scopes").ScopeOptionKey) => {
|
|
89
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
90
|
-
$option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
jurisdiction: (jurisdiction: import("../scopes").JurisdictionFilter | {
|
|
94
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
95
|
-
$option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
96
|
-
}) => {
|
|
97
|
-
$jurisdiction: "administrativeArea" | "location" | "all" | {
|
|
98
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
99
|
-
$option: "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
82
|
};
|
|
103
83
|
export declare function isFieldReference(value: unknown): value is FieldReference;
|
|
104
84
|
export declare function isEventFieldReference(value: unknown): value is FieldReference;
|
|
105
|
-
/** Check if an event flag is present */
|
|
106
|
-
export declare function flag(flagvalue: string): JSONSchema;
|
|
107
|
-
/** Check if an event flag is present */
|
|
108
|
-
export declare function status(statusValue: EventStatus): JSONSchema;
|
|
109
85
|
/**
|
|
110
86
|
* Generate conditional rules for a form field.
|
|
111
87
|
*
|
|
@@ -7,21 +7,13 @@ import { TranslationConfig } from '../events/TranslationConfig';
|
|
|
7
7
|
import { ITokenPayload } from '../authentication';
|
|
8
8
|
import { UUID } from '../uuid';
|
|
9
9
|
import { FormState } from '../events/utils';
|
|
10
|
-
import { ActionConfig } from '../events/ActionConfig';
|
|
11
10
|
import { ActionType } from '../events/ActionType';
|
|
12
|
-
import { EventConfig } from '../events/EventConfig';
|
|
13
11
|
import { EventDocument } from '../events/EventDocument';
|
|
14
|
-
import { EventIndex } from '../events/EventIndex';
|
|
15
|
-
/**
|
|
16
|
-
* Precompiles action conditional schemas from the event configurations to improve performance of condition validation later on.
|
|
17
|
-
* Best called once on application startup before any condition validation is done.
|
|
18
|
-
*/
|
|
19
|
-
export declare function precompileActionSchemas(eventConfigurations: EventConfig[]): void;
|
|
20
12
|
export declare function validate(schema: JSONSchema, data: ConditionalParameters): boolean;
|
|
21
13
|
export declare function validateValue(schema: JSONSchema, data: unknown): boolean;
|
|
22
14
|
export declare function isOnline(): boolean;
|
|
23
|
-
export declare function isConditionMet(conditional: JSONSchema, values: EventState | ActionUpdate, context: ValidatorContext
|
|
24
|
-
export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, FieldValue>, context: ValidatorContext
|
|
15
|
+
export declare function isConditionMet(conditional: JSONSchema, values: EventState | ActionUpdate, context: ValidatorContext): boolean;
|
|
16
|
+
export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, FieldValue>, context: ValidatorContext): boolean;
|
|
25
17
|
export type ValidatorContext = {
|
|
26
18
|
user?: ITokenPayload;
|
|
27
19
|
leafAdminStructureLocationIds?: Array<{
|
|
@@ -32,9 +24,6 @@ export type ValidatorContext = {
|
|
|
32
24
|
export declare function isFieldVisible(field: FieldConfig, form: Partial<ActionUpdate | EventState>, context: ValidatorContext): boolean;
|
|
33
25
|
export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
|
|
34
26
|
export declare function isFieldDisplayedOnReview(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
|
|
35
|
-
export declare function isActionEnabled(actionConfig: ActionConfig, event: EventIndex, context: ValidatorContext): boolean;
|
|
36
|
-
export declare function isActionVisible(actionConfig: ActionConfig, event: EventIndex, context: ValidatorContext): boolean;
|
|
37
|
-
export declare function isActionAvailable(actionConfig: ActionConfig, event: EventIndex, context: ValidatorContext): boolean;
|
|
38
27
|
export declare const errorMessages: {
|
|
39
28
|
hiddenField: {
|
|
40
29
|
id: string;
|