@agenus-io/webhook-centralizer 1.0.5 → 1.0.7
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/dist/Class/index.js +18 -11
- package/dist/Class/interface.d.ts +1 -1
- package/package.json +1 -1
package/dist/Class/index.js
CHANGED
|
@@ -56,19 +56,22 @@ class WebhookCentralizerSDK {
|
|
|
56
56
|
secretToken: this.appToken,
|
|
57
57
|
workSpaceId,
|
|
58
58
|
};
|
|
59
|
-
const response = await axios_1.default.post(`${this.apiUrl}/platform`, {
|
|
59
|
+
const response = await axios_1.default.post(`${this.apiUrl}/platform`, { ...data }, {
|
|
60
|
+
headers: { "app-id": token.appId, "app-secret-token": token.secretToken, "work-space-id": token.workSpaceId }
|
|
61
|
+
});
|
|
60
62
|
return response.data;
|
|
61
63
|
}
|
|
62
64
|
catch (error) {
|
|
65
|
+
let errorMapped = error;
|
|
63
66
|
if (error instanceof axios_1.AxiosError) {
|
|
64
|
-
|
|
67
|
+
errorMapped = error.response?.data;
|
|
65
68
|
}
|
|
66
69
|
else {
|
|
67
|
-
|
|
70
|
+
errorMapped = error;
|
|
68
71
|
}
|
|
69
72
|
return {
|
|
70
73
|
isError: true,
|
|
71
|
-
error:
|
|
74
|
+
error: errorMapped,
|
|
72
75
|
};
|
|
73
76
|
}
|
|
74
77
|
}
|
|
@@ -79,20 +82,23 @@ class WebhookCentralizerSDK {
|
|
|
79
82
|
secretToken: this.appToken,
|
|
80
83
|
workSpaceId,
|
|
81
84
|
};
|
|
82
|
-
const res = await axios_1.default.put(`${this.apiUrl}/platform/${id}`, { token, ...data }
|
|
85
|
+
const res = await axios_1.default.put(`${this.apiUrl}/platform/${id}`, { token, ...data }, {
|
|
86
|
+
headers: { "app-id": token.appId, "app-secret-token": token.secretToken, "work-space-id": token.workSpaceId }
|
|
87
|
+
});
|
|
83
88
|
const result = res.data;
|
|
84
89
|
return result;
|
|
85
90
|
}
|
|
86
91
|
catch (error) {
|
|
92
|
+
let errorMapped = error;
|
|
87
93
|
if (error instanceof axios_1.AxiosError) {
|
|
88
|
-
|
|
94
|
+
errorMapped = error.response?.data;
|
|
89
95
|
}
|
|
90
96
|
else {
|
|
91
|
-
|
|
97
|
+
errorMapped = error;
|
|
92
98
|
}
|
|
93
99
|
return {
|
|
94
100
|
isError: true,
|
|
95
|
-
error:
|
|
101
|
+
error: errorMapped,
|
|
96
102
|
};
|
|
97
103
|
}
|
|
98
104
|
}
|
|
@@ -111,15 +117,16 @@ class WebhookCentralizerSDK {
|
|
|
111
117
|
};
|
|
112
118
|
}
|
|
113
119
|
catch (error) {
|
|
120
|
+
let errorMapped = error;
|
|
114
121
|
if (error instanceof axios_1.AxiosError) {
|
|
115
|
-
|
|
122
|
+
errorMapped = error.response?.data;
|
|
116
123
|
}
|
|
117
124
|
else {
|
|
118
|
-
|
|
125
|
+
errorMapped = error;
|
|
119
126
|
}
|
|
120
127
|
return {
|
|
121
128
|
isError: true,
|
|
122
|
-
error:
|
|
129
|
+
error: errorMapped,
|
|
123
130
|
};
|
|
124
131
|
}
|
|
125
132
|
}
|
|
@@ -3,7 +3,7 @@ import { webhookCentralizerDispatchType } from '../types';
|
|
|
3
3
|
import { JsonValue } from 'aws-sdk/clients/appmesh';
|
|
4
4
|
interface ICreatePlatformDTO {
|
|
5
5
|
title: string;
|
|
6
|
-
platformToken
|
|
6
|
+
platformToken?: string;
|
|
7
7
|
dispatchType: webhookCentralizerDispatchType;
|
|
8
8
|
type: webhookCentralizerPlatform;
|
|
9
9
|
apiToken?: string;
|
package/package.json
CHANGED