@longvansoftware/storefront-js-client 2.2.1 → 2.2.3

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.
@@ -19,6 +19,7 @@ export declare const environmentEndpoints: {
19
19
  upload: string;
20
20
  getImage: string;
21
21
  accounting: string;
22
+ omnigateway: string;
22
23
  };
23
24
  live: {
24
25
  product: string;
@@ -40,5 +41,6 @@ export declare const environmentEndpoints: {
40
41
  upload: string;
41
42
  getImage: string;
42
43
  accounting: string;
44
+ omnigateway: string;
43
45
  };
44
46
  };
@@ -22,6 +22,7 @@ exports.environmentEndpoints = {
22
22
  upload: "https://fileservice.dev.longvan.vn/omnichannel/files/upload",
23
23
  getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
24
24
  accounting: "https://api-gateway.dev.longvan.vn/accounting-service",
25
+ omnigateway: "https://omni-gateway.dev.longvan.vn/omni-gateway/v1",
25
26
  },
26
27
  live: {
27
28
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -43,5 +44,6 @@ exports.environmentEndpoints = {
43
44
  upload: "https://fileservice.dev.longvan.vn/omnichannel/files/upload",
44
45
  getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
45
46
  accounting: "https://api-gateway.dev.longvan.vn/accounting-service",
47
+ omnigateway: "https://omni-gateway.longvan.vn/omni-gateway/v1",
46
48
  },
47
49
  };
@@ -75,6 +75,7 @@ exports.SEARCH_CUSTOMER = (0, graphql_tag_1.gql) `
75
75
  $partnerId: String!
76
76
  $currentPage: Int!
77
77
  $pageSize: Int!
78
+ $followSocialAppId: String
78
79
  ) {
79
80
  searchCustomers(
80
81
  keyword: $keyword
@@ -85,6 +86,7 @@ exports.SEARCH_CUSTOMER = (0, graphql_tag_1.gql) `
85
86
  partnerId: $partnerId
86
87
  currentPage: $currentPage
87
88
  pageSize: $pageSize
89
+ followSocialAppId: $followSocialAppId
88
90
  ) {
89
91
  totalPages
90
92
  totalElements
@@ -17,6 +17,7 @@ import { PortalService } from "./portal";
17
17
  import { UploadService } from "./upload";
18
18
  import { GetImageService } from "./getImage";
19
19
  import { AccountingService } from "./accounting";
20
+ import { OmnigatewayService } from './omnigateway';
20
21
  export interface Endpoints {
21
22
  product: string;
22
23
  crm: string;
@@ -37,6 +38,7 @@ export interface Endpoints {
37
38
  upload: string;
38
39
  getImage: string;
39
40
  accounting: string;
41
+ omnigateway: string;
40
42
  }
41
43
  export declare class SDK {
42
44
  orgId: string;
@@ -61,6 +63,7 @@ export declare class SDK {
61
63
  upload: UploadService;
62
64
  getImage: GetImageService;
63
65
  accounting: AccountingService;
66
+ omnigateway: OmnigatewayService;
64
67
  token: string | null;
65
68
  constructor(orgId: string, storeId: string, environment: "dev" | "live");
66
69
  setToken(token: string): void;
@@ -22,6 +22,7 @@ const portal_1 = require("./portal");
22
22
  const upload_1 = require("./upload");
23
23
  const getImage_1 = require("./getImage");
24
24
  const accounting_1 = require("./accounting");
25
+ const omnigateway_1 = require("./omnigateway");
25
26
  class SDK {
26
27
  constructor(orgId, storeId, environment) {
27
28
  this.orgId = orgId;
@@ -48,6 +49,7 @@ class SDK {
48
49
  this.upload = new upload_1.UploadService(endpoints.upload, orgId, storeId);
49
50
  this.getImage = new getImage_1.GetImageService(endpoints.getImage, orgId, storeId);
50
51
  this.accounting = new accounting_1.AccountingService(endpoints.accounting, orgId, storeId);
52
+ this.omnigateway = new omnigateway_1.OmnigatewayService(endpoints.omnigateway, orgId, storeId);
51
53
  // Initialize other services here
52
54
  }
53
55
  setToken(token) {
@@ -73,6 +75,7 @@ class SDK {
73
75
  // this.shareZalo.setToken(token)
74
76
  // Set token for other services here
75
77
  this.accounting.setToken(token);
78
+ this.omnigateway.setToken(token);
76
79
  }
77
80
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
78
81
  // src/service.ts
@@ -95,6 +98,7 @@ class SDK {
95
98
  this.upload.setStoreId(storeId);
96
99
  this.getImage.setStoreId(storeId);
97
100
  this.accounting.setStoreId(storeId);
101
+ this.omnigateway.setStoreId(storeId);
98
102
  // Set storeId for other services here
99
103
  }
100
104
  setOrgId(orgId) {
@@ -116,6 +120,7 @@ class SDK {
116
120
  this.upload.setOrgId(orgId);
117
121
  this.getImage.setOrgId(orgId);
118
122
  this.accounting.setOrgId(orgId);
123
+ this.omnigateway.setOrgId(orgId);
119
124
  }
120
125
  }
121
126
  exports.SDK = SDK;
@@ -1,6 +1,6 @@
1
1
  import { Service } from "../serviceSDK";
2
2
  export declare class ComhubService extends Service {
3
3
  constructor(endpoint: string, orgId: string, storeId: string);
4
- shareOrder(dataRequet: any, OAId: string): Promise<any>;
4
+ shareOrder(dataRequet: any, OAId: string, templateId: string): Promise<any>;
5
5
  sendMessage(OAId: string, content: string, contentType: string, senderPartyId: string, receivePartyIds: [string]): Promise<any>;
6
6
  }
@@ -15,9 +15,9 @@ class ComhubService extends serviceSDK_1.Service {
15
15
  constructor(endpoint, orgId, storeId) {
16
16
  super(endpoint, orgId, storeId);
17
17
  }
18
- shareOrder(dataRequet, OAId) {
18
+ shareOrder(dataRequet, OAId, templateId) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
- const endpoint = `/web-hook/message/send/social/app/${OAId}/template/370402`;
20
+ const endpoint = `/web-hook/message/send/social/app/${OAId}/template/${templateId}`;
21
21
  const method = "POST";
22
22
  try {
23
23
  const response = yield this.restApiCallWithNoHeader(endpoint, method, dataRequet);
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class OmnigatewayService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ requestJoinRoom(topicId: string, listUser: [string]): Promise<any>;
5
+ }
@@ -0,0 +1,32 @@
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.OmnigatewayService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class OmnigatewayService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ requestJoinRoom(topicId, listUser) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = `/topics/${topicId}/join`;
21
+ const method = "POST";
22
+ try {
23
+ const response = yield this.restApiCallWithNoHeader(endpoint, method, listUser);
24
+ return response;
25
+ }
26
+ catch (error) {
27
+ throw error;
28
+ }
29
+ });
30
+ }
31
+ }
32
+ exports.OmnigatewayService = OmnigatewayService;
@@ -181,6 +181,7 @@ class UserService extends serviceSDK_1.Service {
181
181
  partnerId: this.orgId,
182
182
  currentPage: searchParams.currentPage,
183
183
  pageSize: searchParams.pageSize,
184
+ followSocialAppId: searchParams === null || searchParams === void 0 ? void 0 : searchParams.followSocialAppId,
184
185
  };
185
186
  try {
186
187
  const response = yield this.graphqlQuery(query, variables);
@@ -72,6 +72,7 @@ export interface customerQuery {
72
72
  memberLevel?: string;
73
73
  currentPage?: number | 1;
74
74
  pageSize: number | 20;
75
+ followSocialAppId?: string;
75
76
  }
76
77
  export interface employeesQuery {
77
78
  keyword: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [