@opencrvs/toolkit 2.0.0-rc.800cd96 → 2.0.0-rc.8043a0a
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.
- package/create-countryconfig/index.js +50 -20
- package/create-countryconfig/package.json +12 -2
- package/dist/application-config/index.js +251 -93
- package/dist/cli.js +10 -2
- package/dist/commons/api/router.d.ts +96 -19
- package/dist/commons/application-config/index.d.ts +1 -0
- package/dist/commons/conditionals/conditionals.d.ts +354 -4
- package/dist/commons/conditionals/validate.d.ts +51 -2
- package/dist/commons/events/ActionDocument.d.ts +6 -0
- package/dist/commons/events/ActionInput.d.ts +42 -36
- package/dist/commons/events/Draft.d.ts +2 -3
- package/dist/commons/events/EventDocument.d.ts +3 -0
- package/dist/commons/events/FieldConfig.d.ts +377 -50
- package/dist/commons/events/FieldValue.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +150 -150
- package/dist/commons/events/field.d.ts +47 -1
- package/dist/commons/events/index.d.ts +2 -0
- package/dist/commons/events/state/flags.d.ts +16 -0
- package/dist/commons/events/state/utils.d.ts +3 -0
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +55 -2
- package/dist/events/index.js +923 -200
- package/dist/migrations/v2.0/index.js +10 -2
- package/dist/notification/index.js +786 -129
- package/dist/scopes/index.d.ts +0 -8
- package/dist/scopes/index.js +10 -2
- package/opencrvs-toolkit-2.0.0-rc.8043a0a.tgz +0 -0
- package/package.json +6 -2
- package/opencrvs-toolkit-2.0.0-rc.800cd96.tgz +0 -0
package/dist/scopes/index.d.ts
CHANGED
|
@@ -579,14 +579,6 @@ export type EncodedScope = z.infer<typeof EncodedScope>;
|
|
|
579
579
|
* @returns The encoded scope as a branded string (`EncodedScope`).
|
|
580
580
|
*/
|
|
581
581
|
export declare const encodeScope: (scope: Scope) => EncodedScope;
|
|
582
|
-
/**
|
|
583
|
-
* Converts a scope object into an encoded query string representation.
|
|
584
|
-
*
|
|
585
|
-
* @TODO scope param could be defined as EncodedScope instead of string.
|
|
586
|
-
*
|
|
587
|
-
* @param scope - The scope object to encode.
|
|
588
|
-
* @returns The encoded scope as a branded string (`EncodedScope`).
|
|
589
|
-
*/
|
|
590
582
|
export declare const decodeScope: (query: EncodedScope) => {
|
|
591
583
|
type: "record.create" | "record.declare" | "record.notify";
|
|
592
584
|
options?: {
|
package/dist/scopes/index.js
CHANGED
|
@@ -354,18 +354,26 @@ var encodeScope = (scope) => {
|
|
|
354
354
|
encode: false
|
|
355
355
|
});
|
|
356
356
|
};
|
|
357
|
+
var decodedScopeCache = /* @__PURE__ */ new Map();
|
|
357
358
|
var decodeScope = (query) => {
|
|
359
|
+
if (decodedScopeCache.has(query)) {
|
|
360
|
+
return decodedScopeCache.get(query);
|
|
361
|
+
}
|
|
358
362
|
const scope = qs.parse(query, {
|
|
359
363
|
ignoreQueryPrefix: true,
|
|
360
364
|
comma: true,
|
|
361
365
|
allowDots: true
|
|
362
366
|
});
|
|
363
367
|
const unflattenedScope = unflattenScope(scope);
|
|
364
|
-
|
|
368
|
+
const result = Scope2.safeParse(unflattenedScope)?.data;
|
|
369
|
+
decodedScopeCache.set(query, result);
|
|
370
|
+
return result;
|
|
365
371
|
};
|
|
366
372
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
367
373
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
368
|
-
accessLevel: JurisdictionFilter.enum.all
|
|
374
|
+
accessLevel: JurisdictionFilter.enum.all,
|
|
375
|
+
registeredIn: JurisdictionFilter.enum.all,
|
|
376
|
+
declaredIn: JurisdictionFilter.enum.all
|
|
369
377
|
};
|
|
370
378
|
function getScopeOptionValue(scope, option) {
|
|
371
379
|
const options = "options" in scope ? scope.options : void 0;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencrvs/toolkit",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.8043a0a",
|
|
4
4
|
"description": "OpenCRVS toolkit for building country configurations",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"build": "./build.sh",
|
|
21
21
|
"build:all": "lerna run build --include-dependencies --scope @opencrvs/toolkit && ./build.sh"
|
|
22
22
|
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/opencrvs/opencrvs-core.git"
|
|
26
|
+
},
|
|
23
27
|
"dependencies": {
|
|
24
28
|
"@trpc/client": "11.4.3",
|
|
25
29
|
"@trpc/server": "^11.8.0",
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
"jwt-decode": "^3.0.0",
|
|
30
34
|
"lodash": "^4.17.10",
|
|
31
35
|
"object-hash": "^3.0.0",
|
|
32
|
-
"qs": "6.
|
|
36
|
+
"qs": "6.15.2",
|
|
33
37
|
"superjson": "1.9.0-0",
|
|
34
38
|
"ts-morph": "^27.0.2",
|
|
35
39
|
"uuid": "^9.0.0",
|
|
Binary file
|