@sasjs/adapter 4.8.0 → 4.9.1

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.
@@ -1,5 +1,6 @@
1
1
  import * as https from 'https'
2
2
  import { ServerType } from '@sasjs/utils/types'
3
+ import { VerboseMode } from '../types'
3
4
 
4
5
  /**
5
6
  * Specifies the configuration for the SASjs instance - eg where and how to
@@ -48,7 +49,7 @@ export class SASjsConfig {
48
49
  /**
49
50
  * Set to `true` to enable verbose mode that will log a summary of every HTTP response.
50
51
  */
51
- verbose?: boolean = true
52
+ verbose?: VerboseMode = true
52
53
  /**
53
54
  * The name of the compute context to use when calling the Viya services directly.
54
55
  * Example value: 'SAS Job Execution compute context'
@@ -6,10 +6,12 @@ export * from './Job'
6
6
  export * from './JobDefinition'
7
7
  export * from './JobResult'
8
8
  export * from './Link'
9
+ export * from './Login'
9
10
  export * from './SASjsConfig'
10
- export * from './SASjsRequest'
11
+ export * from './RequestClient'
11
12
  export * from './Session'
12
13
  export * from './UploadFile'
13
14
  export * from './PollOptions'
14
15
  export * from './WriteStream'
15
16
  export * from './ExecuteScript'
17
+ export * from './errors'
@@ -1,4 +1,4 @@
1
- import { SASjsRequest } from '../types/SASjsRequest'
1
+ import { SASjsRequest } from '../types'
2
2
 
3
3
  /**
4
4
  * Comparator for SASjs request timestamps.
@@ -0,0 +1,46 @@
1
+ import { CsrfToken } from '..';
2
+ export interface HttpClient {
3
+ get<T>(url: string, accessToken: string | undefined, contentType: string, overrideHeaders: {
4
+ [key: string]: string | number;
5
+ }): Promise<{
6
+ result: T;
7
+ etag: string;
8
+ }>;
9
+ post<T>(url: string, data: any, accessToken: string | undefined, contentType: string, overrideHeaders: {
10
+ [key: string]: string | number;
11
+ }): Promise<{
12
+ result: T;
13
+ etag: string;
14
+ }>;
15
+ put<T>(url: string, data: any, accessToken: string | undefined, overrideHeaders: {
16
+ [key: string]: string | number;
17
+ }): Promise<{
18
+ result: T;
19
+ etag: string;
20
+ }>;
21
+ delete<T>(url: string, accessToken: string | undefined): Promise<{
22
+ result: T;
23
+ etag: string;
24
+ }>;
25
+ getCsrfToken(type: 'general' | 'file'): CsrfToken | undefined;
26
+ saveLocalStorageToken(accessToken: string, refreshToken: string): void;
27
+ clearCsrfTokens(): void;
28
+ clearLocalStorageTokens(): void;
29
+ getBaseUrl(): string;
30
+ }
31
+ export interface SASjsRequest {
32
+ serviceLink: string;
33
+ timestamp: Date;
34
+ sourceCode: string;
35
+ generatedCode: string;
36
+ logFile: string;
37
+ SASWORK: any;
38
+ }
39
+ export interface SasjsParsedResponse<T> {
40
+ result: T;
41
+ log: string;
42
+ etag: string;
43
+ status: number;
44
+ printOutput?: string;
45
+ }
46
+ export declare type VerboseMode = boolean | 'bleached';
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import * as https from 'https';
3
3
  import { ServerType } from '@sasjs/utils/types';
4
+ import { VerboseMode } from '../types';
4
5
  /**
5
6
  * Specifies the configuration for the SASjs instance - eg where and how to
6
7
  * connect to SAS.
@@ -48,7 +49,7 @@ export declare class SASjsConfig {
48
49
  /**
49
50
  * Set to `true` to enable verbose mode that will log a summary of every HTTP response.
50
51
  */
51
- verbose?: boolean;
52
+ verbose?: VerboseMode;
52
53
  /**
53
54
  * The name of the compute context to use when calling the Viya services directly.
54
55
  * Example value: 'SAS Job Execution compute context'
package/types/index.d.ts CHANGED
@@ -6,10 +6,12 @@ export * from './Job';
6
6
  export * from './JobDefinition';
7
7
  export * from './JobResult';
8
8
  export * from './Link';
9
+ export * from './Login';
9
10
  export * from './SASjsConfig';
10
- export * from './SASjsRequest';
11
+ export * from './RequestClient';
11
12
  export * from './Session';
12
13
  export * from './UploadFile';
13
14
  export * from './PollOptions';
14
15
  export * from './WriteStream';
15
16
  export * from './ExecuteScript';
17
+ export * from './errors';
@@ -1,4 +1,4 @@
1
- import { SASjsRequest } from '../types/SASjsRequest';
1
+ import { SASjsRequest } from '../types';
2
2
  /**
3
3
  * Comparator for SASjs request timestamps.
4
4
  *
@@ -1,12 +0,0 @@
1
- /**
2
- * Represents a SASjs request, its response and logs.
3
- *
4
- */
5
- export interface SASjsRequest {
6
- serviceLink: string;
7
- timestamp: Date;
8
- sourceCode: string;
9
- generatedCode: string;
10
- logFile: string;
11
- SASWORK: any;
12
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Represents a SASjs request, its response and logs.
3
- *
4
- */
5
- export interface SASjsRequest {
6
- serviceLink: string
7
- timestamp: Date
8
- sourceCode: string
9
- generatedCode: string
10
- logFile: string
11
- SASWORK: any
12
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Represents a SASjs request, its response and logs.
3
- *
4
- */
5
- export interface SASjsRequest {
6
- serviceLink: string;
7
- timestamp: Date;
8
- sourceCode: string;
9
- generatedCode: string;
10
- logFile: string;
11
- SASWORK: any;
12
- }