@opencrvs/toolkit 2.0.0-rc.61bee9f → 2.0.0-rc.660de90
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/application-config/index.js +3 -5
- package/dist/cli.js +43 -115
- package/dist/commons/api/router.d.ts +38 -23
- package/dist/commons/conditionals/conditionals.d.ts +3 -3
- package/dist/commons/events/FieldConfig.d.ts +0 -5
- package/dist/conditionals/index.js +3 -5
- package/dist/events/index.js +3 -5
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +1 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +35 -60
- package/dist/migrations/v2.0/index.js +43 -115
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +1 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +1 -90
- package/dist/notification/index.js +3 -5
- package/dist/scopes/index.d.ts +1 -6
- package/dist/scopes/index.js +3 -5
- package/opencrvs-toolkit-2.0.0-rc.660de90.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.61bee9f.tgz +0 -0
|
@@ -772,14 +772,12 @@ var SystemScopeType = z11.enum([
|
|
|
772
772
|
"organisation.read-locations",
|
|
773
773
|
"user.read",
|
|
774
774
|
"user.create",
|
|
775
|
-
"user.edit"
|
|
776
|
-
"user.search"
|
|
775
|
+
"user.edit"
|
|
777
776
|
]);
|
|
778
777
|
var UserScopeType = SystemScopeType.extract([
|
|
779
778
|
"user.read",
|
|
780
779
|
"user.create",
|
|
781
|
-
"user.edit"
|
|
782
|
-
"user.search"
|
|
780
|
+
"user.edit"
|
|
783
781
|
]);
|
|
784
782
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
785
783
|
var UserScopeV2 = z11.discriminatedUnion("type", [
|
|
@@ -788,7 +786,7 @@ var UserScopeV2 = z11.discriminatedUnion("type", [
|
|
|
788
786
|
options: AllUserScopeOptions.optional()
|
|
789
787
|
}),
|
|
790
788
|
z11.object({
|
|
791
|
-
type: UserScopeType.extract(["user.read"
|
|
789
|
+
type: UserScopeType.extract(["user.read"]),
|
|
792
790
|
options: AccessLevelOptions.optional()
|
|
793
791
|
})
|
|
794
792
|
]);
|
package/dist/cli.js
CHANGED
|
@@ -178,8 +178,6 @@ function ensureImports(sourceFile) {
|
|
|
178
178
|
var DEFINE_CONFIG_NAME2 = "defineConfig";
|
|
179
179
|
var ACTIONS_PROPERTY_NAME2 = "actions";
|
|
180
180
|
var TYPE_PROPERTY_NAME2 = "type";
|
|
181
|
-
var ID_PROPERTY_NAME = "id";
|
|
182
|
-
var FLAGS_PROPERTY_NAME = "flags";
|
|
183
181
|
var CUSTOM_ACTION_TYPE_PROPERTY_NAME = "customActionType";
|
|
184
182
|
var AUDIT_HISTORY_LABEL_PROPERTY_NAME = "auditHistoryLabel";
|
|
185
183
|
var DEDUPLICATION_PROPERTY_NAME = "deduplication";
|
|
@@ -189,12 +187,9 @@ var FORM_PROPERTY_NAME = "form";
|
|
|
189
187
|
var ACTION_TYPE_ENUM_NAME = "ActionType";
|
|
190
188
|
var VALIDATE_MEMBER_NAME = "VALIDATE";
|
|
191
189
|
var CUSTOM_MEMBER_NAME = "CUSTOM";
|
|
192
|
-
var REGISTER_MEMBER_NAME2 = "REGISTER";
|
|
193
190
|
var VALIDATE_STRING_LITERAL = "VALIDATE";
|
|
194
191
|
var CUSTOM_STRING_LITERAL = "CUSTOM";
|
|
195
|
-
var REGISTER_STRING_LITERAL2 = "REGISTER";
|
|
196
192
|
var VALIDATE_DECLARATION_VALUE = "VALIDATE_DECLARATION";
|
|
197
|
-
var VALIDATED_FLAG_VALUE = "validated";
|
|
198
193
|
function isValidateType(typeInitializer) {
|
|
199
194
|
if (typeInitializer.getKind() === import_ts_morph2.SyntaxKind.PropertyAccessExpression) {
|
|
200
195
|
const propAccess = typeInitializer.asKindOrThrow(
|
|
@@ -318,50 +313,6 @@ function transformValidateActionToCustom(obj, eventType) {
|
|
|
318
313
|
}
|
|
319
314
|
return true;
|
|
320
315
|
}
|
|
321
|
-
function isRegisterAction(action) {
|
|
322
|
-
const typeProperty = action.getProperty(TYPE_PROPERTY_NAME2);
|
|
323
|
-
if (!typeProperty || !import_ts_morph2.Node.isPropertyAssignment(typeProperty)) return false;
|
|
324
|
-
const typeInit = typeProperty.getInitializer();
|
|
325
|
-
if (!typeInit) return false;
|
|
326
|
-
if (import_ts_morph2.Node.isPropertyAccessExpression(typeInit)) {
|
|
327
|
-
const enumExpr = typeInit.getExpression();
|
|
328
|
-
return import_ts_morph2.Node.isIdentifier(enumExpr) && enumExpr.getText() === ACTION_TYPE_ENUM_NAME && typeInit.getName() === REGISTER_MEMBER_NAME2;
|
|
329
|
-
}
|
|
330
|
-
if (import_ts_morph2.Node.isStringLiteral(typeInit)) {
|
|
331
|
-
return typeInit.getLiteralValue() === REGISTER_STRING_LITERAL2;
|
|
332
|
-
}
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
function arrayHasElementWithId(array3, id) {
|
|
336
|
-
for (const el of array3.getElements()) {
|
|
337
|
-
if (!import_ts_morph2.Node.isObjectLiteralExpression(el)) continue;
|
|
338
|
-
const idProp = el.getProperty(ID_PROPERTY_NAME);
|
|
339
|
-
if (!idProp || !import_ts_morph2.Node.isPropertyAssignment(idProp)) continue;
|
|
340
|
-
const idInit = idProp.getInitializer();
|
|
341
|
-
if (idInit && import_ts_morph2.Node.isStringLiteral(idInit) && idInit.getLiteralValue() === id) {
|
|
342
|
-
return true;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
function ensureRegisterRemovesValidatedFlag(action) {
|
|
348
|
-
const entry = `{ id: '${VALIDATED_FLAG_VALUE}', operation: 'remove' }`;
|
|
349
|
-
const flagsProp = action.getProperty(FLAGS_PROPERTY_NAME);
|
|
350
|
-
if (flagsProp && import_ts_morph2.Node.isPropertyAssignment(flagsProp)) {
|
|
351
|
-
const flagsInit = flagsProp.getInitializer();
|
|
352
|
-
if (flagsInit && import_ts_morph2.Node.isArrayLiteralExpression(flagsInit)) {
|
|
353
|
-
if (arrayHasElementWithId(flagsInit, VALIDATED_FLAG_VALUE)) return false;
|
|
354
|
-
flagsInit.addElement(entry);
|
|
355
|
-
return true;
|
|
356
|
-
}
|
|
357
|
-
return false;
|
|
358
|
-
}
|
|
359
|
-
action.addPropertyAssignment({
|
|
360
|
-
name: FLAGS_PROPERTY_NAME,
|
|
361
|
-
initializer: `[${entry}]`
|
|
362
|
-
});
|
|
363
|
-
return true;
|
|
364
|
-
}
|
|
365
316
|
function processFile2(filePath, project) {
|
|
366
317
|
const sourceFile = project.getSourceFile(filePath);
|
|
367
318
|
if (!sourceFile) return 0;
|
|
@@ -427,18 +378,6 @@ function processFile2(filePath, project) {
|
|
|
427
378
|
` [${import_path2.default.relative(process.cwd(), filePath)}] Added top-level 'flags' array to defineConfig`
|
|
428
379
|
);
|
|
429
380
|
}
|
|
430
|
-
if (configHadValidateAction) {
|
|
431
|
-
for (const element of actionsInitializer.getElements()) {
|
|
432
|
-
if (!import_ts_morph2.Node.isObjectLiteralExpression(element)) continue;
|
|
433
|
-
if (!isRegisterAction(element)) continue;
|
|
434
|
-
if (ensureRegisterRemovesValidatedFlag(element)) {
|
|
435
|
-
transformedCount++;
|
|
436
|
-
console.log(
|
|
437
|
-
` [${import_path2.default.relative(process.cwd(), filePath)}] Added '${VALIDATED_FLAG_VALUE}' remove-flag to REGISTER action`
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
381
|
if (fileNeedsImports) {
|
|
443
382
|
ensureImports(sourceFile);
|
|
444
383
|
}
|
|
@@ -485,7 +424,7 @@ Saving ${modifiedFiles.length} modified file(s)...`);
|
|
|
485
424
|
}
|
|
486
425
|
console.log(
|
|
487
426
|
`
|
|
488
|
-
Done.
|
|
427
|
+
Done. Transformed ${totalTransformed} VALIDATE action(s) to CUSTOM with customActionType: '${VALIDATE_DECLARATION_VALUE}'.`
|
|
489
428
|
);
|
|
490
429
|
}
|
|
491
430
|
|
|
@@ -728,14 +667,14 @@ var QUERY_PROPERTY_NAME = "query";
|
|
|
728
667
|
var TYPE_PROPERTY_NAME5 = "type";
|
|
729
668
|
var CLAUSES_PROPERTY_NAME = "clauses";
|
|
730
669
|
var STATUS_PROPERTY_NAME = "status";
|
|
731
|
-
var
|
|
670
|
+
var FLAGS_PROPERTY_NAME = "flags";
|
|
732
671
|
var TERMS_PROPERTY_NAME = "terms";
|
|
733
672
|
var TERM_PROPERTY_NAME = "term";
|
|
734
673
|
var ANY_OF_PROPERTY_NAME = "anyOf";
|
|
735
674
|
var VALIDATED_STATUS_VALUE = "VALIDATED";
|
|
736
|
-
var
|
|
675
|
+
var VALIDATED_FLAG_VALUE = "validated";
|
|
737
676
|
function addValidatedFlag(clause) {
|
|
738
|
-
const flagsProperty = clause.getProperty(
|
|
677
|
+
const flagsProperty = clause.getProperty(FLAGS_PROPERTY_NAME);
|
|
739
678
|
if (flagsProperty && import_ts_morph5.Node.isPropertyAssignment(flagsProperty)) {
|
|
740
679
|
const flagsInit = flagsProperty.getInitializer();
|
|
741
680
|
if (flagsInit && import_ts_morph5.Node.isObjectLiteralExpression(flagsInit)) {
|
|
@@ -743,19 +682,19 @@ function addValidatedFlag(clause) {
|
|
|
743
682
|
if (anyOfProperty && import_ts_morph5.Node.isPropertyAssignment(anyOfProperty)) {
|
|
744
683
|
const anyOfInit = anyOfProperty.getInitializer();
|
|
745
684
|
if (anyOfInit && import_ts_morph5.Node.isArrayLiteralExpression(anyOfInit)) {
|
|
746
|
-
anyOfInit.addElement(`'${
|
|
685
|
+
anyOfInit.addElement(`'${VALIDATED_FLAG_VALUE}'`);
|
|
747
686
|
}
|
|
748
687
|
} else {
|
|
749
688
|
flagsInit.addPropertyAssignment({
|
|
750
689
|
name: ANY_OF_PROPERTY_NAME,
|
|
751
|
-
initializer: `['${
|
|
690
|
+
initializer: `['${VALIDATED_FLAG_VALUE}']`
|
|
752
691
|
});
|
|
753
692
|
}
|
|
754
693
|
}
|
|
755
694
|
} else {
|
|
756
695
|
clause.addPropertyAssignment({
|
|
757
|
-
name:
|
|
758
|
-
initializer: `{ ${ANY_OF_PROPERTY_NAME}: ['${
|
|
696
|
+
name: FLAGS_PROPERTY_NAME,
|
|
697
|
+
initializer: `{ ${ANY_OF_PROPERTY_NAME}: ['${VALIDATED_FLAG_VALUE}'] }`
|
|
759
698
|
});
|
|
760
699
|
}
|
|
761
700
|
}
|
|
@@ -921,26 +860,23 @@ var DEFINE_CONFIG_NAME4 = "defineConfig";
|
|
|
921
860
|
var DEFINE_WORKQUEUES_NAME2 = "defineWorkqueues";
|
|
922
861
|
var ACTIONS_PROPERTY_NAME4 = "actions";
|
|
923
862
|
var ACTION_PROPERTY_NAME = "action";
|
|
924
|
-
var
|
|
863
|
+
var FLAGS_PROPERTY_NAME2 = "flags";
|
|
925
864
|
var QUERY_PROPERTY_NAME2 = "query";
|
|
926
865
|
var TYPE_PROPERTY_NAME6 = "type";
|
|
927
|
-
var ID_PROPERTY_NAME2 = "id";
|
|
928
866
|
var CLAUSES_PROPERTY_NAME2 = "clauses";
|
|
929
867
|
var ANY_OF_PROPERTY_NAME2 = "anyOf";
|
|
930
868
|
var FLAG_ID = "pending-first-certificate-issuance";
|
|
931
869
|
var REGISTER_TYPE = "REGISTER";
|
|
932
870
|
var PRINT_CERTIFICATE_TYPE = "PRINT_CERTIFICATE";
|
|
933
|
-
|
|
934
|
-
return `{
|
|
871
|
+
var FLAG_DEFINITION_INITIALIZER = `{
|
|
935
872
|
id: '${FLAG_ID}',
|
|
936
873
|
label: {
|
|
937
|
-
id: 'event
|
|
874
|
+
id: 'event.birth.flag.${FLAG_ID}',
|
|
938
875
|
defaultMessage: 'Pending first certificate issuance',
|
|
939
876
|
description: 'Flag label for first certificate issuance'
|
|
940
877
|
},
|
|
941
878
|
requiresAction: true
|
|
942
879
|
}`;
|
|
943
|
-
}
|
|
944
880
|
function isActionOfType(obj, typeName) {
|
|
945
881
|
const typeProperty = obj.getProperty(TYPE_PROPERTY_NAME6);
|
|
946
882
|
if (!typeProperty || !import_ts_morph6.Node.isPropertyAssignment(typeProperty)) return false;
|
|
@@ -954,20 +890,18 @@ function isActionOfType(obj, typeName) {
|
|
|
954
890
|
}
|
|
955
891
|
return false;
|
|
956
892
|
}
|
|
957
|
-
function
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
return initializer.getLiteralValue().toLowerCase();
|
|
965
|
-
}
|
|
966
|
-
if (import_ts_morph6.Node.isPropertyAccessExpression(initializer)) {
|
|
967
|
-
return initializer.getName().toLowerCase();
|
|
968
|
-
}
|
|
893
|
+
function isBirthConfig(configArg) {
|
|
894
|
+
const typeProperty = configArg.getProperty(TYPE_PROPERTY_NAME6);
|
|
895
|
+
if (!typeProperty || !import_ts_morph6.Node.isPropertyAssignment(typeProperty)) return false;
|
|
896
|
+
const initializer = typeProperty.getInitializer();
|
|
897
|
+
if (!initializer) return false;
|
|
898
|
+
if (import_ts_morph6.Node.isStringLiteral(initializer)) {
|
|
899
|
+
return initializer.getLiteralValue().toLowerCase() === "birth";
|
|
969
900
|
}
|
|
970
|
-
|
|
901
|
+
if (import_ts_morph6.Node.isPropertyAccessExpression(initializer)) {
|
|
902
|
+
return initializer.getName().toLowerCase() === "birth";
|
|
903
|
+
}
|
|
904
|
+
return false;
|
|
971
905
|
}
|
|
972
906
|
function hasElementWithId(array3, id) {
|
|
973
907
|
for (const el of array3.getElements()) {
|
|
@@ -981,28 +915,27 @@ function hasElementWithId(array3, id) {
|
|
|
981
915
|
}
|
|
982
916
|
return false;
|
|
983
917
|
}
|
|
984
|
-
function ensureTopLevelFlagDefinition(configArg
|
|
985
|
-
const
|
|
986
|
-
const flagsProp = configArg.getProperty(FLAGS_PROPERTY_NAME3);
|
|
918
|
+
function ensureTopLevelFlagDefinition(configArg) {
|
|
919
|
+
const flagsProp = configArg.getProperty(FLAGS_PROPERTY_NAME2);
|
|
987
920
|
if (flagsProp && import_ts_morph6.Node.isPropertyAssignment(flagsProp)) {
|
|
988
921
|
const flagsInit = flagsProp.getInitializer();
|
|
989
922
|
if (flagsInit && import_ts_morph6.Node.isArrayLiteralExpression(flagsInit)) {
|
|
990
923
|
if (hasElementWithId(flagsInit, FLAG_ID)) return false;
|
|
991
|
-
flagsInit.addElement(
|
|
924
|
+
flagsInit.addElement(FLAG_DEFINITION_INITIALIZER);
|
|
992
925
|
return true;
|
|
993
926
|
}
|
|
994
927
|
return false;
|
|
995
928
|
}
|
|
996
929
|
configArg.addPropertyAssignment({
|
|
997
|
-
name:
|
|
930
|
+
name: FLAGS_PROPERTY_NAME2,
|
|
998
931
|
initializer: `[
|
|
999
|
-
${
|
|
932
|
+
${FLAG_DEFINITION_INITIALIZER}
|
|
1000
933
|
]`
|
|
1001
934
|
});
|
|
1002
935
|
return true;
|
|
1003
936
|
}
|
|
1004
937
|
function ensureActionOperationFlag(action, operation) {
|
|
1005
|
-
const flagsProp = action.getProperty(
|
|
938
|
+
const flagsProp = action.getProperty(FLAGS_PROPERTY_NAME2);
|
|
1006
939
|
const entry = `{ id: '${FLAG_ID}', operation: '${operation}' }`;
|
|
1007
940
|
if (flagsProp && import_ts_morph6.Node.isPropertyAssignment(flagsProp)) {
|
|
1008
941
|
const flagsInit = flagsProp.getInitializer();
|
|
@@ -1014,18 +947,16 @@ function ensureActionOperationFlag(action, operation) {
|
|
|
1014
947
|
return false;
|
|
1015
948
|
}
|
|
1016
949
|
action.addPropertyAssignment({
|
|
1017
|
-
name:
|
|
950
|
+
name: FLAGS_PROPERTY_NAME2,
|
|
1018
951
|
initializer: `[${entry}]`
|
|
1019
952
|
});
|
|
1020
953
|
return true;
|
|
1021
954
|
}
|
|
1022
|
-
function
|
|
955
|
+
function processBirthConfig(configArg, relPath) {
|
|
1023
956
|
let changes = 0;
|
|
1024
|
-
if (ensureTopLevelFlagDefinition(configArg
|
|
957
|
+
if (ensureTopLevelFlagDefinition(configArg)) {
|
|
1025
958
|
changes++;
|
|
1026
|
-
console.log(
|
|
1027
|
-
` [${relPath}] (${eventType}) Added '${FLAG_ID}' to top-level flags`
|
|
1028
|
-
);
|
|
959
|
+
console.log(` [${relPath}] Added '${FLAG_ID}' to top-level flags`);
|
|
1029
960
|
}
|
|
1030
961
|
const actionsProp = configArg.getProperty(ACTIONS_PROPERTY_NAME4);
|
|
1031
962
|
if (!actionsProp || !import_ts_morph6.Node.isPropertyAssignment(actionsProp)) return changes;
|
|
@@ -1039,7 +970,7 @@ function processConfig(configArg, eventType, relPath) {
|
|
|
1039
970
|
if (ensureActionOperationFlag(element, "add")) {
|
|
1040
971
|
changes++;
|
|
1041
972
|
console.log(
|
|
1042
|
-
` [${relPath}]
|
|
973
|
+
` [${relPath}] Added '${FLAG_ID}' add-flag to REGISTER action`
|
|
1043
974
|
);
|
|
1044
975
|
}
|
|
1045
976
|
}
|
|
@@ -1047,7 +978,7 @@ function processConfig(configArg, eventType, relPath) {
|
|
|
1047
978
|
if (ensureActionOperationFlag(element, "remove")) {
|
|
1048
979
|
changes++;
|
|
1049
980
|
console.log(
|
|
1050
|
-
` [${relPath}]
|
|
981
|
+
` [${relPath}] Added '${FLAG_ID}' remove-flag to PRINT_CERTIFICATE action`
|
|
1051
982
|
);
|
|
1052
983
|
}
|
|
1053
984
|
}
|
|
@@ -1076,7 +1007,7 @@ function hasPrintCertificateAction(workqueue) {
|
|
|
1076
1007
|
return false;
|
|
1077
1008
|
}
|
|
1078
1009
|
function addFlagToQueryClause(clause) {
|
|
1079
|
-
const flagsProp = clause.getProperty(
|
|
1010
|
+
const flagsProp = clause.getProperty(FLAGS_PROPERTY_NAME2);
|
|
1080
1011
|
if (flagsProp && import_ts_morph6.Node.isPropertyAssignment(flagsProp)) {
|
|
1081
1012
|
const flagsInit = flagsProp.getInitializer();
|
|
1082
1013
|
if (flagsInit && import_ts_morph6.Node.isObjectLiteralExpression(flagsInit)) {
|
|
@@ -1101,7 +1032,7 @@ function addFlagToQueryClause(clause) {
|
|
|
1101
1032
|
}
|
|
1102
1033
|
} else {
|
|
1103
1034
|
clause.addPropertyAssignment({
|
|
1104
|
-
name:
|
|
1035
|
+
name: FLAGS_PROPERTY_NAME2,
|
|
1105
1036
|
initializer: `{ ${ANY_OF_PROPERTY_NAME2}: ['${FLAG_ID}'] }`
|
|
1106
1037
|
});
|
|
1107
1038
|
return true;
|
|
@@ -1145,9 +1076,8 @@ function processFile6(filePath, project) {
|
|
|
1145
1076
|
if (args2.length === 0) continue;
|
|
1146
1077
|
const configArg = args2[0];
|
|
1147
1078
|
if (!import_ts_morph6.Node.isObjectLiteralExpression(configArg)) continue;
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
totalChanges += processConfig(configArg, eventType, relPath);
|
|
1079
|
+
if (!isBirthConfig(configArg)) continue;
|
|
1080
|
+
totalChanges += processBirthConfig(configArg, relPath);
|
|
1151
1081
|
}
|
|
1152
1082
|
if (calleeName === DEFINE_WORKQUEUES_NAME2) {
|
|
1153
1083
|
const args2 = call.getArguments();
|
|
@@ -1176,7 +1106,7 @@ function processFile6(filePath, project) {
|
|
|
1176
1106
|
async function main6() {
|
|
1177
1107
|
const srcDir = import_path6.default.join(process.cwd(), "src");
|
|
1178
1108
|
console.log(
|
|
1179
|
-
`Scanning for defineConfig and PRINT_CERTIFICATE workqueues in: ${srcDir}
|
|
1109
|
+
`Scanning for birth defineConfig and PRINT_CERTIFICATE workqueues in: ${srcDir}
|
|
1180
1110
|
`
|
|
1181
1111
|
);
|
|
1182
1112
|
const project = new import_ts_morph6.Project({
|
|
@@ -1201,7 +1131,7 @@ async function main6() {
|
|
|
1201
1131
|
}
|
|
1202
1132
|
if (modifiedFiles.length === 0) {
|
|
1203
1133
|
console.log(
|
|
1204
|
-
"No
|
|
1134
|
+
"No birth configs or PRINT_CERTIFICATE workqueues found. Nothing to do."
|
|
1205
1135
|
);
|
|
1206
1136
|
return;
|
|
1207
1137
|
}
|
|
@@ -2296,14 +2226,12 @@ var SystemScopeType = z3.enum([
|
|
|
2296
2226
|
"organisation.read-locations",
|
|
2297
2227
|
"user.read",
|
|
2298
2228
|
"user.create",
|
|
2299
|
-
"user.edit"
|
|
2300
|
-
"user.search"
|
|
2229
|
+
"user.edit"
|
|
2301
2230
|
]);
|
|
2302
2231
|
var UserScopeType = SystemScopeType.extract([
|
|
2303
2232
|
"user.read",
|
|
2304
2233
|
"user.create",
|
|
2305
|
-
"user.edit"
|
|
2306
|
-
"user.search"
|
|
2234
|
+
"user.edit"
|
|
2307
2235
|
]);
|
|
2308
2236
|
var ScopesWithRoleOption = UserScopeType.extract(["user.edit", "user.create"]);
|
|
2309
2237
|
var UserScopeV2 = z3.discriminatedUnion("type", [
|
|
@@ -2312,7 +2240,7 @@ var UserScopeV2 = z3.discriminatedUnion("type", [
|
|
|
2312
2240
|
options: AllUserScopeOptions.optional()
|
|
2313
2241
|
}),
|
|
2314
2242
|
z3.object({
|
|
2315
|
-
type: UserScopeType.extract(["user.read"
|
|
2243
|
+
type: UserScopeType.extract(["user.read"]),
|
|
2316
2244
|
options: AccessLevelOptions.optional()
|
|
2317
2245
|
})
|
|
2318
2246
|
]);
|
|
@@ -4092,18 +4092,33 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4092
4092
|
input: string[];
|
|
4093
4093
|
output: ({
|
|
4094
4094
|
id: string & import("zod").$brand<"UUID">;
|
|
4095
|
-
type: "user";
|
|
4096
4095
|
name: {
|
|
4097
4096
|
firstname: string;
|
|
4098
4097
|
surname: string;
|
|
4099
4098
|
};
|
|
4100
4099
|
role: string;
|
|
4101
|
-
|
|
4100
|
+
primaryOfficeId: string & import("zod").$brand<"UUID">;
|
|
4101
|
+
type: "user";
|
|
4102
|
+
status: "active" | "pending" | "deactivated";
|
|
4103
|
+
avatar?: (string & import("zod").$brand<"DocumentPath">) | undefined;
|
|
4102
4104
|
signature?: (string & import("zod").$brand<"DocumentPath">) | null | undefined;
|
|
4105
|
+
administrativeAreaId?: (string & import("zod").$brand<"UUID">) | null | undefined;
|
|
4106
|
+
device?: string | undefined;
|
|
4107
|
+
fullHonorificName?: string | undefined;
|
|
4108
|
+
mobile?: string | undefined;
|
|
4109
|
+
email?: string | undefined;
|
|
4110
|
+
data?: Record<string, import("../commons").FieldValue> | undefined;
|
|
4103
4111
|
} | {
|
|
4104
4112
|
id: string & import("zod").$brand<"UUID">;
|
|
4105
|
-
type: "system";
|
|
4106
4113
|
name: string;
|
|
4114
|
+
type: "system";
|
|
4115
|
+
primaryOfficeId?: (string & import("zod").$brand<"UUID">) | undefined;
|
|
4116
|
+
administrativeAreaId?: (string & import("zod").$brand<"UUID">) | undefined;
|
|
4117
|
+
signature?: undefined;
|
|
4118
|
+
avatar?: undefined;
|
|
4119
|
+
fullHonorificName?: string | undefined;
|
|
4120
|
+
legacyId?: string | undefined;
|
|
4121
|
+
status?: undefined;
|
|
4107
4122
|
})[];
|
|
4108
4123
|
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
4109
4124
|
}>;
|
|
@@ -4759,7 +4774,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4759
4774
|
'legalStatuses.DECLARED.createdAtLocation'?: {
|
|
4760
4775
|
type: "within";
|
|
4761
4776
|
location: string | {
|
|
4762
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4777
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4763
4778
|
$location?: string | undefined;
|
|
4764
4779
|
};
|
|
4765
4780
|
} | undefined;
|
|
@@ -4781,7 +4796,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4781
4796
|
'legalStatuses.REGISTERED.createdAtLocation'?: {
|
|
4782
4797
|
type: "within";
|
|
4783
4798
|
location: string | {
|
|
4784
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4799
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4785
4800
|
$location?: string | undefined;
|
|
4786
4801
|
};
|
|
4787
4802
|
} | undefined;
|
|
@@ -4796,47 +4811,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4796
4811
|
createdAtLocation?: {
|
|
4797
4812
|
type: "within";
|
|
4798
4813
|
location: string | {
|
|
4799
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4814
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4800
4815
|
$location?: string | undefined;
|
|
4801
4816
|
};
|
|
4802
4817
|
} | {
|
|
4803
4818
|
type: "exact";
|
|
4804
4819
|
term: string | {
|
|
4805
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4820
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4806
4821
|
$location?: string | undefined;
|
|
4807
4822
|
};
|
|
4808
4823
|
} | undefined;
|
|
4809
4824
|
updatedAtLocation?: {
|
|
4810
4825
|
type: "within";
|
|
4811
4826
|
location: string | {
|
|
4812
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4827
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4813
4828
|
$location?: string | undefined;
|
|
4814
4829
|
};
|
|
4815
4830
|
} | {
|
|
4816
4831
|
type: "exact";
|
|
4817
4832
|
term: string | {
|
|
4818
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4833
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4819
4834
|
$location?: string | undefined;
|
|
4820
4835
|
};
|
|
4821
4836
|
} | undefined;
|
|
4822
4837
|
updatedByUserRole?: {
|
|
4823
4838
|
type: "exact";
|
|
4824
4839
|
term: string | {
|
|
4825
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4840
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4826
4841
|
$location?: string | undefined;
|
|
4827
4842
|
};
|
|
4828
4843
|
} | undefined;
|
|
4829
4844
|
assignedTo?: {
|
|
4830
4845
|
type: "exact";
|
|
4831
4846
|
term: string | {
|
|
4832
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4847
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4833
4848
|
$location?: string | undefined;
|
|
4834
4849
|
};
|
|
4835
4850
|
} | undefined;
|
|
4836
4851
|
createdBy?: {
|
|
4837
4852
|
type: "exact";
|
|
4838
4853
|
term: string | {
|
|
4839
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4854
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4840
4855
|
$location?: string | undefined;
|
|
4841
4856
|
};
|
|
4842
4857
|
} | undefined;
|
|
@@ -4847,7 +4862,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4847
4862
|
updatedBy?: {
|
|
4848
4863
|
type: "exact";
|
|
4849
4864
|
term: string | {
|
|
4850
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4865
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4851
4866
|
$location?: string | undefined;
|
|
4852
4867
|
};
|
|
4853
4868
|
} | undefined;
|
|
@@ -4897,7 +4912,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4897
4912
|
'legalStatuses.DECLARED.createdAtLocation'?: {
|
|
4898
4913
|
type: "within";
|
|
4899
4914
|
location: string | {
|
|
4900
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4915
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4901
4916
|
$location?: string | undefined;
|
|
4902
4917
|
};
|
|
4903
4918
|
} | undefined;
|
|
@@ -4919,7 +4934,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4919
4934
|
'legalStatuses.REGISTERED.createdAtLocation'?: {
|
|
4920
4935
|
type: "within";
|
|
4921
4936
|
location: string | {
|
|
4922
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4937
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4923
4938
|
$location?: string | undefined;
|
|
4924
4939
|
};
|
|
4925
4940
|
} | undefined;
|
|
@@ -4934,47 +4949,47 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4934
4949
|
createdAtLocation?: {
|
|
4935
4950
|
type: "within";
|
|
4936
4951
|
location: string | {
|
|
4937
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4952
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4938
4953
|
$location?: string | undefined;
|
|
4939
4954
|
};
|
|
4940
4955
|
} | {
|
|
4941
4956
|
type: "exact";
|
|
4942
4957
|
term: string | {
|
|
4943
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4958
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4944
4959
|
$location?: string | undefined;
|
|
4945
4960
|
};
|
|
4946
4961
|
} | undefined;
|
|
4947
4962
|
updatedAtLocation?: {
|
|
4948
4963
|
type: "within";
|
|
4949
4964
|
location: string | {
|
|
4950
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4965
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4951
4966
|
$location?: string | undefined;
|
|
4952
4967
|
};
|
|
4953
4968
|
} | {
|
|
4954
4969
|
type: "exact";
|
|
4955
4970
|
term: string | {
|
|
4956
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4971
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4957
4972
|
$location?: string | undefined;
|
|
4958
4973
|
};
|
|
4959
4974
|
} | undefined;
|
|
4960
4975
|
updatedByUserRole?: {
|
|
4961
4976
|
type: "exact";
|
|
4962
4977
|
term: string | {
|
|
4963
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4978
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4964
4979
|
$location?: string | undefined;
|
|
4965
4980
|
};
|
|
4966
4981
|
} | undefined;
|
|
4967
4982
|
assignedTo?: {
|
|
4968
4983
|
type: "exact";
|
|
4969
4984
|
term: string | {
|
|
4970
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4985
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4971
4986
|
$location?: string | undefined;
|
|
4972
4987
|
};
|
|
4973
4988
|
} | undefined;
|
|
4974
4989
|
createdBy?: {
|
|
4975
4990
|
type: "exact";
|
|
4976
4991
|
term: string | {
|
|
4977
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
4992
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4978
4993
|
$location?: string | undefined;
|
|
4979
4994
|
};
|
|
4980
4995
|
} | undefined;
|
|
@@ -4985,7 +5000,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
4985
5000
|
updatedBy?: {
|
|
4986
5001
|
type: "exact";
|
|
4987
5002
|
term: string | {
|
|
4988
|
-
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "
|
|
5003
|
+
$userField: "id" | "name" | "administrativeAreaId" | "firstname" | "surname" | "fullHonorificName" | "role" | "device" | "middlename" | "signature" | "avatar" | "primaryOfficeId";
|
|
4989
5004
|
$location?: string | undefined;
|
|
4990
5005
|
};
|
|
4991
5006
|
} | undefined;
|
|
@@ -86,16 +86,16 @@ export declare const user: typeof userSerializer & {
|
|
|
86
86
|
};
|
|
87
87
|
scope: (scope: import("../scopes").ScopeType) => {
|
|
88
88
|
attribute: (option: import("../scopes").ScopeOptionKey) => {
|
|
89
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "
|
|
89
|
+
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
90
90
|
$option: "role" | "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
jurisdiction: (jurisdiction: import("../scopes").JurisdictionFilter | {
|
|
94
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "
|
|
94
|
+
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
95
95
|
$option: "role" | "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
96
96
|
}) => {
|
|
97
97
|
$jurisdiction: "administrativeArea" | "location" | "all" | {
|
|
98
|
-
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "
|
|
98
|
+
$scope: "record.search" | "record.create" | "record.read" | "record.declare" | "record.notify" | "record.edit" | "record.reject" | "record.archive" | "record.review-duplicates" | "record.register" | "record.print-certified-copies" | "record.request-correction" | "record.correct" | "record.unassign-others" | "record.custom-action" | "bypassratelimit" | "record.reindex" | "user.data-seeding" | "integration.create" | "record.import" | "config.update-all" | "attachment.upload" | "profile.electronic-signature" | "user.read-only-my-audit" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "record.confirm-registration" | "record.reject-registration" | "organisation.read-locations" | "user.read" | "user.create" | "user.edit" | "workqueue" | "dashboard.view";
|
|
99
99
|
$option: "role" | "event" | "placeOfEvent" | "declaredIn" | "declaredBy" | "registeredIn" | "registeredBy" | "accessLevel" | "ids";
|
|
100
100
|
};
|
|
101
101
|
};
|