@longvansoftware/service-js-client 2.6.9 → 2.7.1
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 +39 -111
- package/dist/src/graphql/cloud/mutations.js +6 -6
- package/dist/src/graphql/crm_camping/queries.js +16 -59
- package/dist/src/graphql/marketplace/mutations.d.ts +3 -0
- package/dist/src/graphql/marketplace/mutations.js +54 -0
- package/dist/src/graphql/marketplace/queries.d.ts +2 -0
- package/dist/src/graphql/marketplace/queries.js +42 -0
- package/dist/src/graphql/paymentV2/mutations.d.ts +1 -0
- package/dist/src/graphql/paymentV2/mutations.js +15 -1
- package/dist/src/graphql/paymentV2/queries.d.ts +2 -0
- package/dist/src/graphql/paymentV2/queries.js +58 -1
- package/dist/src/graphql/storefont/mutation.d.ts +0 -0
- package/dist/src/graphql/storefont/mutation.js +1 -0
- package/dist/src/graphql/storefont/queries.d.ts +2 -0
- package/dist/src/graphql/storefont/queries.js +46 -0
- package/dist/src/graphql/tag/mutations.d.ts +2 -0
- package/dist/src/graphql/tag/mutations.js +44 -0
- package/dist/src/graphql/tag/queries.d.ts +1 -0
- package/dist/src/graphql/tag/queries.js +20 -0
- package/dist/src/lib/campaign/index.d.ts +1 -0
- package/dist/src/lib/campaign/index.js +69 -12
- package/dist/src/lib/cloud/index.d.ts +6 -6
- package/dist/src/lib/cloud/index.js +12 -12
- package/dist/src/lib/marketplace/index.d.ts +9 -0
- package/dist/src/lib/marketplace/index.js +106 -0
- package/dist/src/lib/paymentV2/index.d.ts +10 -0
- package/dist/src/lib/paymentV2/index.js +39 -0
- package/dist/src/lib/portal/index.d.ts +3 -0
- package/dist/src/lib/portal/index.js +50 -0
- package/dist/src/lib/storefont/index.d.ts +6 -0
- package/dist/src/lib/storefont/index.js +51 -0
- package/dist/src/lib/tag/index.d.ts +7 -0
- package/dist/src/lib/tag/index.js +61 -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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = exports.GET_REVENUE_STATISTIC_BY_PRODUCT = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.GET_REVENUE_STATISTIC_BY_PRODUCT = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetRevenueStatisticByProduct($input: ProductStatisticPagedInput!) {
|
|
7
|
+
getRevenueStatisticByProduct(input: $input) {
|
|
8
|
+
totalElements
|
|
9
|
+
totalPages
|
|
10
|
+
page
|
|
11
|
+
size
|
|
12
|
+
content {
|
|
13
|
+
id
|
|
14
|
+
name
|
|
15
|
+
sku
|
|
16
|
+
image
|
|
17
|
+
productParentId
|
|
18
|
+
totalQuantity
|
|
19
|
+
inventory
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = (0, graphql_tag_1.gql) `
|
|
25
|
+
query GetRevenueStatisticByGroupOrCategory(
|
|
26
|
+
$input: ProductStatisticInput!
|
|
27
|
+
$groupBy: StatisticGroupBy!
|
|
28
|
+
) {
|
|
29
|
+
getRevenueStatisticByGroupOrCategory(input: $input, groupBy: $groupBy) {
|
|
30
|
+
totalElements
|
|
31
|
+
totalPages
|
|
32
|
+
page
|
|
33
|
+
size
|
|
34
|
+
content {
|
|
35
|
+
id
|
|
36
|
+
name
|
|
37
|
+
totalOrders
|
|
38
|
+
totalPriceOfSales
|
|
39
|
+
totalPriceOfService
|
|
40
|
+
totalPriceOfRenewals
|
|
41
|
+
totalPrice
|
|
42
|
+
totalNotPayYet
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REMOVE_TAG_TO_TAG_GROUP = exports.ADD_TAG_TO_TAG_GROUP = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.ADD_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
|
|
6
|
+
mutation AddTagToTagGroup(
|
|
7
|
+
$resourceId: String!
|
|
8
|
+
$resourceType: String!
|
|
9
|
+
$tagId: String!
|
|
10
|
+
$tagGroupId: String
|
|
11
|
+
$addedBy: String!
|
|
12
|
+
) {
|
|
13
|
+
addTagToTagGroup(
|
|
14
|
+
resourceId: $resourceId
|
|
15
|
+
resourceType: $resourceType
|
|
16
|
+
tagId: $tagId
|
|
17
|
+
tagGroupId: $tagGroupId
|
|
18
|
+
addedBy: $addedBy
|
|
19
|
+
) {
|
|
20
|
+
code
|
|
21
|
+
message
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
exports.REMOVE_TAG_TO_TAG_GROUP = (0, graphql_tag_1.gql) `
|
|
26
|
+
mutation RemoveTagToTagGroup(
|
|
27
|
+
$resourceId: String!
|
|
28
|
+
$resourceType: String!
|
|
29
|
+
$tagId: String!
|
|
30
|
+
$tagGroupId: String
|
|
31
|
+
$updateBy: String!
|
|
32
|
+
) {
|
|
33
|
+
removeTagToTagGroup(
|
|
34
|
+
resourceId: $resourceId
|
|
35
|
+
resourceType: $resourceType
|
|
36
|
+
tagId: $tagId
|
|
37
|
+
tagGroupId: $tagGroupId
|
|
38
|
+
updateBy: $updateBy
|
|
39
|
+
) {
|
|
40
|
+
code
|
|
41
|
+
message
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GET_RESULT_TAG: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_RESULT_TAG = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.GET_RESULT_TAG = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetResultTag($resourceId: String!, $resourceType: String!) {
|
|
7
|
+
getResultTag(resourceId: $resourceId, resourceType: $resourceType) {
|
|
8
|
+
id
|
|
9
|
+
title
|
|
10
|
+
items {
|
|
11
|
+
id
|
|
12
|
+
title
|
|
13
|
+
items {
|
|
14
|
+
id
|
|
15
|
+
title
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
@@ -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,62 @@ 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
|
+
isBirthday
|
|
257
|
+
discountAmount
|
|
258
|
+
discountPercent
|
|
259
|
+
usageLimitPerVoucher
|
|
260
|
+
numberOfTimeUsed
|
|
261
|
+
maximumDiscount
|
|
262
|
+
maximumDiscountType
|
|
263
|
+
memberLevel
|
|
264
|
+
affiliateId
|
|
265
|
+
description
|
|
266
|
+
usageLimitType
|
|
267
|
+
minimumSpend
|
|
268
|
+
maximumSpend
|
|
269
|
+
expiryDate
|
|
270
|
+
isUsable
|
|
271
|
+
unusableReasons
|
|
272
|
+
remainingAmount
|
|
273
|
+
discountType
|
|
274
|
+
discountValue
|
|
275
|
+
ownerPartyId
|
|
276
|
+
rewardType
|
|
277
|
+
voucherType
|
|
278
|
+
}`,
|
|
279
|
+
"total",
|
|
280
|
+
"pageNumber",
|
|
281
|
+
"pageSize",
|
|
282
|
+
"totalPages",
|
|
283
|
+
"numberOfElements",
|
|
284
|
+
"first",
|
|
285
|
+
"last"
|
|
286
|
+
]) {
|
|
287
|
+
const query = (0, queries_1.GET_VOUCHER_FOR_USER)(fields);
|
|
288
|
+
const variables = {
|
|
289
|
+
voucherForUserRequest: {
|
|
290
|
+
orderId,
|
|
291
|
+
customerId,
|
|
292
|
+
storeId: this.storeId,
|
|
293
|
+
paymentMethodId,
|
|
294
|
+
shippingCompanyId,
|
|
295
|
+
pageNumber,
|
|
296
|
+
pageSize
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
try {
|
|
300
|
+
const res = yield this.graphqlQuery(query, variables);
|
|
301
|
+
return res.getVouchersForUser;
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
throw error;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
251
308
|
}
|
|
252
309
|
exports.CampaignService = CampaignService;
|
|
@@ -31,17 +31,17 @@ export declare class CloudService extends Service {
|
|
|
31
31
|
getProductsOfService(serviceId: string): Promise<any>;
|
|
32
32
|
getIpsOfService(serviceId: string): Promise<any>;
|
|
33
33
|
getServicesByOrderId(orderId: string): Promise<any>;
|
|
34
|
-
checkDomainNameAvailable(domainName: string): Promise<any>;
|
|
35
|
-
checkDomainNameAvailableVnnic(domainNames: [string]): Promise<any>;
|
|
36
|
-
checkDomainName(domainName: string): Promise<any>;
|
|
37
|
-
checkListDomainName(domainNames: [string]): Promise<any>;
|
|
34
|
+
checkDomainNameAvailable(domainName: string, isClearCache: Boolean): Promise<any>;
|
|
35
|
+
checkDomainNameAvailableVnnic(domainNames: [string], isClearCache: Boolean): Promise<any>;
|
|
36
|
+
checkDomainName(domainName: string, isClearCache: Boolean): Promise<any>;
|
|
37
|
+
checkListDomainName(domainNames: [string], isClearCache: Boolean): Promise<any>;
|
|
38
38
|
getServiceTypeList(): Promise<any>;
|
|
39
39
|
createDomainContact(serviceId: string, domainContacts: any): Promise<any>;
|
|
40
40
|
getDomainContacts(serviceId: string): Promise<any>;
|
|
41
41
|
getOwnersByCustomerId(userId: string): Promise<any>;
|
|
42
42
|
getContactsByOwnerId(ownerId: string): Promise<any>;
|
|
43
|
-
getWhoisDomainInfo(domainName: string): Promise<any>;
|
|
44
|
-
getDomainInfo(domainName: string): Promise<any>;
|
|
43
|
+
getWhoisDomainInfo(domainName: string, isClearCache: Boolean): Promise<any>;
|
|
44
|
+
getDomainInfo(domainName: string, isClearCache: Boolean): Promise<any>;
|
|
45
45
|
getDomainSupplier(serviceId: string): Promise<any>;
|
|
46
46
|
checkDomainExist(domainName: string): Promise<any>;
|
|
47
47
|
checkEnterpriseByTaxCodeDynamic(domainName: string, taxCode: string, checkPromotion: boolean, domainResumeId: string | null, fields: string[]): Promise<any>;
|
|
@@ -380,11 +380,11 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
380
380
|
}
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
|
-
checkDomainNameAvailable(domainName) {
|
|
383
|
+
checkDomainNameAvailable(domainName, isClearCache) {
|
|
384
384
|
return __awaiter(this, void 0, void 0, function* () {
|
|
385
385
|
const mutation = mutations_1.CHECK_DOMAIN_NAME;
|
|
386
386
|
const variables = {
|
|
387
|
-
domainName,
|
|
387
|
+
domainName, isClearCache
|
|
388
388
|
};
|
|
389
389
|
try {
|
|
390
390
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -396,11 +396,11 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
|
-
checkDomainNameAvailableVnnic(domainNames) {
|
|
399
|
+
checkDomainNameAvailableVnnic(domainNames, isClearCache) {
|
|
400
400
|
return __awaiter(this, void 0, void 0, function* () {
|
|
401
401
|
const mutation = mutations_1.CHECK_LIST_DOMAIN_NAME;
|
|
402
402
|
const variables = {
|
|
403
|
-
domainNames,
|
|
403
|
+
domainNames, isClearCache
|
|
404
404
|
};
|
|
405
405
|
try {
|
|
406
406
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -412,11 +412,11 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
412
412
|
}
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
|
-
checkDomainName(domainName) {
|
|
415
|
+
checkDomainName(domainName, isClearCache) {
|
|
416
416
|
return __awaiter(this, void 0, void 0, function* () {
|
|
417
417
|
const mutation = mutations_1.CHECK_DOMAIN_NAME;
|
|
418
418
|
const variables = {
|
|
419
|
-
domainName,
|
|
419
|
+
domainName, isClearCache
|
|
420
420
|
};
|
|
421
421
|
try {
|
|
422
422
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -428,11 +428,11 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
430
|
}
|
|
431
|
-
checkListDomainName(domainNames) {
|
|
431
|
+
checkListDomainName(domainNames, isClearCache) {
|
|
432
432
|
return __awaiter(this, void 0, void 0, function* () {
|
|
433
433
|
const mutation = mutations_1.CHECK_LIST_DOMAIN_NAME;
|
|
434
434
|
const variables = {
|
|
435
|
-
domainNames,
|
|
435
|
+
domainNames, isClearCache
|
|
436
436
|
};
|
|
437
437
|
try {
|
|
438
438
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -540,10 +540,10 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
540
540
|
}
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
getWhoisDomainInfo(domainName) {
|
|
543
|
+
getWhoisDomainInfo(domainName, isClearCache) {
|
|
544
544
|
return __awaiter(this, void 0, void 0, function* () {
|
|
545
545
|
const mutation = mutations_1.GET_DOMAIN_INFO;
|
|
546
|
-
const variables = { domainName };
|
|
546
|
+
const variables = { domainName, isClearCache };
|
|
547
547
|
try {
|
|
548
548
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
549
549
|
return response.getDomainInfo;
|
|
@@ -554,10 +554,10 @@ class CloudService extends serviceSDK_1.Service {
|
|
|
554
554
|
}
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
|
-
getDomainInfo(domainName) {
|
|
557
|
+
getDomainInfo(domainName, isClearCache) {
|
|
558
558
|
return __awaiter(this, void 0, void 0, function* () {
|
|
559
559
|
const mutation = mutations_1.GET_DOMAIN_INFO;
|
|
560
|
-
const variables = { domainName };
|
|
560
|
+
const variables = { domainName, isClearCache };
|
|
561
561
|
try {
|
|
562
562
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
563
563
|
return response.getDomainInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class MarketPlaceService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
createTag(name: string, slug: string, createdBy: string): Promise<any>;
|
|
5
|
+
searchTag(keyword: string, currentPage: number, maxResult: number): Promise<any>;
|
|
6
|
+
getTagsByProductId(productId: string): Promise<any>;
|
|
7
|
+
removeProductTag(productId: string, tagId: string, updatedBy: string, tagGroupId?: string): Promise<any>;
|
|
8
|
+
addProductTag(productId: string, tagId: string, createBy: string, tagGroupId?: string): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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.MarketPlaceService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const queries_1 = require("../../graphql/marketplace/queries");
|
|
15
|
+
const mutations_1 = require("../../graphql/marketplace/mutations");
|
|
16
|
+
class MarketPlaceService extends serviceSDK_1.Service {
|
|
17
|
+
constructor(endpoint, orgId, storeId) {
|
|
18
|
+
super(endpoint, orgId, storeId);
|
|
19
|
+
}
|
|
20
|
+
createTag(name, slug, createdBy) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const mutation = mutations_1.CREATE_TAG;
|
|
23
|
+
const variables = {
|
|
24
|
+
name,
|
|
25
|
+
slug,
|
|
26
|
+
createdBy,
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
30
|
+
return response.createTag;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
searchTag(keyword, currentPage, maxResult) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const queries = queries_1.SEARCH_TAG;
|
|
40
|
+
const variables = {
|
|
41
|
+
keyword,
|
|
42
|
+
currentPage,
|
|
43
|
+
maxResult,
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
const response = yield this.graphqlQuery(queries, variables);
|
|
47
|
+
return response.searchTag;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getTagsByProductId(productId) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const queries = queries_1.GET_TAGS_BY_PRODUCT_ID;
|
|
57
|
+
const variables = {
|
|
58
|
+
productId,
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
const response = yield this.graphqlQuery(queries, variables);
|
|
62
|
+
return response.getTagsByProductId;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
removeProductTag(productId, tagId, updatedBy, tagGroupId) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const mutation = mutations_1.REMOVE_PRODUCT_TAG;
|
|
72
|
+
const variables = {
|
|
73
|
+
productId,
|
|
74
|
+
tagId,
|
|
75
|
+
updatedBy,
|
|
76
|
+
tagGroupId,
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
80
|
+
return response.removeProductTag;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
addProductTag(productId, tagId, createBy, tagGroupId) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const mutation = mutations_1.ADD_PRODUCT_TAG;
|
|
90
|
+
const variables = {
|
|
91
|
+
productId,
|
|
92
|
+
tagId,
|
|
93
|
+
createBy,
|
|
94
|
+
tagGroupId,
|
|
95
|
+
};
|
|
96
|
+
try {
|
|
97
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
98
|
+
return response.addProductTag;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.MarketPlaceService = MarketPlaceService;
|
|
@@ -16,4 +16,14 @@ export declare class PaymentServiceV2 extends Service {
|
|
|
16
16
|
getPaymentGatewaysByMethodCode(methodCode: string): Promise<any>;
|
|
17
17
|
getPaymentMethodTypesV2(storeActive: any, allMethodTypes: boolean): Promise<any>;
|
|
18
18
|
getTransferInfo(storeId: string, paymentId: string): Promise<any>;
|
|
19
|
+
createPayment(paymentData: {
|
|
20
|
+
totalAmount: number;
|
|
21
|
+
storeID: string;
|
|
22
|
+
partnerCode: string;
|
|
23
|
+
methodCode: string;
|
|
24
|
+
phone?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
}): Promise<any>;
|
|
27
|
+
paymentMethodsByPartner(partnerCode?: string): Promise<any>;
|
|
28
|
+
getPaymentMethodTypesWithGatewayConfig(partnerId?: string, storeId?: string): Promise<any>;
|
|
19
29
|
}
|
|
@@ -260,5 +260,44 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
+
createPayment(paymentData) {
|
|
264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
+
const mutation = mutations_1.CREATE_PAYMENT;
|
|
266
|
+
const variables = { paymentData };
|
|
267
|
+
try {
|
|
268
|
+
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
269
|
+
return response.createPayment;
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
throw error;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
paymentMethodsByPartner(partnerCode) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
const query = queries_1.PAYMENT_METHODS_BY_PARTNER;
|
|
279
|
+
const variables = { partnerCode };
|
|
280
|
+
try {
|
|
281
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
282
|
+
return response.paymentMethods;
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
getPaymentMethodTypesWithGatewayConfig(partnerId, storeId) {
|
|
290
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
+
const query = queries_1.GET_PAYMENT_METHOD_TYPES_WITH_GATEWAY_CONFIG;
|
|
292
|
+
const variables = { partnerId, storeId };
|
|
293
|
+
try {
|
|
294
|
+
const response = yield this.graphqlQueryV3(query, variables);
|
|
295
|
+
return response.getPaymentMethodTypes;
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
throw error;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
263
302
|
}
|
|
264
303
|
exports.PaymentServiceV2 = PaymentServiceV2;
|
|
@@ -30,4 +30,7 @@ export declare class PortalService extends Service {
|
|
|
30
30
|
getPosition(query?: Record<string, any>): Promise<any>;
|
|
31
31
|
getPositionForTime(query?: Record<string, any>): Promise<any>;
|
|
32
32
|
getBookingCount(query?: Record<string, any>): Promise<any>;
|
|
33
|
+
getSlugPathFromDynamicFrom(query?: Record<string, any>): Promise<any>;
|
|
34
|
+
putSlugPathFromDynamicFrom(data: any): Promise<any>;
|
|
35
|
+
postSlugPathFromDynamicFrom(data: any): Promise<any>;
|
|
33
36
|
}
|
|
@@ -452,5 +452,55 @@ class PortalService extends serviceSDK_1.Service {
|
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
|
+
getSlugPathFromDynamicFrom(query) {
|
|
456
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
457
|
+
const method = "GET";
|
|
458
|
+
const baseUrl = `/dynamic-collection/public/v2/records/slug_path/slug_path_view`;
|
|
459
|
+
const params = new URLSearchParams();
|
|
460
|
+
if (query) {
|
|
461
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
462
|
+
if (value !== undefined && value !== null) {
|
|
463
|
+
params.append(key, String(value));
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
const endpoint = params.toString()
|
|
468
|
+
? `${baseUrl}?${params.toString()}`
|
|
469
|
+
: baseUrl;
|
|
470
|
+
try {
|
|
471
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method);
|
|
472
|
+
return response;
|
|
473
|
+
}
|
|
474
|
+
catch (error) {
|
|
475
|
+
throw error;
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
putSlugPathFromDynamicFrom(data) {
|
|
480
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
481
|
+
const method = "PUT";
|
|
482
|
+
const endpoint = `/dynamic-collection/public/v2/records/slug_path/slug_path_form`;
|
|
483
|
+
try {
|
|
484
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method, data);
|
|
485
|
+
return response;
|
|
486
|
+
}
|
|
487
|
+
catch (error) {
|
|
488
|
+
throw error;
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
postSlugPathFromDynamicFrom(data) {
|
|
493
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
494
|
+
const method = "POST";
|
|
495
|
+
const endpoint = `/dynamic-collection/public/v2/records/slug_path/slug_path_form`;
|
|
496
|
+
try {
|
|
497
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method, data);
|
|
498
|
+
return response;
|
|
499
|
+
}
|
|
500
|
+
catch (error) {
|
|
501
|
+
throw error;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
}
|
|
455
505
|
}
|
|
456
506
|
exports.PortalService = PortalService;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class StorefontService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
getRevenueStatisticByGroupOrCategory(dataQuery: any, groupBy: any): Promise<any>;
|
|
5
|
+
getRevenueStatisticByProduct(dataQuery: any): Promise<any>;
|
|
6
|
+
}
|