@longvansoftware/storefront-js-client 3.5.3 → 3.5.4

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.
@@ -18,3 +18,4 @@ export declare const UPDATE_PRODUCT_VAT: import("graphql").DocumentNode;
18
18
  export declare const CREATE_GROUP: import("graphql").DocumentNode;
19
19
  export declare const CREATE_CATEGORY: import("graphql").DocumentNode;
20
20
  export declare const CREATE_BRAND: import("graphql").DocumentNode;
21
+ export declare const CREATE_UNIT: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_BRAND = exports.CREATE_CATEGORY = exports.CREATE_GROUP = exports.UPDATE_PRODUCT_VAT = exports.UPDATE_PRODUCT_SKU = exports.CREATE_PRODUCT_VARIANT = exports.REMOVE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_BRAND = exports.SAVE_PRODUCT_DRAFT = exports.ADD_PRODUCT_ATTRIBUTE = exports.CREATE_PRODUCT_FROM_TEMPLATE = exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = exports.CLEAR_ALL_CACHES = exports.UPDATE_UNIT = exports.UPDATE_SHORT_DESCRIPTION = exports.UPDATE_CATEGORY = exports.UPDATE_PRICE_PROMOTION = exports.UPDATE_PRICE = exports.UPDATE_PRODUCT_TITLE = void 0;
3
+ exports.CREATE_UNIT = exports.CREATE_BRAND = exports.CREATE_CATEGORY = exports.CREATE_GROUP = exports.UPDATE_PRODUCT_VAT = exports.UPDATE_PRODUCT_SKU = exports.CREATE_PRODUCT_VARIANT = exports.REMOVE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_BRAND = exports.SAVE_PRODUCT_DRAFT = exports.ADD_PRODUCT_ATTRIBUTE = exports.CREATE_PRODUCT_FROM_TEMPLATE = exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = exports.CLEAR_ALL_CACHES = exports.UPDATE_UNIT = exports.UPDATE_SHORT_DESCRIPTION = exports.UPDATE_CATEGORY = exports.UPDATE_PRICE_PROMOTION = exports.UPDATE_PRICE = exports.UPDATE_PRODUCT_TITLE = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.UPDATE_PRODUCT_TITLE = (0, graphql_tag_1.gql) `
6
6
  mutation UpdateProductTitle(
@@ -338,32 +338,27 @@ exports.CREATE_PRODUCT_VARIANT = (0, graphql_tag_1.gql) `
338
338
  $attributes: [AttributeDTOInput]
339
339
  ) {
340
340
  createProductVariant(partnerId: $partnerId, attributes: $attributes) {
341
- id
342
341
  title
343
- subType
344
- description
345
342
  sku
346
- shortDescription
343
+ partyId
347
344
  vat
348
- parentId
349
- handle
350
- price
351
- displayPrice
352
- hint
353
- compareAtPrices
354
- priceUnit
355
- priceQuantity
356
- priceType
357
- salePolicy
358
- priceTypeName
345
+ unit
346
+ version
347
+ status
348
+ display
349
+ qualify
350
+ subType
351
+ type
352
+ templateFor
353
+ isDraft
359
354
  slug
360
- supplierIds
361
355
  categoryIds
362
356
  productGroupIds
363
357
  tagIds
364
358
  featureIds
365
359
  brandId
366
- unit
360
+ variant
361
+ parentId
367
362
  }
368
363
  }
369
364
  `;
@@ -449,3 +444,11 @@ exports.CREATE_BRAND = (0, graphql_tag_1.gql) `
449
444
  }
450
445
  }
451
446
  `;
447
+ exports.CREATE_UNIT = (0, graphql_tag_1.gql) `
448
+ mutation CreateUnit($partnerId: String!, $name: String!) {
449
+ createUnit(partnerId: $partnerId, name: $name) {
450
+ id
451
+ name
452
+ }
453
+ }
454
+ `;
@@ -65,5 +65,6 @@ export declare class ProductService extends Service {
65
65
  updateProductVAT(productId: string, vat: number, updatedBy: string): Promise<any>;
66
66
  createGroup(name: string, createdBy: string): Promise<any>;
67
67
  createCategory(name: string, createdBy: string): Promise<any>;
68
- createBrand(brandName: string, createBy: string): Promise<any>;
68
+ createBrand(brandName: string, createdBy: string): Promise<any>;
69
+ createUnit(name: string): Promise<any>;
69
70
  }
@@ -648,13 +648,13 @@ class ProductService extends serviceSDK_1.Service {
648
648
  }
649
649
  });
650
650
  }
651
- createBrand(brandName, createBy) {
651
+ createBrand(brandName, createdBy) {
652
652
  return __awaiter(this, void 0, void 0, function* () {
653
653
  const mutaion = mutations_1.CREATE_BRAND;
654
654
  const variables = {
655
655
  partnerId: this.orgId,
656
656
  brandName,
657
- createBy,
657
+ createdBy,
658
658
  };
659
659
  try {
660
660
  const response = yield this.graphqlMutation(mutaion, variables);
@@ -665,5 +665,21 @@ class ProductService extends serviceSDK_1.Service {
665
665
  }
666
666
  });
667
667
  }
668
+ createUnit(name) {
669
+ return __awaiter(this, void 0, void 0, function* () {
670
+ const mutation = mutations_1.CREATE_UNIT;
671
+ const variables = {
672
+ partnerId: this.orgId,
673
+ name
674
+ };
675
+ try {
676
+ const response = yield this.graphqlMutation(mutation, variables);
677
+ return response.createUnit;
678
+ }
679
+ catch (error) {
680
+ throw error;
681
+ }
682
+ });
683
+ }
668
684
  }
669
685
  exports.ProductService = ProductService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [