@@ -164,6 +164,69 @@ declare namespace EW {
164164 readonly cacheKey : CacheKey ;
165165 }
166166
167+ interface BotScore {
168+ /**
169+ * An object for interacting with features related to Bot Management
170+ */
171+ readonly responseSegment : BotScoreResponseSegment ;
172+ }
173+
174+ interface BotScoreResponseSegment {
175+ /**
176+ * Indicates that this request hasn't triggered any detections, resulting in a bot score of zero.
177+ */
178+ isHuman ( ) : boolean ;
179+
180+ /**
181+ * Indicates that this request has a low bot score.
182+ *
183+ * See: https://techdocs.akamai.com/bot-manager/docs/see-bot-activity-api-operation
184+ */
185+ isCautiousResponse ( ) : boolean ;
186+
187+ /**
188+ * Indicates that this request has a middling bot score. You should apply a challenge to the traffic in this
189+ * segment to prohibit bots but let humans through.
190+ *
191+ * See: https://techdocs.akamai.com/bot-manager/docs/see-bot-activity-api-operation
192+ */
193+ isStrictResponse ( ) : boolean ;
194+
195+ /**
196+ * Indicates that this request is from a special class of traffic that Bot Manager sets aside.
197+ * There are cases where a human could get endlessly trapped by certain detections, such as a network-based
198+ * or device-based detection like user-agent. This detection would trip every request, but the person
199+ * could never change the trigger. Where there's this danger that a human could never overcome a detection
200+ * and get stuck, Bot Manager sets aside requests in a special response segment called Safeguard,
201+ * so you can handle them differently. For best results, when you set bot score, leave Safeguard Traffic
202+ * at the preset Strict Response if it uses a challenge action to let clients prove they are
203+ * human and get through.
204+ *
205+ * See: https://techdocs.akamai.com/bot-manager/docs/see-bot-activity-api-operation
206+ */
207+ isSafeguardResponse ( ) : boolean ;
208+
209+ /**
210+ * Indicates that this request has a high bot score, which is more likely to be from a bot.
211+ *
212+ * See: https://techdocs.akamai.com/bot-manager/docs/see-bot-activity-api-operation
213+ */
214+ isAggressiveResponse ( ) : boolean ;
215+
216+ /**
217+ * Indicates that this request has an unknown bot score. This field is left as a placeholder for
218+ * forwards compatibility.
219+ */
220+ isUnexpected ( ) : boolean ;
221+ }
222+
223+ interface HasBotScore {
224+ /**
225+ * Object containing properties related to Bot Management.
226+ */
227+ readonly botScore : BotScore ;
228+ }
229+
167230 interface ReadsBody {
168231 /**
169232 * A promise that reads the body to completion and resolves to a string containing the full
@@ -460,6 +523,12 @@ declare namespace EW {
460523 {
461524 }
462525
526+ // onBotSegmentAvailable
527+ interface BotSegmentAvailableRequest
528+ extends ReadsHeaders , ReadAllHeader , ReadsVariables , MutatesVariables , Request , HasRespondWith , HasBotScore
529+ {
530+ }
531+
463532 // onOriginRequest
464533 interface IngressOriginRequest
465534 extends MutatesHeaders , ReadsHeaders , ReadAllHeader , ReadsVariables , Request , HasRespondWith , MutatesVariables
@@ -718,6 +787,7 @@ declare namespace EW {
718787 }
719788
720789 export {
790+ BotSegmentAvailableRequest ,
721791 EgressClientRequest ,
722792 EgressClientResponse ,
723793 EgressOriginRequest ,
0 commit comments