@sasjs/adapter 3.10.18 → 4.0.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/node/SASjs.d.ts CHANGED
@@ -1,9 +1,18 @@
1
1
  /// <reference types="node" />
2
- import { SASjsConfig, UploadFile, EditContextInput, PollOptions, ExecutionQuery } from './types';
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, ServicePackSASjs } from '@sasjs/utils/types';
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 SAS code on a SAS 9 server. Requires a runner to be present in
29
- * the users home directory in metadata.
30
- * @param linesOfCode - lines of sas code from the file to run.
31
- * @param username - a string representing the username.
32
- * @param password - a string representing the password.
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
- executeScriptSASViya(fileName: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, debug?: boolean): Promise<any>;
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 {};
@@ -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;
package/node/index.d.ts CHANGED
@@ -3,4 +3,6 @@ export * from './types';
3
3
  export * from './types/errors';
4
4
  export * from './SASViyaApiClient';
5
5
  export * from './SAS9ApiClient';
6
+ export * from './SASjsApiClient';
7
+ export * from './request/SasjsRequestClient';
6
8
  export default SASjs;