@longvansoftware/storefront-js-client 4.8.0 → 4.8.2
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 -0
- package/dist/config/config.js +2 -0
- package/dist/src/graphql/campaign/queries.js +13 -0
- package/dist/src/graphql/storefont/mutation.d.ts +0 -0
- package/dist/src/graphql/storefont/mutation.js +1 -0
- package/dist/src/graphql/storefont/queries.d.ts +2 -0
- package/dist/src/graphql/storefont/queries.js +46 -0
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +5 -0
- package/dist/src/lib/storefont/index.d.ts +6 -0
- package/dist/src/lib/{cloudService → storefont}/index.js +25 -9
- package/package.json +1 -1
- package/dist/src/graphql/cloudService/queries.d.ts +0 -1
- package/dist/src/graphql/cloudService/queries.js +0 -71
- package/dist/src/lib/cloudService/index.d.ts +0 -5
package/dist/config/config.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare const environmentEndpoints: {
|
|
|
34
34
|
truedoc: string;
|
|
35
35
|
marketplace: string;
|
|
36
36
|
tag: string;
|
|
37
|
+
storefont: string;
|
|
37
38
|
};
|
|
38
39
|
live: {
|
|
39
40
|
product: string;
|
|
@@ -66,5 +67,6 @@ export declare const environmentEndpoints: {
|
|
|
66
67
|
truedoc: string;
|
|
67
68
|
marketplace: string;
|
|
68
69
|
tag: string;
|
|
70
|
+
storefont: string;
|
|
69
71
|
};
|
|
70
72
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.environmentEndpoints = {
|
|
|
37
37
|
truedoc: "https://api-gateway.dev.truedoc.vn/bmlconnector/graphql",
|
|
38
38
|
marketplace: "https://api-gateway.dev.longvan.vn/marketplace/graphql",
|
|
39
39
|
tag: "https://portal.dev.longvan.vn/tag-api/graphql",
|
|
40
|
+
storefont: "https://storefront.dev.longvan.vn/graphql",
|
|
40
41
|
},
|
|
41
42
|
live: {
|
|
42
43
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -69,5 +70,6 @@ exports.environmentEndpoints = {
|
|
|
69
70
|
truedoc: "https://api-gateway.truedoc.vn/bmlconnector/graphql",
|
|
70
71
|
marketplace: "https://api-gateway.longvan.vn/marketplace/graphql",
|
|
71
72
|
tag: "https://portal.longvan.vn/tag-api/graphql",
|
|
73
|
+
storefont: "https://storefront.dev.longvan.vn/graphql",
|
|
72
74
|
},
|
|
73
75
|
};
|
|
@@ -63,8 +63,13 @@ exports.GET_VOUCHERS = (0, graphql_tag_1.gql) `
|
|
|
63
63
|
status
|
|
64
64
|
discountAmount
|
|
65
65
|
discountPercent
|
|
66
|
+
discountType
|
|
67
|
+
discountValue
|
|
66
68
|
usageLimitPerVoucher
|
|
67
69
|
maximumDiscount
|
|
70
|
+
maximumDiscountType
|
|
71
|
+
minimumSpend
|
|
72
|
+
maximumSpend
|
|
68
73
|
numberOfTimeUsed
|
|
69
74
|
id
|
|
70
75
|
createdStamp
|
|
@@ -73,6 +78,14 @@ exports.GET_VOUCHERS = (0, graphql_tag_1.gql) `
|
|
|
73
78
|
createdBy
|
|
74
79
|
isBirthday
|
|
75
80
|
customerId
|
|
81
|
+
scope
|
|
82
|
+
affiliateId
|
|
83
|
+
description
|
|
84
|
+
usageLimitType
|
|
85
|
+
customAttribute
|
|
86
|
+
assignUserLimit
|
|
87
|
+
ownerPartyId
|
|
88
|
+
migratedFromReferralId
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
91
|
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = exports.GET_REVENUE_STATISTIC_BY_PRODUCT = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.GET_REVENUE_STATISTIC_BY_PRODUCT = (0, graphql_tag_1.gql) `
|
|
6
|
+
query GetRevenueStatisticByProduct($input: ProductStatisticPagedInput!) {
|
|
7
|
+
getRevenueStatisticByProduct(input: $input) {
|
|
8
|
+
totalElements
|
|
9
|
+
totalPages
|
|
10
|
+
page
|
|
11
|
+
size
|
|
12
|
+
content {
|
|
13
|
+
id
|
|
14
|
+
name
|
|
15
|
+
sku
|
|
16
|
+
image
|
|
17
|
+
productParentId
|
|
18
|
+
totalQuantity
|
|
19
|
+
inventory
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
exports.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY = (0, graphql_tag_1.gql) `
|
|
25
|
+
query GetRevenueStatisticByGroupOrCategory(
|
|
26
|
+
$input: ProductStatisticInput!
|
|
27
|
+
$groupBy: StatisticGroupBy!
|
|
28
|
+
) {
|
|
29
|
+
getRevenueStatisticByGroupOrCategory(input: $input, groupBy: $groupBy) {
|
|
30
|
+
totalElements
|
|
31
|
+
totalPages
|
|
32
|
+
page
|
|
33
|
+
size
|
|
34
|
+
content {
|
|
35
|
+
id
|
|
36
|
+
name
|
|
37
|
+
totalOrders
|
|
38
|
+
totalPriceOfSales
|
|
39
|
+
totalPriceOfService
|
|
40
|
+
totalPriceOfRenewals
|
|
41
|
+
totalPrice
|
|
42
|
+
totalNotPayYet
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { CloudCloudService } from "./cloudCloud";
|
|
|
28
28
|
import { TruedocService } from "./truedoc";
|
|
29
29
|
import { MarketPlaceService } from "./marketplace";
|
|
30
30
|
import { TagService } from "./tag";
|
|
31
|
+
import { StorefontService } from "./storefont";
|
|
31
32
|
export interface Endpoints {
|
|
32
33
|
product: string;
|
|
33
34
|
crm: string;
|
|
@@ -59,6 +60,7 @@ export interface Endpoints {
|
|
|
59
60
|
truedoc: string;
|
|
60
61
|
marketplace: string;
|
|
61
62
|
tag: string;
|
|
63
|
+
storefont: string;
|
|
62
64
|
}
|
|
63
65
|
export declare class SDK {
|
|
64
66
|
orgId: string;
|
|
@@ -94,6 +96,7 @@ export declare class SDK {
|
|
|
94
96
|
truedoc: TruedocService;
|
|
95
97
|
marketplace: MarketPlaceService;
|
|
96
98
|
tag: TagService;
|
|
99
|
+
storefont: StorefontService;
|
|
97
100
|
token: string | null;
|
|
98
101
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
99
102
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -33,6 +33,7 @@ const cloudCloud_1 = require("./cloudCloud");
|
|
|
33
33
|
const truedoc_1 = require("./truedoc");
|
|
34
34
|
const marketplace_1 = require("./marketplace");
|
|
35
35
|
const tag_1 = require("./tag");
|
|
36
|
+
const storefont_1 = require("./storefont");
|
|
36
37
|
class SDK {
|
|
37
38
|
constructor(orgId, storeId, environment) {
|
|
38
39
|
this.orgId = orgId;
|
|
@@ -70,6 +71,7 @@ class SDK {
|
|
|
70
71
|
this.truedoc = new truedoc_1.TruedocService(endpoints.truedoc, orgId, storeId);
|
|
71
72
|
this.marketplace = new marketplace_1.MarketPlaceService(endpoints.marketplace, orgId, storeId);
|
|
72
73
|
this.tag = new tag_1.TagService(endpoints.tag, orgId, storeId);
|
|
74
|
+
this.storefont = new storefont_1.StorefontService(endpoints.storefont, orgId, storeId);
|
|
73
75
|
// Initialize other services here
|
|
74
76
|
}
|
|
75
77
|
setToken(token) {
|
|
@@ -106,6 +108,7 @@ class SDK {
|
|
|
106
108
|
this.truedoc.setToken(token);
|
|
107
109
|
this.marketplace.setToken(token);
|
|
108
110
|
this.tag.setToken(token);
|
|
111
|
+
this.storefont.setToken(token);
|
|
109
112
|
}
|
|
110
113
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
111
114
|
// src/service.ts
|
|
@@ -139,6 +142,7 @@ class SDK {
|
|
|
139
142
|
this.truedoc.setStoreId(storeId);
|
|
140
143
|
this.marketplace.setStoreId(storeId);
|
|
141
144
|
this.tag.setStoreId(storeId);
|
|
145
|
+
this.storefont.setStoreId(storeId);
|
|
142
146
|
// Set storeId for other services here
|
|
143
147
|
}
|
|
144
148
|
setOrgId(orgId) {
|
|
@@ -171,6 +175,7 @@ class SDK {
|
|
|
171
175
|
this.truedoc.setOrgId(orgId);
|
|
172
176
|
this.marketplace.setOrgId(orgId);
|
|
173
177
|
this.tag.setOrgId(orgId);
|
|
178
|
+
this.storefont.setOrgId(orgId);
|
|
174
179
|
}
|
|
175
180
|
}
|
|
176
181
|
exports.SDK = SDK;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class StorefontService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
getRevenueStatisticByGroupOrCategory(dataQuery: any, groupBy: any): Promise<any>;
|
|
5
|
+
getRevenueStatisticByProduct(dataQuery: any): Promise<any>;
|
|
6
|
+
}
|
|
@@ -9,22 +9,38 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.StorefontService = void 0;
|
|
13
13
|
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
-
const queries_1 = require("../../graphql/
|
|
15
|
-
class
|
|
14
|
+
const queries_1 = require("../../graphql/storefont/queries");
|
|
15
|
+
class StorefontService extends serviceSDK_1.Service {
|
|
16
16
|
constructor(endpoint, orgId, storeId) {
|
|
17
17
|
super(endpoint, orgId, storeId);
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
getRevenueStatisticByGroupOrCategory(dataQuery, groupBy) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const query = queries_1.
|
|
21
|
+
const query = queries_1.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY;
|
|
22
22
|
const variables = {
|
|
23
|
-
|
|
23
|
+
input: dataQuery,
|
|
24
|
+
groupBy,
|
|
24
25
|
};
|
|
25
26
|
try {
|
|
26
|
-
const response = yield this.
|
|
27
|
-
return response.
|
|
27
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
28
|
+
return response.getRevenueStatisticByGroupOrCategory;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
getRevenueStatisticByProduct(dataQuery) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const query = queries_1.GET_REVENUE_STATISTIC_BY_PRODUCT;
|
|
38
|
+
const variables = {
|
|
39
|
+
input: dataQuery,
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
43
|
+
return response.getRevenueStatisticByProduct;
|
|
28
44
|
}
|
|
29
45
|
catch (error) {
|
|
30
46
|
throw error;
|
|
@@ -32,4 +48,4 @@ class CloudServiceService extends serviceSDK_1.Service {
|
|
|
32
48
|
});
|
|
33
49
|
}
|
|
34
50
|
}
|
|
35
|
-
exports.
|
|
51
|
+
exports.StorefontService = StorefontService;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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
|
-
`;
|