@longvansoftware/storefront-js-client 4.6.7 → 4.6.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.
- package/dist/src/graphql/campaign/queries.d.ts +13 -11
- package/dist/src/graphql/campaign/queries.js +25 -110
- package/dist/src/graphql/crm/mutations.d.ts +1 -0
- package/dist/src/graphql/crm/mutations.js +54 -240
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +64 -5
- package/dist/src/lib/campaign/index.d.ts +1 -0
- package/dist/src/lib/campaign/index.js +64 -12
- package/dist/src/lib/crm/index.d.ts +1 -0
- package/dist/src/lib/crm/index.js +67 -46
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +12 -0
- package/dist/src/utils/helpers.d.ts +2 -0
- package/dist/src/utils/helpers.js +11 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC = exports.GET_PRODUCT_MARKET_PLACE_BY_SUPPLIER = exports.GET_PRODUCT_MARKET_PLACE_BY_ID = exports.GET_PRODUCT_MARKET_PLACE_DETAIL_BY_SLUG = 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;
|
|
3
|
+
exports.GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC = exports.GET_PRODUCT_MARKET_PLACE_BY_SUPPLIER = exports.GET_PRODUCT_MARKET_PLACE_BY_ID = exports.GET_PRODUCT_MARKET_PLACE_DETAIL_BY_SLUG = 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_V2 = 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(
|
|
@@ -500,7 +500,7 @@ exports.GET_SIMPLE_PRODUCTS_QUERY = (0, graphql_tag_1.gql) `
|
|
|
500
500
|
vat
|
|
501
501
|
qualify
|
|
502
502
|
parentId
|
|
503
|
-
|
|
503
|
+
|
|
504
504
|
handle
|
|
505
505
|
price
|
|
506
506
|
compareAtPrice
|
|
@@ -713,6 +713,65 @@ exports.GET_STORES = (0, graphql_tag_1.gql) `
|
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
`;
|
|
716
|
+
exports.GET_STORES_V2 = (0, graphql_tag_1.gql) `
|
|
717
|
+
query GetStores(
|
|
718
|
+
$partnerId: String!
|
|
719
|
+
$enable: Boolean
|
|
720
|
+
$type: String
|
|
721
|
+
$enablePortal: Boolean
|
|
722
|
+
) {
|
|
723
|
+
getStores(
|
|
724
|
+
partnerId: $partnerId
|
|
725
|
+
enable: $enable
|
|
726
|
+
type: $type
|
|
727
|
+
enablePortal: $enablePortal
|
|
728
|
+
) {
|
|
729
|
+
id
|
|
730
|
+
createdStamp
|
|
731
|
+
name
|
|
732
|
+
type
|
|
733
|
+
enable
|
|
734
|
+
partyId
|
|
735
|
+
warehouses
|
|
736
|
+
warehouseIdDefault
|
|
737
|
+
enableOrderAbleFuture
|
|
738
|
+
enableOrderNegativeQuantity
|
|
739
|
+
storeEcommerceName
|
|
740
|
+
shippingCompanies
|
|
741
|
+
shippingCompanyIdPrimary
|
|
742
|
+
customerIdPrimary
|
|
743
|
+
paymentMethodIdPrimary
|
|
744
|
+
enableCustomProductPrice
|
|
745
|
+
enablePaymentPartial
|
|
746
|
+
paymentPartialPercent
|
|
747
|
+
productStoreLink
|
|
748
|
+
applyVat
|
|
749
|
+
scope
|
|
750
|
+
description {
|
|
751
|
+
name
|
|
752
|
+
phone
|
|
753
|
+
address
|
|
754
|
+
footer
|
|
755
|
+
description
|
|
756
|
+
slug
|
|
757
|
+
logo
|
|
758
|
+
banner
|
|
759
|
+
ward
|
|
760
|
+
wardId
|
|
761
|
+
province
|
|
762
|
+
provinceId
|
|
763
|
+
showLogo
|
|
764
|
+
showBanner
|
|
765
|
+
showMap
|
|
766
|
+
showInfoStore
|
|
767
|
+
showBarcode
|
|
768
|
+
showFooter
|
|
769
|
+
showVat
|
|
770
|
+
showPromotion
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
`;
|
|
716
775
|
exports.GET_DETAIL_STORES = (0, graphql_tag_1.gql) `
|
|
717
776
|
query GetDetailStores($partnerId: String!, $storeId: String!) {
|
|
718
777
|
getDetailStores(partnerId: $partnerId, storeId: $storeId) {
|
|
@@ -1185,13 +1244,13 @@ exports.GET_PRODUCT_STORE_PUBLIC = (0, graphql_tag_1.gql) `
|
|
|
1185
1244
|
exports.GET_PRODUCT_MARKET_PLACE = (0, graphql_tag_1.gql) `
|
|
1186
1245
|
query GetProductMarketplace(
|
|
1187
1246
|
$storeChannel: String!
|
|
1188
|
-
$currentPage:Int
|
|
1247
|
+
$currentPage: Int
|
|
1189
1248
|
$maxResult: Int
|
|
1190
1249
|
) {
|
|
1191
1250
|
getProductMarketplace(
|
|
1192
1251
|
storeChannel: $storeChannel
|
|
1193
|
-
currentPage
|
|
1194
|
-
maxResult
|
|
1252
|
+
currentPage: $currentPage
|
|
1253
|
+
maxResult: $maxResult
|
|
1195
1254
|
) {
|
|
1196
1255
|
total
|
|
1197
1256
|
currentPage
|
|
@@ -19,4 +19,5 @@ export declare class CampaignService extends Service {
|
|
|
19
19
|
searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
|
|
20
20
|
getCampaign(id: string): Promise<any>;
|
|
21
21
|
searchProductPricePromotionResponse(campaignId: string, campaignActionId: string, statusActive: string): Promise<any>;
|
|
22
|
+
voucherForUserRequest(orderId: string, customerId?: string, paymentMethodId?: string, shippingCompanyId?: string, pageNumber?: number, pageSize?: number, fields?: string[]): Promise<any>;
|
|
22
23
|
}
|
|
@@ -30,7 +30,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
30
30
|
partyId: this.orgId,
|
|
31
31
|
productStoreId: this.storeId,
|
|
32
32
|
customerId,
|
|
33
|
-
campaignActionType
|
|
33
|
+
campaignActionType
|
|
34
34
|
};
|
|
35
35
|
try {
|
|
36
36
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -54,7 +54,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
54
54
|
customerId,
|
|
55
55
|
excludeExpired,
|
|
56
56
|
pageNumber,
|
|
57
|
-
pageSize
|
|
57
|
+
pageSize
|
|
58
58
|
};
|
|
59
59
|
try {
|
|
60
60
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -73,7 +73,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
73
73
|
partyId: this.orgId,
|
|
74
74
|
productStoreId: this.storeId,
|
|
75
75
|
customerId,
|
|
76
|
-
voucherCode
|
|
76
|
+
voucherCode
|
|
77
77
|
};
|
|
78
78
|
try {
|
|
79
79
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -92,7 +92,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
92
92
|
partyId: this.orgId,
|
|
93
93
|
productStoreId: this.storeId,
|
|
94
94
|
campaignActionType,
|
|
95
|
-
customerId
|
|
95
|
+
customerId
|
|
96
96
|
};
|
|
97
97
|
try {
|
|
98
98
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -110,7 +110,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
110
110
|
partyId: this.orgId,
|
|
111
111
|
productStoreId: this.storeId,
|
|
112
112
|
productId,
|
|
113
|
-
productPrice
|
|
113
|
+
productPrice
|
|
114
114
|
};
|
|
115
115
|
try {
|
|
116
116
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -131,7 +131,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
131
131
|
campaignActionId,
|
|
132
132
|
customerId,
|
|
133
133
|
excludeExpired,
|
|
134
|
-
isPageAble
|
|
134
|
+
isPageAble
|
|
135
135
|
};
|
|
136
136
|
try {
|
|
137
137
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -149,7 +149,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
149
149
|
partyId: this.orgId,
|
|
150
150
|
voucherCode,
|
|
151
151
|
userId,
|
|
152
|
-
affiliateId
|
|
152
|
+
affiliateId
|
|
153
153
|
};
|
|
154
154
|
try {
|
|
155
155
|
const response = yield this.graphqlMutation(query, variables);
|
|
@@ -169,7 +169,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
169
169
|
campaignId: campaignId,
|
|
170
170
|
campaignActionId: campaignActionId,
|
|
171
171
|
excludeExpired: true,
|
|
172
|
-
isBirthday: isBirthday
|
|
172
|
+
isBirthday: isBirthday
|
|
173
173
|
};
|
|
174
174
|
try {
|
|
175
175
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -184,7 +184,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
184
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
185
185
|
const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
|
|
186
186
|
const variables = {
|
|
187
|
-
id
|
|
187
|
+
id
|
|
188
188
|
};
|
|
189
189
|
try {
|
|
190
190
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -203,7 +203,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
203
203
|
storeId: this.storeId,
|
|
204
204
|
productIds: productIds,
|
|
205
205
|
campaignActionId: campaignActionId,
|
|
206
|
-
sort: { asc: true, key: "createdStamp" }
|
|
206
|
+
sort: { asc: true, key: "createdStamp" }
|
|
207
207
|
};
|
|
208
208
|
try {
|
|
209
209
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -218,7 +218,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
218
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
219
|
const query = queries_1.GET_CAMPAIGN;
|
|
220
220
|
const variables = {
|
|
221
|
-
id
|
|
221
|
+
id
|
|
222
222
|
};
|
|
223
223
|
try {
|
|
224
224
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -237,7 +237,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
237
237
|
campaignId,
|
|
238
238
|
campaignActionId,
|
|
239
239
|
statusActive,
|
|
240
|
-
sort: { asc: true, key: "productId" }
|
|
240
|
+
sort: { asc: true, key: "productId" }
|
|
241
241
|
};
|
|
242
242
|
try {
|
|
243
243
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -248,5 +248,57 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
248
248
|
}
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
+
voucherForUserRequest(orderId_1) {
|
|
252
|
+
return __awaiter(this, arguments, void 0, function* (orderId, customerId = "", paymentMethodId, shippingCompanyId, pageNumber = 0, pageSize = 20, fields = [
|
|
253
|
+
`content {
|
|
254
|
+
id
|
|
255
|
+
voucherCode
|
|
256
|
+
voucherType
|
|
257
|
+
isBirthday
|
|
258
|
+
discountAmount
|
|
259
|
+
discountPercent
|
|
260
|
+
usageLimitPerVoucher
|
|
261
|
+
numberOfTimeUsed
|
|
262
|
+
maximumDiscount
|
|
263
|
+
memberLevel
|
|
264
|
+
affiliateId
|
|
265
|
+
description
|
|
266
|
+
usageLimitType
|
|
267
|
+
minimumSpend
|
|
268
|
+
maximumSpend
|
|
269
|
+
expiryDate
|
|
270
|
+
isUsable
|
|
271
|
+
unusableReasons
|
|
272
|
+
remainingAmount
|
|
273
|
+
}`,
|
|
274
|
+
"total",
|
|
275
|
+
"pageNumber",
|
|
276
|
+
"pageSize",
|
|
277
|
+
"totalPages",
|
|
278
|
+
"numberOfElements",
|
|
279
|
+
"first",
|
|
280
|
+
"last"
|
|
281
|
+
]) {
|
|
282
|
+
const query = (0, queries_1.GET_VOUCHER_FOR_USER)(fields);
|
|
283
|
+
const variables = {
|
|
284
|
+
voucherForUserRequest: {
|
|
285
|
+
orderId,
|
|
286
|
+
customerId,
|
|
287
|
+
storeId: this.storeId,
|
|
288
|
+
paymentMethodId,
|
|
289
|
+
shippingCompanyId,
|
|
290
|
+
pageNumber,
|
|
291
|
+
pageSize
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
try {
|
|
295
|
+
const res = yield this.graphqlQuery(query, variables);
|
|
296
|
+
return res.getVouchersForUser;
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
throw error;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
251
303
|
}
|
|
252
304
|
exports.CampaignService = CampaignService;
|
|
@@ -48,5 +48,6 @@ export declare class CrmService extends Service {
|
|
|
48
48
|
getResumesByFieldNameAndValue(orgId: string, fieldName: string, value: string, resumeTemplateId: string): Promise<any>;
|
|
49
49
|
uploadImageResume(resumeId: string, fieldName: string, uploadImageInput: any, updatedBy: string): Promise<any>;
|
|
50
50
|
createResume(resumeTemplateId: string, partyId: string, createdBy: string, name: string): Promise<any>;
|
|
51
|
+
createSupportRequest(title: string, content: string, fileUrl: string, source: string, userId: string, uri: string): Promise<any>;
|
|
51
52
|
getResumesByFieldNameAndValues(resumeTemplateId: string, orgId: string, fieldNameValues: any): Promise<any>;
|
|
52
53
|
}
|