ozon-api 0.0.5 → 0.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.
@@ -37,7 +37,7 @@ var requestApi = /*#__PURE__*/function () {
37
37
  }
38
38
  optionDomain = options.domain || '';
39
39
  optionDomain = optionDomain.match(/\/$/) ? optionDomain : optionDomain + '/';
40
- url = optionDomain + api;
40
+ url = optionDomain + (api.indexOf('/') === 0 ? api.replace('/', '') : api);
41
41
  headers = options.headers || {};
42
42
  if (!/^https?:/.test(url)) {
43
43
  _context.next = 10;
@@ -1,5 +1,6 @@
1
+ import { Category } from "../../types/Category";
1
2
  declare class CategoryClass {
2
- private apiKeyInfo;
3
+ private readonly apiKeyInfo;
3
4
  constructor(apiId: string, apiKey: string);
4
5
  attribute(description_category_id: number, type_id: number, language?: Global.ApiLanguage): Promise<Category.Attribute[]>;
5
6
  attributeValue(description_category_id: number, type_id: number, attribute_id: number, language?: Global.ApiLanguage): Promise<Category.AttributeValue[]>;
@@ -123,7 +123,7 @@ var CategoryClass = /*#__PURE__*/function () {
123
123
  }
124
124
  return _context4.abrupt("return", Promise.reject(new Error('请输入 typeId')));
125
125
  case 5:
126
- if (type_id) {
126
+ if (attribute_id) {
127
127
  _context4.next = 7;
128
128
  break;
129
129
  }
@@ -1,5 +1,6 @@
1
+ import { Product } from "../../types/Product";
1
2
  declare class ProductClass {
2
- private apiKeyInfo;
3
+ private readonly apiKeyInfo;
3
4
  constructor(apiId: string, apiKey: string);
4
5
  importBySku(query: Product.ImportBySkuQuery): Promise<Product.ImportBySkuResult>;
5
6
  checkImportInfo(taskId: number): Promise<Product.CheckImportInfoResult>;
@@ -1,2 +1,3 @@
1
+ import { Category } from "../../types/Category";
1
2
  export declare function attribute(body: Category.AttributeQuery, options?: Global.RequestOptions): Promise<Category.AttributeApi>;
2
3
  export declare function attributeValue(body: Category.AttributeValueQuery, options?: Global.RequestOptions): Promise<Category.AttributeValueApi>;
@@ -39,7 +39,7 @@ function _attributeValue() {
39
39
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
40
40
  while (1) switch (_context2.prev = _context2.next) {
41
41
  case 0:
42
- return _context2.abrupt("return", request("/v1/description-category/attribute", _objectSpread({
42
+ return _context2.abrupt("return", request("/v1/description-category/attribute/values", _objectSpread({
43
43
  method: 'POST',
44
44
  headers: {
45
45
  'Content-Type': 'application/json'
@@ -1,3 +1,4 @@
1
+ import { Product } from "../../types/Product";
1
2
  export declare function importBySku(body: Product.ImportBySkuQuery, options?: Global.RequestOptions): Promise<Product.ImportBySkuResult>;
2
3
  export declare function checkImportInfo(body: {
3
4
  task_id: number;
@@ -1,4 +1,4 @@
1
- declare namespace Category {
1
+ export declare namespace Category {
2
2
  interface AttributeQuery {
3
3
  description_category_id: number;
4
4
  type_id: number;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- declare namespace Product {
1
+ export declare namespace Product {
2
2
  interface ImportBySkuQuery {
3
3
  items: ImportBySkuQueryItems[];
4
4
  }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ozon-api",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "OZON API",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",