@longvansoftware/service-js-client 1.12.0 → 1.12.2

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.
@@ -67,8 +67,8 @@ exports.RESET_PASSWORD_MUTATION = (0, graphql_tag_1.gql) `
67
67
  `;
68
68
  exports.UPDATE_INFO_MUTATION = (0, graphql_tag_1.gql) `
69
69
  mutation UpdateInfo(
70
- $orgId: String
71
- $accessToken: String
70
+ $orgId: String!
71
+ $accessToken: String!
72
72
  $updateUserRequest: UpdateUserRequest
73
73
  $type: String
74
74
  $password: String
@@ -1,3 +1,6 @@
1
+ export declare const GET_DOMAIN_INFO: import("graphql").DocumentNode;
2
+ export declare const CHECK_LIST_DOMAIN_NAME: import("graphql").DocumentNode;
3
+ export declare const CHECK_DOMAIN_NAME: import("graphql").DocumentNode;
1
4
  export declare const CHANGE_SERVICE_NAME: import("graphql").DocumentNode;
2
5
  export declare const CREATE_USER_MAIL_HOSTING: import("graphql").DocumentNode;
3
6
  export declare const DELETE_USER_MAIL_HOSTING: import("graphql").DocumentNode;
@@ -1,7 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_DOMAIN_CONTACT = exports.UPDATE_DNS = exports.UPDATE_USER_PASSWORD = exports.UPDATE_PASSWORD = exports.UPDATE_USER_NAME = exports.UPDATE_DOMAIN_NAME = exports.DELETE_USER_MAIL_HOSTING = exports.CREATE_USER_MAIL_HOSTING = exports.CHANGE_SERVICE_NAME = void 0;
3
+ exports.CREATE_DOMAIN_CONTACT = exports.UPDATE_DNS = exports.UPDATE_USER_PASSWORD = exports.UPDATE_PASSWORD = exports.UPDATE_USER_NAME = exports.UPDATE_DOMAIN_NAME = exports.DELETE_USER_MAIL_HOSTING = exports.CREATE_USER_MAIL_HOSTING = exports.CHANGE_SERVICE_NAME = exports.CHECK_DOMAIN_NAME = exports.CHECK_LIST_DOMAIN_NAME = exports.GET_DOMAIN_INFO = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_DOMAIN_INFO = (0, graphql_tag_1.gql) `
6
+ mutation GetDomainInfo($domainName: String!) {
7
+ getDomainInfo(domainName: $domainName) {
8
+ dnssec
9
+ domainName
10
+ existed
11
+ expiredDate
12
+ idnDomainName
13
+ issuedDate
14
+ dns
15
+ reason
16
+ registrantName
17
+ registrarEnUrl
18
+ registrarViUrl
19
+ renewalDeadline
20
+ status
21
+ registrarName
22
+ }
23
+ }
24
+ `;
25
+ exports.CHECK_LIST_DOMAIN_NAME = (0, graphql_tag_1.gql) `
26
+ mutation CheckListDomainName($domainNames: [String!]!) {
27
+ checkListDomainName(domainNames: $domainNames) {
28
+ domainName
29
+ isAvailable
30
+ topDomain
31
+ }
32
+ }
33
+ `;
34
+ exports.CHECK_DOMAIN_NAME = (0, graphql_tag_1.gql) `
35
+ mutation CheckDomainName($domainName: String!) {
36
+ checkDomainName(domainName: $domainName) {
37
+ domainName
38
+ isAvailable
39
+ topDomain
40
+ message
41
+ }
42
+ }
43
+ `;
5
44
  exports.CHANGE_SERVICE_NAME = (0, graphql_tag_1.gql) `
6
45
  mutation ChangeServiceName(
7
46
  $serviceId: String!
@@ -1,3 +1,6 @@
1
+ export declare const CHECK_DOMAIN_NAME_AVAILABLE: import("graphql").DocumentNode;
2
+ export declare const CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC: import("graphql").DocumentNode;
3
+ export declare const GET_WHOIS_DOMAIN_INFO: import("graphql").DocumentNode;
1
4
  export declare const SERVICE_DETAIL: import("graphql").DocumentNode;
2
5
  export declare const GET_MAIL_RESOURCE: import("graphql").DocumentNode;
3
6
  export declare const GET_USER_MAIL_HOSTING: import("graphql").DocumentNode;
@@ -6,12 +9,9 @@ export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
6
9
  export declare const GET_PRODUCTS_OF_SERVICE: import("graphql").DocumentNode;
7
10
  export declare const GET_IPS_OF_SERVICE: import("graphql").DocumentNode;
8
11
  export declare const GET_SERVICES_BY_ORDER_ID: import("graphql").DocumentNode;
9
- export declare const CHECK_DOMAIN_NAME_AVAILABLE: import("graphql").DocumentNode;
10
- export declare const CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC: import("graphql").DocumentNode;
11
12
  export declare const GET_SERVICE_TYPE_LIST: import("graphql").DocumentNode;
12
13
  export declare const GET_DOMAIN_CONTACTS: import("graphql").DocumentNode;
13
14
  export declare const GET_OWNERS_BY_CUSTOMER_ID: import("graphql").DocumentNode;
14
15
  export declare const GET_CONTACTS_BY_OWNER_ID: import("graphql").DocumentNode;
15
- export declare const GET_WHOIS_DOMAIN_INFO: import("graphql").DocumentNode;
16
16
  export declare const GET_DOMAIN_SUPPLIER: import("graphql").DocumentNode;
17
17
  export declare const CHECK_DOMAIN_EXIST: import("graphql").DocumentNode;
@@ -1,7 +1,46 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHECK_DOMAIN_EXIST = exports.GET_DOMAIN_SUPPLIER = 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_AVAILAVLE_VNNIC = 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.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 = 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
+ exports.CHECK_DOMAIN_NAME_AVAILABLE = (0, graphql_tag_1.gql) `
6
+ query CheckDomainNameAvailable($domainName: String!) {
7
+ checkDomainNameAvailable(domainName: $domainName) {
8
+ domainName
9
+ isAvailable
10
+ topDomain
11
+ message
12
+ }
13
+ }
14
+ `;
15
+ exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = (0, graphql_tag_1.gql) `
16
+ query CheckDomainNameAvailableVnnic($domainNames: [String!]!) {
17
+ checkDomainNameAvailableVnnic(domainNames: $domainNames) {
18
+ domainName
19
+ isAvailable
20
+ topDomain
21
+ }
22
+ }
23
+ `;
24
+ exports.GET_WHOIS_DOMAIN_INFO = (0, graphql_tag_1.gql) `
25
+ query GetWhoisDomainInfo($domainName: String!) {
26
+ getWhoisDomainInfo(domainName: $domainName) {
27
+ dnssec
28
+ domainName
29
+ existed
30
+ expiredDate
31
+ idnDomainName
32
+ issuedDate
33
+ dns
34
+ reason
35
+ registrantName
36
+ registrarEnUrl
37
+ registrarViUrl
38
+ renewalDeadline
39
+ status
40
+ registrarName
41
+ }
42
+ }
43
+ `;
5
44
  exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
6
45
  query ServiceDetail($serviceId: String) {
7
46
  serviceDetail(serviceId: $serviceId) {
@@ -160,25 +199,6 @@ exports.GET_SERVICES_BY_ORDER_ID = (0, graphql_tag_1.gql) `
160
199
  }
161
200
  }
162
201
  `;
163
- exports.CHECK_DOMAIN_NAME_AVAILABLE = (0, graphql_tag_1.gql) `
164
- query CheckDomainNameAvailable($domainName: String!) {
165
- checkDomainNameAvailable(domainName: $domainName) {
166
- domainName
167
- isAvailable
168
- topDomain
169
- message
170
- }
171
- }
172
- `;
173
- exports.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC = (0, graphql_tag_1.gql) `
174
- query CheckDomainNameAvailableVnnic($domainNames: [String!]!) {
175
- checkDomainNameAvailableVnnic(domainNames: $domainNames) {
176
- domainName
177
- isAvailable
178
- topDomain
179
- }
180
- }
181
- `;
182
202
  exports.GET_SERVICE_TYPE_LIST = (0, graphql_tag_1.gql) `
183
203
  query {
184
204
  getServiceTypeList {
@@ -262,26 +282,6 @@ exports.GET_CONTACTS_BY_OWNER_ID = (0, graphql_tag_1.gql) `
262
282
  }
263
283
  }
264
284
  `;
265
- exports.GET_WHOIS_DOMAIN_INFO = (0, graphql_tag_1.gql) `
266
- query GetWhoisDomainInfo($domainName: String!) {
267
- getWhoisDomainInfo(domainName: $domainName) {
268
- dnssec
269
- domainName
270
- existed
271
- expiredDate
272
- idnDomainName
273
- issuedDate
274
- dns
275
- reason
276
- registrantName
277
- registrarEnUrl
278
- registrarViUrl
279
- renewalDeadline
280
- status
281
- registrarName
282
- }
283
- }
284
- `;
285
285
  exports.GET_DOMAIN_SUPPLIER = (0, graphql_tag_1.gql) `
286
286
  query GetDomainSupplier($serviceId: String!) {
287
287
  getDomainSupplier(serviceId: $serviceId)
@@ -1,5 +1,5 @@
1
1
  import { Service } from "../serviceSDK";
2
- import { LoginRequest, LoginResponse, RegisterRequest } from "../../types/auth";
2
+ import { LoginRequest, LoginResponse, RegisterRequest, UpdateInfoRequest } from "../../types/auth";
3
3
  /**
4
4
  * Represents the authentication service.
5
5
  */
@@ -32,6 +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(orgId: string, accessToken: string, updateUserRequest: UpdateInfoRequest['updateUserRequest'], type: string, password: string | null): Promise<any>;
35
36
  linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
36
37
  getUserLoginByUserLoginId(userLoginId: string): Promise<any>;
37
38
  checkUsernameExisted(username: string): Promise<any>;
@@ -174,6 +174,37 @@ class AuthService extends serviceSDK_1.Service {
174
174
  }
175
175
  });
176
176
  }
177
+ updateInfo(orgId, accessToken, updateUserRequest, type, password) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ const mutation = mutations_1.UPDATE_INFO_MUTATION;
180
+ const variables = {
181
+ orgId,
182
+ accessToken,
183
+ updateUserRequest: {
184
+ fullName: updateUserRequest.fullName,
185
+ phone: updateUserRequest.phone,
186
+ email: updateUserRequest.email || null,
187
+ address: updateUserRequest.address || null,
188
+ identityNumber: updateUserRequest.identityNumber || null,
189
+ gender: updateUserRequest.gender || null,
190
+ imageUrl: updateUserRequest.imageUrl || null,
191
+ personalTitle: updateUserRequest.personalTitle || null,
192
+ },
193
+ type,
194
+ password,
195
+ };
196
+ console.log("variables", variables);
197
+ try {
198
+ const response = yield this.graphqlMutation(mutation, variables);
199
+ console.log("res update", response);
200
+ return response.updateInfo;
201
+ }
202
+ catch (error) {
203
+ console.log(`Error in updateInfo: ${error}`);
204
+ throw error;
205
+ }
206
+ });
207
+ }
177
208
  linkingUserLoginAndUserDetail(userLoginId, partyId) {
178
209
  return __awaiter(this, void 0, void 0, function* () {
179
210
  const mutation = mutations_1.LINKING_USER_LOGIN_AND_USER_DETAIL;
@@ -297,36 +297,62 @@ class CloudService extends serviceSDK_1.Service {
297
297
  }
298
298
  checkDomainNameAvailable(domainName) {
299
299
  return __awaiter(this, void 0, void 0, function* () {
300
- const query = queries_1.CHECK_DOMAIN_NAME_AVAILABLE;
300
+ const mutation = mutations_1.CHECK_DOMAIN_NAME;
301
301
  const variables = {
302
302
  domainName,
303
303
  };
304
304
  try {
305
- const response = yield this.graphqlQueryV2(query, variables);
306
- return response.checkDomainNameAvailable;
305
+ const response = yield this.graphqlMutationV2(mutation, variables);
306
+ return response.checkDomainName;
307
307
  }
308
308
  catch (error) {
309
- console.log(`Error in checkDomainNameAvailable: ${error}`);
309
+ console.log(`Error in checkDomainName: ${error}`);
310
310
  throw error;
311
311
  }
312
312
  });
313
313
  }
314
314
  checkDomainNameAvailableVnnic(domainNames) {
315
315
  return __awaiter(this, void 0, void 0, function* () {
316
- const query = queries_1.CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC;
316
+ const mutation = mutations_1.CHECK_LIST_DOMAIN_NAME;
317
317
  const variables = {
318
318
  domainNames,
319
319
  };
320
320
  try {
321
- const response = yield this.graphqlQueryV2(query, variables);
322
- return response.checkDomainNameAvailableVnnic;
321
+ const response = yield this.graphqlMutationV2(mutation, variables);
322
+ return response.checkListDomainName;
323
323
  }
324
324
  catch (error) {
325
- console.log(`Error in checkDomainNameAvailableVnnic: ${error}`);
325
+ console.log(`Error in checkListDomainName: ${error}`);
326
326
  throw error;
327
327
  }
328
328
  });
329
329
  }
330
+ // async checkDomainNameAvailable(domainName: string) {
331
+ // const query = CHECK_DOMAIN_NAME_AVAILABLE;
332
+ // const variables = {
333
+ // domainName,
334
+ // };
335
+ // try {
336
+ // const response = await this.graphqlQueryV2(query, variables);
337
+ // return response.checkDomainNameAvailable;
338
+ // } catch (error) {
339
+ // console.log(`Error in checkDomainNameAvailable: ${error}`);
340
+ // throw error;
341
+ // }
342
+ // }
343
+ // async checkDomainNameAvailableVnnic(domainNames: [string]) {
344
+ // const query = CHECK_DOMAIN_NAME_AVAILAVLE_VNNIC;
345
+ // const variables = {
346
+ // domainNames,
347
+ // };
348
+ // try {
349
+ // const response = await this.graphqlQueryV2(query, variables);
350
+ // return response.checkDomainNameAvailableVnnic;
351
+ // } catch (error) {
352
+ // console.log(`Error in checkDomainNameAvailableVnnic: ${error}`);
353
+ // throw error;
354
+ // }
355
+ // }
330
356
  getServiceTypeList() {
331
357
  return __awaiter(this, void 0, void 0, function* () {
332
358
  const query = queries_1.GET_SERVICE_TYPE_LIST;
@@ -399,18 +425,29 @@ class CloudService extends serviceSDK_1.Service {
399
425
  }
400
426
  getWhoisDomainInfo(domainName) {
401
427
  return __awaiter(this, void 0, void 0, function* () {
402
- const query = queries_1.GET_WHOIS_DOMAIN_INFO;
428
+ const mutation = mutations_1.GET_DOMAIN_INFO;
403
429
  const variables = { domainName };
404
430
  try {
405
- const response = yield this.graphqlQueryV2(query, variables);
406
- return response.getWhoisDomainInfo;
431
+ const response = yield this.graphqlMutationV2(mutation, variables);
432
+ return response.getDomainInfo;
407
433
  }
408
434
  catch (error) {
409
- console.log(`Error in getWhoisDomainInfo: ${error}`);
435
+ console.log(`Error in getDomainInfo: ${error}`);
410
436
  throw error;
411
437
  }
412
438
  });
413
439
  }
440
+ // async getWhoisDomainInfo(domainName: string) {
441
+ // const query = GET_WHOIS_DOMAIN_INFO;
442
+ // const variables = { domainName };
443
+ // try {
444
+ // const response = await this.graphqlQueryV2(query, variables);
445
+ // return response.getWhoisDomainInfo;
446
+ // } catch (error) {
447
+ // console.log(`Error in getWhoisDomainInfo: ${error}`);
448
+ // throw error;
449
+ // }
450
+ // }
414
451
  getDomainSupplier(serviceId) {
415
452
  return __awaiter(this, void 0, void 0, function* () {
416
453
  const query = queries_1.GET_DOMAIN_SUPPLIER;
@@ -125,7 +125,8 @@ class OrderService extends serviceSDK_1.Service {
125
125
  */
126
126
  removeVoucher(orderId, voucherCode) {
127
127
  return __awaiter(this, void 0, void 0, function* () {
128
- const endpoint = `/orders/${this.orgId}/${orderId}/voucher/${voucherCode}`;
128
+ const encodedVoucherCode = encodeURIComponent(voucherCode); // Mã hóa voucherCode
129
+ const endpoint = `/orders/${this.orgId}/${orderId}/voucher/${encodedVoucherCode}`;
129
130
  const method = "DELETE";
130
131
  try {
131
132
  const response = yield this.restApiCallWithToken(endpoint, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [