@longvansoftware/storefront-js-client 1.8.1 → 1.8.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.
@@ -14,6 +14,7 @@ export declare const environmentEndpoints: {
14
14
  paymentV2: string;
15
15
  warehouseV2: string;
16
16
  deepLinkVietQr: string;
17
+ shareZalo: string;
17
18
  };
18
19
  live: {
19
20
  product: string;
@@ -30,5 +31,6 @@ export declare const environmentEndpoints: {
30
31
  paymentV2: string;
31
32
  warehouseV2: string;
32
33
  deepLinkVietQr: string;
34
+ shareZalo: string;
33
35
  };
34
36
  };
@@ -17,6 +17,7 @@ exports.environmentEndpoints = {
17
17
  paymentV2: "https://payment.dev.longvan.vn/graphql",
18
18
  warehouseV2: "https://portal.dev.longvan.vn/facility-api",
19
19
  deepLinkVietQr: "https://api.vietqr.io/v2",
20
+ shareZalo: "https://com-hub.longvan.vn/com-hub/v1/web-hook/zalo/zns/62661ed100adf430d79fb9e5"
20
21
  },
21
22
  live: {
22
23
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -33,5 +34,6 @@ exports.environmentEndpoints = {
33
34
  paymentV2: "https://payment-staging.longvan.vn/graphql",
34
35
  warehouseV2: "https://portal.longvan.vn/facility-api/public-facility/1.0.0/product-inventory",
35
36
  deepLinkVietQr: "https://api.vietqr.io/v2",
37
+ shareZalo: "https://com-hub.longvan.vn/com-hub/v1/web-hook/zalo/zns/62661ed100adf430d79fb9e5"
36
38
  },
37
39
  };
@@ -293,6 +293,7 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
293
293
  $pageNumber: Int!
294
294
  $pageSize: Int!
295
295
  $sorts: [BaseSort]
296
+ $attributes: JSON
296
297
  ) {
297
298
  getWorkEfforts(
298
299
  partnerId: $partnerId
@@ -302,6 +303,7 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
302
303
  pageNumber: $pageNumber
303
304
  pageSize: $pageSize
304
305
  sorts: $sorts
306
+ attributes: $attributes
305
307
  ) {
306
308
  total
307
309
  data {
@@ -12,6 +12,7 @@ import { ImageService } from "./image";
12
12
  import { PaymentServiceV2 } from "./paymentV2";
13
13
  import { WarehouseServiceV2 } from "./warehouseV2";
14
14
  import { DeepLinkVietQrService } from "./deepLinkVietQr";
15
+ import { ShareZaloService } from "./shareZalo";
15
16
  export interface Endpoints {
16
17
  product: string;
17
18
  crm: string;
@@ -27,6 +28,7 @@ export interface Endpoints {
27
28
  paymentV2: string;
28
29
  warehouseV2: string;
29
30
  deepLinkVietQr: string;
31
+ shareZalo: string;
30
32
  }
31
33
  export declare class SDK {
32
34
  orgId: string;
@@ -46,6 +48,7 @@ export declare class SDK {
46
48
  paymentV2: PaymentServiceV2;
47
49
  warehouseV2: WarehouseServiceV2;
48
50
  deepLinkVietQr: DeepLinkVietQrService;
51
+ shareZalo: ShareZaloService;
49
52
  token: string | null;
50
53
  constructor(orgId: string, storeId: string, environment: "dev" | "live");
51
54
  setToken(token: string): void;
@@ -17,6 +17,7 @@ const image_1 = require("./image");
17
17
  const paymentV2_1 = require("./paymentV2");
18
18
  const warehouseV2_1 = require("./warehouseV2");
19
19
  const deepLinkVietQr_1 = require("./deepLinkVietQr");
20
+ const shareZalo_1 = require("./shareZalo");
20
21
  class SDK {
21
22
  constructor(orgId, storeId, environment) {
22
23
  this.orgId = orgId;
@@ -38,6 +39,7 @@ class SDK {
38
39
  this.paymentV2 = new paymentV2_1.PaymentServiceV2(endpoints.paymentV2, orgId, storeId);
39
40
  this.warehouseV2 = new warehouseV2_1.WarehouseServiceV2(endpoints.warehouseV2, orgId, storeId);
40
41
  this.deepLinkVietQr = new deepLinkVietQr_1.DeepLinkVietQrService(endpoints.deepLinkVietQr, orgId, storeId);
42
+ this.shareZalo = new shareZalo_1.ShareZaloService(endpoints.shareZalo, orgId, storeId);
41
43
  // Initialize other services here
42
44
  }
43
45
  setToken(token) {
@@ -57,6 +59,7 @@ class SDK {
57
59
  this.warehouseV2.setToken(token);
58
60
  this.deepLinkVietQr.setToken(token);
59
61
  this.campaign.setToken(token);
62
+ this.shareZalo.setToken(token);
60
63
  // Set token for other services here
61
64
  }
62
65
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
@@ -19,7 +19,7 @@ export declare class CrmService extends Service {
19
19
  getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
20
20
  addComment(params: any): Promise<any>;
21
21
  createWorkEffort(createdBy: string, name: String, decription: string, workEffortTypeId: string, source: string, attributes: object, addAttachmentRequest: AddAttachmentRequest): Promise<any>;
22
- getWorkEfforts(performerId: string, workEffortTypeId: string, source: string, pageNumber: number, pageSize: number, sorts: BaseSort): Promise<any>;
22
+ getWorkEfforts(performerId: string, workEffortTypeId: string, source: string, pageNumber: number, pageSize: number, sorts: BaseSort, attributes: object): Promise<any>;
23
23
  getWorkEffortById(id: string): Promise<any>;
24
24
  updateWorkEffortProcessStatus(workEffortId: string, processStatus: string, performerId: string): Promise<any>;
25
25
  }
@@ -314,7 +314,7 @@ class CrmService extends serviceSDK_1.Service {
314
314
  }
315
315
  });
316
316
  }
317
- getWorkEfforts(performerId, workEffortTypeId, source, pageNumber, pageSize, sorts) {
317
+ getWorkEfforts(performerId, workEffortTypeId, source, pageNumber, pageSize, sorts, attributes) {
318
318
  return __awaiter(this, void 0, void 0, function* () {
319
319
  const query = queries_1.GET_WORK_EFFORTS;
320
320
  const variables = {
@@ -325,6 +325,7 @@ class CrmService extends serviceSDK_1.Service {
325
325
  pageNumber,
326
326
  pageSize,
327
327
  sorts,
328
+ attributes
328
329
  };
329
330
  try {
330
331
  const response = yield this.graphqlQueryV2(query, variables);
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class ShareZaloService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ shareOrder(dataRequet: any): 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.ShareZaloService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class ShareZaloService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ shareOrder(dataRequet) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = ``;
21
+ const method = "POST";
22
+ try {
23
+ const response = yield this.restApiCallWithNoToken(endpoint, method, dataRequet);
24
+ return response;
25
+ }
26
+ catch (error) {
27
+ throw error;
28
+ }
29
+ });
30
+ }
31
+ }
32
+ exports.ShareZaloService = ShareZaloService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [