@opencrvs/toolkit 2.2.0-rc.ab91cce → 2.2.0-rc.ac299dc

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.
Files changed (32) hide show
  1. package/dist/application-config/index.js +36 -3
  2. package/dist/authentication/index.js +14 -1
  3. package/dist/commons/api/router.d.ts +1374 -71
  4. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  5. package/dist/commons/events/ActionConfig.d.ts +54 -0
  6. package/dist/commons/events/ActionDocument.d.ts +88 -0
  7. package/dist/commons/events/ActionInput.d.ts +52 -0
  8. package/dist/commons/events/ActionType.d.ts +11 -1
  9. package/dist/commons/events/AdvancedSearchConfig.d.ts +18 -0
  10. package/dist/commons/events/AuditLog.d.ts +4 -0
  11. package/dist/commons/events/CountryConfigQueryInput.d.ts +192 -0
  12. package/dist/commons/events/Draft.d.ts +2 -0
  13. package/dist/commons/events/EventDocument.d.ts +88 -0
  14. package/dist/commons/events/EventIndex.d.ts +41 -0
  15. package/dist/commons/events/EventMetadata.d.ts +23 -0
  16. package/dist/commons/events/EventStatus.d.ts +1 -0
  17. package/dist/commons/events/FieldConfig.d.ts +10 -0
  18. package/dist/commons/events/WorkqueueConfig.d.ts +216 -10
  19. package/dist/commons/events/field.d.ts +5 -0
  20. package/dist/commons/events/scopes.d.ts +2 -0
  21. package/dist/commons/events/state/index.d.ts +10 -2
  22. package/dist/commons/events/state/utils.d.ts +11 -1
  23. package/dist/commons/events/test.utils.d.ts +23 -1
  24. package/dist/commons/events/utils.d.ts +29 -1
  25. package/dist/conditionals/index.js +14 -1
  26. package/dist/events/index.js +134 -8
  27. package/dist/notification/index.js +91 -5
  28. package/dist/scopes/index.d.ts +29 -6
  29. package/dist/scopes/index.js +14 -1
  30. package/opencrvs-toolkit-2.2.0-rc.ac299dc.tgz +0 -0
  31. package/package.json +1 -1
  32. package/opencrvs-toolkit-2.2.0-rc.ab91cce.tgz +0 -0
