@longvansoftware/service-js-client 1.16.6 → 1.16.8
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/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/orderGraphQL/queries.d.ts +7 -5
- package/dist/src/graphql/orderGraphQL/queries.js +11 -1
- package/dist/src/graphql/product/queries.d.ts +2 -0
- package/dist/src/graphql/product/queries.js +41 -1
- package/dist/src/lib/auth/index.d.ts +1 -1
- package/dist/src/lib/auth/index.js +3 -4
- package/dist/src/lib/cloud/index.d.ts +7 -0
- package/dist/src/lib/cloud/index.js +123 -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/orderGraphQL/index.d.ts +1 -0
- package/dist/src/lib/orderGraphQL/index.js +16 -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/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
3
|
+
exports.GET_CATEGORIES = exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = exports.GET_TAGS_BY_CATEGORY = exports.GET_TAGS = exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS_DYNAMIC = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY_DYNAMIC = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
// export const GET_PRODUCT_BY_ID_QUERY = gql`
|
|
6
6
|
// query GetProductById(
|
|
@@ -907,6 +907,24 @@ exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
|
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
909
|
`;
|
|
910
|
+
const GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC = (fields = []) => {
|
|
911
|
+
const fieldStr = fields.join("\n ");
|
|
912
|
+
const hasFields = fields.length > 0;
|
|
913
|
+
return (0, graphql_tag_1.gql) `
|
|
914
|
+
query GetProductVariantById(
|
|
915
|
+
$partnerId: String!
|
|
916
|
+
$storeChannel: String!
|
|
917
|
+
$variantId: String!
|
|
918
|
+
) {
|
|
919
|
+
getProductVariantById(
|
|
920
|
+
partnerId: $partnerId
|
|
921
|
+
storeChannel: $storeChannel
|
|
922
|
+
variantId: $variantId
|
|
923
|
+
) ${hasFields ? `{ ${fieldStr} }` : ""}
|
|
924
|
+
}
|
|
925
|
+
`;
|
|
926
|
+
};
|
|
927
|
+
exports.GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC = GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC;
|
|
910
928
|
exports.GET_RELATED_INFOR = (0, graphql_tag_1.gql) `
|
|
911
929
|
query GetProductVariantById($id: String!) {
|
|
912
930
|
getRelatedInfor(id: $id) {
|
|
@@ -1018,3 +1036,25 @@ const GET_LIST_PRODUCTS_CONFIG_DYNAMIC = (fields = []) => {
|
|
|
1018
1036
|
`;
|
|
1019
1037
|
};
|
|
1020
1038
|
exports.GET_LIST_PRODUCTS_CONFIG_DYNAMIC = GET_LIST_PRODUCTS_CONFIG_DYNAMIC;
|
|
1039
|
+
exports.GET_CATEGORIES = (0, graphql_tag_1.gql) `
|
|
1040
|
+
query GetCategories($partnerId: String!, $storeChannel: String!) {
|
|
1041
|
+
getCategories(partnerId: $partnerId, storeChannel: $storeChannel) {
|
|
1042
|
+
id
|
|
1043
|
+
title
|
|
1044
|
+
image
|
|
1045
|
+
icon
|
|
1046
|
+
parentId
|
|
1047
|
+
level
|
|
1048
|
+
handle
|
|
1049
|
+
child {
|
|
1050
|
+
id
|
|
1051
|
+
title
|
|
1052
|
+
image
|
|
1053
|
+
icon
|
|
1054
|
+
parentId
|
|
1055
|
+
level
|
|
1056
|
+
handle
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
`;
|
|
@@ -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) {
|
|
@@ -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;
|
|
@@ -61,4 +61,5 @@ export declare class ComputingService extends Service {
|
|
|
61
61
|
updateCPU(computingId: string, socket: number, corePerSocket: number, updateBy: string): Promise<any>;
|
|
62
62
|
updateRAM(computingId: string, size: number, unit: string, updateBy: string): Promise<any>;
|
|
63
63
|
getComputingsDynamic(userId: string, fields: string[]): Promise<any>;
|
|
64
|
+
createComputingForEC(createComputingInputForEC: any, createBy: string): Promise<any>;
|
|
64
65
|
}
|
|
@@ -906,5 +906,22 @@ class ComputingService extends serviceSDK_1.Service {
|
|
|
906
906
|
}
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
|
+
createComputingForEC(createComputingInputForEC, createBy) {
|
|
910
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
911
|
+
const mutation = mutations_1.CREATE_COMPUTING_FOR_EC;
|
|
912
|
+
const variables = {
|
|
913
|
+
createComputingInputForEC,
|
|
914
|
+
createBy,
|
|
915
|
+
};
|
|
916
|
+
try {
|
|
917
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
918
|
+
return response.createComputingForEC;
|
|
919
|
+
}
|
|
920
|
+
catch (error) {
|
|
921
|
+
console.log(`Error fetching get createComputingForEC method: ${error}`);
|
|
922
|
+
throw error;
|
|
923
|
+
}
|
|
924
|
+
});
|
|
925
|
+
}
|
|
909
926
|
}
|
|
910
927
|
exports.ComputingService = ComputingService;
|
|
@@ -14,8 +14,10 @@ export declare class CrmService extends Service {
|
|
|
14
14
|
updateWorkEffortStatus(performerId: string, workEffortId: string, source: string, status: string): Promise<any>;
|
|
15
15
|
addAttachmentForWorkEffort(performerId: string, workEffortId: string, attachments: [{}]): Promise<any>;
|
|
16
16
|
getListTicket(performerId: string, getTicketRequest: getTicketRequest): Promise<any>;
|
|
17
|
+
getListTicketDynamic(performerId: string, getTicketRequest: getTicketRequest, fields: string[]): Promise<any>;
|
|
17
18
|
addTicket(performerId: string, addTicketRequest: AddTicketRequest, addAttachmentRequest: [AddAttachmentRequest]): Promise<any>;
|
|
18
19
|
getTicketById(ticketId: string): Promise<any>;
|
|
20
|
+
getTicketByIdDynamic(ticketId: string, fields: string[]): Promise<any>;
|
|
19
21
|
getAttachmentByWorkEffortId(workEffortIds: [string]): Promise<any>;
|
|
20
22
|
getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
|
|
21
23
|
addComment(params: any): Promise<any>;
|
|
@@ -28,4 +30,10 @@ export declare class CrmService extends Service {
|
|
|
28
30
|
cloneResume(resumeOriginalId: string, domain: string, createdBy: string): Promise<any>;
|
|
29
31
|
linkingResumeDomainAndContact(resumeDomainId: string, resumeContactId: string, contactType: string, linkedBy: string): Promise<any>;
|
|
30
32
|
getResumeDomainByServiceId(serviceId: string): Promise<any>;
|
|
33
|
+
getCollegesByProvinceId(provinceId: string | null): Promise<any>;
|
|
34
|
+
getRelatedResourceByResourceType(fromId: string, fromResourceType: string, toResourceType: string): Promise<any>;
|
|
35
|
+
addResourceRelated(fromId: string, fromResourceType: string, toIds: string[], toResourceType: string, createdBy: string): Promise<any>;
|
|
36
|
+
getResumeInfoByCustomerId(customerId: string): Promise<any>;
|
|
37
|
+
createResumeInfo(data: any): Promise<any>;
|
|
38
|
+
updateFieldResume(resumeId: string, fieldName: string, value: string, resourceType: string, updatedBy: string): Promise<any>;
|
|
31
39
|
}
|
|
@@ -205,6 +205,24 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
+
getListTicketDynamic(performerId, getTicketRequest, fields) {
|
|
209
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
const query = (0, queries_1.GET_LIST_TICKET_DYNAMIC)(fields);
|
|
211
|
+
const variables = {
|
|
212
|
+
partyId: this.orgId,
|
|
213
|
+
performerId,
|
|
214
|
+
getTicketRequest,
|
|
215
|
+
};
|
|
216
|
+
try {
|
|
217
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
218
|
+
return response.getListTicket;
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
console.log(`Error fetching get getListTicketDynamic method: ${error}`);
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
208
226
|
addTicket(performerId, addTicketRequest, addAttachmentRequest) {
|
|
209
227
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
228
|
const mutation = mutations_1.ADD_TICKED;
|
|
@@ -240,6 +258,22 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
240
258
|
}
|
|
241
259
|
});
|
|
242
260
|
}
|
|
261
|
+
getTicketByIdDynamic(ticketId, fields) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const query = (0, queries_1.GET_LIST_TICKET_BY_ID_DYNAMIC)(fields);
|
|
264
|
+
const variables = {
|
|
265
|
+
ticketId,
|
|
266
|
+
};
|
|
267
|
+
try {
|
|
268
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
269
|
+
return response.getTicketById;
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
console.log(`Error in getTicketByIdDynamic: ${error}`);
|
|
273
|
+
throw error;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
243
277
|
getAttachmentByWorkEffortId(workEffortIds) {
|
|
244
278
|
return __awaiter(this, void 0, void 0, function* () {
|
|
245
279
|
const query = queries_1.GET_ATTACHMENT_BY_WORK_EFFORT_ID;
|
|
@@ -457,5 +491,112 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
457
491
|
}
|
|
458
492
|
});
|
|
459
493
|
}
|
|
494
|
+
getCollegesByProvinceId(provinceId) {
|
|
495
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
496
|
+
const query = queries_1.GET_COLLEGES_BY_PROVINCE_ID;
|
|
497
|
+
const variables = {
|
|
498
|
+
provinceId,
|
|
499
|
+
};
|
|
500
|
+
try {
|
|
501
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
502
|
+
return response.getCollegesByProvinceId;
|
|
503
|
+
}
|
|
504
|
+
catch (error) {
|
|
505
|
+
console.log(`Error in getCollegesByProvinceId: ${error}`);
|
|
506
|
+
throw error;
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
getRelatedResourceByResourceType(fromId, fromResourceType, toResourceType) {
|
|
511
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
512
|
+
const query = queries_1.GET_RELATED_RESOURCE_BY_RESOURCE_TYPE;
|
|
513
|
+
const variables = {
|
|
514
|
+
fromId,
|
|
515
|
+
fromResourceType,
|
|
516
|
+
toResourceType,
|
|
517
|
+
accessToken: this.token,
|
|
518
|
+
partnerId: this.orgId,
|
|
519
|
+
};
|
|
520
|
+
try {
|
|
521
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
522
|
+
return response.getRelatedResourceByResourceType;
|
|
523
|
+
}
|
|
524
|
+
catch (error) {
|
|
525
|
+
console.log(`Error in getRelatedResourceByResourceType: ${error}`);
|
|
526
|
+
throw error;
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
addResourceRelated(fromId, fromResourceType, toIds, toResourceType, createdBy) {
|
|
531
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
532
|
+
const mutation = mutations_1.ADD_RESOURCE_RELATED;
|
|
533
|
+
const variables = {
|
|
534
|
+
fromId,
|
|
535
|
+
fromResourceType,
|
|
536
|
+
toIds,
|
|
537
|
+
toResourceType,
|
|
538
|
+
createdBy,
|
|
539
|
+
};
|
|
540
|
+
try {
|
|
541
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
542
|
+
return response.addResourceRelated;
|
|
543
|
+
}
|
|
544
|
+
catch (error) {
|
|
545
|
+
console.log(`Error in addResourceRelated: ${error}`);
|
|
546
|
+
throw error;
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
getResumeInfoByCustomerId(customerId) {
|
|
551
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
552
|
+
const query = queries_1.GET_RESUME_INFO_BY_CUSTOMER_ID;
|
|
553
|
+
const variables = {
|
|
554
|
+
customerId,
|
|
555
|
+
orgId: this.orgId,
|
|
556
|
+
};
|
|
557
|
+
try {
|
|
558
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
559
|
+
return response.getResumeInfoByCustomerId;
|
|
560
|
+
}
|
|
561
|
+
catch (error) {
|
|
562
|
+
console.log(`Error in getResumeInfoByCustomerId: ${error}`);
|
|
563
|
+
throw error;
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
createResumeInfo(data) {
|
|
568
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
569
|
+
const mutation = mutations_1.CREATE_RUSUME_INFO;
|
|
570
|
+
const variables = Object.assign(Object.assign({}, data), { orgId: this.orgId });
|
|
571
|
+
try {
|
|
572
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
573
|
+
return response.createResumeInfo;
|
|
574
|
+
}
|
|
575
|
+
catch (error) {
|
|
576
|
+
console.log(`Error in createResumeInfo: ${error}`);
|
|
577
|
+
throw error;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
updateFieldResume(resumeId, fieldName, value, resourceType, updatedBy) {
|
|
582
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
583
|
+
const mutation = mutations_1.UPDATE_FIELD_RESUME;
|
|
584
|
+
const variables = {
|
|
585
|
+
resumeId,
|
|
586
|
+
fieldName,
|
|
587
|
+
value,
|
|
588
|
+
resourceType,
|
|
589
|
+
updatedBy,
|
|
590
|
+
};
|
|
591
|
+
try {
|
|
592
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
593
|
+
return response.updateFieldResume;
|
|
594
|
+
}
|
|
595
|
+
catch (error) {
|
|
596
|
+
console.log(`Error in updateFieldResume: ${error}`);
|
|
597
|
+
throw error;
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
}
|
|
460
601
|
}
|
|
461
602
|
exports.CrmService = CrmService;
|
|
@@ -6,11 +6,11 @@ export declare class CrmCampingService extends Service {
|
|
|
6
6
|
searchProductQuantityPromotionAction(productId: string): Promise<any>;
|
|
7
7
|
addCustomerToVoucher(userId: string, voucherCode: string): Promise<any>;
|
|
8
8
|
getCampaignActionById(campaignActionId: string): Promise<any>;
|
|
9
|
-
suggestVoucher(customerId: string, scope: string | null, isNewCustomer: boolean): Promise<any>;
|
|
9
|
+
suggestVoucher(customerId: string, scopeIgnore: string | null, scope: string | null, isNewCustomer: boolean): Promise<any>;
|
|
10
10
|
searchVouchers(campaignId: String, campaignActionId: String, campaignActionType: String, customerId: String, pageNumber: number, pageSize: number): Promise<any>;
|
|
11
11
|
getAverageRating(targetIds: [string], customerId: string, evaluationType: string): Promise<any>;
|
|
12
12
|
getUrlEvaluation(targetIds: [string], customerId: string, evaluationType: string): Promise<any>;
|
|
13
13
|
getNumberOfTicketEvaluation(customerId: string): Promise<any>;
|
|
14
|
-
searchProductGiftPromotionResponse(
|
|
14
|
+
searchProductGiftPromotionResponse(parameterSearchProductGift: any): Promise<any>;
|
|
15
15
|
addProductGiftPromotion(orderId: string, updatedBy: string, addData: any): Promise<any>;
|
|
16
16
|
}
|
|
@@ -89,7 +89,7 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
89
89
|
// throw error;
|
|
90
90
|
// }
|
|
91
91
|
// }
|
|
92
|
-
suggestVoucher(customerId, scope, isNewCustomer) {
|
|
92
|
+
suggestVoucher(customerId, scopeIgnore, scope, isNewCustomer) {
|
|
93
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
94
|
const query = queries_1.SUGGEST_VOUCHER;
|
|
95
95
|
const variables = {
|
|
@@ -97,7 +97,8 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
97
97
|
excludeExpired: true,
|
|
98
98
|
customerId,
|
|
99
99
|
scope,
|
|
100
|
-
isNewCustomer
|
|
100
|
+
isNewCustomer,
|
|
101
|
+
scopeIgnore,
|
|
101
102
|
};
|
|
102
103
|
try {
|
|
103
104
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -137,7 +138,7 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
137
138
|
targetIds,
|
|
138
139
|
customerId,
|
|
139
140
|
evaluationType,
|
|
140
|
-
orgId: this.orgId
|
|
141
|
+
orgId: this.orgId,
|
|
141
142
|
};
|
|
142
143
|
try {
|
|
143
144
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -156,7 +157,7 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
156
157
|
targetIds,
|
|
157
158
|
customerId,
|
|
158
159
|
evaluationType,
|
|
159
|
-
orgId: this.orgId
|
|
160
|
+
orgId: this.orgId,
|
|
160
161
|
};
|
|
161
162
|
try {
|
|
162
163
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -173,7 +174,7 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
173
174
|
const query = queries_1.GET_NUMBER_OF_TICKET_EVALUATION;
|
|
174
175
|
const variables = {
|
|
175
176
|
customerId,
|
|
176
|
-
orgId: this.orgId
|
|
177
|
+
orgId: this.orgId,
|
|
177
178
|
};
|
|
178
179
|
try {
|
|
179
180
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -185,13 +186,17 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
185
186
|
}
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
|
-
searchProductGiftPromotionResponse(
|
|
189
|
+
searchProductGiftPromotionResponse(parameterSearchProductGift) {
|
|
189
190
|
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
// console.log("🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ parameterSearchProductGift:", parameterSearchProductGift)
|
|
190
192
|
const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
|
|
191
193
|
const variables = {
|
|
192
|
-
partyId: this.orgId,
|
|
193
|
-
productId
|
|
194
|
+
parameterSearchProductGift: Object.assign({ partyId: this.orgId }, parameterSearchProductGift),
|
|
194
195
|
};
|
|
196
|
+
// console.log(
|
|
197
|
+
// "🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ variables:",
|
|
198
|
+
// variables
|
|
199
|
+
// );
|
|
195
200
|
try {
|
|
196
201
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
197
202
|
return response.searchProductGiftPromotionResponse;
|
|
@@ -5,6 +5,7 @@ export declare class OrderGraphQLService extends Service {
|
|
|
5
5
|
setStoreId(storeId: string): void;
|
|
6
6
|
createOrder(input: any): Promise<any>;
|
|
7
7
|
getOrderDetail(orderId: string): Promise<any>;
|
|
8
|
+
getOrderDetailDynamic(orderId: string, fields: string[]): Promise<any>;
|
|
8
9
|
getQuantityOrderLineItems(orderId: string): Promise<any>;
|
|
9
10
|
updateQuantityV2(payload: any): Promise<any>;
|
|
10
11
|
getOrderLineItemByServiceId(serviceId: string): Promise<any>;
|
|
@@ -55,6 +55,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
getOrderDetailDynamic(orderId, fields) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const query = (0, queries_1.GET_ORDER_DETAIL_DYNAMIC)(fields);
|
|
61
|
+
const variables = {
|
|
62
|
+
orderId,
|
|
63
|
+
};
|
|
64
|
+
try {
|
|
65
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
66
|
+
return response.orderDetail;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.log(`Error in orderDetailDynamic: ${error}`);
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
58
74
|
getQuantityOrderLineItems(orderId) {
|
|
59
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
76
|
const query = queries_1.GET_QUANTITY_ORDER_LINEITEMS;
|
|
@@ -43,10 +43,12 @@ export declare class ProductService extends Service {
|
|
|
43
43
|
getHandleByServiceTypes(serviceTypes: [string]): Promise<any>;
|
|
44
44
|
getResourceByProduct(productId: string): Promise<any>;
|
|
45
45
|
getProductVariantById(variantId: string): Promise<any>;
|
|
46
|
+
getProductVariantByIdDynamic(variantId: string, store: string, fields: string[]): Promise<any>;
|
|
46
47
|
getRelatedInfor(id: string): Promise<any>;
|
|
47
48
|
getDetailStores(storeId: string): Promise<any>;
|
|
48
49
|
getListPrice(productIds: string[], storeId: string): Promise<any>;
|
|
49
50
|
getTags(storeId: string): Promise<any>;
|
|
50
51
|
getTagsByCategory(categoryId: string, storeId: string): Promise<any>;
|
|
51
52
|
getListProductConfigDynamic(productId: string, store: string, fields: string[]): Promise<any>;
|
|
53
|
+
getCategories(): Promise<any>;
|
|
52
54
|
}
|
|
@@ -231,6 +231,24 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
+
getProductVariantByIdDynamic(variantId, store, fields) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
const query = (0, queries_1.GET_PRODUCT_VARIANT_BY_ID_QUERY_DYNAMIC)(fields);
|
|
237
|
+
const variables = {
|
|
238
|
+
partnerId: this.orgId,
|
|
239
|
+
storeChannel: store ? store : this.storeId,
|
|
240
|
+
variantId,
|
|
241
|
+
};
|
|
242
|
+
try {
|
|
243
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
244
|
+
return response.getProductById;
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
console.log(`Error fetching product by ID: ${error}`);
|
|
248
|
+
throw error;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
234
252
|
getRelatedInfor(id) {
|
|
235
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
236
254
|
const query = queries_1.GET_RELATED_INFOR;
|
|
@@ -335,5 +353,21 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
335
353
|
}
|
|
336
354
|
});
|
|
337
355
|
}
|
|
356
|
+
getCategories() {
|
|
357
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
358
|
+
const query = queries_1.GET_CATEGORIES;
|
|
359
|
+
const variables = {
|
|
360
|
+
partnerId: this.orgId,
|
|
361
|
+
storeChannel: this.storeId,
|
|
362
|
+
};
|
|
363
|
+
try {
|
|
364
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
365
|
+
return response.getCategories;
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
throw error;
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
338
372
|
}
|
|
339
373
|
exports.ProductService = ProductService;
|
|
@@ -3,7 +3,7 @@ export declare class ResourcePermissionService extends Service {
|
|
|
3
3
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
4
|
setToken(token: string): void;
|
|
5
5
|
setStoreId(storeId: string): void;
|
|
6
|
-
shareResource(createModel: any): Promise<any>;
|
|
7
|
-
removeShareParty(resourceId: string, sharePartyId: string, resourceType: string): Promise<any>;
|
|
6
|
+
shareResource(createModel: any, partnerId: string): Promise<any>;
|
|
7
|
+
removeShareParty(resourceId: string, sharePartyId: string, resourceType: string, partnerId: string): Promise<any>;
|
|
8
8
|
getSharedUserByService(resourceType: string, resourceId: string): Promise<any>;
|
|
9
9
|
}
|