@longvansoftware/storefront-js-client 2.1.1 → 2.1.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.
@@ -1,5 +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): Promise<any>;
5
+ sendMessage(OAId: string, content: string, contentType: string, senderId: string, receiveContactIds: [string]): Promise<any>;
5
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) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
- const endpoint = `/web-hook/zalo/zns/${oAId}`;
20
+ const endpoint = `/web-hook/zalo/zns/${OAId}`;
21
21
  const method = "POST";
22
22
  try {
23
23
  const response = yield this.restApiCallWithNoHeader(endpoint, method, dataRequet);
@@ -28,5 +28,24 @@ class ComhubService extends serviceSDK_1.Service {
28
28
  }
29
29
  });
30
30
  }
31
+ sendMessage(OAId, content, contentType, senderId, receiveContactIds) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const endpoint = `/web-hook/message/send/social/app/${OAId}`;
34
+ const method = "POST";
35
+ const dataRequet = {
36
+ content,
37
+ contentType,
38
+ senderId,
39
+ receiveContactIds,
40
+ };
41
+ try {
42
+ const response = yield this.restApiCallWithNoHeader(endpoint, method, dataRequet);
43
+ return response;
44
+ }
45
+ catch (error) {
46
+ throw error;
47
+ }
48
+ });
49
+ }
31
50
  }
32
51
  exports.ComhubService = ComhubService;
@@ -47,7 +47,7 @@ class PortalService extends serviceSDK_1.Service {
47
47
  //Create- tag
48
48
  createTag(title, createBy, partnerId) {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
- const endpoint = `/tag-api/public/tag-core/tag/create?title=${title}&createBy=${createBy}&partnerId=${partnerId}`;
50
+ const endpoint = `/tag-api/public/tag-core/tag/create?title=${title}&createBy=${createBy}&partnerId=${this.orgId}`;
51
51
  const method = "POST";
52
52
  try {
53
53
  const response = yield this.restApiCallWithNoHeader(endpoint, method);
@@ -61,7 +61,7 @@ class PortalService extends serviceSDK_1.Service {
61
61
  // search tag
62
62
  searchTag(partnerId, title, id, search) {
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
- const endpoint = `/tag-api/public/tag-core/tag/get?partnerId=${partnerId}&title=${title}&id=${id}&search=${search}`;
64
+ const endpoint = `/tag-api/public/tag-core/tag/get?partnerId=${this.orgId}&title=${title}&id=${id}&search=${search}`;
65
65
  const method = "GET";
66
66
  try {
67
67
  const response = yield this.restApiCallWithNoHeader(endpoint, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [