@@ -21,6 +21,7 @@ import {
2121 validateSessionsCompanionStateParams ,
2222 validateSessionsCreateParams ,
2323 validateSessionsObserverVisibilityParams ,
24+ validateSessionsArchiveManyParams ,
2425 validateSessionsPatchParams ,
2526 validateSessionsSearchParams ,
2627 validateSessionsSendParams ,
@@ -198,6 +199,40 @@ describe("lazy protocol validators", () => {
198199 ] ) ;
199200 } ) ;
200201
202+ it ( "validates bounded closed bulk session archive requests" , ( ) => {
203+ const target = {
204+ key : "agent:main:archive-me" ,
205+ agentId : "main" ,
206+ expectedSessionId : "session-archive-me" ,
207+ expectedLifecycleRevision : "revision-archive-me" ,
208+ } ;
209+ expectAccepted ( validateSessionsArchiveManyParams , [
210+ { targets : [ target ] , archived : true } ,
211+ {
212+ targets : Array . from ( { length : 100 } , ( _ , index ) => ( {
213+ key : `agent:main:archive-${ index } ` ,
214+ } ) ) ,
215+ archived : false ,
216+ } ,
217+ ] ) ;
218+ expectRejected ( validateSessionsArchiveManyParams , [
219+ { targets : [ ] , archived : true } ,
220+ {
221+ targets : Array . from ( { length : 101 } , ( _ , index ) => ( {
222+ key : `agent:main:archive-${ index } ` ,
223+ } ) ) ,
224+ archived : true ,
225+ } ,
226+ { targets : [ { key : "" } ] , archived : true } ,
227+ { targets : [ { key : target . key , agentId : "" } ] , archived : true } ,
228+ { targets : [ { key : target . key , expectedSessionId : "" } ] , archived : true } ,
229+ { targets : [ { key : target . key , expectedLifecycleRevision : "" } ] , archived : true } ,
230+ { targets : [ { key : target . key , extra : true } ] , archived : true } ,
231+ { targets : [ target ] , archived : "yes" } ,
232+ { targets : [ target ] , archived : true , extra : true } ,
233+ ] ) ;
234+ } ) ;
235+
201236 it ( "validates sparse session tool overrides" , ( ) => {
202237 expectAccepted ( validateSessionsPatchParams , [
203238 sessionPatch ( {
0 commit comments