From ad5627a0eddda83e0b706ff6c6df2d8d4bde2c53 Mon Sep 17 00:00:00 2001 From: Utkarsh Maheshwari Date: Thu, 14 Mar 2024 11:35:35 +0530 Subject: [PATCH] Fix types for `pm.execution.setNextRequest` --- lib/sandbox/pmapi.js | 1 + types/index.d.ts | 19 ++++++++----------- types/sandbox/prerequest.d.ts | 19 ++++++++----------- types/sandbox/test.d.ts | 17 +++++++---------- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/lib/sandbox/pmapi.js b/lib/sandbox/pmapi.js index 16249e7f..ef742c93 100644 --- a/lib/sandbox/pmapi.js +++ b/lib/sandbox/pmapi.js @@ -298,6 +298,7 @@ function Postman (execution, onRequest, onSkipRequest, onAssertion, cookieStore, * running the collection. Passing `null` stops the collection run * after the current request is executed. * + * @instance * @param {string|null} request - name of the request to run next */ setNextRequest: function setNextRequest (request) { diff --git a/types/index.d.ts b/types/index.d.ts index 5018699f..2d416bc8 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for postman-sandbox 4.5.0 +// Type definitions for postman-sandbox 4.5.1 // Project: https://github.com/postmanlabs/postman-sandbox // Definitions by: PostmanLabs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -254,16 +254,6 @@ declare interface Visualizer { clear(): void; } -declare namespace Execution { - /** - * Sets the next request to be run after the current request, when - * running the collection. Passing `null` stops the collection run - * after the current request is executed. - * @param request - name of the request to run next - */ - function setNextRequest(request: string | null): void; -} - declare interface Execution { request: any; response: any; @@ -275,6 +265,13 @@ declare interface Execution { * The path of the current request. */ location: ExecutionLocation; + /** + * Sets the next request to be run after the current request, when + * running the collection. Passing `null` stops the collection run + * after the current request is executed. + * @param request - name of the request to run next + */ + setNextRequest(request: string | null): void; } declare interface ExecutionLocation extends Array { diff --git a/types/sandbox/prerequest.d.ts b/types/sandbox/prerequest.d.ts index be96c103..7f8d526a 100644 --- a/types/sandbox/prerequest.d.ts +++ b/types/sandbox/prerequest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for postman-sandbox 4.5.0 +// Type definitions for postman-sandbox 4.5.1 // Project: https://github.com/postmanlabs/postman-sandbox // Definitions by: PostmanLabs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -113,16 +113,6 @@ declare interface Visualizer { clear(): void; } -declare namespace Execution { - /** - * Sets the next request to be run after the current request, when - * running the collection. Passing `null` stops the collection run - * after the current request is executed. - * @param request - name of the request to run next - */ - function setNextRequest(request: string | null): void; -} - declare interface Execution { /** * Stops the current request and its scripts from executing. @@ -133,6 +123,13 @@ declare interface Execution { * The path of the current request. */ location: ExecutionLocation; + /** + * Sets the next request to be run after the current request, when + * running the collection. Passing `null` stops the collection run + * after the current request is executed. + * @param request - name of the request to run next + */ + setNextRequest(request: string | null): void; } declare interface ExecutionLocation extends Array { diff --git a/types/sandbox/test.d.ts b/types/sandbox/test.d.ts index 9660d936..af43315a 100644 --- a/types/sandbox/test.d.ts +++ b/types/sandbox/test.d.ts @@ -1,4 +1,4 @@ -// Type definitions for postman-sandbox 4.5.0 +// Type definitions for postman-sandbox 4.5.1 // Project: https://github.com/postmanlabs/postman-sandbox // Definitions by: PostmanLabs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -119,21 +119,18 @@ declare interface Visualizer { clear(): void; } -declare namespace Execution { +declare interface Execution { + /** + * The path of the current request. + */ + location: ExecutionLocation; /** * Sets the next request to be run after the current request, when * running the collection. Passing `null` stops the collection run * after the current request is executed. * @param request - name of the request to run next */ - function setNextRequest(request: string | null): void; -} - -declare interface Execution { - /** - * The path of the current request. - */ - location: ExecutionLocation; + setNextRequest(request: string | null): void; } declare interface ExecutionLocation extends Array {