@opencrvs/toolkit 1.9.13-rc.72233cd → 1.9.13-rc.7491e0c
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/build.sh +0 -13
- package/dist/api/index.d.ts.map +1 -1
- package/dist/commons/api/router.d.ts +4561 -3370
- package/dist/commons/conditionals/conditionals.d.ts +3 -27
- package/dist/commons/conditionals/validate.d.ts +3 -13
- package/dist/commons/events/ActionConfig.d.ts +1555 -415
- package/dist/commons/events/ActionDocument.d.ts +1941 -888
- package/dist/commons/events/ActionInput.d.ts +1277 -277
- package/dist/commons/events/ActionType.d.ts +11 -91
- package/dist/commons/events/AdvancedSearchConfig.d.ts +1496 -294
- package/dist/commons/events/CompositeFieldValue.d.ts +190 -30
- package/dist/commons/events/Conditional.d.ts +38 -26
- package/dist/commons/events/Constants.d.ts +1 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +4471 -1592
- package/dist/commons/events/CreatedAtLocation.d.ts +2 -0
- package/dist/commons/events/DeduplicationConfig.d.ts +171 -15
- package/dist/commons/events/Draft.d.ts +113 -72
- package/dist/commons/events/DynamicFieldValue.d.ts +78 -12
- package/dist/commons/events/EventConfig.d.ts +2420 -35
- package/dist/commons/events/EventConfigInput.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +1366 -354
- package/dist/commons/events/EventIndex.d.ts +1010 -212
- package/dist/commons/events/EventInput.d.ts +8 -3
- package/dist/commons/events/EventMetadata.d.ts +357 -130
- package/dist/commons/events/FieldConfig.d.ts +12890 -2890
- package/dist/commons/events/FieldType.d.ts +4 -26
- package/dist/commons/events/FieldTypeMapping.d.ts +906 -314
- package/dist/commons/events/FieldValue.d.ts +527 -149
- package/dist/commons/events/FileUtils.d.ts +2 -2
- package/dist/commons/events/FormConfig.d.ts +721 -54
- package/dist/commons/events/PageConfig.d.ts +320 -58
- package/dist/commons/events/PlainDate.d.ts +1 -1
- package/dist/commons/events/SummaryConfig.d.ts +161 -14
- package/dist/commons/events/TemplateConfig.d.ts +3 -2
- package/dist/commons/events/TranslationConfig.d.ts +2 -2
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +37 -74
- package/dist/commons/events/WorkqueueConfig.d.ts +7480 -2135
- package/dist/commons/events/deduplication.d.ts +3 -3
- package/dist/commons/events/defineConfig.d.ts +247 -2
- package/dist/commons/events/index.d.ts +0 -3
- package/dist/commons/events/locations.d.ts +20 -57
- package/dist/commons/events/scopes.d.ts +34 -35
- package/dist/commons/events/state/availableActions.d.ts +2 -7
- package/dist/commons/events/state/flags.d.ts +3 -21
- package/dist/commons/events/state/index.d.ts +27 -30
- package/dist/commons/events/state/utils.d.ts +172 -190
- package/dist/commons/events/test.utils.d.ts +11 -52
- package/dist/commons/events/transactions.d.ts +1 -1
- package/dist/commons/events/utils.d.ts +274 -374
- package/dist/commons/notification/UserNotifications.d.ts +637 -61
- package/dist/conditionals/index.d.ts.map +1 -1
- package/dist/conditionals/index.js +14 -302
- package/dist/events/deduplication.d.ts +3 -3
- package/dist/events/index.js +2113 -2847
- package/dist/notification/index.d.ts.map +1 -1
- package/dist/notification/index.js +1769 -2073
- package/dist/scopes/index.d.ts +353 -640
- package/dist/scopes/index.d.ts.map +1 -1
- package/dist/scopes/index.js +300 -340
- package/package.json +3 -13
- package/tsconfig.json +2 -12
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/application-config/index.d.ts +0 -2
- package/dist/application-config/index.d.ts.map +0 -1
- package/dist/application-config/index.js +0 -2128
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -3237
- package/dist/commons/application-config/index.d.ts +0 -84
- package/dist/commons/events/AuditLog.d.ts +0 -405
- package/dist/commons/events/Flag.d.ts +0 -67
- package/dist/commons/events/eventConfigValidation.d.ts +0 -8
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -405
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -829
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -159
- package/dist/migrations/v2.0/index.d.ts +0 -7
- package/dist/migrations/v2.0/index.d.ts.map +0 -1
- package/dist/migrations/v2.0/index.js +0 -3176
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -344
- package/dist/migrations/v2.0/migrate-scopes.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-scopes.js +0 -282
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -268
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -237
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +0 -157
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +0 -75
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -97
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -78
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -110
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -164
- package/dist/migrations/v2.0/rename-api-paths.d.ts +0 -3
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-api-paths.js +0 -188
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +0 -181
- package/opencrvs-toolkit-1.9.13-rc.72233cd.tgz +0 -0
package/dist/scopes/index.d.ts
CHANGED
|
@@ -1,672 +1,385 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export type ScopeOptionKey = z.infer<typeof ScopeOptionKey>;
|
|
79
|
-
export declare const ScopesWithPlaceEventOptions: z.ZodEnum<{
|
|
80
|
-
"record.create": "record.create";
|
|
81
|
-
"record.declare": "record.declare";
|
|
82
|
-
"record.notify": "record.notify";
|
|
83
|
-
}>;
|
|
84
|
-
export declare const ScopesWithDeclaredOptions: z.ZodEnum<{
|
|
85
|
-
"record.edit": "record.edit";
|
|
86
|
-
"record.reject": "record.reject";
|
|
87
|
-
"record.archive": "record.archive";
|
|
88
|
-
"record.review-duplicates": "record.review-duplicates";
|
|
89
|
-
"record.register": "record.register";
|
|
90
|
-
}>;
|
|
91
|
-
export declare const ScopesWithFullOptions: z.ZodEnum<{
|
|
92
|
-
"record.search": "record.search";
|
|
93
|
-
"record.read": "record.read";
|
|
94
|
-
"record.request-correction": "record.request-correction";
|
|
95
|
-
"record.correct": "record.correct";
|
|
96
|
-
"record.unassign-others": "record.unassign-others";
|
|
97
|
-
}>;
|
|
98
|
-
export declare const RecordScopeV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
99
|
-
type: z.ZodEnum<{
|
|
100
|
-
"record.create": "record.create";
|
|
101
|
-
"record.declare": "record.declare";
|
|
102
|
-
"record.notify": "record.notify";
|
|
103
|
-
}>;
|
|
104
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
105
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
106
|
-
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
107
|
-
administrativeArea: "administrativeArea";
|
|
108
|
-
location: "location";
|
|
109
|
-
all: "all";
|
|
110
|
-
}>>;
|
|
111
|
-
}, z.core.$strip>>;
|
|
112
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
-
type: z.ZodEnum<{
|
|
114
|
-
"record.edit": "record.edit";
|
|
115
|
-
"record.reject": "record.reject";
|
|
116
|
-
"record.archive": "record.archive";
|
|
117
|
-
"record.review-duplicates": "record.review-duplicates";
|
|
118
|
-
"record.register": "record.register";
|
|
119
|
-
}>;
|
|
120
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
121
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
122
|
-
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
123
|
-
administrativeArea: "administrativeArea";
|
|
124
|
-
location: "location";
|
|
125
|
-
all: "all";
|
|
126
|
-
}>>;
|
|
127
|
-
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
128
|
-
administrativeArea: "administrativeArea";
|
|
129
|
-
location: "location";
|
|
130
|
-
all: "all";
|
|
131
|
-
}>>;
|
|
132
|
-
declaredBy: z.ZodOptional<z.ZodEnum<{
|
|
133
|
-
user: "user";
|
|
134
|
-
}>>;
|
|
135
|
-
}, z.core.$strip>>;
|
|
136
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
137
|
-
type: z.ZodEnum<{
|
|
138
|
-
"record.search": "record.search";
|
|
139
|
-
"record.read": "record.read";
|
|
140
|
-
"record.request-correction": "record.request-correction";
|
|
141
|
-
"record.correct": "record.correct";
|
|
142
|
-
"record.unassign-others": "record.unassign-others";
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SearchScopeAccessLevels } from './events';
|
|
3
|
+
export declare const SCOPES: {
|
|
4
|
+
readonly BYPASSRATELIMIT: "bypassratelimit";
|
|
5
|
+
readonly REGISTER: "register";
|
|
6
|
+
readonly DEMO: "demo";
|
|
7
|
+
readonly CONFIG: "config";
|
|
8
|
+
readonly WEBHOOK: "webhook";
|
|
9
|
+
readonly NATIONALID: "nationalId";
|
|
10
|
+
readonly NOTIFICATION_API: "notification-api";
|
|
11
|
+
readonly RECORDSEARCH: "recordsearch";
|
|
12
|
+
readonly RECORD_IMPORT: "record.import";
|
|
13
|
+
readonly RECORD_EXPORT: "record.export";
|
|
14
|
+
readonly RECORD_REINDEX: "record.reindex";
|
|
15
|
+
readonly RECORD_DECLARE_BIRTH: "record.declare-birth";
|
|
16
|
+
readonly RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction";
|
|
17
|
+
readonly RECORD_DECLARE_DEATH: "record.declare-death";
|
|
18
|
+
readonly RECORD_DECLARE_DEATH_MY_JURISDICTION: "record.declare-death:my-jurisdiction";
|
|
19
|
+
readonly RECORD_DECLARE_MARRIAGE: "record.declare-marriage";
|
|
20
|
+
readonly RECORD_DECLARE_MARRIAGE_MY_JURISDICTION: "record.declare-marriage:my-jurisdiction";
|
|
21
|
+
readonly RECORD_SUBMIT_INCOMPLETE: "record.declaration-submit-incomplete";
|
|
22
|
+
readonly RECORD_SUBMIT_FOR_REVIEW: "record.declaration-submit-for-review";
|
|
23
|
+
readonly RECORD_UNASSIGN_OTHERS: "record.unassign-others";
|
|
24
|
+
readonly RECORD_SUBMIT_FOR_APPROVAL: "record.declaration-submit-for-approval";
|
|
25
|
+
readonly RECORD_SUBMIT_FOR_UPDATES: "record.declaration-submit-for-updates";
|
|
26
|
+
readonly RECORD_DECLARATION_EDIT: "record.declaration-edit";
|
|
27
|
+
readonly RECORD_REVIEW_DUPLICATES: "record.review-duplicates";
|
|
28
|
+
readonly RECORD_DECLARATION_ARCHIVE: "record.declaration-archive";
|
|
29
|
+
readonly RECORD_DECLARATION_REINSTATE: "record.declaration-reinstate";
|
|
30
|
+
readonly RECORD_REGISTER: "record.register";
|
|
31
|
+
/**
|
|
32
|
+
* This scope is used to **print and **issue certified copies of a record
|
|
33
|
+
* after it has been registered. Previously Registrars had this permission.
|
|
34
|
+
*/
|
|
35
|
+
readonly RECORD_PRINT_ISSUE_CERTIFIED_COPIES: "record.registration-print&issue-certified-copies";
|
|
36
|
+
readonly RECORD_REGISTRATION_REQUEST_CORRECTION: "record.registration-request-correction";
|
|
37
|
+
readonly RECORD_REGISTRATION_CORRECT: "record.registration-correct";
|
|
38
|
+
readonly RECORD_CONFIRM_REGISTRATION: "record.confirm-registration";
|
|
39
|
+
readonly RECORD_REJECT_REGISTRATION: "record.reject-registration";
|
|
40
|
+
readonly SEARCH_BIRTH_MY_JURISDICTION: "search.birth:my-jurisdiction";
|
|
41
|
+
readonly SEARCH_BIRTH: "search.birth";
|
|
42
|
+
readonly SEARCH_DEATH_MY_JURISDICTION: "search.death:my-jurisdiction";
|
|
43
|
+
readonly SEARCH_DEATH: "search.death";
|
|
44
|
+
readonly SEARCH_MARRIAGE_MY_JURISDICTION: "search.marriage:my-jurisdiction";
|
|
45
|
+
readonly SEARCH_MARRIAGE: "search.marriage";
|
|
46
|
+
readonly RECORD_READ: "record.read";
|
|
47
|
+
readonly PROFILE_ELECTRONIC_SIGNATURE: "profile.electronic-signature";
|
|
48
|
+
readonly PERFORMANCE_READ: "performance.read";
|
|
49
|
+
readonly PERFORMANCE_READ_DASHBOARDS: "performance.read-dashboards";
|
|
50
|
+
readonly PERFORMANCE_EXPORT_VITAL_STATISTICS: "performance.vital-statistics-export";
|
|
51
|
+
readonly ORGANISATION_READ_LOCATIONS: "organisation.read-locations:all";
|
|
52
|
+
readonly ORGANISATION_READ_LOCATIONS_MY_OFFICE: "organisation.read-locations:my-office";
|
|
53
|
+
readonly ORGANISATION_READ_LOCATIONS_MY_JURISDICTION: "organisation.read-locations:my-jurisdiction";
|
|
54
|
+
readonly USER_READ: "user.read:all";
|
|
55
|
+
readonly USER_READ_MY_OFFICE: "user.read:my-office";
|
|
56
|
+
readonly USER_READ_MY_JURISDICTION: "user.read:my-jurisdiction";
|
|
57
|
+
readonly USER_READ_ONLY_MY_AUDIT: "user.read:only-my-audit";
|
|
58
|
+
readonly USER_CREATE: "user.create:all";
|
|
59
|
+
readonly USER_CREATE_MY_JURISDICTION: "user.create:my-jurisdiction";
|
|
60
|
+
readonly USER_UPDATE: "user.update:all";
|
|
61
|
+
readonly USER_UPDATE_MY_JURISDICTION: "user.update:my-jurisdiction";
|
|
62
|
+
readonly CONFIG_UPDATE_ALL: "config.update:all";
|
|
63
|
+
readonly USER_DATA_SEEDING: "user.data-seeding";
|
|
64
|
+
};
|
|
65
|
+
export declare const SearchScopes: z.ZodUnion<[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">]>;
|
|
66
|
+
declare const LiteralScopes: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"register">, z.ZodLiteral<"demo">, z.ZodLiteral<"config">]>, z.ZodUnion<[z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">]>, z.ZodLiteral<"record.unassign-others">, z.ZodUnion<[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.ZodUnion<[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.registration-print&issue-certified-copies">, z.ZodUnion<[z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>, z.ZodUnion<[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<"profile.electronic-signature">, z.ZodUnion<[z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">]>, z.ZodUnion<[z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">]>, z.ZodUnion<[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">, z.ZodUnion<[z.ZodLiteral<"record.reindex">, z.ZodLiteral<"record.import">]>]>;
|
|
67
|
+
declare const SearchScope: z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"search">;
|
|
69
|
+
options: z.ZodObject<{
|
|
70
|
+
event: z.ZodArray<z.ZodString, "many">;
|
|
71
|
+
access: z.ZodArray<z.ZodEnum<["my-jurisdiction", "all"]>, "many">;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
event: string[];
|
|
74
|
+
access: ("my-jurisdiction" | "all")[];
|
|
75
|
+
}, {
|
|
76
|
+
event: string[];
|
|
77
|
+
access: ("my-jurisdiction" | "all")[];
|
|
143
78
|
}>;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
declaredBy: z.ZodOptional<z.ZodEnum<{
|
|
157
|
-
user: "user";
|
|
158
|
-
}>>;
|
|
159
|
-
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
160
|
-
administrativeArea: "administrativeArea";
|
|
161
|
-
location: "location";
|
|
162
|
-
all: "all";
|
|
163
|
-
}>>;
|
|
164
|
-
registeredBy: z.ZodOptional<z.ZodEnum<{
|
|
165
|
-
user: "user";
|
|
166
|
-
}>>;
|
|
167
|
-
}, z.core.$strip>>;
|
|
168
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
-
type: z.ZodLiteral<"record.custom-action">;
|
|
170
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
171
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
172
|
-
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
173
|
-
administrativeArea: "administrativeArea";
|
|
174
|
-
location: "location";
|
|
175
|
-
all: "all";
|
|
176
|
-
}>>;
|
|
177
|
-
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
178
|
-
administrativeArea: "administrativeArea";
|
|
179
|
-
location: "location";
|
|
180
|
-
all: "all";
|
|
181
|
-
}>>;
|
|
182
|
-
declaredBy: z.ZodOptional<z.ZodEnum<{
|
|
183
|
-
user: "user";
|
|
184
|
-
}>>;
|
|
185
|
-
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
186
|
-
administrativeArea: "administrativeArea";
|
|
187
|
-
location: "location";
|
|
188
|
-
all: "all";
|
|
189
|
-
}>>;
|
|
190
|
-
registeredBy: z.ZodOptional<z.ZodEnum<{
|
|
191
|
-
user: "user";
|
|
192
|
-
}>>;
|
|
193
|
-
customActionTypes: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
194
|
-
}, z.core.$strip>>;
|
|
195
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
196
|
-
type: z.ZodLiteral<"record.print-certified-copies">;
|
|
197
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
198
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
199
|
-
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
200
|
-
administrativeArea: "administrativeArea";
|
|
201
|
-
location: "location";
|
|
202
|
-
all: "all";
|
|
203
|
-
}>>;
|
|
204
|
-
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
205
|
-
administrativeArea: "administrativeArea";
|
|
206
|
-
location: "location";
|
|
207
|
-
all: "all";
|
|
208
|
-
}>>;
|
|
209
|
-
declaredBy: z.ZodOptional<z.ZodEnum<{
|
|
210
|
-
user: "user";
|
|
211
|
-
}>>;
|
|
212
|
-
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
213
|
-
administrativeArea: "administrativeArea";
|
|
214
|
-
location: "location";
|
|
215
|
-
all: "all";
|
|
216
|
-
}>>;
|
|
217
|
-
registeredBy: z.ZodOptional<z.ZodEnum<{
|
|
218
|
-
user: "user";
|
|
219
|
-
}>>;
|
|
220
|
-
templates: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
221
|
-
}, z.core.$strip>>;
|
|
222
|
-
}, z.core.$strip>], "type">;
|
|
223
|
-
export declare function scopeUsesDeclaredOptions(scope: Scope): scope is Extract<Scope, {
|
|
224
|
-
type: z.infer<typeof ScopesWithDeclaredOptions>;
|
|
225
|
-
}>;
|
|
226
|
-
export declare function scopeUsesFullOptions(scope: Scope): scope is Extract<Scope, {
|
|
227
|
-
type: z.infer<typeof ScopesWithFullOptions>;
|
|
228
|
-
}>;
|
|
229
|
-
export declare function scopeUsesPrintCertifiedCopiesOptions(scope: Scope): scope is Extract<Scope, {
|
|
230
|
-
type: 'record.print-certified-copies';
|
|
231
|
-
}>;
|
|
232
|
-
export declare function isCustomActionScope(scope: Scope): scope is Extract<Scope, {
|
|
233
|
-
type: 'record.custom-action';
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
type: "search";
|
|
81
|
+
options: {
|
|
82
|
+
event: string[];
|
|
83
|
+
access: ("my-jurisdiction" | "all")[];
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
type: "search";
|
|
87
|
+
options: {
|
|
88
|
+
event: string[];
|
|
89
|
+
access: ("my-jurisdiction" | "all")[];
|
|
90
|
+
};
|
|
234
91
|
}>;
|
|
235
|
-
|
|
236
|
-
type: z.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
type: z.ZodEnum<{
|
|
247
|
-
"record.edit": "record.edit";
|
|
248
|
-
"record.reject": "record.reject";
|
|
249
|
-
"record.archive": "record.archive";
|
|
250
|
-
"record.review-duplicates": "record.review-duplicates";
|
|
251
|
-
"record.register": "record.register";
|
|
252
|
-
}>;
|
|
253
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
254
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
255
|
-
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
256
|
-
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
257
|
-
declaredBy: z.ZodOptional<z.ZodString>;
|
|
258
|
-
}, z.core.$strip>>;
|
|
259
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
260
|
-
type: z.ZodEnum<{
|
|
261
|
-
"record.search": "record.search";
|
|
262
|
-
"record.read": "record.read";
|
|
263
|
-
"record.request-correction": "record.request-correction";
|
|
264
|
-
"record.correct": "record.correct";
|
|
265
|
-
"record.unassign-others": "record.unassign-others";
|
|
92
|
+
declare const PrintCertifiedCopiesScope: z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"record.registered.print-certified-copies">;
|
|
94
|
+
options: z.ZodObject<{
|
|
95
|
+
event: z.ZodArray<z.ZodString, "many">;
|
|
96
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
event: string[];
|
|
99
|
+
templates?: string[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
event: string[];
|
|
102
|
+
templates?: string[] | undefined;
|
|
266
103
|
}>;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
placeOfEvent: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
280
|
-
declaredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
281
|
-
declaredBy: z.ZodOptional<z.ZodString>;
|
|
282
|
-
registeredIn: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
283
|
-
registeredBy: z.ZodOptional<z.ZodString>;
|
|
284
|
-
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
285
|
-
}, z.core.$strip>>;
|
|
286
|
-
}, z.core.$strip>], "type">;
|
|
287
|
-
export type RecordScopeV2 = z.infer<typeof RecordScopeV2>;
|
|
288
|
-
export type ResolvedRecordScopeV2 = z.infer<typeof ResolvedRecordScopeV2>;
|
|
289
|
-
declare const SystemScopeType: z.ZodEnum<{
|
|
290
|
-
"organisation.read-locations": "organisation.read-locations";
|
|
291
|
-
"user.read": "user.read";
|
|
292
|
-
"user.create": "user.create";
|
|
293
|
-
"user.edit": "user.edit";
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
type: "record.registered.print-certified-copies";
|
|
106
|
+
options: {
|
|
107
|
+
event: string[];
|
|
108
|
+
templates?: string[] | undefined;
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
type: "record.registered.print-certified-copies";
|
|
112
|
+
options: {
|
|
113
|
+
event: string[];
|
|
114
|
+
templates?: string[] | undefined;
|
|
115
|
+
};
|
|
294
116
|
}>;
|
|
295
|
-
export type
|
|
296
|
-
|
|
297
|
-
export declare const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
"user.read-only-my-audit": "user.read-only-my-audit";
|
|
308
|
-
"performance.read": "performance.read";
|
|
309
|
-
"performance.read-dashboards": "performance.read-dashboards";
|
|
310
|
-
"performance.vital-statistics-export": "performance.vital-statistics-export";
|
|
311
|
-
"record.confirm-registration": "record.confirm-registration";
|
|
312
|
-
"record.reject-registration": "record.reject-registration";
|
|
117
|
+
export type SearchScope = z.infer<typeof SearchScope>;
|
|
118
|
+
export type PrintCertifiedCopiesScope = z.infer<typeof PrintCertifiedCopiesScope>;
|
|
119
|
+
export declare const RecordScopeType: z.ZodEnum<["record.create", "record.read", "record.declare", "record.notify", "record.declared.validate", "record.declared.reject", "record.declared.archive", "record.declared.review-duplicates", "record.register", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
|
|
120
|
+
export type RecordScopeType = z.infer<typeof RecordScopeType>;
|
|
121
|
+
export declare const RecordScope: z.ZodObject<{
|
|
122
|
+
type: z.ZodEnum<["record.create", "record.read", "record.declare", "record.notify", "record.declared.validate", "record.declared.reject", "record.declared.archive", "record.declared.review-duplicates", "record.register", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
|
|
123
|
+
options: z.ZodObject<{
|
|
124
|
+
event: z.ZodArray<z.ZodString, "many">;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
event: string[];
|
|
127
|
+
}, {
|
|
128
|
+
event: string[];
|
|
313
129
|
}>;
|
|
314
|
-
},
|
|
315
|
-
type:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
|
|
132
|
+
options: {
|
|
133
|
+
event: string[];
|
|
134
|
+
};
|
|
135
|
+
}, {
|
|
136
|
+
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
|
|
137
|
+
options: {
|
|
138
|
+
event: string[];
|
|
139
|
+
};
|
|
140
|
+
}>;
|
|
141
|
+
export type RecordScope = z.infer<typeof RecordScope>;
|
|
142
|
+
declare const ConfigurableRawScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"search">;
|
|
144
|
+
options: z.ZodObject<{
|
|
145
|
+
event: z.ZodArray<z.ZodString, "many">;
|
|
146
|
+
access: z.ZodArray<z.ZodEnum<["my-jurisdiction", "all"]>, "many">;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
event: string[];
|
|
149
|
+
access: ("my-jurisdiction" | "all")[];
|
|
150
|
+
}, {
|
|
151
|
+
event: string[];
|
|
152
|
+
access: ("my-jurisdiction" | "all")[];
|
|
319
153
|
}>;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
type: "search";
|
|
156
|
+
options: {
|
|
157
|
+
event: string[];
|
|
158
|
+
access: ("my-jurisdiction" | "all")[];
|
|
159
|
+
};
|
|
160
|
+
}, {
|
|
161
|
+
type: "search";
|
|
162
|
+
options: {
|
|
163
|
+
event: string[];
|
|
164
|
+
access: ("my-jurisdiction" | "all")[];
|
|
165
|
+
};
|
|
166
|
+
}>, z.ZodObject<{
|
|
167
|
+
type: z.ZodLiteral<"record.registered.print-certified-copies">;
|
|
168
|
+
options: z.ZodObject<{
|
|
169
|
+
event: z.ZodArray<z.ZodString, "many">;
|
|
170
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
171
|
+
}, "strip", z.ZodTypeAny, {
|
|
172
|
+
event: string[];
|
|
173
|
+
templates?: string[] | undefined;
|
|
174
|
+
}, {
|
|
175
|
+
event: string[];
|
|
176
|
+
templates?: string[] | undefined;
|
|
335
177
|
}>;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
"record.request-correction": "record.request-correction";
|
|
357
|
-
"record.correct": "record.correct";
|
|
358
|
-
"record.unassign-others": "record.unassign-others";
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
type: "record.registered.print-certified-copies";
|
|
180
|
+
options: {
|
|
181
|
+
event: string[];
|
|
182
|
+
templates?: string[] | undefined;
|
|
183
|
+
};
|
|
184
|
+
}, {
|
|
185
|
+
type: "record.registered.print-certified-copies";
|
|
186
|
+
options: {
|
|
187
|
+
event: string[];
|
|
188
|
+
templates?: string[] | undefined;
|
|
189
|
+
};
|
|
190
|
+
}>, z.ZodObject<{
|
|
191
|
+
type: z.ZodLiteral<"user.create">;
|
|
192
|
+
options: z.ZodObject<{
|
|
193
|
+
role: z.ZodArray<z.ZodString, "many">;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
role: string[];
|
|
196
|
+
}, {
|
|
197
|
+
role: string[];
|
|
359
198
|
}>;
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
all: "all";
|
|
379
|
-
}>>;
|
|
380
|
-
registeredBy: z.ZodOptional<z.ZodEnum<{
|
|
381
|
-
user: "user";
|
|
382
|
-
}>>;
|
|
383
|
-
}, z.core.$strip>>;
|
|
384
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
385
|
-
type: z.ZodLiteral<"record.custom-action">;
|
|
386
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
387
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
388
|
-
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
389
|
-
administrativeArea: "administrativeArea";
|
|
390
|
-
location: "location";
|
|
391
|
-
all: "all";
|
|
392
|
-
}>>;
|
|
393
|
-
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
394
|
-
administrativeArea: "administrativeArea";
|
|
395
|
-
location: "location";
|
|
396
|
-
all: "all";
|
|
397
|
-
}>>;
|
|
398
|
-
declaredBy: z.ZodOptional<z.ZodEnum<{
|
|
399
|
-
user: "user";
|
|
400
|
-
}>>;
|
|
401
|
-
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
402
|
-
administrativeArea: "administrativeArea";
|
|
403
|
-
location: "location";
|
|
404
|
-
all: "all";
|
|
405
|
-
}>>;
|
|
406
|
-
registeredBy: z.ZodOptional<z.ZodEnum<{
|
|
407
|
-
user: "user";
|
|
408
|
-
}>>;
|
|
409
|
-
customActionTypes: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
410
|
-
}, z.core.$strip>>;
|
|
411
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
412
|
-
type: z.ZodLiteral<"record.print-certified-copies">;
|
|
413
|
-
options: z.ZodOptional<z.ZodObject<{
|
|
414
|
-
event: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
415
|
-
placeOfEvent: z.ZodOptional<z.ZodEnum<{
|
|
416
|
-
administrativeArea: "administrativeArea";
|
|
417
|
-
location: "location";
|
|
418
|
-
all: "all";
|
|
419
|
-
}>>;
|
|
420
|
-
declaredIn: z.ZodOptional<z.ZodEnum<{
|
|
421
|
-
administrativeArea: "administrativeArea";
|
|
422
|
-
location: "location";
|
|
423
|
-
all: "all";
|
|
424
|
-
}>>;
|
|
425
|
-
declaredBy: z.ZodOptional<z.ZodEnum<{
|
|
426
|
-
user: "user";
|
|
427
|
-
}>>;
|
|
428
|
-
registeredIn: z.ZodOptional<z.ZodEnum<{
|
|
429
|
-
administrativeArea: "administrativeArea";
|
|
430
|
-
location: "location";
|
|
431
|
-
all: "all";
|
|
432
|
-
}>>;
|
|
433
|
-
registeredBy: z.ZodOptional<z.ZodEnum<{
|
|
434
|
-
user: "user";
|
|
435
|
-
}>>;
|
|
436
|
-
templates: z.ZodPipe<z.ZodTransform<({} | null)[] | undefined, unknown>, z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
437
|
-
}, z.core.$strip>>;
|
|
438
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
439
|
-
type: z.ZodEnum<{
|
|
440
|
-
"organisation.read-locations": "organisation.read-locations";
|
|
441
|
-
"user.read": "user.read";
|
|
442
|
-
"user.create": "user.create";
|
|
443
|
-
"user.edit": "user.edit";
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
type: "user.create";
|
|
201
|
+
options: {
|
|
202
|
+
role: string[];
|
|
203
|
+
};
|
|
204
|
+
}, {
|
|
205
|
+
type: "user.create";
|
|
206
|
+
options: {
|
|
207
|
+
role: string[];
|
|
208
|
+
};
|
|
209
|
+
}>, z.ZodObject<{
|
|
210
|
+
type: z.ZodLiteral<"user.edit">;
|
|
211
|
+
options: z.ZodObject<{
|
|
212
|
+
role: z.ZodArray<z.ZodString, "many">;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
role: string[];
|
|
215
|
+
}, {
|
|
216
|
+
role: string[];
|
|
444
217
|
}>;
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
218
|
+
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
type: "user.edit";
|
|
220
|
+
options: {
|
|
221
|
+
role: string[];
|
|
222
|
+
};
|
|
223
|
+
}, {
|
|
224
|
+
type: "user.edit";
|
|
225
|
+
options: {
|
|
226
|
+
role: string[];
|
|
227
|
+
};
|
|
228
|
+
}>, z.ZodObject<{
|
|
453
229
|
type: z.ZodLiteral<"workqueue">;
|
|
454
230
|
options: z.ZodObject<{
|
|
455
|
-
|
|
456
|
-
}, z.
|
|
457
|
-
|
|
458
|
-
|
|
231
|
+
id: z.ZodArray<z.ZodString, "many">;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
id: string[];
|
|
234
|
+
}, {
|
|
235
|
+
id: string[];
|
|
236
|
+
}>;
|
|
237
|
+
}, "strip", z.ZodTypeAny, {
|
|
238
|
+
type: "workqueue";
|
|
239
|
+
options: {
|
|
240
|
+
id: string[];
|
|
241
|
+
};
|
|
242
|
+
}, {
|
|
243
|
+
type: "workqueue";
|
|
244
|
+
options: {
|
|
245
|
+
id: string[];
|
|
246
|
+
};
|
|
247
|
+
}>, z.ZodObject<{
|
|
248
|
+
type: z.ZodEnum<["record.create", "record.read", "record.declare", "record.notify", "record.declared.validate", "record.declared.reject", "record.declared.archive", "record.declared.review-duplicates", "record.register", "record.registered.request-correction", "record.registered.correct", "record.unassign-others"]>;
|
|
459
249
|
options: z.ZodObject<{
|
|
460
|
-
|
|
461
|
-
}, z.
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
"record.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
"record.
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
250
|
+
event: z.ZodArray<z.ZodString, "many">;
|
|
251
|
+
}, "strip", z.ZodTypeAny, {
|
|
252
|
+
event: string[];
|
|
253
|
+
}, {
|
|
254
|
+
event: string[];
|
|
255
|
+
}>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
|
|
258
|
+
options: {
|
|
259
|
+
event: string[];
|
|
260
|
+
};
|
|
261
|
+
}, {
|
|
262
|
+
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
|
|
263
|
+
options: {
|
|
264
|
+
event: string[];
|
|
265
|
+
};
|
|
266
|
+
}>]>;
|
|
267
|
+
type ConfigurableRawScopes = z.infer<typeof ConfigurableRawScopes>;
|
|
268
|
+
export type ConfigurableScopeType = ConfigurableRawScopes['type'];
|
|
269
|
+
type FlattenedSearchScope = {
|
|
270
|
+
type: 'search';
|
|
271
|
+
options: Record<string, SearchScopeAccessLevels>;
|
|
272
|
+
};
|
|
273
|
+
export type ConfigurableScopes = Exclude<ConfigurableRawScopes, {
|
|
274
|
+
type: 'search';
|
|
275
|
+
}> | FlattenedSearchScope;
|
|
276
|
+
export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{
|
|
277
|
+
type: "record.registered.print-certified-copies";
|
|
278
|
+
options: {
|
|
279
|
+
event: string[];
|
|
280
|
+
templates?: string[] | undefined;
|
|
281
|
+
};
|
|
282
|
+
}, {
|
|
283
|
+
type: T;
|
|
284
|
+
}> | Extract<{
|
|
285
|
+
type: "user.create";
|
|
286
|
+
options: {
|
|
287
|
+
role: string[];
|
|
288
|
+
};
|
|
289
|
+
}, {
|
|
290
|
+
type: T;
|
|
291
|
+
}> | Extract<{
|
|
292
|
+
type: "user.edit";
|
|
293
|
+
options: {
|
|
294
|
+
role: string[];
|
|
295
|
+
};
|
|
296
|
+
}, {
|
|
297
|
+
type: T;
|
|
298
|
+
}> | Extract<{
|
|
299
|
+
type: "workqueue";
|
|
300
|
+
options: {
|
|
301
|
+
id: string[];
|
|
302
|
+
};
|
|
303
|
+
}, {
|
|
304
|
+
type: T;
|
|
305
|
+
}> | Extract<{
|
|
306
|
+
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
|
|
307
|
+
options: {
|
|
308
|
+
event: string[];
|
|
309
|
+
};
|
|
310
|
+
}, {
|
|
311
|
+
type: T;
|
|
312
|
+
}> | Extract<FlattenedSearchScope, {
|
|
313
|
+
type: T;
|
|
314
|
+
}> | undefined;
|
|
516
315
|
/**
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
* @
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
316
|
+
* Parses a configurable scope string into a ConfigurableRawScopes object.
|
|
317
|
+
* @param {string} scope - The scope string to parse
|
|
318
|
+
* @returns {ConfigurableRawScopes | undefined} The parsed scope object if valid, undefined otherwise
|
|
319
|
+
* @example
|
|
320
|
+
* parseScope("user.create[role=field-agent|registration-agent]")
|
|
321
|
+
* // Returns: { type: "user.create", options: { role: ["field-agent", "registration-agent"] } }
|
|
523
322
|
*/
|
|
524
|
-
export declare
|
|
525
|
-
type: "record.
|
|
526
|
-
options
|
|
527
|
-
event
|
|
528
|
-
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
529
|
-
} | undefined;
|
|
530
|
-
} | {
|
|
531
|
-
type: "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register";
|
|
532
|
-
options?: {
|
|
533
|
-
event?: string[] | undefined;
|
|
534
|
-
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
535
|
-
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
536
|
-
declaredBy?: "user" | undefined;
|
|
537
|
-
} | undefined;
|
|
538
|
-
} | {
|
|
539
|
-
type: "record.search" | "record.read" | "record.request-correction" | "record.correct" | "record.unassign-others";
|
|
540
|
-
options?: {
|
|
541
|
-
event?: string[] | undefined;
|
|
542
|
-
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
543
|
-
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
544
|
-
declaredBy?: "user" | undefined;
|
|
545
|
-
registeredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
546
|
-
registeredBy?: "user" | undefined;
|
|
547
|
-
} | undefined;
|
|
548
|
-
} | {
|
|
549
|
-
type: "record.custom-action";
|
|
550
|
-
options?: {
|
|
551
|
-
event?: string[] | undefined;
|
|
552
|
-
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
553
|
-
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
554
|
-
declaredBy?: "user" | undefined;
|
|
555
|
-
registeredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
556
|
-
registeredBy?: "user" | undefined;
|
|
557
|
-
customActionTypes?: string[] | undefined;
|
|
558
|
-
} | undefined;
|
|
559
|
-
} | {
|
|
560
|
-
type: "record.print-certified-copies";
|
|
561
|
-
options?: {
|
|
562
|
-
event?: string[] | undefined;
|
|
563
|
-
placeOfEvent?: "administrativeArea" | "location" | "all" | undefined;
|
|
564
|
-
declaredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
565
|
-
declaredBy?: "user" | undefined;
|
|
566
|
-
registeredIn?: "administrativeArea" | "location" | "all" | undefined;
|
|
567
|
-
registeredBy?: "user" | undefined;
|
|
323
|
+
export declare function parseConfigurableScope(scope: string): {
|
|
324
|
+
type: "record.registered.print-certified-copies";
|
|
325
|
+
options: {
|
|
326
|
+
event: string[];
|
|
568
327
|
templates?: string[] | undefined;
|
|
569
|
-
}
|
|
328
|
+
};
|
|
570
329
|
} | {
|
|
571
|
-
type: "
|
|
330
|
+
type: "search";
|
|
331
|
+
options: {
|
|
332
|
+
event: string[];
|
|
333
|
+
access: ("my-jurisdiction" | "all")[];
|
|
334
|
+
};
|
|
572
335
|
} | {
|
|
573
|
-
type: "
|
|
574
|
-
options
|
|
575
|
-
|
|
576
|
-
}
|
|
336
|
+
type: "user.create";
|
|
337
|
+
options: {
|
|
338
|
+
role: string[];
|
|
339
|
+
};
|
|
340
|
+
} | {
|
|
341
|
+
type: "user.edit";
|
|
342
|
+
options: {
|
|
343
|
+
role: string[];
|
|
344
|
+
};
|
|
577
345
|
} | {
|
|
578
346
|
type: "workqueue";
|
|
579
347
|
options: {
|
|
580
|
-
|
|
348
|
+
id: string[];
|
|
581
349
|
};
|
|
582
350
|
} | {
|
|
583
|
-
type: "
|
|
351
|
+
type: "record.unassign-others" | "record.register" | "record.read" | "record.create" | "record.declare" | "record.notify" | "record.declared.validate" | "record.declared.reject" | "record.declared.archive" | "record.declared.review-duplicates" | "record.registered.request-correction" | "record.registered.correct";
|
|
584
352
|
options: {
|
|
585
|
-
|
|
353
|
+
event: string[];
|
|
586
354
|
};
|
|
587
355
|
} | undefined;
|
|
356
|
+
export declare function parseLiteralScope(scope: string): {
|
|
357
|
+
type: "bypassratelimit" | "register" | "demo" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.import" | "record.reindex" | "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.registration-print&issue-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "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" | "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";
|
|
358
|
+
} | undefined;
|
|
588
359
|
/**
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
* @
|
|
592
|
-
* @
|
|
593
|
-
*
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
scopes: EncodedScope[];
|
|
599
|
-
}): Scope[];
|
|
600
|
-
/**
|
|
601
|
-
* Checks if the provided scopes or token contain any of the accepted scopes.
|
|
602
|
-
*
|
|
603
|
-
* Overloads:
|
|
604
|
-
* - `hasAnyScope(token, scopes)` → extracts scopes from a token
|
|
605
|
-
* - `hasAnyScope(scopes, scopes)` → checks directly from a scope array
|
|
606
|
-
*/
|
|
607
|
-
/**
|
|
608
|
-
* Checks if the provided token contains any of the accepted scopes.
|
|
609
|
-
*
|
|
610
|
-
* @param {string} token - The authentication JWT token.
|
|
611
|
-
* @param {ScopeType[]} scopes - An array of scope types to check for.
|
|
612
|
-
* @returns {boolean} True if the token contains at least one of the accepted scopes, false otherwise.
|
|
613
|
-
*/
|
|
614
|
-
export declare function hasAnyScope(token: string, scopes: ScopeType[]): boolean;
|
|
615
|
-
/**
|
|
616
|
-
* Checks if the provided array of scopes contains any of the accepted scopes.
|
|
617
|
-
*
|
|
618
|
-
* @param {EncodedScope[]} userScopes - Array of scopes to check.
|
|
619
|
-
* @param {ScopeType[]} scopes - An array of scope types to check for.
|
|
620
|
-
* @returns {boolean} True if the scope list contains at least one of the accepted scopes.
|
|
621
|
-
*/
|
|
622
|
-
export declare function hasAnyScope(userScopes: EncodedScope[], scopes: ScopeType[]): boolean;
|
|
623
|
-
/**
|
|
624
|
-
* Checks whether a scope exists either inside a JWT token or
|
|
625
|
-
* within a provided list of scopes.
|
|
626
|
-
*
|
|
627
|
-
* Overloads:
|
|
628
|
-
* - `hasScope(token, scope)` → extracts scopes from a token
|
|
629
|
-
* - `hasScope(scopes, scope)` → checks directly from a scope array
|
|
630
|
-
*/
|
|
631
|
-
/**
|
|
632
|
-
* Checks if the provided token contains the given scope.
|
|
633
|
-
*
|
|
634
|
-
* @param token - The authentication JWT token.
|
|
635
|
-
* @param scope - The scope type to check for.
|
|
636
|
-
* @returns True if the token contains the specified scope.
|
|
637
|
-
*/
|
|
638
|
-
export declare function hasScope(token: string, scope: ScopeType): boolean;
|
|
639
|
-
/**
|
|
640
|
-
* Checks if the provided list of scopes contains the given scope.
|
|
641
|
-
*
|
|
642
|
-
* @param scopes - Array of scopes to check.
|
|
643
|
-
* @param scope - The scope type to check for.
|
|
644
|
-
* @returns True if the scope list contains the specified scope.
|
|
645
|
-
*/
|
|
646
|
-
export declare function hasScope(scopes: EncodedScope[], scope: ScopeType): boolean;
|
|
647
|
-
/**
|
|
648
|
-
* Checks if the given event type is allowed by the accepted scopes. If no specific event types are defined, it returns true.
|
|
649
|
-
*
|
|
650
|
-
* @param {Scope[]} userScopes - The scopes of the user.
|
|
651
|
-
* @param {string} eventType - The event type to check for permission.
|
|
652
|
-
* @returns {boolean} Returns true if the event type is allowed by the scope.
|
|
653
|
-
*/
|
|
654
|
-
export declare function canUserCreateEvent(userScopes: EncodedScope[], eventType: string): boolean;
|
|
655
|
-
/**
|
|
656
|
-
* Helper for defining scopes for user roles. Should be used in country config.
|
|
657
|
-
*
|
|
658
|
-
* @param scopes Array of scopes in object format.
|
|
659
|
-
* @returns Array of scopes in string format, encoded for use in JWT tokens.
|
|
360
|
+
* Stringifies a ConfigurableScopes object into a scope string.
|
|
361
|
+
* @param {ConfigurableScopes} scope - The scope object to stringify
|
|
362
|
+
* @returns {string} The stringified scope in format "type[key1=value1|value2,key2=value3|value4]"
|
|
363
|
+
* @example
|
|
364
|
+
* stringifyScope({
|
|
365
|
+
* type: "record.notify",
|
|
366
|
+
* options: { event: ["birth", "tennis-club-membership"] }
|
|
367
|
+
* })
|
|
368
|
+
* // Returns: "record.notify[event=birth|tennis-club-membership]"
|
|
660
369
|
*/
|
|
661
|
-
export declare function
|
|
370
|
+
export declare function stringifyScope(scope: z.infer<typeof ConfigurableRawScopes>): string;
|
|
662
371
|
/**
|
|
663
|
-
*
|
|
372
|
+
* Extracts authorized event identifiers (e.g. birth, death) from the provided configurable scopes.
|
|
664
373
|
*
|
|
665
|
-
* @param
|
|
374
|
+
* @param scopes - Array of configurable scopes with options
|
|
375
|
+
* @returns Array of authorized event identifiers
|
|
666
376
|
*/
|
|
667
|
-
export declare function
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
}
|
|
377
|
+
export declare function getAuthorizedEventsFromScopes(scopes: ConfigurableScopes[]): string[];
|
|
378
|
+
export declare const scopes: Scope[];
|
|
379
|
+
export type ParsedScopes = NonNullable<ReturnType<typeof parseConfigurableScope>>;
|
|
380
|
+
export type RawScopes = z.infer<typeof LiteralScopes> | (string & {});
|
|
381
|
+
export type Scope = RawScopes;
|
|
382
|
+
export declare const ActionScopes: z.ZodUnion<[z.ZodUnion<[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.ZodUnion<[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.registration-print&issue-certified-copies">, z.ZodUnion<[z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">]>]>;
|
|
383
|
+
export type ActionScopes = z.infer<typeof ActionScopes>;
|
|
671
384
|
export {};
|
|
672
385
|
//# sourceMappingURL=scopes.d.ts.map
|