@pintahub/shopify-api 1.3.7 → 1.3.9

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.
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateProduct = void 0;
13
13
  const ActionBuilder_1 = require("../../ActionBuilder");
14
+ const handleErrors_1 = require("../../../utils/handleErrors");
14
15
  class CreateProduct extends ActionBuilder_1.ActionBuilder {
15
16
  run(args) {
16
17
  return __awaiter(this, void 0, void 0, function* () {
@@ -19,6 +20,11 @@ class CreateProduct extends ActionBuilder_1.ActionBuilder {
19
20
  productCreate(input: $input) {
20
21
  product {
21
22
  id
23
+ title
24
+ handle
25
+ status
26
+ productType
27
+ vendor
22
28
  }
23
29
  userErrors {
24
30
  field
@@ -32,8 +38,11 @@ class CreateProduct extends ActionBuilder_1.ActionBuilder {
32
38
  input: args
33
39
  }
34
40
  });
35
- console.log('result', JSON.stringify(result, null, 2));
36
- return {};
41
+ const { data, errors } = Object.assign({}, result);
42
+ yield (0, handleErrors_1.handleErrors)(errors);
43
+ const { productCreate } = data;
44
+ const { product } = Object.assign({}, productCreate);
45
+ return Object.assign({}, product);
37
46
  });
38
47
  }
39
48
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateProductMedia = void 0;
13
13
  const ActionBuilder_1 = require("../../ActionBuilder");
14
14
  const getGlobalID_1 = require("../../../utils/getGlobalID");
15
+ const handleErrors_1 = require("../../../utils/handleErrors");
15
16
  class CreateProductMedia extends ActionBuilder_1.ActionBuilder {
16
17
  run(args) {
17
18
  return __awaiter(this, void 0, void 0, function* () {
@@ -37,11 +38,12 @@ class CreateProductMedia extends ActionBuilder_1.ActionBuilder {
37
38
  const result = yield this.client.request(query, {
38
39
  variables: {
39
40
  productId: gId,
40
- media,
41
+ media
41
42
  }
42
43
  });
43
- console.log('result', JSON.stringify(result, null, 2));
44
- return {};
44
+ const { data, errors } = Object.assign({}, result);
45
+ yield (0, handleErrors_1.handleErrors)(errors);
46
+ return data;
45
47
  });
46
48
  }
47
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pintahub/shopify-api",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "description": "",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",