@sasjs/adapter 3.4.1 → 3.6.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/SASjs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { SASjsConfig, UploadFile, EditContextInput, PollOptions, FolderMember, ServiceMember, ExecutionQuery } from './types';
2
+ import { SASjsConfig, UploadFile, EditContextInput, PollOptions, ExecutionQuery, FileTree } from './types';
3
3
  import { SASViyaApiClient } from './SASViyaApiClient';
4
4
  import { SASjsAuthResponse } from './SASjsApiClient';
5
5
  import { MacroVar, AuthConfig, ExtraResponseAttributes, SasAuthResponse } from '@sasjs/utils/types';
@@ -21,9 +21,25 @@ export default class SASjs {
21
21
  private computeJobExecutor;
22
22
  private jesJobExecutor;
23
23
  private sas9JobExecutor;
24
+ private sasJsJobExecutor;
24
25
  constructor(config?: Partial<SASjsConfig>);
25
26
  getCsrfToken(type?: 'general' | 'file'): import("./types").CsrfToken | undefined;
27
+ /**
28
+ * Executes the sas code against SAS9 server
29
+ * @param linesOfCode - lines of sas code from the file to run.
30
+ * @param username - a string representing the username.
31
+ * @param password - a string representing the password.
32
+ */
26
33
  executeScriptSAS9(linesOfCode: string[], userName: string, password: string): Promise<string | undefined>;
34
+ /**
35
+ * Executes the sas code against SASViya server
36
+ * @param fileName - name of the file to run. It will be converted to path to the file being submitted for execution.
37
+ * @param linesOfCode - lines of sas code from the file to run.
38
+ * @param contextName - context name on which code will be run on the server.
39
+ * @param authConfig - (optional) the access token, refresh token, client and secret for authorizing the request.
40
+ * @param debug - (optional) if true, global debug config will be overriden
41
+ */
42
+ executeScriptSASViya(fileName: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, debug?: boolean): Promise<any>;
27
43
  /**
28
44
  * Gets compute contexts.
29
45
  * @param accessToken - an access token for an authorized user.
@@ -89,11 +105,7 @@ export default class SASjs {
89
105
  * @param accessToken - an access token for an authorized user.
90
106
  */
91
107
  deleteComputeContext(contextName: string, accessToken?: string): Promise<{
92
- result: import("./types").Context; /**
93
- * Returns a JSON representation of a compute context.
94
- * @param contextId - an id of the context to return.
95
- * @param accessToken - an access token for an authorized user.
96
- */
108
+ result: import("./types").Context;
97
109
  etag: string;
98
110
  }>;
99
111
  /**
@@ -110,15 +122,6 @@ export default class SASjs {
110
122
  */
111
123
  getComputeContextById(contextId: string, accessToken?: string): Promise<import("./types").ContextAllAttributes>;
112
124
  createSession(contextName: string, accessToken: string): Promise<import("./types").Session>;
113
- /**
114
- * Executes the sas code against given sas server
115
- * @param fileName - name of the file to run. It will be converted to path to the file being submitted for execution.
116
- * @param linesOfCode - lines of sas code from the file to run.
117
- * @param contextName - context name on which code will be run on the server.
118
- * @param authConfig - (optional) the access token, refresh token, client and secret for authorizing the request.
119
- * @param debug - (optional) if true, global debug config will be overriden
120
- */
121
- executeScriptSASViya(fileName: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, debug?: boolean): Promise<any>;
122
125
  /**
123
126
  * Creates a folder in the logical SAS folder tree
124
127
  * @param folderName - name of the folder to be created.
@@ -225,11 +228,7 @@ export default class SASjs {
225
228
  * Logs out of the configured SAS server.
226
229
  */
227
230
  logOut(): Promise<boolean | {
228
- result: unknown; /**
229
- * Returns a JSON representation of a compute context.
230
- * @param contextId - an id of the context to return.
231
- * @param accessToken - an access token for an authorized user.
232
- */
231
+ result: unknown;
233
232
  etag: string;
234
233
  }>;
235
234
  /**
@@ -307,7 +306,14 @@ export default class SASjs {
307
306
  * @param isForced - flag that indicates if target folder already exists, it and all subfolders have to be deleted.
308
307
  */
309
308
  deployServicePack(serviceJson: any, appLoc?: string, serverUrl?: string, accessToken?: string, isForced?: boolean): Promise<void>;
310
- deployToSASjs(members: [FolderMember, ServiceMember]): Promise<{
309
+ /**
310
+ * Creates the folders and services at the given location `appLoc` on the given server `serverUrl`.
311
+ * @param members - the JSON specifying the folders and services to be created.
312
+ * @param appLoc - the base folder in which to create the new folders and
313
+ * services. If not provided, is taken from SASjsConfig.
314
+ * @param authConfig - a valid client, secret, refresh and access tokens that are authorised to execute compute jobs.
315
+ */
316
+ deployToSASjs(members: FileTree, appLoc?: string, authConfig?: AuthConfig): Promise<{
311
317
  status: string;
312
318
  message: string;
313
319
  example?: {} | undefined;
@@ -318,6 +324,7 @@ export default class SASjs {
318
324
  log?: string | undefined;
319
325
  logPath?: string | undefined;
320
326
  error?: {} | undefined;
327
+ _webout?: string | undefined;
321
328
  } | undefined>;
322
329
  /**
323
330
  * Kicks off execution of the given job via the compute API.
@@ -1,11 +1,12 @@
1
- import { FolderMember, ServiceMember, ExecutionQuery } from './types';
1
+ import { AuthConfig } from '@sasjs/utils/types';
2
+ import { FileTree, ExecutionQuery } from './types';
2
3
  import { RequestClient } from './request/RequestClient';
3
4
  export declare class SASjsApiClient {
4
5
  private serverUrl;
5
6
  private requestClient;
6
7
  constructor(serverUrl: string, requestClient: RequestClient);
7
8
  setConfig(serverUrl: string): void;
8
- deploy(members: [FolderMember, ServiceMember], appLoc: string): Promise<{
9
+ deploy(members: FileTree, appLoc: string, authConfig?: AuthConfig): Promise<{
9
10
  status: string;
10
11
  message: string;
11
12
  example?: {} | undefined;
@@ -16,6 +17,7 @@ export declare class SASjsApiClient {
16
17
  log?: string | undefined;
17
18
  logPath?: string | undefined;
18
19
  error?: {} | undefined;
20
+ _webout?: string | undefined;
19
21
  }>;
20
22
  /**
21
23
  * Exchanges the auth code for an access token for the given client.
@@ -1 +1 @@
1
- import 'jest-extended';
1
+ export {};