@longvansoftware/service-js-client 1.7.4 → 1.7.6

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.
@@ -9,3 +9,6 @@ export declare const GET_SERVICES_BY_ORDER_ID: import("graphql").DocumentNode;
9
9
  export declare const CHECK_DOMAIN_NAME_AVAILABLE: import("graphql").DocumentNode;
10
10
  export declare const GET_SERVICE_TYPE_LIST: import("graphql").DocumentNode;
11
11
  export declare const GET_DOMAIN_CONTACTS: import("graphql").DocumentNode;
12
+ export declare const GET_OWNERS_BY_CUSTOMER_ID: import("graphql").DocumentNode;
13
+ export declare const GET_CONTACTS_BY_OWNER_ID: import("graphql").DocumentNode;
14
+ export declare const GET_WHOIS_DOMAIN_INFO: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.CHECK_DOMAIN_NAME_AVAILABLE = 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 = void 0;
3
+ exports.GET_WHOIS_DOMAIN_INFO = exports.GET_CONTACTS_BY_OWNER_ID = exports.GET_OWNERS_BY_CUSTOMER_ID = exports.GET_DOMAIN_CONTACTS = exports.GET_SERVICE_TYPE_LIST = exports.CHECK_DOMAIN_NAME_AVAILABLE = 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 = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
6
6
  query ServiceDetail($serviceId: String) {
@@ -208,3 +208,66 @@ exports.GET_DOMAIN_CONTACTS = (0, graphql_tag_1.gql) `
208
208
  }
209
209
  }
210
210
  `;
211
+ exports.GET_OWNERS_BY_CUSTOMER_ID = (0, graphql_tag_1.gql) `
212
+ query GetOwnersByCustomerId($userId: String!) {
213
+ getOwnersByCustomerId(userId: $userId) {
214
+ id
215
+ name
216
+ type
217
+ phone
218
+ email
219
+ identityNumber
220
+ imageUrl
221
+ address
222
+ birthday
223
+ gender
224
+ status
225
+ }
226
+ }
227
+ `;
228
+ exports.GET_CONTACTS_BY_OWNER_ID = (0, graphql_tag_1.gql) `
229
+ query GetContactsByOwnerId($ownerId: String!) {
230
+ getContactsByOwnerId(ownerId: $ownerId) {
231
+ partyId
232
+ fullName
233
+ otherName
234
+ customerType
235
+ email
236
+ country
237
+ provinceId
238
+ province
239
+ districtId
240
+ district
241
+ wardId
242
+ ward
243
+ address
244
+ phone
245
+ contactType
246
+ taxCode
247
+ businessCode
248
+ idNumber
249
+ gender
250
+ birthday
251
+ level
252
+ }
253
+ }
254
+ `;
255
+ exports.GET_WHOIS_DOMAIN_INFO = (0, graphql_tag_1.gql) `
256
+ query GetWhoisDomainInfo($domainName: String!) {
257
+ getWhoisDomainInfo(domainName: $domainName) {
258
+ dnssec
259
+ domainName
260
+ existed
261
+ expiredDate
262
+ idnDomainName
263
+ issuedDate
264
+ nameServer
265
+ reason
266
+ registrantName
267
+ registrarEnUrl
268
+ registrarViUrl
269
+ renewalDeadline
270
+ status
271
+ }
272
+ }
273
+ `;
@@ -30,4 +30,7 @@ export declare class CloudService extends Service {
30
30
  getServiceTypeList(): Promise<any>;
31
31
  createDomainContact(serviceId: string, domainContacts: any): Promise<any>;
32
32
  getDomainContacts(serviceId: string): Promise<any>;
33
+ getOwnersByCustomerId(userId: string): Promise<any>;
34
+ getContactsByOwnerId(ownerId: string): Promise<any>;
35
+ getWhoisDomainInfo(domainName: string): Promise<any>;
33
36
  }
@@ -353,5 +353,47 @@ class CloudService extends serviceSDK_1.Service {
353
353
  }
354
354
  });
355
355
  }
356
+ getOwnersByCustomerId(userId) {
357
+ return __awaiter(this, void 0, void 0, function* () {
358
+ const query = queries_1.GET_OWNERS_BY_CUSTOMER_ID;
359
+ const variables = { userId };
360
+ try {
361
+ const response = yield this.graphqlQueryV2(query, variables);
362
+ return response.getOwnersByCustomerId;
363
+ }
364
+ catch (error) {
365
+ console.log(`Error in getOwnersByCustomerId: ${error}`);
366
+ throw error;
367
+ }
368
+ });
369
+ }
370
+ getContactsByOwnerId(ownerId) {
371
+ return __awaiter(this, void 0, void 0, function* () {
372
+ const query = queries_1.GET_CONTACTS_BY_OWNER_ID;
373
+ const variables = { ownerId };
374
+ try {
375
+ const response = yield this.graphqlQueryV2(query, variables);
376
+ return response.getContactsByOwnerId;
377
+ }
378
+ catch (error) {
379
+ console.log(`Error in getContactsByOwnerId: ${error}`);
380
+ throw error;
381
+ }
382
+ });
383
+ }
384
+ getWhoisDomainInfo(domainName) {
385
+ return __awaiter(this, void 0, void 0, function* () {
386
+ const query = queries_1.GET_WHOIS_DOMAIN_INFO;
387
+ const variables = { domainName };
388
+ try {
389
+ const response = yield this.graphqlQueryV2(query, variables);
390
+ return response.getWhoisDomainInfo;
391
+ }
392
+ catch (error) {
393
+ console.log(`Error in getWhoisDomainInfo: ${error}`);
394
+ throw error;
395
+ }
396
+ });
397
+ }
356
398
  }
357
399
  exports.CloudService = CloudService;
@@ -12,4 +12,5 @@ export declare class CloudRestService extends Service {
12
12
  getProvinces(): Promise<any>;
13
13
  getDistrictsByProvinceId(provinceId: string): Promise<any>;
14
14
  getWardByDistrictId(districtId: string): Promise<any>;
15
+ getEnterprises(gdtCode: string): Promise<any>;
15
16
  }
@@ -69,5 +69,19 @@ class CloudRestService extends serviceSDK_1.Service {
69
69
  }
70
70
  });
71
71
  }
72
+ getEnterprises(gdtCode) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const endpoint = `/enterprises/query?gdtCode=${gdtCode}`;
75
+ const method = "GET";
76
+ try {
77
+ const response = yield this.restApiCallWithToken(endpoint, method);
78
+ return response;
79
+ }
80
+ catch (error) {
81
+ console.log(`Error in getEnterprises: ${error}`);
82
+ throw error;
83
+ }
84
+ });
85
+ }
72
86
  }
73
87
  exports.CloudRestService = CloudRestService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [