@longvansoftware/storefront-js-client 4.5.5 → 4.5.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.
- package/dist/src/graphql/product/mutations.d.ts +1 -0
- package/dist/src/graphql/product/mutations.js +19 -1
- package/dist/src/graphql/product/queries.d.ts +2 -0
- package/dist/src/graphql/product/queries.js +148 -1
- package/dist/src/lib/product/index.d.ts +3 -0
- package/dist/src/lib/product/index.js +46 -0
- package/package.json +1 -1
|
@@ -31,3 +31,4 @@ export declare const UPDATE_ATTRIBUTE_METADATA: import("graphql").DocumentNode;
|
|
|
31
31
|
export declare const CREATE_TAG: import("graphql").DocumentNode;
|
|
32
32
|
export declare const ADD_PRODUCT_TAG: import("graphql").DocumentNode;
|
|
33
33
|
export declare const REMOVE_PRODUCT_TAG: import("graphql").DocumentNode;
|
|
34
|
+
export declare const PUBLIC_PRODUCT: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REMOVE_PRODUCT_TAG = exports.ADD_PRODUCT_TAG = exports.CREATE_TAG = exports.UPDATE_ATTRIBUTE_METADATA = exports.UPDATE_PRODUCT_SUBTYPE = exports.REMOVE_PRODUCT = exports.CREATE_PRODUCT = exports.REMOVE_IMAGE = exports.REMOVE_PRODUCT_IMAGES = exports.BUILD_PRODUCT_PREBUILD_BY_STORE = exports.BUILD_PRODUCT_PREBUILD_BY_PRODUCT = exports.CREATE_PRODUCT_IMAGES = 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;
|
|
3
|
+
exports.PUBLIC_PRODUCT = exports.REMOVE_PRODUCT_TAG = exports.ADD_PRODUCT_TAG = exports.CREATE_TAG = exports.UPDATE_ATTRIBUTE_METADATA = exports.UPDATE_PRODUCT_SUBTYPE = exports.REMOVE_PRODUCT = exports.CREATE_PRODUCT = exports.REMOVE_IMAGE = exports.REMOVE_PRODUCT_IMAGES = exports.BUILD_PRODUCT_PREBUILD_BY_STORE = exports.BUILD_PRODUCT_PREBUILD_BY_PRODUCT = exports.CREATE_PRODUCT_IMAGES = 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(
|
|
@@ -752,3 +752,21 @@ exports.REMOVE_PRODUCT_TAG = (0, graphql_tag_1.gql) `
|
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
`;
|
|
755
|
+
exports.PUBLIC_PRODUCT = (0, graphql_tag_1.gql) `
|
|
756
|
+
mutation PublicProduct(
|
|
757
|
+
$storeId: String!
|
|
758
|
+
$productId: String!
|
|
759
|
+
$isPublic: Boolean!
|
|
760
|
+
$updatedBy: String!
|
|
761
|
+
) {
|
|
762
|
+
publicProduct(
|
|
763
|
+
storeId: $storeId
|
|
764
|
+
productId: $productId
|
|
765
|
+
isPublic: $isPublic
|
|
766
|
+
updatedBy: $updatedBy
|
|
767
|
+
) {
|
|
768
|
+
status
|
|
769
|
+
message
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
`;
|
|
@@ -25,3 +25,5 @@ export declare const GET_CATEGORY_BY_ID: import("graphql").DocumentNode;
|
|
|
25
25
|
export declare const GET_CATEGORY_BY_HANDLE: import("graphql").DocumentNode;
|
|
26
26
|
export declare const GET_TAGS_BY_PRODUCT: import("graphql").DocumentNode;
|
|
27
27
|
export declare const GET_PRODUCT_STORE_BY_SCOPE: import("graphql").DocumentNode;
|
|
28
|
+
export declare const GET_PRODUCT_STORE_PUBLIC: import("graphql").DocumentNode;
|
|
29
|
+
export declare const GET_PRODUCT_MARKET_PLACE: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PRODUCT_STORE_BY_SCOPE = exports.GET_TAGS_BY_PRODUCT = exports.GET_CATEGORY_BY_HANDLE = exports.GET_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_SIMPLE_PRODUCT_BY_ID_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
3
|
+
exports.GET_PRODUCT_MARKET_PLACE = exports.GET_PRODUCT_STORE_PUBLIC = exports.GET_PRODUCT_STORE_BY_SCOPE = exports.GET_TAGS_BY_PRODUCT = exports.GET_CATEGORY_BY_HANDLE = exports.GET_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_SIMPLE_PRODUCT_BY_ID_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
// export const GET_PRODUCT_BY_ID_QUERY = gql`
|
|
6
6
|
// query GetProductById(
|
|
@@ -1210,6 +1210,17 @@ exports.GET_PRODUCT_STORE_BY_SCOPE = (0, graphql_tag_1.gql) `
|
|
|
1210
1210
|
phone
|
|
1211
1211
|
address
|
|
1212
1212
|
footer
|
|
1213
|
+
description
|
|
1214
|
+
slug
|
|
1215
|
+
logo
|
|
1216
|
+
banner
|
|
1217
|
+
ward
|
|
1218
|
+
wardId
|
|
1219
|
+
province
|
|
1220
|
+
provinceId
|
|
1221
|
+
showLogo
|
|
1222
|
+
showBanner
|
|
1223
|
+
showMap
|
|
1213
1224
|
showInfoStore
|
|
1214
1225
|
showBarcode
|
|
1215
1226
|
showFooter
|
|
@@ -1219,3 +1230,139 @@ exports.GET_PRODUCT_STORE_BY_SCOPE = (0, graphql_tag_1.gql) `
|
|
|
1219
1230
|
}
|
|
1220
1231
|
}
|
|
1221
1232
|
`;
|
|
1233
|
+
exports.GET_PRODUCT_STORE_PUBLIC = (0, graphql_tag_1.gql) `
|
|
1234
|
+
query GetProductStorePublic($productId: String!, $isPublic: Boolean!) {
|
|
1235
|
+
getProductStorePublic(productId: $productId, isPublic: $isPublic)
|
|
1236
|
+
}
|
|
1237
|
+
`;
|
|
1238
|
+
exports.GET_PRODUCT_MARKET_PLACE = (0, graphql_tag_1.gql) `
|
|
1239
|
+
query GetProductMarketplace(
|
|
1240
|
+
$storeChannel: String!
|
|
1241
|
+
$supplierId: String
|
|
1242
|
+
$categoryId: String
|
|
1243
|
+
$productId: String
|
|
1244
|
+
) {
|
|
1245
|
+
getProductMarketplace(
|
|
1246
|
+
storeChannel: $storeChannel
|
|
1247
|
+
supplierId: $supplierId
|
|
1248
|
+
categoryId: $categoryId
|
|
1249
|
+
productId: $productId
|
|
1250
|
+
) {
|
|
1251
|
+
total
|
|
1252
|
+
currentPage
|
|
1253
|
+
maxResult
|
|
1254
|
+
totalPage
|
|
1255
|
+
data {
|
|
1256
|
+
id
|
|
1257
|
+
title
|
|
1258
|
+
subType
|
|
1259
|
+
description
|
|
1260
|
+
sku
|
|
1261
|
+
shortDescription
|
|
1262
|
+
weight
|
|
1263
|
+
width
|
|
1264
|
+
depth
|
|
1265
|
+
height
|
|
1266
|
+
vat
|
|
1267
|
+
qualify
|
|
1268
|
+
parentId
|
|
1269
|
+
handle
|
|
1270
|
+
price
|
|
1271
|
+
displayPrice
|
|
1272
|
+
hint
|
|
1273
|
+
compareAtPrices
|
|
1274
|
+
priceUnit
|
|
1275
|
+
priceQuantity
|
|
1276
|
+
priceType
|
|
1277
|
+
salePolicy
|
|
1278
|
+
priceTypeName
|
|
1279
|
+
priceVaries
|
|
1280
|
+
available
|
|
1281
|
+
options
|
|
1282
|
+
optionsRelationship
|
|
1283
|
+
compareAtPrice
|
|
1284
|
+
featuredImage
|
|
1285
|
+
version
|
|
1286
|
+
images
|
|
1287
|
+
tags {
|
|
1288
|
+
id
|
|
1289
|
+
name
|
|
1290
|
+
slug
|
|
1291
|
+
type
|
|
1292
|
+
scope
|
|
1293
|
+
storeIds
|
|
1294
|
+
selected
|
|
1295
|
+
}
|
|
1296
|
+
featureTypes {
|
|
1297
|
+
id
|
|
1298
|
+
keyId
|
|
1299
|
+
name
|
|
1300
|
+
position
|
|
1301
|
+
type
|
|
1302
|
+
subType
|
|
1303
|
+
fill
|
|
1304
|
+
requireData
|
|
1305
|
+
otherItem
|
|
1306
|
+
values
|
|
1307
|
+
description
|
|
1308
|
+
createStamp
|
|
1309
|
+
createdBy
|
|
1310
|
+
usedCreatedChild
|
|
1311
|
+
}
|
|
1312
|
+
variants {
|
|
1313
|
+
id
|
|
1314
|
+
handle
|
|
1315
|
+
title
|
|
1316
|
+
price
|
|
1317
|
+
priceType
|
|
1318
|
+
compareAtPrice
|
|
1319
|
+
options
|
|
1320
|
+
optionsIds
|
|
1321
|
+
featuredImage
|
|
1322
|
+
sku
|
|
1323
|
+
}
|
|
1324
|
+
categories {
|
|
1325
|
+
id
|
|
1326
|
+
title
|
|
1327
|
+
image
|
|
1328
|
+
icon
|
|
1329
|
+
parentId
|
|
1330
|
+
level
|
|
1331
|
+
handle
|
|
1332
|
+
description
|
|
1333
|
+
}
|
|
1334
|
+
groups {
|
|
1335
|
+
id
|
|
1336
|
+
name
|
|
1337
|
+
policy
|
|
1338
|
+
image
|
|
1339
|
+
resourceId
|
|
1340
|
+
resourceType
|
|
1341
|
+
scope
|
|
1342
|
+
}
|
|
1343
|
+
attributeDTOS {
|
|
1344
|
+
id
|
|
1345
|
+
key
|
|
1346
|
+
keyId
|
|
1347
|
+
extendFromSource
|
|
1348
|
+
}
|
|
1349
|
+
productAttributes {
|
|
1350
|
+
attributeName
|
|
1351
|
+
attributeValue
|
|
1352
|
+
}
|
|
1353
|
+
unitDTO {
|
|
1354
|
+
id
|
|
1355
|
+
name
|
|
1356
|
+
}
|
|
1357
|
+
brand {
|
|
1358
|
+
id
|
|
1359
|
+
createStamp
|
|
1360
|
+
createdBy
|
|
1361
|
+
name
|
|
1362
|
+
image
|
|
1363
|
+
imageIcon
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
`;
|
|
@@ -86,4 +86,7 @@ export declare class ProductService extends Service {
|
|
|
86
86
|
removeProductTag(dataTag: any): Promise<any>;
|
|
87
87
|
getTagsByProduct(productId: string): Promise<any>;
|
|
88
88
|
getProductStoreByScope(scope: string, enable: boolean): Promise<any>;
|
|
89
|
+
getProductStorePublic(productId: string, isPublic: boolean): Promise<any>;
|
|
90
|
+
publicProduct(storeId: string, productId: string, isPublic: boolean, updatedBy: string): Promise<any>;
|
|
91
|
+
getProductMarketplace(dataQuery: any): Promise<any>;
|
|
89
92
|
}
|
|
@@ -983,5 +983,51 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
983
983
|
}
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
+
getProductStorePublic(productId, isPublic) {
|
|
987
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
988
|
+
const queries = queries_1.GET_PRODUCT_STORE_PUBLIC;
|
|
989
|
+
const variables = {
|
|
990
|
+
productId,
|
|
991
|
+
isPublic,
|
|
992
|
+
};
|
|
993
|
+
try {
|
|
994
|
+
const response = yield this.graphqlQuery(queries, variables);
|
|
995
|
+
return response.getProductStorePublic;
|
|
996
|
+
}
|
|
997
|
+
catch (error) {
|
|
998
|
+
throw error;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
publicProduct(storeId, productId, isPublic, updatedBy) {
|
|
1003
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1004
|
+
const mutation = mutations_1.PUBLIC_PRODUCT;
|
|
1005
|
+
const variables = {
|
|
1006
|
+
storeId,
|
|
1007
|
+
productId,
|
|
1008
|
+
isPublic,
|
|
1009
|
+
updatedBy,
|
|
1010
|
+
};
|
|
1011
|
+
try {
|
|
1012
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
1013
|
+
return response.publicProduct;
|
|
1014
|
+
}
|
|
1015
|
+
catch (error) {
|
|
1016
|
+
throw error;
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
getProductMarketplace(dataQuery) {
|
|
1021
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1022
|
+
const queries = queries_1.GET_PRODUCT_MARKET_PLACE;
|
|
1023
|
+
try {
|
|
1024
|
+
const response = yield this.graphqlQuery(queries, dataQuery);
|
|
1025
|
+
return response.getProductMarketplace;
|
|
1026
|
+
}
|
|
1027
|
+
catch (error) {
|
|
1028
|
+
throw error;
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
986
1032
|
}
|
|
987
1033
|
exports.ProductService = ProductService;
|