@longvansoftware/service-js-client 1.4.6 → 1.4.8

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.
@@ -33,7 +33,7 @@ exports.environmentEndpoints = {
33
33
  dns: "https://admin.longvan.net/powerdns/dns",
34
34
  crm_camping: "https://crm.longvan.vn/campaign-gateway/graphql",
35
35
  order_graphQL: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
36
- paymentLV: "https://payment-staging.longvan.vn/graphql",
36
+ paymentLV: "https://payment.longvan.vn/graphql",
37
37
  resource_permission: "https://api-gateway.longvan.vn/resource-permission-api/graphql"
38
38
  },
39
39
  };
@@ -223,8 +223,8 @@ exports.GET_COMPUTINGS = (0, graphql_tag_1.gql) `
223
223
  }
224
224
  `;
225
225
  exports.GET_LAB_INSTANCE = (0, graphql_tag_1.gql) `
226
- query GetLabInstance($articleId: String!, $labId: String!, $userId: String!) {
227
- getLabInstance(articleId: $articleId, labId: $labId, userId: $userId) {
226
+ query GetLabInstance($labId: String!, $userId: String!) {
227
+ getLabInstance(labId: $labId, userId: $userId) {
228
228
  id
229
229
  name
230
230
  username
@@ -245,6 +245,18 @@ exports.GET_LAB_INSTANCE = (0, graphql_tag_1.gql) `
245
245
  serviceId
246
246
  status
247
247
  statusDetail
248
+ groupType
249
+ colocationId
250
+ ip
251
+ region
252
+ site
253
+ rack
254
+ location
255
+ position
256
+ deviceType
257
+ url
258
+ baremetalId
259
+ platform
248
260
  }
249
261
  }
250
262
  `;
@@ -18,6 +18,7 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
18
18
  amount
19
19
  currencyCode
20
20
  }
21
+ createdStamp
21
22
  }
22
23
  lineItems {
23
24
  orderLineItem {
@@ -15,3 +15,4 @@ export declare const GET_RESOURCE_BY_PRODUCT: import("graphql").DocumentNode;
15
15
  export declare const GET_PRODUCT_VARIANT_BY_ID: import("graphql").DocumentNode;
16
16
  export declare const GET_RELATED_INFOR: import("graphql").DocumentNode;
17
17
  export declare const GET_DETAIL_STORES: import("graphql").DocumentNode;
18
+ export declare const GET_LIST_PRICE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
3
+ exports.GET_LIST_PRICE = exports.GET_DETAIL_STORES = exports.GET_RELATED_INFOR = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  // export const GET_PRODUCT_BY_ID_QUERY = gql`
6
6
  // query GetProductById(
@@ -829,3 +829,16 @@ exports.GET_DETAIL_STORES = (0, graphql_tag_1.gql) `
829
829
  }
830
830
  }
831
831
  `;
832
+ exports.GET_LIST_PRICE = (0, graphql_tag_1.gql) `
833
+ query GetListPrice(
834
+ $partnerId: String!
835
+ $storeChannel: String!
836
+ $productIds: [String!]!
837
+ ) {
838
+ getListPrice(
839
+ partnerId: $partnerId
840
+ storeChannel: $storeChannel
841
+ productIds: $productIds
842
+ )
843
+ }
844
+ `;
@@ -33,7 +33,7 @@ export declare class ComputingService extends Service {
33
33
  networkUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
34
34
  diskUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
35
35
  getComputings(userId: string): Promise<any>;
36
- getLabInstance(articleId: string, labId: string, userId: string): Promise<any>;
36
+ getLabInstance(labId: string, userId: string): Promise<any>;
37
37
  createCluster(ownerId: string, name: string): Promise<any>;
38
38
  addComputingInCluster(clusterId: string, computingId: string, userId: string): Promise<any>;
39
39
  removeComputingInCluster(clusterId: string, computingId: string, userId: string): Promise<any>;
@@ -431,11 +431,10 @@ class ComputingService extends serviceSDK_1.Service {
431
431
  }
432
432
  });
433
433
  }
434
- getLabInstance(articleId, labId, userId) {
434
+ getLabInstance(labId, userId) {
435
435
  return __awaiter(this, void 0, void 0, function* () {
436
436
  const query = queries_1.GET_LAB_INSTANCE;
437
437
  const variables = {
438
- articleId,
439
438
  labId,
440
439
  userId,
441
440
  };
@@ -1217,7 +1217,7 @@ class OrderService extends serviceSDK_1.Service {
1217
1217
  const endpoint = `/front/orders/${this.orgId}/${store ? store : this.storeId}/${orderId}/${orderItemId}/remove?updated_by=${updated_by}&reason=${reason}`;
1218
1218
  const method = "DELETE";
1219
1219
  try {
1220
- const response = yield this.restApiCallWithToken(endpoint, method);
1220
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
1221
1221
  return response;
1222
1222
  }
1223
1223
  catch (error) {
@@ -1238,7 +1238,7 @@ class OrderService extends serviceSDK_1.Service {
1238
1238
  const endpoint = `/front/orders/${this.orgId}/${store ? store : this.storeId}/${orderId}/orderLineItem?updated_by=${updated_by}`;
1239
1239
  const method = "POST";
1240
1240
  try {
1241
- const response = yield this.restApiCallWithToken(endpoint, method, data);
1241
+ const response = yield this.restApiCallWithNoToken(endpoint, method, data);
1242
1242
  return response;
1243
1243
  }
1244
1244
  catch (error) {
@@ -43,4 +43,5 @@ export declare class ProductService extends Service {
43
43
  getProductVariantById(variantId: string): Promise<any>;
44
44
  getRelatedInfor(id: string): Promise<any>;
45
45
  getDetailStores(storeId: string): Promise<any>;
46
+ getListPrice(productIds: string[], storeId: string): Promise<any>;
46
47
  }
@@ -232,5 +232,23 @@ class ProductService extends serviceSDK_1.Service {
232
232
  }
233
233
  });
234
234
  }
235
+ getListPrice(productIds, storeId) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ const query = queries_1.GET_LIST_PRICE;
238
+ const variablesHandle = {
239
+ partnerId: this.orgId,
240
+ storeChannel: storeId ? storeId : this.storeId,
241
+ productIds,
242
+ };
243
+ try {
244
+ const response = yield this.graphqlQueryV2(query, variablesHandle);
245
+ return response.getListPrice;
246
+ }
247
+ catch (error) {
248
+ console.log(`Error fetching getDetailStores error : ${error}`);
249
+ throw error;
250
+ }
251
+ });
252
+ }
235
253
  }
236
254
  exports.ProductService = ProductService;
@@ -96,7 +96,7 @@ class Service {
96
96
  restApiCallWithToken(path, method, data, headers) {
97
97
  return __awaiter(this, void 0, void 0, function* () {
98
98
  try {
99
- const modifiedHeaders = Object.assign({}, headers);
99
+ const modifiedHeaders = Object.assign(Object.assign({}, headers), { PartnerId: this.orgId, Authorization: "Bearer " + this.token });
100
100
  const response = yield (0, axios_1.default)({
101
101
  url: this.endpoint + path,
102
102
  method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [