@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.
@@ -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
  }
@@ -3,3 +3,4 @@ export * from './JesJobExecutor';
3
3
  export * from './JobExecutor';
4
4
  export * from './Sas9JobExecutor';
5
5
  export * from './WebJobExecutor';
6
+ export * from './FileUploader';
@@ -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 overrideSasjsConfig - object to override existing config (optional)
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: any, overrideSasjsConfig?: any): Promise<any>;
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;