@netresearch/node-red-contrib-magento-eqp 3.0.1 → 3.0.6
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.
|
@@ -35,8 +35,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g =
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
39
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
40
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
41
|
function step(op) {
|
|
42
42
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -80,7 +80,7 @@ var MagentoEQPCallbackParser = /** @class */ (function (_super) {
|
|
|
80
80
|
}
|
|
81
81
|
_this.configNode = configNode;
|
|
82
82
|
_this.on('input', function (msg) { return __awaiter(_this, void 0, void 0, function () {
|
|
83
|
-
var payload, _a, err_1, error, httpResponse;
|
|
83
|
+
var payload, _a, err_1, error, httpResponse, httpError, errorString;
|
|
84
84
|
return __generator(this, function (_b) {
|
|
85
85
|
switch (_b.label) {
|
|
86
86
|
case 0:
|
|
@@ -105,13 +105,15 @@ var MagentoEQPCallbackParser = /** @class */ (function (_super) {
|
|
|
105
105
|
case 2:
|
|
106
106
|
err_1 = _b.sent();
|
|
107
107
|
error = err_1;
|
|
108
|
+
httpResponse = err_1 instanceof axios_1.AxiosError && !!err_1.response ? err_1.response.data : null;
|
|
109
|
+
httpError = httpResponse ? JSON.stringify(httpResponse) : '';
|
|
110
|
+
errorString = "".concat(error, ": ").concat(httpError);
|
|
108
111
|
this.status({
|
|
109
112
|
fill: 'red',
|
|
110
113
|
shape: 'ring',
|
|
111
|
-
text:
|
|
114
|
+
text: errorString
|
|
112
115
|
});
|
|
113
|
-
|
|
114
|
-
this.send([null, __assign(__assign({}, error), { httpResponse: httpResponse })]);
|
|
116
|
+
this.send([null, __assign(__assign({}, error), { httpResponse: httpResponse, payload: errorString })]);
|
|
115
117
|
return [3 /*break*/, 3];
|
|
116
118
|
case 3: return [2 /*return*/];
|
|
117
119
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
defaults: {
|
|
7
7
|
name: { value: '' },
|
|
8
8
|
environment: { value: 'production', required: true },
|
|
9
|
-
autoRefresh: { value: true }
|
|
10
9
|
},
|
|
11
10
|
credentials: {
|
|
12
11
|
appId: { type: 'text' },
|
|
@@ -28,7 +27,7 @@
|
|
|
28
27
|
<label for="node-config-input-environment"><i class="icon-tag" />Environment</label>
|
|
29
28
|
<select id="node-config-input-environment">
|
|
30
29
|
<option value="production">Production</option>
|
|
31
|
-
<option value="
|
|
30
|
+
<option value="sandbox">Sandbox</option>
|
|
32
31
|
</select>
|
|
33
32
|
</div>
|
|
34
33
|
|
|
@@ -39,7 +39,6 @@ var MagentoEQPConfig = /** @class */ (function (_super) {
|
|
|
39
39
|
_this.appId = _this.credentials.appId;
|
|
40
40
|
_this.appSecret = _this.credentials.appSecret;
|
|
41
41
|
_this.environment = config.environment;
|
|
42
|
-
_this.autoRefresh = config.autoRefresh;
|
|
43
42
|
_this.eqp = new node_magento_eqp_1.EQP({
|
|
44
43
|
environment: (_a = config.environment) !== null && _a !== void 0 ? _a : 'production',
|
|
45
44
|
autoRefresh: (_b = config.autoRefresh) !== null && _b !== void 0 ? _b : true,
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netresearch/node-red-contrib-magento-eqp",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "Node-RED module for parsing callbacks from the Magento Marketplace EQP API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/netresearch/node-red-contrib-magento-eqp.git"
|
|
9
9
|
},
|
|
10
|
-
"author": "
|
|
10
|
+
"author": "DevMiner <devminer@devminer.xyz>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"node-red": {
|
|
13
13
|
"nodes": {
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"node-red-contrib-typescript-node": "^0.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/node": "^
|
|
36
|
-
"@types/node-red": "0.20.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
38
|
-
"@typescript-eslint/parser": "^
|
|
35
|
+
"@types/node": "^20.0.0",
|
|
36
|
+
"@types/node-red": "0.20.7",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
39
39
|
"eslint": "^8.45.0",
|
|
40
|
-
"eslint-plugin-html": "^
|
|
40
|
+
"eslint-plugin-html": "^8.0.0",
|
|
41
41
|
"typescript": "^5.1.6"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|