@longvansoftware/storefront-js-client 4.8.0 → 4.8.1

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.
@@ -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
  };
@@ -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
  };
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,2 @@
1
+ export declare const GET_REVENUE_STATISTIC_BY_PRODUCT: import("graphql").DocumentNode;
2
+ export declare const GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY: import("graphql").DocumentNode;
@@ -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
+ `;
@@ -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;
@@ -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
+ }
@@ -0,0 +1,51 @@
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.StorefontService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ const queries_1 = require("../../graphql/storefont/queries");
15
+ class StorefontService extends serviceSDK_1.Service {
16
+ constructor(endpoint, orgId, storeId) {
17
+ super(endpoint, orgId, storeId);
18
+ }
19
+ getRevenueStatisticByGroupOrCategory(dataQuery, groupBy) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const query = queries_1.GET_REVENUE_STATISTIC_BY_GROUP_OR_CATEGORY;
22
+ const variables = {
23
+ input: dataQuery,
24
+ groupBy,
25
+ };
26
+ try {
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;
44
+ }
45
+ catch (error) {
46
+ throw error;
47
+ }
48
+ });
49
+ }
50
+ }
51
+ exports.StorefontService = StorefontService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [