@longvansoftware/storefront-js-client 2.2.6 → 2.2.7-beta-14
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/config/config.d.ts +2 -0
- package/dist/config/config.js +3 -1
- package/dist/src/graphql/campaign/mutations.d.ts +1 -0
- package/dist/src/graphql/campaign/mutations.js +31 -0
- package/dist/src/graphql/campaign/queries.d.ts +2 -0
- package/dist/src/graphql/campaign/queries.js +94 -1
- package/dist/src/graphql/crm/mutations.d.ts +1 -0
- package/dist/src/graphql/crm/mutations.js +18 -3
- package/dist/src/graphql/crm/queries.d.ts +2 -0
- package/dist/src/graphql/crm/queries.js +51 -3
- package/dist/src/graphql/payment/mutations.js +1 -0
- package/dist/src/graphql/paymentV2/mutations.d.ts +2 -0
- package/dist/src/graphql/paymentV2/mutations.js +46 -1
- package/dist/src/graphql/paymentV2/queries.d.ts +3 -0
- package/dist/src/graphql/paymentV2/queries.js +121 -1
- package/dist/src/graphql/product/queries.js +22 -0
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +5 -0
- package/dist/src/lib/campaign/index.d.ts +3 -0
- package/dist/src/lib/campaign/index.js +50 -0
- package/dist/src/lib/comhub/index.d.ts +1 -1
- package/dist/src/lib/comhub/index.js +3 -3
- package/dist/src/lib/crm/index.d.ts +4 -1
- package/dist/src/lib/crm/index.js +53 -2
- package/dist/src/lib/omnigateway/index.d.ts +1 -1
- package/dist/src/lib/omnigateway/index.js +3 -3
- package/dist/src/lib/order/index.d.ts +50 -0
- package/dist/src/lib/order/index.js +151 -0
- package/dist/src/lib/paymentV2/index.d.ts +5 -0
- package/dist/src/lib/paymentV2/index.js +80 -0
- package/dist/src/lib/portal/index.d.ts +3 -0
- package/dist/src/lib/portal/index.js +13 -0
- package/dist/src/lib/product/index.d.ts +2 -1
- package/dist/src/lib/product/index.js +23 -2
- package/dist/src/lib/token/index.d.ts +5 -0
- package/dist/src/lib/token/index.js +32 -0
- package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
- package/dist/src/utils/validatePhoneNumber.js +20 -0
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CampaignService = void 0;
|
|
13
13
|
const serviceSDK_1 = require("../serviceSDK");
|
|
14
14
|
const queries_1 = require("../../graphql/campaign/queries");
|
|
15
|
+
const mutations_1 = require("../../graphql/campaign/mutations");
|
|
15
16
|
class CampaignService extends serviceSDK_1.Service {
|
|
16
17
|
/**
|
|
17
18
|
* Constructs a new CampaignService instance.
|
|
@@ -70,6 +71,7 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
70
71
|
const query = queries_1.CHECK_VALID_VOUCHER;
|
|
71
72
|
const variables = {
|
|
72
73
|
partyId: this.orgId,
|
|
74
|
+
productStoreId: this.storeId,
|
|
73
75
|
customerId,
|
|
74
76
|
voucherCode,
|
|
75
77
|
};
|
|
@@ -138,5 +140,53 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
138
140
|
}
|
|
139
141
|
});
|
|
140
142
|
}
|
|
143
|
+
addCustomerToVoucher(voucherCode, userId) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const query = mutations_1.ADD_CUSTOMER_ID_INTO_VOUCHER;
|
|
146
|
+
const variables = {
|
|
147
|
+
partyId: this.orgId,
|
|
148
|
+
voucherCode,
|
|
149
|
+
userId,
|
|
150
|
+
};
|
|
151
|
+
try {
|
|
152
|
+
const response = yield this.graphqlMutation(query, variables);
|
|
153
|
+
return response.addCustomerIdIntoVoucher;
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
suggestVoucher() {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const query = queries_1.SUGGEST_VOUCHER;
|
|
163
|
+
const variables = {
|
|
164
|
+
partyId: this.orgId,
|
|
165
|
+
excludeExpired: true,
|
|
166
|
+
};
|
|
167
|
+
try {
|
|
168
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
169
|
+
return response.suggestVoucher;
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
getCampaignActionById(id) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
|
|
179
|
+
const variables = {
|
|
180
|
+
id,
|
|
181
|
+
};
|
|
182
|
+
try {
|
|
183
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
184
|
+
return response.getCampaignActionById;
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
141
191
|
}
|
|
142
192
|
exports.CampaignService = CampaignService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Service } from "../serviceSDK";
|
|
2
2
|
export declare class ComhubService extends Service {
|
|
3
3
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
|
|
4
|
+
sendZns(dataTemplate: any, appId: string, messageType: string): Promise<any>;
|
|
5
5
|
sendMessage(OAId: string, content: string, contentType: string, senderPartyId: string, receivePartyIds: [string]): Promise<any>;
|
|
6
6
|
}
|
|
@@ -15,12 +15,12 @@ class ComhubService extends serviceSDK_1.Service {
|
|
|
15
15
|
constructor(endpoint, orgId, storeId) {
|
|
16
16
|
super(endpoint, orgId, storeId);
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
sendZns(dataTemplate, appId, messageType) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const endpoint = `/web-hook/message/send/social/app/${
|
|
20
|
+
const endpoint = `/web-hook/message/send/social/ZNS/app/${appId}/message-type/${messageType}`;
|
|
21
21
|
const method = "POST";
|
|
22
22
|
try {
|
|
23
|
-
const response = yield this.restApiCallWithNoHeader(endpoint, method,
|
|
23
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method, dataTemplate);
|
|
24
24
|
return response;
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
@@ -28,9 +28,12 @@ export declare class CrmService extends Service {
|
|
|
28
28
|
updateConnectorDescription(connectorId: string, description: string, updatedBy: string): Promise<any>;
|
|
29
29
|
getTags(connectorId: string): Promise<any>;
|
|
30
30
|
removeTag(connectorId: string, tagId: string, removedBy: string): Promise<any>;
|
|
31
|
-
searchTopic(
|
|
31
|
+
searchTopic(filterTopicRequest: any, pageSize: number, currentPage: number): Promise<any>;
|
|
32
32
|
closeTopic(id: string, updatedBy: string): Promise<any>;
|
|
33
33
|
createTopic(socialAppId: String, customerId: string, message: string): Promise<any>;
|
|
34
34
|
getTopicByCustomerId(filterTopicRequest: any, pageSize: number, currentPage: number): Promise<any>;
|
|
35
35
|
getMyWorkEffortToday(performerId: string, source: string): Promise<any>;
|
|
36
|
+
getMessages(topicId: String, pageSize: Number, pageNumber: Number): Promise<any>;
|
|
37
|
+
getResourceRelatedTopic(topicId: string, resourceType: string): Promise<any>;
|
|
38
|
+
addTopicRelatedResource(topicId: string, resourceId: string, resourceType: string, createdBy: string): Promise<any>;
|
|
36
39
|
}
|
|
@@ -473,11 +473,11 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
473
473
|
}
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
-
searchTopic(
|
|
476
|
+
searchTopic(filterTopicRequest, pageSize, currentPage) {
|
|
477
477
|
return __awaiter(this, void 0, void 0, function* () {
|
|
478
478
|
const query = queries_1.SEARCH_TOPIC;
|
|
479
479
|
const variables = {
|
|
480
|
-
filterTopicRequest:
|
|
480
|
+
filterTopicRequest: filterTopicRequest,
|
|
481
481
|
partnerId: this.orgId,
|
|
482
482
|
pageSize,
|
|
483
483
|
currentPage,
|
|
@@ -559,5 +559,56 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
559
559
|
}
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
|
+
getMessages(topicId, pageSize, pageNumber) {
|
|
563
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
564
|
+
const query = queries_1.GET_MESSAGES;
|
|
565
|
+
const variables = {
|
|
566
|
+
topicId,
|
|
567
|
+
pageSize,
|
|
568
|
+
pageNumber,
|
|
569
|
+
};
|
|
570
|
+
try {
|
|
571
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
572
|
+
return response.getMessages;
|
|
573
|
+
}
|
|
574
|
+
catch (error) {
|
|
575
|
+
throw error;
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
getResourceRelatedTopic(topicId, resourceType) {
|
|
580
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
+
const query = queries_1.GET_RESOURCE_RELATED_TOPIC;
|
|
582
|
+
const variables = {
|
|
583
|
+
topicId,
|
|
584
|
+
resourceType,
|
|
585
|
+
};
|
|
586
|
+
try {
|
|
587
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
588
|
+
return response.getResourceRelatedTopic;
|
|
589
|
+
}
|
|
590
|
+
catch (error) {
|
|
591
|
+
throw error;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
addTopicRelatedResource(topicId, resourceId, resourceType, createdBy) {
|
|
596
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
597
|
+
const mutation = mutations_1.ADD_TOPIC_RELATED_RESOURCE;
|
|
598
|
+
const variables = {
|
|
599
|
+
topicId,
|
|
600
|
+
resourceId,
|
|
601
|
+
resourceType,
|
|
602
|
+
createdBy,
|
|
603
|
+
};
|
|
604
|
+
try {
|
|
605
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
606
|
+
return response.addTopicRelatedResource;
|
|
607
|
+
}
|
|
608
|
+
catch (error) {
|
|
609
|
+
throw error;
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
}
|
|
562
613
|
}
|
|
563
614
|
exports.CrmService = CrmService;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Service } from "../serviceSDK";
|
|
2
2
|
export declare class OmnigatewayService extends Service {
|
|
3
3
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
-
requestJoinRoom(
|
|
4
|
+
requestJoinRoom(roomId: string, listUser: [string]): Promise<any>;
|
|
5
5
|
getTemplate(type: string): Promise<any>;
|
|
6
6
|
getInfoChatApp(): Promise<any>;
|
|
7
7
|
}
|
|
@@ -15,9 +15,9 @@ class OmnigatewayService extends serviceSDK_1.Service {
|
|
|
15
15
|
constructor(endpoint, orgId, storeId) {
|
|
16
16
|
super(endpoint, orgId, storeId);
|
|
17
17
|
}
|
|
18
|
-
requestJoinRoom(
|
|
18
|
+
requestJoinRoom(roomId, listUser) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const endpoint = `/topics/${
|
|
20
|
+
const endpoint = `/topics/room/${roomId}/join`;
|
|
21
21
|
const method = "POST";
|
|
22
22
|
try {
|
|
23
23
|
const response = yield this.restApiCallWithNoHeader(endpoint, method, listUser);
|
|
@@ -43,7 +43,7 @@ class OmnigatewayService extends serviceSDK_1.Service {
|
|
|
43
43
|
}
|
|
44
44
|
getInfoChatApp() {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const endpoint = `/
|
|
46
|
+
const endpoint = `/channels/partner/${this.orgId}/social`;
|
|
47
47
|
const method = "GET";
|
|
48
48
|
try {
|
|
49
49
|
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
@@ -459,4 +459,54 @@ export declare class OrderService extends Service {
|
|
|
459
459
|
enableProductDiary(orderId: string, orderItemId: string): Promise<any>;
|
|
460
460
|
removeMemberDiscount(orderId: string): Promise<any>;
|
|
461
461
|
getInfoChatApp(attributesName: string): Promise<any>;
|
|
462
|
+
validatePhoneNumber(phoneNumer: string): boolean;
|
|
463
|
+
/**
|
|
464
|
+
*report by date month year
|
|
465
|
+
* @param employee_assign
|
|
466
|
+
* @param type_view
|
|
467
|
+
* @param date_from
|
|
468
|
+
* @param date_to
|
|
469
|
+
* @returns A promise that resolves with the created order.
|
|
470
|
+
* @throws If an error occurs while creating the order.
|
|
471
|
+
*/
|
|
472
|
+
reportDateMonthYear(employee_assign: string, type_view: string, date_from: number, date_to: number): Promise<any>;
|
|
473
|
+
/**
|
|
474
|
+
* report by sale employee
|
|
475
|
+
* @param employee_assign
|
|
476
|
+
* @param date_from
|
|
477
|
+
* @param date_to
|
|
478
|
+
* @returns A promise that resolves with the created order.
|
|
479
|
+
* @throws If an error occurs while creating the order.
|
|
480
|
+
*/
|
|
481
|
+
reportBySaleEmployee(employee_assign: string, date_from: number, date_to: number): Promise<any>;
|
|
482
|
+
/**
|
|
483
|
+
* report by sale employee
|
|
484
|
+
* @param employee_assign
|
|
485
|
+
* @param date_from
|
|
486
|
+
* @param date_to
|
|
487
|
+
* @returns A promise that resolves with the created order.
|
|
488
|
+
* @throws If an error occurs while creating the order.
|
|
489
|
+
*/
|
|
490
|
+
reportByPaymentMethod(employee_assign: string, date_from: number, date_to: number): Promise<any>;
|
|
491
|
+
/**
|
|
492
|
+
* report by detail
|
|
493
|
+
* @param employee_assign
|
|
494
|
+
* @param type_view
|
|
495
|
+
* @param date_from
|
|
496
|
+
* @param date_to
|
|
497
|
+
* @returns A promise that resolves with the created order.
|
|
498
|
+
* @throws If an error occurs while creating the order.
|
|
499
|
+
*/
|
|
500
|
+
reportByDetail(employee_assign: string, type_view: string, date_from: number, date_to: number): Promise<any>;
|
|
501
|
+
/**
|
|
502
|
+
* report by store
|
|
503
|
+
* @param date_from
|
|
504
|
+
* @param date_to
|
|
505
|
+
* @returns A promise that resolves with the created order.
|
|
506
|
+
* @throws If an error occurs while creating the order.
|
|
507
|
+
*/
|
|
508
|
+
reporByStores(date_from: number, date_to: number): Promise<any>;
|
|
509
|
+
updateExchangeOrder(exchangeOrder: string, returnOrder: string, sellOrder: string): Promise<any>;
|
|
510
|
+
removeShippingAddress(orderId: string, updateBy: string): Promise<any>;
|
|
511
|
+
removeShippingInfo(orderId: string, updateBy: string): Promise<any>;
|
|
462
512
|
}
|
|
@@ -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.OrderService = void 0;
|
|
13
13
|
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const validatePhoneNumber_1 = require("../../utils/validatePhoneNumber");
|
|
14
15
|
/**
|
|
15
16
|
* Represents a service for managing orders.
|
|
16
17
|
*/
|
|
@@ -1343,5 +1344,155 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1343
1344
|
}
|
|
1344
1345
|
});
|
|
1345
1346
|
}
|
|
1347
|
+
validatePhoneNumber(phoneNumer) {
|
|
1348
|
+
const res = (0, validatePhoneNumber_1.validatePhoneNumber)(phoneNumer);
|
|
1349
|
+
return res;
|
|
1350
|
+
}
|
|
1351
|
+
// statistic
|
|
1352
|
+
/**
|
|
1353
|
+
*report by date month year
|
|
1354
|
+
* @param employee_assign
|
|
1355
|
+
* @param type_view
|
|
1356
|
+
* @param date_from
|
|
1357
|
+
* @param date_to
|
|
1358
|
+
* @returns A promise that resolves with the created order.
|
|
1359
|
+
* @throws If an error occurs while creating the order.
|
|
1360
|
+
*/
|
|
1361
|
+
reportDateMonthYear(employee_assign, type_view, date_from, date_to) {
|
|
1362
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1363
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportDateMonthYear?type_view=${type_view}&date_from=${date_from}&date_to=${date_to}`;
|
|
1364
|
+
const method = "GET";
|
|
1365
|
+
try {
|
|
1366
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1367
|
+
return response;
|
|
1368
|
+
}
|
|
1369
|
+
catch (error) {
|
|
1370
|
+
throw error;
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* report by sale employee
|
|
1376
|
+
* @param employee_assign
|
|
1377
|
+
* @param date_from
|
|
1378
|
+
* @param date_to
|
|
1379
|
+
* @returns A promise that resolves with the created order.
|
|
1380
|
+
* @throws If an error occurs while creating the order.
|
|
1381
|
+
*/
|
|
1382
|
+
reportBySaleEmployee(employee_assign, date_from, date_to) {
|
|
1383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1384
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportBySaleEmployee?date_from=${date_from}&date_to=${date_to}`;
|
|
1385
|
+
const method = "GET";
|
|
1386
|
+
try {
|
|
1387
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1388
|
+
return response;
|
|
1389
|
+
}
|
|
1390
|
+
catch (error) {
|
|
1391
|
+
throw error;
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* report by sale employee
|
|
1397
|
+
* @param employee_assign
|
|
1398
|
+
* @param date_from
|
|
1399
|
+
* @param date_to
|
|
1400
|
+
* @returns A promise that resolves with the created order.
|
|
1401
|
+
* @throws If an error occurs while creating the order.
|
|
1402
|
+
*/
|
|
1403
|
+
reportByPaymentMethod(employee_assign, date_from, date_to) {
|
|
1404
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1405
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportByPaymentMethod?date_from=${date_from}&date_to=${date_to}`;
|
|
1406
|
+
const method = "GET";
|
|
1407
|
+
try {
|
|
1408
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1409
|
+
return response;
|
|
1410
|
+
}
|
|
1411
|
+
catch (error) {
|
|
1412
|
+
throw error;
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* report by detail
|
|
1418
|
+
* @param employee_assign
|
|
1419
|
+
* @param type_view
|
|
1420
|
+
* @param date_from
|
|
1421
|
+
* @param date_to
|
|
1422
|
+
* @returns A promise that resolves with the created order.
|
|
1423
|
+
* @throws If an error occurs while creating the order.
|
|
1424
|
+
*/
|
|
1425
|
+
reportByDetail(employee_assign, type_view, date_from, date_to) {
|
|
1426
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1427
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportByDetail?type_view=${type_view}&date_from=${date_from}&date_to=${date_to}`;
|
|
1428
|
+
const method = "GET";
|
|
1429
|
+
try {
|
|
1430
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1431
|
+
return response;
|
|
1432
|
+
}
|
|
1433
|
+
catch (error) {
|
|
1434
|
+
throw error;
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* report by store
|
|
1440
|
+
* @param date_from
|
|
1441
|
+
* @param date_to
|
|
1442
|
+
* @returns A promise that resolves with the created order.
|
|
1443
|
+
* @throws If an error occurs while creating the order.
|
|
1444
|
+
*/
|
|
1445
|
+
reporByStores(date_from, date_to) {
|
|
1446
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1447
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/reportByStores?date_from=${date_from}&date_to=${date_to}`;
|
|
1448
|
+
const method = "GET";
|
|
1449
|
+
try {
|
|
1450
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1451
|
+
return response;
|
|
1452
|
+
}
|
|
1453
|
+
catch (error) {
|
|
1454
|
+
throw error;
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
updateExchangeOrder(exchangeOrder, returnOrder, sellOrder) {
|
|
1459
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1460
|
+
const endpoint = `/orders/${this.orgId}/${exchangeOrder}/${returnOrder}/${sellOrder}/updateExchangeOrder`;
|
|
1461
|
+
const method = "PUT";
|
|
1462
|
+
try {
|
|
1463
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1464
|
+
return response;
|
|
1465
|
+
}
|
|
1466
|
+
catch (error) {
|
|
1467
|
+
throw error;
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
removeShippingAddress(orderId, updateBy) {
|
|
1472
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1473
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/removeShippingAddressInfo?updated_by=${updateBy}`;
|
|
1474
|
+
const method = "PUT";
|
|
1475
|
+
try {
|
|
1476
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1477
|
+
return response;
|
|
1478
|
+
}
|
|
1479
|
+
catch (error) {
|
|
1480
|
+
throw error;
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
removeShippingInfo(orderId, updateBy) {
|
|
1485
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1486
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/removeShippingInfo?updated_by=${updateBy}`;
|
|
1487
|
+
const method = "PUT";
|
|
1488
|
+
try {
|
|
1489
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1490
|
+
return response;
|
|
1491
|
+
}
|
|
1492
|
+
catch (error) {
|
|
1493
|
+
throw error;
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1346
1497
|
}
|
|
1347
1498
|
exports.OrderService = OrderService;
|
|
@@ -5,4 +5,9 @@ export declare class PaymentServiceV2 extends Service {
|
|
|
5
5
|
cancelPayment(paymentId: string, reason: string): Promise<any>;
|
|
6
6
|
paymentMethods(): Promise<any>;
|
|
7
7
|
getPaymentMethodTypes(): Promise<any>;
|
|
8
|
+
paymentInfo(paymentId: string): Promise<any>;
|
|
9
|
+
confirmToGateway(paymentId: string, methodCode: string, returnUrl: string): Promise<any>;
|
|
10
|
+
paymentStatus(paymentId: string): Promise<any>;
|
|
11
|
+
gwConfigDetail(configId: string): Promise<any>;
|
|
12
|
+
confirmPaymentSuccessManual(paymentId: string, transactionNo: string, note: string, confirmBy: string): Promise<any>;
|
|
8
13
|
}
|
|
@@ -79,5 +79,85 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
+
paymentInfo(paymentId) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const query = queries_1.PAYMENT_INFO;
|
|
85
|
+
const variables = {
|
|
86
|
+
paymentId,
|
|
87
|
+
};
|
|
88
|
+
try {
|
|
89
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
90
|
+
return response.paymentInfo;
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
confirmToGateway(paymentId, methodCode, returnUrl) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const mutation = mutations_1.CONFIRM_TO_GATEWAY;
|
|
100
|
+
const variables = {
|
|
101
|
+
paymentId,
|
|
102
|
+
methodCode,
|
|
103
|
+
returnUrl,
|
|
104
|
+
};
|
|
105
|
+
try {
|
|
106
|
+
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
107
|
+
return response.confirmToGateway;
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
paymentStatus(paymentId) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
const query = queries_1.PAYMENT_STATUS;
|
|
117
|
+
const variables = {
|
|
118
|
+
paymentId,
|
|
119
|
+
};
|
|
120
|
+
try {
|
|
121
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
122
|
+
return response.paymentStatus;
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
gwConfigDetail(configId) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const query = queries_1.GW_CONFIG_DETAIL;
|
|
132
|
+
const variables = {
|
|
133
|
+
configId,
|
|
134
|
+
};
|
|
135
|
+
try {
|
|
136
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
137
|
+
return response.gwConfigDetail;
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
confirmPaymentSuccessManual(paymentId, transactionNo, note, confirmBy) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
const mutation = mutations_1.CONFIRM_PAYMENT_SUCCESS_MANUAL;
|
|
147
|
+
const variables = {
|
|
148
|
+
paymentId: paymentId,
|
|
149
|
+
transactionNo: transactionNo,
|
|
150
|
+
note: note,
|
|
151
|
+
confirmBy: confirmBy,
|
|
152
|
+
};
|
|
153
|
+
try {
|
|
154
|
+
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
155
|
+
return response.confirmPaymentSuccessManual;
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
82
162
|
}
|
|
83
163
|
exports.PaymentServiceV2 = PaymentServiceV2;
|
|
@@ -5,4 +5,7 @@ export declare class PortalService extends Service {
|
|
|
5
5
|
updateDynamicForm(dataRequest: any): Promise<any>;
|
|
6
6
|
createTag(title: string, createBy: string, partnerId?: string): Promise<any>;
|
|
7
7
|
searchTag(partnerId?: string, title?: string, id?: string, search?: string): Promise<any>;
|
|
8
|
+
redirectLink(sku?: string, id?: string): string;
|
|
9
|
+
imageProduct(parentId: string, parentType: string, width?: number, height?: number): string;
|
|
10
|
+
imagesProduct(parentId: string, parentType: string, width?: number, height?: number): string;
|
|
8
11
|
}
|
|
@@ -72,5 +72,18 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
+
//
|
|
76
|
+
redirectLink(sku, id) {
|
|
77
|
+
const url = `${this.endpoint}/facility/manager/session/inventory-item-by-product.xhtml?${sku ? `sku=${sku}` : `id=${id}`}&orgId=${this.orgId}`;
|
|
78
|
+
return url;
|
|
79
|
+
}
|
|
80
|
+
imageProduct(parentId, parentType, width, height) {
|
|
81
|
+
const url = `${this.endpoint}/image-gateway/public/image/${parentType}/${parentId}${width ? `?w=${width}` : ``}${`${height ? `&h=${height}` : ``}`} `;
|
|
82
|
+
return url;
|
|
83
|
+
}
|
|
84
|
+
imagesProduct(parentId, parentType, width, height) {
|
|
85
|
+
const url = `${this.endpoint}/image-gateway/public/images/${parentType}/${parentId}?w=${width}&h=${height}`;
|
|
86
|
+
return url;
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
exports.PortalService = PortalService;
|
|
@@ -36,7 +36,8 @@ export declare class ProductService extends Service {
|
|
|
36
36
|
getPolicy(groupId: string): Promise<any>;
|
|
37
37
|
getStores(type: string): Promise<any>;
|
|
38
38
|
getDetailStores(): Promise<any>;
|
|
39
|
+
getDetailStoresV2(storeId: string): Promise<any>;
|
|
39
40
|
getProductImage: (productId: string) => Promise<any>;
|
|
40
41
|
getCategory(typeBuild: string, level: number): Promise<any>;
|
|
41
|
-
getProduct(
|
|
42
|
+
getProduct(dataQuery: any): Promise<any>;
|
|
42
43
|
}
|
|
@@ -24,6 +24,7 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
24
24
|
*/
|
|
25
25
|
constructor(endpoint, orgId, storeId) {
|
|
26
26
|
super(endpoint, orgId, storeId);
|
|
27
|
+
//
|
|
27
28
|
this.getProductImage = (productId) => __awaiter(this, void 0, void 0, function* () {
|
|
28
29
|
const query = queries_1.GET_PRODUCT_IMAGE;
|
|
29
30
|
const variables = {
|
|
@@ -176,6 +177,23 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
179
|
}
|
|
180
|
+
//
|
|
181
|
+
getDetailStoresV2(storeId) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
const query = queries_1.GET_DETAIL_STORES;
|
|
184
|
+
const variablesHandle = {
|
|
185
|
+
partnerId: this.orgId,
|
|
186
|
+
storeId,
|
|
187
|
+
};
|
|
188
|
+
try {
|
|
189
|
+
const response = yield this.graphqlQuery(query, variablesHandle);
|
|
190
|
+
return response.getDetailStores;
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
throw error;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
179
197
|
getCategory(typeBuild, level) {
|
|
180
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
199
|
const query = queries_1.GET_CATEGORIES_QUERY;
|
|
@@ -194,13 +212,16 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
194
212
|
}
|
|
195
213
|
});
|
|
196
214
|
}
|
|
197
|
-
getProduct(
|
|
215
|
+
getProduct(dataQuery) {
|
|
198
216
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
217
|
const query = queries_1.GET_PRODUCT;
|
|
200
218
|
const variables = {
|
|
201
219
|
partnerId: this.orgId,
|
|
202
220
|
storeChannel: this.storeId,
|
|
203
|
-
|
|
221
|
+
keyword: dataQuery.keyword,
|
|
222
|
+
category: dataQuery.category,
|
|
223
|
+
currentPage: dataQuery.currentPage,
|
|
224
|
+
maxResult: dataQuery.maxResult,
|
|
204
225
|
};
|
|
205
226
|
try {
|
|
206
227
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthorizationService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class AuthorizationService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
checkToken(orgId, token) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const endpoint = `/${orgId}/oauth2/api/v1/token/${token}`;
|
|
21
|
+
const method = "GET";
|
|
22
|
+
try {
|
|
23
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.AuthorizationService = AuthorizationService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validatePhoneNumber(phoneNumber: string): boolean;
|