@opencrvs/toolkit 1.8.0-rc.fde984c → 1.8.0-rc.fe4d9d5
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/dist/commons/api/router.d.ts +4652 -128
- package/dist/commons/conditionals/validate.d.ts +5 -0
- package/dist/commons/events/ActionDocument.d.ts +105 -0
- package/dist/commons/events/ActionType.d.ts +6 -0
- package/dist/commons/events/CountryConfigQueryInput.d.ts +254 -168
- package/dist/commons/events/Draft.d.ts +5 -0
- package/dist/commons/events/EventDocument.d.ts +80 -0
- package/dist/commons/events/EventIndex.d.ts +596 -160
- package/dist/commons/events/EventMetadata.d.ts +35 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +11 -11
- package/dist/commons/events/WorkqueueConfig.d.ts +1959 -470
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/scopes.d.ts +1 -2
- package/dist/commons/events/test.utils.d.ts +13 -0
- package/dist/commons/events/utils.d.ts +1 -0
- package/dist/events/index.js +870 -539
- package/dist/scopes/index.d.ts +4 -1
- package/dist/scopes/index.js +67 -17
- package/package.json +1 -1
@@ -35,6 +35,7 @@ export * from './test.utils';
|
|
35
35
|
export * from './TemplateConfig';
|
36
36
|
export * from './scopes';
|
37
37
|
export * from './serializer';
|
38
|
+
export * from './state/availableActions';
|
38
39
|
export * from '../conditionals/conditionals';
|
39
40
|
export * from '../conditionals/validate';
|
40
41
|
export * from './field';
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Scope } from '../scopes';
|
2
|
-
import { ActionType } from './ActionType';
|
3
2
|
export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"];
|
4
3
|
export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[];
|
5
4
|
export declare const ACTION_ALLOWED_SCOPES: {
|
@@ -40,6 +39,6 @@ export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: {
|
|
40
39
|
UNASSIGN: never[];
|
41
40
|
DETECT_DUPLICATE: never[];
|
42
41
|
};
|
42
|
+
export declare const WRITE_ACTION_SCOPES: ("record.declare-birth" | "record.declaration-submit-for-approval" | "record.register" | "record.registration-print&issue-certified-copies")[];
|
43
43
|
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean;
|
44
|
-
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[];
|
45
44
|
//# sourceMappingURL=scopes.d.ts.map
|
@@ -10,6 +10,13 @@ import { TranslationConfig } from './TranslationConfig';
|
|
10
10
|
import { FieldConfig } from './FieldConfig';
|
11
11
|
import { WorkqueueConfig } from './WorkqueueConfig';
|
12
12
|
import { FieldValue } from './FieldValue';
|
13
|
+
import { z } from 'zod';
|
14
|
+
/**
|
15
|
+
* In real application, the roles are defined in the countryconfig.
|
16
|
+
* These are just for testing purposes to generate realistic mock data.
|
17
|
+
*/
|
18
|
+
export declare const TestUserRole: z.ZodEnum<["FIELD_AGENT", "LOCAL_REGISTRAR", "LOCAL_SYSTEM_ADMIN", "NATIONAL_REGISTRAR", "REGISTRATION_AGENT"]>;
|
19
|
+
export type TestUserRole = z.infer<typeof TestUserRole>;
|
13
20
|
export declare function generateRandomName(rng: () => number): {
|
14
21
|
firstname: string;
|
15
22
|
surname: string;
|
@@ -398,6 +405,12 @@ export declare function generateActionDocument({ configuration, action, rng, def
|
|
398
405
|
action: ActionType;
|
399
406
|
rng?: () => number;
|
400
407
|
defaults?: Partial<ActionDocument>;
|
408
|
+
user?: Partial<{
|
409
|
+
signature: string;
|
410
|
+
primaryOfficeId: string;
|
411
|
+
role: TestUserRole;
|
412
|
+
id: string;
|
413
|
+
}>;
|
401
414
|
}): ActionDocument;
|
402
415
|
export declare function generateEventDocument({ configuration, actions, rng }: {
|
403
416
|
configuration: EventConfig;
|
@@ -4129,6 +4129,7 @@ export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]):
|
|
4129
4129
|
type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN";
|
4130
4130
|
status: "Rejected" | "Requested" | "Accepted";
|
4131
4131
|
transactionId: string;
|
4132
|
+
createdByUserType: "system" | "user";
|
4132
4133
|
createdAt: string;
|
4133
4134
|
createdBy: string;
|
4134
4135
|
createdByRole: string;
|