@longvansoftware/storefront-js-client 4.1.8 → 4.2.0

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.
@@ -1 +1,2 @@
1
1
  export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
2
+ export declare const SERVICE_DETAIL: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEARCH_SERVICE = void 0;
3
+ exports.SERVICE_DETAIL = exports.SEARCH_SERVICE = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
6
6
  query SearchService($filter: CloudServiceFilterInput) {
@@ -69,3 +69,55 @@ exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
69
69
  }
70
70
  }
71
71
  `;
72
+ exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
73
+ query ServiceDetail($serviceId: String) {
74
+ serviceDetail(serviceId: $serviceId) {
75
+ service {
76
+ supplierId
77
+ serviceId
78
+ partnerId
79
+ serviceName
80
+ type
81
+ typeName
82
+ status
83
+ statusFulfillment
84
+ ownerId
85
+ startDate
86
+ endDate
87
+ serviceType
88
+ urlPrivate
89
+ urlPublic
90
+ username
91
+ password
92
+ attrs
93
+ description
94
+ ips
95
+ productGroupId
96
+ orderId
97
+ }
98
+ resources {
99
+ type
100
+ name
101
+ total
102
+ unit
103
+ component
104
+ value
105
+ keyId
106
+ }
107
+ configs {
108
+ configId
109
+ name
110
+ configValue
111
+ }
112
+ extraData {
113
+ title
114
+ content {
115
+ name
116
+ value
117
+ type
118
+ action
119
+ }
120
+ }
121
+ }
122
+ }
123
+ `;
@@ -3,4 +3,5 @@ export declare class CloudCloudService extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
4
  setToken(token: string): void;
5
5
  searchService(data: any): Promise<any>;
6
+ serviceDetail(serviceId: string): Promise<any>;
6
7
  }
@@ -34,5 +34,20 @@ class CloudCloudService extends serviceSDK_1.Service {
34
34
  }
35
35
  });
36
36
  }
37
+ serviceDetail(serviceId) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const query = queries_1.SERVICE_DETAIL;
40
+ const variables = {
41
+ serviceId,
42
+ };
43
+ try {
44
+ const response = yield this.graphqlQueryV4(query, variables);
45
+ return response.serviceDetail;
46
+ }
47
+ catch (error) {
48
+ throw error;
49
+ }
50
+ });
51
+ }
37
52
  }
38
53
  exports.CloudCloudService = CloudCloudService;
@@ -27,4 +27,5 @@ export declare class PortalService extends Service {
27
27
  bookingSchedule(data: Record<string, any>): Promise<any>;
28
28
  getWorkSchedule(orgId: string, query?: Record<string, any>): Promise<any>;
29
29
  updateSchedule(orgId: string, data: Record<string, any>): Promise<any>;
30
+ getPosition(query?: Record<string, any>): Promise<any>;
30
31
  }
@@ -369,7 +369,7 @@ class PortalService extends serviceSDK_1.Service {
369
369
  }
370
370
  updateSchedule(orgId, data) {
371
371
  return __awaiter(this, void 0, void 0, function* () {
372
- const method = 'POST';
372
+ const method = "POST";
373
373
  const endpoint = `/dynamic-collection/public/v2/schedule/actionBooking`;
374
374
  try {
375
375
  const response = yield this.restApiCallWithNoToken(endpoint, method, data);
@@ -380,5 +380,29 @@ class PortalService extends serviceSDK_1.Service {
380
380
  }
381
381
  });
382
382
  }
383
+ getPosition(query) {
384
+ return __awaiter(this, void 0, void 0, function* () {
385
+ const method = "GET";
386
+ const baseUrl = `/dynamic-collection/public/v2/records/POSITION/danh_sach_vi_tri`;
387
+ const params = new URLSearchParams();
388
+ if (query) {
389
+ Object.entries(query).forEach(([key, value]) => {
390
+ if (value !== undefined && value !== null) {
391
+ params.append(key, String(value));
392
+ }
393
+ });
394
+ }
395
+ const endpoint = params.toString()
396
+ ? `${baseUrl}?${params.toString()}`
397
+ : baseUrl;
398
+ try {
399
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
400
+ return response;
401
+ }
402
+ catch (error) {
403
+ throw error;
404
+ }
405
+ });
406
+ }
383
407
  }
384
408
  exports.PortalService = PortalService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.1.8",
3
+ "version": "4.2.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [