sim-node-lib 0.0.141 → 0.0.143
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.
|
@@ -4,7 +4,6 @@ export declare class AxiosService {
|
|
|
4
4
|
url: string;
|
|
5
5
|
constructor(url: string);
|
|
6
6
|
authSim(auth?: string): AxiosService;
|
|
7
|
-
authToTerminal(auth?: string): void;
|
|
8
7
|
get(params?: object, data?: object, responseType?: ResponseType): Promise<AxiosResponse<any, any>>;
|
|
9
8
|
post(params?: object, data?: object): Promise<AxiosResponse<any, any>>;
|
|
10
9
|
put(params?: object, data?: object): Promise<AxiosResponse<any, any>>;
|
|
@@ -21,7 +21,6 @@ class AxiosService {
|
|
|
21
21
|
authSim(auth) {
|
|
22
22
|
var _a;
|
|
23
23
|
let authEnv = (_a = process.env.AUTHORIZATION) !== null && _a !== void 0 ? _a : '';
|
|
24
|
-
console.log('AUTH ENV: ', authEnv);
|
|
25
24
|
let authString = 'Basic ' + authEnv;
|
|
26
25
|
if (auth) {
|
|
27
26
|
authString = 'Basic ' + auth;
|
|
@@ -32,14 +31,6 @@ class AxiosService {
|
|
|
32
31
|
};
|
|
33
32
|
return this;
|
|
34
33
|
}
|
|
35
|
-
authToTerminal(auth) {
|
|
36
|
-
var _a, _b;
|
|
37
|
-
let authEnv = (_a = process.env.AUTHORIZATION) !== null && _a !== void 0 ? _a : '';
|
|
38
|
-
headers = {
|
|
39
|
-
authorization: (_b = 'Basic ' + auth) !== null && _b !== void 0 ? _b : authEnv,
|
|
40
|
-
};
|
|
41
|
-
console.log(headers);
|
|
42
|
-
}
|
|
43
34
|
get(params, data, responseType) {
|
|
44
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
36
|
let content = {
|
|
@@ -49,6 +40,7 @@ class AxiosService {
|
|
|
49
40
|
data: data ? data : undefined,
|
|
50
41
|
responseType: responseType ? responseType : 'json',
|
|
51
42
|
};
|
|
43
|
+
console.log('headers: ', content.headers);
|
|
52
44
|
return yield (0, axios_1.default)(this.url, content)
|
|
53
45
|
.then((response) => {
|
|
54
46
|
return response;
|