@sasjs/adapter 3.10.15 → 3.10.16
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 -6
- package/SASjs.d.ts +2 -6
- package/SASjsApiClient.d.ts +3 -7
- package/api/viya/getFileStream.d.ts +1 -1
- package/index.js +2 -2
- package/node/SASjs.d.ts +2 -6
- package/node/SASjsApiClient.d.ts +3 -7
- package/node/api/viya/getFileStream.d.ts +1 -1
- package/node/index.js +2 -2
- package/node/utils/createAxiosInstance.d.ts +1 -1
- package/node/utils/parseWeboutResponse.d.ts +1 -1
- package/package.json +4 -6
- package/src/SASjs.ts +5 -1
- package/src/SASjsApiClient.ts +16 -15
- package/utils/createAxiosInstance.d.ts +1 -1
- package/utils/parseWeboutResponse.d.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as https from 'https';
|
|
2
|
-
export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent
|
|
2
|
+
export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent) => import("axios").AxiosInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const parseWeboutResponse: (response: string, url?: string
|
|
1
|
+
export declare const parseWeboutResponse: (response: string, url?: string) => string;
|
package/package.json
CHANGED
|
@@ -67,14 +67,12 @@
|
|
|
67
67
|
"semantic-release": "19.0.3",
|
|
68
68
|
"terser-webpack-plugin": "5.3.1",
|
|
69
69
|
"ts-jest": "27.1.3",
|
|
70
|
-
"ts-loader": "9.
|
|
70
|
+
"ts-loader": "9.4.0",
|
|
71
71
|
"tslint": "6.1.3",
|
|
72
72
|
"tslint-config-prettier": "1.18.0",
|
|
73
|
-
"typedoc": "0.
|
|
74
|
-
"typedoc-neo-theme": "1.1.1",
|
|
75
|
-
"typedoc-plugin-external-module-name": "4.0.6",
|
|
73
|
+
"typedoc": "0.23.15",
|
|
76
74
|
"typedoc-plugin-rename-defaults": "0.4.0",
|
|
77
|
-
"typescript": "4.
|
|
75
|
+
"typescript": "4.8.3",
|
|
78
76
|
"webpack": "5.69.0",
|
|
79
77
|
"webpack-cli": "4.9.2"
|
|
80
78
|
},
|
|
@@ -87,5 +85,5 @@
|
|
|
87
85
|
"https": "1.0.0",
|
|
88
86
|
"tough-cookie": "4.0.0"
|
|
89
87
|
},
|
|
90
|
-
"version": "3.10.
|
|
88
|
+
"version": "3.10.16"
|
|
91
89
|
}
|
package/src/SASjs.ts
CHANGED
|
@@ -846,7 +846,11 @@ export default class SASjs {
|
|
|
846
846
|
}
|
|
847
847
|
|
|
848
848
|
public async executeJobSASjs(query: ExecutionQuery, authConfig?: AuthConfig) {
|
|
849
|
-
return await this.sasJSApiClient?.executeJob(
|
|
849
|
+
return await this.sasJSApiClient?.executeJob(
|
|
850
|
+
query,
|
|
851
|
+
this.sasjsConfig.appLoc,
|
|
852
|
+
authConfig
|
|
853
|
+
)
|
|
850
854
|
}
|
|
851
855
|
|
|
852
856
|
/**
|
package/src/SASjsApiClient.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { ExecutionQuery } from './types'
|
|
|
3
3
|
import { RequestClient } from './request/RequestClient'
|
|
4
4
|
import { getAccessTokenForSasjs } from './auth/getAccessTokenForSasjs'
|
|
5
5
|
import { refreshTokensForSasjs } from './auth/refreshTokensForSasjs'
|
|
6
|
-
import { parseWeboutResponse, SASJS_LOGS_SEPARATOR } from './utils'
|
|
7
6
|
import { getTokens } from './auth/getTokens'
|
|
8
7
|
|
|
9
8
|
export class SASjsApiClient {
|
|
@@ -42,23 +41,25 @@ export class SASjsApiClient {
|
|
|
42
41
|
return Promise.resolve(result)
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
public async executeJob(
|
|
44
|
+
public async executeJob(
|
|
45
|
+
query: ExecutionQuery,
|
|
46
|
+
appLoc: string,
|
|
47
|
+
authConfig?: AuthConfig
|
|
48
|
+
) {
|
|
46
49
|
const access_token = authConfig ? authConfig.access_token : undefined
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
logPath?: string
|
|
53
|
-
error?: {}
|
|
54
|
-
_webout?: string
|
|
55
|
-
}>('SASjsApi/stp/execute', query, access_token)
|
|
56
|
-
|
|
57
|
-
if (Object.keys(result).includes('_webout')) {
|
|
58
|
-
result._webout = parseWeboutResponse(result._webout!)
|
|
59
|
-
}
|
|
51
|
+
let _program
|
|
52
|
+
if (query._program.startsWith('/')) {
|
|
53
|
+
_program = query._program
|
|
54
|
+
} else _program = `${appLoc}/${query._program}`
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
const response: any = await this.requestClient.post(
|
|
57
|
+
'SASjsApi/stp/execute',
|
|
58
|
+
{ _debug: 131, ...query, _program },
|
|
59
|
+
access_token
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
return { result: response.result, log: response.log }
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as https from 'https';
|
|
2
|
-
export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent
|
|
2
|
+
export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent) => import("axios").AxiosInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const parseWeboutResponse: (response: string, url?: string
|
|
1
|
+
export declare const parseWeboutResponse: (response: string, url?: string) => string;
|