@opencrvs/toolkit 1.9.3-rc.a8532b8 → 1.9.3-rc.ae9ad24

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.
@@ -6,7 +6,7 @@ import { FieldUpdateValue, FieldValue } from '../events/FieldValue';
6
6
  import { TranslationConfig } from '../events/TranslationConfig';
7
7
  import { ITokenPayload } from '../authentication';
8
8
  import { UUID } from '../uuid';
9
- import { ActionType } from '../client';
9
+ import { ActionType, EventDocument } from '../client';
10
10
  export declare function validate(schema: JSONSchema, data: ConditionalParameters): boolean;
11
11
  export declare function validateValue(schema: JSONSchema, data: unknown): boolean;
12
12
  export declare function isOnline(): boolean;
@@ -17,6 +17,7 @@ export type ValidatorContext = {
17
17
  leafAdminStructureLocationIds?: Array<{
18
18
  id: UUID;
19
19
  }>;
20
+ event?: EventDocument;
20
21
  };
21
22
  export declare function isFieldVisible(field: FieldConfig, form: Partial<ActionUpdate | EventState>, context: ValidatorContext): boolean;
22
23
  export declare function isFieldEnabled(field: FieldConfig, form: ActionUpdate | EventState, context: ValidatorContext): boolean;
@@ -3303,7 +3303,8 @@ function isConditionMet(conditional, values, context) {
3303
3303
  $now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
3304
3304
  $online: isOnline(),
3305
3305
  $user: context.user,
3306
- $leafAdminStructureLocationIds: context.leafAdminStructureLocationIds ?? []
3306
+ $leafAdminStructureLocationIds: context.leafAdminStructureLocationIds ?? [],
3307
+ $event: context.event
3307
3308
  });
3308
3309
  }
3309
3310
  function getConditionalActionsForField(field3, values) {
@@ -3329,7 +3330,8 @@ function isFieldConditionMet(field3, form, conditionalType, context) {
3329
3330
  $now: (0, import_date_fns.formatISO)(/* @__PURE__ */ new Date(), { representation: "date" }),
3330
3331
  $online: isOnline(),
3331
3332
  $user: context.user,
3332
- $leafAdminStructureLocationIds: context.leafAdminStructureLocationIds ?? []
3333
+ $leafAdminStructureLocationIds: context.leafAdminStructureLocationIds ?? [],
3334
+ $event: context.event
3333
3335
  });
3334
3336
  return validConditionals.includes(conditionalType);
3335
3337
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.9.3-rc.a8532b8",
3
+ "version": "1.9.3-rc.ae9ad24",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {