@opencrvs/toolkit 2.2.0-rc.045257f → 2.2.0-rc.19ec10b
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 +7 -2
- package/dist/application-config/index.js +16 -5
- package/dist/authentication/index.d.ts +1 -1
- package/dist/authentication/index.js +4 -8
- package/dist/cli.js +927 -356
- package/dist/commons/api/router.d.ts +17 -4
- package/dist/commons/application-config/index.d.ts +1 -1
- package/dist/commons/conditionals/conditionals.d.ts +55 -4
- package/dist/commons/conditionals/validate.d.ts +1 -1
- package/dist/commons/events/ActionStatus.d.ts +2 -2
- package/dist/commons/events/ActionType.d.ts +2 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +3 -0
- package/dist/commons/events/Draft.d.ts +34 -1
- package/dist/commons/events/EventConfig.d.ts +446 -0
- package/dist/commons/events/EventDocument.d.ts +2 -0
- package/dist/commons/events/EventIndex.d.ts +1 -0
- package/dist/commons/events/EventInput.d.ts +1 -0
- package/dist/commons/events/EventMetadata.d.ts +1 -0
- package/dist/commons/events/FieldTypeMapping.d.ts +19 -19
- package/dist/commons/events/PlainDate.d.ts +5 -0
- package/dist/commons/events/defineConfig.d.ts +7 -2
- package/dist/commons/events/event.d.ts +20 -1
- package/dist/commons/events/field.d.ts +37 -0
- package/dist/commons/events/locations.d.ts +1 -1
- package/dist/commons/events/scopes.d.ts +2 -1
- package/dist/commons/events/state/index.d.ts +1 -0
- package/dist/commons/events/test.utils.d.ts +59 -6
- package/dist/commons/events/utils.d.ts +28 -2
- package/dist/commons/users/Role.d.ts +23 -0
- package/dist/commons/users/User.d.ts +263 -0
- package/dist/commons/users/authentication.d.ts +67 -0
- package/dist/commons/users/index.d.ts +5 -0
- package/dist/commons/users/roleValidations.d.ts +15 -0
- package/dist/commons/users/scopes.d.ts +1402 -0
- package/dist/commons/users/userReferences.d.ts +176 -0
- package/dist/conditionals/index.js +13 -5
- package/dist/environment/custom-types.d.ts +1 -0
- package/dist/environment/custom-types.d.ts.map +1 -1
- package/dist/environment/derived-variables.d.ts +8 -0
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +9 -0
- package/dist/environment/questions.d.ts +42 -9
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +70 -47
- package/dist/environment/registry.d.ts +15 -0
- package/dist/environment/registry.d.ts.map +1 -0
- package/dist/environment/registry.js +112 -0
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +104 -23
- package/dist/events/index.js +1627 -1100
- package/dist/migrations/add-notify-config.d.ts +40 -0
- package/dist/migrations/add-notify-config.d.ts.map +1 -0
- package/dist/migrations/add-notify-config.js +249 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +602 -143
- package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -1
- package/dist/migrations/move-declaration-to-declare-action.js +27 -144
- package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -1
- package/dist/migrations/read-declaration-through-helper.js +3 -61
- package/dist/migrations/resolve-versioned-event-config.d.ts +56 -0
- package/dist/migrations/resolve-versioned-event-config.d.ts.map +1 -0
- package/dist/migrations/resolve-versioned-event-config.js +353 -0
- package/dist/migrations/utils.d.ts +61 -0
- package/dist/migrations/utils.d.ts.map +1 -0
- package/dist/migrations/utils.js +218 -0
- package/dist/notification/index.js +707 -119
- package/dist/roles/index.d.ts +2 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/dist/roles/index.js +730 -0
- package/dist/scopes/index.d.ts +0 -10
- package/dist/scopes/index.js +3 -7
- package/dist/templates/charts-values/dependencies/values.yaml +5 -2
- package/dist/templates/charts-values/opencrvs-services/values.yaml +2 -5
- package/dist/verify/endpoints.d.ts +11 -0
- package/dist/verify/endpoints.d.ts.map +1 -1
- package/dist/verify/endpoints.js +21 -27
- package/opencrvs-toolkit-2.2.0-rc.19ec10b.tgz +0 -0
- package/package.json +4 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +3 -5
- package/dist/environment/dockerhub.d.ts +0 -15
- package/dist/environment/dockerhub.d.ts.map +0 -1
- package/dist/environment/dockerhub.js +0 -104
- package/opencrvs-toolkit-2.2.0-rc.045257f.tgz +0 -0
|
@@ -114,7 +114,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
114
114
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
115
115
|
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
116
116
|
input: void;
|
|
117
|
-
output: import("../commons").
|
|
117
|
+
output: import("../commons").VersionedEventConfig[];
|
|
118
118
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
119
119
|
}>;
|
|
120
120
|
}>>;
|
|
@@ -123,6 +123,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
123
123
|
transactionId: string;
|
|
124
124
|
type: string;
|
|
125
125
|
createdAtLocation?: string | null | undefined;
|
|
126
|
+
configVersionId?: string | undefined;
|
|
126
127
|
};
|
|
127
128
|
output: {
|
|
128
129
|
id: string & import("zod").$brand<"UUID">;
|
|
@@ -469,6 +470,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
469
470
|
status: "Rejected";
|
|
470
471
|
})[];
|
|
471
472
|
trackingId: string;
|
|
473
|
+
configVersionId: string;
|
|
472
474
|
};
|
|
473
475
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
474
476
|
}>;
|
|
@@ -822,6 +824,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
822
824
|
status: "Rejected";
|
|
823
825
|
})[];
|
|
824
826
|
trackingId: string;
|
|
827
|
+
configVersionId: string;
|
|
825
828
|
};
|
|
826
829
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
827
830
|
}>;
|
|
@@ -1175,6 +1178,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1175
1178
|
status: "Rejected";
|
|
1176
1179
|
})[];
|
|
1177
1180
|
trackingId: string;
|
|
1181
|
+
configVersionId: string;
|
|
1178
1182
|
}[];
|
|
1179
1183
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
1180
1184
|
}>;
|
|
@@ -1227,7 +1231,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1227
1231
|
annotation?: Record<string, import("../commons").FieldUpdateValue> | null | undefined;
|
|
1228
1232
|
status: "Accepted" | "Rejected" | "Requested";
|
|
1229
1233
|
originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
1230
|
-
type: "
|
|
1234
|
+
type: "DECLARE" | "NOTIFY";
|
|
1231
1235
|
};
|
|
1232
1236
|
}[];
|
|
1233
1237
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
@@ -1243,7 +1247,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1243
1247
|
keepAssignmentIfAccepted?: boolean | undefined;
|
|
1244
1248
|
keepAssignmentIfRejected?: boolean | undefined;
|
|
1245
1249
|
createdAtLocation?: string | null | undefined;
|
|
1246
|
-
type: "DECLARE";
|
|
1250
|
+
type: "DECLARE" | "NOTIFY";
|
|
1247
1251
|
status: "Accepted" | "Rejected" | "Requested";
|
|
1248
1252
|
};
|
|
1249
1253
|
output: {
|
|
@@ -1262,7 +1266,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1262
1266
|
annotation?: Record<string, import("../commons").FieldUpdateValue> | null | undefined;
|
|
1263
1267
|
status: "Accepted" | "Rejected" | "Requested";
|
|
1264
1268
|
originalActionId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
1265
|
-
type: "
|
|
1269
|
+
type: "DECLARE" | "NOTIFY";
|
|
1266
1270
|
};
|
|
1267
1271
|
};
|
|
1268
1272
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
@@ -2030,6 +2034,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
2030
2034
|
status: "Rejected";
|
|
2031
2035
|
})[];
|
|
2032
2036
|
trackingId: string;
|
|
2037
|
+
configVersionId: string;
|
|
2033
2038
|
};
|
|
2034
2039
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
2035
2040
|
}>;
|
|
@@ -2715,6 +2720,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
2715
2720
|
status: "Rejected";
|
|
2716
2721
|
})[];
|
|
2717
2722
|
trackingId: string;
|
|
2723
|
+
configVersionId: string;
|
|
2718
2724
|
};
|
|
2719
2725
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
2720
2726
|
}>;
|
|
@@ -5369,6 +5375,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5369
5375
|
status: "Rejected";
|
|
5370
5376
|
})[];
|
|
5371
5377
|
trackingId: string;
|
|
5378
|
+
configVersionId: string;
|
|
5372
5379
|
};
|
|
5373
5380
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
5374
5381
|
}>;
|
|
@@ -5416,6 +5423,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5416
5423
|
createdAt: string;
|
|
5417
5424
|
updatedAt: string;
|
|
5418
5425
|
trackingId: string;
|
|
5426
|
+
configVersionId: string;
|
|
5419
5427
|
actions: ({
|
|
5420
5428
|
id: string & import("zod").$brand<"UUID">;
|
|
5421
5429
|
transactionId: string;
|
|
@@ -5779,6 +5787,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
5779
5787
|
createdAt: string;
|
|
5780
5788
|
updatedAt: string;
|
|
5781
5789
|
trackingId: string;
|
|
5790
|
+
configVersionId: string;
|
|
5782
5791
|
actions: ({
|
|
5783
5792
|
id: string & import("zod").$brand<"UUID">;
|
|
5784
5793
|
transactionId: string;
|
|
@@ -8192,6 +8201,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8192
8201
|
status: "Rejected";
|
|
8193
8202
|
})[];
|
|
8194
8203
|
trackingId: string;
|
|
8204
|
+
configVersionId: string;
|
|
8195
8205
|
};
|
|
8196
8206
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
8197
8207
|
}>;
|
|
@@ -8554,6 +8564,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8554
8564
|
status: "Rejected";
|
|
8555
8565
|
})[];
|
|
8556
8566
|
trackingId: string;
|
|
8567
|
+
configVersionId: string;
|
|
8557
8568
|
};
|
|
8558
8569
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
8559
8570
|
}>;
|
|
@@ -8570,6 +8581,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8570
8581
|
results: {
|
|
8571
8582
|
id: string & import("zod").$brand<"UUID">;
|
|
8572
8583
|
type: string;
|
|
8584
|
+
configVersionId: string;
|
|
8573
8585
|
status: "ARCHIVED" | "CREATED" | "DECLARED" | "NOTIFIED" | "REGISTERED" | "REVOKED";
|
|
8574
8586
|
legalStatuses: {
|
|
8575
8587
|
NOTIFIED?: {
|
|
@@ -8975,6 +8987,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8975
8987
|
status: "Rejected";
|
|
8976
8988
|
})[];
|
|
8977
8989
|
trackingId: string;
|
|
8990
|
+
configVersionId: string;
|
|
8978
8991
|
}[];
|
|
8979
8992
|
output: any;
|
|
8980
8993
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
@@ -87,7 +87,7 @@ export declare const ClientConfig: z.ZodObject<{
|
|
|
87
87
|
}, z.core.$strip>>;
|
|
88
88
|
}, z.core.$strip>>;
|
|
89
89
|
FEATURES: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
90
|
-
|
|
90
|
+
_EXPERIMENTAL_LEGACY_RECORDS: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
91
91
|
}, z.core.$strip>>>;
|
|
92
92
|
}, z.core.$strip>;
|
|
93
93
|
export type ClientConfig = z.infer<typeof ClientConfig>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { EventDocument } from '../events/EventDocument';
|
|
2
2
|
import { ActionUpdate, EventState } from '../events/ActionDocument';
|
|
3
|
-
import { ITokenPayload as TokenPayload } from '../authentication';
|
|
3
|
+
import { ITokenPayload as TokenPayload } from '../users/authentication';
|
|
4
4
|
import { PartialSchema as AjvJSONSchemaType } from 'ajv/dist/types/json-schema';
|
|
5
5
|
import { userSerializer } from '../events/serializers/user/serializer';
|
|
6
6
|
import { UUID } from '../uuid';
|
|
7
7
|
import { todayDateTimeValueSerializer } from '../events/serializers/date/serializer';
|
|
8
8
|
import { EventStatus } from '../events/EventMetadata';
|
|
9
|
+
import type { ActionType } from '../events/ActionType';
|
|
9
10
|
import { CodeToEvaluate, FieldReference } from '../events/FieldConfig';
|
|
10
11
|
import type { ClientFunctionContext } from './validate';
|
|
11
12
|
/** @knipignore */
|
|
@@ -83,13 +84,13 @@ export declare const now: typeof todayDateTimeValueSerializer;
|
|
|
83
84
|
* Generate conditional rules for user.
|
|
84
85
|
*/
|
|
85
86
|
export declare const user: typeof userSerializer & {
|
|
86
|
-
scope: (scope: import("../scopes").ScopeType) => {
|
|
87
|
-
attribute: (option: import("../scopes").ScopeOptionKey) => {
|
|
87
|
+
scope: (scope: import("../users/scopes").ScopeType) => {
|
|
88
|
+
attribute: (option: import("../users/scopes").ScopeOptionKey) => {
|
|
88
89
|
$scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.audit.read" | "integration.create" | "location.edit" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.action.accept" | "record.action.reject" | "record.archive" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reinstate-registration" | "record.reject" | "record.request-correction" | "record.review-duplicates" | "record.revoke-registration" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
|
|
89
90
|
$option: "accessLevel" | "createdBy" | "createdIn" | "declaredBy" | "declaredIn" | "event" | "flags" | "ids" | "notifiedBy" | "notifiedIn" | "placeOfEvent" | "registeredBy" | "registeredIn" | "role" | "status";
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
|
-
jurisdiction: (jurisdiction: import("../scopes").JurisdictionFilter | {
|
|
93
|
+
jurisdiction: (jurisdiction: import("../users/scopes").JurisdictionFilter | {
|
|
93
94
|
$scope: "attachment.upload" | "bypassratelimit" | "config.update-all" | "dashboard.view" | "integration.audit.read" | "integration.create" | "location.edit" | "organisation.read-locations" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "profile.electronic-signature" | "record.action.accept" | "record.action.reject" | "record.archive" | "record.correct" | "record.create" | "record.custom-action" | "record.declare" | "record.edit" | "record.import" | "record.notify" | "record.print-certified-copies" | "record.read" | "record.register" | "record.reindex" | "record.reinstate-registration" | "record.reject" | "record.request-correction" | "record.review-duplicates" | "record.revoke-registration" | "record.search" | "record.unarchive" | "record.unassign-others" | "user.create" | "user.data-seeding" | "user.edit" | "user.read" | "user.read-only-my-audit" | "user.search" | "workqueue";
|
|
94
95
|
$option: "accessLevel" | "createdBy" | "createdIn" | "declaredBy" | "declaredIn" | "event" | "flags" | "ids" | "notifiedBy" | "notifiedIn" | "placeOfEvent" | "registeredBy" | "registeredIn" | "role" | "status";
|
|
95
96
|
}) => {
|
|
@@ -111,6 +112,24 @@ export declare function isFieldReference(value: unknown): value is FieldReferenc
|
|
|
111
112
|
export declare function isEventFieldReference(value: unknown): value is {
|
|
112
113
|
$$event: string;
|
|
113
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* Matches an action by type. A custom action must always name its
|
|
117
|
+
* `customActionType`, so that it does not match every custom action.
|
|
118
|
+
*/
|
|
119
|
+
export type ActionMatcher = {
|
|
120
|
+
type: typeof ActionType.CUSTOM;
|
|
121
|
+
customActionType: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: Exclude<ActionType, typeof ActionType.CUSTOM>;
|
|
124
|
+
customActionType?: never;
|
|
125
|
+
};
|
|
126
|
+
export type ActionDateReference = {
|
|
127
|
+
$action: {
|
|
128
|
+
match: ActionMatcher[];
|
|
129
|
+
occurrence: 'first' | 'last';
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export declare function isActionDateReference(value: unknown): value is ActionDateReference;
|
|
114
133
|
/** Check if an event flag is present */
|
|
115
134
|
export declare function flag(flagvalue: string): JSONSchema;
|
|
116
135
|
/** Check if an event flag is present */
|
|
@@ -155,6 +174,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
155
174
|
inFuture: () => JSONSchema;
|
|
156
175
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
157
176
|
fromNow: () => JSONSchema;
|
|
177
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
178
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
158
179
|
};
|
|
159
180
|
date: (date: string | FieldReference) => JSONSchema;
|
|
160
181
|
now: () => JSONSchema;
|
|
@@ -165,6 +186,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
165
186
|
inFuture: () => JSONSchema;
|
|
166
187
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
167
188
|
fromNow: () => JSONSchema;
|
|
189
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
190
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
168
191
|
};
|
|
169
192
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
170
193
|
now: () => JSONSchema;
|
|
@@ -245,6 +268,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
245
268
|
inFuture: () => JSONSchema;
|
|
246
269
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
247
270
|
fromNow: () => JSONSchema;
|
|
271
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
272
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
248
273
|
};
|
|
249
274
|
date: (date: string | FieldReference) => JSONSchema;
|
|
250
275
|
now: () => JSONSchema;
|
|
@@ -255,6 +280,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
255
280
|
inFuture: () => JSONSchema;
|
|
256
281
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
257
282
|
fromNow: () => JSONSchema;
|
|
283
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
284
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
258
285
|
};
|
|
259
286
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
260
287
|
now: () => JSONSchema;
|
|
@@ -343,6 +370,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
343
370
|
inFuture: () => JSONSchema;
|
|
344
371
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
345
372
|
fromNow: () => JSONSchema;
|
|
373
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
374
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
346
375
|
};
|
|
347
376
|
date: (date: string | FieldReference) => JSONSchema;
|
|
348
377
|
now: () => JSONSchema;
|
|
@@ -353,6 +382,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
353
382
|
inFuture: () => JSONSchema;
|
|
354
383
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
355
384
|
fromNow: () => JSONSchema;
|
|
385
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
386
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
356
387
|
};
|
|
357
388
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
358
389
|
now: () => JSONSchema;
|
|
@@ -448,6 +479,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
448
479
|
inFuture: () => JSONSchema;
|
|
449
480
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
450
481
|
fromNow: () => JSONSchema;
|
|
482
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
483
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
451
484
|
};
|
|
452
485
|
date: (date: string | FieldReference) => JSONSchema;
|
|
453
486
|
now: () => JSONSchema;
|
|
@@ -458,6 +491,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
458
491
|
inFuture: () => JSONSchema;
|
|
459
492
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
460
493
|
fromNow: () => JSONSchema;
|
|
494
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
495
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
461
496
|
};
|
|
462
497
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
463
498
|
now: () => JSONSchema;
|
|
@@ -538,6 +573,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
538
573
|
inFuture: () => JSONSchema;
|
|
539
574
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
540
575
|
fromNow: () => JSONSchema;
|
|
576
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
577
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
541
578
|
};
|
|
542
579
|
date: (date: string | FieldReference) => JSONSchema;
|
|
543
580
|
now: () => JSONSchema;
|
|
@@ -548,6 +585,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
548
585
|
inFuture: () => JSONSchema;
|
|
549
586
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
550
587
|
fromNow: () => JSONSchema;
|
|
588
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
589
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
551
590
|
};
|
|
552
591
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
553
592
|
now: () => JSONSchema;
|
|
@@ -643,6 +682,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
643
682
|
inFuture: () => JSONSchema;
|
|
644
683
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
645
684
|
fromNow: () => JSONSchema;
|
|
685
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
686
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
646
687
|
};
|
|
647
688
|
date: (date: string | FieldReference) => JSONSchema;
|
|
648
689
|
now: () => JSONSchema;
|
|
@@ -653,6 +694,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
653
694
|
inFuture: () => JSONSchema;
|
|
654
695
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
655
696
|
fromNow: () => JSONSchema;
|
|
697
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
698
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
656
699
|
};
|
|
657
700
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
658
701
|
now: () => JSONSchema;
|
|
@@ -733,6 +776,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
733
776
|
inFuture: () => JSONSchema;
|
|
734
777
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
735
778
|
fromNow: () => JSONSchema;
|
|
779
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
780
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
736
781
|
};
|
|
737
782
|
date: (date: string | FieldReference) => JSONSchema;
|
|
738
783
|
now: () => JSONSchema;
|
|
@@ -743,6 +788,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
743
788
|
inFuture: () => JSONSchema;
|
|
744
789
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
745
790
|
fromNow: () => JSONSchema;
|
|
791
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
792
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
746
793
|
};
|
|
747
794
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
748
795
|
now: () => JSONSchema;
|
|
@@ -821,6 +868,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
821
868
|
inFuture: () => JSONSchema;
|
|
822
869
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
823
870
|
fromNow: () => JSONSchema;
|
|
871
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
872
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
824
873
|
};
|
|
825
874
|
date: (date: string | FieldReference) => JSONSchema;
|
|
826
875
|
now: () => JSONSchema;
|
|
@@ -831,6 +880,8 @@ export declare function createFieldConditionals(fieldId: string): {
|
|
|
831
880
|
inFuture: () => JSONSchema;
|
|
832
881
|
fromDate: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
833
882
|
fromNow: () => JSONSchema;
|
|
883
|
+
beforeAction: (action: ActionDateReference) => JSONSchema;
|
|
884
|
+
afterAction: (action: ActionDateReference) => JSONSchema;
|
|
834
885
|
};
|
|
835
886
|
date: (date: `${string}-${string}-${string}` | FieldReference) => JSONSchema;
|
|
836
887
|
now: () => JSONSchema;
|
|
@@ -4,7 +4,7 @@ import { FieldConditional } from '../events/Conditional';
|
|
|
4
4
|
import { FieldConfig } from '../events/FieldConfig';
|
|
5
5
|
import { PlainDate, FieldUpdateValue, FieldValue } from '../events/FieldValue';
|
|
6
6
|
import { TranslationConfig } from '../events/TranslationConfig';
|
|
7
|
-
import { EncodedScope, TokenUserType } from '../authentication';
|
|
7
|
+
import { EncodedScope, TokenUserType } from '../users/authentication';
|
|
8
8
|
import { UUID } from '../uuid';
|
|
9
9
|
import { FormState } from '../events/utils';
|
|
10
10
|
import { ActionConfig } from '../events/ActionConfig';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deliberately dependency-free (aside from language builtins) so that files
|
|
3
3
|
* like Flag.ts can depend on ActionStatus without being pulled into the
|
|
4
|
-
* commons/scopes.ts <-> commons/authentication.ts import cycle that
|
|
4
|
+
* commons/users/scopes.ts <-> commons/users/authentication.ts import cycle that
|
|
5
5
|
* ActionDocument.ts participates in (it imports TokenUserType from
|
|
6
|
-
* '../authentication').
|
|
6
|
+
* '../users/authentication').
|
|
7
7
|
*/
|
|
8
8
|
export declare const ActionStatus: {
|
|
9
9
|
readonly Requested: 'Requested';
|
|
@@ -59,6 +59,8 @@ export type ActionTypes = z.infer<typeof ActionTypes>;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare const ClientSpecificAction: {
|
|
61
61
|
readonly REVIEW_CORRECTION_REQUEST: 'REVIEW_CORRECTION_REQUEST';
|
|
62
|
+
/** Opens the user's declare or notify draft of the event in its own flow */
|
|
63
|
+
readonly CONTINUE_DRAFT: 'CONTINUE_DRAFT';
|
|
62
64
|
};
|
|
63
65
|
export type ClientSpecificAction = (typeof ClientSpecificAction)[keyof typeof ClientSpecificAction];
|
|
64
66
|
/** Actions which change event data (declaration) before registration / during declaration. */
|
|
@@ -161,6 +161,7 @@ export declare const FieldConfigSchema: z.ZodObject<{
|
|
|
161
161
|
}, z.core.$strip>>;
|
|
162
162
|
fieldId: z.ZodString;
|
|
163
163
|
fieldType: z.ZodLiteral<"field">;
|
|
164
|
+
defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
164
165
|
}, z.core.$strip>;
|
|
165
166
|
/**
|
|
166
167
|
* The event fields that are available for advanced search, date of event, summary. These are the values
|
|
@@ -513,6 +514,7 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
513
514
|
}, z.core.$strip>>;
|
|
514
515
|
fieldId: z.ZodString;
|
|
515
516
|
fieldType: z.ZodLiteral<"field">;
|
|
517
|
+
defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
516
518
|
}, z.core.$strip>, z.ZodObject<{
|
|
517
519
|
config: z.ZodObject<{
|
|
518
520
|
type: z.ZodEnum<{
|
|
@@ -836,6 +838,7 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
|
|
|
836
838
|
}, z.core.$strip>>;
|
|
837
839
|
fieldId: z.ZodString;
|
|
838
840
|
fieldType: z.ZodLiteral<"field">;
|
|
841
|
+
defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
839
842
|
}, z.core.$strip>, z.ZodObject<{
|
|
840
843
|
config: z.ZodObject<{
|
|
841
844
|
type: z.ZodEnum<{
|
|
@@ -57,13 +57,46 @@ export declare const DraftInput: z.ZodObject<{
|
|
|
57
57
|
keepAssignmentIfAccepted: z.ZodOptional<z.ZodBoolean>;
|
|
58
58
|
keepAssignmentIfRejected: z.ZodOptional<z.ZodBoolean>;
|
|
59
59
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
60
|
-
type: z.
|
|
60
|
+
type: z.ZodEnum<{
|
|
61
|
+
DECLARE: "DECLARE";
|
|
62
|
+
NOTIFY: "NOTIFY";
|
|
63
|
+
}>;
|
|
61
64
|
status: z.ZodEnum<{
|
|
62
65
|
Accepted: "Accepted";
|
|
63
66
|
Rejected: "Rejected";
|
|
64
67
|
Requested: "Requested";
|
|
65
68
|
}>;
|
|
66
69
|
}, z.core.$strip>;
|
|
70
|
+
export declare const RemoteDraft: z.ZodObject<{
|
|
71
|
+
id: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
72
|
+
eventId: z.core.$ZodBranded<z.ZodUUID, "UUID", "out">;
|
|
73
|
+
transactionId: z.ZodString;
|
|
74
|
+
createdAt: z.ZodString;
|
|
75
|
+
action: z.ZodObject<{
|
|
76
|
+
transactionId: z.ZodString;
|
|
77
|
+
createdByUserType: z.ZodEnum<{
|
|
78
|
+
system: "system";
|
|
79
|
+
user: "user";
|
|
80
|
+
}>;
|
|
81
|
+
createdAt: z.ZodString;
|
|
82
|
+
createdBy: z.ZodString;
|
|
83
|
+
createdByRole: z.ZodOptional<z.ZodString>;
|
|
84
|
+
createdBySignature: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "DocumentPath", "out">>>;
|
|
85
|
+
declaration: z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>;
|
|
86
|
+
annotation: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>>;
|
|
87
|
+
status: z.ZodEnum<{
|
|
88
|
+
Accepted: "Accepted";
|
|
89
|
+
Rejected: "Rejected";
|
|
90
|
+
Requested: "Requested";
|
|
91
|
+
}>;
|
|
92
|
+
originalActionId: z.ZodNullable<z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
93
|
+
type: z.ZodEnum<{
|
|
94
|
+
DECLARE: "DECLARE";
|
|
95
|
+
NOTIFY: "NOTIFY";
|
|
96
|
+
}>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
}, z.core.$strip>;
|
|
67
99
|
export type Draft = z.infer<typeof Draft>;
|
|
68
100
|
export type DraftInput = z.infer<typeof DraftInput>;
|
|
101
|
+
export type RemoteDraft = z.infer<typeof RemoteDraft>;
|
|
69
102
|
//# sourceMappingURL=Draft.d.ts.map
|