@closerepo/sentinel-contracts 1.0.0 → 1.2.0
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/index.d.ts +747 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
declare const sentinelContractVersion: 1;
|
|
4
4
|
declare const sentinelHealthReportMaximumBytes: number;
|
|
5
5
|
declare const sentinelHealthReportMaximumComponents = 64;
|
|
6
|
+
declare const sentinelHealthReportMaximumCapabilities = 64;
|
|
6
7
|
declare const sentinelEventIdSchema: z.ZodUUID;
|
|
7
8
|
declare const sentinelEvidenceSchema: z.ZodObject<{
|
|
8
9
|
label: z.ZodEnum<{
|
|
@@ -877,6 +878,563 @@ declare const sentinelHealthReportSchema: z.ZodObject<{
|
|
|
877
878
|
}, z.core.$strict>>;
|
|
878
879
|
}, z.core.$strict>>;
|
|
879
880
|
}, z.core.$strict>;
|
|
881
|
+
declare const sentinelRuntimeCapabilityObservationSchema: z.ZodObject<{
|
|
882
|
+
capabilityKey: z.ZodString;
|
|
883
|
+
state: z.ZodEnum<{
|
|
884
|
+
enabled: "enabled";
|
|
885
|
+
disabled: "disabled";
|
|
886
|
+
}>;
|
|
887
|
+
}, z.core.$strict>;
|
|
888
|
+
declare const sentinelHealthReportV2Schema: z.ZodObject<{
|
|
889
|
+
contractVersion: z.ZodLiteral<2>;
|
|
890
|
+
projectId: z.ZodString;
|
|
891
|
+
environment: z.ZodString;
|
|
892
|
+
runtimeInstanceId: z.ZodString;
|
|
893
|
+
reportId: z.ZodUUID;
|
|
894
|
+
sequence: z.ZodNumber;
|
|
895
|
+
observedAt: z.ZodISODateTime;
|
|
896
|
+
components: z.ZodArray<z.ZodObject<{
|
|
897
|
+
componentKey: z.ZodString;
|
|
898
|
+
componentClass: z.ZodString;
|
|
899
|
+
state: z.ZodEnum<{
|
|
900
|
+
unknown: "unknown";
|
|
901
|
+
failed: "failed";
|
|
902
|
+
unavailable: "unavailable";
|
|
903
|
+
degraded: "degraded";
|
|
904
|
+
healthy: "healthy";
|
|
905
|
+
}>;
|
|
906
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
907
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
908
|
+
key: z.ZodString;
|
|
909
|
+
value: z.ZodNumber;
|
|
910
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
911
|
+
bytes: "bytes";
|
|
912
|
+
count: "count";
|
|
913
|
+
milliseconds: "milliseconds";
|
|
914
|
+
percent: "percent";
|
|
915
|
+
ratio: "ratio";
|
|
916
|
+
}>>;
|
|
917
|
+
}, z.core.$strict>>;
|
|
918
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
919
|
+
episodeId: z.ZodUUID;
|
|
920
|
+
attempt: z.ZodNumber;
|
|
921
|
+
terminal: z.ZodBoolean;
|
|
922
|
+
operation: z.ZodString;
|
|
923
|
+
stage: z.ZodString;
|
|
924
|
+
code: z.ZodString;
|
|
925
|
+
summary: z.ZodString;
|
|
926
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
927
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
928
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
929
|
+
}, z.core.$strict>>;
|
|
930
|
+
}, z.core.$strict>>;
|
|
931
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
932
|
+
capabilityKey: z.ZodString;
|
|
933
|
+
state: z.ZodEnum<{
|
|
934
|
+
enabled: "enabled";
|
|
935
|
+
disabled: "disabled";
|
|
936
|
+
}>;
|
|
937
|
+
}, z.core.$strict>>;
|
|
938
|
+
}, z.core.$strict>;
|
|
939
|
+
declare const sentinelHealthReportAnySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
940
|
+
contractVersion: z.ZodLiteral<1>;
|
|
941
|
+
projectId: z.ZodString;
|
|
942
|
+
environment: z.ZodString;
|
|
943
|
+
runtimeInstanceId: z.ZodString;
|
|
944
|
+
reportId: z.ZodUUID;
|
|
945
|
+
sequence: z.ZodNumber;
|
|
946
|
+
observedAt: z.ZodISODateTime;
|
|
947
|
+
components: z.ZodArray<z.ZodObject<{
|
|
948
|
+
componentKey: z.ZodString;
|
|
949
|
+
componentClass: z.ZodString;
|
|
950
|
+
state: z.ZodEnum<{
|
|
951
|
+
unknown: "unknown";
|
|
952
|
+
failed: "failed";
|
|
953
|
+
unavailable: "unavailable";
|
|
954
|
+
degraded: "degraded";
|
|
955
|
+
healthy: "healthy";
|
|
956
|
+
}>;
|
|
957
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
958
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
959
|
+
key: z.ZodString;
|
|
960
|
+
value: z.ZodNumber;
|
|
961
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
962
|
+
bytes: "bytes";
|
|
963
|
+
count: "count";
|
|
964
|
+
milliseconds: "milliseconds";
|
|
965
|
+
percent: "percent";
|
|
966
|
+
ratio: "ratio";
|
|
967
|
+
}>>;
|
|
968
|
+
}, z.core.$strict>>;
|
|
969
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
970
|
+
episodeId: z.ZodUUID;
|
|
971
|
+
attempt: z.ZodNumber;
|
|
972
|
+
terminal: z.ZodBoolean;
|
|
973
|
+
operation: z.ZodString;
|
|
974
|
+
stage: z.ZodString;
|
|
975
|
+
code: z.ZodString;
|
|
976
|
+
summary: z.ZodString;
|
|
977
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
978
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
979
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
980
|
+
}, z.core.$strict>>;
|
|
981
|
+
}, z.core.$strict>>;
|
|
982
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
983
|
+
contractVersion: z.ZodLiteral<2>;
|
|
984
|
+
projectId: z.ZodString;
|
|
985
|
+
environment: z.ZodString;
|
|
986
|
+
runtimeInstanceId: z.ZodString;
|
|
987
|
+
reportId: z.ZodUUID;
|
|
988
|
+
sequence: z.ZodNumber;
|
|
989
|
+
observedAt: z.ZodISODateTime;
|
|
990
|
+
components: z.ZodArray<z.ZodObject<{
|
|
991
|
+
componentKey: z.ZodString;
|
|
992
|
+
componentClass: z.ZodString;
|
|
993
|
+
state: z.ZodEnum<{
|
|
994
|
+
unknown: "unknown";
|
|
995
|
+
failed: "failed";
|
|
996
|
+
unavailable: "unavailable";
|
|
997
|
+
degraded: "degraded";
|
|
998
|
+
healthy: "healthy";
|
|
999
|
+
}>;
|
|
1000
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1001
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1002
|
+
key: z.ZodString;
|
|
1003
|
+
value: z.ZodNumber;
|
|
1004
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1005
|
+
bytes: "bytes";
|
|
1006
|
+
count: "count";
|
|
1007
|
+
milliseconds: "milliseconds";
|
|
1008
|
+
percent: "percent";
|
|
1009
|
+
ratio: "ratio";
|
|
1010
|
+
}>>;
|
|
1011
|
+
}, z.core.$strict>>;
|
|
1012
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1013
|
+
episodeId: z.ZodUUID;
|
|
1014
|
+
attempt: z.ZodNumber;
|
|
1015
|
+
terminal: z.ZodBoolean;
|
|
1016
|
+
operation: z.ZodString;
|
|
1017
|
+
stage: z.ZodString;
|
|
1018
|
+
code: z.ZodString;
|
|
1019
|
+
summary: z.ZodString;
|
|
1020
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1021
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1022
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1023
|
+
}, z.core.$strict>>;
|
|
1024
|
+
}, z.core.$strict>>;
|
|
1025
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
1026
|
+
capabilityKey: z.ZodString;
|
|
1027
|
+
state: z.ZodEnum<{
|
|
1028
|
+
enabled: "enabled";
|
|
1029
|
+
disabled: "disabled";
|
|
1030
|
+
}>;
|
|
1031
|
+
}, z.core.$strict>>;
|
|
1032
|
+
}, z.core.$strict>]>;
|
|
1033
|
+
declare const sentinelHealthRuntimeStatusSchema: z.ZodObject<{
|
|
1034
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1035
|
+
statusType: z.ZodLiteral<"health">;
|
|
1036
|
+
projectId: z.ZodString;
|
|
1037
|
+
environment: z.ZodString;
|
|
1038
|
+
runtimes: z.ZodArray<z.ZodObject<{
|
|
1039
|
+
runtimeInstanceId: z.ZodString;
|
|
1040
|
+
state: z.ZodEnum<{
|
|
1041
|
+
unavailable: "unavailable";
|
|
1042
|
+
degraded: "degraded";
|
|
1043
|
+
healthy: "healthy";
|
|
1044
|
+
stale: "stale";
|
|
1045
|
+
}>;
|
|
1046
|
+
latestReport: z.ZodNullable<z.ZodObject<{
|
|
1047
|
+
receivedAt: z.ZodISODateTime;
|
|
1048
|
+
report: z.ZodUnion<readonly [z.ZodObject<{
|
|
1049
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1050
|
+
projectId: z.ZodString;
|
|
1051
|
+
environment: z.ZodString;
|
|
1052
|
+
runtimeInstanceId: z.ZodString;
|
|
1053
|
+
reportId: z.ZodUUID;
|
|
1054
|
+
sequence: z.ZodNumber;
|
|
1055
|
+
observedAt: z.ZodISODateTime;
|
|
1056
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1057
|
+
componentKey: z.ZodString;
|
|
1058
|
+
componentClass: z.ZodString;
|
|
1059
|
+
state: z.ZodEnum<{
|
|
1060
|
+
unknown: "unknown";
|
|
1061
|
+
failed: "failed";
|
|
1062
|
+
unavailable: "unavailable";
|
|
1063
|
+
degraded: "degraded";
|
|
1064
|
+
healthy: "healthy";
|
|
1065
|
+
}>;
|
|
1066
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1067
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1068
|
+
key: z.ZodString;
|
|
1069
|
+
value: z.ZodNumber;
|
|
1070
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1071
|
+
bytes: "bytes";
|
|
1072
|
+
count: "count";
|
|
1073
|
+
milliseconds: "milliseconds";
|
|
1074
|
+
percent: "percent";
|
|
1075
|
+
ratio: "ratio";
|
|
1076
|
+
}>>;
|
|
1077
|
+
}, z.core.$strict>>;
|
|
1078
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1079
|
+
episodeId: z.ZodUUID;
|
|
1080
|
+
attempt: z.ZodNumber;
|
|
1081
|
+
terminal: z.ZodBoolean;
|
|
1082
|
+
operation: z.ZodString;
|
|
1083
|
+
stage: z.ZodString;
|
|
1084
|
+
code: z.ZodString;
|
|
1085
|
+
summary: z.ZodString;
|
|
1086
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1087
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1088
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1089
|
+
}, z.core.$strict>>;
|
|
1090
|
+
}, z.core.$strict>>;
|
|
1091
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1092
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1093
|
+
projectId: z.ZodString;
|
|
1094
|
+
environment: z.ZodString;
|
|
1095
|
+
runtimeInstanceId: z.ZodString;
|
|
1096
|
+
reportId: z.ZodUUID;
|
|
1097
|
+
sequence: z.ZodNumber;
|
|
1098
|
+
observedAt: z.ZodISODateTime;
|
|
1099
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1100
|
+
componentKey: z.ZodString;
|
|
1101
|
+
componentClass: z.ZodString;
|
|
1102
|
+
state: z.ZodEnum<{
|
|
1103
|
+
unknown: "unknown";
|
|
1104
|
+
failed: "failed";
|
|
1105
|
+
unavailable: "unavailable";
|
|
1106
|
+
degraded: "degraded";
|
|
1107
|
+
healthy: "healthy";
|
|
1108
|
+
}>;
|
|
1109
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1110
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1111
|
+
key: z.ZodString;
|
|
1112
|
+
value: z.ZodNumber;
|
|
1113
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1114
|
+
bytes: "bytes";
|
|
1115
|
+
count: "count";
|
|
1116
|
+
milliseconds: "milliseconds";
|
|
1117
|
+
percent: "percent";
|
|
1118
|
+
ratio: "ratio";
|
|
1119
|
+
}>>;
|
|
1120
|
+
}, z.core.$strict>>;
|
|
1121
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1122
|
+
episodeId: z.ZodUUID;
|
|
1123
|
+
attempt: z.ZodNumber;
|
|
1124
|
+
terminal: z.ZodBoolean;
|
|
1125
|
+
operation: z.ZodString;
|
|
1126
|
+
stage: z.ZodString;
|
|
1127
|
+
code: z.ZodString;
|
|
1128
|
+
summary: z.ZodString;
|
|
1129
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1130
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1131
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1132
|
+
}, z.core.$strict>>;
|
|
1133
|
+
}, z.core.$strict>>;
|
|
1134
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
1135
|
+
capabilityKey: z.ZodString;
|
|
1136
|
+
state: z.ZodEnum<{
|
|
1137
|
+
enabled: "enabled";
|
|
1138
|
+
disabled: "disabled";
|
|
1139
|
+
}>;
|
|
1140
|
+
}, z.core.$strict>>;
|
|
1141
|
+
}, z.core.$strict>]>;
|
|
1142
|
+
}, z.core.$strict>>;
|
|
1143
|
+
componentIncidents: z.ZodArray<z.ZodObject<{
|
|
1144
|
+
componentKey: z.ZodString;
|
|
1145
|
+
failure: z.ZodObject<{
|
|
1146
|
+
episodeId: z.ZodUUID;
|
|
1147
|
+
attempt: z.ZodNumber;
|
|
1148
|
+
terminal: z.ZodBoolean;
|
|
1149
|
+
operation: z.ZodString;
|
|
1150
|
+
stage: z.ZodString;
|
|
1151
|
+
code: z.ZodString;
|
|
1152
|
+
summary: z.ZodString;
|
|
1153
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1154
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1155
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1156
|
+
}, z.core.$strict>;
|
|
1157
|
+
incidentId: z.ZodUUID;
|
|
1158
|
+
}, z.core.$strict>>;
|
|
1159
|
+
runtimeExpectationIncident: z.ZodNullable<z.ZodObject<{
|
|
1160
|
+
differences: z.ZodArray<z.ZodObject<{
|
|
1161
|
+
capabilityKey: z.ZodString;
|
|
1162
|
+
expected: z.ZodEnum<{
|
|
1163
|
+
enabled: "enabled";
|
|
1164
|
+
disabled: "disabled";
|
|
1165
|
+
}>;
|
|
1166
|
+
kind: z.ZodEnum<{
|
|
1167
|
+
mismatch: "mismatch";
|
|
1168
|
+
missing: "missing";
|
|
1169
|
+
}>;
|
|
1170
|
+
observed: z.ZodNullable<z.ZodEnum<{
|
|
1171
|
+
enabled: "enabled";
|
|
1172
|
+
disabled: "disabled";
|
|
1173
|
+
}>>;
|
|
1174
|
+
}, z.core.$strict>>;
|
|
1175
|
+
expectationRevision: z.ZodString;
|
|
1176
|
+
incidentId: z.ZodUUID;
|
|
1177
|
+
observationState: z.ZodEnum<{
|
|
1178
|
+
unavailable: "unavailable";
|
|
1179
|
+
available: "available";
|
|
1180
|
+
}>;
|
|
1181
|
+
}, z.core.$strict>>;
|
|
1182
|
+
staleIncident: z.ZodNullable<z.ZodObject<{
|
|
1183
|
+
incidentId: z.ZodUUID;
|
|
1184
|
+
openedAt: z.ZodISODateTime;
|
|
1185
|
+
}, z.core.$strict>>;
|
|
1186
|
+
}, z.core.$strict>>;
|
|
1187
|
+
}, z.core.$strict>;
|
|
1188
|
+
declare const sentinelStatusResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1189
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1190
|
+
projectId: z.ZodString;
|
|
1191
|
+
environment: z.ZodString;
|
|
1192
|
+
registration: z.ZodObject<{
|
|
1193
|
+
enabled: z.ZodBoolean;
|
|
1194
|
+
mode: z.ZodEnum<{
|
|
1195
|
+
live: "live";
|
|
1196
|
+
disabled: "disabled";
|
|
1197
|
+
shadow: "shadow";
|
|
1198
|
+
}>;
|
|
1199
|
+
policyDigest: z.ZodString;
|
|
1200
|
+
projectionDigest: z.ZodString;
|
|
1201
|
+
projectedAt: z.ZodISODateTime;
|
|
1202
|
+
sourceRevision: z.ZodString;
|
|
1203
|
+
}, z.core.$strict>;
|
|
1204
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
1205
|
+
id: z.ZodString;
|
|
1206
|
+
semanticDigest: z.ZodString;
|
|
1207
|
+
enabled: z.ZodBoolean;
|
|
1208
|
+
state: z.ZodEnum<{
|
|
1209
|
+
unknown: "unknown";
|
|
1210
|
+
firing: "firing";
|
|
1211
|
+
closed: "closed";
|
|
1212
|
+
idle: "idle";
|
|
1213
|
+
}>;
|
|
1214
|
+
severity: z.ZodNullable<z.ZodEnum<{
|
|
1215
|
+
warning: "warning";
|
|
1216
|
+
critical: "critical";
|
|
1217
|
+
}>>;
|
|
1218
|
+
incidentId: z.ZodNullable<z.ZodUUID>;
|
|
1219
|
+
lastEvaluatedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1220
|
+
lastEventId: z.ZodNullable<z.ZodUUID>;
|
|
1221
|
+
}, z.core.$strict>>;
|
|
1222
|
+
deliveries: z.ZodArray<z.ZodObject<{
|
|
1223
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1224
|
+
projectId: z.ZodString;
|
|
1225
|
+
environment: z.ZodString;
|
|
1226
|
+
eventId: z.ZodUUID;
|
|
1227
|
+
state: z.ZodEnum<{
|
|
1228
|
+
pending: "pending";
|
|
1229
|
+
delivered: "delivered";
|
|
1230
|
+
failed: "failed";
|
|
1231
|
+
retrying: "retrying";
|
|
1232
|
+
partial: "partial";
|
|
1233
|
+
unavailable: "unavailable";
|
|
1234
|
+
}>;
|
|
1235
|
+
reason: z.ZodEnum<{
|
|
1236
|
+
in_progress: "in_progress";
|
|
1237
|
+
partial_delivery: "partial_delivery";
|
|
1238
|
+
complete: "complete";
|
|
1239
|
+
retry_exhausted: "retry_exhausted";
|
|
1240
|
+
receipt_unavailable: "receipt_unavailable";
|
|
1241
|
+
}>;
|
|
1242
|
+
receivers: z.ZodArray<z.ZodObject<{
|
|
1243
|
+
receiverKey: z.ZodString;
|
|
1244
|
+
state: z.ZodEnum<{
|
|
1245
|
+
pending: "pending";
|
|
1246
|
+
delivering: "delivering";
|
|
1247
|
+
delivered: "delivered";
|
|
1248
|
+
failed: "failed";
|
|
1249
|
+
}>;
|
|
1250
|
+
attempts: z.ZodNumber;
|
|
1251
|
+
failureCode: z.ZodNullable<z.ZodEnum<{
|
|
1252
|
+
delivery_interrupted: "delivery_interrupted";
|
|
1253
|
+
provider_rejected: "provider_rejected";
|
|
1254
|
+
provider_timeout: "provider_timeout";
|
|
1255
|
+
provider_unavailable: "provider_unavailable";
|
|
1256
|
+
receiver_missing: "receiver_missing";
|
|
1257
|
+
synthetic_retry: "synthetic_retry";
|
|
1258
|
+
}>>;
|
|
1259
|
+
leaseExpiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1260
|
+
lastAttemptAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1261
|
+
}, z.core.$strict>>;
|
|
1262
|
+
updatedAt: z.ZodISODateTime;
|
|
1263
|
+
}, z.core.$strict>>;
|
|
1264
|
+
heartbeat: z.ZodObject<{
|
|
1265
|
+
state: z.ZodEnum<{
|
|
1266
|
+
unavailable: "unavailable";
|
|
1267
|
+
healthy: "healthy";
|
|
1268
|
+
stale: "stale";
|
|
1269
|
+
}>;
|
|
1270
|
+
lastCompletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1271
|
+
}, z.core.$strict>;
|
|
1272
|
+
diagnostics: z.ZodArray<z.ZodObject<{
|
|
1273
|
+
code: z.ZodString;
|
|
1274
|
+
state: z.ZodEnum<{
|
|
1275
|
+
unknown: "unknown";
|
|
1276
|
+
warning: "warning";
|
|
1277
|
+
failed: "failed";
|
|
1278
|
+
degraded: "degraded";
|
|
1279
|
+
}>;
|
|
1280
|
+
summary: z.ZodString;
|
|
1281
|
+
suggestedCommand: z.ZodOptional<z.ZodString>;
|
|
1282
|
+
}, z.core.$strict>>;
|
|
1283
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1284
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1285
|
+
statusType: z.ZodLiteral<"health">;
|
|
1286
|
+
projectId: z.ZodString;
|
|
1287
|
+
environment: z.ZodString;
|
|
1288
|
+
runtimes: z.ZodArray<z.ZodObject<{
|
|
1289
|
+
runtimeInstanceId: z.ZodString;
|
|
1290
|
+
state: z.ZodEnum<{
|
|
1291
|
+
unavailable: "unavailable";
|
|
1292
|
+
degraded: "degraded";
|
|
1293
|
+
healthy: "healthy";
|
|
1294
|
+
stale: "stale";
|
|
1295
|
+
}>;
|
|
1296
|
+
latestReport: z.ZodNullable<z.ZodObject<{
|
|
1297
|
+
receivedAt: z.ZodISODateTime;
|
|
1298
|
+
report: z.ZodUnion<readonly [z.ZodObject<{
|
|
1299
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1300
|
+
projectId: z.ZodString;
|
|
1301
|
+
environment: z.ZodString;
|
|
1302
|
+
runtimeInstanceId: z.ZodString;
|
|
1303
|
+
reportId: z.ZodUUID;
|
|
1304
|
+
sequence: z.ZodNumber;
|
|
1305
|
+
observedAt: z.ZodISODateTime;
|
|
1306
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1307
|
+
componentKey: z.ZodString;
|
|
1308
|
+
componentClass: z.ZodString;
|
|
1309
|
+
state: z.ZodEnum<{
|
|
1310
|
+
unknown: "unknown";
|
|
1311
|
+
failed: "failed";
|
|
1312
|
+
unavailable: "unavailable";
|
|
1313
|
+
degraded: "degraded";
|
|
1314
|
+
healthy: "healthy";
|
|
1315
|
+
}>;
|
|
1316
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1317
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1318
|
+
key: z.ZodString;
|
|
1319
|
+
value: z.ZodNumber;
|
|
1320
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1321
|
+
bytes: "bytes";
|
|
1322
|
+
count: "count";
|
|
1323
|
+
milliseconds: "milliseconds";
|
|
1324
|
+
percent: "percent";
|
|
1325
|
+
ratio: "ratio";
|
|
1326
|
+
}>>;
|
|
1327
|
+
}, z.core.$strict>>;
|
|
1328
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1329
|
+
episodeId: z.ZodUUID;
|
|
1330
|
+
attempt: z.ZodNumber;
|
|
1331
|
+
terminal: z.ZodBoolean;
|
|
1332
|
+
operation: z.ZodString;
|
|
1333
|
+
stage: z.ZodString;
|
|
1334
|
+
code: z.ZodString;
|
|
1335
|
+
summary: z.ZodString;
|
|
1336
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1337
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1338
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1339
|
+
}, z.core.$strict>>;
|
|
1340
|
+
}, z.core.$strict>>;
|
|
1341
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1342
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1343
|
+
projectId: z.ZodString;
|
|
1344
|
+
environment: z.ZodString;
|
|
1345
|
+
runtimeInstanceId: z.ZodString;
|
|
1346
|
+
reportId: z.ZodUUID;
|
|
1347
|
+
sequence: z.ZodNumber;
|
|
1348
|
+
observedAt: z.ZodISODateTime;
|
|
1349
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1350
|
+
componentKey: z.ZodString;
|
|
1351
|
+
componentClass: z.ZodString;
|
|
1352
|
+
state: z.ZodEnum<{
|
|
1353
|
+
unknown: "unknown";
|
|
1354
|
+
failed: "failed";
|
|
1355
|
+
unavailable: "unavailable";
|
|
1356
|
+
degraded: "degraded";
|
|
1357
|
+
healthy: "healthy";
|
|
1358
|
+
}>;
|
|
1359
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1360
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1361
|
+
key: z.ZodString;
|
|
1362
|
+
value: z.ZodNumber;
|
|
1363
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1364
|
+
bytes: "bytes";
|
|
1365
|
+
count: "count";
|
|
1366
|
+
milliseconds: "milliseconds";
|
|
1367
|
+
percent: "percent";
|
|
1368
|
+
ratio: "ratio";
|
|
1369
|
+
}>>;
|
|
1370
|
+
}, z.core.$strict>>;
|
|
1371
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1372
|
+
episodeId: z.ZodUUID;
|
|
1373
|
+
attempt: z.ZodNumber;
|
|
1374
|
+
terminal: z.ZodBoolean;
|
|
1375
|
+
operation: z.ZodString;
|
|
1376
|
+
stage: z.ZodString;
|
|
1377
|
+
code: z.ZodString;
|
|
1378
|
+
summary: z.ZodString;
|
|
1379
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1380
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1381
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1382
|
+
}, z.core.$strict>>;
|
|
1383
|
+
}, z.core.$strict>>;
|
|
1384
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
1385
|
+
capabilityKey: z.ZodString;
|
|
1386
|
+
state: z.ZodEnum<{
|
|
1387
|
+
enabled: "enabled";
|
|
1388
|
+
disabled: "disabled";
|
|
1389
|
+
}>;
|
|
1390
|
+
}, z.core.$strict>>;
|
|
1391
|
+
}, z.core.$strict>]>;
|
|
1392
|
+
}, z.core.$strict>>;
|
|
1393
|
+
componentIncidents: z.ZodArray<z.ZodObject<{
|
|
1394
|
+
componentKey: z.ZodString;
|
|
1395
|
+
failure: z.ZodObject<{
|
|
1396
|
+
episodeId: z.ZodUUID;
|
|
1397
|
+
attempt: z.ZodNumber;
|
|
1398
|
+
terminal: z.ZodBoolean;
|
|
1399
|
+
operation: z.ZodString;
|
|
1400
|
+
stage: z.ZodString;
|
|
1401
|
+
code: z.ZodString;
|
|
1402
|
+
summary: z.ZodString;
|
|
1403
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1404
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1405
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1406
|
+
}, z.core.$strict>;
|
|
1407
|
+
incidentId: z.ZodUUID;
|
|
1408
|
+
}, z.core.$strict>>;
|
|
1409
|
+
runtimeExpectationIncident: z.ZodNullable<z.ZodObject<{
|
|
1410
|
+
differences: z.ZodArray<z.ZodObject<{
|
|
1411
|
+
capabilityKey: z.ZodString;
|
|
1412
|
+
expected: z.ZodEnum<{
|
|
1413
|
+
enabled: "enabled";
|
|
1414
|
+
disabled: "disabled";
|
|
1415
|
+
}>;
|
|
1416
|
+
kind: z.ZodEnum<{
|
|
1417
|
+
mismatch: "mismatch";
|
|
1418
|
+
missing: "missing";
|
|
1419
|
+
}>;
|
|
1420
|
+
observed: z.ZodNullable<z.ZodEnum<{
|
|
1421
|
+
enabled: "enabled";
|
|
1422
|
+
disabled: "disabled";
|
|
1423
|
+
}>>;
|
|
1424
|
+
}, z.core.$strict>>;
|
|
1425
|
+
expectationRevision: z.ZodString;
|
|
1426
|
+
incidentId: z.ZodUUID;
|
|
1427
|
+
observationState: z.ZodEnum<{
|
|
1428
|
+
unavailable: "unavailable";
|
|
1429
|
+
available: "available";
|
|
1430
|
+
}>;
|
|
1431
|
+
}, z.core.$strict>>;
|
|
1432
|
+
staleIncident: z.ZodNullable<z.ZodObject<{
|
|
1433
|
+
incidentId: z.ZodUUID;
|
|
1434
|
+
openedAt: z.ZodISODateTime;
|
|
1435
|
+
}, z.core.$strict>>;
|
|
1436
|
+
}, z.core.$strict>>;
|
|
1437
|
+
}, z.core.$strict>]>;
|
|
880
1438
|
declare const sentinelHealthReportAuthenticationSchema: z.ZodObject<{
|
|
881
1439
|
timestamp: z.ZodISODateTime;
|
|
882
1440
|
nonce: z.ZodUUID;
|
|
@@ -934,9 +1492,184 @@ declare const sentinelHealthReportSubmissionSchema: z.ZodObject<{
|
|
|
934
1492
|
signature: z.ZodString;
|
|
935
1493
|
}, z.core.$strict>;
|
|
936
1494
|
}, z.core.$strict>;
|
|
1495
|
+
declare const sentinelHealthReportSubmissionV2Schema: z.ZodObject<{
|
|
1496
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1497
|
+
report: z.ZodObject<{
|
|
1498
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1499
|
+
projectId: z.ZodString;
|
|
1500
|
+
environment: z.ZodString;
|
|
1501
|
+
runtimeInstanceId: z.ZodString;
|
|
1502
|
+
reportId: z.ZodUUID;
|
|
1503
|
+
sequence: z.ZodNumber;
|
|
1504
|
+
observedAt: z.ZodISODateTime;
|
|
1505
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1506
|
+
componentKey: z.ZodString;
|
|
1507
|
+
componentClass: z.ZodString;
|
|
1508
|
+
state: z.ZodEnum<{
|
|
1509
|
+
unknown: "unknown";
|
|
1510
|
+
failed: "failed";
|
|
1511
|
+
unavailable: "unavailable";
|
|
1512
|
+
degraded: "degraded";
|
|
1513
|
+
healthy: "healthy";
|
|
1514
|
+
}>;
|
|
1515
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1516
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1517
|
+
key: z.ZodString;
|
|
1518
|
+
value: z.ZodNumber;
|
|
1519
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1520
|
+
bytes: "bytes";
|
|
1521
|
+
count: "count";
|
|
1522
|
+
milliseconds: "milliseconds";
|
|
1523
|
+
percent: "percent";
|
|
1524
|
+
ratio: "ratio";
|
|
1525
|
+
}>>;
|
|
1526
|
+
}, z.core.$strict>>;
|
|
1527
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1528
|
+
episodeId: z.ZodUUID;
|
|
1529
|
+
attempt: z.ZodNumber;
|
|
1530
|
+
terminal: z.ZodBoolean;
|
|
1531
|
+
operation: z.ZodString;
|
|
1532
|
+
stage: z.ZodString;
|
|
1533
|
+
code: z.ZodString;
|
|
1534
|
+
summary: z.ZodString;
|
|
1535
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1536
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1537
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1538
|
+
}, z.core.$strict>>;
|
|
1539
|
+
}, z.core.$strict>>;
|
|
1540
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
1541
|
+
capabilityKey: z.ZodString;
|
|
1542
|
+
state: z.ZodEnum<{
|
|
1543
|
+
enabled: "enabled";
|
|
1544
|
+
disabled: "disabled";
|
|
1545
|
+
}>;
|
|
1546
|
+
}, z.core.$strict>>;
|
|
1547
|
+
}, z.core.$strict>;
|
|
1548
|
+
authentication: z.ZodObject<{
|
|
1549
|
+
timestamp: z.ZodISODateTime;
|
|
1550
|
+
nonce: z.ZodUUID;
|
|
1551
|
+
signature: z.ZodString;
|
|
1552
|
+
}, z.core.$strict>;
|
|
1553
|
+
}, z.core.$strict>;
|
|
1554
|
+
declare const sentinelHealthReportSubmissionAnySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
1555
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1556
|
+
report: z.ZodObject<{
|
|
1557
|
+
contractVersion: z.ZodLiteral<1>;
|
|
1558
|
+
projectId: z.ZodString;
|
|
1559
|
+
environment: z.ZodString;
|
|
1560
|
+
runtimeInstanceId: z.ZodString;
|
|
1561
|
+
reportId: z.ZodUUID;
|
|
1562
|
+
sequence: z.ZodNumber;
|
|
1563
|
+
observedAt: z.ZodISODateTime;
|
|
1564
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1565
|
+
componentKey: z.ZodString;
|
|
1566
|
+
componentClass: z.ZodString;
|
|
1567
|
+
state: z.ZodEnum<{
|
|
1568
|
+
unknown: "unknown";
|
|
1569
|
+
failed: "failed";
|
|
1570
|
+
unavailable: "unavailable";
|
|
1571
|
+
degraded: "degraded";
|
|
1572
|
+
healthy: "healthy";
|
|
1573
|
+
}>;
|
|
1574
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1575
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1576
|
+
key: z.ZodString;
|
|
1577
|
+
value: z.ZodNumber;
|
|
1578
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1579
|
+
bytes: "bytes";
|
|
1580
|
+
count: "count";
|
|
1581
|
+
milliseconds: "milliseconds";
|
|
1582
|
+
percent: "percent";
|
|
1583
|
+
ratio: "ratio";
|
|
1584
|
+
}>>;
|
|
1585
|
+
}, z.core.$strict>>;
|
|
1586
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1587
|
+
episodeId: z.ZodUUID;
|
|
1588
|
+
attempt: z.ZodNumber;
|
|
1589
|
+
terminal: z.ZodBoolean;
|
|
1590
|
+
operation: z.ZodString;
|
|
1591
|
+
stage: z.ZodString;
|
|
1592
|
+
code: z.ZodString;
|
|
1593
|
+
summary: z.ZodString;
|
|
1594
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1595
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1596
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1597
|
+
}, z.core.$strict>>;
|
|
1598
|
+
}, z.core.$strict>>;
|
|
1599
|
+
}, z.core.$strict>;
|
|
1600
|
+
authentication: z.ZodObject<{
|
|
1601
|
+
timestamp: z.ZodISODateTime;
|
|
1602
|
+
nonce: z.ZodUUID;
|
|
1603
|
+
signature: z.ZodString;
|
|
1604
|
+
}, z.core.$strict>;
|
|
1605
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1606
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1607
|
+
report: z.ZodObject<{
|
|
1608
|
+
contractVersion: z.ZodLiteral<2>;
|
|
1609
|
+
projectId: z.ZodString;
|
|
1610
|
+
environment: z.ZodString;
|
|
1611
|
+
runtimeInstanceId: z.ZodString;
|
|
1612
|
+
reportId: z.ZodUUID;
|
|
1613
|
+
sequence: z.ZodNumber;
|
|
1614
|
+
observedAt: z.ZodISODateTime;
|
|
1615
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1616
|
+
componentKey: z.ZodString;
|
|
1617
|
+
componentClass: z.ZodString;
|
|
1618
|
+
state: z.ZodEnum<{
|
|
1619
|
+
unknown: "unknown";
|
|
1620
|
+
failed: "failed";
|
|
1621
|
+
unavailable: "unavailable";
|
|
1622
|
+
degraded: "degraded";
|
|
1623
|
+
healthy: "healthy";
|
|
1624
|
+
}>;
|
|
1625
|
+
lastSuccessAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1626
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
1627
|
+
key: z.ZodString;
|
|
1628
|
+
value: z.ZodNumber;
|
|
1629
|
+
unit: z.ZodOptional<z.ZodEnum<{
|
|
1630
|
+
bytes: "bytes";
|
|
1631
|
+
count: "count";
|
|
1632
|
+
milliseconds: "milliseconds";
|
|
1633
|
+
percent: "percent";
|
|
1634
|
+
ratio: "ratio";
|
|
1635
|
+
}>>;
|
|
1636
|
+
}, z.core.$strict>>;
|
|
1637
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
1638
|
+
episodeId: z.ZodUUID;
|
|
1639
|
+
attempt: z.ZodNumber;
|
|
1640
|
+
terminal: z.ZodBoolean;
|
|
1641
|
+
operation: z.ZodString;
|
|
1642
|
+
stage: z.ZodString;
|
|
1643
|
+
code: z.ZodString;
|
|
1644
|
+
summary: z.ZodString;
|
|
1645
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
1646
|
+
upstreamStatus: z.ZodOptional<z.ZodNumber>;
|
|
1647
|
+
upstreamCode: z.ZodOptional<z.ZodString>;
|
|
1648
|
+
}, z.core.$strict>>;
|
|
1649
|
+
}, z.core.$strict>>;
|
|
1650
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
1651
|
+
capabilityKey: z.ZodString;
|
|
1652
|
+
state: z.ZodEnum<{
|
|
1653
|
+
enabled: "enabled";
|
|
1654
|
+
disabled: "disabled";
|
|
1655
|
+
}>;
|
|
1656
|
+
}, z.core.$strict>>;
|
|
1657
|
+
}, z.core.$strict>;
|
|
1658
|
+
authentication: z.ZodObject<{
|
|
1659
|
+
timestamp: z.ZodISODateTime;
|
|
1660
|
+
nonce: z.ZodUUID;
|
|
1661
|
+
signature: z.ZodString;
|
|
1662
|
+
}, z.core.$strict>;
|
|
1663
|
+
}, z.core.$strict>]>;
|
|
937
1664
|
declare function sentinelHealthReportSignatureInput(submission: Pick<SentinelHealthReportSubmission, 'contractVersion' | 'report'> & {
|
|
938
1665
|
authentication: Pick<SentinelHealthReportAuthentication, 'timestamp' | 'nonce'>;
|
|
939
1666
|
}): string;
|
|
1667
|
+
declare function sentinelHealthReportV2SignatureInput(submission: Pick<SentinelHealthReportSubmissionV2, 'contractVersion' | 'report'> & {
|
|
1668
|
+
authentication: Pick<SentinelHealthReportAuthentication, 'timestamp' | 'nonce'>;
|
|
1669
|
+
}): string;
|
|
1670
|
+
declare function sentinelHealthReportAnySignatureInput(submission: Pick<SentinelHealthReportSubmissionAny, 'contractVersion' | 'report'> & {
|
|
1671
|
+
authentication: Pick<SentinelHealthReportAuthentication, 'timestamp' | 'nonce'>;
|
|
1672
|
+
}): string;
|
|
940
1673
|
declare const sentinelHealthReportRejectionCodeSchema: z.ZodEnum<{
|
|
941
1674
|
authentication_failed: "authentication_failed";
|
|
942
1675
|
identity_not_registered: "identity_not_registered";
|
|
@@ -978,6 +1711,12 @@ declare const sentinelHealthReportIngestResultSchema: z.ZodDiscriminatedUnion<[z
|
|
|
978
1711
|
interface SentinelHealthReportServiceV1 {
|
|
979
1712
|
reportHealth(submission: SentinelHealthReportSubmission): Promise<SentinelHealthReportIngestResult>;
|
|
980
1713
|
}
|
|
1714
|
+
interface SentinelHealthReportServiceV2 {
|
|
1715
|
+
reportHealth(submission: SentinelHealthReportSubmissionV2): Promise<SentinelHealthReportIngestResult>;
|
|
1716
|
+
}
|
|
1717
|
+
interface SentinelHealthReportServiceAny {
|
|
1718
|
+
reportHealth(submission: SentinelHealthReportSubmissionAny): Promise<SentinelHealthReportIngestResult>;
|
|
1719
|
+
}
|
|
981
1720
|
type SentinelAction = z.infer<typeof sentinelActionSchema>;
|
|
982
1721
|
type SentinelAlertPolicy = z.infer<typeof sentinelAlertPolicySchema>;
|
|
983
1722
|
type SentinelDeliveryReceipt = z.infer<typeof sentinelDeliveryReceiptSchema>;
|
|
@@ -992,14 +1731,21 @@ type SentinelRegistration = z.infer<typeof sentinelRegistrationSchema>;
|
|
|
992
1731
|
type SentinelRegistrationCommand = z.infer<typeof sentinelRegistrationCommandSchema>;
|
|
993
1732
|
type SentinelRule = z.infer<typeof sentinelRuleSchema>;
|
|
994
1733
|
type SentinelRuntimeStatus = z.infer<typeof sentinelRuntimeStatusSchema>;
|
|
1734
|
+
type SentinelHealthRuntimeStatus = z.infer<typeof sentinelHealthRuntimeStatusSchema>;
|
|
1735
|
+
type SentinelStatusResponse = z.infer<typeof sentinelStatusResponseSchema>;
|
|
995
1736
|
type SentinelTestEvent = z.infer<typeof sentinelTestEventSchema>;
|
|
996
1737
|
type SentinelHealthComponent = z.infer<typeof sentinelHealthComponentSchema>;
|
|
997
1738
|
type SentinelHealthFailure = z.infer<typeof sentinelHealthFailureSchema>;
|
|
998
1739
|
type SentinelHealthMetricFact = z.infer<typeof sentinelHealthMetricFactSchema>;
|
|
999
1740
|
type SentinelHealthReport = z.infer<typeof sentinelHealthReportSchema>;
|
|
1741
|
+
type SentinelHealthReportV2 = z.infer<typeof sentinelHealthReportV2Schema>;
|
|
1742
|
+
type SentinelHealthReportAny = z.infer<typeof sentinelHealthReportAnySchema>;
|
|
1000
1743
|
type SentinelHealthReportAuthentication = z.infer<typeof sentinelHealthReportAuthenticationSchema>;
|
|
1001
1744
|
type SentinelHealthReportIngestResult = z.infer<typeof sentinelHealthReportIngestResultSchema>;
|
|
1002
1745
|
type SentinelHealthReportRejectionCode = z.infer<typeof sentinelHealthReportRejectionCodeSchema>;
|
|
1003
1746
|
type SentinelHealthReportSubmission = z.infer<typeof sentinelHealthReportSubmissionSchema>;
|
|
1747
|
+
type SentinelHealthReportSubmissionV2 = z.infer<typeof sentinelHealthReportSubmissionV2Schema>;
|
|
1748
|
+
type SentinelHealthReportSubmissionAny = z.infer<typeof sentinelHealthReportSubmissionAnySchema>;
|
|
1749
|
+
type SentinelRuntimeCapabilityObservation = z.infer<typeof sentinelRuntimeCapabilityObservationSchema>;
|
|
1004
1750
|
//#endregion
|
|
1005
|
-
export { SentinelAction, SentinelAlertPolicy, SentinelDeliveryReceipt, SentinelEnvironmentBinding, SentinelHealthComponent, SentinelHealthFailure, SentinelHealthMetricFact, SentinelHealthReport, SentinelHealthReportAuthentication, SentinelHealthReportIngestResult, SentinelHealthReportRejectionCode, SentinelHealthReportServiceV1, SentinelHealthReportSubmission, SentinelIncidentEvent, SentinelPolicyAction, SentinelProjectManifest, SentinelQueueEvent, SentinelQueueMetrics, SentinelReceiverFailureCode, SentinelRegistration, SentinelRegistrationCommand, SentinelRule, SentinelRuntimeStatus, SentinelTestEvent, sentinelActionSchema, sentinelAlertPolicySchema, sentinelContractVersion, sentinelDeliveryReceiptSchema, sentinelDiagnosticSchema, sentinelEnvironmentBindingSchema, sentinelEventIdSchema, sentinelEvidenceSchema, sentinelHealthComponentSchema, sentinelHealthFailureSchema, sentinelHealthMetricFactSchema, sentinelHealthReportAuthenticationSchema, sentinelHealthReportIngestResultSchema, sentinelHealthReportMaximumBytes, sentinelHealthReportMaximumComponents, sentinelHealthReportRejectionCodeSchema, sentinelHealthReportSchema, sentinelHealthReportSignatureInput, sentinelHealthReportSubmissionSchema, sentinelIncidentEventSchema, sentinelPolicyActionSchema, sentinelProjectManifestSchema, sentinelQueueEventIdentityInput, sentinelQueueEventSchema, sentinelQueueMetricsSchema, sentinelReceiverFailureCodeSchema, sentinelReceiverStateSchema, sentinelRegistrationCommandSchema, sentinelRegistrationSchema, sentinelRuleSchema, sentinelRunbookSchema, sentinelRuntimeStatusSchema, sentinelTestEventSchema };
|
|
1751
|
+
export { SentinelAction, SentinelAlertPolicy, SentinelDeliveryReceipt, SentinelEnvironmentBinding, SentinelHealthComponent, SentinelHealthFailure, SentinelHealthMetricFact, SentinelHealthReport, SentinelHealthReportAny, SentinelHealthReportAuthentication, SentinelHealthReportIngestResult, SentinelHealthReportRejectionCode, SentinelHealthReportServiceAny, SentinelHealthReportServiceV1, SentinelHealthReportServiceV2, SentinelHealthReportSubmission, SentinelHealthReportSubmissionAny, SentinelHealthReportSubmissionV2, SentinelHealthReportV2, SentinelHealthRuntimeStatus, SentinelIncidentEvent, SentinelPolicyAction, SentinelProjectManifest, SentinelQueueEvent, SentinelQueueMetrics, SentinelReceiverFailureCode, SentinelRegistration, SentinelRegistrationCommand, SentinelRule, SentinelRuntimeCapabilityObservation, SentinelRuntimeStatus, SentinelStatusResponse, SentinelTestEvent, sentinelActionSchema, sentinelAlertPolicySchema, sentinelContractVersion, sentinelDeliveryReceiptSchema, sentinelDiagnosticSchema, sentinelEnvironmentBindingSchema, sentinelEventIdSchema, sentinelEvidenceSchema, sentinelHealthComponentSchema, sentinelHealthFailureSchema, sentinelHealthMetricFactSchema, sentinelHealthReportAnySchema, sentinelHealthReportAnySignatureInput, sentinelHealthReportAuthenticationSchema, sentinelHealthReportIngestResultSchema, sentinelHealthReportMaximumBytes, sentinelHealthReportMaximumCapabilities, sentinelHealthReportMaximumComponents, sentinelHealthReportRejectionCodeSchema, sentinelHealthReportSchema, sentinelHealthReportSignatureInput, sentinelHealthReportSubmissionAnySchema, sentinelHealthReportSubmissionSchema, sentinelHealthReportSubmissionV2Schema, sentinelHealthReportV2Schema, sentinelHealthReportV2SignatureInput, sentinelHealthRuntimeStatusSchema, sentinelIncidentEventSchema, sentinelPolicyActionSchema, sentinelProjectManifestSchema, sentinelQueueEventIdentityInput, sentinelQueueEventSchema, sentinelQueueMetricsSchema, sentinelReceiverFailureCodeSchema, sentinelReceiverStateSchema, sentinelRegistrationCommandSchema, sentinelRegistrationSchema, sentinelRuleSchema, sentinelRunbookSchema, sentinelRuntimeCapabilityObservationSchema, sentinelRuntimeStatusSchema, sentinelStatusResponseSchema, sentinelTestEventSchema };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";const t=1,n=32*1024,r=64,i=t=>e.string().trim().min(1).max(t),a=e.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),o=e.string().regex(/^[a-z][A-Za-z0-9_]{0,63}$/),s=e.uuid(),c=s,l=e.url().refine(e=>e.startsWith(`https://`),`must use HTTPS`),u=e.object({label:e.enum([`Observed value`,`Warning threshold`,`Critical threshold`]),value:e.number().finite().nonnegative()}).strict(),d=e.object({label:i(80),url:l}).strict(),f=e.object({type:e.literal(`none`)}).strict(),p=e.object({type:e.literal(`live_command`),command:i(500).regex(/^abuse apply\b/).refine(e=>e.endsWith(` --apply`),`must end with --apply`)}).strict(),m=e.object({type:e.literal(`test_preview`),summary:i(300).refine(e=>!e.includes(`--apply`),`must not contain --apply`)}).strict(),h=e.discriminatedUnion(`type`,[f,p,m]),g=e.object({contractVersion:e.literal(1),projectId:a,environment:a,incidentId:c,eventId:c,kind:e.enum([`firing`,`reminder`,`resolved`]),severity:e.enum([`warning`,`critical`]),signalClass:e.enum([`attack`,`service`]),signal:a,title:i(120),occurredAt:e.iso.datetime(),evidence:e.array(u).max(8),runbook:d,statusCommand:i(300).regex(/^sentinel status\b/),receiverKeys:e.array(a).min(1).max(16),action:h}).strict(),_=g.extend({mode:e.literal(`live`)}).superRefine((e,t)=>{e.signalClass===`service`&&e.action.type!==`none`&&t.addIssue({code:`custom`,message:`service events cannot contain an operational action`,path:[`action`]}),e.action.type===`test_preview`&&t.addIssue({code:`custom`,message:`live events cannot contain a test preview`,path:[`action`]})}),v=g.extend({mode:e.literal(`test`),action:e.discriminatedUnion(`type`,[f,m])}).strict(),y=e.union([_,v]);function b(e){let t=y.parse(e);return JSON.stringify(t)}const x=e.enum([`delivery_interrupted`,`provider_rejected`,`provider_timeout`,`provider_unavailable`,`receiver_missing`,`synthetic_retry`]),S=e.object({receiverKey:a,state:e.enum([`pending`,`delivering`,`delivered`,`failed`]),attempts:e.number().int().min(0).max(4),failureCode:x.nullable(),leaseExpiresAt:e.iso.datetime().nullable(),lastAttemptAt:e.iso.datetime().nullable()}).strict().superRefine((e,t)=>{e.state===`failed`&&e.failureCode===null&&t.addIssue({code:`custom`,message:`failed receivers require failureCode`,path:[`failureCode`]}),e.state!==`failed`&&e.failureCode!==null&&t.addIssue({code:`custom`,message:`only failed receivers can carry failureCode`,path:[`failureCode`]})}),C=e.object({contractVersion:e.literal(1),projectId:a,environment:a,eventId:c,state:e.enum([`pending`,`retrying`,`partial`,`delivered`,`failed`,`unavailable`]),reason:e.enum([`in_progress`,`partial_delivery`,`complete`,`retry_exhausted`,`receipt_unavailable`]),receivers:e.array(S).max(16),updatedAt:e.iso.datetime()}).strict(),w=e.object({code:a,state:e.enum([`degraded`,`failed`,`unknown`,`warning`]),summary:i(300),suggestedCommand:i(500).optional()}).strict(),T=e.object({contractVersion:e.literal(1),projectId:a,environment:a,registration:e.object({enabled:e.boolean(),mode:e.enum([`disabled`,`shadow`,`live`]),policyDigest:e.string().regex(/^[a-f0-9]{64}$/),projectionDigest:e.string().regex(/^[a-f0-9]{64}$/),projectedAt:e.iso.datetime(),sourceRevision:i(160)}).strict(),rules:e.array(e.object({id:a,semanticDigest:e.string().regex(/^[a-f0-9]{64}$/),enabled:e.boolean(),state:e.enum([`closed`,`firing`,`idle`,`unknown`]),severity:e.enum([`warning`,`critical`]).nullable(),incidentId:c.nullable(),lastEvaluatedAt:e.iso.datetime().nullable(),lastEventId:c.nullable()}).strict()).max(64),deliveries:e.array(C).max(64),heartbeat:e.object({state:e.enum([`healthy`,`stale`,`unavailable`]),lastCompletedAt:e.iso.datetime().nullable()}).strict(),diagnostics:e.array(w).max(32)}).strict(),E=e.object({state:e.enum([`available`,`unavailable`]),backlogCount:e.number().int().nonnegative().nullable(),backlogBytes:e.number().int().nonnegative().nullable(),oldestMessageAt:e.iso.datetime().nullable(),retentionSeconds:e.number().int().positive().nullable()}).strict(),D=e.string().regex(/^[A-Z][A-Z0-9_]{2,127}$/),O=e.string().max(240).regex(/^(?![A-Za-z]:|\/|.*(?:^|\/)\.\.(?:\/|$)).+\.json$/),k=e.object({mode:e.enum([`disabled`,`shadow`,`live`]),statusUrlEnv:D,statusHmacSecretEnv:D,healthReportHmacSecretEnv:D.optional(),opsAccountIdEnv:D,provisionApiTokenEnv:D,statusApiTokenEnv:D,analyticsAccountIdEnv:D,analyticsApiTokenEnv:D,analyticsDataset:a,workerName:a,queueName:a,dlqName:a,registrationQueueName:a,registrationDlqName:a,notificationWorkerName:a,healthchecksProvisionApiKeyEnv:D.optional(),healthchecksPingUrlEnv:D.optional(),healthchecksStatusApiKeyEnv:D.optional()}).strict().superRefine((e,t)=>{let n=[e.healthchecksProvisionApiKeyEnv,e.healthchecksPingUrlEnv,e.healthchecksStatusApiKeyEnv].filter(Boolean);n.length>0&&n.length!==3&&t.addIssue({code:`custom`,message:`Healthchecks provision, status and ping URL references must be configured together`,path:[`healthchecksProvisionApiKeyEnv`]})}),A=e.object({contractVersion:e.literal(1),projectId:a,policy:O,environments:e.record(a,k)}).strict().superRefine((e,t)=>{Object.keys(e.environments).length===0&&t.addIssue({code:`custom`,message:`at least one environment is required`,path:[`environments`]})}),j=e.object({type:e.literal(`abuse`),project:e.string().regex(/^[a-zA-Z0-9._/-]{1,120}$/),target:a,action:a,layer:a,ttl:e.string().regex(/^[1-9][0-9]{0,4}[smhd]$/).optional()}).strict(),M=e.discriminatedUnion(`type`,[f,j]),N=e.object({id:a,enabled:e.boolean(),signalClass:e.enum([`attack`,`service`]),signal:e.object({type:e.enum([`operation_count`,`worker_error_ratio`,`edge_security_spike`,`provider_health`]),operation:o.optional(),operations:e.array(o).min(1).max(16).optional(),outcomes:e.array(e.enum([`committed`,`accepted_noop`,`rejected`,`failed`])).max(4).optional(),minimumSample:e.number().int().positive().optional()}).strict(),windowMinutes:e.number().int().min(5).max(1440),thresholds:e.object({warning:e.number().nonnegative(),critical:e.number().positive()}).strict().refine(e=>e.critical>e.warning,`critical must exceed warning`),recovery:e.object({healthyEvaluations:e.number().int().min(1).max(24)}).strict(),reminders:e.object({warningMinutes:e.number().int().min(5).max(10080),criticalMinutes:e.number().int().min(5).max(10080)}).strict(),runbook:d,receiverKeys:e.array(a).min(1).max(16),actions:e.object({warning:M,critical:M}).strict()}).strict().superRefine((e,t)=>{e.signal.operation&&e.signal.operations&&t.addIssue({code:`custom`,message:`signal cannot define both operation and operations`,path:[`signal`]}),e.signal.type===`operation_count`&&!e.signal.operation&&!e.signal.operations&&t.addIssue({code:`custom`,message:`operation_count requires operation or operations`,path:[`signal`]}),e.signal.type===`provider_health`&&e.thresholds.warning>1&&t.addIssue({code:`custom`,message:`provider_health warning threshold must be at most 1`,path:[`thresholds`,`warning`]}),e.signalClass===`service`&&(e.actions.warning.type!==`none`||e.actions.critical.type!==`none`)&&t.addIssue({code:`custom`,message:`service rules cannot configure abuse actions`,path:[`actions`]})}),P=e.object({contractVersion:e.literal(1),evaluationMinutes:e.number().int().min(5).max(60),rules:e.array(N).min(1).max(64)}).strict().superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.rules.entries())n.has(i.id)&&t.addIssue({code:`custom`,message:`duplicate rule id ${i.id}`,path:[`rules`,r,`id`]}),n.add(i.id)}),F=e.object({analytics:e.object({accountIdBinding:D,dataset:a,index:i(160),tokenBinding:D}).strict(),enabled:e.boolean(),environment:a,mode:e.enum([`disabled`,`shadow`,`live`]),policy:P,policyDigest:e.string().regex(/^[a-f0-9]{64}$/),projectionDigest:e.string().regex(/^[a-f0-9]{64}$/),projectId:a,projectedAt:e.iso.datetime(),sourceRevision:i(160),healthReportHmacSecretBinding:D.optional()}).strict().refine(e=>e.enabled===(e.mode!==`disabled`),{message:`enabled must match registration mode`,path:[`enabled`]}).superRefine((e,t)=>{e.mode===`live`&&!e.policy.rules.some(e=>e.enabled&&e.signal.type===`provider_health`)&&t.addIssue({code:`custom`,message:`Live registration requires an enabled provider_health rule`,path:[`policy`,`rules`]})}),I=e.object({commandId:c,contractVersion:e.literal(1),expectedPreviousDigest:e.string().regex(/^[a-f0-9]{64}$/).nullable(),kind:e.literal(`registration_upsert`),registration:F}).strict(),L=e.string().trim().min(1).max(160),R=e.object({key:a,value:e.number().finite().nonnegative(),unit:e.enum([`bytes`,`count`,`milliseconds`,`percent`,`ratio`]).optional()}).strict(),z=e.object({episodeId:s,attempt:e.number().int().min(1).max(1e3),terminal:e.boolean(),operation:o,stage:a,code:a,summary:i(300),correlationId:L.optional(),upstreamStatus:e.number().int().min(100).max(599).optional(),upstreamCode:a.optional()}).strict(),B=e.object({componentKey:a,componentClass:a,state:e.enum([`healthy`,`degraded`,`failed`,`unavailable`,`unknown`]),lastSuccessAt:e.iso.datetime().nullable(),facts:e.array(R).max(16),failure:z.nullable()}).strict().superRefine((e,t)=>{e.state===`healthy`&&e.failure!==null&&t.addIssue({code:`custom`,message:`healthy components cannot carry a current failure`,path:[`failure`]}),(e.state===`failed`||e.state===`unavailable`)&&e.failure===null&&t.addIssue({code:`custom`,message:`failed and unavailable components require a current failure`,path:[`failure`]})}),V=e.object({contractVersion:e.literal(1),projectId:a,environment:a,runtimeInstanceId:a,reportId:s,sequence:e.number().int().min(1).max(2**53-1),observedAt:e.iso.datetime(),components:e.array(B).min(1).max(64)}).strict().superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.components.entries())n.has(i.componentKey)&&t.addIssue({code:`custom`,message:`duplicate component key ${i.componentKey}`,path:[`components`,r,`componentKey`]}),n.add(i.componentKey)}),H=e.object({timestamp:e.iso.datetime(),nonce:s,signature:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),U=e.object({contractVersion:e.literal(1),report:V,authentication:H}).strict();function W(e){let t=U.omit({authentication:!0}).extend({authentication:H.omit({signature:!0})}).parse(e);return JSON.stringify(t)}const G=e.enum([`authentication_failed`,`identity_not_registered`,`nonce_replayed`,`report_invalid`,`runtime_identity_mismatch`,`sequence_invalid`,`size_exceeded`,`timestamp_out_of_range`,`unexpected_failure`]),K=e.discriminatedUnion(`outcome`,[e.object({outcome:e.literal(`accepted`),acceptedSequence:e.number().int().min(1).max(2**53-1),receivedAt:e.iso.datetime()}).strict(),e.object({outcome:e.literal(`duplicate`),acceptedSequence:e.number().int().min(1).max(2**53-1),receivedAt:e.iso.datetime()}).strict(),e.object({outcome:e.literal(`out_of_order`),acceptedSequence:e.number().int().min(1).max(2**53-1),receivedAt:e.iso.datetime()}).strict(),e.object({outcome:e.literal(`rejected`),rejectionCode:G,summary:i(300)}).strict()]);export{h as sentinelActionSchema,P as sentinelAlertPolicySchema,t as sentinelContractVersion,C as sentinelDeliveryReceiptSchema,w as sentinelDiagnosticSchema,k as sentinelEnvironmentBindingSchema,s as sentinelEventIdSchema,u as sentinelEvidenceSchema,B as sentinelHealthComponentSchema,z as sentinelHealthFailureSchema,R as sentinelHealthMetricFactSchema,H as sentinelHealthReportAuthenticationSchema,K as sentinelHealthReportIngestResultSchema,n as sentinelHealthReportMaximumBytes,r as sentinelHealthReportMaximumComponents,G as sentinelHealthReportRejectionCodeSchema,V as sentinelHealthReportSchema,W as sentinelHealthReportSignatureInput,U as sentinelHealthReportSubmissionSchema,_ as sentinelIncidentEventSchema,M as sentinelPolicyActionSchema,A as sentinelProjectManifestSchema,b as sentinelQueueEventIdentityInput,y as sentinelQueueEventSchema,E as sentinelQueueMetricsSchema,x as sentinelReceiverFailureCodeSchema,S as sentinelReceiverStateSchema,I as sentinelRegistrationCommandSchema,F as sentinelRegistrationSchema,N as sentinelRuleSchema,d as sentinelRunbookSchema,T as sentinelRuntimeStatusSchema,v as sentinelTestEventSchema};
|
|
1
|
+
import{z as e}from"zod";const t=1,n=32*1024,r=64,i=64,a=t=>e.string().trim().min(1).max(t),o=e.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),s=e.string().regex(/^[a-z][A-Za-z0-9_]{0,63}$/),c=e.uuid(),l=c,ee=e.url().refine(e=>e.startsWith(`https://`),`must use HTTPS`),u=e.object({label:e.enum([`Observed value`,`Warning threshold`,`Critical threshold`]),value:e.number().finite().nonnegative()}).strict(),d=e.object({label:a(80),url:ee}).strict(),f=e.object({type:e.literal(`none`)}).strict(),p=e.object({type:e.literal(`live_command`),command:a(500).regex(/^abuse apply\b/).refine(e=>e.endsWith(` --apply`),`must end with --apply`)}).strict(),m=e.object({type:e.literal(`test_preview`),summary:a(300).refine(e=>!e.includes(`--apply`),`must not contain --apply`)}).strict(),h=e.discriminatedUnion(`type`,[f,p,m]),g=e.object({contractVersion:e.literal(1),projectId:o,environment:o,incidentId:l,eventId:l,kind:e.enum([`firing`,`reminder`,`resolved`]),severity:e.enum([`warning`,`critical`]),signalClass:e.enum([`attack`,`service`]),signal:o,title:a(120),occurredAt:e.iso.datetime(),evidence:e.array(u).max(8),runbook:d,statusCommand:a(300).regex(/^sentinel status\b/),receiverKeys:e.array(o).min(1).max(16),action:h}).strict(),_=g.extend({mode:e.literal(`live`)}).superRefine((e,t)=>{e.signalClass===`service`&&e.action.type!==`none`&&t.addIssue({code:`custom`,message:`service events cannot contain an operational action`,path:[`action`]}),e.action.type===`test_preview`&&t.addIssue({code:`custom`,message:`live events cannot contain a test preview`,path:[`action`]})}),v=g.extend({mode:e.literal(`test`),action:e.discriminatedUnion(`type`,[f,m])}).strict(),y=e.union([_,v]);function b(e){let t=y.parse(e);return JSON.stringify(t)}const x=e.enum([`delivery_interrupted`,`provider_rejected`,`provider_timeout`,`provider_unavailable`,`receiver_missing`,`synthetic_retry`]),S=e.object({receiverKey:o,state:e.enum([`pending`,`delivering`,`delivered`,`failed`]),attempts:e.number().int().min(0).max(4),failureCode:x.nullable(),leaseExpiresAt:e.iso.datetime().nullable(),lastAttemptAt:e.iso.datetime().nullable()}).strict().superRefine((e,t)=>{e.state===`failed`&&e.failureCode===null&&t.addIssue({code:`custom`,message:`failed receivers require failureCode`,path:[`failureCode`]}),e.state!==`failed`&&e.failureCode!==null&&t.addIssue({code:`custom`,message:`only failed receivers can carry failureCode`,path:[`failureCode`]})}),C=e.object({contractVersion:e.literal(1),projectId:o,environment:o,eventId:l,state:e.enum([`pending`,`retrying`,`partial`,`delivered`,`failed`,`unavailable`]),reason:e.enum([`in_progress`,`partial_delivery`,`complete`,`retry_exhausted`,`receipt_unavailable`]),receivers:e.array(S).max(16),updatedAt:e.iso.datetime()}).strict(),w=e.object({code:o,state:e.enum([`degraded`,`failed`,`unknown`,`warning`]),summary:a(300),suggestedCommand:a(500).optional()}).strict(),T=e.object({contractVersion:e.literal(1),projectId:o,environment:o,registration:e.object({enabled:e.boolean(),mode:e.enum([`disabled`,`shadow`,`live`]),policyDigest:e.string().regex(/^[a-f0-9]{64}$/),projectionDigest:e.string().regex(/^[a-f0-9]{64}$/),projectedAt:e.iso.datetime(),sourceRevision:a(160)}).strict(),rules:e.array(e.object({id:o,semanticDigest:e.string().regex(/^[a-f0-9]{64}$/),enabled:e.boolean(),state:e.enum([`closed`,`firing`,`idle`,`unknown`]),severity:e.enum([`warning`,`critical`]).nullable(),incidentId:l.nullable(),lastEvaluatedAt:e.iso.datetime().nullable(),lastEventId:l.nullable()}).strict()).max(64),deliveries:e.array(C).max(64),heartbeat:e.object({state:e.enum([`healthy`,`stale`,`unavailable`]),lastCompletedAt:e.iso.datetime().nullable()}).strict(),diagnostics:e.array(w).max(32)}).strict(),te=e.object({state:e.enum([`available`,`unavailable`]),backlogCount:e.number().int().nonnegative().nullable(),backlogBytes:e.number().int().nonnegative().nullable(),oldestMessageAt:e.iso.datetime().nullable(),retentionSeconds:e.number().int().positive().nullable()}).strict(),E=e.string().regex(/^[A-Z][A-Z0-9_]{2,127}$/),ne=e.string().max(240).regex(/^(?![A-Za-z]:|\/|.*(?:^|\/)\.\.(?:\/|$)).+\.json$/),D=e.object({mode:e.enum([`disabled`,`shadow`,`live`]),statusUrlEnv:E,statusHmacSecretEnv:E,healthReportHmacSecretEnv:E.optional(),opsAccountIdEnv:E,provisionApiTokenEnv:E,statusApiTokenEnv:E,analyticsAccountIdEnv:E,analyticsApiTokenEnv:E,analyticsDataset:o,workerName:o,queueName:o,dlqName:o,registrationQueueName:o,registrationDlqName:o,notificationWorkerName:o,healthchecksProvisionApiKeyEnv:E.optional(),healthchecksPingUrlEnv:E.optional(),healthchecksStatusApiKeyEnv:E.optional()}).strict().superRefine((e,t)=>{let n=[e.healthchecksProvisionApiKeyEnv,e.healthchecksPingUrlEnv,e.healthchecksStatusApiKeyEnv].filter(Boolean);n.length>0&&n.length!==3&&t.addIssue({code:`custom`,message:`Healthchecks provision, status and ping URL references must be configured together`,path:[`healthchecksProvisionApiKeyEnv`]})}),O=e.object({contractVersion:e.literal(1),projectId:o,policy:ne,environments:e.record(o,D)}).strict().superRefine((e,t)=>{Object.keys(e.environments).length===0&&t.addIssue({code:`custom`,message:`at least one environment is required`,path:[`environments`]})}),k=e.object({type:e.literal(`abuse`),project:e.string().regex(/^[a-zA-Z0-9._/-]{1,120}$/),target:o,action:o,layer:o,ttl:e.string().regex(/^[1-9][0-9]{0,4}[smhd]$/).optional()}).strict(),A=e.discriminatedUnion(`type`,[f,k]),j=e.object({id:o,enabled:e.boolean(),signalClass:e.enum([`attack`,`service`]),signal:e.object({type:e.enum([`operation_count`,`worker_error_ratio`,`edge_security_spike`,`provider_health`]),operation:s.optional(),operations:e.array(s).min(1).max(16).optional(),outcomes:e.array(e.enum([`committed`,`accepted_noop`,`rejected`,`failed`])).max(4).optional(),minimumSample:e.number().int().positive().optional()}).strict(),windowMinutes:e.number().int().min(5).max(1440),thresholds:e.object({warning:e.number().nonnegative(),critical:e.number().positive()}).strict().refine(e=>e.critical>e.warning,`critical must exceed warning`),recovery:e.object({healthyEvaluations:e.number().int().min(1).max(24)}).strict(),reminders:e.object({warningMinutes:e.number().int().min(5).max(10080),criticalMinutes:e.number().int().min(5).max(10080)}).strict(),runbook:d,receiverKeys:e.array(o).min(1).max(16),actions:e.object({warning:A,critical:A}).strict()}).strict().superRefine((e,t)=>{e.signal.operation&&e.signal.operations&&t.addIssue({code:`custom`,message:`signal cannot define both operation and operations`,path:[`signal`]}),e.signal.type===`operation_count`&&!e.signal.operation&&!e.signal.operations&&t.addIssue({code:`custom`,message:`operation_count requires operation or operations`,path:[`signal`]}),e.signal.type===`provider_health`&&e.thresholds.warning>1&&t.addIssue({code:`custom`,message:`provider_health warning threshold must be at most 1`,path:[`thresholds`,`warning`]}),e.signalClass===`service`&&(e.actions.warning.type!==`none`||e.actions.critical.type!==`none`)&&t.addIssue({code:`custom`,message:`service rules cannot configure abuse actions`,path:[`actions`]})}),M=e.object({contractVersion:e.literal(1),evaluationMinutes:e.number().int().min(5).max(60),rules:e.array(j).min(1).max(64)}).strict().superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.rules.entries())n.has(i.id)&&t.addIssue({code:`custom`,message:`duplicate rule id ${i.id}`,path:[`rules`,r,`id`]}),n.add(i.id)}),N=e.object({analytics:e.object({accountIdBinding:E,dataset:o,index:a(160),tokenBinding:E}).strict(),enabled:e.boolean(),environment:o,mode:e.enum([`disabled`,`shadow`,`live`]),policy:M,policyDigest:e.string().regex(/^[a-f0-9]{64}$/),projectionDigest:e.string().regex(/^[a-f0-9]{64}$/),projectId:o,projectedAt:e.iso.datetime(),sourceRevision:a(160),healthReportHmacSecretBinding:E.optional()}).strict().refine(e=>e.enabled===(e.mode!==`disabled`),{message:`enabled must match registration mode`,path:[`enabled`]}).superRefine((e,t)=>{e.mode===`live`&&!e.policy.rules.some(e=>e.enabled&&e.signal.type===`provider_health`)&&t.addIssue({code:`custom`,message:`Live registration requires an enabled provider_health rule`,path:[`policy`,`rules`]})}),P=e.object({commandId:l,contractVersion:e.literal(1),expectedPreviousDigest:e.string().regex(/^[a-f0-9]{64}$/).nullable(),kind:e.literal(`registration_upsert`),registration:N}).strict(),F=e.string().trim().min(1).max(160),I=e.object({key:o,value:e.number().finite().nonnegative(),unit:e.enum([`bytes`,`count`,`milliseconds`,`percent`,`ratio`]).optional()}).strict(),L=e.object({episodeId:c,attempt:e.number().int().min(1).max(1e3),terminal:e.boolean(),operation:s,stage:o,code:o,summary:a(300),correlationId:F.optional(),upstreamStatus:e.number().int().min(100).max(599).optional(),upstreamCode:o.optional()}).strict(),R=e.object({componentKey:o,componentClass:o,state:e.enum([`healthy`,`degraded`,`failed`,`unavailable`,`unknown`]),lastSuccessAt:e.iso.datetime().nullable(),facts:e.array(I).max(16),failure:L.nullable()}).strict().superRefine((e,t)=>{e.state===`healthy`&&e.failure!==null&&t.addIssue({code:`custom`,message:`healthy components cannot carry a current failure`,path:[`failure`]}),(e.state===`failed`||e.state===`unavailable`)&&e.failure===null&&t.addIssue({code:`custom`,message:`failed and unavailable components require a current failure`,path:[`failure`]})}),z=e.object({contractVersion:e.literal(1),projectId:o,environment:o,runtimeInstanceId:o,reportId:c,sequence:e.number().int().min(1).max(2**53-1),observedAt:e.iso.datetime(),components:e.array(R).min(1).max(64)}).strict().superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.components.entries())n.has(i.componentKey)&&t.addIssue({code:`custom`,message:`duplicate component key ${i.componentKey}`,path:[`components`,r,`componentKey`]}),n.add(i.componentKey)}),B=e.object({capabilityKey:o,state:e.enum([`enabled`,`disabled`])}).strict(),V=e.object({contractVersion:e.literal(2),projectId:o,environment:o,runtimeInstanceId:o,reportId:c,sequence:e.number().int().min(1).max(2**53-1),observedAt:e.iso.datetime(),components:e.array(R).min(1).max(64),capabilities:e.array(B).max(64)}).strict().superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.components.entries())n.has(i.componentKey)&&t.addIssue({code:`custom`,message:`duplicate component key ${i.componentKey}`,path:[`components`,r,`componentKey`]}),n.add(i.componentKey);let r=new Set;for(let[n,i]of e.capabilities.entries())r.has(i.capabilityKey)&&t.addIssue({code:`custom`,message:`duplicate capability key ${i.capabilityKey}`,path:[`capabilities`,n,`capabilityKey`]}),r.add(i.capabilityKey)}),H=e.union([z,V]),U=e.object({capabilityKey:o,expected:e.enum([`enabled`,`disabled`]),kind:e.enum([`mismatch`,`missing`]),observed:e.enum([`enabled`,`disabled`]).nullable()}).strict(),W=e.object({componentKey:o,failure:L,incidentId:l}).strict(),G=e.object({runtimeInstanceId:o,state:e.enum([`degraded`,`healthy`,`stale`,`unavailable`]),latestReport:e.object({receivedAt:e.iso.datetime(),report:H}).strict().nullable(),componentIncidents:e.array(W).max(64),runtimeExpectationIncident:e.object({differences:e.array(U).max(64),expectationRevision:o,incidentId:l,observationState:e.enum([`available`,`unavailable`])}).strict().nullable(),staleIncident:e.object({incidentId:l,openedAt:e.iso.datetime()}).strict().nullable()}).strict().superRefine((e,t)=>{let n=e.latestReport===null?`unavailable`:e.staleIncident===null?e.componentIncidents.length>0||e.runtimeExpectationIncident!==null?`degraded`:`healthy`:`stale`;e.state!==n&&t.addIssue({code:`custom`,message:`runtime state must be ${n}`,path:[`state`]}),e.latestReport===null&&(e.componentIncidents.length>0||e.runtimeExpectationIncident!==null||e.staleIncident!==null)&&t.addIssue({code:`custom`,message:`an unavailable runtime without a report cannot carry incidents`,path:[`latestReport`]})}),K=e.object({contractVersion:e.literal(1),statusType:e.literal(`health`),projectId:o,environment:o,runtimes:e.array(G).max(64)}).strict().superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.runtimes.entries()){n.has(i.runtimeInstanceId)&&t.addIssue({code:`custom`,message:`duplicate runtime identity ${i.runtimeInstanceId}`,path:[`runtimes`,r,`runtimeInstanceId`]}),n.add(i.runtimeInstanceId);let a=i.latestReport?.report;a&&(a.projectId!==e.projectId||a.environment!==e.environment||a.runtimeInstanceId!==i.runtimeInstanceId)&&t.addIssue({code:`custom`,message:`latest report identity must match the status runtime identity`,path:[`runtimes`,r,`latestReport`,`report`]})}}),q=e.union([T,K]),J=e.object({timestamp:e.iso.datetime(),nonce:c,signature:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),Y=e.object({contractVersion:e.literal(1),report:z,authentication:J}).strict(),X=e.object({contractVersion:e.literal(2),report:V,authentication:J}).strict(),re=e.union([Y,X]);function Z(e){let t=Y.omit({authentication:!0}).extend({authentication:J.omit({signature:!0})}).parse(e);return JSON.stringify(t)}function Q(e){let t=X.omit({authentication:!0}).extend({authentication:J.omit({signature:!0})}).parse(e);return JSON.stringify(t)}function ie(e){return e.contractVersion===1?Z(e):Q(e)}const $=e.enum([`authentication_failed`,`identity_not_registered`,`nonce_replayed`,`report_invalid`,`runtime_identity_mismatch`,`sequence_invalid`,`size_exceeded`,`timestamp_out_of_range`,`unexpected_failure`]),ae=e.discriminatedUnion(`outcome`,[e.object({outcome:e.literal(`accepted`),acceptedSequence:e.number().int().min(1).max(2**53-1),receivedAt:e.iso.datetime()}).strict(),e.object({outcome:e.literal(`duplicate`),acceptedSequence:e.number().int().min(1).max(2**53-1),receivedAt:e.iso.datetime()}).strict(),e.object({outcome:e.literal(`out_of_order`),acceptedSequence:e.number().int().min(1).max(2**53-1),receivedAt:e.iso.datetime()}).strict(),e.object({outcome:e.literal(`rejected`),rejectionCode:$,summary:a(300)}).strict()]);export{h as sentinelActionSchema,M as sentinelAlertPolicySchema,t as sentinelContractVersion,C as sentinelDeliveryReceiptSchema,w as sentinelDiagnosticSchema,D as sentinelEnvironmentBindingSchema,c as sentinelEventIdSchema,u as sentinelEvidenceSchema,R as sentinelHealthComponentSchema,L as sentinelHealthFailureSchema,I as sentinelHealthMetricFactSchema,H as sentinelHealthReportAnySchema,ie as sentinelHealthReportAnySignatureInput,J as sentinelHealthReportAuthenticationSchema,ae as sentinelHealthReportIngestResultSchema,n as sentinelHealthReportMaximumBytes,i as sentinelHealthReportMaximumCapabilities,r as sentinelHealthReportMaximumComponents,$ as sentinelHealthReportRejectionCodeSchema,z as sentinelHealthReportSchema,Z as sentinelHealthReportSignatureInput,re as sentinelHealthReportSubmissionAnySchema,Y as sentinelHealthReportSubmissionSchema,X as sentinelHealthReportSubmissionV2Schema,V as sentinelHealthReportV2Schema,Q as sentinelHealthReportV2SignatureInput,K as sentinelHealthRuntimeStatusSchema,_ as sentinelIncidentEventSchema,A as sentinelPolicyActionSchema,O as sentinelProjectManifestSchema,b as sentinelQueueEventIdentityInput,y as sentinelQueueEventSchema,te as sentinelQueueMetricsSchema,x as sentinelReceiverFailureCodeSchema,S as sentinelReceiverStateSchema,P as sentinelRegistrationCommandSchema,N as sentinelRegistrationSchema,j as sentinelRuleSchema,d as sentinelRunbookSchema,B as sentinelRuntimeCapabilityObservationSchema,T as sentinelRuntimeStatusSchema,q as sentinelStatusResponseSchema,v as sentinelTestEventSchema};
|