@opencrvs/toolkit 1.8.0-rc.ff0a1b5 → 1.8.0-rc.ff1f8e0

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 (38) hide show
  1. package/dist/commons/api/router.d.ts +8086 -3911
  2. package/dist/commons/conditionals/conditionals.d.ts +7 -6
  3. package/dist/commons/events/ActionConfig.d.ts +22281 -7289
  4. package/dist/commons/events/ActionDocument.d.ts +533 -346
  5. package/dist/commons/events/ActionInput.d.ts +197 -125
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +603 -12
  7. package/dist/commons/events/Constants.d.ts +2 -0
  8. package/dist/commons/events/CountryConfigQueryInput.d.ts +2982 -0
  9. package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
  10. package/dist/commons/events/Draft.d.ts +29 -24
  11. package/dist/commons/events/EventConfig.d.ts +17241 -9571
  12. package/dist/commons/events/EventDocument.d.ts +386 -267
  13. package/dist/commons/events/EventIndex.d.ts +343 -466
  14. package/dist/commons/events/EventInput.d.ts +0 -13
  15. package/dist/commons/events/EventMetadata.d.ts +72 -48
  16. package/dist/commons/events/FieldConfig.d.ts +991 -428
  17. package/dist/commons/events/FieldTypeMapping.d.ts +5 -2
  18. package/dist/commons/events/FieldValue.d.ts +2 -0
  19. package/dist/commons/events/FormConfig.d.ts +7190 -3722
  20. package/dist/commons/events/PageConfig.d.ts +1512 -660
  21. package/dist/commons/events/User.d.ts +31 -7
  22. package/dist/commons/events/WorkqueueColumnConfig.d.ts +53 -0
  23. package/dist/commons/events/WorkqueueConfig.d.ts +3506 -239
  24. package/dist/commons/events/defineConfig.d.ts +1632 -574
  25. package/dist/commons/events/event.d.ts +37 -10
  26. package/dist/commons/events/field.d.ts +25 -20
  27. package/dist/commons/events/index.d.ts +4 -0
  28. package/dist/commons/events/scopes.d.ts +20 -1
  29. package/dist/commons/events/serializer.d.ts +2 -0
  30. package/dist/commons/events/test.utils.d.ts +28 -7
  31. package/dist/commons/events/transactions.d.ts +1 -1
  32. package/dist/commons/events/utils.d.ts +443 -291
  33. package/dist/commons/events/workqueueDefaultColumns.d.ts +3 -0
  34. package/dist/conditionals/index.js +28 -8
  35. package/dist/events/index.js +2153 -865
  36. package/dist/scopes/index.d.ts +94 -6
  37. package/dist/scopes/index.js +42 -21
  38. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { WorkqueueColumn } from './WorkqueueColumnConfig';
2
+ export declare const defaultWorkqueueColumns: WorkqueueColumn[];
3
+ //# sourceMappingURL=workqueueDefaultColumns.d.ts.map
@@ -33,6 +33,23 @@ __export(conditionals_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(conditionals_exports);
35
35
 
36
+ // ../commons/src/events/serializers/user/serializer.ts
37
+ var import_zod = require("zod");
38
+ var SerializedUserField = import_zod.z.object({
39
+ $userField: import_zod.z.enum([
40
+ "id",
41
+ "name",
42
+ "role",
43
+ "signatureFilename",
44
+ "primaryOfficeId"
45
+ ])
46
+ });
47
+ function userSerializer(userField) {
48
+ return {
49
+ $userField: userField
50
+ };
51
+ }
52
+
36
53
  // ../commons/src/conditionals/conditionals.ts
37
54
  function defineConditional(schema) {
38
55
  return schema;
@@ -74,7 +91,7 @@ function not(condition) {
74
91
  function never() {
75
92
  return not(alwaysTrue());
76
93
  }
77
- var user = {
94
+ var user = Object.assign(userSerializer, {
78
95
  hasScope: (scope) => defineConditional({
79
96
  type: "object",
80
97
  properties: {
@@ -94,7 +111,7 @@ var user = {
94
111
  },
95
112
  required: ["$user"]
96
113
  })
97
- };
114
+ });
98
115
  function createEventConditionals() {
99
116
  return {
100
117
  /**
@@ -145,7 +162,7 @@ function getDateRangeToFieldReference(fieldId, comparedFieldId, clause) {
145
162
  };
146
163
  }
147
164
  function isFieldReference(value) {
148
- return typeof value === "object" && value !== null && "_fieldId" in value;
165
+ return typeof value === "object" && value !== null && "$$field" in value;
149
166
  }
150
167
  function createFieldConditionals(fieldId) {
151
168
  const getDateRange = (date, clause) => ({
@@ -160,6 +177,10 @@ function createFieldConditionals(fieldId) {
160
177
  required: [fieldId]
161
178
  });
162
179
  return {
180
+ /**
181
+ * @private Internal property used for field reference tracking.
182
+ */
183
+ $$field: fieldId,
163
184
  isAfter: () => ({
164
185
  days: (days) => ({
165
186
  inPast: () => defineFormConditional(
@@ -171,7 +192,7 @@ function createFieldConditionals(fieldId) {
171
192
  }),
172
193
  date: (date) => {
173
194
  if (isFieldReference(date)) {
174
- const comparedFieldId = date._fieldId;
195
+ const comparedFieldId = date.$$field;
175
196
  return defineFormConditional(
176
197
  getDateRangeToFieldReference(
177
198
  fieldId,
@@ -195,7 +216,7 @@ function createFieldConditionals(fieldId) {
195
216
  }),
196
217
  date: (date) => {
197
218
  if (isFieldReference(date)) {
198
- const comparedFieldId = date._fieldId;
219
+ const comparedFieldId = date.$$field;
199
220
  return defineFormConditional(
200
221
  getDateRangeToFieldReference(
201
222
  fieldId,
@@ -210,7 +231,7 @@ function createFieldConditionals(fieldId) {
210
231
  }),
211
232
  isEqualTo: (value) => {
212
233
  if (isFieldReference(value)) {
213
- const comparedFieldId = value._fieldId;
234
+ const comparedFieldId = value.$$field;
214
235
  return defineFormConditional({
215
236
  type: "object",
216
237
  properties: {
@@ -326,7 +347,6 @@ function createFieldConditionals(fieldId) {
326
347
  }
327
348
  },
328
349
  required: [fieldId]
329
- }),
330
- getId: () => ({ fieldId })
350
+ })
331
351
  };
332
352
  }