@longvansoftware/service-js-client 1.10.4 → 1.10.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.
@@ -13,6 +13,7 @@ export declare const environmentEndpoints: {
13
13
  dns: string;
14
14
  crm_camping: string;
15
15
  order_graphQL: string;
16
+ order_cloud_rest: string;
16
17
  paymentLV: string;
17
18
  resource_permission: string;
18
19
  cloud_rest: string;
@@ -31,6 +32,7 @@ export declare const environmentEndpoints: {
31
32
  dns: string;
32
33
  crm_camping: string;
33
34
  order_graphQL: string;
35
+ order_cloud_rest: string;
34
36
  paymentLV: string;
35
37
  resource_permission: string;
36
38
  cloud_rest: string;
@@ -16,9 +16,10 @@ exports.environmentEndpoints = {
16
16
  dns: "https://admin-dev.longvan.net/powerdns/dns",
17
17
  crm_camping: "https://crm.dev.longvan.vn/campaign-gateway/graphql",
18
18
  order_graphQL: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
19
+ order_cloud_rest: "https://api-gateway.dev.longvan.vn/order-cloud-service",
19
20
  paymentLV: "https://payment.dev.longvan.vn/graphql",
20
21
  resource_permission: "https://api-gateway.dev.longvan.vn/resource-permission-api/graphql",
21
- cloud_rest: "https://api-gateway.dev.longvan.vn/cloud-service-api/v1"
22
+ cloud_rest: "https://api-gateway.dev.longvan.vn/cloud-service-api/v1",
22
23
  },
23
24
  live: {
24
25
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -34,8 +35,9 @@ exports.environmentEndpoints = {
34
35
  dns: "https://admin.longvan.net/powerdns/dns",
35
36
  crm_camping: "https://crm.longvan.vn/campaign-gateway/graphql",
36
37
  order_graphQL: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
38
+ order_cloud_rest: "https://api-gateway.longvan.vn/order-cloud-service",
37
39
  paymentLV: "https://payment.longvan.vn/graphql",
38
40
  resource_permission: "https://api-gateway.longvan.vn/resource-permission-api/graphql",
39
- cloud_rest: "https://api-gateway.longvan.vn/cloud-service-api/v1"
41
+ cloud_rest: "https://api-gateway.longvan.vn/cloud-service-api/v1",
40
42
  },
41
43
  };
@@ -439,11 +439,46 @@ exports.GET_TEMPLATE = (0, graphql_tag_1.gql) `
439
439
  getTemplates {
440
440
  id
441
441
  name
442
- status
443
442
  osType
444
443
  username
445
- createdStamp
446
- updatedStamp
444
+ resourceRecommend {
445
+ cpu {
446
+ size
447
+ used
448
+ unit
449
+ }
450
+ ram {
451
+ size
452
+ used
453
+ unit
454
+ }
455
+ disk {
456
+ index
457
+ storageId
458
+ size
459
+ used
460
+ unit
461
+ }
462
+ }
463
+ resourceMinimum {
464
+ cpu {
465
+ size
466
+ used
467
+ unit
468
+ }
469
+ ram {
470
+ size
471
+ used
472
+ unit
473
+ }
474
+ disk {
475
+ index
476
+ storageId
477
+ size
478
+ used
479
+ unit
480
+ }
481
+ }
447
482
  }
448
483
  }
449
484
  `;
@@ -14,6 +14,7 @@ import { OrderGraphQLService } from "./orderGraphQL";
14
14
  import { PaymentLVService } from "./paymentLV";
15
15
  import { ResourcePermissionService } from "./resource_permission";
16
16
  import { CloudRestService } from "./cloud_rest";
17
+ import { OrderCloudRestService } from "./order_cloud_rest";
17
18
  export interface Endpoints {
18
19
  product: string;
19
20
  crm: string;
@@ -31,6 +32,7 @@ export interface Endpoints {
31
32
  paymentLV: string;
32
33
  resource_permission: string;
33
34
  cloud_rest: string;
35
+ order_cloud_rest: string;
34
36
  }
35
37
  export declare class SDK {
36
38
  orgId: string;
@@ -53,6 +55,7 @@ export declare class SDK {
53
55
  paymentLV: PaymentLVService;
54
56
  resource_permission: ResourcePermissionService;
55
57
  cloud_rest: CloudRestService;
58
+ order_cloud_rest: OrderCloudRestService;
56
59
  token: string | null;
57
60
  private endpoints;
58
61
  constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
@@ -20,6 +20,7 @@ const orderGraphQL_1 = require("./orderGraphQL");
20
20
  const paymentLV_1 = require("./paymentLV");
21
21
  const resource_permission_1 = require("./resource_permission");
22
22
  const cloud_rest_1 = require("./cloud_rest");
23
+ const order_cloud_rest_1 = require("./order_cloud_rest");
23
24
  class SDK {
24
25
  constructor(orgId, storeId, storefrontAccessToken, environment) {
25
26
  this.orgId = orgId;
@@ -50,6 +51,7 @@ class SDK {
50
51
  this.paymentLV = new paymentLV_1.PaymentLVService(this.endpoints.paymentLV, orgId, storeId);
51
52
  this.resource_permission = new resource_permission_1.ResourcePermissionService(this.endpoints.resource_permission, orgId, storeId);
52
53
  this.cloud_rest = new cloud_rest_1.CloudRestService(this.endpoints.cloud_rest, orgId, storeId);
54
+ this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, orgId, storeId);
53
55
  // Initialize other services here
54
56
  }
55
57
  setToken(token) {
@@ -71,6 +73,7 @@ class SDK {
71
73
  this.paymentLV.setToken(token);
72
74
  this.resource_permission.setToken(token);
73
75
  this.cloud_rest.setToken(token);
76
+ this.order_cloud_rest.setToken(token);
74
77
  // Set token for other services here
75
78
  }
76
79
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
@@ -94,6 +97,7 @@ class SDK {
94
97
  this.paymentLV = new paymentLV_1.PaymentLVService(this.endpoints.paymentLV, this.orgId, storeId);
95
98
  this.resource_permission = new resource_permission_1.ResourcePermissionService(this.endpoints.resource_permission, this.orgId, storeId);
96
99
  this.cloud_rest = new cloud_rest_1.CloudRestService(this.endpoints.cloud_rest, this.orgId, storeId);
100
+ this.order_cloud_rest = new order_cloud_rest_1.OrderCloudRestService(this.endpoints.order_cloud_rest, this.orgId, storeId);
97
101
  }
98
102
  }
99
103
  exports.SDK = SDK;
@@ -0,0 +1,7 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class OrderCloudRestService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ setToken(token: string): void;
5
+ setStoreId(storeId: string): void;
6
+ updateOrderConfirmation(orderId: string, createBy: string): Promise<any>;
7
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrderCloudRestService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class OrderCloudRestService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ setToken(token) {
19
+ this.token = token;
20
+ }
21
+ setStoreId(storeId) {
22
+ this.storeId = storeId;
23
+ }
24
+ updateOrderConfirmation(orderId, createBy) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ const endpoint = `/service-webhook?partnerId=${this.orgId}&orderId=${orderId}&createBy=${createBy}`;
27
+ const method = "GET";
28
+ try {
29
+ const response = yield this.restApiCallWithToken(endpoint, method);
30
+ return response;
31
+ }
32
+ catch (error) {
33
+ console.log(`Error in updateOrderConfirmation: ${error}`);
34
+ throw error;
35
+ }
36
+ });
37
+ }
38
+ }
39
+ exports.OrderCloudRestService = OrderCloudRestService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.10.4",
3
+ "version": "1.10.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [