@longvansoftware/service-js-client 1.3.2 → 1.3.4
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.
- package/dist/config/config.js +1 -1
- package/dist/src/graphql/cloud/queries.js +3 -0
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +32 -1
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +16 -0
- package/package.json +1 -1
package/dist/config/config.js
CHANGED
@@ -24,7 +24,7 @@ exports.environmentEndpoints = {
|
|
24
24
|
auth: "https://crm.longvan.vn/authorization-gateway/graphql",
|
25
25
|
order: "https://storefront.longvan.vn/v2",
|
26
26
|
user: "https://user.longvan.vn/user-gateway/graphql",
|
27
|
-
payment: "https://portal.longvan.vn/invoice-gateway/graphql",
|
27
|
+
payment: "https://portal-staging.longvan.vn/invoice-gateway/graphql",
|
28
28
|
service: "https://portal.longvan.vn/service-api/graphql",
|
29
29
|
warehouse: "https://facility-api-v2.longvan.vn/facility-api/public-facility/1.0.0",
|
30
30
|
computing: "https://api-gateway.longvan.vn/computing-service/graphql",
|
@@ -28,6 +28,7 @@ exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
|
|
28
28
|
password
|
29
29
|
attrs
|
30
30
|
description
|
31
|
+
ips
|
31
32
|
}
|
32
33
|
resources {
|
33
34
|
type
|
@@ -116,6 +117,8 @@ exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
|
|
116
117
|
username
|
117
118
|
password
|
118
119
|
attrs
|
120
|
+
description
|
121
|
+
ips
|
119
122
|
}
|
120
123
|
}
|
121
124
|
}
|
@@ -13,3 +13,4 @@ export declare const GET_PRODUCTS: import("graphql").DocumentNode;
|
|
13
13
|
export declare const GET_HANDLE_BY_SERVICETYPE: import("graphql").DocumentNode;
|
14
14
|
export declare const GET_RESOURCE_BY_PRODUCT: import("graphql").DocumentNode;
|
15
15
|
export declare const GET_PRODUCT_VARIANT_BY_ID: import("graphql").DocumentNode;
|
16
|
+
export declare const GET_RELATED_INFOR: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
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_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(
|
@@ -477,15 +477,38 @@ exports.GET_PRODUCT_OPTION = (0, graphql_tag_1.gql) `
|
|
477
477
|
) {
|
478
478
|
id
|
479
479
|
name
|
480
|
+
position
|
481
|
+
type
|
480
482
|
subType
|
483
|
+
fill
|
484
|
+
requireData
|
485
|
+
values
|
486
|
+
valuesFull {
|
487
|
+
id
|
488
|
+
name
|
489
|
+
}
|
490
|
+
valuesPortal {
|
491
|
+
id
|
492
|
+
name
|
493
|
+
}
|
481
494
|
productFeatureDTOS {
|
495
|
+
id
|
496
|
+
featureTypeId
|
482
497
|
productOptionGroupItemDTOS {
|
483
498
|
id
|
499
|
+
price
|
484
500
|
productId
|
485
501
|
productName
|
502
|
+
}
|
503
|
+
productOptionConfigs {
|
504
|
+
id
|
486
505
|
price
|
506
|
+
productId
|
507
|
+
productName
|
487
508
|
}
|
488
509
|
}
|
510
|
+
createStamp
|
511
|
+
createdBy
|
489
512
|
}
|
490
513
|
}
|
491
514
|
`;
|
@@ -760,3 +783,11 @@ exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
|
|
760
783
|
}
|
761
784
|
}
|
762
785
|
`;
|
786
|
+
exports.GET_RELATED_INFOR = (0, graphql_tag_1.gql) `
|
787
|
+
query GetProductVariantById($id: String!) {
|
788
|
+
getRelatedInfor(id: $id) {
|
789
|
+
id
|
790
|
+
type
|
791
|
+
}
|
792
|
+
}
|
793
|
+
`;
|
@@ -38,4 +38,5 @@ export declare class ProductService extends Service {
|
|
38
38
|
getHandleByServiceTypes(serviceTypes: [string]): Promise<any>;
|
39
39
|
getResourceByProduct(productId: string): Promise<any>;
|
40
40
|
getProductVariantById(variantId: string): Promise<any>;
|
41
|
+
getRelatedInfor(id: string): Promise<any>;
|
41
42
|
}
|
@@ -196,5 +196,21 @@ class ProductService extends serviceSDK_1.Service {
|
|
196
196
|
}
|
197
197
|
});
|
198
198
|
}
|
199
|
+
getRelatedInfor(id) {
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
201
|
+
const query = queries_1.GET_RELATED_INFOR;
|
202
|
+
const variablesHandle = {
|
203
|
+
id,
|
204
|
+
};
|
205
|
+
try {
|
206
|
+
const response = yield this.graphqlQueryV2(query, variablesHandle);
|
207
|
+
return response.getRelatedInfor;
|
208
|
+
}
|
209
|
+
catch (error) {
|
210
|
+
console.log(`Error fetching getRelatedInfor error : ${error}`);
|
211
|
+
throw error;
|
212
|
+
}
|
213
|
+
});
|
214
|
+
}
|
199
215
|
}
|
200
216
|
exports.ProductService = ProductService;
|