@opencrvs/toolkit 2.0.0-rc.ff04b30 → 2.0.0-rc.ff8df64
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 +244 -97
- package/dist/cli.js +9 -3
- 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/AdvancedSearchConfig.d.ts +342 -0
- 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 +5 -5
- package/dist/commons/events/field.d.ts +53 -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 +12 -287
- package/dist/commons/events/utils.d.ts +12 -1
- package/dist/conditionals/index.js +52 -1
- package/dist/events/index.js +924 -201
- package/dist/migrations/v2.0/index.js +9 -3
- package/dist/notification/index.js +782 -119
- package/dist/scopes/index.d.ts +4 -6
- package/dist/scopes/index.js +9 -3
- package/opencrvs-toolkit-2.0.0-rc.ff8df64.tgz +0 -0
- package/package.json +6 -2
- package/opencrvs-toolkit-2.0.0-rc.ff04b30.tgz +0 -0
package/dist/scopes/index.d.ts
CHANGED
|
@@ -580,14 +580,12 @@ export type EncodedScope = z.infer<typeof EncodedScope>;
|
|
|
580
580
|
*/
|
|
581
581
|
export declare const encodeScope: (scope: Scope) => EncodedScope;
|
|
582
582
|
/**
|
|
583
|
-
* Converts
|
|
583
|
+
* Converts an encoded scope string into a scope object.
|
|
584
584
|
*
|
|
585
|
-
* @
|
|
586
|
-
*
|
|
587
|
-
* @param scope - The scope object to encode.
|
|
588
|
-
* @returns The encoded scope as a branded string (`EncodedScope`).
|
|
585
|
+
* @param scope - The encoded scope string to decode.
|
|
586
|
+
* @returns The decoded scope object.
|
|
589
587
|
*/
|
|
590
|
-
export declare const decodeScope: (
|
|
588
|
+
export declare const decodeScope: (encodedScope: EncodedScope) => {
|
|
591
589
|
type: "record.create" | "record.declare" | "record.notify";
|
|
592
590
|
options?: {
|
|
593
591
|
event?: string[] | undefined;
|
package/dist/scopes/index.js
CHANGED
|
@@ -354,14 +354,20 @@ var encodeScope = (scope) => {
|
|
|
354
354
|
encode: false
|
|
355
355
|
});
|
|
356
356
|
};
|
|
357
|
-
var
|
|
358
|
-
|
|
357
|
+
var decodedScopeCache = /* @__PURE__ */ new Map();
|
|
358
|
+
var decodeScope = (encodedScope) => {
|
|
359
|
+
if (decodedScopeCache.has(encodedScope)) {
|
|
360
|
+
return decodedScopeCache.get(encodedScope);
|
|
361
|
+
}
|
|
362
|
+
const scope = qs.parse(encodedScope, {
|
|
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(encodedScope, result);
|
|
370
|
+
return result;
|
|
365
371
|
};
|
|
366
372
|
var DEFAULT_SCOPE_OPTIONS = {
|
|
367
373
|
placeOfEvent: JurisdictionFilter.enum.all,
|
|
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.ff8df64",
|
|
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
|