@remyar/tecdoc_client 0.0.9 → 0.0.10
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/lib/index.js +2 -0
- package/lib/tecdoc/getAmBrands.js +2 -6
- package/lib/tecdoc/getBrands.js +63 -0
- package/package.json +1 -1
- package/src/index.js +2 -0
- package/src/tecdoc/getAmBrands.js +2 -6
- package/src/tecdoc/getBrands.js +22 -0
package/lib/index.js
CHANGED
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _config = _interopRequireDefault(require("./api/config"));
|
|
9
|
+
var _getBrands = _interopRequireDefault(require("./tecdoc/getBrands"));
|
|
9
10
|
var _getAmBrands = _interopRequireDefault(require("./tecdoc/getAmBrands"));
|
|
10
11
|
var _getVersion = _interopRequireDefault(require("./tecdoc/getVersion"));
|
|
11
12
|
var _default = exports["default"] = {
|
|
12
13
|
setProvider: _config["default"].setProvider,
|
|
14
|
+
getBrands: _getBrands["default"],
|
|
13
15
|
getAmBrands: _getAmBrands["default"],
|
|
14
16
|
getVersion: _getVersion["default"]
|
|
15
17
|
};
|
|
@@ -28,14 +28,10 @@ function _ref() {
|
|
|
28
28
|
_context.p = 0;
|
|
29
29
|
_context.n = 1;
|
|
30
30
|
return _api["default"].post({
|
|
31
|
-
|
|
31
|
+
getAmBrands: {
|
|
32
32
|
"articleCountry": (params === null || params === void 0 ? void 0 : params.articleCountry) || "FR",
|
|
33
33
|
"lang": (params === null || params === void 0 ? void 0 : params.lang) || "FR",
|
|
34
|
-
"provider": params !== null && params !== void 0 && params.provider ? params === null || params === void 0 ? void 0 : params.provider : process.env.TECDOC_PROVIDER_ID
|
|
35
|
-
"includeAll": (params === null || params === void 0 ? void 0 : params.includeAll) || false,
|
|
36
|
-
"includeAddressDetails": (params === null || params === void 0 ? void 0 : params.includeAddressDetails) || false,
|
|
37
|
-
"includeDataSupplierStatus": (params === null || params === void 0 ? void 0 : params.includeDataSupplierStatus) || false,
|
|
38
|
-
"includeDataSupplierLogo": (params === null || params === void 0 ? void 0 : params.includeDataSupplierLogo) || false
|
|
34
|
+
"provider": params !== null && params !== void 0 && params.provider ? params === null || params === void 0 ? void 0 : params.provider : process.env.TECDOC_PROVIDER_ID
|
|
39
35
|
}
|
|
40
36
|
});
|
|
41
37
|
case 1:
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = _default;
|
|
8
|
+
var _regenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _api = _interopRequireDefault(require("../api"));
|
|
11
|
+
function _default() {
|
|
12
|
+
return _ref.apply(this, arguments);
|
|
13
|
+
}
|
|
14
|
+
function _ref() {
|
|
15
|
+
_ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee2() {
|
|
16
|
+
var params,
|
|
17
|
+
_args2 = arguments;
|
|
18
|
+
return (0, _regenerator2["default"])().w(function (_context2) {
|
|
19
|
+
while (1) switch (_context2.n) {
|
|
20
|
+
case 0:
|
|
21
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
22
|
+
return _context2.a(2, new Promise(/*#__PURE__*/function () {
|
|
23
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee(resolve, reject) {
|
|
24
|
+
var result, _t;
|
|
25
|
+
return (0, _regenerator2["default"])().w(function (_context) {
|
|
26
|
+
while (1) switch (_context.p = _context.n) {
|
|
27
|
+
case 0:
|
|
28
|
+
_context.p = 0;
|
|
29
|
+
_context.n = 1;
|
|
30
|
+
return _api["default"].post({
|
|
31
|
+
getAmBrands: {
|
|
32
|
+
"articleCountry": (params === null || params === void 0 ? void 0 : params.articleCountry) || "FR",
|
|
33
|
+
"lang": (params === null || params === void 0 ? void 0 : params.lang) || "FR",
|
|
34
|
+
"provider": params !== null && params !== void 0 && params.provider ? params === null || params === void 0 ? void 0 : params.provider : process.env.TECDOC_PROVIDER_ID,
|
|
35
|
+
"includeAll": (params === null || params === void 0 ? void 0 : params.includeAll) || false,
|
|
36
|
+
"includeAddressDetails": (params === null || params === void 0 ? void 0 : params.includeAddressDetails) || false,
|
|
37
|
+
"includeDataSupplierStatus": (params === null || params === void 0 ? void 0 : params.includeDataSupplierStatus) || false,
|
|
38
|
+
"includeDataSupplierLogo": (params === null || params === void 0 ? void 0 : params.includeDataSupplierLogo) || false
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
case 1:
|
|
42
|
+
result = _context.v;
|
|
43
|
+
resolve(result);
|
|
44
|
+
_context.n = 3;
|
|
45
|
+
break;
|
|
46
|
+
case 2:
|
|
47
|
+
_context.p = 2;
|
|
48
|
+
_t = _context.v;
|
|
49
|
+
reject(_t);
|
|
50
|
+
case 3:
|
|
51
|
+
return _context.a(2);
|
|
52
|
+
}
|
|
53
|
+
}, _callee, null, [[0, 2]]);
|
|
54
|
+
}));
|
|
55
|
+
return function (_x, _x2) {
|
|
56
|
+
return _ref2.apply(this, arguments);
|
|
57
|
+
};
|
|
58
|
+
}()));
|
|
59
|
+
}
|
|
60
|
+
}, _callee2);
|
|
61
|
+
}));
|
|
62
|
+
return _ref.apply(this, arguments);
|
|
63
|
+
}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import config from './api/config';
|
|
3
|
+
import getBrands from "./tecdoc/getBrands";
|
|
3
4
|
import getAmBrands from "./tecdoc/getAmBrands";
|
|
4
5
|
import getVersion from './tecdoc/getVersion';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
setProvider : config.setProvider,
|
|
9
|
+
getBrands,
|
|
8
10
|
getAmBrands,
|
|
9
11
|
getVersion
|
|
10
12
|
}
|
|
@@ -4,14 +4,10 @@ export default async function (params = {}) {
|
|
|
4
4
|
return new Promise(async (resolve, reject) => {
|
|
5
5
|
try {
|
|
6
6
|
let result = await api.post({
|
|
7
|
-
|
|
7
|
+
getAmBrands: {
|
|
8
8
|
"articleCountry": params?.articleCountry || "FR",
|
|
9
9
|
"lang": params?.lang || "FR",
|
|
10
|
-
"provider": params?.provider ? params?.provider : process.env.TECDOC_PROVIDER_ID
|
|
11
|
-
"includeAll": params?.includeAll || false,
|
|
12
|
-
"includeAddressDetails": params?.includeAddressDetails || false,
|
|
13
|
-
"includeDataSupplierStatus": params?.includeDataSupplierStatus || false,
|
|
14
|
-
"includeDataSupplierLogo": params?.includeDataSupplierLogo || false
|
|
10
|
+
"provider": params?.provider ? params?.provider : process.env.TECDOC_PROVIDER_ID
|
|
15
11
|
}
|
|
16
12
|
});
|
|
17
13
|
resolve(result);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import api from '../api';
|
|
2
|
+
|
|
3
|
+
export default async function (params = {}) {
|
|
4
|
+
return new Promise(async (resolve, reject) => {
|
|
5
|
+
try {
|
|
6
|
+
let result = await api.post({
|
|
7
|
+
getAmBrands: {
|
|
8
|
+
"articleCountry": params?.articleCountry || "FR",
|
|
9
|
+
"lang": params?.lang || "FR",
|
|
10
|
+
"provider": params?.provider ? params?.provider : process.env.TECDOC_PROVIDER_ID,
|
|
11
|
+
"includeAll": params?.includeAll || false,
|
|
12
|
+
"includeAddressDetails": params?.includeAddressDetails || false,
|
|
13
|
+
"includeDataSupplierStatus": params?.includeDataSupplierStatus || false,
|
|
14
|
+
"includeDataSupplierLogo": params?.includeDataSupplierLogo || false
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
resolve(result);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
reject(err);
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
}
|