@sasjs/adapter 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/SASjs.d.ts +31 -5
- package/index-dev.js +2 -2
- package/index.js +1 -1
- package/minified/sas9/SASjs.d.ts +1 -1
- package/minified_sas9.js +1 -1
- package/node/SASjs.d.ts +31 -5
- package/node/index.js +1 -1
- package/node/request/RequestClient.d.ts +9 -31
- package/node/request/SasjsRequestClient.d.ts +1 -7
- package/node/types/RequestClient.d.ts +46 -0
- package/node/types/SASjsConfig.d.ts +5 -0
- package/node/types/index.d.ts +3 -1
- package/node/utils/compareTimestamps.d.ts +1 -1
- package/package.json +1 -1
- package/request/RequestClient.d.ts +9 -31
- package/request/SasjsRequestClient.d.ts +1 -7
- package/src/SASjs.ts +59 -8
- package/src/minified/sas9/SASjs.ts +2 -1
- package/src/minified/sas9/WebJobExecutor.ts +0 -1
- package/src/request/RequestClient.ts +23 -38
- package/src/request/SasjsRequestClient.ts +1 -9
- package/src/types/RequestClient.ts +55 -0
- package/src/types/SASjsConfig.ts +5 -0
- package/src/types/index.ts +3 -1
- package/src/utils/compareTimestamps.ts +1 -1
- package/types/RequestClient.d.ts +46 -0
- package/types/SASjsConfig.d.ts +5 -0
- package/types/index.d.ts +3 -1
- package/utils/compareTimestamps.d.ts +1 -1
- package/node/types/SASjsRequest.d.ts +0 -12
- package/src/types/SASjsRequest.ts +0 -12
- package/types/SASjsRequest.d.ts +0 -12
package/node/SASjs.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { SASjsConfig, UploadFile, EditContextInput, PollOptions } from './types';
|
|
2
|
+
import { SASjsConfig, UploadFile, EditContextInput, PollOptions, VerboseMode, LoginOptions, LoginResult, ExecutionQuery } from './types';
|
|
3
3
|
import { SASViyaApiClient } from './SASViyaApiClient';
|
|
4
4
|
import { SASjsAuthResponse } from './SASjsApiClient';
|
|
5
5
|
import { MacroVar, AuthConfig, ExtraResponseAttributes, SasAuthResponse, AuthConfigSas9 } from '@sasjs/utils/types';
|
|
6
|
-
import {
|
|
6
|
+
import { AxiosResponse } from 'axios';
|
|
7
7
|
interface ExecuteScriptParams {
|
|
8
8
|
linesOfCode: string[];
|
|
9
9
|
fileName?: string;
|
|
@@ -44,6 +44,17 @@ export default class SASjs {
|
|
|
44
44
|
* @param debug - (optional) if true, global debug config will be overriden
|
|
45
45
|
*/
|
|
46
46
|
executeScript({ linesOfCode, fileName, contextName, runTime, authConfig, authConfigSas9, debug }: ExecuteScriptParams): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Executes job on SASJS server.
|
|
49
|
+
* @param query - an object containing job path and debug level.
|
|
50
|
+
* @param appLoc - an application path.
|
|
51
|
+
* @param authConfig - an object for authentication.
|
|
52
|
+
* @returns a promise that resolves into job execution result and log.
|
|
53
|
+
*/
|
|
54
|
+
executeJob(query: ExecutionQuery, appLoc: string, authConfig?: AuthConfig): Promise<{
|
|
55
|
+
result: any;
|
|
56
|
+
log: any;
|
|
57
|
+
} | undefined>;
|
|
47
58
|
/**
|
|
48
59
|
* Gets compute contexts.
|
|
49
60
|
* @param accessToken - an access token for an authorised user.
|
|
@@ -216,7 +227,7 @@ export default class SASjs {
|
|
|
216
227
|
* Checks whether a session is active, or login is required.
|
|
217
228
|
* @returns - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.
|
|
218
229
|
*/
|
|
219
|
-
checkSession(): Promise<import("./types
|
|
230
|
+
checkSession(): Promise<import("./types").LoginResultInternal>;
|
|
220
231
|
/**
|
|
221
232
|
* Logs into the SAS server with the supplied credentials.
|
|
222
233
|
* @param username - a string representing the username.
|
|
@@ -308,9 +319,9 @@ export default class SASjs {
|
|
|
308
319
|
* @param pollOptions - an object that represents poll interval(milliseconds) and maximum amount of attempts. Object example: { maxPollCount: 24 * 60 * 60, pollInterval: 1000 }. More information available at src/api/viya/pollJobState.ts.
|
|
309
320
|
* @param printPid - a boolean that indicates whether the function should print (PID) of the started job.
|
|
310
321
|
* @param variables - an object that represents macro variables.
|
|
311
|
-
* @param verboseMode - boolean to enable verbose mode (log every HTTP response).
|
|
322
|
+
* @param verboseMode - boolean or a string equal to 'bleached' to enable verbose mode (log every HTTP response).
|
|
312
323
|
*/
|
|
313
|
-
startComputeJob(sasJob: string, data: any, config?: any, authConfig?: AuthConfig, waitForResult?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar, verboseMode?:
|
|
324
|
+
startComputeJob(sasJob: string, data: any, config?: any, authConfig?: AuthConfig, waitForResult?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar, verboseMode?: VerboseMode): Promise<any>;
|
|
314
325
|
private resendWaitingRequests;
|
|
315
326
|
/**
|
|
316
327
|
* Fetches content of the log file
|
|
@@ -327,5 +338,20 @@ export default class SASjs {
|
|
|
327
338
|
private setupConfiguration;
|
|
328
339
|
private createFoldersAndServices;
|
|
329
340
|
private isMethodSupported;
|
|
341
|
+
/**
|
|
342
|
+
* Enables verbose mode that will log a summary of every HTTP response.
|
|
343
|
+
* @param successCallBack - function that should be triggered on every HTTP response with the status 2**.
|
|
344
|
+
* @param errorCallBack - function that should be triggered on every HTTP response with the status different from 2**.
|
|
345
|
+
*/
|
|
346
|
+
enableVerboseMode(successCallBack?: (response: AxiosResponse) => AxiosResponse, errorCallBack?: (response: AxiosResponse) => AxiosResponse): void;
|
|
347
|
+
/**
|
|
348
|
+
* Turns off verbose mode to log every HTTP response.
|
|
349
|
+
*/
|
|
350
|
+
disableVerboseMode(): void;
|
|
351
|
+
/**
|
|
352
|
+
* Sets verbose mode.
|
|
353
|
+
* @param verboseMode - value of the verbose mode, can be true, false or bleached(without extra colors).
|
|
354
|
+
*/
|
|
355
|
+
setVerboseMode: (verboseMode: VerboseMode) => void;
|
|
330
356
|
}
|
|
331
357
|
export {};
|