@longvansoftware/service-js-client 1.16.6 → 1.16.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/campaign/mutations.d.ts +1 -0
- package/dist/src/graphql/campaign/mutations.js +34 -0
- package/dist/src/graphql/campaign/queries.d.ts +9 -0
- package/dist/src/graphql/campaign/queries.js +427 -0
- package/dist/src/graphql/cashbook/queries.d.ts +2 -0
- package/dist/src/graphql/cashbook/queries.js +99 -0
- package/dist/src/graphql/cloud/mutations.d.ts +23 -16
- package/dist/src/graphql/cloud/mutations.js +101 -1
- package/dist/src/graphql/cloud/queries.d.ts +1 -0
- package/dist/src/graphql/cloud/queries.js +26 -1
- package/dist/src/graphql/computing/mutations.d.ts +1 -0
- package/dist/src/graphql/computing/mutations.js +15 -1
- package/dist/src/graphql/crm/mutations.d.ts +3 -0
- package/dist/src/graphql/crm/mutations.js +54 -1
- package/dist/src/graphql/crm/queries.d.ts +17 -11
- package/dist/src/graphql/crm/queries.js +107 -1
- package/dist/src/graphql/crm_camping/queries.js +49 -19
- package/dist/src/graphql/fragments/product.d.ts +38 -0
- package/dist/src/graphql/fragments/product.js +196 -0
- package/dist/src/graphql/orderGraphQL/queries.d.ts +7 -5
- package/dist/src/graphql/orderGraphQL/queries.js +11 -1
- package/dist/src/graphql/paymentV2/mutations.d.ts +5 -0
- package/dist/src/graphql/paymentV2/mutations.js +120 -0
- package/dist/src/graphql/paymentV2/queries.d.ts +9 -0
- package/dist/src/graphql/paymentV2/queries.js +257 -0
- package/dist/src/graphql/product/queries.d.ts +2 -0
- package/dist/src/graphql/product/queries.js +41 -1
- package/dist/src/graphql/store/mutations.d.ts +1 -0
- package/dist/src/graphql/store/mutations.js +29 -0
- package/dist/src/graphql/store/queries.d.ts +1 -0
- package/dist/src/graphql/store/queries.js +29 -0
- package/dist/src/lib/accounting/index.d.ts +5 -0
- package/dist/src/lib/accounting/index.js +32 -0
- package/dist/src/lib/auth/index.d.ts +1 -1
- package/dist/src/lib/auth/index.js +3 -4
- package/dist/src/lib/campaign/index.d.ts +20 -0
- package/dist/src/lib/campaign/index.js +218 -0
- package/dist/src/lib/cashbook/index.d.ts +6 -0
- package/dist/src/lib/cashbook/index.js +56 -0
- package/dist/src/lib/cloud/index.d.ts +7 -0
- package/dist/src/lib/cloud/index.js +123 -0
- package/dist/src/lib/comhub/index.d.ts +6 -0
- package/dist/src/lib/comhub/index.js +50 -0
- package/dist/src/lib/computing/index.d.ts +1 -0
- package/dist/src/lib/computing/index.js +17 -0
- package/dist/src/lib/crm/index.d.ts +8 -0
- package/dist/src/lib/crm/index.js +141 -0
- package/dist/src/lib/crm_camping/index.d.ts +2 -2
- package/dist/src/lib/crm_camping/index.js +13 -8
- package/dist/src/lib/deepLinkVietQr/index.d.ts +7 -0
- package/dist/src/lib/deepLinkVietQr/index.js +58 -0
- package/dist/src/lib/fileService/index.d.ts +34 -0
- package/dist/src/lib/fileService/index.js +80 -0
- package/dist/src/lib/getImage/index.d.ts +4 -0
- package/dist/src/lib/getImage/index.js +10 -0
- package/dist/src/lib/image/index.d.ts +7 -0
- package/dist/src/lib/image/index.js +49 -0
- package/dist/src/lib/omnigateway/index.d.ts +7 -0
- package/dist/src/lib/omnigateway/index.js +58 -0
- package/dist/src/lib/orderGraphQL/index.d.ts +1 -0
- package/dist/src/lib/orderGraphQL/index.js +16 -0
- package/dist/src/lib/paymentV2/index.d.ts +18 -0
- package/dist/src/lib/paymentV2/index.js +245 -0
- package/dist/src/lib/portal/index.d.ts +23 -0
- package/dist/src/lib/portal/index.js +255 -0
- package/dist/src/lib/product/index.d.ts +2 -0
- package/dist/src/lib/product/index.js +34 -0
- package/dist/src/lib/resource_permission/index.d.ts +2 -2
- package/dist/src/lib/resource_permission/index.js +4 -4
- package/dist/src/lib/shareZalo/index.d.ts +5 -0
- package/dist/src/lib/shareZalo/index.js +32 -0
- package/dist/src/lib/store/index.d.ts +30 -0
- package/dist/src/lib/store/index.js +74 -0
- package/dist/src/lib/token/index.d.ts +5 -0
- package/dist/src/lib/token/index.js +32 -0
- package/dist/src/lib/upload/index.d.ts +5 -0
- package/dist/src/lib/upload/index.js +35 -0
- package/dist/src/lib/warehouseV2/index.d.ts +13 -0
- package/dist/src/lib/warehouseV2/index.js +54 -0
- package/dist/src/lib/zca/index.d.ts +12 -0
- package/dist/src/lib/zca/index.js +41 -0
- package/dist/src/types/campaign.d.ts +14 -0
- package/dist/src/types/campaign.js +2 -0
- package/dist/src/types/common.d.ts +264 -0
- package/dist/src/types/common.js +35 -0
- package/dist/src/types/invoice.d.ts +13 -0
- package/dist/src/types/invoice.js +2 -0
- package/dist/src/types/portal.d.ts +7 -0
- package/dist/src/types/portal.js +2 -0
- package/dist/src/types/store.d.ts +158 -0
- package/dist/src/types/store.js +3 -0
- package/dist/src/utils/errorHandler.d.ts +64 -0
- package/dist/src/utils/errorHandler.js +197 -0
- package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
- package/dist/src/utils/validatePhoneNumber.js +20 -0
- package/package.json +1 -1
- package/dist/src/lib/service.d.ts +0 -14
- package/dist/src/lib/service.js +0 -101
- package/dist/src/utils/build-field-string.d.ts +0 -1
- package/dist/src/utils/build-field-string.js +0 -16
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CREATE_STORE_MUTATION = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.CREATE_STORE_MUTATION = (0, graphql_tag_1.gql) `
|
|
6
|
+
mutation CreateStore($partnerId: String, $storeName: String) {
|
|
7
|
+
createStore(partnerId: $partnerId, storeName: $storeName) {
|
|
8
|
+
id
|
|
9
|
+
createdStamp
|
|
10
|
+
name
|
|
11
|
+
type
|
|
12
|
+
enable
|
|
13
|
+
partyId
|
|
14
|
+
warehouses
|
|
15
|
+
warehouseIdDefault
|
|
16
|
+
enableOrderAbleFuture
|
|
17
|
+
enableOrderNegativeQuantity
|
|
18
|
+
storeEcommerceName
|
|
19
|
+
shippingCompanies
|
|
20
|
+
shippingCompanyIdPrimary
|
|
21
|
+
customerIdPrimary
|
|
22
|
+
paymentMethodIdPrimary
|
|
23
|
+
enableCustomProductPrice
|
|
24
|
+
enablePaymentPartial
|
|
25
|
+
paymentPartialPercent
|
|
26
|
+
productStoreLink
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GET_STORE_CHANNEL_BY_EMP_ID_QUERY: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_STORE_CHANNEL_BY_EMP_ID_QUERY = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.GET_STORE_CHANNEL_BY_EMP_ID_QUERY = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetStoreChannelByEmpId($saleId: String) {
|
|
7
|
+
getStoreChannelByEmpId(saleId: $saleId) {
|
|
8
|
+
id
|
|
9
|
+
createdStamp
|
|
10
|
+
name
|
|
11
|
+
type
|
|
12
|
+
enable
|
|
13
|
+
partyId
|
|
14
|
+
warehouses
|
|
15
|
+
warehouseIdDefault
|
|
16
|
+
enableOrderAbleFuture
|
|
17
|
+
enableOrderNegativeQuantity
|
|
18
|
+
storeEcommerceName
|
|
19
|
+
shippingCompanies
|
|
20
|
+
shippingCompanyIdPrimary
|
|
21
|
+
customerIdPrimary
|
|
22
|
+
paymentMethodIdPrimary
|
|
23
|
+
enableCustomProductPrice
|
|
24
|
+
enablePaymentPartial
|
|
25
|
+
paymentPartialPercent
|
|
26
|
+
productStoreLink
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -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.AccountingService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class AccountingService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
getCustomerWallet(customerId, type) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const endpoint = `/${this.orgId}/get_gl_account?partyId=${customerId}&type=${type}`;
|
|
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.AccountingService = AccountingService;
|
|
@@ -32,7 +32,7 @@ export declare class AuthService extends Service {
|
|
|
32
32
|
getUserLoginByToken(accessToken: string): Promise<any>;
|
|
33
33
|
updateProfile(userLoginId: string, name: string, phone: string, email: string): Promise<any>;
|
|
34
34
|
createUserDetail(userLoginId: string): Promise<any>;
|
|
35
|
-
updateInfo(
|
|
35
|
+
updateInfo(accessToken: string, updateUserRequest: UpdateInfoRequest['updateUserRequest'], type: string, password: string | null): Promise<any>;
|
|
36
36
|
linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
|
|
37
37
|
getUserLoginByUserLoginId(userLoginId: string): Promise<any>;
|
|
38
38
|
checkUsernameExisted(username: string): Promise<any>;
|
|
@@ -174,11 +174,11 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
updateInfo(
|
|
177
|
+
updateInfo(accessToken, updateUserRequest, type, password) {
|
|
178
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
179
|
const mutation = mutations_1.UPDATE_INFO_MUTATION;
|
|
180
180
|
const variables = {
|
|
181
|
-
orgId,
|
|
181
|
+
orgId: this.orgId,
|
|
182
182
|
accessToken,
|
|
183
183
|
updateUserRequest: {
|
|
184
184
|
fullName: updateUserRequest.fullName,
|
|
@@ -189,14 +189,13 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
189
189
|
gender: updateUserRequest.gender || null,
|
|
190
190
|
imageUrl: updateUserRequest.imageUrl || null,
|
|
191
191
|
personalTitle: updateUserRequest.personalTitle || null,
|
|
192
|
+
birthDate: updateUserRequest.birthDate || null,
|
|
192
193
|
},
|
|
193
194
|
type,
|
|
194
195
|
password,
|
|
195
196
|
};
|
|
196
|
-
console.log("variables", variables);
|
|
197
197
|
try {
|
|
198
198
|
const response = yield this.graphqlMutation(mutation, variables);
|
|
199
|
-
console.log("res update", response);
|
|
200
199
|
return response.updateInfo;
|
|
201
200
|
}
|
|
202
201
|
catch (error) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class CampaignService extends Service {
|
|
3
|
+
/**
|
|
4
|
+
* Constructs a new CampaignService instance.
|
|
5
|
+
* @param endpoint - The endpoint URL for the service.
|
|
6
|
+
* @param orgId - The organization ID.
|
|
7
|
+
* @param storeId - The store ID.
|
|
8
|
+
*/
|
|
9
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
10
|
+
getCampaignActionActiveNow(customerId: string, campaignActionType: string): Promise<any>;
|
|
11
|
+
searchVouchers(campaignId: String, campaignActionId: String, campaignActionType: String, customerId: String, excludeExpired: Boolean, pageNumber: number, pageSize: number): Promise<any>;
|
|
12
|
+
checkValidVoucher(customerId: string, voucherCode: string): Promise<any>;
|
|
13
|
+
getCampaignActiveNow(campaignActionType: string, customerId: string): Promise<any>;
|
|
14
|
+
getPromotionProductPrice(productId: String, productPrice: number): Promise<any>;
|
|
15
|
+
getVoucherAvailableForCustomer(campaignId: string, campaignActionId: string, customerId: string, excludeExpired: Boolean, isPageAble: Boolean): Promise<any>;
|
|
16
|
+
addCustomerToVoucher(voucherCode: string, userId: string, affiliateId: string): Promise<any>;
|
|
17
|
+
suggestVoucher(customerId: string, campaignId: string, campaignActionId: string, isBirthday: Boolean): Promise<any>;
|
|
18
|
+
getCampaignActionById(id: string): Promise<any>;
|
|
19
|
+
searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
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.CampaignService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const queries_1 = require("../../graphql/campaign/queries");
|
|
15
|
+
const mutations_1 = require("../../graphql/campaign/mutations");
|
|
16
|
+
class CampaignService extends serviceSDK_1.Service {
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a new CampaignService instance.
|
|
19
|
+
* @param endpoint - The endpoint URL for the service.
|
|
20
|
+
* @param orgId - The organization ID.
|
|
21
|
+
* @param storeId - The store ID.
|
|
22
|
+
*/
|
|
23
|
+
constructor(endpoint, orgId, storeId) {
|
|
24
|
+
super(endpoint, orgId, storeId);
|
|
25
|
+
}
|
|
26
|
+
getCampaignActionActiveNow(customerId, campaignActionType) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const query = queries_1.GET_CAMPAIGN_ACTION_ACTIVE_NOW;
|
|
29
|
+
const variables = {
|
|
30
|
+
partyId: this.orgId,
|
|
31
|
+
productStoreId: this.storeId,
|
|
32
|
+
customerId,
|
|
33
|
+
campaignActionType,
|
|
34
|
+
};
|
|
35
|
+
try {
|
|
36
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
37
|
+
return response.getCampaignActionActiveNow;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.log(`Error fetching getCampaignActionActiveNow: ${error}`);
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
searchVouchers(campaignId, campaignActionId, campaignActionType, customerId, excludeExpired, pageNumber, pageSize) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const query = queries_1.GET_VOUCHERS;
|
|
48
|
+
const variables = {
|
|
49
|
+
partyId: this.orgId,
|
|
50
|
+
storeId: this.storeId,
|
|
51
|
+
campaignId,
|
|
52
|
+
campaignActionId,
|
|
53
|
+
campaignActionType,
|
|
54
|
+
customerId,
|
|
55
|
+
excludeExpired,
|
|
56
|
+
pageNumber,
|
|
57
|
+
pageSize,
|
|
58
|
+
};
|
|
59
|
+
try {
|
|
60
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
61
|
+
return response.searchVoucher;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.log(`Error fetching searchVoucher: ${error}`);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
checkValidVoucher(customerId, voucherCode) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const query = queries_1.CHECK_VALID_VOUCHER;
|
|
72
|
+
const variables = {
|
|
73
|
+
partyId: this.orgId,
|
|
74
|
+
productStoreId: this.storeId,
|
|
75
|
+
customerId,
|
|
76
|
+
voucherCode,
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
80
|
+
return response.checkValidVoucher;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.log(`Error fetching searchVoucher: ${error}`);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getCampaignActiveNow(campaignActionType, customerId) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const query = queries_1.GET_CAMPAIGN_ACTIVE_NOW;
|
|
91
|
+
const variables = {
|
|
92
|
+
partyId: this.orgId,
|
|
93
|
+
productStoreId: this.storeId,
|
|
94
|
+
campaignActionType,
|
|
95
|
+
customerId,
|
|
96
|
+
};
|
|
97
|
+
try {
|
|
98
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
99
|
+
return response.getCampaignActiveNow;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
getPromotionProductPrice(productId, productPrice) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const query = queries_1.GET_PROMOTION_PRODUCT_PRICE;
|
|
109
|
+
const variables = {
|
|
110
|
+
partyId: this.orgId,
|
|
111
|
+
productStoreId: this.storeId,
|
|
112
|
+
productId,
|
|
113
|
+
productPrice,
|
|
114
|
+
};
|
|
115
|
+
try {
|
|
116
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
117
|
+
return response.getPromotionProductPrice;
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
getVoucherAvailableForCustomer(campaignId, campaignActionId, customerId, excludeExpired, isPageAble) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const query = queries_1.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER;
|
|
127
|
+
const variables = {
|
|
128
|
+
partyId: this.orgId,
|
|
129
|
+
storeId: this.storeId,
|
|
130
|
+
campaignId,
|
|
131
|
+
campaignActionId,
|
|
132
|
+
customerId,
|
|
133
|
+
excludeExpired,
|
|
134
|
+
isPageAble,
|
|
135
|
+
};
|
|
136
|
+
try {
|
|
137
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
138
|
+
return response.getVoucherAvailableForCustomer;
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
addCustomerToVoucher(voucherCode, userId, affiliateId) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const query = mutations_1.ADD_CUSTOMER_ID_INTO_VOUCHER;
|
|
148
|
+
const variables = {
|
|
149
|
+
partyId: this.orgId,
|
|
150
|
+
voucherCode,
|
|
151
|
+
userId,
|
|
152
|
+
affiliateId,
|
|
153
|
+
};
|
|
154
|
+
try {
|
|
155
|
+
const response = yield this.graphqlMutation(query, variables);
|
|
156
|
+
return response.addCustomerIdIntoVoucher;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
suggestVoucher(customerId, campaignId, campaignActionId, isBirthday) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const query = queries_1.SUGGEST_VOUCHER;
|
|
166
|
+
const variables = {
|
|
167
|
+
partyId: this.orgId,
|
|
168
|
+
customerId: customerId,
|
|
169
|
+
campaignId: campaignId,
|
|
170
|
+
campaignActionId: campaignActionId,
|
|
171
|
+
excludeExpired: true,
|
|
172
|
+
isBirthday: isBirthday,
|
|
173
|
+
};
|
|
174
|
+
try {
|
|
175
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
176
|
+
return response.suggestVoucher;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
getCampaignActionById(id) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
|
|
186
|
+
const variables = {
|
|
187
|
+
id,
|
|
188
|
+
};
|
|
189
|
+
try {
|
|
190
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
191
|
+
return response.getCampaignActionById;
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
throw error;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
searchProductGiftPromotionResponse(productIds, campaignActionId) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
|
|
201
|
+
const variables = {
|
|
202
|
+
partyId: this.orgId,
|
|
203
|
+
storeId: this.storeId,
|
|
204
|
+
productIds: productIds,
|
|
205
|
+
campaignActionId: campaignActionId,
|
|
206
|
+
sort: { asc: true, key: "createdStamp" },
|
|
207
|
+
};
|
|
208
|
+
try {
|
|
209
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
210
|
+
return response.searchProductGiftPromotionResponse;
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
throw error;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
exports.CampaignService = CampaignService;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class CashbookService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
searchTransactions(keyword: string, dateFrom: number, dateTo: number, currentPage: number, pageSize: number): Promise<any>;
|
|
5
|
+
getCashbookTransactionDetail(cashTransactionId: string): Promise<any>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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.CashbookService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const queries_1 = require("../../graphql/cashbook/queries");
|
|
15
|
+
class CashbookService extends serviceSDK_1.Service {
|
|
16
|
+
constructor(endpoint, orgId, storeId) {
|
|
17
|
+
super(endpoint, orgId, storeId);
|
|
18
|
+
}
|
|
19
|
+
searchTransactions(keyword, dateFrom, dateTo, currentPage, pageSize) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const query = queries_1.SEARCH_TRANSACTIONS;
|
|
22
|
+
const variables = {
|
|
23
|
+
partnerId: this.orgId,
|
|
24
|
+
keyword,
|
|
25
|
+
dateFrom,
|
|
26
|
+
dateTo,
|
|
27
|
+
currentPage,
|
|
28
|
+
pageSize,
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
32
|
+
return response.searchTransactions;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
getCashbookTransactionDetail(cashTransactionId) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const query = queries_1.GET_CASHBOOK_TRANSACTION_DETAIL;
|
|
42
|
+
const variables = {
|
|
43
|
+
partnerId: this.orgId,
|
|
44
|
+
cashTransactionId,
|
|
45
|
+
};
|
|
46
|
+
try {
|
|
47
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
48
|
+
return response.getCashbookTransactionDetail;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.CashbookService = CashbookService;
|
|
@@ -11,6 +11,10 @@ export declare class CloudService extends Service {
|
|
|
11
11
|
setToken(token: string): void;
|
|
12
12
|
setStoreId(storeId: string): void;
|
|
13
13
|
serviceDetail(serviceId: string): Promise<any>;
|
|
14
|
+
updateServiceCompleted(serviceId: string, handleBy: string): Promise<any>;
|
|
15
|
+
updateServiceNew(serviceId: string, handleBy: string): Promise<any>;
|
|
16
|
+
updateServiceReadyDeploy(serviceId: string, handleBy: string): Promise<any>;
|
|
17
|
+
updateUrlPublic(serviceId: string, handleBy: string, urlPublic: string): Promise<any>;
|
|
14
18
|
getMailResource(serviceId: string): Promise<any>;
|
|
15
19
|
changeServiceName(serviceId: string, updateBy: string, updateData: string): Promise<any>;
|
|
16
20
|
getUserMailHosting(serviceId: string): Promise<any>;
|
|
@@ -39,9 +43,12 @@ export declare class CloudService extends Service {
|
|
|
39
43
|
getDomainInfo(domainName: string): Promise<any>;
|
|
40
44
|
getDomainSupplier(serviceId: string): Promise<any>;
|
|
41
45
|
checkDomainExist(domainName: string): Promise<any>;
|
|
46
|
+
checkEnterpriseByTaxCodeDynamic(domainName: string, taxCode: string, checkPromotion: boolean, domainResumeId: string | null, fields: string[]): Promise<any>;
|
|
47
|
+
checkBusinessByTaxCodeDynamic(domainName: string, taxCode: string, checkPromotion: boolean, domainResumeId: string | null, fields: string[]): Promise<any>;
|
|
42
48
|
getOrderChangeResourceTerm(serviceId: string, createdBy: string): Promise<any>;
|
|
43
49
|
searchActions(parameter: any): Promise<any>;
|
|
44
50
|
createActionChangeIpOfService(action: any, byUser: string): Promise<any>;
|
|
45
51
|
updateActionStatus(actionId: string, status: string, byUser: string): Promise<any>;
|
|
46
52
|
updateActionCustomAttribute(actionId: string, attrName: string, attrValue: string, byUser: string): Promise<any>;
|
|
53
|
+
getElasticCloudResource(serviceId: string): Promise<any>;
|
|
47
54
|
}
|
|
@@ -45,6 +45,75 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
updateServiceCompleted(serviceId, handleBy) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const mutation = mutations_1.UPDATE_SERVICE_COMPLETED;
|
|
51
|
+
const variables = {
|
|
52
|
+
serviceId,
|
|
53
|
+
handleBy,
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
57
|
+
return response.updateServiceCompleted;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.log(`Error in updateServiceCompleted: ${error}`);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
updateServiceNew(serviceId, handleBy) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const mutation = mutations_1.UPDATE_SERVICE_NEW;
|
|
68
|
+
const variables = {
|
|
69
|
+
serviceId,
|
|
70
|
+
handleBy,
|
|
71
|
+
};
|
|
72
|
+
try {
|
|
73
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
74
|
+
return response.updateServiceNew;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.log(`Error in updateServiceNew: ${error}`);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
updateServiceReadyDeploy(serviceId, handleBy) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const mutation = mutations_1.UPDATE_SERVICE_READY_DEPLOY;
|
|
85
|
+
const variables = {
|
|
86
|
+
serviceId,
|
|
87
|
+
handleBy,
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
91
|
+
return response.updateServiceReadyDeploy;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.log(`Error in updateServiceReadyDeploy: ${error}`);
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
updateUrlPublic(serviceId, handleBy, urlPublic) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const mutation = mutations_1.UPDATE_URL_PUBLIC;
|
|
102
|
+
const variables = {
|
|
103
|
+
serviceId,
|
|
104
|
+
handleBy,
|
|
105
|
+
urlPublic
|
|
106
|
+
};
|
|
107
|
+
try {
|
|
108
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
109
|
+
return response.updateUrlPublic;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.log(`Error in updateUrlPublic: ${error}`);
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
48
117
|
getMailResource(serviceId) {
|
|
49
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
119
|
const query = queries_1.GET_MAIL_RESOURCE;
|
|
@@ -522,6 +591,44 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
522
591
|
}
|
|
523
592
|
});
|
|
524
593
|
}
|
|
594
|
+
checkEnterpriseByTaxCodeDynamic(domainName, taxCode, checkPromotion, domainResumeId, fields) {
|
|
595
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
596
|
+
const mutation = (0, mutations_1.CHECK_ENTERPRISE_BY_TAX_CODE_DYNAMIC)(fields);
|
|
597
|
+
const variables = {
|
|
598
|
+
domainName,
|
|
599
|
+
taxCode,
|
|
600
|
+
checkPromotion,
|
|
601
|
+
domainResumeId
|
|
602
|
+
};
|
|
603
|
+
try {
|
|
604
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
605
|
+
return response.checkEnterpriseByTaxCode;
|
|
606
|
+
}
|
|
607
|
+
catch (error) {
|
|
608
|
+
console.log(`Error in checkEnterpriseByTaxCodeDynamic: ${error}`);
|
|
609
|
+
throw error;
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
checkBusinessByTaxCodeDynamic(domainName, taxCode, checkPromotion, domainResumeId, fields) {
|
|
614
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
615
|
+
const mutation = (0, mutations_1.CHECK_BUSINESS_BY_TAX_CODE_DYNAMIC)(fields);
|
|
616
|
+
const variables = {
|
|
617
|
+
domainName,
|
|
618
|
+
taxCode,
|
|
619
|
+
checkPromotion,
|
|
620
|
+
domainResumeId
|
|
621
|
+
};
|
|
622
|
+
try {
|
|
623
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
624
|
+
return response.checkBusinessByTaxCode;
|
|
625
|
+
}
|
|
626
|
+
catch (error) {
|
|
627
|
+
console.log(`Error in checkBusinessByTaxCodeDynamic: ${error}`);
|
|
628
|
+
throw error;
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
}
|
|
525
632
|
getOrderChangeResourceTerm(serviceId, createdBy) {
|
|
526
633
|
return __awaiter(this, void 0, void 0, function* () {
|
|
527
634
|
const mutation = mutations_1.GET_ORDER_CHANGE_RESOURCE_TERM;
|
|
@@ -611,5 +718,21 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
611
718
|
}
|
|
612
719
|
});
|
|
613
720
|
}
|
|
721
|
+
getElasticCloudResource(serviceId) {
|
|
722
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
723
|
+
const query = queries_1.GET_ELASTIC_CLOUD_RESOURCE;
|
|
724
|
+
const variables = {
|
|
725
|
+
serviceId,
|
|
726
|
+
};
|
|
727
|
+
try {
|
|
728
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
729
|
+
return response.getElasticCloudResource;
|
|
730
|
+
}
|
|
731
|
+
catch (error) {
|
|
732
|
+
console.log(`Error in getElasticCloudResource: ${error}`);
|
|
733
|
+
throw error;
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
}
|
|
614
737
|
}
|
|
615
738
|
exports.CloudService = CloudService;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class ComhubService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
sendZns(dataTemplate: any, appId: string, messageType: string): Promise<any>;
|
|
5
|
+
sendMessage(OAId: string, content: string, contentType: string, senderPartyId: string, receivePartyIds: [string]): Promise<any>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.ComhubService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class ComhubService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
sendZns(dataTemplate, appId, messageType) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const endpoint = `/web-hook/message/v2/send/social/ZNS/app/${appId}/message-type/${messageType}`;
|
|
21
|
+
const method = "POST";
|
|
22
|
+
try {
|
|
23
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method, dataTemplate);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
sendMessage(OAId, content, contentType, senderPartyId, receivePartyIds) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const endpoint = `/web-hook/message/send/social/app/${OAId}`;
|
|
34
|
+
const method = "POST";
|
|
35
|
+
const dataRequet = {
|
|
36
|
+
content,
|
|
37
|
+
senderPartyId,
|
|
38
|
+
receivePartyIds,
|
|
39
|
+
};
|
|
40
|
+
try {
|
|
41
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method, dataRequet);
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ComhubService = ComhubService;
|