1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-13 07:00:06 +00:00

fix: usage and typings, axios, nodeFormData, cookiejar...

This commit is contained in:
2025-02-28 15:04:51 +01:00
parent be3ce56b85
commit 77306fedee
21 changed files with 1284 additions and 633 deletions

View File

@@ -1,6 +1,6 @@
import * as https from 'https'
import { AxiosRequestConfig } from 'axios'
import axiosCookieJarSupport from 'axios-cookiejar-support'
import { wrapper } from 'axios-cookiejar-support'
import * as tough from 'tough-cookie'
import { prefixMessage } from '@sasjs/utils/error'
import { RequestClient, throwIfError } from './RequestClient'
@@ -17,8 +17,8 @@ export class Sas9RequestClient extends RequestClient {
this.httpClient.defaults.validateStatus = (status) =>
status >= 200 && status < 303
if (axiosCookieJarSupport) {
axiosCookieJarSupport(this.httpClient)
if (wrapper) {
wrapper(this.httpClient)
this.httpClient.defaults.jar = new tough.CookieJar()
}
}