@opencrvs/toolkit 1.9.13-rc.fc5374d → 2.0.0-rc.e0918cb
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 +13 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/application-config/index.d.ts +2 -0
- package/dist/application-config/index.d.ts.map +1 -0
- package/dist/application-config/index.js +2128 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3633 -0
- package/dist/commons/api/router.d.ts +3438 -2300
- package/dist/commons/application-config/index.d.ts +84 -0
- package/dist/commons/conditionals/conditionals.d.ts +27 -3
- package/dist/commons/conditionals/validate.d.ts +13 -3
- package/dist/commons/events/ActionConfig.d.ts +415 -1555
- package/dist/commons/events/ActionDocument.d.ts +888 -1941
- package/dist/commons/events/ActionInput.d.ts +277 -1073
- package/dist/commons/events/ActionType.d.ts +91 -11
- package/dist/commons/events/AdvancedSearchConfig.d.ts +294 -1496
- package/dist/commons/events/AuditLog.d.ts +405 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +30 -190
- package/dist/commons/events/Conditional.d.ts +26 -38
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +1592 -4471
- package/dist/commons/events/DeduplicationConfig.d.ts +15 -171
- package/dist/commons/events/Draft.d.ts +72 -107
- package/dist/commons/events/DynamicFieldValue.d.ts +12 -78
- package/dist/commons/events/EventConfig.d.ts +37 -2420
- package/dist/commons/events/EventConfigInput.d.ts +0 -3
- package/dist/commons/events/EventDocument.d.ts +354 -1366
- package/dist/commons/events/EventIndex.d.ts +212 -1010
- package/dist/commons/events/EventInput.d.ts +3 -8
- package/dist/commons/events/EventMetadata.d.ts +130 -357
- package/dist/commons/events/FieldConfig.d.ts +2892 -12892
- package/dist/commons/events/FieldType.d.ts +26 -4
- package/dist/commons/events/FieldTypeMapping.d.ts +314 -906
- package/dist/commons/events/FieldValue.d.ts +149 -527
- package/dist/commons/events/FileUtils.d.ts +2 -2
- package/dist/commons/events/Flag.d.ts +67 -0
- package/dist/commons/events/FormConfig.d.ts +54 -721
- package/dist/commons/events/PageConfig.d.ts +58 -320
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/SummaryConfig.d.ts +14 -161
- package/dist/commons/events/TemplateConfig.d.ts +2 -3
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +74 -37
- package/dist/commons/events/WorkqueueConfig.d.ts +2208 -7553
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +2 -247
- package/dist/commons/events/eventConfigValidation.d.ts +8 -0
- package/dist/commons/events/index.d.ts +3 -0
- package/dist/commons/events/locations.d.ts +57 -20
- package/dist/commons/events/scopes.d.ts +36 -35
- package/dist/commons/events/state/availableActions.d.ts +7 -2
- package/dist/commons/events/state/flags.d.ts +21 -3
- package/dist/commons/events/state/index.d.ts +30 -27
- package/dist/commons/events/state/utils.d.ts +190 -172
- package/dist/commons/events/test.utils.d.ts +52 -11
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +373 -273
- package/dist/commons/notification/UserNotifications.d.ts +61 -637
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +302 -14
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2860 -2115
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +405 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +3 -0
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -0
- package/dist/migrations/v2.0/checkout-upstream-files.js +143 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +2 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +829 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +3 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +1 -0
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +159 -0
- package/dist/migrations/v2.0/create-events-index.d.ts +3 -0
- package/dist/migrations/v2.0/create-events-index.d.ts.map +1 -0
- package/dist/migrations/v2.0/create-events-index.js +326 -0
- package/dist/migrations/v2.0/index.d.ts +7 -0
- package/dist/migrations/v2.0/index.d.ts.map +1 -0
- package/dist/migrations/v2.0/index.js +3572 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +3 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -0
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +344 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-scopes.js +282 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +268 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +3 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -0
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +237 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +3 -0
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-delete-actions.js +157 -0
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +3 -0
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-demo-scope.js +75 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +3 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-deprecated-imports.js +97 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +3 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-hearth-migrations.js +78 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +3 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +110 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +3 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +1 -0
- package/dist/migrations/v2.0/remove-review-from-register-action.js +164 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts +3 -0
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-api-paths.js +188 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +3 -0
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +1 -0
- package/dist/migrations/v2.0/rename-location-parent-id.js +181 -0
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +3 -0
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +1 -0
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +196 -0
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +2076 -1767
- package/dist/scopes/index.d.ts +640 -353
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +340 -300
- package/opencrvs-toolkit-2.0.0-rc.e0918cb.tgz +0 -0
- package/package.json +18 -8
- package/tsconfig.json +12 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/commons/events/CreatedAtLocation.d.ts +0 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { FieldConfig } from './events/FieldConfig';
|
|
3
|
+
export declare const SearchCriteria: z.ZodEnum<{
|
|
4
|
+
NAME: "NAME";
|
|
5
|
+
EMAIL: "EMAIL";
|
|
6
|
+
TRACKING_ID: "TRACKING_ID";
|
|
7
|
+
REGISTRATION_NUMBER: "REGISTRATION_NUMBER";
|
|
8
|
+
NATIONAL_ID: "NATIONAL_ID";
|
|
9
|
+
PHONE_NUMBER: "PHONE_NUMBER";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const ApplicationConfig: z.ZodObject<{
|
|
12
|
+
APPLICATION_NAME: z.ZodString;
|
|
13
|
+
COUNTRY_LOGO: z.ZodObject<{
|
|
14
|
+
fileName: z.ZodString;
|
|
15
|
+
file: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
SYSTEM_IANA_TIMEZONE: z.ZodString;
|
|
18
|
+
CURRENCY: z.ZodObject<{
|
|
19
|
+
languagesAndCountry: z.ZodArray<z.ZodString>;
|
|
20
|
+
isoCode: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
ADMIN_STRUCTURE: z.ZodArray<z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
label: z.ZodObject<import("./events/TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
PHONE_NUMBER_PATTERN: z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
|
|
27
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
|
|
28
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
|
|
29
|
+
SEARCH_DEFAULT_CRITERIA: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
NAME: "NAME";
|
|
31
|
+
EMAIL: "EMAIL";
|
|
32
|
+
TRACKING_ID: "TRACKING_ID";
|
|
33
|
+
REGISTRATION_NUMBER: "REGISTRATION_NUMBER";
|
|
34
|
+
NATIONAL_ID: "NATIONAL_ID";
|
|
35
|
+
PHONE_NUMBER: "PHONE_NUMBER";
|
|
36
|
+
}>>>;
|
|
37
|
+
ADDITIONAL_USER_FIELDS: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodType<FieldConfig, import("./events/FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./events/FieldConfig").FieldConfigInput>>>>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type ApplicationConfig = z.infer<typeof ApplicationConfig>;
|
|
40
|
+
export declare const defineApplicationConfig: (config: z.input<typeof ApplicationConfig>) => ApplicationConfig;
|
|
41
|
+
export declare const BackgroundConfig: z.ZodObject<{
|
|
42
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
43
|
+
backgroundImage: z.ZodOptional<z.ZodString>;
|
|
44
|
+
imageFit: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export declare const LoginConfig: z.ZodObject<{
|
|
47
|
+
COUNTRY: z.ZodString;
|
|
48
|
+
LANGUAGES: z.ZodArray<z.ZodString>;
|
|
49
|
+
USER_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
|
|
50
|
+
INFORMANT_NOTIFICATION_DELIVERY_METHOD: z.ZodString;
|
|
51
|
+
PHONE_NUMBER_PATTERN: z.ZodUnion<[z.ZodString, z.ZodCustom<RegExp, RegExp>]>;
|
|
52
|
+
LOGIN_BACKGROUND: z.ZodObject<{
|
|
53
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
54
|
+
backgroundImage: z.ZodOptional<z.ZodString>;
|
|
55
|
+
imageFit: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
SENTRY: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type LoginConfig = z.infer<typeof LoginConfig>;
|
|
60
|
+
export declare const defineLoginConfig: (config: z.input<typeof LoginConfig>) => LoginConfig;
|
|
61
|
+
export declare const ClientConfig: z.ZodObject<{
|
|
62
|
+
COUNTRY: z.ZodString;
|
|
63
|
+
LANGUAGES: z.ZodArray<z.ZodString>;
|
|
64
|
+
SENTRY: z.ZodOptional<z.ZodString>;
|
|
65
|
+
REGISTER_BACKGROUND: z.ZodObject<{
|
|
66
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
67
|
+
backgroundImage: z.ZodOptional<z.ZodString>;
|
|
68
|
+
imageFit: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
DASHBOARDS: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
title: z.ZodObject<import("./events/TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
73
|
+
url: z.ZodString;
|
|
74
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
auth: z.ZodLiteral<"REQUEST_AUTH_TOKEN">;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
FEATURES: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
79
|
+
V2_EVENTS: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
80
|
+
}, z.core.$strip>>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export type ClientConfig = z.infer<typeof ClientConfig>;
|
|
83
|
+
export declare const defineClientConfig: (config: z.input<typeof ClientConfig>) => ClientConfig;
|
|
84
|
+
//# sourceMappingURL=application-config.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { EventDocument } from '../events/EventDocument';
|
|
2
2
|
import { EventState } from '../events/ActionDocument';
|
|
3
|
-
import { ITokenPayload as TokenPayload
|
|
3
|
+
import { ITokenPayload as TokenPayload } 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';
|
|
8
9
|
import { FieldReference } from '../events/FieldConfig';
|
|
9
10
|
/** @knipignore */
|
|
10
11
|
export type JSONSchema = {
|
|
@@ -29,7 +30,11 @@ export type FormConditionalParameters = CommonConditionalParameters & {
|
|
|
29
30
|
id: UUID;
|
|
30
31
|
}>;
|
|
31
32
|
};
|
|
32
|
-
export type
|
|
33
|
+
export type EventStateConditionalParameters = CommonConditionalParameters & {
|
|
34
|
+
$flags: string[];
|
|
35
|
+
$status: EventStatus;
|
|
36
|
+
};
|
|
37
|
+
export type ConditionalParameters = UserConditionalParameters | EventConditionalParameters | FormConditionalParameters | EventStateConditionalParameters;
|
|
33
38
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
34
39
|
type AjvJSONSchema = AjvJSONSchemaType<UnionToIntersection<ConditionalParameters>>;
|
|
35
40
|
/**
|
|
@@ -71,7 +76,7 @@ export declare const now: typeof todayDateTimeValueSerializer;
|
|
|
71
76
|
* Generate conditional rules for user.
|
|
72
77
|
*/
|
|
73
78
|
export declare const user: typeof userSerializer & {
|
|
74
|
-
hasScope: (scope:
|
|
79
|
+
hasScope: (scope: string) => JSONSchema;
|
|
75
80
|
hasRole: (role: string) => JSONSchema;
|
|
76
81
|
isOnline: () => JSONSchema;
|
|
77
82
|
locationLevel: (adminLevelId: string) => {
|
|
@@ -79,9 +84,28 @@ export declare const user: typeof userSerializer & {
|
|
|
79
84
|
$location: string;
|
|
80
85
|
};
|
|
81
86
|
};
|
|
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
|
+
};
|
|
82
102
|
};
|
|
83
103
|
export declare function isFieldReference(value: unknown): value is FieldReference;
|
|
84
104
|
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;
|
|
85
109
|
/**
|
|
86
110
|
* Generate conditional rules for a form field.
|
|
87
111
|
*
|
|
@@ -7,24 +7,34 @@ 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';
|
|
10
11
|
import { ActionType } from '../events/ActionType';
|
|
12
|
+
import { EventConfig } from '../events/EventConfig';
|
|
11
13
|
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;
|
|
12
20
|
export declare function validate(schema: JSONSchema, data: ConditionalParameters): boolean;
|
|
13
21
|
export declare function validateValue(schema: JSONSchema, data: unknown): boolean;
|
|
14
22
|
export declare function isOnline(): boolean;
|
|
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;
|
|
23
|
+
export declare function isConditionMet(conditional: JSONSchema, values: EventState | ActionUpdate, context: ValidatorContext, eventIndex?: EventIndex): boolean;
|
|
24
|
+
export declare function areConditionsMet(conditions: FieldConditional[], values: Record<string, FieldValue>, context: ValidatorContext, event: EventIndex): boolean;
|
|
17
25
|
export type ValidatorContext = {
|
|
18
26
|
user?: ITokenPayload;
|
|
19
27
|
leafAdminStructureLocationIds?: Array<{
|
|
20
28
|
id: UUID;
|
|
21
29
|
}>;
|
|
22
30
|
event?: EventDocument;
|
|
23
|
-
baseFormState?: EventState;
|
|
24
31
|
};
|
|
25
32
|
export declare function isFieldVisible(field: FieldConfig, form: Partial<ActionUpdate | EventState>, context: ValidatorContext): boolean;
|
|
26
33
|
export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
|
|
27
34
|
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;
|
|
28
38
|
export declare const errorMessages: {
|
|
29
39
|
hiddenField: {
|
|
30
40
|
id: string;
|