@longvansoftware/storefront-js-client 4.1.7 → 4.1.9
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.d.ts +2 -2
- package/dist/config/config.js +2 -2
- package/dist/src/graphql/cloudCloud/queries.d.ts +2 -0
- package/dist/src/graphql/cloudCloud/queries.js +123 -0
- package/dist/src/lib/SDK.d.ts +3 -3
- package/dist/src/lib/SDK.js +5 -5
- package/dist/src/lib/cloudCloud/index.d.ts +7 -0
- package/dist/src/lib/cloudCloud/index.js +53 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare const environmentEndpoints: {
|
|
|
30
30
|
store: string;
|
|
31
31
|
fileService: string;
|
|
32
32
|
orderCloud: string;
|
|
33
|
-
|
|
33
|
+
cloudCloud: string;
|
|
34
34
|
};
|
|
35
35
|
live: {
|
|
36
36
|
product: string;
|
|
@@ -59,6 +59,6 @@ export declare const environmentEndpoints: {
|
|
|
59
59
|
store: string;
|
|
60
60
|
fileService: string;
|
|
61
61
|
orderCloud: string;
|
|
62
|
-
|
|
62
|
+
cloudCloud: string;
|
|
63
63
|
};
|
|
64
64
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -33,7 +33,7 @@ exports.environmentEndpoints = {
|
|
|
33
33
|
store: "https://storefront.dev.longvan.vn/v2",
|
|
34
34
|
fileService: "https://fileservice.dev.longvan.vn/omnichannel",
|
|
35
35
|
orderCloud: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
|
|
36
|
-
|
|
36
|
+
cloudCloud: "https://api-gateway.dev.longvan.vn/cloud-service-api/graphql",
|
|
37
37
|
},
|
|
38
38
|
live: {
|
|
39
39
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -62,6 +62,6 @@ exports.environmentEndpoints = {
|
|
|
62
62
|
store: "https://storefront.longvan.vn/v2",
|
|
63
63
|
fileService: "https://fileservice.longvan.vn/longvan",
|
|
64
64
|
orderCloud: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
|
|
65
|
-
|
|
65
|
+
cloudCloud: "https://api-gateway.longvan.vn/cloud-service-api/graphql",
|
|
66
66
|
},
|
|
67
67
|
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SERVICE_DETAIL = exports.SEARCH_SERVICE = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
|
|
6
|
+
query SearchService($filter: CloudServiceFilterInput) {
|
|
7
|
+
searchService(filter: $filter) {
|
|
8
|
+
total
|
|
9
|
+
offset
|
|
10
|
+
maxResult
|
|
11
|
+
resultList {
|
|
12
|
+
supplierId
|
|
13
|
+
serviceId
|
|
14
|
+
partnerId
|
|
15
|
+
serviceName
|
|
16
|
+
type
|
|
17
|
+
typeName
|
|
18
|
+
status
|
|
19
|
+
statusFulfillment
|
|
20
|
+
ownerId
|
|
21
|
+
startDate
|
|
22
|
+
endDate
|
|
23
|
+
serviceType
|
|
24
|
+
urlPrivate
|
|
25
|
+
urlPublic
|
|
26
|
+
username
|
|
27
|
+
password
|
|
28
|
+
attrs
|
|
29
|
+
description
|
|
30
|
+
productGroupId
|
|
31
|
+
orderId
|
|
32
|
+
actionRequest {
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
uri
|
|
36
|
+
type
|
|
37
|
+
}
|
|
38
|
+
billingCycle {
|
|
39
|
+
quantity
|
|
40
|
+
unit
|
|
41
|
+
}
|
|
42
|
+
productConfiguration {
|
|
43
|
+
productId
|
|
44
|
+
productTitle
|
|
45
|
+
productResources {
|
|
46
|
+
name
|
|
47
|
+
quantity
|
|
48
|
+
unit
|
|
49
|
+
productId
|
|
50
|
+
giftProductId
|
|
51
|
+
gift
|
|
52
|
+
giftQuantity
|
|
53
|
+
campaignId
|
|
54
|
+
campaignActionId
|
|
55
|
+
qualify
|
|
56
|
+
idParent
|
|
57
|
+
addQuantity
|
|
58
|
+
defaultQuantity
|
|
59
|
+
title
|
|
60
|
+
price
|
|
61
|
+
unitPrice
|
|
62
|
+
totalResource
|
|
63
|
+
unitGift
|
|
64
|
+
giftDuration
|
|
65
|
+
giftDurationUnit
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
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
|
+
`;
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { CashbookService } from "./cashbook";
|
|
|
24
24
|
import { StoreService } from "./store";
|
|
25
25
|
import { FileServiceSerVice } from "./fileService";
|
|
26
26
|
import { OrderCloudService } from "./orderCloud";
|
|
27
|
-
import {
|
|
27
|
+
import { CloudCloudService } from "./cloudCloud";
|
|
28
28
|
export interface Endpoints {
|
|
29
29
|
product: string;
|
|
30
30
|
crm: string;
|
|
@@ -52,7 +52,7 @@ export interface Endpoints {
|
|
|
52
52
|
store: string;
|
|
53
53
|
fileService: string;
|
|
54
54
|
orderCloud: string;
|
|
55
|
-
|
|
55
|
+
cloudCloud: string;
|
|
56
56
|
}
|
|
57
57
|
export declare class SDK {
|
|
58
58
|
orgId: string;
|
|
@@ -82,7 +82,7 @@ export declare class SDK {
|
|
|
82
82
|
zca: ZcaService;
|
|
83
83
|
cashbook: CashbookService;
|
|
84
84
|
store: StoreService;
|
|
85
|
-
|
|
85
|
+
cloudCloud: CloudCloudService;
|
|
86
86
|
fileService: FileServiceSerVice;
|
|
87
87
|
token: string | null;
|
|
88
88
|
orderCloud: OrderCloudService;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -29,7 +29,7 @@ const cashbook_1 = require("./cashbook");
|
|
|
29
29
|
const store_1 = require("./store");
|
|
30
30
|
const fileService_1 = require("./fileService");
|
|
31
31
|
const orderCloud_1 = require("./orderCloud");
|
|
32
|
-
const
|
|
32
|
+
const cloudCloud_1 = require("./cloudCloud");
|
|
33
33
|
class SDK {
|
|
34
34
|
constructor(orgId, storeId, environment) {
|
|
35
35
|
this.orgId = orgId;
|
|
@@ -63,7 +63,7 @@ class SDK {
|
|
|
63
63
|
this.store = new store_1.StoreService(endpoints.store, orgId, storeId); // Using product endpoint for now
|
|
64
64
|
this.fileService = new fileService_1.FileServiceSerVice(endpoints.fileService, orgId, storeId);
|
|
65
65
|
this.orderCloud = new orderCloud_1.OrderCloudService(endpoints.orderCloud, orgId, storeId);
|
|
66
|
-
this.
|
|
66
|
+
this.cloudCloud = new cloudCloud_1.CloudCloudService(endpoints.cloudCloud, orgId, storeId);
|
|
67
67
|
// Initialize other services here
|
|
68
68
|
}
|
|
69
69
|
setToken(token) {
|
|
@@ -96,7 +96,7 @@ class SDK {
|
|
|
96
96
|
this.store.setToken(token);
|
|
97
97
|
this.fileService.setToken(token);
|
|
98
98
|
this.orderCloud.setToken(token);
|
|
99
|
-
this.
|
|
99
|
+
this.cloudCloud.setToken(token);
|
|
100
100
|
}
|
|
101
101
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
102
102
|
// src/service.ts
|
|
@@ -126,7 +126,7 @@ class SDK {
|
|
|
126
126
|
this.store.setStoreId(storeId);
|
|
127
127
|
this.fileService.setStoreId(storeId);
|
|
128
128
|
this.orderCloud.setStoreId(storeId);
|
|
129
|
-
this.
|
|
129
|
+
this.cloudCloud.setStoreId(storeId);
|
|
130
130
|
// Set storeId for other services here
|
|
131
131
|
}
|
|
132
132
|
setOrgId(orgId) {
|
|
@@ -155,7 +155,7 @@ class SDK {
|
|
|
155
155
|
this.store.setOrgId(orgId);
|
|
156
156
|
this.fileService.setOrgId(orgId);
|
|
157
157
|
this.orderCloud.setStoreId(orgId);
|
|
158
|
-
this.
|
|
158
|
+
this.cloudCloud.setStoreId(orgId);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
exports.SDK = SDK;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class CloudCloudService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
setToken(token: string): void;
|
|
5
|
+
searchService(data: any): Promise<any>;
|
|
6
|
+
serviceDetail(serviceId: string): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.CloudCloudService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
const queries_1 = require("../../graphql/cloudCloud/queries");
|
|
15
|
+
class CloudCloudService extends serviceSDK_1.Service {
|
|
16
|
+
constructor(endpoint, orgId, storeId) {
|
|
17
|
+
super(endpoint, orgId, storeId);
|
|
18
|
+
}
|
|
19
|
+
setToken(token) {
|
|
20
|
+
this.token = token;
|
|
21
|
+
}
|
|
22
|
+
searchService(data) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const query = queries_1.SEARCH_SERVICE;
|
|
25
|
+
const variables = {
|
|
26
|
+
filter: data,
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
const response = yield this.graphqlQueryV4(query, variables);
|
|
30
|
+
return response.searchService;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
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
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.CloudCloudService = CloudCloudService;
|