@opencrvs/toolkit 1.8.0-rc.fd8a78f → 1.8.0-rc.fd936ab

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 (41) hide show
  1. package/dist/commons/api/router.d.ts +447 -14227
  2. package/dist/commons/conditionals/conditionals.d.ts +6 -14
  3. package/dist/commons/conditionals/validate.d.ts +6 -10
  4. package/dist/commons/events/ActionConfig.d.ts +1726 -117415
  5. package/dist/commons/events/ActionDocument.d.ts +383 -2305
  6. package/dist/commons/events/ActionInput.d.ts +303 -1583
  7. package/dist/commons/events/ActionType.d.ts +0 -4
  8. package/dist/commons/events/AdvancedSearchConfig.d.ts +22 -1029
  9. package/dist/commons/events/CompositeFieldValue.d.ts +0 -31
  10. package/dist/commons/events/Draft.d.ts +29 -143
  11. package/dist/commons/events/EventConfig.d.ts +1361 -56376
  12. package/dist/commons/events/EventDocument.d.ts +264 -1428
  13. package/dist/commons/events/EventIndex.d.ts +25 -1590
  14. package/dist/commons/events/EventMetadata.d.ts +43 -299
  15. package/dist/commons/events/FieldConfig.d.ts +1060 -5458
  16. package/dist/commons/events/FieldType.d.ts +3 -6
  17. package/dist/commons/events/FieldTypeMapping.d.ts +54 -103
  18. package/dist/commons/events/FieldValue.d.ts +8 -49
  19. package/dist/commons/events/FormConfig.d.ts +524 -49166
  20. package/dist/commons/events/PageConfig.d.ts +208 -12210
  21. package/dist/commons/events/SummaryConfig.d.ts +42 -93
  22. package/dist/commons/events/User.d.ts +2 -31
  23. package/dist/commons/events/WorkqueueConfig.d.ts +20 -4803
  24. package/dist/commons/events/defineConfig.d.ts +75 -9010
  25. package/dist/commons/events/index.d.ts +0 -8
  26. package/dist/commons/events/test.utils.d.ts +78 -147
  27. package/dist/commons/events/utils.d.ts +68 -13352
  28. package/dist/conditionals/index.js +36 -76
  29. package/dist/events/index.js +1504 -3807
  30. package/dist/scopes/index.d.ts +6 -94
  31. package/dist/scopes/index.js +21 -42
  32. package/package.json +2 -3
  33. package/dist/commons/events/Constants.d.ts +0 -3
  34. package/dist/commons/events/CountryConfigQueryInput.d.ts +0 -2982
  35. package/dist/commons/events/CreatedAtLocation.d.ts +0 -3
  36. package/dist/commons/events/WorkqueueColumnConfig.d.ts +0 -53
  37. package/dist/commons/events/event.d.ts +0 -54
  38. package/dist/commons/events/field.d.ts +0 -77
  39. package/dist/commons/events/scopes.d.ts +0 -45
  40. package/dist/commons/events/serializer.d.ts +0 -2
  41. package/dist/commons/events/workqueueDefaultColumns.d.ts +0 -3
@@ -19,7 +19,6 @@ export declare const SCOPES: {
19
19
  * @TODO This is a temporary scope to be used for V2 Events custom events declaration
20
20
  */
21
21
  readonly RECORD_DECLARE: "record.declare-birth";
22
- readonly RECORD_IMPORT: "record.import";
23
22
  readonly RECORD_DECLARE_BIRTH: "record.declare-birth";
24
23
  readonly RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction";
25
24
  readonly RECORD_DECLARE_DEATH: "record.declare-death";
@@ -85,7 +84,7 @@ export declare const SCOPES: {
85
84
  readonly CONFIG_UPDATE_ALL: "config.update:all";
86
85
  readonly USER_DATA_SEEDING: "user.data-seeding";
87
86
  };
88
- declare const LiteralScopes: z.ZodUnion<[z.ZodLiteral<"natlsysadmin">, z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"declare">, z.ZodLiteral<"register">, z.ZodLiteral<"validate">, z.ZodLiteral<"demo">, z.ZodLiteral<"certify">, z.ZodLiteral<"performance">, z.ZodLiteral<"sysadmin">, z.ZodLiteral<"teams">, z.ZodLiteral<"config">, z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">, z.ZodLiteral<"record.import">, z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">, z.ZodLiteral<"record.unassign-others">, z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.export-records">, z.ZodLiteral<"record.declaration-print">, z.ZodLiteral<"record.declaration-print-supporting-documents">, z.ZodLiteral<"record.registration-print">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodLiteral<"record.registration-print-certified-copies">, z.ZodLiteral<"record.registration-bulk-print-certified-copies">, z.ZodLiteral<"record.registration-verify-certified-copies">, z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.registration-request-revocation">, z.ZodLiteral<"record.registration-revoke">, z.ZodLiteral<"record.registration-request-reinstatement">, z.ZodLiteral<"record.registration-reinstate">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">, z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">, z.ZodLiteral<"record.read">, z.ZodLiteral<"record.read-audit">, z.ZodLiteral<"record.read-comments">, z.ZodLiteral<"record.create-comments">, z.ZodLiteral<"profile.update">, z.ZodLiteral<"profile.electronic-signature">, z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">, z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">, z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">]>;
87
+ declare const LiteralScopes: z.ZodUnion<[z.ZodLiteral<"natlsysadmin">, z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"declare">, z.ZodLiteral<"register">, z.ZodLiteral<"validate">, z.ZodLiteral<"demo">, z.ZodLiteral<"certify">, z.ZodLiteral<"performance">, z.ZodLiteral<"sysadmin">, z.ZodLiteral<"teams">, z.ZodLiteral<"config">, z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">, z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">, z.ZodLiteral<"record.unassign-others">, z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.export-records">, z.ZodLiteral<"record.declaration-print">, z.ZodLiteral<"record.declaration-print-supporting-documents">, z.ZodLiteral<"record.registration-print">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodLiteral<"record.registration-print-certified-copies">, z.ZodLiteral<"record.registration-bulk-print-certified-copies">, z.ZodLiteral<"record.registration-verify-certified-copies">, z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.registration-request-revocation">, z.ZodLiteral<"record.registration-revoke">, z.ZodLiteral<"record.registration-request-reinstatement">, z.ZodLiteral<"record.registration-reinstate">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">, z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">, z.ZodLiteral<"record.read">, z.ZodLiteral<"record.read-audit">, z.ZodLiteral<"record.read-comments">, z.ZodLiteral<"record.create-comments">, z.ZodLiteral<"profile.update">, z.ZodLiteral<"profile.electronic-signature">, z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">, z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">, z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">]>;
89
88
  declare const ConfigurableScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
90
89
  type: z.ZodLiteral<"user.create">;
91
90
  options: z.ZodObject<{
@@ -124,84 +123,19 @@ declare const ConfigurableScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
124
123
  options: {
125
124
  role: string[];
126
125
  };
127
- }>, z.ZodObject<{
128
- type: z.ZodLiteral<"workqueue">;
129
- options: z.ZodObject<{
130
- id: z.ZodArray<z.ZodString, "many">;
131
- }, "strip", z.ZodTypeAny, {
132
- id: string[];
133
- }, {
134
- id: string[];
135
- }>;
136
- }, "strip", z.ZodTypeAny, {
137
- type: "workqueue";
138
- options: {
139
- id: string[];
140
- };
141
- }, {
142
- type: "workqueue";
143
- options: {
144
- id: string[];
145
- };
146
- }>, z.ZodObject<{
147
- type: z.ZodLiteral<"record.notify">;
148
- options: z.ZodObject<{
149
- event: z.ZodArray<z.ZodString, "many">;
150
- }, "strip", z.ZodTypeAny, {
151
- event: string[];
152
- }, {
153
- event: string[];
154
- }>;
155
- }, "strip", z.ZodTypeAny, {
156
- type: "record.notify";
157
- options: {
158
- event: string[];
159
- };
160
- }, {
161
- type: "record.notify";
162
- options: {
163
- event: string[];
164
- };
165
126
  }>]>;
166
- export type ConfigurableScopeType = ConfigurableScopes['type'];
167
- export type ConfigurableScopes = z.infer<typeof ConfigurableScopes>;
168
- export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{
127
+ type ConfigurableScopes = z.infer<typeof ConfigurableScopes>;
128
+ export declare function findScope(scopes: string[], scopeType: ConfigurableScopes['type']): {
169
129
  type: "user.create";
170
130
  options: {
171
131
  role: string[];
172
132
  };
173
- }, {
174
- type: T;
175
- }> | Extract<{
133
+ } | {
176
134
  type: "user.edit";
177
135
  options: {
178
136
  role: string[];
179
137
  };
180
- }, {
181
- type: T;
182
- }> | Extract<{
183
- type: "workqueue";
184
- options: {
185
- id: string[];
186
- };
187
- }, {
188
- type: T;
189
- }> | Extract<{
190
- type: "record.notify";
191
- options: {
192
- event: string[];
193
- };
194
- }, {
195
- type: T;
196
- }> | undefined;
197
- /**
198
- * Parses a configurable scope string into a ConfigurableScopes object.
199
- * @param {string} scope - The scope string to parse
200
- * @returns {ConfigurableScopes | undefined} The parsed scope object if valid, undefined otherwise
201
- * @example
202
- * parseScope("user.create[role=field-agent|registration-agent]")
203
- * // Returns: { type: "user.create", options: { role: ["field-agent", "registration-agent"] } }
204
- */
138
+ } | undefined;
205
139
  export declare function parseScope(scope: string): {
206
140
  type: "user.create";
207
141
  options: {
@@ -213,30 +147,8 @@ export declare function parseScope(scope: string): {
213
147
  role: string[];
214
148
  };
215
149
  } | {
216
- type: "workqueue";
217
- options: {
218
- id: string[];
219
- };
220
- } | {
221
- type: "record.notify";
222
- options: {
223
- event: string[];
224
- };
225
- } | {
226
- type: "natlsysadmin" | "bypassratelimit" | "declare" | "register" | "validate" | "demo" | "certify" | "performance" | "sysadmin" | "teams" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.declare-birth" | "record.import" | "record.declare-birth:my-jurisdiction" | "record.declare-death" | "record.declare-death:my-jurisdiction" | "record.declare-marriage" | "record.declare-marriage:my-jurisdiction" | "record.declaration-submit-incomplete" | "record.declaration-submit-for-review" | "record.unassign-others" | "record.declaration-submit-for-approval" | "record.declaration-submit-for-updates" | "record.declaration-edit" | "record.review-duplicates" | "record.declaration-archive" | "record.declaration-reinstate" | "record.register" | "record.export-records" | "record.declaration-print" | "record.declaration-print-supporting-documents" | "record.registration-print" | "record.registration-print&issue-certified-copies" | "record.registration-print-certified-copies" | "record.registration-bulk-print-certified-copies" | "record.registration-verify-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "record.registration-request-revocation" | "record.registration-revoke" | "record.registration-request-reinstatement" | "record.registration-reinstate" | "record.confirm-registration" | "record.reject-registration" | "search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage" | "record.read" | "record.read-audit" | "record.read-comments" | "record.create-comments" | "profile.update" | "profile.electronic-signature" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "organisation.read-locations:all" | "organisation.read-locations:my-office" | "organisation.read-locations:my-jurisdiction" | "user.read:all" | "user.read:my-office" | "user.read:my-jurisdiction" | "user.read:only-my-audit" | "user.create:all" | "user.create:my-jurisdiction" | "user.update:all" | "user.update:my-jurisdiction" | "config.update:all" | "user.data-seeding";
150
+ type: "natlsysadmin" | "bypassratelimit" | "declare" | "register" | "validate" | "demo" | "certify" | "performance" | "sysadmin" | "teams" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.declare-birth" | "record.declare-birth:my-jurisdiction" | "record.declare-death" | "record.declare-death:my-jurisdiction" | "record.declare-marriage" | "record.declare-marriage:my-jurisdiction" | "record.declaration-submit-incomplete" | "record.declaration-submit-for-review" | "record.unassign-others" | "record.declaration-submit-for-approval" | "record.declaration-submit-for-updates" | "record.declaration-edit" | "record.review-duplicates" | "record.declaration-archive" | "record.declaration-reinstate" | "record.register" | "record.export-records" | "record.declaration-print" | "record.declaration-print-supporting-documents" | "record.registration-print" | "record.registration-print&issue-certified-copies" | "record.registration-print-certified-copies" | "record.registration-bulk-print-certified-copies" | "record.registration-verify-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "record.registration-request-revocation" | "record.registration-revoke" | "record.registration-request-reinstatement" | "record.registration-reinstate" | "record.confirm-registration" | "record.reject-registration" | "search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage" | "record.read" | "record.read-audit" | "record.read-comments" | "record.create-comments" | "profile.update" | "profile.electronic-signature" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "organisation.read-locations:all" | "organisation.read-locations:my-office" | "organisation.read-locations:my-jurisdiction" | "user.read:all" | "user.read:my-office" | "user.read:my-jurisdiction" | "user.read:only-my-audit" | "user.create:all" | "user.create:my-jurisdiction" | "user.update:all" | "user.update:my-jurisdiction" | "config.update:all" | "user.data-seeding";
227
151
  } | undefined;
228
- /**
229
- * Stringifies a ConfigurableScopes object into a scope string.
230
- * @param {ConfigurableScopes} scope - The scope object to stringify
231
- * @returns {string} The stringified scope in format "type[key1=value1|value2,key2=value3|value4]"
232
- * @example
233
- * stringifyScope({
234
- * type: "record.notify",
235
- * options: { event: ["v2.birth", "tennis-club-membership"] }
236
- * })
237
- * // Returns: "record.notify[event=v2.birth|tennis-club-membership]"
238
- */
239
- export declare function stringifyScope(scope: ConfigurableScopes): string;
240
152
  export declare const scopes: Scope[];
241
153
  export type ParsedScopes = NonNullable<ReturnType<typeof parseScope>>;
242
154
  export type RawScopes = z.infer<typeof LiteralScopes> | (string & {});
@@ -23,8 +23,7 @@ __export(scopes_exports, {
23
23
  SCOPES: () => SCOPES,
24
24
  findScope: () => findScope,
25
25
  parseScope: () => parseScope,
26
- scopes: () => scopes,
27
- stringifyScope: () => stringifyScope
26
+ scopes: () => scopes
28
27
  });
29
28
  module.exports = __toCommonJS(scopes_exports);
30
29
 
@@ -53,8 +52,6 @@ var SCOPES = {
53
52
  */
54
53
  RECORD_DECLARE: "record.declare-birth",
55
54
  // declare
56
- RECORD_IMPORT: "record.import",
57
- // declare
58
55
  RECORD_DECLARE_BIRTH: "record.declare-birth",
59
56
  RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction",
60
57
  RECORD_DECLARE_DEATH: "record.declare-death",
@@ -158,7 +155,6 @@ var LiteralScopes = import_zod.z.union([
158
155
  import_zod.z.literal(SCOPES.NATIONALID),
159
156
  import_zod.z.literal(SCOPES.NOTIFICATION_API),
160
157
  import_zod.z.literal(SCOPES.RECORDSEARCH),
161
- import_zod.z.literal(SCOPES.RECORD_IMPORT),
162
158
  import_zod.z.literal(SCOPES.RECORD_DECLARE_BIRTH),
163
159
  import_zod.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION),
164
160
  import_zod.z.literal(SCOPES.RECORD_DECLARE_DEATH),
@@ -220,7 +216,7 @@ var LiteralScopes = import_zod.z.union([
220
216
  import_zod.z.literal(SCOPES.CONFIG_UPDATE_ALL),
221
217
  import_zod.z.literal(SCOPES.USER_DATA_SEEDING)
222
218
  ]);
223
- var rawConfigurableScopeRegex = /^([a-zA-Z\.]+)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/;
219
+ var rawConfigurableScopeRegex = /^([a-zA-Z]+\.[a-zA-Z]+)\[((?:\w+=\w+(?:\|\w+)*)(:?,\w+=\w+(?:\|\w+)*)*)\]$/;
224
220
  var rawConfigurableScope = import_zod.z.string().regex(rawConfigurableScopeRegex);
225
221
  var CreateUserScope = import_zod.z.object({
226
222
  type: import_zod.z.literal("user.create"),
@@ -234,27 +230,12 @@ var EditUserScope = import_zod.z.object({
234
230
  role: import_zod.z.array(import_zod.z.string())
235
231
  })
236
232
  });
237
- var WorkqueueScope = import_zod.z.object({
238
- type: import_zod.z.literal("workqueue"),
239
- options: import_zod.z.object({
240
- id: import_zod.z.array(import_zod.z.string())
241
- })
242
- });
243
- var NotifyRecordScope = import_zod.z.object({
244
- type: import_zod.z.literal("record.notify"),
245
- options: import_zod.z.object({
246
- event: import_zod.z.array(import_zod.z.string())
247
- })
248
- });
249
233
  var ConfigurableScopes = import_zod.z.discriminatedUnion("type", [
250
234
  CreateUserScope,
251
- EditUserScope,
252
- WorkqueueScope,
253
- NotifyRecordScope
235
+ EditUserScope
254
236
  ]);
255
237
  function findScope(scopes2, scopeType) {
256
- const parsedScopes = scopes2.map((rawScope) => parseScope(rawScope));
257
- return parsedScopes.find(
238
+ return scopes2.map((rawScope) => parseScope(rawScope)).find(
258
239
  (parsedScope) => parsedScope?.type === scopeType
259
240
  );
260
241
  }
@@ -266,25 +247,23 @@ function parseScope(scope) {
266
247
  };
267
248
  }
268
249
  const maybeConfigurableScope = rawConfigurableScope.safeParse(scope);
269
- if (!maybeConfigurableScope.success) {
270
- return;
250
+ if (maybeConfigurableScope.success) {
251
+ const rawScope = maybeConfigurableScope.data;
252
+ const [, type, rawOptions] = rawScope.match(rawConfigurableScopeRegex) ?? [];
253
+ const options = rawOptions.split(",").reduce((acc, option) => {
254
+ const [key, value] = option.split("=");
255
+ acc[key] = value.split("|");
256
+ return acc;
257
+ }, {});
258
+ const parsedScope = {
259
+ type,
260
+ options
261
+ };
262
+ const result = ConfigurableScopes.safeParse(parsedScope);
263
+ if (result.success) {
264
+ return result.data;
265
+ }
271
266
  }
272
- const rawScope = maybeConfigurableScope.data;
273
- const [, type, rawOptions] = rawScope.match(rawConfigurableScopeRegex) ?? [];
274
- const options = rawOptions.split(",").reduce((acc, option) => {
275
- const [key, value] = option.split("=");
276
- acc[key] = value.split("|");
277
- return acc;
278
- }, {});
279
- const parsedScope = {
280
- type,
281
- options
282
- };
283
- const result = ConfigurableScopes.safeParse(parsedScope);
284
- return result.success ? result.data : void 0;
285
- }
286
- function stringifyScope(scope) {
287
- const options = Object.entries(scope.options).map(([key, value]) => `${key}=${value.join("|")}`).join(",");
288
- return `${scope.type}[${options}]`;
267
+ return void 0;
289
268
  }
290
269
  var scopes = Object.values(SCOPES);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "1.8.0-rc.fd8a78f",
3
+ "version": "1.8.0-rc.fd936ab",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "exports": {
@@ -20,8 +20,7 @@
20
20
  "ajv-formats": "^3.0.1",
21
21
  "superjson": "1.9.0-0",
22
22
  "@trpc/client": "^11.0.0-rc.648",
23
- "@trpc/server": "^11.0.0-rc.532",
24
- "zod-openapi": "^4.2.4"
23
+ "@trpc/server": "^11.0.0-rc.532"
25
24
  },
26
25
  "devDependencies": {
27
26
  "@types/uuid": "^9.0.3",
@@ -1,3 +0,0 @@
1
- export declare const TENNIS_CLUB_MEMBERSHIP = "tennis-club-membership";
2
- export declare const BIRTH_EVENT = "v2-birth";
3
- //# sourceMappingURL=Constants.d.ts.map