@sasjs/adapter 3.10.14 → 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.
@@ -1,2 +1,2 @@
1
1
  import * as https from 'https';
2
- export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent | undefined) => import("axios").AxiosInstance;
2
+ export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent) => import("axios").AxiosInstance;
@@ -1 +1 @@
1
- export declare const parseWeboutResponse: (response: string, url?: string | undefined) => 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.2.6",
70
+ "ts-loader": "9.4.0",
71
71
  "tslint": "6.1.3",
72
72
  "tslint-config-prettier": "1.18.0",
73
- "typedoc": "0.22.11",
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.5.5",
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.14"
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(query, authConfig)
849
+ return await this.sasJSApiClient?.executeJob(
850
+ query,
851
+ this.sasjsConfig.appLoc,
852
+ authConfig
853
+ )
850
854
  }
851
855
 
852
856
  /**
@@ -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(query: ExecutionQuery, authConfig?: AuthConfig) {
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
- const { result } = await this.requestClient.post<{
49
- status: string
50
- message: string
51
- log?: string
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
- return Promise.resolve(result)
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
  /**
@@ -88,9 +89,6 @@ export class SASjsApiClient {
88
89
  .then((res: any) => {
89
90
  if (res.log) parsedSasjsServerLog = res.log
90
91
  })
91
- .catch((err) => {
92
- parsedSasjsServerLog = err
93
- })
94
92
 
95
93
  return parsedSasjsServerLog
96
94
  }
@@ -1,2 +1,2 @@
1
1
  import * as https from 'https';
2
- export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent | undefined) => import("axios").AxiosInstance;
2
+ export declare const createAxiosInstance: (baseURL: string, httpsAgent?: https.Agent) => import("axios").AxiosInstance;
@@ -1 +1 @@
1
- export declare const parseWeboutResponse: (response: string, url?: string | undefined) => string;
1
+ export declare const parseWeboutResponse: (response: string, url?: string) => string;