@longvansoftware/storefront-js-client 2.0.7 → 2.0.9

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.
@@ -16,6 +16,8 @@ export declare const environmentEndpoints: {
16
16
  deepLinkVietQr: string;
17
17
  comhub: string;
18
18
  portal: string;
19
+ upload: string;
20
+ getImage: string;
19
21
  };
20
22
  live: {
21
23
  product: string;
@@ -34,5 +36,7 @@ export declare const environmentEndpoints: {
34
36
  deepLinkVietQr: string;
35
37
  comhub: string;
36
38
  portal: string;
39
+ upload: string;
40
+ getImage: string;
37
41
  };
38
42
  };
@@ -19,6 +19,8 @@ exports.environmentEndpoints = {
19
19
  deepLinkVietQr: "https://api.vietqr.io/v2",
20
20
  comhub: "https://com-hub.longvan.vn/com-hub/v1",
21
21
  portal: " https://portal.dev.longvan.vn",
22
+ upload: "https://fileservice.dev.longvan.vn/omnichannel/files/upload",
23
+ getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
22
24
  },
23
25
  live: {
24
26
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -37,5 +39,7 @@ exports.environmentEndpoints = {
37
39
  deepLinkVietQr: "https://api.vietqr.io/v2",
38
40
  comhub: "https://com-hub.longvan.vn/com-hub/v1",
39
41
  portal: " https://portal.longvan.vn",
42
+ upload: "https://fileservice.dev.longvan.vn/omnichannel/files/upload",
43
+ getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
40
44
  },
41
45
  };
@@ -406,6 +406,7 @@ exports.CREATE_WORK_EFFORT = (0, graphql_tag_1.gql) `
406
406
  $source: String!
407
407
  $attributes: JSON
408
408
  $addAttachmentRequest: [AddAttachmentRequest]
409
+ $parentId: String!
409
410
  ) {
410
411
  createWorkEffort(
411
412
  partnerId: $partnerId
@@ -416,6 +417,7 @@ exports.CREATE_WORK_EFFORT = (0, graphql_tag_1.gql) `
416
417
  source: $source
417
418
  attributes: $attributes
418
419
  addAttachmentRequest: $addAttachmentRequest
420
+ parentId: $parentId
419
421
  ) {
420
422
  id
421
423
  createdStamp
@@ -780,19 +782,17 @@ exports.UPDATE_CONNECTOR_DESCRIPTION = (0, graphql_tag_1.gql) `
780
782
  }
781
783
  `;
782
784
  exports.REMOVE_TAG = (0, graphql_tag_1.gql) `
783
- mutation RemoveTag($connectorId: String!, $tagId: String!, $removedBy: String!) {
785
+ mutation RemoveTag(
786
+ $connectorId: String!
787
+ $tagId: String!
788
+ $removedBy: String!
789
+ ) {
784
790
  removeTag(connectorId: $connectorId, tagId: $tagId, removedBy: $removedBy)
785
791
  }
786
792
  `;
787
793
  exports.CLOSE_TOPIC = (0, graphql_tag_1.gql) `
788
- mutation CloseTopic(
789
- $id: String!
790
- $updatedBy: String
791
- ) {
792
- closeTopic(
793
- id: $id
794
- updatedBy: $updatedBy
795
- ) {
794
+ mutation CloseTopic($id: String!, $updatedBy: String) {
795
+ closeTopic(id: $id, updatedBy: $updatedBy) {
796
796
  id
797
797
  status
798
798
  name
@@ -10,3 +10,4 @@ export declare const GET_WORK_EFFORT_BY_ID: import("graphql").DocumentNode;
10
10
  export declare const GET_CONNECTOR_BY_RESOURCE: import("graphql").DocumentNode;
11
11
  export declare const GET_TAG: import("graphql").DocumentNode;
12
12
  export declare const SEARCH_TOPIC: import("graphql").DocumentNode;
13
+ export declare const GET_MY_WORK_EFFORT_TODAY: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEARCH_TOPIC = exports.GET_TAG = exports.GET_CONNECTOR_BY_RESOURCE = exports.GET_WORK_EFFORT_BY_ID = exports.GET_WORK_EFFORTS = exports.GET_LIST_COMMENT = exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = exports.GET_TICKET_BY_ID = exports.GET_LIST_TICKET = exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = exports.GET_LIST_OPPORTUNITY_QUERY = void 0;
3
+ exports.GET_MY_WORK_EFFORT_TODAY = exports.SEARCH_TOPIC = exports.GET_TAG = exports.GET_CONNECTOR_BY_RESOURCE = exports.GET_WORK_EFFORT_BY_ID = exports.GET_WORK_EFFORTS = exports.GET_LIST_COMMENT = exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = exports.GET_TICKET_BY_ID = exports.GET_LIST_TICKET = exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = exports.GET_LIST_OPPORTUNITY_QUERY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_LIST_OPPORTUNITY_QUERY = (0, graphql_tag_1.gql) `
6
6
  query GetListOpportunity(
@@ -594,3 +594,54 @@ exports.SEARCH_TOPIC = (0, graphql_tag_1.gql) `
594
594
  }
595
595
  }
596
596
  `;
597
+ exports.GET_MY_WORK_EFFORT_TODAY = (0, graphql_tag_1.gql) `
598
+ query GetMyWorkEffortToday(
599
+ $partnerId: String!
600
+ $performerId: String!
601
+ $source: String!
602
+ ) {
603
+ getMyWorkEffortToDay(
604
+ partnerId: $partnerId
605
+ performerId: $performerId
606
+ source: $source
607
+ ) {
608
+ id
609
+ createdStamp
610
+ updatedStamp
611
+ createdBy
612
+ updatedBy
613
+ name
614
+ partyId
615
+ targetId
616
+ targetType
617
+ targetUrl
618
+ description
619
+ status
620
+ parentId
621
+ workEffortTypeId
622
+ stmId
623
+ workflowId
624
+ endDateExpect
625
+ endDateActual
626
+ startDateActual
627
+ startDateExpect
628
+ source
629
+ priorityName
630
+ priorityValue
631
+ connectorId
632
+ mode
633
+ partyGroupIds
634
+ tagIds
635
+ processResult
636
+ processStatus
637
+ owner {
638
+ id
639
+ fullName
640
+ name
641
+ type
642
+ phone
643
+ email
644
+ }
645
+ }
646
+ }
647
+ `;
@@ -14,6 +14,8 @@ import { WarehouseServiceV2 } from "./warehouseV2";
14
14
  import { DeepLinkVietQrService } from "./deepLinkVietQr";
15
15
  import { ComhubService } from "./comhub";
16
16
  import { PortalService } from "./portal";
17
+ import { UploadService } from "./upload";
18
+ import { GetImageService } from "./getImage";
17
19
  export interface Endpoints {
18
20
  product: string;
19
21
  crm: string;
@@ -31,6 +33,8 @@ export interface Endpoints {
31
33
  deepLinkVietQr: string;
32
34
  comhub: string;
33
35
  portal: string;
36
+ upload: string;
37
+ getImage: string;
34
38
  }
35
39
  export declare class SDK {
36
40
  orgId: string;
@@ -52,6 +56,8 @@ export declare class SDK {
52
56
  deepLinkVietQr: DeepLinkVietQrService;
53
57
  comhub: ComhubService;
54
58
  portal: PortalService;
59
+ upload: UploadService;
60
+ getImage: GetImageService;
55
61
  token: string | null;
56
62
  constructor(orgId: string, storeId: string, environment: "dev" | "live");
57
63
  setToken(token: string): void;
@@ -19,6 +19,8 @@ const warehouseV2_1 = require("./warehouseV2");
19
19
  const deepLinkVietQr_1 = require("./deepLinkVietQr");
20
20
  const comhub_1 = require("./comhub");
21
21
  const portal_1 = require("./portal");
22
+ const upload_1 = require("./upload");
23
+ const getImage_1 = require("./getImage");
22
24
  class SDK {
23
25
  constructor(orgId, storeId, environment) {
24
26
  this.orgId = orgId;
@@ -42,6 +44,8 @@ class SDK {
42
44
  this.deepLinkVietQr = new deepLinkVietQr_1.DeepLinkVietQrService(endpoints.deepLinkVietQr, orgId, storeId);
43
45
  this.comhub = new comhub_1.ComhubService(endpoints.comhub, orgId, storeId);
44
46
  this.portal = new portal_1.PortalService(endpoints.portal, orgId, storeId);
47
+ this.upload = new upload_1.UploadService(endpoints.upload, orgId, storeId);
48
+ this.getImage = new getImage_1.GetImageService(endpoints.getImage, orgId, storeId);
45
49
  // Initialize other services here
46
50
  }
47
51
  setToken(token) {
@@ -62,6 +66,8 @@ class SDK {
62
66
  this.deepLinkVietQr.setToken(token);
63
67
  this.campaign.setToken(token);
64
68
  this.portal.setToken(token);
69
+ this.upload.setToken(token);
70
+ this.getImage.setToken(token);
65
71
  // this.shareZalo.setToken(token)
66
72
  // Set token for other services here
67
73
  }
@@ -83,6 +89,8 @@ class SDK {
83
89
  this.deepLinkVietQr.setStoreId(storeId);
84
90
  this.campaign.setStoreId(storeId);
85
91
  this.portal.setStoreId(storeId);
92
+ this.upload.setStoreId(storeId);
93
+ this.getImage.setStoreId(storeId);
86
94
  // Set storeId for other services here
87
95
  }
88
96
  setOrgId(orgId) {
@@ -101,6 +109,8 @@ class SDK {
101
109
  this.deepLinkVietQr.setOrgId(orgId);
102
110
  this.campaign.setOrgId(orgId);
103
111
  this.portal.setOrgId(orgId);
112
+ this.upload.setOrgId(orgId);
113
+ this.getImage.setOrgId(orgId);
104
114
  }
105
115
  }
106
116
  exports.SDK = SDK;
@@ -18,7 +18,7 @@ export declare class CrmService extends Service {
18
18
  getAttachmentByWorkEffortId(workEffortIds: [string]): Promise<any>;
19
19
  getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
20
20
  addComment(params: any): Promise<any>;
21
- createWorkEffort(createdBy: string, name: String, decription: string, workEffortTypeId: string, source: string, attributes: object, addAttachmentRequest: AddAttachmentRequest): Promise<any>;
21
+ createWorkEffort(createdBy: string, name: String, decription: string, workEffortTypeId: string, source: string, attributes: object, addAttachmentRequest: AddAttachmentRequest, parentId: string): Promise<any>;
22
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>;
@@ -31,4 +31,5 @@ export declare class CrmService extends Service {
31
31
  searchTopic(accountTableId: string, pageSize: number, currentPage: number): Promise<any>;
32
32
  closeTopic(id: string, updatedBy: string): Promise<any>;
33
33
  getTopicByCustomerId(filterTopicRequest: any, pageSize: number, currentPage: number): Promise<any>;
34
+ getMyWorkEffortToday(performerId: string, source: string): Promise<any>;
34
35
  }
@@ -292,7 +292,7 @@ class CrmService extends serviceSDK_1.Service {
292
292
  }
293
293
  });
294
294
  }
295
- createWorkEffort(createdBy, name, decription, workEffortTypeId, source, attributes, addAttachmentRequest) {
295
+ createWorkEffort(createdBy, name, decription, workEffortTypeId, source, attributes, addAttachmentRequest, parentId) {
296
296
  return __awaiter(this, void 0, void 0, function* () {
297
297
  const query = mutations_1.CREATE_WORK_EFFORT;
298
298
  const variables = {
@@ -304,6 +304,7 @@ class CrmService extends serviceSDK_1.Service {
304
304
  source,
305
305
  attributes,
306
306
  addAttachmentRequest,
307
+ parentId,
307
308
  };
308
309
  try {
309
310
  const response = yield this.graphqlMutationV2(query, variables);
@@ -508,7 +509,7 @@ class CrmService extends serviceSDK_1.Service {
508
509
  }
509
510
  getTopicByCustomerId(filterTopicRequest, pageSize, currentPage) {
510
511
  return __awaiter(this, void 0, void 0, function* () {
511
- const query = queries_1.SEARCH_TOPIC;
512
+ const mutation = queries_1.SEARCH_TOPIC;
512
513
  const variables = {
513
514
  filterTopicRequest,
514
515
  partnerId: this.orgId,
@@ -516,7 +517,7 @@ class CrmService extends serviceSDK_1.Service {
516
517
  currentPage,
517
518
  };
518
519
  try {
519
- const response = yield this.graphqlMutationV2(query, variables);
520
+ const response = yield this.graphqlMutationV2(mutation, variables);
520
521
  return response.searchTopic;
521
522
  }
522
523
  catch (error) {
@@ -524,5 +525,22 @@ class CrmService extends serviceSDK_1.Service {
524
525
  }
525
526
  });
526
527
  }
528
+ getMyWorkEffortToday(performerId, source) {
529
+ return __awaiter(this, void 0, void 0, function* () {
530
+ const query = queries_1.GET_MY_WORK_EFFORT_TODAY;
531
+ const variables = {
532
+ partnerId: this.orgId,
533
+ performerId,
534
+ source,
535
+ };
536
+ try {
537
+ const response = yield this.graphqlQuery(query, variables);
538
+ return response.getMyWorkEffortToDay;
539
+ }
540
+ catch (error) {
541
+ throw error;
542
+ }
543
+ });
544
+ }
527
545
  }
528
546
  exports.CrmService = CrmService;
@@ -0,0 +1,4 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class GetImageService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetImageService = void 0;
4
+ const serviceSDK_1 = require("../serviceSDK");
5
+ class GetImageService extends serviceSDK_1.Service {
6
+ constructor(endpoint, orgId, storeId) {
7
+ super(endpoint, orgId, storeId);
8
+ }
9
+ }
10
+ exports.GetImageService = GetImageService;
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class UploadService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ uploadImage(imageCode: string): Promise<any>;
5
+ }
@@ -0,0 +1,35 @@
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.UploadService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class UploadService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ uploadImage(imageCode) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = "";
21
+ const method = "POST";
22
+ try {
23
+ const formData = new FormData();
24
+ formData.append("uploadFile", imageCode);
25
+ formData.append("path", "public");
26
+ const response = yield this.restApiCallWithNoHeader(endpoint, method, formData);
27
+ return response;
28
+ }
29
+ catch (error) {
30
+ throw error;
31
+ }
32
+ });
33
+ }
34
+ }
35
+ exports.UploadService = UploadService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [