@longvansoftware/service-js-client 1.16.1 → 1.16.2
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/README.md +93 -93
- package/dist/src/graphql/accounting_service/mutations.js +96 -96
- package/dist/src/graphql/accounting_service/queries.js +57 -57
- package/dist/src/graphql/auth/mutations.js +235 -235
- package/dist/src/graphql/auth/queries.js +68 -68
- package/dist/src/graphql/cloud/mutations.js +282 -282
- package/dist/src/graphql/cloud/queries.js +341 -341
- package/dist/src/graphql/computing/mutations.js +303 -303
- package/dist/src/graphql/computing/queries.js +548 -548
- package/dist/src/graphql/crm/mutations.js +390 -390
- package/dist/src/graphql/crm/queries.js +357 -357
- package/dist/src/graphql/crm_camping/mutations.js +32 -32
- package/dist/src/graphql/crm_camping/queries.js +228 -199
- package/dist/src/graphql/orderGraphQL/mutations.js +351 -351
- package/dist/src/graphql/orderGraphQL/queries.js +387 -387
- package/dist/src/graphql/payment/mutations.js +45 -45
- package/dist/src/graphql/payment/queries.js +60 -60
- package/dist/src/graphql/paymentLV/mutations.js +19 -19
- package/dist/src/graphql/paymentLV/queries.js +75 -75
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +910 -892
- package/dist/src/graphql/quicklab_service/mutations.js +154 -154
- package/dist/src/graphql/quicklab_service/queries.js +108 -108
- package/dist/src/graphql/resource_permission/mutations.js +57 -57
- package/dist/src/graphql/resource_permission/queries.js +13 -13
- package/dist/src/graphql/service/mutations.js +228 -228
- package/dist/src/graphql/service/queries.js +128 -128
- package/dist/src/graphql/user/mutations.js +214 -214
- package/dist/src/graphql/user/queries.js +312 -312
- package/dist/src/lib/crm_camping/index.d.ts +1 -1
- package/dist/src/lib/crm_camping/index.js +10 -6
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +18 -0
- package/dist/src/lib/service.d.ts +14 -0
- package/dist/src/lib/service.js +101 -0
- package/dist/src/lib/serviceSDK.js +12 -12
- package/dist/src/utils/build-field-string.d.ts +1 -0
- package/dist/src/utils/build-field-string.js +16 -0
- package/package.json +43 -44
- package/dist/src/graphql/campaign/mutations.d.ts +0 -1
- package/dist/src/graphql/campaign/mutations.js +0 -34
- package/dist/src/graphql/campaign/queries.d.ts +0 -9
- package/dist/src/graphql/campaign/queries.js +0 -412
- package/dist/src/graphql/cashbook/queries.d.ts +0 -2
- package/dist/src/graphql/cashbook/queries.js +0 -99
- package/dist/src/graphql/paymentV2/mutations.d.ts +0 -3
- package/dist/src/graphql/paymentV2/mutations.js +0 -54
- package/dist/src/graphql/paymentV2/queries.d.ts +0 -6
- package/dist/src/graphql/paymentV2/queries.js +0 -186
- package/dist/src/graphql/store/mutations.d.ts +0 -1
- package/dist/src/graphql/store/mutations.js +0 -29
- package/dist/src/graphql/store/queries.d.ts +0 -1
- package/dist/src/graphql/store/queries.js +0 -29
- package/dist/src/lib/accounting/index.d.ts +0 -5
- package/dist/src/lib/accounting/index.js +0 -32
- package/dist/src/lib/campaign/index.d.ts +0 -20
- package/dist/src/lib/campaign/index.js +0 -213
- package/dist/src/lib/cashbook/index.d.ts +0 -6
- package/dist/src/lib/cashbook/index.js +0 -56
- package/dist/src/lib/comhub/index.d.ts +0 -6
- package/dist/src/lib/comhub/index.js +0 -50
- package/dist/src/lib/deepLinkVietQr/index.d.ts +0 -6
- package/dist/src/lib/deepLinkVietQr/index.js +0 -45
- package/dist/src/lib/getImage/index.d.ts +0 -4
- package/dist/src/lib/getImage/index.js +0 -10
- package/dist/src/lib/image/index.d.ts +0 -7
- package/dist/src/lib/image/index.js +0 -49
- package/dist/src/lib/omnigateway/index.d.ts +0 -7
- package/dist/src/lib/omnigateway/index.js +0 -58
- package/dist/src/lib/paymentV2/index.d.ts +0 -13
- package/dist/src/lib/paymentV2/index.js +0 -163
- package/dist/src/lib/portal/index.d.ts +0 -21
- package/dist/src/lib/portal/index.js +0 -225
- package/dist/src/lib/store/index.d.ts +0 -30
- package/dist/src/lib/store/index.js +0 -74
- package/dist/src/lib/token/index.d.ts +0 -5
- package/dist/src/lib/token/index.js +0 -32
- package/dist/src/lib/upload/index.d.ts +0 -5
- package/dist/src/lib/upload/index.js +0 -35
- package/dist/src/lib/warehouseV2/index.d.ts +0 -13
- package/dist/src/lib/warehouseV2/index.js +0 -54
- package/dist/src/lib/zca/index.d.ts +0 -12
- package/dist/src/lib/zca/index.js +0 -41
- package/dist/src/types/campaign.d.ts +0 -14
- package/dist/src/types/campaign.js +0 -2
- package/dist/src/types/invoice.d.ts +0 -13
- package/dist/src/types/invoice.js +0 -2
- package/dist/src/types/store.d.ts +0 -158
- package/dist/src/types/store.js +0 -3
- package/dist/src/utils/validatePhoneNumber.d.ts +0 -1
- package/dist/src/utils/validatePhoneNumber.js +0 -20
@@ -1,186 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GW_CONFIG_DETAIL = exports.PAYMENT_STATUS = exports.PAYMENT_INFO = exports.GET_PAYMENT_METHOD_TYPES = exports.PAYMENT_METHODS = exports.PAYMENTS_BY_ORDERS = void 0;
|
4
|
-
const graphql_tag_1 = require("graphql-tag");
|
5
|
-
exports.PAYMENTS_BY_ORDERS = (0, graphql_tag_1.gql) `
|
6
|
-
query PaymentsByOrders($orderIds: [String!]!) {
|
7
|
-
paymentsByOrders(orderIds: $orderIds) {
|
8
|
-
methodCode
|
9
|
-
methodTypeCode
|
10
|
-
gatewayConfigId
|
11
|
-
partnerCode
|
12
|
-
totalAmount
|
13
|
-
fee
|
14
|
-
discountAmount
|
15
|
-
payDate
|
16
|
-
payType
|
17
|
-
transactionDate
|
18
|
-
orderId
|
19
|
-
paymentId
|
20
|
-
invoiceId
|
21
|
-
orderInfo
|
22
|
-
orderType
|
23
|
-
locale
|
24
|
-
merchantIp
|
25
|
-
extraData
|
26
|
-
storeID
|
27
|
-
bankCode
|
28
|
-
appUser
|
29
|
-
phone
|
30
|
-
email
|
31
|
-
address
|
32
|
-
statusCode
|
33
|
-
statusDescription
|
34
|
-
transactionId
|
35
|
-
createBy
|
36
|
-
methodDescription
|
37
|
-
methodMapping
|
38
|
-
baseMethodCode
|
39
|
-
confirmPaidBy
|
40
|
-
confirmPaidDate
|
41
|
-
qrCode
|
42
|
-
payUrl
|
43
|
-
paymentNote
|
44
|
-
}
|
45
|
-
}
|
46
|
-
`;
|
47
|
-
exports.PAYMENT_METHODS = (0, graphql_tag_1.gql) `
|
48
|
-
query PaymentMethods($partnerCode: String) {
|
49
|
-
paymentMethods(partnerCode: $partnerCode) {
|
50
|
-
id
|
51
|
-
code
|
52
|
-
name
|
53
|
-
description
|
54
|
-
image
|
55
|
-
}
|
56
|
-
}
|
57
|
-
`;
|
58
|
-
exports.GET_PAYMENT_METHOD_TYPES = (0, graphql_tag_1.gql) `
|
59
|
-
query GetPaymentMethodTypes($partnerId: String!, $storeId: String!) {
|
60
|
-
getPaymentMethodTypes(partnerId: $partnerId, storeId: $storeId) {
|
61
|
-
code
|
62
|
-
name
|
63
|
-
description
|
64
|
-
image
|
65
|
-
}
|
66
|
-
}
|
67
|
-
`;
|
68
|
-
exports.PAYMENT_INFO = (0, graphql_tag_1.gql) `
|
69
|
-
query PaymentInfo($paymentId: String!) {
|
70
|
-
paymentInfo(paymentId: $paymentId) {
|
71
|
-
id
|
72
|
-
payType
|
73
|
-
payDate
|
74
|
-
dueDate
|
75
|
-
completePayment
|
76
|
-
paymentTerm
|
77
|
-
methodCode
|
78
|
-
methodTypeCode
|
79
|
-
gatewayConfigId
|
80
|
-
partnerCode
|
81
|
-
totalAmount
|
82
|
-
remain
|
83
|
-
currCode
|
84
|
-
invoiceId
|
85
|
-
orderId
|
86
|
-
orderInfo
|
87
|
-
orderGroup
|
88
|
-
orderType
|
89
|
-
returnUrl
|
90
|
-
ipnUrl
|
91
|
-
merchantIp
|
92
|
-
extraData
|
93
|
-
storeID
|
94
|
-
bankCode
|
95
|
-
appUser
|
96
|
-
phone
|
97
|
-
email
|
98
|
-
address
|
99
|
-
signature
|
100
|
-
createBy
|
101
|
-
transactionId
|
102
|
-
baseMethodCode
|
103
|
-
retry
|
104
|
-
postToOrder
|
105
|
-
editAble
|
106
|
-
approved
|
107
|
-
statusCode
|
108
|
-
paymentGroup
|
109
|
-
userId
|
110
|
-
type
|
111
|
-
attributes
|
112
|
-
items {
|
113
|
-
id
|
114
|
-
partnerCode
|
115
|
-
paymentId
|
116
|
-
type
|
117
|
-
orderId
|
118
|
-
invoiceId
|
119
|
-
orderGroup
|
120
|
-
orderType
|
121
|
-
orderInfo
|
122
|
-
totalAmount
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
`;
|
127
|
-
exports.PAYMENT_STATUS = (0, graphql_tag_1.gql) `
|
128
|
-
query PaymentStatus($paymentId: String!) {
|
129
|
-
paymentStatus(paymentId: $paymentId) {
|
130
|
-
methodCode
|
131
|
-
methodTypeCode
|
132
|
-
gatewayConfigId
|
133
|
-
partnerCode
|
134
|
-
totalAmount
|
135
|
-
fee
|
136
|
-
discountAmount
|
137
|
-
payDate
|
138
|
-
payType
|
139
|
-
transactionDate
|
140
|
-
paymentId
|
141
|
-
invoiceId
|
142
|
-
orderInfo
|
143
|
-
orderType
|
144
|
-
locale
|
145
|
-
merchantIp
|
146
|
-
extraData
|
147
|
-
storeID
|
148
|
-
bankCode
|
149
|
-
appUser
|
150
|
-
phone
|
151
|
-
email
|
152
|
-
address
|
153
|
-
statusCode
|
154
|
-
statusDescription
|
155
|
-
transactionId
|
156
|
-
createBy
|
157
|
-
methodDescription
|
158
|
-
methodMapping
|
159
|
-
baseMethodCode
|
160
|
-
confirmPaidBy
|
161
|
-
confirmPaidDate
|
162
|
-
qrCode
|
163
|
-
payUrl
|
164
|
-
attributes
|
165
|
-
}
|
166
|
-
}
|
167
|
-
`;
|
168
|
-
exports.GW_CONFIG_DETAIL = (0, graphql_tag_1.gql) `
|
169
|
-
query GwConfigDetail($configId: String!) {
|
170
|
-
gwConfigDetail(configId: $configId) {
|
171
|
-
id
|
172
|
-
name
|
173
|
-
methodCode
|
174
|
-
partnerCode
|
175
|
-
subMethodCode
|
176
|
-
gwPartnerCode
|
177
|
-
gwPartnerName
|
178
|
-
gwSubChannel
|
179
|
-
gwMethodVersion
|
180
|
-
accessKey
|
181
|
-
secretKey
|
182
|
-
description
|
183
|
-
activated
|
184
|
-
}
|
185
|
-
}
|
186
|
-
`;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const CREATE_STORE_MUTATION: import("graphql").DocumentNode;
|
@@ -1,29 +0,0 @@
|
|
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
|
-
`;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const GET_STORE_CHANNEL_BY_EMP_ID_QUERY: import("graphql").DocumentNode;
|
@@ -1,29 +0,0 @@
|
|
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
|
-
`;
|
@@ -1,32 +0,0 @@
|
|
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;
|
@@ -1,20 +0,0 @@
|
|
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): Promise<any>;
|
18
|
-
getCampaignActionById(id: string): Promise<any>;
|
19
|
-
searchProductGiftPromotionResponse(campaignActionId: string): Promise<any>;
|
20
|
-
}
|
@@ -1,213 +0,0 @@
|
|
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) {
|
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
|
-
excludeExpired: true,
|
170
|
-
};
|
171
|
-
try {
|
172
|
-
const response = yield this.graphqlQuery(query, variables);
|
173
|
-
return response.suggestVoucher;
|
174
|
-
}
|
175
|
-
catch (error) {
|
176
|
-
throw error;
|
177
|
-
}
|
178
|
-
});
|
179
|
-
}
|
180
|
-
getCampaignActionById(id) {
|
181
|
-
return __awaiter(this, void 0, void 0, function* () {
|
182
|
-
const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
|
183
|
-
const variables = {
|
184
|
-
id,
|
185
|
-
};
|
186
|
-
try {
|
187
|
-
const response = yield this.graphqlQuery(query, variables);
|
188
|
-
return response.getCampaignActionById;
|
189
|
-
}
|
190
|
-
catch (error) {
|
191
|
-
throw error;
|
192
|
-
}
|
193
|
-
});
|
194
|
-
}
|
195
|
-
searchProductGiftPromotionResponse(campaignActionId) {
|
196
|
-
return __awaiter(this, void 0, void 0, function* () {
|
197
|
-
const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
|
198
|
-
const variables = {
|
199
|
-
partyId: this.orgId,
|
200
|
-
storeId: this.storeId,
|
201
|
-
campaignActionId: campaignActionId,
|
202
|
-
};
|
203
|
-
try {
|
204
|
-
const response = yield this.graphqlQuery(query, variables);
|
205
|
-
return response.searchProductGiftPromotionResponse;
|
206
|
-
}
|
207
|
-
catch (error) {
|
208
|
-
throw error;
|
209
|
-
}
|
210
|
-
});
|
211
|
-
}
|
212
|
-
}
|
213
|
-
exports.CampaignService = CampaignService;
|
@@ -1,6 +0,0 @@
|
|
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
|
-
}
|
@@ -1,56 +0,0 @@
|
|
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;
|
@@ -1,6 +0,0 @@
|
|
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
|
-
}
|
@@ -1,50 +0,0 @@
|
|
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;
|