ozon-api 0.0.2
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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/Foo/index.d.ts +5 -0
- package/dist/Foo/index.js +8 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/index.js +4 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/Request.d.ts +3 -0
- package/dist/lib/Request.js +123 -0
- package/dist/lib/getTestApiKey.d.ts +3 -0
- package/dist/lib/getTestApiKey.js +19 -0
- package/dist/lib/store.d.ts +6 -0
- package/dist/lib/store.js +44 -0
- package/dist/lib/toast.d.ts +2 -0
- package/dist/lib/toast.js +8 -0
- package/dist/lib/toastError.d.ts +2 -0
- package/dist/lib/toastError.js +8 -0
- package/dist/ozon/category/index.d.ts +7 -0
- package/dist/ozon/category/index.js +188 -0
- package/dist/ozon/product/index.d.ts +10 -0
- package/dist/ozon/product/index.js +154 -0
- package/dist/service/api/CategoryController.d.ts +2 -0
- package/dist/service/api/CategoryController.js +56 -0
- package/dist/service/api/ProductController.d.ts +7 -0
- package/dist/service/api/ProductController.js +125 -0
- package/dist/types/Category.d.ts +49 -0
- package/dist/types/Category.js +0 -0
- package/dist/types/Product.d.ts +193 -0
- package/dist/types/Product.js +0 -0
- package/dist/types/typings.d.ts +32 -0
- package/package.json +77 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
import * as ProductController from "../../service/api/ProductController";
|
|
12
|
+
var ProductClass = /*#__PURE__*/function () {
|
|
13
|
+
function ProductClass(apiKeyInfo) {
|
|
14
|
+
_classCallCheck(this, ProductClass);
|
|
15
|
+
_defineProperty(this, "apiKeyInfo", {
|
|
16
|
+
apiId: '',
|
|
17
|
+
apiKey: ''
|
|
18
|
+
});
|
|
19
|
+
this.apiKeyInfo = apiKeyInfo;
|
|
20
|
+
console.log('Product constructor:', apiKeyInfo);
|
|
21
|
+
}
|
|
22
|
+
// https://api-seller.ozon.ru/v1/product/import-by-sku
|
|
23
|
+
_createClass(ProductClass, [{
|
|
24
|
+
key: "importBySku",
|
|
25
|
+
value: function () {
|
|
26
|
+
var _importBySku = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query) {
|
|
27
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29
|
+
case 0:
|
|
30
|
+
if (!(!(query !== null && query !== void 0 && query.items) || (query === null || query === void 0 ? void 0 : query.items.length) === 0)) {
|
|
31
|
+
_context.next = 2;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
return _context.abrupt("return", Promise.reject(new Error('请输入 sku ID ')));
|
|
35
|
+
case 2:
|
|
36
|
+
return _context.abrupt("return", ProductController.importBySku(query, {
|
|
37
|
+
apiKey: this.apiKeyInfo.apiKey,
|
|
38
|
+
apiId: this.apiKeyInfo.apiId
|
|
39
|
+
}));
|
|
40
|
+
case 3:
|
|
41
|
+
case "end":
|
|
42
|
+
return _context.stop();
|
|
43
|
+
}
|
|
44
|
+
}, _callee, this);
|
|
45
|
+
}));
|
|
46
|
+
function importBySku(_x) {
|
|
47
|
+
return _importBySku.apply(this, arguments);
|
|
48
|
+
}
|
|
49
|
+
return importBySku;
|
|
50
|
+
}()
|
|
51
|
+
}, {
|
|
52
|
+
key: "checkImportInfo",
|
|
53
|
+
value: function () {
|
|
54
|
+
var _checkImportInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(taskId) {
|
|
55
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
56
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
if (taskId) {
|
|
59
|
+
_context2.next = 2;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
return _context2.abrupt("return", Promise.reject(new Error('请输入 Task ID ')));
|
|
63
|
+
case 2:
|
|
64
|
+
return _context2.abrupt("return", ProductController.checkImportInfo({
|
|
65
|
+
task_id: taskId
|
|
66
|
+
}, {
|
|
67
|
+
apiKey: this.apiKeyInfo.apiKey,
|
|
68
|
+
apiId: this.apiKeyInfo.apiId
|
|
69
|
+
}));
|
|
70
|
+
case 3:
|
|
71
|
+
case "end":
|
|
72
|
+
return _context2.stop();
|
|
73
|
+
}
|
|
74
|
+
}, _callee2, this);
|
|
75
|
+
}));
|
|
76
|
+
function checkImportInfo(_x2) {
|
|
77
|
+
return _checkImportInfo.apply(this, arguments);
|
|
78
|
+
}
|
|
79
|
+
return checkImportInfo;
|
|
80
|
+
}()
|
|
81
|
+
}, {
|
|
82
|
+
key: "getListOfProducts",
|
|
83
|
+
value: function () {
|
|
84
|
+
var _getListOfProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(filter) {
|
|
85
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
86
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
return _context3.abrupt("return", ProductController.getListOfProducts({
|
|
89
|
+
filter: filter,
|
|
90
|
+
last_id: '',
|
|
91
|
+
limit: 1000
|
|
92
|
+
}, {
|
|
93
|
+
apiKey: this.apiKeyInfo.apiKey,
|
|
94
|
+
apiId: this.apiKeyInfo.apiId
|
|
95
|
+
}));
|
|
96
|
+
case 1:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context3.stop();
|
|
99
|
+
}
|
|
100
|
+
}, _callee3, this);
|
|
101
|
+
}));
|
|
102
|
+
function getListOfProducts(_x3) {
|
|
103
|
+
return _getListOfProducts.apply(this, arguments);
|
|
104
|
+
}
|
|
105
|
+
return getListOfProducts;
|
|
106
|
+
}() // 获取详细的
|
|
107
|
+
}, {
|
|
108
|
+
key: "getPlatformProductDetailList",
|
|
109
|
+
value: function () {
|
|
110
|
+
var _getPlatformProductDetailList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {
|
|
111
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
112
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
return _context4.abrupt("return", ProductController.getPlatformProductDetailList(query, {
|
|
115
|
+
apiKey: this.apiKeyInfo.apiKey,
|
|
116
|
+
apiId: this.apiKeyInfo.apiId
|
|
117
|
+
}));
|
|
118
|
+
case 1:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context4.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee4, this);
|
|
123
|
+
}));
|
|
124
|
+
function getPlatformProductDetailList(_x4) {
|
|
125
|
+
return _getPlatformProductDetailList.apply(this, arguments);
|
|
126
|
+
}
|
|
127
|
+
return getPlatformProductDetailList;
|
|
128
|
+
}()
|
|
129
|
+
}, {
|
|
130
|
+
key: "productImport",
|
|
131
|
+
value: function () {
|
|
132
|
+
var _productImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(query) {
|
|
133
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
134
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
135
|
+
case 0:
|
|
136
|
+
return _context5.abrupt("return", ProductController.productImport(query, {
|
|
137
|
+
apiKey: this.apiKeyInfo.apiKey,
|
|
138
|
+
apiId: this.apiKeyInfo.apiId
|
|
139
|
+
}));
|
|
140
|
+
case 1:
|
|
141
|
+
case "end":
|
|
142
|
+
return _context5.stop();
|
|
143
|
+
}
|
|
144
|
+
}, _callee5, this);
|
|
145
|
+
}));
|
|
146
|
+
function productImport(_x5) {
|
|
147
|
+
return _productImport.apply(this, arguments);
|
|
148
|
+
}
|
|
149
|
+
return productImport;
|
|
150
|
+
}()
|
|
151
|
+
}]);
|
|
152
|
+
return ProductClass;
|
|
153
|
+
}();
|
|
154
|
+
export default ProductClass;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function attribute(body: Category.AttributeQuery, options?: Global.RequestOptions): Promise<Category.AttributeApi>;
|
|
2
|
+
export declare function attributeValue(body: Category.AttributeValueQuery, options?: Global.RequestOptions): Promise<Category.AttributeValueApi>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
import request from "../../lib/Request";
|
|
11
|
+
export function attribute(_x, _x2) {
|
|
12
|
+
return _attribute.apply(this, arguments);
|
|
13
|
+
}
|
|
14
|
+
function _attribute() {
|
|
15
|
+
_attribute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
|
|
16
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
return _context.abrupt("return", request("/v1/description-category/attribute", _objectSpread({
|
|
20
|
+
method: 'POST',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json'
|
|
23
|
+
},
|
|
24
|
+
data: _objectSpread({}, body)
|
|
25
|
+
}, options || {})));
|
|
26
|
+
case 1:
|
|
27
|
+
case "end":
|
|
28
|
+
return _context.stop();
|
|
29
|
+
}
|
|
30
|
+
}, _callee);
|
|
31
|
+
}));
|
|
32
|
+
return _attribute.apply(this, arguments);
|
|
33
|
+
}
|
|
34
|
+
export function attributeValue(_x3, _x4) {
|
|
35
|
+
return _attributeValue.apply(this, arguments);
|
|
36
|
+
}
|
|
37
|
+
function _attributeValue() {
|
|
38
|
+
_attributeValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body, options) {
|
|
39
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
40
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
return _context2.abrupt("return", request("/v1/description-category/attribute", _objectSpread({
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: {
|
|
45
|
+
'Content-Type': 'application/json'
|
|
46
|
+
},
|
|
47
|
+
data: _objectSpread({}, body)
|
|
48
|
+
}, options || {})));
|
|
49
|
+
case 1:
|
|
50
|
+
case "end":
|
|
51
|
+
return _context2.stop();
|
|
52
|
+
}
|
|
53
|
+
}, _callee2);
|
|
54
|
+
}));
|
|
55
|
+
return _attributeValue.apply(this, arguments);
|
|
56
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function importBySku(body: Product.ImportBySkuQuery, options?: Global.RequestOptions): Promise<Product.ImportBySkuResult>;
|
|
2
|
+
export declare function checkImportInfo(body: {
|
|
3
|
+
task_id: number;
|
|
4
|
+
}, options?: Global.RequestOptions): Promise<Product.CheckImportInfoResult>;
|
|
5
|
+
export declare function getListOfProducts(body: Product.GetListOfProductsQuery, options?: Global.RequestOptions): Promise<Product.CheckImportInfoResult>;
|
|
6
|
+
export declare function getPlatformProductDetailList(body: Product.GetPlatformProductDetailListQuery, options?: Global.RequestOptions): Promise<Product.GetPlatformProductDetailList>;
|
|
7
|
+
export declare function productImport(body: Product.ProductImportQuery, options?: Global.RequestOptions): Promise<Product.ProductImportResult>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
import request from "../../lib/Request";
|
|
11
|
+
export function importBySku(_x, _x2) {
|
|
12
|
+
return _importBySku.apply(this, arguments);
|
|
13
|
+
}
|
|
14
|
+
function _importBySku() {
|
|
15
|
+
_importBySku = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
|
|
16
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
return _context.abrupt("return", request("/v1/product/import-by-sku", _objectSpread({
|
|
20
|
+
method: 'POST',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json'
|
|
23
|
+
},
|
|
24
|
+
data: _objectSpread({}, body)
|
|
25
|
+
}, options || {})));
|
|
26
|
+
case 1:
|
|
27
|
+
case "end":
|
|
28
|
+
return _context.stop();
|
|
29
|
+
}
|
|
30
|
+
}, _callee);
|
|
31
|
+
}));
|
|
32
|
+
return _importBySku.apply(this, arguments);
|
|
33
|
+
}
|
|
34
|
+
export function checkImportInfo(_x3, _x4) {
|
|
35
|
+
return _checkImportInfo.apply(this, arguments);
|
|
36
|
+
}
|
|
37
|
+
function _checkImportInfo() {
|
|
38
|
+
_checkImportInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body, options) {
|
|
39
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
40
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
return _context2.abrupt("return", request("/v1/product/import/info", _objectSpread({
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: {
|
|
45
|
+
'Content-Type': 'application/json'
|
|
46
|
+
},
|
|
47
|
+
data: _objectSpread({}, body)
|
|
48
|
+
}, options || {})));
|
|
49
|
+
case 1:
|
|
50
|
+
case "end":
|
|
51
|
+
return _context2.stop();
|
|
52
|
+
}
|
|
53
|
+
}, _callee2);
|
|
54
|
+
}));
|
|
55
|
+
return _checkImportInfo.apply(this, arguments);
|
|
56
|
+
}
|
|
57
|
+
export function getListOfProducts(_x5, _x6) {
|
|
58
|
+
return _getListOfProducts.apply(this, arguments);
|
|
59
|
+
}
|
|
60
|
+
function _getListOfProducts() {
|
|
61
|
+
_getListOfProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(body, options) {
|
|
62
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
63
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
64
|
+
case 0:
|
|
65
|
+
return _context3.abrupt("return", request("/v3/product/list", _objectSpread({
|
|
66
|
+
method: 'POST',
|
|
67
|
+
headers: {
|
|
68
|
+
'Content-Type': 'application/json'
|
|
69
|
+
},
|
|
70
|
+
data: _objectSpread({}, body)
|
|
71
|
+
}, options || {})));
|
|
72
|
+
case 1:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context3.stop();
|
|
75
|
+
}
|
|
76
|
+
}, _callee3);
|
|
77
|
+
}));
|
|
78
|
+
return _getListOfProducts.apply(this, arguments);
|
|
79
|
+
}
|
|
80
|
+
export function getPlatformProductDetailList(_x7, _x8) {
|
|
81
|
+
return _getPlatformProductDetailList.apply(this, arguments);
|
|
82
|
+
}
|
|
83
|
+
function _getPlatformProductDetailList() {
|
|
84
|
+
_getPlatformProductDetailList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(body, options) {
|
|
85
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
86
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
return _context4.abrupt("return", request("/v3/product/info/list", _objectSpread({
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: {
|
|
91
|
+
'Content-Type': 'application/json'
|
|
92
|
+
},
|
|
93
|
+
data: _objectSpread({}, body)
|
|
94
|
+
}, options || {})));
|
|
95
|
+
case 1:
|
|
96
|
+
case "end":
|
|
97
|
+
return _context4.stop();
|
|
98
|
+
}
|
|
99
|
+
}, _callee4);
|
|
100
|
+
}));
|
|
101
|
+
return _getPlatformProductDetailList.apply(this, arguments);
|
|
102
|
+
}
|
|
103
|
+
export function productImport(_x9, _x10) {
|
|
104
|
+
return _productImport.apply(this, arguments);
|
|
105
|
+
}
|
|
106
|
+
function _productImport() {
|
|
107
|
+
_productImport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(body, options) {
|
|
108
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
109
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
110
|
+
case 0:
|
|
111
|
+
return _context5.abrupt("return", request("/v3/product/import", _objectSpread({
|
|
112
|
+
method: 'POST',
|
|
113
|
+
headers: {
|
|
114
|
+
'Content-Type': 'application/json'
|
|
115
|
+
},
|
|
116
|
+
data: _objectSpread({}, body)
|
|
117
|
+
}, options || {})));
|
|
118
|
+
case 1:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context5.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee5);
|
|
123
|
+
}));
|
|
124
|
+
return _productImport.apply(this, arguments);
|
|
125
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare namespace Category {
|
|
2
|
+
interface AttributeQuery {
|
|
3
|
+
description_category_id: number;
|
|
4
|
+
type_id: number;
|
|
5
|
+
language: Global.ApiLanguage;
|
|
6
|
+
}
|
|
7
|
+
type AttributeType = 'Decimal' | 'String' | 'URL' | 'Integer';
|
|
8
|
+
interface Attribute {
|
|
9
|
+
"id": number;
|
|
10
|
+
"attribute_complex_id": number;
|
|
11
|
+
"name": string;
|
|
12
|
+
"description": string;
|
|
13
|
+
"type": AttributeType;
|
|
14
|
+
"is_collection": boolean;
|
|
15
|
+
"is_required": boolean;
|
|
16
|
+
"is_aspect": boolean;
|
|
17
|
+
"max_value_count": number;
|
|
18
|
+
"group_name": string;
|
|
19
|
+
"group_id": number;
|
|
20
|
+
"dictionary_id": number;
|
|
21
|
+
"category_dependent": boolean;
|
|
22
|
+
"complex_is_collection": boolean;
|
|
23
|
+
}
|
|
24
|
+
interface AttributeApi {
|
|
25
|
+
result: Attribute[];
|
|
26
|
+
success?: boolean;
|
|
27
|
+
message?: string;
|
|
28
|
+
}
|
|
29
|
+
interface AttributeValueQuery {
|
|
30
|
+
description_category_id: number;
|
|
31
|
+
type_id: number;
|
|
32
|
+
attribute_id: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
last_value_id: number;
|
|
35
|
+
language: Global.ApiLanguage;
|
|
36
|
+
}
|
|
37
|
+
interface AttributeValueApi {
|
|
38
|
+
has_next: boolean;
|
|
39
|
+
result: AttributeValue[];
|
|
40
|
+
success?: boolean;
|
|
41
|
+
message?: string;
|
|
42
|
+
}
|
|
43
|
+
interface AttributeValue {
|
|
44
|
+
"id": number;
|
|
45
|
+
"info": string;
|
|
46
|
+
"picture": string;
|
|
47
|
+
"value": string;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
declare namespace Product {
|
|
2
|
+
interface ImportBySkuQuery {
|
|
3
|
+
items: ImportBySkuQueryItems[];
|
|
4
|
+
}
|
|
5
|
+
interface ImportBySkuQueryItems {
|
|
6
|
+
name?: string;
|
|
7
|
+
offer_id?: string;
|
|
8
|
+
old_price?: string;
|
|
9
|
+
price?: string;
|
|
10
|
+
sku: number;
|
|
11
|
+
vat?: string;
|
|
12
|
+
currency_code?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ImportBySkuResult {
|
|
15
|
+
code?: number;
|
|
16
|
+
message?: string;
|
|
17
|
+
result?: {
|
|
18
|
+
task_id: number;
|
|
19
|
+
unmatched_sku_list?: number[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface CheckImportInfoResult {
|
|
23
|
+
code?: number;
|
|
24
|
+
message?: string;
|
|
25
|
+
"result"?: {
|
|
26
|
+
"items": {
|
|
27
|
+
"offer_id": string;
|
|
28
|
+
"product_id": number;
|
|
29
|
+
"status": 'failed' | 'imported';
|
|
30
|
+
"errors": {
|
|
31
|
+
"code": "offer_id_invalid";
|
|
32
|
+
"field": "offer_id";
|
|
33
|
+
"attribute_id": number;
|
|
34
|
+
"state": "new";
|
|
35
|
+
"level": "error";
|
|
36
|
+
"description": string;
|
|
37
|
+
"attribute_name": "";
|
|
38
|
+
"message": string;
|
|
39
|
+
}[];
|
|
40
|
+
}[];
|
|
41
|
+
"total": number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface GetListOfProductsQuery {
|
|
45
|
+
filter: GetListOfProductsQueryFilter;
|
|
46
|
+
last_id: string;
|
|
47
|
+
limit: number;
|
|
48
|
+
}
|
|
49
|
+
interface GetListOfProductsQueryFilter {
|
|
50
|
+
offer_id: string[];
|
|
51
|
+
product_id: number[];
|
|
52
|
+
visibility: string;
|
|
53
|
+
}
|
|
54
|
+
interface GetPlatformProductDetailListQuery {
|
|
55
|
+
offer_id: string[];
|
|
56
|
+
product_id: number[];
|
|
57
|
+
sku: number[];
|
|
58
|
+
}
|
|
59
|
+
interface GetPlatformProductDetailList {
|
|
60
|
+
"items": {
|
|
61
|
+
"availabilities": {
|
|
62
|
+
"availability": string;
|
|
63
|
+
"reasons": {
|
|
64
|
+
"human_text": {
|
|
65
|
+
"text": string;
|
|
66
|
+
};
|
|
67
|
+
"id": number;
|
|
68
|
+
}[];
|
|
69
|
+
"sku": number;
|
|
70
|
+
"source": string;
|
|
71
|
+
}[];
|
|
72
|
+
"barcodes": string[];
|
|
73
|
+
"color_image": string[];
|
|
74
|
+
"commissions": {
|
|
75
|
+
"delivery_amount": number;
|
|
76
|
+
"percent": number;
|
|
77
|
+
"return_amount": number;
|
|
78
|
+
"sale_schema": string;
|
|
79
|
+
"value": number;
|
|
80
|
+
}[];
|
|
81
|
+
"created_at": string;
|
|
82
|
+
"currency_code": string;
|
|
83
|
+
"description_category_id": number;
|
|
84
|
+
"discounted_fbo_stocks": number;
|
|
85
|
+
"errors": {
|
|
86
|
+
"attribute_id": 0;
|
|
87
|
+
"code": string;
|
|
88
|
+
"field": string;
|
|
89
|
+
"level": "ERROR_LEVEL_UNSPECIFIED";
|
|
90
|
+
"state": string;
|
|
91
|
+
"texts": {
|
|
92
|
+
"attribute_name": string;
|
|
93
|
+
"description": string;
|
|
94
|
+
"hint_code": string;
|
|
95
|
+
"message": string;
|
|
96
|
+
"params": [
|
|
97
|
+
{
|
|
98
|
+
"name": string;
|
|
99
|
+
"value": string;
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
"short_description": string;
|
|
103
|
+
};
|
|
104
|
+
}[];
|
|
105
|
+
"has_discounted_fbo_item": boolean;
|
|
106
|
+
"id": number;
|
|
107
|
+
"images": string[];
|
|
108
|
+
"images360": string[];
|
|
109
|
+
"is_archived": boolean;
|
|
110
|
+
"is_autoarchived": boolean;
|
|
111
|
+
"is_discounted": boolean;
|
|
112
|
+
"is_kgt": boolean;
|
|
113
|
+
"is_prepayment_allowed": boolean;
|
|
114
|
+
"is_super": boolean;
|
|
115
|
+
"min_price": string;
|
|
116
|
+
"model_info": {
|
|
117
|
+
"count": number;
|
|
118
|
+
"model_id": number;
|
|
119
|
+
};
|
|
120
|
+
"name": string;
|
|
121
|
+
"offer_id": string;
|
|
122
|
+
"old_price": string;
|
|
123
|
+
"price": string;
|
|
124
|
+
"price_indexes": {
|
|
125
|
+
"color_index": "COLOR_INDEX_UNSPECIFIED";
|
|
126
|
+
"external_index_data": {
|
|
127
|
+
"minimal_price": string;
|
|
128
|
+
"minimal_price_currency": string;
|
|
129
|
+
"price_index_value": 0;
|
|
130
|
+
};
|
|
131
|
+
"ozon_index_data": {
|
|
132
|
+
"minimal_price": string;
|
|
133
|
+
"minimal_price_currency": string;
|
|
134
|
+
"price_index_value": number;
|
|
135
|
+
};
|
|
136
|
+
"self_marketplaces_index_data": {
|
|
137
|
+
"minimal_price": string;
|
|
138
|
+
"minimal_price_currency": string;
|
|
139
|
+
"price_index_value": number;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
"primary_image": string[];
|
|
143
|
+
"promotions": {
|
|
144
|
+
"is_enabled": boolean;
|
|
145
|
+
"type": "UNSPECIFIED";
|
|
146
|
+
}[];
|
|
147
|
+
"sku": number;
|
|
148
|
+
"sources": {
|
|
149
|
+
"created_at": string;
|
|
150
|
+
"quant_code": string;
|
|
151
|
+
"shipment_type": "SHIPMENT_TYPE_UNSPECIFIED";
|
|
152
|
+
"sku": number;
|
|
153
|
+
"source": string;
|
|
154
|
+
}[];
|
|
155
|
+
"statuses": {
|
|
156
|
+
"is_created": boolean;
|
|
157
|
+
"moderate_status": string;
|
|
158
|
+
"status": string;
|
|
159
|
+
"status_description": string;
|
|
160
|
+
"status_failed": string;
|
|
161
|
+
"status_name": string;
|
|
162
|
+
"status_tooltip": string;
|
|
163
|
+
"status_updated_at": string;
|
|
164
|
+
"validation_status": string;
|
|
165
|
+
};
|
|
166
|
+
"stocks": {
|
|
167
|
+
"has_stock": boolean;
|
|
168
|
+
"stocks": {
|
|
169
|
+
"present": number;
|
|
170
|
+
"reserved": number;
|
|
171
|
+
"sku": number;
|
|
172
|
+
"source": string;
|
|
173
|
+
}[];
|
|
174
|
+
};
|
|
175
|
+
"type_id": number;
|
|
176
|
+
"updated_at": string;
|
|
177
|
+
"vat": string;
|
|
178
|
+
"visibility_details": {
|
|
179
|
+
"has_price": boolean;
|
|
180
|
+
"has_stock": boolean;
|
|
181
|
+
};
|
|
182
|
+
"volume_weight": number;
|
|
183
|
+
}[];
|
|
184
|
+
}
|
|
185
|
+
interface ProductImportQuery {
|
|
186
|
+
items: ProductImportQueryItems[];
|
|
187
|
+
}
|
|
188
|
+
interface ProductImportQueryItems {
|
|
189
|
+
attributes: [];
|
|
190
|
+
}
|
|
191
|
+
interface ProductImportResult {
|
|
192
|
+
}
|
|
193
|
+
}
|