@longvansoftware/service-js-client 1.7.3 → 1.7.5

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,5 @@ 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;
@@ -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_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) {
@@ -181,6 +181,53 @@ exports.GET_SERVICE_TYPE_LIST = (0, graphql_tag_1.gql) `
181
181
  exports.GET_DOMAIN_CONTACTS = (0, graphql_tag_1.gql) `
182
182
  query GetDomainContacts($serviceId: String!) {
183
183
  getDomainContacts(serviceId: $serviceId) {
184
+ supplierId
185
+ domainContacts {
186
+ partyId
187
+ fullName
188
+ otherName
189
+ customerType
190
+ email
191
+ country
192
+ provinceId
193
+ province
194
+ districtId
195
+ district
196
+ wardId
197
+ ward
198
+ address
199
+ phone
200
+ contactType
201
+ taxCode
202
+ businessCode
203
+ idNumber
204
+ gender
205
+ birthday
206
+ level
207
+ }
208
+ }
209
+ }
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) {
184
231
  partyId
185
232
  fullName
186
233
  otherName
@@ -30,4 +30,6 @@ 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>;
33
35
  }
@@ -353,5 +353,33 @@ 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
+ }
356
384
  }
357
385
  exports.CloudService = CloudService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [