@opencrvs/toolkit 1.8.1-rc.d31fe05 → 1.8.1-rc.e23b224

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.
@@ -33,14 +33,6 @@ declare function eventFn(fieldId: EventFieldId): {
33
33
  type: "fuzzy";
34
34
  };
35
35
  };
36
- within: () => {
37
- fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
38
- fieldType: "event";
39
- } & {
40
- config: {
41
- type: "within";
42
- };
43
- };
44
36
  };
45
37
  declare const event: typeof eventFn & {
46
38
  /**
@@ -56,20 +56,6 @@ export declare function field(fieldId: string, options?: {
56
56
  type: "fuzzy";
57
57
  };
58
58
  };
59
- within: () => {
60
- options?: SelectOption[];
61
- excludeInSearchQuery?: boolean;
62
- alternateFieldIds?: string[];
63
- conditionals?: FieldConditional[];
64
- validations?: ValidationConfig[];
65
- searchCriteriaLabelPrefix?: TranslationConfig;
66
- fieldId: string;
67
- fieldType: "field";
68
- } & {
69
- config: {
70
- type: "within";
71
- };
72
- };
73
59
  $$field: string;
74
60
  isAfter: () => {
75
61
  days: (days: number) => {
@@ -414,7 +414,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
414
414
  requestId: string;
415
415
  keepAssignment: boolean | undefined;
416
416
  };
417
- reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "reason">>) => {
417
+ reject: (eventId: string, requestId: string, input?: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment">>) => {
418
418
  type: "REJECT_CORRECTION";
419
419
  transactionId: string;
420
420
  declaration: {};
@@ -422,10 +422,6 @@ export declare function eventPayloadGenerator(rng: () => number): {
422
422
  eventId: string;
423
423
  requestId: string;
424
424
  keepAssignment: boolean | undefined;
425
- reason: {
426
- message: string;
427
- isDuplicate?: boolean | undefined;
428
- };
429
425
  };
430
426
  };
431
427
  };
@@ -15520,7 +15520,7 @@ export declare function getEventConfigById(eventConfigs: EventConfig[], id: stri
15520
15520
  title: import("./TranslationConfig").TranslationConfig;
15521
15521
  fields: ({
15522
15522
  config: {
15523
- type: "exact" | "fuzzy" | "range" | "within";
15523
+ type: "exact" | "fuzzy" | "range";
15524
15524
  };
15525
15525
  fieldId: string;
15526
15526
  fieldType: "field";
@@ -15547,7 +15547,7 @@ export declare function getEventConfigById(eventConfigs: EventConfig[], id: stri
15547
15547
  excludeInSearchQuery?: boolean | undefined;
15548
15548
  } | {
15549
15549
  config: {
15550
- type: "exact" | "fuzzy" | "range" | "within";
15550
+ type: "exact" | "fuzzy" | "range";
15551
15551
  };
15552
15552
  fieldId: "status" | "updatedAt" | "trackingId" | "legalStatuses.REGISTERED.acceptedAt" | "legalStatuses.REGISTERED.createdAtLocation";
15553
15553
  fieldType: "event";
@@ -139,6 +139,7 @@ __export(events_exports, {
139
139
  PageConfig: () => PageConfig,
140
140
  PageTypes: () => PageTypes,
141
141
  PrintCertificateActionInput: () => PrintCertificateActionInput,
142
+ PrintDetails: () => PrintDetails,
142
143
  QueryExpression: () => QueryExpression,
143
144
  QueryInput: () => QueryInput,
144
145
  QueryType: () => QueryType,
@@ -1340,7 +1341,7 @@ var SummaryConfig = import_zod14.z.object({
1340
1341
 
1341
1342
  // ../commons/src/events/AdvancedSearchConfig.ts
1342
1343
  var import_zod15 = require("zod");
1343
- var MatchType = import_zod15.z.enum(["fuzzy", "exact", "range", "within"]);
1344
+ var MatchType = import_zod15.z.enum(["fuzzy", "exact", "range"]);
1344
1345
  var BaseField3 = import_zod15.z.object({
1345
1346
  config: import_zod15.z.object({
1346
1347
  type: MatchType.describe("Determines the type of field")
@@ -1902,6 +1903,9 @@ var ActionBase = import_zod19.z.object({
1902
1903
  originalActionId: UUID.optional().nullable().describe(
1903
1904
  "Reference to the original action that was asynchronously rejected or accepted by 3rd party integration."
1904
1905
  )
1906
+ // 'actionDetails' field reserved for additional metadata
1907
+ // Each action can define its own action details specifc to the action
1908
+ // See PrintCertificateAction
1905
1909
  });
1906
1910
  var AssignedAction = ActionBase.merge(
1907
1911
  import_zod19.z.object({
@@ -1961,9 +1965,13 @@ var NotifiedAction = ActionBase.merge(
1961
1965
  type: import_zod19.z.literal(ActionType.NOTIFY)
1962
1966
  })
1963
1967
  );
1968
+ var PrintDetails = import_zod19.z.object({
1969
+ templateId: import_zod19.z.string().optional()
1970
+ });
1964
1971
  var PrintCertificateAction = ActionBase.merge(
1965
1972
  import_zod19.z.object({
1966
- type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE)
1973
+ type: import_zod19.z.literal(ActionType.PRINT_CERTIFICATE),
1974
+ actionDetails: PrintDetails.optional().nullable()
1967
1975
  })
1968
1976
  );
1969
1977
  var RequestedCorrectionAction = ActionBase.merge(
@@ -1980,8 +1988,7 @@ var ApprovedCorrectionAction = ActionBase.merge(
1980
1988
  var RejectedCorrectionAction = ActionBase.merge(
1981
1989
  import_zod19.z.object({
1982
1990
  type: import_zod19.z.literal(ActionType.REJECT_CORRECTION),
1983
- requestId: import_zod19.z.string(),
1984
- reason: RejectionReason
1991
+ requestId: import_zod19.z.string()
1985
1992
  })
1986
1993
  );
1987
1994
  var ReadAction = ActionBase.merge(
@@ -3175,19 +3182,6 @@ function createSearchConfig(baseField) {
3175
3182
  fuzzy: () => ({
3176
3183
  ...baseField,
3177
3184
  config: { type: "fuzzy" }
3178
- }),
3179
- /**
3180
- * Creates a configuration for matching locations and the child locations
3181
- * @returns An object containing the field ID and a configuration object with a type of 'within'.
3182
- * @example field('createdAtLocation').within()
3183
- * // {
3184
- * // ...
3185
- * // config: { type: 'within' }
3186
- * // }
3187
- */
3188
- within: () => ({
3189
- ...baseField,
3190
- config: { type: "within" }
3191
3185
  })
3192
3186
  };
3193
3187
  }
@@ -3890,7 +3884,8 @@ var DeclareActionInput = BaseActionInput.merge(
3890
3884
  );
3891
3885
  var PrintCertificateActionInput = BaseActionInput.merge(
3892
3886
  import_zod29.z.object({
3893
- type: import_zod29.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE)
3887
+ type: import_zod29.z.literal(ActionType.PRINT_CERTIFICATE).default(ActionType.PRINT_CERTIFICATE),
3888
+ actionDetails: PrintDetails.optional()
3894
3889
  })
3895
3890
  );
3896
3891
  var RejectDeclarationActionInput = BaseActionInput.merge(
@@ -3930,8 +3925,7 @@ var RequestCorrectionActionInput = BaseActionInput.merge(
3930
3925
  var RejectCorrectionActionInput = BaseActionInput.merge(
3931
3926
  import_zod29.z.object({
3932
3927
  requestId: import_zod29.z.string(),
3933
- type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
3934
- reason: RejectionReason
3928
+ type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
3935
3929
  })
3936
3930
  );
3937
3931
  var ApproveCorrectionActionInput = BaseActionInput.merge(
@@ -6770,7 +6764,7 @@ function eventPayloadGenerator(rng) {
6770
6764
  requestId,
6771
6765
  keepAssignment: input.keepAssignment
6772
6766
  }),
6773
- reject: (eventId, requestId, input) => ({
6767
+ reject: (eventId, requestId, input = {}) => ({
6774
6768
  type: ActionType.REJECT_CORRECTION,
6775
6769
  transactionId: input.transactionId ?? getUUID(),
6776
6770
  declaration: {},
@@ -6781,8 +6775,7 @@ function eventPayloadGenerator(rng) {
6781
6775
  ),
6782
6776
  eventId,
6783
6777
  requestId,
6784
- keepAssignment: input.keepAssignment,
6785
- reason: input.reason ?? { message: "" }
6778
+ keepAssignment: input.keepAssignment
6786
6779
  })
6787
6780
  }
6788
6781
  }
@@ -6841,8 +6834,7 @@ function generateActionDocument({
6841
6834
  return {
6842
6835
  ...actionBase,
6843
6836
  requestId: getUUID(),
6844
- type: action,
6845
- reason: { message: "Correction rejection" }
6837
+ type: action
6846
6838
  };
6847
6839
  case ActionType.REGISTER:
6848
6840
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.8.1-rc.d31fe05",
3
+ "version": "1.8.1-rc.e23b224",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {