@awarevue/api-types 1.0.15 → 1.0.16
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/agent-communication/protocol.d.ts +97 -97
- package/dist/agent-communication/protocol.js +3 -3
- package/dist/device/server.d.ts +4 -1
- package/dist/device/server.js +6 -3
- package/dist/error.d.ts +386 -8
- package/dist/error.js +120 -5
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -192,7 +192,7 @@ export declare const sProviderSpecs: z.ZodObject<{
|
|
|
192
192
|
placeHolder?: string | undefined;
|
|
193
193
|
})[] | undefined;
|
|
194
194
|
}>;
|
|
195
|
-
export declare const sAccessObjectKind: z.ZodEnum<["
|
|
195
|
+
export declare const sAccessObjectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
196
196
|
export declare const sTokenSpecs: z.ZodObject<{
|
|
197
197
|
type: z.ZodEnum<["card", "pin", "fingerprint"]>;
|
|
198
198
|
regex: z.ZodOptional<z.ZodString>;
|
|
@@ -226,7 +226,7 @@ export declare const sAccessControlCapabilityReport: z.ZodObject<{
|
|
|
226
226
|
formatDescription?: string | undefined;
|
|
227
227
|
maxPerPerson?: number | undefined;
|
|
228
228
|
}>, "many">;
|
|
229
|
-
accessObjects: z.ZodArray<z.ZodEnum<["
|
|
229
|
+
accessObjects: z.ZodArray<z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>, "many">;
|
|
230
230
|
oneSchedulePerDoor: z.ZodBoolean;
|
|
231
231
|
}, "strip", z.ZodTypeAny, {
|
|
232
232
|
tokens: {
|
|
@@ -235,7 +235,7 @@ export declare const sAccessControlCapabilityReport: z.ZodObject<{
|
|
|
235
235
|
formatDescription?: string | undefined;
|
|
236
236
|
maxPerPerson?: number | undefined;
|
|
237
237
|
}[];
|
|
238
|
-
accessObjects: ("person" | "zone" | "
|
|
238
|
+
accessObjects: ("person" | "zone" | "device" | "schedule" | "accessRule")[];
|
|
239
239
|
oneSchedulePerDoor: boolean;
|
|
240
240
|
}, {
|
|
241
241
|
tokens: {
|
|
@@ -244,7 +244,7 @@ export declare const sAccessControlCapabilityReport: z.ZodObject<{
|
|
|
244
244
|
formatDescription?: string | undefined;
|
|
245
245
|
maxPerPerson?: number | undefined;
|
|
246
246
|
}[];
|
|
247
|
-
accessObjects: ("person" | "zone" | "
|
|
247
|
+
accessObjects: ("person" | "zone" | "device" | "schedule" | "accessRule")[];
|
|
248
248
|
oneSchedulePerDoor: boolean;
|
|
249
249
|
}>;
|
|
250
250
|
export declare const sRegisterRq: z.ZodObject<{
|
|
@@ -332,7 +332,7 @@ export declare const sRegisterRq: z.ZodObject<{
|
|
|
332
332
|
formatDescription?: string | undefined;
|
|
333
333
|
maxPerPerson?: number | undefined;
|
|
334
334
|
}>, "many">;
|
|
335
|
-
accessObjects: z.ZodArray<z.ZodEnum<["
|
|
335
|
+
accessObjects: z.ZodArray<z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>, "many">;
|
|
336
336
|
oneSchedulePerDoor: z.ZodBoolean;
|
|
337
337
|
}, "strip", z.ZodTypeAny, {
|
|
338
338
|
tokens: {
|
|
@@ -341,7 +341,7 @@ export declare const sRegisterRq: z.ZodObject<{
|
|
|
341
341
|
formatDescription?: string | undefined;
|
|
342
342
|
maxPerPerson?: number | undefined;
|
|
343
343
|
}[];
|
|
344
|
-
accessObjects: ("person" | "zone" | "
|
|
344
|
+
accessObjects: ("person" | "zone" | "device" | "schedule" | "accessRule")[];
|
|
345
345
|
oneSchedulePerDoor: boolean;
|
|
346
346
|
}, {
|
|
347
347
|
tokens: {
|
|
@@ -350,7 +350,7 @@ export declare const sRegisterRq: z.ZodObject<{
|
|
|
350
350
|
formatDescription?: string | undefined;
|
|
351
351
|
maxPerPerson?: number | undefined;
|
|
352
352
|
}[];
|
|
353
|
-
accessObjects: ("person" | "zone" | "
|
|
353
|
+
accessObjects: ("person" | "zone" | "device" | "schedule" | "accessRule")[];
|
|
354
354
|
oneSchedulePerDoor: boolean;
|
|
355
355
|
}>>>;
|
|
356
356
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -378,7 +378,7 @@ export declare const sRegisterRq: z.ZodObject<{
|
|
|
378
378
|
formatDescription?: string | undefined;
|
|
379
379
|
maxPerPerson?: number | undefined;
|
|
380
380
|
}[];
|
|
381
|
-
accessObjects: ("person" | "zone" | "
|
|
381
|
+
accessObjects: ("person" | "zone" | "device" | "schedule" | "accessRule")[];
|
|
382
382
|
oneSchedulePerDoor: boolean;
|
|
383
383
|
}> | undefined;
|
|
384
384
|
}, {
|
|
@@ -406,7 +406,7 @@ export declare const sRegisterRq: z.ZodObject<{
|
|
|
406
406
|
formatDescription?: string | undefined;
|
|
407
407
|
maxPerPerson?: number | undefined;
|
|
408
408
|
}[];
|
|
409
|
-
accessObjects: ("person" | "zone" | "
|
|
409
|
+
accessObjects: ("person" | "zone" | "device" | "schedule" | "accessRule")[];
|
|
410
410
|
oneSchedulePerDoor: boolean;
|
|
411
411
|
}> | undefined;
|
|
412
412
|
}>;
|
|
@@ -1041,73 +1041,73 @@ export declare const sGetAvailableDevicesRs: z.ZodIntersection<z.ZodObject<{
|
|
|
1041
1041
|
export declare const sObjectMerge: z.ZodObject<{
|
|
1042
1042
|
kind: z.ZodLiteral<"merge">;
|
|
1043
1043
|
objectId: z.ZodString;
|
|
1044
|
-
objectKind: z.ZodEnum<["
|
|
1044
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1045
1045
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1046
1046
|
}, "strip", z.ZodTypeAny, {
|
|
1047
1047
|
kind: "merge";
|
|
1048
|
-
objectKind: "person" | "zone" | "
|
|
1048
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1049
1049
|
objectId: string;
|
|
1050
1050
|
props: Record<string, unknown>;
|
|
1051
1051
|
}, {
|
|
1052
1052
|
kind: "merge";
|
|
1053
|
-
objectKind: "person" | "zone" | "
|
|
1053
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1054
1054
|
objectId: string;
|
|
1055
1055
|
props: Record<string, unknown>;
|
|
1056
1056
|
}>;
|
|
1057
1057
|
export declare const sObjectDelete: z.ZodObject<{
|
|
1058
1058
|
kind: z.ZodLiteral<"delete">;
|
|
1059
1059
|
objectId: z.ZodString;
|
|
1060
|
-
objectKind: z.ZodEnum<["
|
|
1060
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1061
1061
|
}, "strip", z.ZodTypeAny, {
|
|
1062
1062
|
kind: "delete";
|
|
1063
|
-
objectKind: "person" | "zone" | "
|
|
1063
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1064
1064
|
objectId: string;
|
|
1065
1065
|
}, {
|
|
1066
1066
|
kind: "delete";
|
|
1067
|
-
objectKind: "person" | "zone" | "
|
|
1067
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1068
1068
|
objectId: string;
|
|
1069
1069
|
}>;
|
|
1070
1070
|
export declare const sRelationMerge: z.ZodObject<{
|
|
1071
1071
|
kind: z.ZodLiteral<"relation-merge">;
|
|
1072
1072
|
left: z.ZodObject<{
|
|
1073
|
-
kind: z.ZodEnum<["
|
|
1073
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1074
1074
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1075
1075
|
}, "strip", z.ZodTypeAny, {
|
|
1076
|
-
kind: "person" | "zone" | "
|
|
1076
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1077
1077
|
objectId?: string | undefined;
|
|
1078
1078
|
}, {
|
|
1079
|
-
kind: "person" | "zone" | "
|
|
1079
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1080
1080
|
objectId?: string | undefined;
|
|
1081
1081
|
}>;
|
|
1082
1082
|
right: z.ZodObject<{
|
|
1083
|
-
kind: z.ZodEnum<["
|
|
1083
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1084
1084
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1085
1085
|
}, "strip", z.ZodTypeAny, {
|
|
1086
|
-
kind: "person" | "zone" | "
|
|
1086
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1087
1087
|
objectId?: string | undefined;
|
|
1088
1088
|
}, {
|
|
1089
|
-
kind: "person" | "zone" | "
|
|
1089
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1090
1090
|
objectId?: string | undefined;
|
|
1091
1091
|
}>;
|
|
1092
1092
|
linkExists: z.ZodBoolean;
|
|
1093
1093
|
}, "strip", z.ZodTypeAny, {
|
|
1094
1094
|
left: {
|
|
1095
|
-
kind: "person" | "zone" | "
|
|
1095
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1096
1096
|
objectId?: string | undefined;
|
|
1097
1097
|
};
|
|
1098
1098
|
right: {
|
|
1099
|
-
kind: "person" | "zone" | "
|
|
1099
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1100
1100
|
objectId?: string | undefined;
|
|
1101
1101
|
};
|
|
1102
1102
|
kind: "relation-merge";
|
|
1103
1103
|
linkExists: boolean;
|
|
1104
1104
|
}, {
|
|
1105
1105
|
left: {
|
|
1106
|
-
kind: "person" | "zone" | "
|
|
1106
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1107
1107
|
objectId?: string | undefined;
|
|
1108
1108
|
};
|
|
1109
1109
|
right: {
|
|
1110
|
-
kind: "person" | "zone" | "
|
|
1110
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1111
1111
|
objectId?: string | undefined;
|
|
1112
1112
|
};
|
|
1113
1113
|
kind: "relation-merge";
|
|
@@ -1116,71 +1116,71 @@ export declare const sRelationMerge: z.ZodObject<{
|
|
|
1116
1116
|
export declare const sAccessMutation: z.ZodUnion<[z.ZodObject<{
|
|
1117
1117
|
kind: z.ZodLiteral<"merge">;
|
|
1118
1118
|
objectId: z.ZodString;
|
|
1119
|
-
objectKind: z.ZodEnum<["
|
|
1119
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1120
1120
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1121
1121
|
}, "strip", z.ZodTypeAny, {
|
|
1122
1122
|
kind: "merge";
|
|
1123
|
-
objectKind: "person" | "zone" | "
|
|
1123
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1124
1124
|
objectId: string;
|
|
1125
1125
|
props: Record<string, unknown>;
|
|
1126
1126
|
}, {
|
|
1127
1127
|
kind: "merge";
|
|
1128
|
-
objectKind: "person" | "zone" | "
|
|
1128
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1129
1129
|
objectId: string;
|
|
1130
1130
|
props: Record<string, unknown>;
|
|
1131
1131
|
}>, z.ZodObject<{
|
|
1132
1132
|
kind: z.ZodLiteral<"delete">;
|
|
1133
1133
|
objectId: z.ZodString;
|
|
1134
|
-
objectKind: z.ZodEnum<["
|
|
1134
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1135
1135
|
}, "strip", z.ZodTypeAny, {
|
|
1136
1136
|
kind: "delete";
|
|
1137
|
-
objectKind: "person" | "zone" | "
|
|
1137
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1138
1138
|
objectId: string;
|
|
1139
1139
|
}, {
|
|
1140
1140
|
kind: "delete";
|
|
1141
|
-
objectKind: "person" | "zone" | "
|
|
1141
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1142
1142
|
objectId: string;
|
|
1143
1143
|
}>, z.ZodObject<{
|
|
1144
1144
|
kind: z.ZodLiteral<"relation-merge">;
|
|
1145
1145
|
left: z.ZodObject<{
|
|
1146
|
-
kind: z.ZodEnum<["
|
|
1146
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1147
1147
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1148
1148
|
}, "strip", z.ZodTypeAny, {
|
|
1149
|
-
kind: "person" | "zone" | "
|
|
1149
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1150
1150
|
objectId?: string | undefined;
|
|
1151
1151
|
}, {
|
|
1152
|
-
kind: "person" | "zone" | "
|
|
1152
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1153
1153
|
objectId?: string | undefined;
|
|
1154
1154
|
}>;
|
|
1155
1155
|
right: z.ZodObject<{
|
|
1156
|
-
kind: z.ZodEnum<["
|
|
1156
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1157
1157
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1158
1158
|
}, "strip", z.ZodTypeAny, {
|
|
1159
|
-
kind: "person" | "zone" | "
|
|
1159
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1160
1160
|
objectId?: string | undefined;
|
|
1161
1161
|
}, {
|
|
1162
|
-
kind: "person" | "zone" | "
|
|
1162
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1163
1163
|
objectId?: string | undefined;
|
|
1164
1164
|
}>;
|
|
1165
1165
|
linkExists: z.ZodBoolean;
|
|
1166
1166
|
}, "strip", z.ZodTypeAny, {
|
|
1167
1167
|
left: {
|
|
1168
|
-
kind: "person" | "zone" | "
|
|
1168
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1169
1169
|
objectId?: string | undefined;
|
|
1170
1170
|
};
|
|
1171
1171
|
right: {
|
|
1172
|
-
kind: "person" | "zone" | "
|
|
1172
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1173
1173
|
objectId?: string | undefined;
|
|
1174
1174
|
};
|
|
1175
1175
|
kind: "relation-merge";
|
|
1176
1176
|
linkExists: boolean;
|
|
1177
1177
|
}, {
|
|
1178
1178
|
left: {
|
|
1179
|
-
kind: "person" | "zone" | "
|
|
1179
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1180
1180
|
objectId?: string | undefined;
|
|
1181
1181
|
};
|
|
1182
1182
|
right: {
|
|
1183
|
-
kind: "person" | "zone" | "
|
|
1183
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1184
1184
|
objectId?: string | undefined;
|
|
1185
1185
|
};
|
|
1186
1186
|
kind: "relation-merge";
|
|
@@ -1196,71 +1196,71 @@ export declare const sValidateChangeRq: z.ZodObject<{
|
|
|
1196
1196
|
mutations: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
1197
1197
|
kind: z.ZodLiteral<"merge">;
|
|
1198
1198
|
objectId: z.ZodString;
|
|
1199
|
-
objectKind: z.ZodEnum<["
|
|
1199
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1200
1200
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1201
1201
|
}, "strip", z.ZodTypeAny, {
|
|
1202
1202
|
kind: "merge";
|
|
1203
|
-
objectKind: "person" | "zone" | "
|
|
1203
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1204
1204
|
objectId: string;
|
|
1205
1205
|
props: Record<string, unknown>;
|
|
1206
1206
|
}, {
|
|
1207
1207
|
kind: "merge";
|
|
1208
|
-
objectKind: "person" | "zone" | "
|
|
1208
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1209
1209
|
objectId: string;
|
|
1210
1210
|
props: Record<string, unknown>;
|
|
1211
1211
|
}>, z.ZodObject<{
|
|
1212
1212
|
kind: z.ZodLiteral<"delete">;
|
|
1213
1213
|
objectId: z.ZodString;
|
|
1214
|
-
objectKind: z.ZodEnum<["
|
|
1214
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1215
1215
|
}, "strip", z.ZodTypeAny, {
|
|
1216
1216
|
kind: "delete";
|
|
1217
|
-
objectKind: "person" | "zone" | "
|
|
1217
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1218
1218
|
objectId: string;
|
|
1219
1219
|
}, {
|
|
1220
1220
|
kind: "delete";
|
|
1221
|
-
objectKind: "person" | "zone" | "
|
|
1221
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1222
1222
|
objectId: string;
|
|
1223
1223
|
}>, z.ZodObject<{
|
|
1224
1224
|
kind: z.ZodLiteral<"relation-merge">;
|
|
1225
1225
|
left: z.ZodObject<{
|
|
1226
|
-
kind: z.ZodEnum<["
|
|
1226
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1227
1227
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1228
1228
|
}, "strip", z.ZodTypeAny, {
|
|
1229
|
-
kind: "person" | "zone" | "
|
|
1229
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1230
1230
|
objectId?: string | undefined;
|
|
1231
1231
|
}, {
|
|
1232
|
-
kind: "person" | "zone" | "
|
|
1232
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1233
1233
|
objectId?: string | undefined;
|
|
1234
1234
|
}>;
|
|
1235
1235
|
right: z.ZodObject<{
|
|
1236
|
-
kind: z.ZodEnum<["
|
|
1236
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1237
1237
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1238
1238
|
}, "strip", z.ZodTypeAny, {
|
|
1239
|
-
kind: "person" | "zone" | "
|
|
1239
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1240
1240
|
objectId?: string | undefined;
|
|
1241
1241
|
}, {
|
|
1242
|
-
kind: "person" | "zone" | "
|
|
1242
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1243
1243
|
objectId?: string | undefined;
|
|
1244
1244
|
}>;
|
|
1245
1245
|
linkExists: z.ZodBoolean;
|
|
1246
1246
|
}, "strip", z.ZodTypeAny, {
|
|
1247
1247
|
left: {
|
|
1248
|
-
kind: "person" | "zone" | "
|
|
1248
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1249
1249
|
objectId?: string | undefined;
|
|
1250
1250
|
};
|
|
1251
1251
|
right: {
|
|
1252
|
-
kind: "person" | "zone" | "
|
|
1252
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1253
1253
|
objectId?: string | undefined;
|
|
1254
1254
|
};
|
|
1255
1255
|
kind: "relation-merge";
|
|
1256
1256
|
linkExists: boolean;
|
|
1257
1257
|
}, {
|
|
1258
1258
|
left: {
|
|
1259
|
-
kind: "person" | "zone" | "
|
|
1259
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1260
1260
|
objectId?: string | undefined;
|
|
1261
1261
|
};
|
|
1262
1262
|
right: {
|
|
1263
|
-
kind: "person" | "zone" | "
|
|
1263
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1264
1264
|
objectId?: string | undefined;
|
|
1265
1265
|
};
|
|
1266
1266
|
kind: "relation-merge";
|
|
@@ -1273,20 +1273,20 @@ export declare const sValidateChangeRq: z.ZodObject<{
|
|
|
1273
1273
|
refMap: Record<string, Record<string, string[]>>;
|
|
1274
1274
|
mutations: ({
|
|
1275
1275
|
kind: "merge";
|
|
1276
|
-
objectKind: "person" | "zone" | "
|
|
1276
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1277
1277
|
objectId: string;
|
|
1278
1278
|
props: Record<string, unknown>;
|
|
1279
1279
|
} | {
|
|
1280
1280
|
kind: "delete";
|
|
1281
|
-
objectKind: "person" | "zone" | "
|
|
1281
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1282
1282
|
objectId: string;
|
|
1283
1283
|
} | {
|
|
1284
1284
|
left: {
|
|
1285
|
-
kind: "person" | "zone" | "
|
|
1285
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1286
1286
|
objectId?: string | undefined;
|
|
1287
1287
|
};
|
|
1288
1288
|
right: {
|
|
1289
|
-
kind: "person" | "zone" | "
|
|
1289
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1290
1290
|
objectId?: string | undefined;
|
|
1291
1291
|
};
|
|
1292
1292
|
kind: "relation-merge";
|
|
@@ -1299,20 +1299,20 @@ export declare const sValidateChangeRq: z.ZodObject<{
|
|
|
1299
1299
|
refMap: Record<string, Record<string, string[]>>;
|
|
1300
1300
|
mutations: ({
|
|
1301
1301
|
kind: "merge";
|
|
1302
|
-
objectKind: "person" | "zone" | "
|
|
1302
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1303
1303
|
objectId: string;
|
|
1304
1304
|
props: Record<string, unknown>;
|
|
1305
1305
|
} | {
|
|
1306
1306
|
kind: "delete";
|
|
1307
|
-
objectKind: "person" | "zone" | "
|
|
1307
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1308
1308
|
objectId: string;
|
|
1309
1309
|
} | {
|
|
1310
1310
|
left: {
|
|
1311
|
-
kind: "person" | "zone" | "
|
|
1311
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1312
1312
|
objectId?: string | undefined;
|
|
1313
1313
|
};
|
|
1314
1314
|
right: {
|
|
1315
|
-
kind: "person" | "zone" | "
|
|
1315
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1316
1316
|
objectId?: string | undefined;
|
|
1317
1317
|
};
|
|
1318
1318
|
kind: "relation-merge";
|
|
@@ -1322,7 +1322,7 @@ export declare const sValidateChangeRq: z.ZodObject<{
|
|
|
1322
1322
|
export declare const sChangeIssueCode: z.ZodEnum<["BAD_REFERENCE", "NOT_FOUND", "NOT_UNIQUE", "INVALID", "NOT_SUPPORTED"]>;
|
|
1323
1323
|
export declare const sChangeIssue: z.ZodObject<{
|
|
1324
1324
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1325
|
-
objectKind: z.ZodOptional<z.ZodEnum<["
|
|
1325
|
+
objectKind: z.ZodOptional<z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>>;
|
|
1326
1326
|
code: z.ZodOptional<z.ZodEnum<["BAD_REFERENCE", "NOT_FOUND", "NOT_UNIQUE", "INVALID", "NOT_SUPPORTED"]>>;
|
|
1327
1327
|
path: z.ZodOptional<z.ZodString>;
|
|
1328
1328
|
index: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1332,14 +1332,14 @@ export declare const sChangeIssue: z.ZodObject<{
|
|
|
1332
1332
|
code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
|
|
1333
1333
|
message?: string | undefined;
|
|
1334
1334
|
path?: string | undefined;
|
|
1335
|
-
objectKind?: "person" | "zone" | "
|
|
1335
|
+
objectKind?: "person" | "zone" | "device" | "schedule" | "accessRule" | undefined;
|
|
1336
1336
|
objectId?: string | undefined;
|
|
1337
1337
|
}, {
|
|
1338
1338
|
index?: number | undefined;
|
|
1339
1339
|
code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
|
|
1340
1340
|
message?: string | undefined;
|
|
1341
1341
|
path?: string | undefined;
|
|
1342
|
-
objectKind?: "person" | "zone" | "
|
|
1342
|
+
objectKind?: "person" | "zone" | "device" | "schedule" | "accessRule" | undefined;
|
|
1343
1343
|
objectId?: string | undefined;
|
|
1344
1344
|
}>;
|
|
1345
1345
|
export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
|
|
@@ -1354,7 +1354,7 @@ export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
|
|
|
1354
1354
|
}>, z.ZodObject<{
|
|
1355
1355
|
issues: z.ZodArray<z.ZodObject<{
|
|
1356
1356
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1357
|
-
objectKind: z.ZodOptional<z.ZodEnum<["
|
|
1357
|
+
objectKind: z.ZodOptional<z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>>;
|
|
1358
1358
|
code: z.ZodOptional<z.ZodEnum<["BAD_REFERENCE", "NOT_FOUND", "NOT_UNIQUE", "INVALID", "NOT_SUPPORTED"]>>;
|
|
1359
1359
|
path: z.ZodOptional<z.ZodString>;
|
|
1360
1360
|
index: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1364,14 +1364,14 @@ export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
|
|
|
1364
1364
|
code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
|
|
1365
1365
|
message?: string | undefined;
|
|
1366
1366
|
path?: string | undefined;
|
|
1367
|
-
objectKind?: "person" | "zone" | "
|
|
1367
|
+
objectKind?: "person" | "zone" | "device" | "schedule" | "accessRule" | undefined;
|
|
1368
1368
|
objectId?: string | undefined;
|
|
1369
1369
|
}, {
|
|
1370
1370
|
index?: number | undefined;
|
|
1371
1371
|
code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
|
|
1372
1372
|
message?: string | undefined;
|
|
1373
1373
|
path?: string | undefined;
|
|
1374
|
-
objectKind?: "person" | "zone" | "
|
|
1374
|
+
objectKind?: "person" | "zone" | "device" | "schedule" | "accessRule" | undefined;
|
|
1375
1375
|
objectId?: string | undefined;
|
|
1376
1376
|
}>, "many">;
|
|
1377
1377
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
@@ -1380,7 +1380,7 @@ export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
|
|
|
1380
1380
|
code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
|
|
1381
1381
|
message?: string | undefined;
|
|
1382
1382
|
path?: string | undefined;
|
|
1383
|
-
objectKind?: "person" | "zone" | "
|
|
1383
|
+
objectKind?: "person" | "zone" | "device" | "schedule" | "accessRule" | undefined;
|
|
1384
1384
|
objectId?: string | undefined;
|
|
1385
1385
|
}[];
|
|
1386
1386
|
}, {
|
|
@@ -1389,7 +1389,7 @@ export declare const sValidateChangeRs: z.ZodIntersection<z.ZodObject<{
|
|
|
1389
1389
|
code?: "BAD_REFERENCE" | "NOT_FOUND" | "NOT_UNIQUE" | "INVALID" | "NOT_SUPPORTED" | undefined;
|
|
1390
1390
|
message?: string | undefined;
|
|
1391
1391
|
path?: string | undefined;
|
|
1392
|
-
objectKind?: "person" | "zone" | "
|
|
1392
|
+
objectKind?: "person" | "zone" | "device" | "schedule" | "accessRule" | undefined;
|
|
1393
1393
|
objectId?: string | undefined;
|
|
1394
1394
|
}[];
|
|
1395
1395
|
}>>;
|
|
@@ -1401,71 +1401,71 @@ export declare const sApplyChange: z.ZodObject<{
|
|
|
1401
1401
|
mutations: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
1402
1402
|
kind: z.ZodLiteral<"merge">;
|
|
1403
1403
|
objectId: z.ZodString;
|
|
1404
|
-
objectKind: z.ZodEnum<["
|
|
1404
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1405
1405
|
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1406
1406
|
}, "strip", z.ZodTypeAny, {
|
|
1407
1407
|
kind: "merge";
|
|
1408
|
-
objectKind: "person" | "zone" | "
|
|
1408
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1409
1409
|
objectId: string;
|
|
1410
1410
|
props: Record<string, unknown>;
|
|
1411
1411
|
}, {
|
|
1412
1412
|
kind: "merge";
|
|
1413
|
-
objectKind: "person" | "zone" | "
|
|
1413
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1414
1414
|
objectId: string;
|
|
1415
1415
|
props: Record<string, unknown>;
|
|
1416
1416
|
}>, z.ZodObject<{
|
|
1417
1417
|
kind: z.ZodLiteral<"delete">;
|
|
1418
1418
|
objectId: z.ZodString;
|
|
1419
|
-
objectKind: z.ZodEnum<["
|
|
1419
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1420
1420
|
}, "strip", z.ZodTypeAny, {
|
|
1421
1421
|
kind: "delete";
|
|
1422
|
-
objectKind: "person" | "zone" | "
|
|
1422
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1423
1423
|
objectId: string;
|
|
1424
1424
|
}, {
|
|
1425
1425
|
kind: "delete";
|
|
1426
|
-
objectKind: "person" | "zone" | "
|
|
1426
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1427
1427
|
objectId: string;
|
|
1428
1428
|
}>, z.ZodObject<{
|
|
1429
1429
|
kind: z.ZodLiteral<"relation-merge">;
|
|
1430
1430
|
left: z.ZodObject<{
|
|
1431
|
-
kind: z.ZodEnum<["
|
|
1431
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1432
1432
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1433
1433
|
}, "strip", z.ZodTypeAny, {
|
|
1434
|
-
kind: "person" | "zone" | "
|
|
1434
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1435
1435
|
objectId?: string | undefined;
|
|
1436
1436
|
}, {
|
|
1437
|
-
kind: "person" | "zone" | "
|
|
1437
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1438
1438
|
objectId?: string | undefined;
|
|
1439
1439
|
}>;
|
|
1440
1440
|
right: z.ZodObject<{
|
|
1441
|
-
kind: z.ZodEnum<["
|
|
1441
|
+
kind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone"]>;
|
|
1442
1442
|
objectId: z.ZodOptional<z.ZodString>;
|
|
1443
1443
|
}, "strip", z.ZodTypeAny, {
|
|
1444
|
-
kind: "person" | "zone" | "
|
|
1444
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1445
1445
|
objectId?: string | undefined;
|
|
1446
1446
|
}, {
|
|
1447
|
-
kind: "person" | "zone" | "
|
|
1447
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1448
1448
|
objectId?: string | undefined;
|
|
1449
1449
|
}>;
|
|
1450
1450
|
linkExists: z.ZodBoolean;
|
|
1451
1451
|
}, "strip", z.ZodTypeAny, {
|
|
1452
1452
|
left: {
|
|
1453
|
-
kind: "person" | "zone" | "
|
|
1453
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1454
1454
|
objectId?: string | undefined;
|
|
1455
1455
|
};
|
|
1456
1456
|
right: {
|
|
1457
|
-
kind: "person" | "zone" | "
|
|
1457
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1458
1458
|
objectId?: string | undefined;
|
|
1459
1459
|
};
|
|
1460
1460
|
kind: "relation-merge";
|
|
1461
1461
|
linkExists: boolean;
|
|
1462
1462
|
}, {
|
|
1463
1463
|
left: {
|
|
1464
|
-
kind: "person" | "zone" | "
|
|
1464
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1465
1465
|
objectId?: string | undefined;
|
|
1466
1466
|
};
|
|
1467
1467
|
right: {
|
|
1468
|
-
kind: "person" | "zone" | "
|
|
1468
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1469
1469
|
objectId?: string | undefined;
|
|
1470
1470
|
};
|
|
1471
1471
|
kind: "relation-merge";
|
|
@@ -1478,20 +1478,20 @@ export declare const sApplyChange: z.ZodObject<{
|
|
|
1478
1478
|
refMap: Record<string, Record<string, string[]>>;
|
|
1479
1479
|
mutations: ({
|
|
1480
1480
|
kind: "merge";
|
|
1481
|
-
objectKind: "person" | "zone" | "
|
|
1481
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1482
1482
|
objectId: string;
|
|
1483
1483
|
props: Record<string, unknown>;
|
|
1484
1484
|
} | {
|
|
1485
1485
|
kind: "delete";
|
|
1486
|
-
objectKind: "person" | "zone" | "
|
|
1486
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1487
1487
|
objectId: string;
|
|
1488
1488
|
} | {
|
|
1489
1489
|
left: {
|
|
1490
|
-
kind: "person" | "zone" | "
|
|
1490
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1491
1491
|
objectId?: string | undefined;
|
|
1492
1492
|
};
|
|
1493
1493
|
right: {
|
|
1494
|
-
kind: "person" | "zone" | "
|
|
1494
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1495
1495
|
objectId?: string | undefined;
|
|
1496
1496
|
};
|
|
1497
1497
|
kind: "relation-merge";
|
|
@@ -1504,20 +1504,20 @@ export declare const sApplyChange: z.ZodObject<{
|
|
|
1504
1504
|
refMap: Record<string, Record<string, string[]>>;
|
|
1505
1505
|
mutations: ({
|
|
1506
1506
|
kind: "merge";
|
|
1507
|
-
objectKind: "person" | "zone" | "
|
|
1507
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1508
1508
|
objectId: string;
|
|
1509
1509
|
props: Record<string, unknown>;
|
|
1510
1510
|
} | {
|
|
1511
1511
|
kind: "delete";
|
|
1512
|
-
objectKind: "person" | "zone" | "
|
|
1512
|
+
objectKind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1513
1513
|
objectId: string;
|
|
1514
1514
|
} | {
|
|
1515
1515
|
left: {
|
|
1516
|
-
kind: "person" | "zone" | "
|
|
1516
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1517
1517
|
objectId?: string | undefined;
|
|
1518
1518
|
};
|
|
1519
1519
|
right: {
|
|
1520
|
-
kind: "person" | "zone" | "
|
|
1520
|
+
kind: "person" | "zone" | "device" | "schedule" | "accessRule";
|
|
1521
1521
|
objectId?: string | undefined;
|
|
1522
1522
|
};
|
|
1523
1523
|
kind: "relation-merge";
|
|
@@ -55,11 +55,11 @@ exports.sProviderSpecs = zod_1.z.object({
|
|
|
55
55
|
.describe('UI hints for configuration form visuals'),
|
|
56
56
|
});
|
|
57
57
|
exports.sAccessObjectKind = zod_1.z.enum([
|
|
58
|
-
'
|
|
58
|
+
'accessRule',
|
|
59
59
|
'schedule',
|
|
60
|
-
'zone',
|
|
61
60
|
'person',
|
|
62
|
-
'
|
|
61
|
+
'device',
|
|
62
|
+
'zone',
|
|
63
63
|
]);
|
|
64
64
|
exports.sTokenSpecs = zod_1.z.object({
|
|
65
65
|
type: credential_1.sCredentialType, // etc, those map to a AWARE-standardized set of token types
|
package/dist/device/server.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AccessRuleDto, PersonDto, PersonPresenceDto, ScheduleDto, ZoneDto } from '../access-control';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
import { DeviceDto } from './any-device';
|
|
3
4
|
import { AutomationRuleDto } from '../automation';
|
|
4
5
|
import { DeviceGroupDto } from '../device-group';
|
|
@@ -23,6 +24,8 @@ export type ServerState = {
|
|
|
23
24
|
runnableProviders: string[];
|
|
24
25
|
accessControlCaps: Record<string, AccessControlCapabilityReport>;
|
|
25
26
|
};
|
|
27
|
+
export declare const sObjectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
28
|
+
export type ObjectKind = z.infer<typeof sObjectKind>;
|
|
26
29
|
export type ObjectKinds = {
|
|
27
30
|
layout: LayoutDto;
|
|
28
31
|
view: ViewDto;
|
|
@@ -37,7 +40,7 @@ export type ObjectKinds = {
|
|
|
37
40
|
macro: MacroDto;
|
|
38
41
|
role: RoleDto;
|
|
39
42
|
};
|
|
40
|
-
export declare const objectKinds: readonly
|
|
43
|
+
export declare const objectKinds: readonly ObjectKind[];
|
|
41
44
|
export type ObjectCreated = {
|
|
42
45
|
[K in keyof ObjectKinds]: {
|
|
43
46
|
originator: string;
|
package/dist/device/server.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectLabels = exports.objectKinds = exports.SERVER = void 0;
|
|
3
|
+
exports.objectLabels = exports.objectKinds = exports.sObjectKind = exports.SERVER = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
4
5
|
exports.SERVER = 'server';
|
|
5
|
-
|
|
6
|
+
// EVENTS
|
|
7
|
+
exports.sObjectKind = zod_1.z.enum([
|
|
6
8
|
'accessRule',
|
|
7
9
|
'schedule',
|
|
8
10
|
'person',
|
|
@@ -15,7 +17,8 @@ exports.objectKinds = [
|
|
|
15
17
|
'automationRule',
|
|
16
18
|
'macro',
|
|
17
19
|
'role',
|
|
18
|
-
];
|
|
20
|
+
]);
|
|
21
|
+
exports.objectKinds = exports.sObjectKind.options;
|
|
19
22
|
exports.objectLabels = {
|
|
20
23
|
accessRule: 'Access Rule',
|
|
21
24
|
schedule: 'Schedule',
|
package/dist/error.d.ts
CHANGED
|
@@ -1,13 +1,391 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const sErrorNotFound: z.ZodObject<{
|
|
3
|
+
objectId: z.ZodString;
|
|
4
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
5
5
|
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
7
|
+
objectId: string;
|
|
8
8
|
}, {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
10
|
+
objectId: string;
|
|
11
11
|
}>;
|
|
12
|
-
export
|
|
12
|
+
export declare const sErrorInvalid: z.ZodObject<{
|
|
13
|
+
objectId: z.ZodString;
|
|
14
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
17
|
+
objectId: string;
|
|
18
|
+
}, {
|
|
19
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
20
|
+
objectId: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const sErrorNotSupported: z.ZodObject<{
|
|
23
|
+
objectId: z.ZodString;
|
|
24
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
27
|
+
objectId: string;
|
|
28
|
+
}, {
|
|
29
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
30
|
+
objectId: string;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const sErrorNotUnique: z.ZodObject<{
|
|
33
|
+
objectId: z.ZodString;
|
|
34
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
35
|
+
conflictingObjectId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
38
|
+
objectId: string;
|
|
39
|
+
conflictingObjectId?: string | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
42
|
+
objectId: string;
|
|
43
|
+
conflictingObjectId?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const sErrorInvalidFormat: z.ZodObject<{
|
|
46
|
+
value: z.ZodString;
|
|
47
|
+
path: z.ZodString;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
value: string;
|
|
50
|
+
path: string;
|
|
51
|
+
}, {
|
|
52
|
+
value: string;
|
|
53
|
+
path: string;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const sErrorMissingField: z.ZodObject<{
|
|
56
|
+
path: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
path: string;
|
|
59
|
+
}, {
|
|
60
|
+
path: string;
|
|
61
|
+
}>;
|
|
62
|
+
export declare const sErrorNotUniqueValue: z.ZodObject<{
|
|
63
|
+
value: z.ZodString;
|
|
64
|
+
path: z.ZodString;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
value: string;
|
|
67
|
+
path: string;
|
|
68
|
+
}, {
|
|
69
|
+
value: string;
|
|
70
|
+
path: string;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const sErrorList: z.ZodObject<{
|
|
73
|
+
errors: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
74
|
+
objectId: z.ZodString;
|
|
75
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
78
|
+
objectId: string;
|
|
79
|
+
}, {
|
|
80
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
81
|
+
objectId: string;
|
|
82
|
+
}>, z.ZodObject<{
|
|
83
|
+
objectId: z.ZodString;
|
|
84
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
87
|
+
objectId: string;
|
|
88
|
+
}, {
|
|
89
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
90
|
+
objectId: string;
|
|
91
|
+
}>, z.ZodObject<{
|
|
92
|
+
objectId: z.ZodString;
|
|
93
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
96
|
+
objectId: string;
|
|
97
|
+
}, {
|
|
98
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
99
|
+
objectId: string;
|
|
100
|
+
}>, z.ZodObject<{
|
|
101
|
+
objectId: z.ZodString;
|
|
102
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
103
|
+
conflictingObjectId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
106
|
+
objectId: string;
|
|
107
|
+
conflictingObjectId?: string | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
110
|
+
objectId: string;
|
|
111
|
+
conflictingObjectId?: string | undefined;
|
|
112
|
+
}>, z.ZodObject<{
|
|
113
|
+
value: z.ZodString;
|
|
114
|
+
path: z.ZodString;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
value: string;
|
|
117
|
+
path: string;
|
|
118
|
+
}, {
|
|
119
|
+
value: string;
|
|
120
|
+
path: string;
|
|
121
|
+
}>, z.ZodObject<{
|
|
122
|
+
path: z.ZodString;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
path: string;
|
|
125
|
+
}, {
|
|
126
|
+
path: string;
|
|
127
|
+
}>, z.ZodObject<{
|
|
128
|
+
value: z.ZodString;
|
|
129
|
+
path: z.ZodString;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
value: string;
|
|
132
|
+
path: string;
|
|
133
|
+
}, {
|
|
134
|
+
value: string;
|
|
135
|
+
path: string;
|
|
136
|
+
}>]>, "many">;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
errors: ({
|
|
139
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
140
|
+
objectId: string;
|
|
141
|
+
} | {
|
|
142
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
143
|
+
objectId: string;
|
|
144
|
+
} | {
|
|
145
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
146
|
+
objectId: string;
|
|
147
|
+
} | {
|
|
148
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
149
|
+
objectId: string;
|
|
150
|
+
conflictingObjectId?: string | undefined;
|
|
151
|
+
} | {
|
|
152
|
+
value: string;
|
|
153
|
+
path: string;
|
|
154
|
+
} | {
|
|
155
|
+
path: string;
|
|
156
|
+
} | {
|
|
157
|
+
value: string;
|
|
158
|
+
path: string;
|
|
159
|
+
})[];
|
|
160
|
+
}, {
|
|
161
|
+
errors: ({
|
|
162
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
163
|
+
objectId: string;
|
|
164
|
+
} | {
|
|
165
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
166
|
+
objectId: string;
|
|
167
|
+
} | {
|
|
168
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
169
|
+
objectId: string;
|
|
170
|
+
} | {
|
|
171
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
172
|
+
objectId: string;
|
|
173
|
+
conflictingObjectId?: string | undefined;
|
|
174
|
+
} | {
|
|
175
|
+
value: string;
|
|
176
|
+
path: string;
|
|
177
|
+
} | {
|
|
178
|
+
path: string;
|
|
179
|
+
} | {
|
|
180
|
+
value: string;
|
|
181
|
+
path: string;
|
|
182
|
+
})[];
|
|
183
|
+
}>;
|
|
184
|
+
export type ErrorNotFound = z.infer<typeof sErrorNotFound>;
|
|
185
|
+
export type ErrorInvalid = z.infer<typeof sErrorInvalid>;
|
|
186
|
+
export type ErrorNotSupported = z.infer<typeof sErrorNotSupported>;
|
|
187
|
+
export type ErrorNotUnique = z.infer<typeof sErrorNotUnique>;
|
|
188
|
+
export type ErrorInvalidFormat = z.infer<typeof sErrorInvalidFormat>;
|
|
189
|
+
export type ErrorMissingField = z.infer<typeof sErrorMissingField>;
|
|
190
|
+
export type ErrorNotUniqueValue = z.infer<typeof sErrorNotUniqueValue>;
|
|
191
|
+
export type ErrorList = z.infer<typeof sErrorList>;
|
|
192
|
+
export declare const errorDetailsMap: {
|
|
193
|
+
readonly 'not-found': z.ZodObject<{
|
|
194
|
+
objectId: z.ZodString;
|
|
195
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
198
|
+
objectId: string;
|
|
199
|
+
}, {
|
|
200
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
201
|
+
objectId: string;
|
|
202
|
+
}>;
|
|
203
|
+
readonly invalid: z.ZodObject<{
|
|
204
|
+
objectId: z.ZodString;
|
|
205
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
208
|
+
objectId: string;
|
|
209
|
+
}, {
|
|
210
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
211
|
+
objectId: string;
|
|
212
|
+
}>;
|
|
213
|
+
readonly 'not-supported': z.ZodObject<{
|
|
214
|
+
objectId: z.ZodString;
|
|
215
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
218
|
+
objectId: string;
|
|
219
|
+
}, {
|
|
220
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
221
|
+
objectId: string;
|
|
222
|
+
}>;
|
|
223
|
+
readonly 'not-unique': z.ZodObject<{
|
|
224
|
+
objectId: z.ZodString;
|
|
225
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
226
|
+
conflictingObjectId: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
229
|
+
objectId: string;
|
|
230
|
+
conflictingObjectId?: string | undefined;
|
|
231
|
+
}, {
|
|
232
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
233
|
+
objectId: string;
|
|
234
|
+
conflictingObjectId?: string | undefined;
|
|
235
|
+
}>;
|
|
236
|
+
readonly 'invalid-format': z.ZodObject<{
|
|
237
|
+
value: z.ZodString;
|
|
238
|
+
path: z.ZodString;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
value: string;
|
|
241
|
+
path: string;
|
|
242
|
+
}, {
|
|
243
|
+
value: string;
|
|
244
|
+
path: string;
|
|
245
|
+
}>;
|
|
246
|
+
readonly 'missing-field': z.ZodObject<{
|
|
247
|
+
path: z.ZodString;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
path: string;
|
|
250
|
+
}, {
|
|
251
|
+
path: string;
|
|
252
|
+
}>;
|
|
253
|
+
readonly 'not-unique-value': z.ZodObject<{
|
|
254
|
+
value: z.ZodString;
|
|
255
|
+
path: z.ZodString;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
value: string;
|
|
258
|
+
path: string;
|
|
259
|
+
}, {
|
|
260
|
+
value: string;
|
|
261
|
+
path: string;
|
|
262
|
+
}>;
|
|
263
|
+
readonly list: z.ZodObject<{
|
|
264
|
+
errors: z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
265
|
+
objectId: z.ZodString;
|
|
266
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
269
|
+
objectId: string;
|
|
270
|
+
}, {
|
|
271
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
272
|
+
objectId: string;
|
|
273
|
+
}>, z.ZodObject<{
|
|
274
|
+
objectId: z.ZodString;
|
|
275
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
278
|
+
objectId: string;
|
|
279
|
+
}, {
|
|
280
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
281
|
+
objectId: string;
|
|
282
|
+
}>, z.ZodObject<{
|
|
283
|
+
objectId: z.ZodString;
|
|
284
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
285
|
+
}, "strip", z.ZodTypeAny, {
|
|
286
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
287
|
+
objectId: string;
|
|
288
|
+
}, {
|
|
289
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
290
|
+
objectId: string;
|
|
291
|
+
}>, z.ZodObject<{
|
|
292
|
+
objectId: z.ZodString;
|
|
293
|
+
objectKind: z.ZodEnum<["accessRule", "schedule", "person", "device", "zone", "personPresence", "deviceGroup", "view", "layout", "automationRule", "macro", "role"]>;
|
|
294
|
+
conflictingObjectId: z.ZodOptional<z.ZodString>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
297
|
+
objectId: string;
|
|
298
|
+
conflictingObjectId?: string | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
301
|
+
objectId: string;
|
|
302
|
+
conflictingObjectId?: string | undefined;
|
|
303
|
+
}>, z.ZodObject<{
|
|
304
|
+
value: z.ZodString;
|
|
305
|
+
path: z.ZodString;
|
|
306
|
+
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
value: string;
|
|
308
|
+
path: string;
|
|
309
|
+
}, {
|
|
310
|
+
value: string;
|
|
311
|
+
path: string;
|
|
312
|
+
}>, z.ZodObject<{
|
|
313
|
+
path: z.ZodString;
|
|
314
|
+
}, "strip", z.ZodTypeAny, {
|
|
315
|
+
path: string;
|
|
316
|
+
}, {
|
|
317
|
+
path: string;
|
|
318
|
+
}>, z.ZodObject<{
|
|
319
|
+
value: z.ZodString;
|
|
320
|
+
path: z.ZodString;
|
|
321
|
+
}, "strip", z.ZodTypeAny, {
|
|
322
|
+
value: string;
|
|
323
|
+
path: string;
|
|
324
|
+
}, {
|
|
325
|
+
value: string;
|
|
326
|
+
path: string;
|
|
327
|
+
}>]>, "many">;
|
|
328
|
+
}, "strip", z.ZodTypeAny, {
|
|
329
|
+
errors: ({
|
|
330
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
331
|
+
objectId: string;
|
|
332
|
+
} | {
|
|
333
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
334
|
+
objectId: string;
|
|
335
|
+
} | {
|
|
336
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
337
|
+
objectId: string;
|
|
338
|
+
} | {
|
|
339
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
340
|
+
objectId: string;
|
|
341
|
+
conflictingObjectId?: string | undefined;
|
|
342
|
+
} | {
|
|
343
|
+
value: string;
|
|
344
|
+
path: string;
|
|
345
|
+
} | {
|
|
346
|
+
path: string;
|
|
347
|
+
} | {
|
|
348
|
+
value: string;
|
|
349
|
+
path: string;
|
|
350
|
+
})[];
|
|
351
|
+
}, {
|
|
352
|
+
errors: ({
|
|
353
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
354
|
+
objectId: string;
|
|
355
|
+
} | {
|
|
356
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
357
|
+
objectId: string;
|
|
358
|
+
} | {
|
|
359
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
360
|
+
objectId: string;
|
|
361
|
+
} | {
|
|
362
|
+
objectKind: "view" | "role" | "person" | "zone" | "layout" | "device" | "schedule" | "macro" | "accessRule" | "personPresence" | "deviceGroup" | "automationRule";
|
|
363
|
+
objectId: string;
|
|
364
|
+
conflictingObjectId?: string | undefined;
|
|
365
|
+
} | {
|
|
366
|
+
value: string;
|
|
367
|
+
path: string;
|
|
368
|
+
} | {
|
|
369
|
+
path: string;
|
|
370
|
+
} | {
|
|
371
|
+
value: string;
|
|
372
|
+
path: string;
|
|
373
|
+
})[];
|
|
374
|
+
}>;
|
|
375
|
+
};
|
|
376
|
+
export type ErrorDetailsMap = {
|
|
377
|
+
[K in keyof typeof errorDetailsMap]: z.infer<(typeof errorDetailsMap)[K]>;
|
|
378
|
+
};
|
|
379
|
+
export type ErrorCode = keyof typeof errorDetailsMap;
|
|
380
|
+
export type ErrorDetails = z.infer<(typeof errorDetailsMap)[keyof typeof errorDetailsMap]>;
|
|
381
|
+
export type ErrorResponse = {
|
|
382
|
+
[K in keyof typeof errorDetailsMap]: {
|
|
383
|
+
code: K;
|
|
384
|
+
message: string;
|
|
385
|
+
details: z.infer<(typeof errorDetailsMap)[K]>;
|
|
386
|
+
};
|
|
387
|
+
}[keyof typeof errorDetailsMap];
|
|
13
388
|
export declare const isErrorResponse: (obj: unknown) => obj is ErrorResponse;
|
|
389
|
+
export declare const isErrorOfCode: <T extends ErrorCode>(error: unknown, code: T) => error is ErrorResponse & {
|
|
390
|
+
code: T;
|
|
391
|
+
};
|
package/dist/error.js
CHANGED
|
@@ -1,10 +1,125 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isErrorResponse = exports.
|
|
3
|
+
exports.isErrorOfCode = exports.isErrorResponse = exports.errorDetailsMap = exports.sErrorList = exports.sErrorNotUniqueValue = exports.sErrorMissingField = exports.sErrorInvalidFormat = exports.sErrorNotUnique = exports.sErrorNotSupported = exports.sErrorInvalid = exports.sErrorNotFound = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const device_1 = require("./device");
|
|
6
|
+
exports.sErrorNotFound = zod_1.z.object({
|
|
7
|
+
objectId: zod_1.z.string(),
|
|
8
|
+
objectKind: device_1.sObjectKind,
|
|
8
9
|
});
|
|
9
|
-
|
|
10
|
+
exports.sErrorInvalid = zod_1.z.object({
|
|
11
|
+
objectId: zod_1.z.string(),
|
|
12
|
+
objectKind: device_1.sObjectKind,
|
|
13
|
+
});
|
|
14
|
+
exports.sErrorNotSupported = zod_1.z.object({
|
|
15
|
+
objectId: zod_1.z.string(),
|
|
16
|
+
objectKind: device_1.sObjectKind,
|
|
17
|
+
});
|
|
18
|
+
exports.sErrorNotUnique = zod_1.z.object({
|
|
19
|
+
objectId: zod_1.z.string(),
|
|
20
|
+
objectKind: device_1.sObjectKind,
|
|
21
|
+
conflictingObjectId: zod_1.z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
exports.sErrorInvalidFormat = zod_1.z.object({
|
|
24
|
+
value: zod_1.z.string(),
|
|
25
|
+
path: zod_1.z.string(),
|
|
26
|
+
});
|
|
27
|
+
exports.sErrorMissingField = zod_1.z.object({
|
|
28
|
+
path: zod_1.z.string(),
|
|
29
|
+
});
|
|
30
|
+
exports.sErrorNotUniqueValue = zod_1.z.object({
|
|
31
|
+
value: zod_1.z.string(),
|
|
32
|
+
path: zod_1.z.string(),
|
|
33
|
+
});
|
|
34
|
+
exports.sErrorList = zod_1.z.object({
|
|
35
|
+
errors: zod_1.z.array(zod_1.z.union([
|
|
36
|
+
exports.sErrorNotFound,
|
|
37
|
+
exports.sErrorInvalid,
|
|
38
|
+
exports.sErrorNotSupported,
|
|
39
|
+
exports.sErrorNotUnique,
|
|
40
|
+
exports.sErrorInvalidFormat,
|
|
41
|
+
exports.sErrorMissingField,
|
|
42
|
+
exports.sErrorNotUniqueValue,
|
|
43
|
+
])),
|
|
44
|
+
});
|
|
45
|
+
exports.errorDetailsMap = {
|
|
46
|
+
'not-found': exports.sErrorNotFound,
|
|
47
|
+
invalid: exports.sErrorInvalid,
|
|
48
|
+
'not-supported': exports.sErrorNotSupported,
|
|
49
|
+
'not-unique': exports.sErrorNotUnique,
|
|
50
|
+
'invalid-format': exports.sErrorInvalidFormat,
|
|
51
|
+
'missing-field': exports.sErrorMissingField,
|
|
52
|
+
'not-unique-value': exports.sErrorNotUniqueValue,
|
|
53
|
+
list: exports.sErrorList,
|
|
54
|
+
// Add more error types here as needed
|
|
55
|
+
};
|
|
56
|
+
const isErrorResponse = (obj) => {
|
|
57
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (!('code' in obj)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const code = obj.code;
|
|
64
|
+
if (typeof obj.code !== 'string') {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (!('message' in obj)) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (typeof obj.message !== 'string') {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (!('details' in obj)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const details = obj.details;
|
|
77
|
+
if (typeof details !== 'object' || details === null) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
if (!exports.errorDetailsMap[code]) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
const schema = exports.errorDetailsMap[code];
|
|
84
|
+
if (!schema.safeParse(details).success) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
};
|
|
10
89
|
exports.isErrorResponse = isErrorResponse;
|
|
90
|
+
const isErrorOfCode = (error, code) => {
|
|
91
|
+
if (typeof error !== 'object' || error === null) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (!('code' in error)) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (typeof error.code !== 'string') {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (error.code !== code) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
if (!('details' in error)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
const details = error.details;
|
|
107
|
+
if (typeof details !== 'object' || details === null) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (!exports.errorDetailsMap[code].safeParse(details).success) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
return true;
|
|
114
|
+
};
|
|
115
|
+
exports.isErrorOfCode = isErrorOfCode;
|
|
116
|
+
// export type ErrorDetailsMap = {
|
|
117
|
+
// 'not-found': ErrorNotFound;
|
|
118
|
+
// invalid: ErrorInvalid;
|
|
119
|
+
// 'not-supported': ErrorNotSupported;
|
|
120
|
+
// 'not-unique': ErrorNotUnique;
|
|
121
|
+
// };
|
|
122
|
+
// export const sErrorResponse = z.object({});
|
|
123
|
+
// export type ErrorResponse = z.infer<typeof sErrorResponse>;
|
|
124
|
+
// export const isErrorResponse = (obj: unknown): obj is ErrorResponse =>
|
|
125
|
+
// sErrorResponse.safeParse(obj).success;
|
package/dist/package.json
CHANGED