@sasjs/adapter 2.11.0 → 2.11.4
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 +9 -7
- package/SASViyaApiClient.d.ts +7 -0
- package/SASjs.d.ts +15 -2
- package/index.js +2 -2
- package/job-execution/FileUploader.d.ts +9 -0
- package/job-execution/JobExecutor.d.ts +0 -7
- package/job-execution/index.d.ts +1 -0
- package/node/SASViyaApiClient.d.ts +7 -0
- package/node/SASjs.d.ts +15 -2
- package/node/index.js +2 -2
- package/node/job-execution/FileUploader.d.ts +9 -0
- package/node/job-execution/JobExecutor.d.ts +0 -7
- package/node/job-execution/index.d.ts +1 -0
- package/node/request/RequestClient.d.ts +20 -0
- package/package.json +6 -6
- package/request/RequestClient.d.ts +20 -0
- package/src/SASViyaApiClient.ts +10 -0
- package/src/SASjs.ts +44 -29
- package/src/job-execution/ComputeJobExecutor.ts +4 -5
- package/src/job-execution/FileUploader.ts +143 -0
- package/src/job-execution/JesJobExecutor.ts +4 -4
- package/src/job-execution/JobExecutor.ts +1 -52
- package/src/job-execution/Sas9JobExecutor.ts +1 -1
- package/src/job-execution/WebJobExecutor.ts +35 -7
- package/src/job-execution/index.ts +1 -0
- package/src/request/RequestClient.ts +95 -20
- package/src/utils/getValidJson.ts +2 -0
- package/src/utils/loginPrompt/index.ts +21 -11
- package/src/utils/parseViyaDebugResponse.ts +1 -1
- package/FileUploader.d.ts +0 -10
- package/node/FileUploader.d.ts +0 -10
- package/src/FileUploader.ts +0 -98
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RequestClient } from '../request/RequestClient';
|
|
2
|
+
import { ServerType } from '@sasjs/utils/types';
|
|
3
|
+
import { BaseJobExecutor } from './JobExecutor';
|
|
4
|
+
export declare class FileUploader extends BaseJobExecutor {
|
|
5
|
+
private jobsPath;
|
|
6
|
+
private requestClient;
|
|
7
|
+
constructor(serverUrl: string, serverType: ServerType, jobsPath: string, requestClient: RequestClient);
|
|
8
|
+
execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import { AuthConfig, ServerType } from '@sasjs/utils/types';
|
|
2
|
-
import { SASjsRequest } from '../types';
|
|
3
2
|
import { ExtraResponseAttributes } from '@sasjs/utils/types';
|
|
4
3
|
export declare type ExecuteFunction = () => Promise<any>;
|
|
5
4
|
export interface JobExecutor {
|
|
6
5
|
execute: (sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]) => Promise<any>;
|
|
7
6
|
resendWaitingRequests: () => Promise<void>;
|
|
8
|
-
getRequests: () => SASjsRequest[];
|
|
9
|
-
clearRequests: () => void;
|
|
10
7
|
}
|
|
11
8
|
export declare abstract class BaseJobExecutor implements JobExecutor {
|
|
12
9
|
protected serverUrl: string;
|
|
13
10
|
protected serverType: ServerType;
|
|
14
11
|
constructor(serverUrl: string, serverType: ServerType);
|
|
15
12
|
private waitingRequests;
|
|
16
|
-
private requests;
|
|
17
13
|
abstract execute(sasJob: string, data: any, config: any, loginRequiredCallback?: any, authConfig?: AuthConfig | undefined, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<any>;
|
|
18
14
|
resendWaitingRequests: () => Promise<void>;
|
|
19
|
-
getRequests: () => SASjsRequest[];
|
|
20
|
-
clearRequests: () => void;
|
|
21
15
|
protected appendWaitingRequest(request: ExecuteFunction): void;
|
|
22
|
-
protected appendRequest(response: any, program: string, debug: boolean): void;
|
|
23
16
|
}
|
package/job-execution/index.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export declare class SASViyaApiClient {
|
|
|
16
16
|
private sessionManager;
|
|
17
17
|
private contextManager;
|
|
18
18
|
private folderMap;
|
|
19
|
+
/**
|
|
20
|
+
* A helper method used to call appendRequest method of RequestClient
|
|
21
|
+
* @param response - response from sasjs request
|
|
22
|
+
* @param program - name of program
|
|
23
|
+
* @param debug - a boolean that indicates whether debug was enabled or not
|
|
24
|
+
*/
|
|
25
|
+
appendRequest(response: any, program: string, debug: boolean): void;
|
|
19
26
|
get debug(): boolean;
|
|
20
27
|
set debug(value: boolean);
|
|
21
28
|
/**
|
package/node/SASjs.d.ts
CHANGED
|
@@ -219,9 +219,18 @@ export default class SASjs {
|
|
|
219
219
|
* Process). Is prepended at runtime with the value of `appLoc`.
|
|
220
220
|
* @param files - array of files to be uploaded, including File object and file name.
|
|
221
221
|
* @param params - request URL parameters.
|
|
222
|
-
* @param
|
|
222
|
+
* @param config - provide any changes to the config here, for instance to
|
|
223
|
+
* enable/disable `debug`. Any change provided will override the global config,
|
|
224
|
+
* for that particular function call.
|
|
225
|
+
* @param loginRequiredCallback - a function that is called if the
|
|
226
|
+
* user is not logged in (eg to display a login form). The request will be
|
|
227
|
+
* resubmitted after successful login.
|
|
223
228
|
*/
|
|
224
|
-
uploadFile(sasJob: string, files: UploadFile[], params:
|
|
229
|
+
uploadFile(sasJob: string, files: UploadFile[], params: {
|
|
230
|
+
[key: string]: any;
|
|
231
|
+
} | null, config?: {
|
|
232
|
+
[key: string]: any;
|
|
233
|
+
}, loginRequiredCallback?: () => any): Promise<unknown>;
|
|
225
234
|
/**
|
|
226
235
|
* Makes a request to the SAS Service specified in `SASjob`. The response
|
|
227
236
|
* object will always contain table names in lowercase, and column names in
|
|
@@ -304,6 +313,10 @@ export default class SASjs {
|
|
|
304
313
|
* @param accessToken - an access token for an authorized user.
|
|
305
314
|
*/
|
|
306
315
|
fetchLogFileContent(logUrl: string, accessToken?: string): Promise<string>;
|
|
316
|
+
/**
|
|
317
|
+
* this method returns an array of SASjsRequest
|
|
318
|
+
* @returns SASjsRequest[]
|
|
319
|
+
*/
|
|
307
320
|
getSasRequests(): import("./types").SASjsRequest[];
|
|
308
321
|
clearSasRequests(): void;
|
|
309
322
|
private setupConfiguration;
|