diff --git a/src/SASjs.ts b/src/SASjs.ts index 1d560a1..1320f5b 100644 --- a/src/SASjs.ts +++ b/src/SASjs.ts @@ -8,7 +8,8 @@ import { VerboseMode, ErrorResponse, LoginOptions, - LoginResult + LoginResult, + ExecutionQuery } from './types' import { SASViyaApiClient } from './SASViyaApiClient' import { SAS9ApiClient } from './SAS9ApiClient' @@ -160,6 +161,23 @@ export default class SASjs { } } + /** + * Executes job on SASJS server. + * @param query - an object containing job path and debug level. + * @param appLoc - an application path. + * @param authConfig - an object for authentication. + * @returns a promise that resolves into job execution result and log. + */ + public async executeJob( + query: ExecutionQuery, + appLoc: string, + authConfig?: AuthConfig + ) { + this.isMethodSupported('executeScript', [ServerType.Sasjs]) + + return await this.sasJSApiClient?.executeJob(query, appLoc, authConfig) + } + /** * Gets compute contexts. * @param accessToken - an access token for an authorised user.