Skip to content

Commit

Permalink
Fix types for pm.execution.setNextRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
coditva committed Mar 14, 2024
1 parent e543858 commit ad5627a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
1 change: 1 addition & 0 deletions lib/sandbox/pmapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
19 changes: 8 additions & 11 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
19 changes: 8 additions & 11 deletions types/sandbox/prerequest.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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 {
Expand Down
17 changes: 7 additions & 10 deletions types/sandbox/test.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ad5627a

Please sign in to comment.