1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-15 16:10:06 +00:00

chore(poll-job-status): renamed PollOptions to PollStrategy and added docs

This commit is contained in:
Yury Shkoda
2023-05-15 16:32:07 +03:00
parent f9f4aa5aa6
commit 153b285670
8 changed files with 112 additions and 86 deletions

View File

@@ -9,7 +9,7 @@ import {
File,
EditContextInput,
JobDefinition,
PollOptions
PollStrategy
} from './types'
import {
CertificateError,
@@ -276,7 +276,7 @@ export class SASViyaApiClient {
* @param debug - when set to true, the log will be returned.
* @param expectWebout - when set to true, the automatic _webout fileref will be checked for content, and that content returned. This fileref is used when the Job contains a SASjs web request (as opposed to executing arbitrary SAS code).
* @param waitForResult - when set to true, function will return the session
* @param pollOptions - an object that represents poll interval(milliseconds) and maximum amount of attempts. Object example: { MAX_POLL_COUNT: 24 * 60 * 60, POLL_INTERVAL: 1000 }.
* @param pollStrategy - an object that represents poll interval(milliseconds) and maximum amount of attempts. Object example: { maxPollCount: 24 * 60 * 60, pollInterval: 1000 }.
* @param printPid - a boolean that indicates whether the function should print (PID) of the started job.
* @param variables - an object that represents macro variables.
*/
@@ -289,7 +289,7 @@ export class SASViyaApiClient {
debug: boolean = false,
expectWebout = false,
waitForResult = true,
pollOptions?: PollOptions,
pollStrategy?: PollStrategy,
printPid = false,
variables?: MacroVar
): Promise<any> {
@@ -305,7 +305,7 @@ export class SASViyaApiClient {
debug,
expectWebout,
waitForResult,
pollOptions,
pollStrategy,
printPid,
variables
)
@@ -627,7 +627,7 @@ export class SASViyaApiClient {
* @param accessToken - an optional access token for an authorized user.
* @param waitForResult - a boolean indicating if the function should wait for a result.
* @param expectWebout - a boolean indicating whether to expect a _webout response.
* @param pollOptions - an object that represents poll interval(milliseconds) and maximum amount of attempts. Object example: { MAX_POLL_COUNT: 24 * 60 * 60, POLL_INTERVAL: 1000 }.
* @param pollStrategy - an object that represents poll interval(milliseconds) and maximum amount of attempts. Object example: { maxPollCount: 24 * 60 * 60, pollInterval: 1000 }.
* @param printPid - a boolean that indicates whether the function should print (PID) of the started job.
* @param variables - an object that represents macro variables.
*/
@@ -639,7 +639,7 @@ export class SASViyaApiClient {
authConfig?: AuthConfig,
waitForResult = true,
expectWebout = false,
pollOptions?: PollOptions,
pollStrategy?: PollStrategy,
printPid = false,
variables?: MacroVar
) {
@@ -718,7 +718,7 @@ export class SASViyaApiClient {
debug,
expectWebout,
waitForResult,
pollOptions,
pollStrategy,
printPid,
variables
)
@@ -910,14 +910,14 @@ export class SASViyaApiClient {
private async pollJobState(
postedJob: Job,
authConfig?: AuthConfig,
pollOptions?: PollOptions
pollStrategy?: PollStrategy
) {
return pollJobState(
this.requestClient,
postedJob,
this.debug,
authConfig,
pollOptions
pollStrategy
)
}