@@ -162,6 +162,8 @@ var ActionType = {
162
162
  REQUEST_CORRECTION: "REQUEST_CORRECTION",
163
163
  REJECT_CORRECTION: "REJECT_CORRECTION",
164
164
  APPROVE_CORRECTION: "APPROVE_CORRECTION",
165
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION",
166
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION",
165
167
  // General actions
166
168
  READ: "READ",
167
169
  ASSIGN: "ASSIGN",
@@ -181,6 +183,8 @@ var ConfirmableActions = [
181
183
  ActionType.REQUEST_CORRECTION,
182
184
  ActionType.APPROVE_CORRECTION,
183
185
  ActionType.REJECT_CORRECTION,
186
+ ActionType.REVOKE_REGISTRATION,
187
+ ActionType.REINSTATE_REGISTRATION,
184
188
  ActionType.CUSTOM
185
189
  ];
186
190
  var ActionTypes = z6.enum([
@@ -200,6 +204,8 @@ var ActionTypes = z6.enum([
200
204
  "REQUEST_CORRECTION",
201
205
  "REJECT_CORRECTION",
202
206
  "APPROVE_CORRECTION",
207
+ "REVOKE_REGISTRATION",
208
+ "REINSTATE_REGISTRATION",
203
209
  "READ",
204
210
  "ASSIGN",
205
211
  "UNASSIGN",
@@ -238,7 +244,9 @@ var WorkqueueActionType = ActionTypes.extract([
238
244
  ActionType.ARCHIVE,
239
245
  ActionType.UNARCHIVE,
240
246
  ActionType.PRINT_CERTIFICATE,
241
- ActionType.REQUEST_CORRECTION
247
+ ActionType.REQUEST_CORRECTION,
248
+ ActionType.REVOKE_REGISTRATION,
249
+ ActionType.REINSTATE_REGISTRATION
242
250
  ]);
243
251
  var META_ACTIONS = [
244
252
  ActionType.ASSIGN,
@@ -390,6 +398,7 @@ var EventStatus = z10.enum([
390
398
  "NOTIFIED",
391
399
  "DECLARED",
392
400
  "REGISTERED",
401
+ "REVOKED",
393
402
  "ARCHIVED"
394
403
  ]);
395
404
 
@@ -413,6 +422,8 @@ var RecordScopeTypeV2 = z11.enum([
413
422
  "record.print-certified-copies",
414
423
  "record.request-correction",
415
424
  "record.correct",
425
+ "record.revoke-registration",
426
+ "record.reinstate-registration",
416
427
  "record.unassign-others",
417
428
  "record.custom-action",
418
429
  "record.action.accept",
@@ -539,6 +550,8 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
539
550
  "record.read",
540
551
  "record.request-correction",
541
552
  "record.correct",
553
+ "record.revoke-registration",
554
+ "record.reinstate-registration",
542
555
  "record.unassign-others",
543
556
  "record.review-duplicates"
544
557
  ]);
@@ -180,6 +180,7 @@ __export(events_exports, {
180
180
  NameFieldUpdateValue: () => NameFieldUpdateValue,
181
181
  NameFieldValue: () => NameFieldValue,
182
182
  NonEmptyTextValue: () => NonEmptyTextValue,
183
+ NoneOfStatus: () => NoneOfStatus,
183
184
  NotifyActionInput: () => NotifyActionInput,
184
185
  NumberFieldValue: () => NumberFieldValue,
185
186
  NumberWithUnitFieldUpdateValue: () => NumberWithUnitFieldUpdateValue,
@@ -203,10 +204,12 @@ __export(events_exports, {
203
204
  RegisterAction: () => RegisterAction,
204
205
  RegisterActionInput: () => RegisterActionInput,
205
206
  RegistrationCreationMetadata: () => RegistrationCreationMetadata,
207
+ ReinstateRegistrationActionInput: () => ReinstateRegistrationActionInput,
206
208
  RejectCorrectionActionInput: () => RejectCorrectionActionInput,
207
209
  RejectDeclarationActionInput: () => RejectDeclarationActionInput,
208
210
  RejectedCorrectionAction: () => RejectedCorrectionAction,
209
211
  RequestCorrectionActionInput: () => RequestCorrectionActionInput,
212
+ RevokeRegistrationActionInput: () => RevokeRegistrationActionInput,
210
213
  SearchQuery: () => SearchQuery,
211
214
  SearchQueryParams: () => SearchQueryParams,
212
215
  SeededLocationVersions: () => SeededLocationVersions,
@@ -530,6 +533,8 @@ var ActionType = {
530
533
  REQUEST_CORRECTION: "REQUEST_CORRECTION",
531
534
  REJECT_CORRECTION: "REJECT_CORRECTION",
532
535
  APPROVE_CORRECTION: "APPROVE_CORRECTION",
536
+ REVOKE_REGISTRATION: "REVOKE_REGISTRATION",
537
+ REINSTATE_REGISTRATION: "REINSTATE_REGISTRATION",
533
538
  // General actions
534
539
  READ: "READ",
535
540
  ASSIGN: "ASSIGN",
@@ -549,6 +554,8 @@ var ConfirmableActions = [
549
554
  ActionType.REQUEST_CORRECTION,
550
555
  ActionType.APPROVE_CORRECTION,
551
556
  ActionType.REJECT_CORRECTION,
557
+ ActionType.REVOKE_REGISTRATION,
558
+ ActionType.REINSTATE_REGISTRATION,
552
559
  ActionType.CUSTOM
553
560
  ];
554
561
  var ActionTypes = z2.enum([
@@ -568,6 +575,8 @@ var ActionTypes = z2.enum([
568
575
  "REQUEST_CORRECTION",
569
576
  "REJECT_CORRECTION",
570
577
  "APPROVE_CORRECTION",
578
+ "REVOKE_REGISTRATION",
579
+ "REINSTATE_REGISTRATION",
571
580
  "READ",
572
581
  "ASSIGN",
573
582
  "UNASSIGN",
@@ -609,7 +618,9 @@ var WorkqueueActionType = ActionTypes.extract([
609
618
  ActionType.ARCHIVE,
610
619
  ActionType.UNARCHIVE,
611
620
  ActionType.PRINT_CERTIFICATE,
612
- ActionType.REQUEST_CORRECTION
621
+ ActionType.REQUEST_CORRECTION,
622
+ ActionType.REVOKE_REGISTRATION,
623
+ ActionType.REINSTATE_REGISTRATION
613
624
  ]);
614
625
  var META_ACTIONS = [
615
626
  ActionType.ASSIGN,
@@ -764,6 +775,7 @@ var EventStatus = z6.enum([
764
775
  "NOTIFIED",
765
776
  "DECLARED",
766
777
  "REGISTERED",
778
+ "REVOKED",
767
779
  "ARCHIVED"
768
780
  ]);
769
781
 
@@ -787,6 +799,8 @@ var RecordScopeTypeV2 = z7.enum([
787
799
  "record.print-certified-copies",
788
800
  "record.request-correction",
789
801
  "record.correct",
802
+ "record.revoke-registration",
803
+ "record.reinstate-registration",
790
804
  "record.unassign-others",
791
805
  "record.custom-action",
792
806
  "record.action.accept",
@@ -913,6 +927,8 @@ var ScopesWithFullOptions = RecordScopeTypeV2.extract([
913
927
  "record.read",
914
928
  "record.request-correction",
915
929
  "record.correct",
930
+ "record.revoke-registration",
931
+ "record.reinstate-registration",
916
932
  "record.unassign-others",
917
933
  "record.review-duplicates"
918
934
  ]);
@@ -1157,6 +1173,8 @@ var EventActionEntrySchema = AuditLogEntryBase.extend({
1157
1173
  "event.actions.correction.request.request",
1158
1174
  "event.actions.correction.approve.request",
1159
1175
  "event.actions.correction.reject.request",
1176
+ "event.actions.revoke_registration.request",
1177
+ "event.actions.reinstate_registration.request",
1160
1178
  "event.actions.mark_as_duplicate.request",
1161
1179
  "event.actions.mark_as_not_duplicate.request"
1162
1180
  ]),
@@ -1911,6 +1929,16 @@ var UnarchiveAction = ActionBase.extend(
1911
1929
  type: z16.literal(ActionType.UNARCHIVE)
1912
1930
  }).shape
1913
1931
  );
1932
+ var RevokeRegistrationAction = ActionBase.extend(
1933
+ z16.object({
1934
+ type: z16.literal(ActionType.REVOKE_REGISTRATION)
1935
+ }).shape
1936
+ );
1937
+ var ReinstateRegistrationAction = ActionBase.extend(
1938
+ z16.object({
1939
+ type: z16.literal(ActionType.REINSTATE_REGISTRATION)
1940
+ }).shape
1941
+ );
1914
1942
  var CreatedAction = ActionBase.extend(
1915
1943
  z16.object({
1916
1944
  type: z16.literal(ActionType.CREATE)
@@ -1979,6 +2007,8 @@ var ActionDocument = z16.discriminatedUnion("type", [
1979
2007
  MarkAsDuplicateAction.meta({ id: "MarkAsDuplicateAction" }),
1980
2008
  ArchiveAction.meta({ id: "ArchiveAction" }),
1981
2009
  UnarchiveAction.meta({ id: "UnarchiveAction" }),
2010
+ RevokeRegistrationAction.meta({ id: "RevokeRegistrationAction" }),
2011
+ ReinstateRegistrationAction.meta({ id: "ReinstateRegistrationAction" }),
1982
2012
  NotifiedAction.meta({ id: "NotifiedAction" }),
1983
2013
  RegisterAction.meta({ id: "RegisterAction" }),
1984
2014
  DeclareAction.meta({ id: "DeclareAction" }),
@@ -2027,7 +2057,8 @@ var RegistrationCreationMetadata = ActionCreationMetadata.extend({
2027
2057
  var LegalStatuses = z17.object({
2028
2058
  [EventStatus.enum.NOTIFIED]: ActionCreationMetadata.nullish(),
2029
2059
  [EventStatus.enum.DECLARED]: ActionCreationMetadata.nullish(),
2030
- [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish()
2060
+ [EventStatus.enum.REGISTERED]: RegistrationCreationMetadata.nullish(),
2061
+ [EventStatus.enum.REVOKED]: ActionCreationMetadata.nullish()
2031
2062
  });
2032
2063
  var EventMetadata = z17.object({
2033
2064
  id: UUID,
@@ -2229,6 +2260,12 @@ var AnyOfStatus = import_v4.z.object({
2229
2260
  }).meta({
2230
2261
  id: "AnyOfStatus"
2231
2262
  });
2263
+ var NoneOfStatus = import_v4.z.object({
2264
+ type: import_v4.z.literal("noneOf"),
2265
+ terms: import_v4.z.array(EventStatus)
2266
+ }).meta({
2267
+ id: "NoneOfStatus"
2268
+ });
2232
2269
  var Range = import_v4.z.object({
2233
2270
  type: import_v4.z.literal("range"),
2234
2271
  gte: import_v4.z.string(),
@@ -2269,7 +2306,7 @@ var QueryInput = import_v4.z.lazy(
2269
2306
  var QueryExpression = import_v4.z.object({
2270
2307
  id: import_v4.z.optional(import_v4.z.string()),
2271
2308
  eventType: import_v4.z.string(),
2272
- status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, ExactStatus])),
2309
+ status: import_v4.z.optional(import_v4.z.union([AnyOfStatus, NoneOfStatus, ExactStatus])),
2273
2310
  createdAt: import_v4.z.optional(DateCondition),
2274
2311
  updatedAt: import_v4.z.optional(DateCondition),
2275
2312
  "legalStatuses.DECLARED.createdAtLocation": import_v4.z.optional(Within).nullable(),
@@ -2278,6 +2315,7 @@ var QueryExpression = import_v4.z.object({
2278
2315
  "legalStatuses.REGISTERED.createdAtLocation": import_v4.z.optional(Within).nullable(),
2279
2316
  "legalStatuses.REGISTERED.createdByRole": import_v4.z.optional(AnyOf),
2280
2317
  "legalStatuses.REGISTERED.registrationNumber": import_v4.z.optional(Exact),
2318
+ "legalStatuses.REVOKED.createdAtLocation": import_v4.z.optional(Within).nullable(),
2281
2319
  createdAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
2282
2320
  updatedAtLocation: import_v4.z.optional(import_v4.z.union([Within, Exact])),
2283
2321
  assignedTo: import_v4.z.optional(Exact),
@@ -3561,6 +3599,18 @@ var UnarchiveConfig = ActionConfigBase.extend(
3561
3599
  type: z25.literal(ActionType.UNARCHIVE)
3562
3600
  }).shape
3563
3601
  );
3602
+ var RevokeRegistrationConfig = ActionConfigBase.extend(
3603
+ z25.object({
3604
+ type: z25.literal(ActionType.REVOKE_REGISTRATION),
3605
+ form: actionConfirmationForm
3606
+ }).shape
3607
+ );
3608
+ var ReinstateRegistrationConfig = ActionConfigBase.extend(
3609
+ z25.object({
3610
+ type: z25.literal(ActionType.REINSTATE_REGISTRATION),
3611
+ form: actionConfirmationForm
3612
+ }).shape
3613
+ );
3564
3614
  var EditActionConfig = ActionConfigBase.extend(
3565
3615
  z25.object({
3566
3616
  type: z25.literal(ActionType.EDIT),
@@ -3701,6 +3751,14 @@ var ActionConfig = z25.discriminatedUnion("type", [
3701
3751
  id: "UnarchiveActionConfig",
3702
3752
  description: "Configuration for unarchiving a record."
3703
3753
  }),
3754
+ RevokeRegistrationConfig.meta({
3755
+ id: "RevokeRegistrationActionConfig",
3756
+ description: "Configuration for revoking a registered record."
3757
+ }),
3758
+ ReinstateRegistrationConfig.meta({
3759
+ id: "ReinstateRegistrationActionConfig",
3760
+ description: "Configuration for reinstating a revoked record back to registered."
3761
+ }),
3704
3762
  CustomActionConfig.meta({
3705
3763
  id: "CustomActionConfig",
3706
3764
  description: "Configuration for a country-defined custom action. An event may include any number of these."
@@ -3993,6 +4051,9 @@ var BaseField3 = z30.object({
3993
4051
  ),
3994
4052
  allowedLocations: JurisdictionReference.optional().describe(
3995
4053
  `Override the allowedLocations for a location field in advanced search. Use this when the declaration form's allowedLocations references a scope (e.g. record.create) that search-only users don't have \u2014 specify record.search scope instead.`
4054
+ ),
4055
+ useFormDefaultValue: z30.boolean().optional().describe(
4056
+ `Set to false to open the field empty in advanced search instead of pre-filled with the declaration form's defaultValue.`
3996
4057
  )
3997
4058
  });
3998
4059
  var SearchQueryParams = z30.object({
@@ -4512,6 +4573,8 @@ var updateActions = new Set(
4512
4573
  ActionType.REQUEST_CORRECTION,
4513
4574
  ActionType.APPROVE_CORRECTION,
4514
4575
  ActionType.REJECT_CORRECTION,
4576
+ ActionType.REVOKE_REGISTRATION,
4577
+ ActionType.REINSTATE_REGISTRATION,
4515
4578
  ActionType.CUSTOM
4516
4579
  ]).options
4517
4580
  );
@@ -4538,7 +4601,7 @@ function getActionUpdateMetadata(actions) {
4538
4601
  (0, import_lodash.pick)(createAction, metadataFields)
4539
4602
  );
4540
4603
  }
4541
- function getLegalStatuses(actions) {
4604
+ function getLegalStatuses(actions, status2) {
4542
4605
  return {
4543
4606
  [EventStatus.enum.NOTIFIED]: getDeclarationActionCreationMetadata(
4544
4607
  ActionType.NOTIFY,
@@ -4551,7 +4614,12 @@ function getLegalStatuses(actions) {
4551
4614
  [EventStatus.enum.REGISTERED]: getDeclarationActionCreationMetadata(
4552
4615
  ActionType.REGISTER,
4553
4616
  actions
4554
- )
4617
+ ),
4618
+ // A later reinstate does not remove the revoke action, so only report it while the record is still revoked.
4619
+ [EventStatus.enum.REVOKED]: status2 === EventStatus.enum.REVOKED ? getDeclarationActionCreationMetadata(
4620
+ ActionType.REVOKE_REGISTRATION,
4621
+ actions
4622
+ ) : null
4555
4623
  };
4556
4624
  }
4557
4625
 
@@ -5421,6 +5489,10 @@ function getStatusFromActions(actions) {
5421
5489
  return EventStatus.enum.REGISTERED;
5422
5490
  case ActionType.NOTIFY:
5423
5491
  return EventStatus.enum.NOTIFIED;
5492
+ case ActionType.REVOKE_REGISTRATION:
5493
+ return EventStatus.enum.REVOKED;
5494
+ case ActionType.REINSTATE_REGISTRATION:
5495
+ return EventStatus.enum.REGISTERED;
5424
5496
  // Already filtered out above; listed here only to satisfy exhaustiveness.
5425
5497
  case ActionType.ARCHIVE:
5426
5498
  case ActionType.UNARCHIVE:
@@ -5538,7 +5610,7 @@ function getCurrentEventState(event2, config) {
5538
5610
  const acceptedActionMetadata = getActionUpdateMetadata(acceptedActions);
5539
5611
  const declaration = aggregateActionDeclarations(event2);
5540
5612
  const status2 = getStatusFromActions(sortedActions);
5541
- const legalStatuses = getLegalStatuses(sortedActions);
5613
+ const legalStatuses = getLegalStatuses(sortedActions, status2);
5542
5614
  const base = deepDropNulls({
5543
5615
  id: event2.id,
5544
5616
  type: event2.type,
@@ -7199,7 +7271,7 @@ var SerializableWithin = z37.object({
7199
7271
  });
7200
7272
  var SerializedQueryExpression = z37.object({
7201
7273
  eventType: z37.string(),
7202
- status: z37.optional(z37.union([AnyOfStatus, ExactStatus])),
7274
+ status: z37.optional(z37.union([AnyOfStatus, NoneOfStatus, ExactStatus])),
7203
7275
  createdAt: z37.optional(DateCondition),
7204
7276
  updatedAt: z37.optional(DateCondition),
7205
7277
  "legalStatuses.DECLARED.createdAtLocation": z37.optional(SerializableWithin),
@@ -7208,6 +7280,7 @@ var SerializedQueryExpression = z37.object({
7208
7280
  "legalStatuses.REGISTERED.createdAtLocation": z37.optional(SerializableWithin),
7209
7281
  "legalStatuses.REGISTERED.createdByRole": z37.optional(AnyOf),
7210
7282
  "legalStatuses.REGISTERED.registrationNumber": z37.optional(Exact),
7283
+ "legalStatuses.REVOKED.createdAtLocation": z37.optional(SerializableWithin),
7211
7284
  createdAtLocation: z37.optional(
7212
7285
  z37.union([SerializableWithin, SerializableExact])
7213
7286
  ),
@@ -7440,6 +7513,16 @@ var UnarchiveActionInput = BaseActionInput.extend(
7440
7513
  type: z39.literal(ActionType.UNARCHIVE).default(ActionType.UNARCHIVE)
7441
7514
  }).shape
7442
7515
  );
7516
+ var RevokeRegistrationActionInput = BaseActionInput.extend(
7517
+ z39.object({
7518
+ type: z39.literal(ActionType.REVOKE_REGISTRATION).default(ActionType.REVOKE_REGISTRATION)
7519
+ }).shape
7520
+ );
7521
+ var ReinstateRegistrationActionInput = BaseActionInput.extend(
7522
+ z39.object({
7523
+ type: z39.literal(ActionType.REINSTATE_REGISTRATION).default(ActionType.REINSTATE_REGISTRATION)
7524
+ }).shape
7525
+ );
7443
7526
  var AssignActionInput = BaseActionInput.extend(
7444
7527
  z39.object({
7445
7528
  type: z39.literal(ActionType.ASSIGN),
@@ -7502,6 +7585,12 @@ var ActionInput = z39.discriminatedUnion("type", [
7502
7585
  }),
7503
7586
  ArchiveActionInput.meta({ id: "ArchiveActionInput" }),
7504
7587
  UnarchiveActionInput.meta({ id: "UnarchiveActionInput" }),
7588
+ RevokeRegistrationActionInput.meta({
7589
+ id: "RevokeRegistrationActionInput"
7590
+ }),
7591
+ ReinstateRegistrationActionInput.meta({
7592
+ id: "ReinstateRegistrationActionInput"
7593
+ }),
7505
7594
  AssignActionInput.meta({ id: "AssignActionInput" }),
7506
7595
  UnassignActionInput.meta({ id: "UnassignActionInput" }),
7507
7596
  PrintCertificateActionInput.meta({ id: "PrintCertificateActionInput" }),
@@ -11179,6 +11268,22 @@ function eventPayloadGenerator(rng, configuration = tennisClubMembershipEvent) {
11179
11268
  eventId,
11180
11269
  ...input
11181
11270
  }),
11271
+ revokeRegistration: (eventId, input = {}) => ({
11272
+ type: ActionType.REVOKE_REGISTRATION,
11273
+ transactionId: input.transactionId ?? getUUID(),
11274
+ declaration: {},
11275
+ annotation: {},
11276
+ eventId,
11277
+ ...input
11278
+ }),
11279
+ reinstateRegistration: (eventId, input = {}) => ({
11280
+ type: ActionType.REINSTATE_REGISTRATION,
11281
+ transactionId: input.transactionId ?? getUUID(),
11282
+ declaration: {},
11283
+ annotation: {},
11284
+ eventId,
11285
+ ...input
11286
+ }),
11182
11287
  reject: (eventId, input = {}) => ({
11183
11288
  type: ActionType.REJECT,
11184
11289
  transactionId: input.transactionId ?? getUUID(),
@@ -11347,6 +11452,8 @@ function generateActionDocument({
11347
11452
  case ActionType.REGISTER:
11348
11453
  case ActionType.REQUEST_CORRECTION:
11349
11454
  case ActionType.UNARCHIVE:
11455
+ case ActionType.REVOKE_REGISTRATION:
11456
+ case ActionType.REINSTATE_REGISTRATION:
11350
11457
  return { ...actionBase, type: action };
11351
11458
  case ActionType.EDIT:
11352
11459
  return {
@@ -11715,6 +11822,8 @@ var ACTION_SCOPE_MAP = {
11715
11822
  [ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: ["record.correct"],
11716
11823
  [ActionType.REJECT_CORRECTION]: ["record.correct"],
11717
11824
  [ActionType.APPROVE_CORRECTION]: ["record.correct"],
11825
+ [ActionType.REVOKE_REGISTRATION]: ["record.revoke-registration"],
11826
+ [ActionType.REINSTATE_REGISTRATION]: ["record.reinstate-registration"],
11718
11827
  [ActionType.MARK_AS_DUPLICATE]: ["record.review-duplicates"],
11719
11828
  [ActionType.MARK_AS_NOT_DUPLICATE]: ["record.review-duplicates"],
11720
11829
  [ActionType.ARCHIVE]: ["record.archive"],
@@ -11737,6 +11846,8 @@ var DOCUMENT_DELETE_SCOPES = [
11737
11846
  "record.print-certified-copies",
11738
11847
  "record.request-correction",
11739
11848
  "record.correct",
11849
+ "record.revoke-registration",
11850
+ "record.reinstate-registration",
11740
11851
  "record.review-duplicates",
11741
11852
  "record.archive",
11742
11853
  "record.unarchive",
@@ -11876,6 +11987,10 @@ function deserializeQueryExpression(expression, user2) {
11876
11987
  expression["legalStatuses.REGISTERED.createdAtLocation"].location,
11877
11988
  user2
11878
11989
  ) : void 0;
11990
+ const revokedLocation = expression["legalStatuses.REVOKED.createdAtLocation"] ? userDeserializer(
11991
+ expression["legalStatuses.REVOKED.createdAtLocation"].location,
11992
+ user2
11993
+ ) : void 0;
11879
11994
  return {
11880
11995
  ...expression,
11881
11996
  assignedTo: expression.assignedTo && isDefined(assignedTo) ? { ...expression.assignedTo, term: assignedTo } : void 0,
@@ -11894,6 +12009,10 @@ function deserializeQueryExpression(expression, user2) {
11894
12009
  ["legalStatuses.REGISTERED.createdAtLocation"]: expression["legalStatuses.REGISTERED.createdAtLocation"] && isDefined(registeredLocation) ? {
11895
12010
  ...expression["legalStatuses.REGISTERED.createdAtLocation"],
11896
12011
  location: registeredLocation
12012
+ } : void 0,
12013
+ ["legalStatuses.REVOKED.createdAtLocation"]: expression["legalStatuses.REVOKED.createdAtLocation"] && isDefined(revokedLocation) ? {
12014
+ ...expression["legalStatuses.REVOKED.createdAtLocation"],
12015
+ location: revokedLocation
11897
12016
  } : void 0
11898
12017
  };
11899
12018
  }
@@ -11940,7 +12059,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
11940
12059
  ActionType.APPROVE_CORRECTION,
11941
12060
  ActionType.REJECT_CORRECTION,
11942
12061
  ActionType.CUSTOM,
11943
- ClientSpecificAction.REVIEW_CORRECTION_REQUEST
12062
+ ClientSpecificAction.REVIEW_CORRECTION_REQUEST,
12063
+ ActionType.REVOKE_REGISTRATION
12064
+ ],
12065
+ [EventStatus.enum.REVOKED]: [
12066
+ ActionType.READ,
12067
+ ActionType.REINSTATE_REGISTRATION
11944
12068
  ],
11945
12069
  [EventStatus.enum.ARCHIVED]: [
11946
12070
  ActionType.READ,
@@ -11954,6 +12078,8 @@ var ACTION_FILTERS = {
11954
12078
  [ClientSpecificAction.REVIEW_CORRECTION_REQUEST]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
11955
12079
  [ActionType.APPROVE_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
11956
12080
  [ActionType.REJECT_CORRECTION]: (flags) => flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
12081
+ [ActionType.REVOKE_REGISTRATION]: (flags) => !flags.includes(InherentFlags.CORRECTION_REQUESTED) && !flags.some((flag2) => flag2.endsWith(":requested")),
12082
+ [ActionType.REINSTATE_REGISTRATION]: (flags) => !flags.some((flag2) => flag2.endsWith(":requested")),
11957
12083
  [ActionType.MARK_AS_DUPLICATE]: (flags) => flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
11958
12084
  [ActionType.EDIT]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),
11959
12085
  [ActionType.REGISTER]: (flags) => !flags.includes(InherentFlags.POTENTIAL_DUPLICATE) && !flags.some((flag2) => flag2.endsWith(":requested")),