@sasjs/adapter 2.12.0 → 3.1.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.
Files changed (47) hide show
  1. package/SAS9ApiClient.d.ts +3 -1
  2. package/SASViyaApiClient.d.ts +7 -1
  3. package/SASjs.d.ts +9 -7
  4. package/auth/AuthManager.d.ts +7 -2
  5. package/index.js +2 -2
  6. package/job-execution/Sas9JobExecutor.d.ts +6 -5
  7. package/node/SAS9ApiClient.d.ts +3 -1
  8. package/node/SASViyaApiClient.d.ts +7 -1
  9. package/node/SASjs.d.ts +9 -7
  10. package/node/auth/AuthManager.d.ts +7 -2
  11. package/node/index.js +2 -2
  12. package/node/job-execution/Sas9JobExecutor.d.ts +6 -5
  13. package/node/request/RequestClient.d.ts +4 -2
  14. package/node/request/Sas9RequestClient.d.ts +3 -1
  15. package/node/types/ExecuteScript.d.ts +0 -1
  16. package/node/types/SASjsConfig.d.ts +11 -4
  17. package/node/utils/createAxiosInstance.d.ts +3 -0
  18. package/node/utils/getValidJson.d.ts +1 -1
  19. package/node/utils/index.d.ts +1 -0
  20. package/node/utils/parseViyaDebugResponse.d.ts +1 -1
  21. package/package.json +10 -6
  22. package/request/RequestClient.d.ts +4 -2
  23. package/request/Sas9RequestClient.d.ts +3 -1
  24. package/src/SAS9ApiClient.ts +3 -2
  25. package/src/SASjs.ts +17 -12
  26. package/src/auth/AuthManager.ts +23 -10
  27. package/src/auth/getAccessToken.ts +1 -1
  28. package/src/job-execution/Sas9JobExecutor.ts +36 -5
  29. package/src/job-execution/WebJobExecutor.ts +18 -3
  30. package/src/request/RequestClient.ts +23 -20
  31. package/src/request/Sas9RequestClient.ts +3 -2
  32. package/src/test/SAS_server_app.ts +38 -0
  33. package/src/types/ExecuteScript.ts +0 -1
  34. package/src/types/SASjsConfig.ts +10 -4
  35. package/src/utils/createAxiosInstance.ts +7 -0
  36. package/src/utils/getValidJson.ts +1 -1
  37. package/src/utils/index.ts +1 -0
  38. package/src/utils/parseWeboutResponse.ts +1 -1
  39. package/test/RequestClient.spec.d.ts +1 -0
  40. package/test/SAS_server_app.d.ts +10 -0
  41. package/types/ExecuteScript.d.ts +0 -1
  42. package/types/SASjsConfig.d.ts +11 -4
  43. package/utils/createAxiosInstance.d.ts +3 -0
  44. package/utils/getValidJson.d.ts +1 -1
  45. package/utils/index.d.ts +1 -0
  46. package/utils/parseViyaDebugResponse.d.ts +1 -1
  47. package/CHANGELOG.md +0 -213
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ import * as https from 'https';
1
3
  /**
2
4
  * A client for interfacing with the SAS9 REST API.
3
5
  *
@@ -6,7 +8,7 @@ export declare class SAS9ApiClient {
6
8
  private serverUrl;
7
9
  private jobsPath;
8
10
  private requestClient;
9
- constructor(serverUrl: string, jobsPath: string, allowInsecureRequests: boolean);
11
+ constructor(serverUrl: string, jobsPath: string, httpsAgentOptions?: https.AgentOptions);
10
12
  /**
11
13
  * Returns an object containing server URL.
12
14
  */
@@ -105,7 +105,13 @@ export declare class SASViyaApiClient {
105
105
  */
106
106
  editComputeContext(contextName: string, editedContext: EditContextInput, accessToken?: string): Promise<{
107
107
  result: Context;
108
- etag: string;
108
+ etag: string; /**
109
+ * Creates a launcher context on the given server.
110
+ * @param contextName - the name of the context to be created.
111
+ * @param description - the description of the context to be created.
112
+ * @param launchType - launch type of the context to be created.
113
+ * @param accessToken - an access token for an authorized user.
114
+ */
109
115
  }>;
110
116
  /**
111
117
  * Deletes a compute context on the given server.
package/SASjs.d.ts CHANGED
@@ -20,7 +20,7 @@ export default class SASjs {
20
20
  private computeJobExecutor;
21
21
  private jesJobExecutor;
22
22
  private sas9JobExecutor;
23
- constructor(config?: any);
23
+ constructor(config?: Partial<SASjsConfig>);
24
24
  getCsrfToken(type?: 'general' | 'file'): import("./types").CsrfToken | undefined;
25
25
  executeScriptSAS9(linesOfCode: string[], userName: string, password: string): Promise<string | undefined>;
26
26
  /**
@@ -40,10 +40,7 @@ export default class SASjs {
40
40
  */
41
41
  getLauncherContexts(accessToken: string): Promise<{
42
42
  createdBy: any;
43
- id: any; /**
44
- * Gets compute contexts.
45
- * @param accessToken - an access token for an authorized user.
46
- */
43
+ id: any;
47
44
  name: any;
48
45
  version: any;
49
46
  attributes: {};
@@ -199,9 +196,10 @@ export default class SASjs {
199
196
  setDebugState(value: boolean): void;
200
197
  /**
201
198
  * Checks whether a session is active, or login is required.
199
+ * @param accessToken - an optional access token is required for SASjs server type.
202
200
  * @returns - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.
203
201
  */
204
- checkSession(): Promise<{
202
+ checkSession(accessToken?: string): Promise<{
205
203
  isLoggedIn: boolean;
206
204
  userName: string;
207
205
  loginForm?: any;
@@ -214,8 +212,12 @@ export default class SASjs {
214
212
  logIn(username?: string, password?: string, options?: LoginOptions): Promise<LoginResult>;
215
213
  /**
216
214
  * Logs out of the configured SAS server.
215
+ * @param accessToken - an optional access token is required for SASjs server type.
217
216
  */
218
- logOut(): Promise<boolean>;
217
+ logOut(accessToken?: string): Promise<{
218
+ result: unknown;
219
+ etag: string;
220
+ }> | Promise<boolean>;
219
221
  /**
220
222
  * Uploads a file to the given service.
221
223
  * @param sasJob - the path to the SAS program (ultimately resolves to
@@ -27,12 +27,13 @@ export declare class AuthManager {
27
27
  private sendLoginRequest;
28
28
  /**
29
29
  * Checks whether a session is active, or login is required.
30
+ * @param accessToken - an optional access token is required for SASjs server type.
30
31
  * @returns - a promise which resolves with an object containing three values
31
32
  * - a boolean `isLoggedIn`
32
33
  * - a string `userName` and
33
34
  * - a form `loginForm` if not loggedin.
34
35
  */
35
- checkSession(): Promise<{
36
+ checkSession(accessToken?: string): Promise<{
36
37
  isLoggedIn: boolean;
37
38
  userName: string;
38
39
  loginForm?: any;
@@ -44,6 +45,10 @@ export declare class AuthManager {
44
45
  private setLoginUrl;
45
46
  /**
46
47
  * Logs out of the configured SAS server.
48
+ * @param accessToken - an optional access token is required for SASjs server type.
47
49
  */
48
- logOut(): Promise<boolean>;
50
+ logOut(accessToken?: string): Promise<{
51
+ result: unknown;
52
+ etag: string;
53
+ }> | Promise<boolean>;
49
54
  }