@longvansoftware/service-js-client 1.20.8 → 2.1.0
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/orderGraphQL/queries.d.ts +1 -0
- package/dist/src/graphql/orderGraphQL/queries.js +11 -1
- package/dist/src/graphql/storage_s3/queries.d.ts +1 -0
- package/dist/src/graphql/storage_s3/queries.js +6 -1
- package/dist/src/graphql/user/queries.d.ts +19 -17
- package/dist/src/graphql/user/queries.js +12 -1
- package/dist/src/lib/orderGraphQL/index.d.ts +1 -0
- package/dist/src/lib/orderGraphQL/index.js +17 -0
- package/dist/src/lib/storage_s3/index.d.ts +1 -0
- package/dist/src/lib/storage_s3/index.js +16 -0
- package/dist/src/lib/user/index.d.ts +1 -0
- package/dist/src/lib/user/index.js +19 -3
- package/package.json +1 -1
|
@@ -6,3 +6,4 @@ export declare const GET_ORDER_LINE_ITEM_BY_SERVICE_ID: DocumentNode;
|
|
|
6
6
|
export declare const GET_ORDER_BY_SERVICE_ID: DocumentNode;
|
|
7
7
|
export declare const FIND_ORDER_BY_OWNER_PARTYID: DocumentNode;
|
|
8
8
|
export declare const CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
9
|
+
export declare const SEARCH_ORDER_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
|
|
3
|
+
exports.SEARCH_ORDER_DYNAMIC = exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
|
|
6
6
|
query getOrderDetail($orderId: String!) {
|
|
@@ -458,3 +458,13 @@ const CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = (fields = []) => {
|
|
|
458
458
|
`;
|
|
459
459
|
};
|
|
460
460
|
exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC;
|
|
461
|
+
const SEARCH_ORDER_DYNAMIC = (fields = []) => {
|
|
462
|
+
const fieldStr = fields.join("\n ");
|
|
463
|
+
const hasFields = fields.length > 0;
|
|
464
|
+
return (0, graphql_tag_1.gql) `
|
|
465
|
+
query searchOrder($filter: OrderFilter) {
|
|
466
|
+
searchOrder(filter: $filter) ${hasFields ? `{ ${fieldStr} }` : ""}
|
|
467
|
+
}
|
|
468
|
+
`;
|
|
469
|
+
};
|
|
470
|
+
exports.SEARCH_ORDER_DYNAMIC = SEARCH_ORDER_DYNAMIC;
|
|
@@ -7,3 +7,4 @@ export declare const GET_LIST_S3_DOMAIN_BY_S3_USER_ID: (fields?: string[]) => Do
|
|
|
7
7
|
export declare const GET_LIST_CORS_BY_S3_USER_ID: (fields?: string[]) => DocumentNode;
|
|
8
8
|
export declare const GET_LIST_FILE_OTHER_VERSION: (fields?: string[]) => DocumentNode;
|
|
9
9
|
export declare const CHART_IN_YEAR: (fields?: string[]) => DocumentNode;
|
|
10
|
+
export declare const GET_IP_CONSUL: DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHART_IN_YEAR = exports.GET_LIST_FILE_OTHER_VERSION = exports.GET_LIST_CORS_BY_S3_USER_ID = exports.GET_LIST_S3_DOMAIN_BY_S3_USER_ID = exports.GET_LIST_FILE_TRASH = exports.GET_LIST_OBJECT = exports.GET_LIST_BUCKET_BY_S3_USER_ID = exports.GET_LIST_S3_USER_BY_SERVICE_ID = void 0;
|
|
3
|
+
exports.GET_IP_CONSUL = exports.CHART_IN_YEAR = exports.GET_LIST_FILE_OTHER_VERSION = exports.GET_LIST_CORS_BY_S3_USER_ID = exports.GET_LIST_S3_DOMAIN_BY_S3_USER_ID = exports.GET_LIST_FILE_TRASH = exports.GET_LIST_OBJECT = exports.GET_LIST_BUCKET_BY_S3_USER_ID = exports.GET_LIST_S3_USER_BY_SERVICE_ID = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
const GET_LIST_S3_USER_BY_SERVICE_ID = (fields = []) => {
|
|
6
6
|
const fieldStr = fields.join('\n ');
|
|
@@ -98,3 +98,8 @@ const CHART_IN_YEAR = (fields = []) => {
|
|
|
98
98
|
`;
|
|
99
99
|
};
|
|
100
100
|
exports.CHART_IN_YEAR = CHART_IN_YEAR;
|
|
101
|
+
exports.GET_IP_CONSUL = (0, graphql_tag_1.gql) `
|
|
102
|
+
query GetIPConsul($userId: String!) {
|
|
103
|
+
getIPConsul(userId: $userId)
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
1
|
+
import { DocumentNode } from "graphql";
|
|
2
|
+
export declare const GET_PERSON_BY_IDS_QUERY: DocumentNode;
|
|
3
|
+
export declare const SEARCH_COMPANY: DocumentNode;
|
|
4
|
+
export declare const GET_CUSTOMER_BY_ID: DocumentNode;
|
|
5
|
+
export declare const SEARCH_CUSTOMER: DocumentNode;
|
|
6
|
+
export declare const SEARCH_EMPLOYEES: DocumentNode;
|
|
7
|
+
export declare const GET_POSTIONS_BY_EMPLOYEES_ID: DocumentNode;
|
|
8
|
+
export declare const GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID: DocumentNode;
|
|
9
|
+
export declare const GET_EMPLOYEES_BY_STORE_CHANEL_ID: DocumentNode;
|
|
10
|
+
export declare const GET_COMPANY_BY_CONTACT_INFO_ID: DocumentNode;
|
|
11
|
+
export declare const GET_CONTACT_INFOS_BY_COMPANY_ID: DocumentNode;
|
|
12
|
+
export declare const GET_PROVINCES: DocumentNode;
|
|
13
|
+
export declare const GET_DISTRICTS: DocumentNode;
|
|
14
|
+
export declare const GET_WARDS: DocumentNode;
|
|
15
|
+
export declare const GET_WARDS_BY_PROVINCE_ID: DocumentNode;
|
|
16
|
+
export declare const GET_VAT_INFOR_BY_OWNER_PARTY_ID: DocumentNode;
|
|
17
|
+
export declare const GET_TEAM_BY_USER_ID: DocumentNode;
|
|
18
|
+
export declare const GET_USERS_BY_TEAM_ID: DocumentNode;
|
|
19
|
+
export declare const GET_CUSTOMER_BY_ID_DYNAMIC: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_USERS_BY_TEAM_ID = exports.GET_TEAM_BY_USER_ID = exports.GET_VAT_INFOR_BY_OWNER_PARTY_ID = exports.GET_WARDS_BY_PROVINCE_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
3
|
+
exports.GET_CUSTOMER_BY_ID_DYNAMIC = exports.GET_USERS_BY_TEAM_ID = exports.GET_TEAM_BY_USER_ID = exports.GET_VAT_INFOR_BY_OWNER_PARTY_ID = exports.GET_WARDS_BY_PROVINCE_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetPersonByIds($partyIds: [String!]!) {
|
|
@@ -331,3 +331,14 @@ exports.GET_USERS_BY_TEAM_ID = (0, graphql_tag_1.gql) `
|
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
`;
|
|
334
|
+
const GET_CUSTOMER_BY_ID_DYNAMIC = (fields = []) => {
|
|
335
|
+
const fieldStr = fields.join("\n ");
|
|
336
|
+
const hasFields = fields.length > 0;
|
|
337
|
+
return (0, graphql_tag_1.gql) `query GetCustomerById($id: String!) {
|
|
338
|
+
getCustomerById(id: $id) {
|
|
339
|
+
${hasFields ? `${fieldStr}` : ""}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
`;
|
|
343
|
+
};
|
|
344
|
+
exports.GET_CUSTOMER_BY_ID_DYNAMIC = GET_CUSTOMER_BY_ID_DYNAMIC;
|
|
@@ -14,4 +14,5 @@ export declare class OrderGraphQLService extends Service {
|
|
|
14
14
|
removeProductOptionOrderLineItem(orderLineItemId: string, optionId: string, updateBy: string): Promise<any>;
|
|
15
15
|
findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
|
|
16
16
|
calcExchangePriceExtendResourceDetail(serviceId: string, productBaseIdNew: string, durationQuantity: string, durationUnit: string, fields: string[]): Promise<any>;
|
|
17
|
+
searchOrderDynamic(params: any, fields: string[]): Promise<any>;
|
|
17
18
|
}
|
|
@@ -209,5 +209,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
|
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
+
searchOrderDynamic(params, fields) {
|
|
213
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
214
|
+
console.log("🚀 ~ OrderGraphQLService ~ searchOrderDynamic ~ params:", params);
|
|
215
|
+
const query = (0, queries_1.SEARCH_ORDER_DYNAMIC)(fields);
|
|
216
|
+
const variables = {
|
|
217
|
+
filter: params,
|
|
218
|
+
};
|
|
219
|
+
try {
|
|
220
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
221
|
+
return response.searchOrder;
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
console.log(`Error in searchOrderDynamic: ${error}`);
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
212
229
|
}
|
|
213
230
|
exports.OrderGraphQLService = OrderGraphQLService;
|
|
@@ -36,4 +36,5 @@ export declare class StorageS3Service extends Service {
|
|
|
36
36
|
resetKey(s3UserId: string, updateBy: string, fields: string[]): Promise<any>;
|
|
37
37
|
actionSyncUserFromS3(s3UserId: string, updateBy: string, fields: string[]): Promise<any>;
|
|
38
38
|
chartInYear(s3UserId: string, year: number, month: number, fields: string[]): Promise<any>;
|
|
39
|
+
getIPConsul(userId: string): Promise<any>;
|
|
39
40
|
}
|
|
@@ -646,5 +646,21 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
|
+
getIPConsul(userId) {
|
|
650
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
651
|
+
const query = queries_1.GET_IP_CONSUL;
|
|
652
|
+
const variables = {
|
|
653
|
+
userId
|
|
654
|
+
};
|
|
655
|
+
try {
|
|
656
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
657
|
+
return response.getIPConsul;
|
|
658
|
+
}
|
|
659
|
+
catch (error) {
|
|
660
|
+
console.log(`Error in getIPConsul: ${error}`);
|
|
661
|
+
throw error;
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
}
|
|
649
665
|
}
|
|
650
666
|
exports.StorageS3Service = StorageS3Service;
|
|
@@ -33,4 +33,5 @@ export declare class UserService extends Service {
|
|
|
33
33
|
addUserToTeam(teamId: string, userId: string, createdBy: string): Promise<any>;
|
|
34
34
|
removeUserFromTeam(teamId: string, userId: string, deletedBy: string): Promise<any>;
|
|
35
35
|
updateTeamName(teamId: string, name: string, updatedBy: string): Promise<any>;
|
|
36
|
+
getCustomerByIdDynamic(id: string, fields: string[]): Promise<any>;
|
|
36
37
|
}
|
|
@@ -305,7 +305,7 @@ class UserService extends serviceSDK_1.Service {
|
|
|
305
305
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
306
|
const query = queries_1.GET_PROVINCES;
|
|
307
307
|
const variables = {
|
|
308
|
-
version
|
|
308
|
+
version,
|
|
309
309
|
};
|
|
310
310
|
try {
|
|
311
311
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -338,7 +338,7 @@ class UserService extends serviceSDK_1.Service {
|
|
|
338
338
|
const query = queries_1.GET_WARDS;
|
|
339
339
|
const variables = {
|
|
340
340
|
districtId,
|
|
341
|
-
version
|
|
341
|
+
version,
|
|
342
342
|
};
|
|
343
343
|
try {
|
|
344
344
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -354,7 +354,7 @@ class UserService extends serviceSDK_1.Service {
|
|
|
354
354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
355
355
|
const query = queries_1.GET_WARDS_BY_PROVINCE_ID;
|
|
356
356
|
const variables = {
|
|
357
|
-
provinceId
|
|
357
|
+
provinceId,
|
|
358
358
|
};
|
|
359
359
|
try {
|
|
360
360
|
const response = yield this.graphqlQueryV2(query, variables);
|
|
@@ -541,5 +541,21 @@ class UserService extends serviceSDK_1.Service {
|
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
+
getCustomerByIdDynamic(id, fields) {
|
|
545
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
546
|
+
const query = (0, queries_1.GET_CUSTOMER_BY_ID_DYNAMIC)(fields);
|
|
547
|
+
const variables = {
|
|
548
|
+
id,
|
|
549
|
+
};
|
|
550
|
+
try {
|
|
551
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
552
|
+
return response.getCustomerById;
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
console.log(`Error in getCustomerById: ${error}`);
|
|
556
|
+
throw error;
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
}
|
|
544
560
|
}
|
|
545
561
|
exports.UserService = UserService;
|