@sasjs/adapter 3.10.18 → 3.10.19
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/SASjs.d.ts +19 -39
- package/SASjsApiClient.d.ts +7 -0
- package/index.d.ts +2 -0
- package/index.js +2 -2
- package/node/SASjs.d.ts +19 -39
- package/node/SASjsApiClient.d.ts +7 -0
- package/node/index.d.ts +2 -0
- package/node/index.js +2 -2
- package/package.json +1 -1
- package/src/SASjs.ts +70 -87
- package/src/SASjsApiClient.ts +7 -0
- package/src/index.ts +2 -0
package/node/SASjs.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { SASjsConfig, UploadFile, EditContextInput, PollOptions
|
|
2
|
+
import { SASjsConfig, UploadFile, EditContextInput, PollOptions } from './types';
|
|
3
3
|
import { SASViyaApiClient } from './SASViyaApiClient';
|
|
4
4
|
import { SASjsAuthResponse } from './SASjsApiClient';
|
|
5
|
-
import { MacroVar, AuthConfig, ExtraResponseAttributes, SasAuthResponse,
|
|
5
|
+
import { MacroVar, AuthConfig, ExtraResponseAttributes, SasAuthResponse, AuthConfigSas9 } from '@sasjs/utils/types';
|
|
6
6
|
import { LoginOptions, LoginResult } from './types/Login';
|
|
7
|
+
interface ExecuteScriptParams {
|
|
8
|
+
linesOfCode: string[];
|
|
9
|
+
fileName?: string;
|
|
10
|
+
contextName?: string;
|
|
11
|
+
runTime?: string;
|
|
12
|
+
authConfig?: AuthConfig;
|
|
13
|
+
authConfigSas9?: AuthConfigSas9;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
}
|
|
7
16
|
/**
|
|
8
17
|
* SASjs is a JavaScript adapter for SAS.
|
|
9
18
|
*
|
|
@@ -25,28 +34,16 @@ export default class SASjs {
|
|
|
25
34
|
constructor(config?: Partial<SASjsConfig>);
|
|
26
35
|
getCsrfToken(type?: 'general' | 'file'): import("./types").CsrfToken | undefined;
|
|
27
36
|
/**
|
|
28
|
-
* Executes
|
|
29
|
-
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
*/
|
|
34
|
-
executeScriptSAS9(linesOfCode: string[], userName: string, password: string): Promise<string | undefined>;
|
|
35
|
-
/**
|
|
36
|
-
* Executes SAS code on a SASJS server
|
|
37
|
-
* @param code - a string of code from the file to run.
|
|
37
|
+
* Executes code on a SAS server.
|
|
38
|
+
* @param linesOfCode - lines of code to run.
|
|
39
|
+
* @param fileName - (required for server type sas viya) name of the file to run. It will be converted to path to the file being submitted for execution.
|
|
40
|
+
* @param contextName - (required for server type sas viya) context name on which code will be run on the server.
|
|
41
|
+
* @param runTime - (required for server type sasjs) a string to represent runTime for code execution.
|
|
38
42
|
* @param authConfig - (optional) a valid client, secret, refresh and access tokens that are authorised to execute scripts.
|
|
39
|
-
|
|
40
|
-
executeScriptSASjs(code: string, runTime?: string, authConfig?: AuthConfig): Promise<string | undefined>;
|
|
41
|
-
/**
|
|
42
|
-
* Executes sas code in a SAS Viya compute session.
|
|
43
|
-
* @param fileName - name of the file to run. It will be converted to path to the file being submitted for execution.
|
|
44
|
-
* @param linesOfCode - lines of sas code from the file to run.
|
|
45
|
-
* @param contextName - context name on which code will be run on the server.
|
|
46
|
-
* @param authConfig - (optional) the access token, refresh token, client and secret for authorizing the request.
|
|
43
|
+
* @param authConfigSas9 - (required for server type sas9) a valid username and password that are authorised to execute scripts.
|
|
47
44
|
* @param debug - (optional) if true, global debug config will be overriden
|
|
48
45
|
*/
|
|
49
|
-
|
|
46
|
+
executeScript({ linesOfCode, fileName, contextName, runTime, authConfig, authConfigSas9, debug }: ExecuteScriptParams): Promise<any>;
|
|
50
47
|
/**
|
|
51
48
|
* Gets compute contexts.
|
|
52
49
|
* @param accessToken - an access token for an authorised user.
|
|
@@ -294,24 +291,6 @@ export default class SASjs {
|
|
|
294
291
|
* @param isForced - flag that indicates if target folder already exists, it and all subfolders have to be deleted.
|
|
295
292
|
*/
|
|
296
293
|
deployServicePack(serviceJson: any, appLoc?: string, serverUrl?: string, accessToken?: string, isForced?: boolean): Promise<void>;
|
|
297
|
-
/**
|
|
298
|
-
* Creates the folders and services at the given location `appLoc` on the given server `serverUrl`.
|
|
299
|
-
* @param dataJson - the JSON specifying the folders and files to be created, can also includes
|
|
300
|
-
* appLoc, streamServiceName, streamWebFolder, streamLogo
|
|
301
|
-
* @param appLoc - (optional) the base folder in which to create the new folders and
|
|
302
|
-
* services. If not provided, is taken from SASjsConfig. Precedence will be of appLoc present in dataJson.
|
|
303
|
-
* @param authConfig - (optional) a valid client, secret, refresh and access tokens that are authorised to execute compute jobs.
|
|
304
|
-
*/
|
|
305
|
-
deployToSASjs(dataJson: ServicePackSASjs, appLoc?: string, authConfig?: AuthConfig): Promise<{
|
|
306
|
-
status: string;
|
|
307
|
-
message: string;
|
|
308
|
-
streamServiceName?: string | undefined;
|
|
309
|
-
example?: {} | undefined;
|
|
310
|
-
} | undefined>;
|
|
311
|
-
executeJobSASjs(query: ExecutionQuery, authConfig?: AuthConfig): Promise<{
|
|
312
|
-
result: any;
|
|
313
|
-
log: any;
|
|
314
|
-
} | undefined>;
|
|
315
294
|
/**
|
|
316
295
|
* Kicks off execution of the given job via the compute API.
|
|
317
296
|
* @returns an object representing the compute session created for the given job.
|
|
@@ -348,3 +327,4 @@ export default class SASjs {
|
|
|
348
327
|
private createFoldersAndServices;
|
|
349
328
|
private isMethodSupported;
|
|
350
329
|
}
|
|
330
|
+
export {};
|
package/node/SASjsApiClient.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ import { RequestClient } from './request/RequestClient';
|
|
|
4
4
|
export declare class SASjsApiClient {
|
|
5
5
|
private requestClient;
|
|
6
6
|
constructor(requestClient: RequestClient);
|
|
7
|
+
/**
|
|
8
|
+
* Creates the folders and services at the given location `appLoc` on the given server `serverUrl`.
|
|
9
|
+
* @param dataJson - the JSON specifying the folders and files to be created, can also includes
|
|
10
|
+
* appLoc, streamServiceName, streamWebFolder, streamLogo
|
|
11
|
+
* @param appLoc - the base folder in which to create the new folders and services.
|
|
12
|
+
* @param authConfig - (optional) a valid client, secret, refresh and access tokens that are authorised to execute compute jobs.
|
|
13
|
+
*/
|
|
7
14
|
deploy(dataJson: ServicePackSASjs, appLoc: string, authConfig?: AuthConfig): Promise<{
|
|
8
15
|
status: string;
|
|
9
16
|
message: string;
|