@pintahub/shopify-api 2.2.8 → 2.2.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.
@@ -1,13 +1,8 @@
1
1
  import { AdminApiClient } from "@shopify/admin-api-client/dist/ts/graphql/types";
2
2
  import { ActionBuilder } from "../../ActionBuilder";
3
+ import { ProductCreateInput } from "../../../input/ProductCreateInput";
3
4
  export interface CreateProductInput extends Record<string, any> {
4
- title: string;
5
- descriptionHtml?: string;
6
- status?: string;
7
- tags?: string | Array<string>;
8
- productType?: string;
9
- options?: Array<string>;
10
- variants?: Array<Record<string, any>>;
5
+ product: ProductCreateInput;
11
6
  }
12
7
  export interface CreateProductOutput extends Record<string, any> {
13
8
  }
@@ -16,8 +16,8 @@ class CreateProduct extends ActionBuilder_1.ActionBuilder {
16
16
  run(args) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  const query = `
19
- mutation productCreate($input: ProductInput!) {
20
- productCreate(input: $input) {
19
+ mutation productCreate($product: ProductCreateInput!) {
20
+ productCreate(product: $product) {
21
21
  product {
22
22
  id
23
23
  title
@@ -34,9 +34,7 @@ class CreateProduct extends ActionBuilder_1.ActionBuilder {
34
34
  }
35
35
  `;
36
36
  const result = yield this.client.request(query, {
37
- variables: {
38
- input: args
39
- }
37
+ variables: args,
40
38
  });
41
39
  const { data, errors } = Object.assign({}, result);
42
40
  yield (0, handleErrors_1.handleErrors)(errors);
@@ -21,7 +21,7 @@ const DeleteProduct_1 = require("./DeleteProduct");
21
21
  const UpdateProductOption_1 = require("./UpdateProductOption");
22
22
  const GetProductOptions_1 = require("./GetProductOptions");
23
23
  const ReorderMedia_1 = require("./ReorderMedia");
24
- const CreateProduct_1 = require("../products/CreateProduct");
24
+ const CreateProduct_1 = require("./CreateProduct");
25
25
  class AdminProductsAPI extends APIBase_1.APIBase {
26
26
  _runAction(Action, args) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
@@ -0,0 +1,6 @@
1
+ export interface ProductCreateInput extends Record<string, any> {
2
+ title?: string;
3
+ productType?: string;
4
+ handle?: string;
5
+ status?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pintahub/shopify-api",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",