@longvansoftware/service-js-client 2.1.7 → 2.1.9

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.
@@ -8,3 +8,4 @@ export declare const GET_PHONE_BY_PARTYID: DocumentNode;
8
8
  export declare const GET_EMAIL_BY_PARTYID: DocumentNode;
9
9
  export declare const GET_ACCESS_TOKEN_BY_OTP: DocumentNode;
10
10
  export declare const GET_PARTY_DETAIL_BY_PHONE: (fields?: string[]) => DocumentNode;
11
+ export declare const GET_ORGANIZATIONS_BY_PARTYID: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_PARTY_DETAIL_BY_PHONE = exports.GET_ACCESS_TOKEN_BY_OTP = exports.GET_EMAIL_BY_PARTYID = exports.GET_PHONE_BY_PARTYID = exports.GET_USER_LOGIN_BY_PARTY_ID = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
3
+ exports.GET_ORGANIZATIONS_BY_PARTYID = exports.GET_PARTY_DETAIL_BY_PHONE = exports.GET_ACCESS_TOKEN_BY_OTP = exports.GET_EMAIL_BY_PARTYID = exports.GET_PHONE_BY_PARTYID = exports.GET_USER_LOGIN_BY_PARTY_ID = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
6
6
  query GetUserDetail($orgId: String!, $accessToken: String!) {
@@ -98,3 +98,15 @@ const GET_PARTY_DETAIL_BY_PHONE = (fields = []) => {
98
98
  `;
99
99
  };
100
100
  exports.GET_PARTY_DETAIL_BY_PHONE = GET_PARTY_DETAIL_BY_PHONE;
101
+ const GET_ORGANIZATIONS_BY_PARTYID = (fields = []) => {
102
+ const fieldStr = fields.join("\n ");
103
+ const hasFields = fields.length > 0;
104
+ return (0, graphql_tag_1.gql) `
105
+ query getOrganizationsByPartyId($partyId: String!) {
106
+ getOrganizationsByPartyId(partyId: $partyId) {
107
+ ${hasFields ? `${fieldStr}` : ""}
108
+ }
109
+ }
110
+ `;
111
+ };
112
+ exports.GET_ORGANIZATIONS_BY_PARTYID = GET_ORGANIZATIONS_BY_PARTYID;
@@ -19,3 +19,4 @@ export declare const GET_DOMAIN_SUPPLIER: DocumentNode;
19
19
  export declare const CHECK_DOMAIN_EXIST: DocumentNode;
20
20
  export declare const SEARCH_ACTIONS: DocumentNode;
21
21
  export declare const GET_ELASTIC_CLOUD_RESOURCE: DocumentNode;
22
+ export declare const SEARCH_SERVICE_DYNAMIC: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_ELASTIC_CLOUD_RESOURCE = exports.SEARCH_ACTIONS = exports.CHECK_DOMAIN_EXIST = exports.GET_DOMAIN_SUPPLIER = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.GET_SERVICES_BY_ORDER_ID = exports.GET_IPS_OF_SERVICE = exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL_DYNAMIC = exports.SERVICE_DETAIL = exports.GET_WHOIS_DOMAIN_INFO = exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = exports.CHECK_DOMAIN_NAME_AVAILABLE = void 0;
3
+ exports.SEARCH_SERVICE_DYNAMIC = exports.GET_ELASTIC_CLOUD_RESOURCE = exports.SEARCH_ACTIONS = exports.CHECK_DOMAIN_EXIST = exports.GET_DOMAIN_SUPPLIER = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.GET_SERVICES_BY_ORDER_ID = exports.GET_IPS_OF_SERVICE = exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL_DYNAMIC = exports.SERVICE_DETAIL = exports.GET_WHOIS_DOMAIN_INFO = exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = exports.CHECK_DOMAIN_NAME_AVAILABLE = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.CHECK_DOMAIN_NAME_AVAILABLE = (0, graphql_tag_1.gql) `
6
6
  query CheckDomainNameAvailable($domainName: String!) {
@@ -379,3 +379,15 @@ exports.GET_ELASTIC_CLOUD_RESOURCE = (0, graphql_tag_1.gql) `
379
379
  }
380
380
  }
381
381
  `;
382
+ const SEARCH_SERVICE_DYNAMIC = (fields = []) => {
383
+ const fieldStr = fields.join('\n ');
384
+ const hasFields = fields.length > 0;
385
+ return (0, graphql_tag_1.gql) `
386
+ query SearchService($filter: CloudServiceFilterInput) {
387
+ searchService(filter: $filter) {
388
+ ${hasFields ? `${fieldStr}` : ''}
389
+ }
390
+ }
391
+ `;
392
+ };
393
+ exports.SEARCH_SERVICE_DYNAMIC = SEARCH_SERVICE_DYNAMIC;
@@ -46,4 +46,5 @@ export declare class AuthService extends Service {
46
46
  getEmailByPartyId(partyId: string): Promise<any>;
47
47
  getPartyDetailByPhone(phone: string, fields: string[]): Promise<any>;
48
48
  createPartyDetail(name: string, phone: string, createdBy: string, source: string, fields: string[]): Promise<any>;
49
+ getOrganizationsByPartyIdDynamic(partyId: string, fields: string[]): Promise<any>;
49
50
  }
@@ -428,5 +428,21 @@ class AuthService extends serviceSDK_1.Service {
428
428
  }
429
429
  });
430
430
  }
431
+ getOrganizationsByPartyIdDynamic(partyId, fields) {
432
+ return __awaiter(this, void 0, void 0, function* () {
433
+ const query = (0, queries_1.GET_ORGANIZATIONS_BY_PARTYID)(fields);
434
+ const variables = {
435
+ partyId
436
+ };
437
+ try {
438
+ const response = yield this.graphqlQuery(query, variables);
439
+ return response.getOrganizationsByPartyId;
440
+ }
441
+ catch (error) {
442
+ console.log(`Error in getOrganizationsByPartyId: ${error}`);
443
+ throw error;
444
+ }
445
+ });
446
+ }
431
447
  }
432
448
  exports.AuthService = AuthService;
@@ -52,4 +52,5 @@ export declare class CloudService extends Service {
52
52
  updateActionStatus(actionId: string, status: string, byUser: string): Promise<any>;
53
53
  updateActionCustomAttribute(actionId: string, attrName: string, attrValue: string, byUser: string): Promise<any>;
54
54
  getElasticCloudResource(serviceId: string): Promise<any>;
55
+ searchServiceDynamic(filter: Filter, fields: string[]): Promise<any>;
55
56
  }
@@ -750,5 +750,21 @@ class CloudService extends serviceSDK_1.Service {
750
750
  }
751
751
  });
752
752
  }
753
+ searchServiceDynamic(filter, fields) {
754
+ return __awaiter(this, void 0, void 0, function* () {
755
+ const query = (0, queries_1.SEARCH_SERVICE_DYNAMIC)(fields);
756
+ const variables = {
757
+ filter,
758
+ };
759
+ try {
760
+ const response = yield this.graphqlQueryV2(query, variables);
761
+ return response.searchService;
762
+ }
763
+ catch (error) {
764
+ console.log(`Error in searchServiceDynamic: ${error}`);
765
+ throw error;
766
+ }
767
+ });
768
+ }
753
769
  }
754
770
  exports.CloudService = CloudService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [