@longvansoftware/service-js-client 1.12.0 → 1.12.1

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!
@@ -6,12 +6,9 @@ export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
6
6
  export declare const GET_PRODUCTS_OF_SERVICE: import("graphql").DocumentNode;
7
7
  export declare const GET_IPS_OF_SERVICE: import("graphql").DocumentNode;
8
8
  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
9
  export declare const GET_SERVICE_TYPE_LIST: import("graphql").DocumentNode;
12
10
  export declare const GET_DOMAIN_CONTACTS: import("graphql").DocumentNode;
13
11
  export declare const GET_OWNERS_BY_CUSTOMER_ID: import("graphql").DocumentNode;
14
12
  export declare const GET_CONTACTS_BY_OWNER_ID: import("graphql").DocumentNode;
15
- export declare const GET_WHOIS_DOMAIN_INFO: import("graphql").DocumentNode;
16
13
  export declare const GET_DOMAIN_SUPPLIER: import("graphql").DocumentNode;
17
14
  export declare const CHECK_DOMAIN_EXIST: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
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 = 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) {
@@ -160,25 +160,6 @@ exports.GET_SERVICES_BY_ORDER_ID = (0, graphql_tag_1.gql) `
160
160
  }
161
161
  }
162
162
  `;
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
163
  exports.GET_SERVICE_TYPE_LIST = (0, graphql_tag_1.gql) `
183
164
  query {
184
165
  getServiceTypeList {
@@ -262,26 +243,6 @@ exports.GET_CONTACTS_BY_OWNER_ID = (0, graphql_tag_1.gql) `
262
243
  }
263
244
  }
264
245
  `;
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
246
  exports.GET_DOMAIN_SUPPLIER = (0, graphql_tag_1.gql) `
286
247
  query GetDomainSupplier($serviceId: String!) {
287
248
  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;
@@ -26,14 +26,14 @@ export declare class CloudService extends Service {
26
26
  getProductsOfService(serviceId: string): Promise<any>;
27
27
  getIpsOfService(serviceId: string): Promise<any>;
28
28
  getServicesByOrderId(orderId: string): Promise<any>;
29
- checkDomainNameAvailable(domainName: string): Promise<any>;
30
- checkDomainNameAvailableVnnic(domainNames: [string]): Promise<any>;
29
+ checkDomainName(domainName: string): Promise<any>;
30
+ checkListDomainName(domainNames: [string]): Promise<any>;
31
31
  getServiceTypeList(): Promise<any>;
32
32
  createDomainContact(serviceId: string, domainContacts: any): Promise<any>;
33
33
  getDomainContacts(serviceId: string): Promise<any>;
34
34
  getOwnersByCustomerId(userId: string): Promise<any>;
35
35
  getContactsByOwnerId(ownerId: string): Promise<any>;
36
- getWhoisDomainInfo(domainName: string): Promise<any>;
36
+ getDomainInfo(domainName: string): Promise<any>;
37
37
  getDomainSupplier(serviceId: string): Promise<any>;
38
38
  checkDomainExist(domainName: string): Promise<any>;
39
39
  }
@@ -295,34 +295,34 @@ class CloudService extends serviceSDK_1.Service {
295
295
  }
296
296
  });
297
297
  }
298
- checkDomainNameAvailable(domainName) {
298
+ checkDomainName(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
- checkDomainNameAvailableVnnic(domainNames) {
314
+ checkListDomainName(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
  });
@@ -397,16 +397,16 @@ class CloudService extends serviceSDK_1.Service {
397
397
  }
398
398
  });
399
399
  }
400
- getWhoisDomainInfo(domainName) {
400
+ getDomainInfo(domainName) {
401
401
  return __awaiter(this, void 0, void 0, function* () {
402
- const query = queries_1.GET_WHOIS_DOMAIN_INFO;
402
+ const mutation = mutations_1.GET_DOMAIN_INFO;
403
403
  const variables = { domainName };
404
404
  try {
405
- const response = yield this.graphqlQueryV2(query, variables);
406
- return response.getWhoisDomainInfo;
405
+ const response = yield this.graphqlMutationV2(mutation, variables);
406
+ return response.getDomainInfo;
407
407
  }
408
408
  catch (error) {
409
- console.log(`Error in getWhoisDomainInfo: ${error}`);
409
+ console.log(`Error in getDomainInfo: ${error}`);
410
410
  throw error;
411
411
  }
412
412
  });
@@ -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.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [