@longvansoftware/service-js-client 1.16.6 → 1.16.7

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.
Files changed (100) hide show
  1. package/dist/src/graphql/campaign/mutations.d.ts +1 -0
  2. package/dist/src/graphql/campaign/mutations.js +34 -0
  3. package/dist/src/graphql/campaign/queries.d.ts +9 -0
  4. package/dist/src/graphql/campaign/queries.js +427 -0
  5. package/dist/src/graphql/cashbook/queries.d.ts +2 -0
  6. package/dist/src/graphql/cashbook/queries.js +99 -0
  7. package/dist/src/graphql/cloud/mutations.d.ts +23 -16
  8. package/dist/src/graphql/cloud/mutations.js +101 -1
  9. package/dist/src/graphql/cloud/queries.d.ts +1 -0
  10. package/dist/src/graphql/cloud/queries.js +26 -1
  11. package/dist/src/graphql/computing/mutations.d.ts +1 -0
  12. package/dist/src/graphql/computing/mutations.js +15 -1
  13. package/dist/src/graphql/crm/mutations.d.ts +3 -0
  14. package/dist/src/graphql/crm/mutations.js +54 -1
  15. package/dist/src/graphql/crm/queries.d.ts +17 -11
  16. package/dist/src/graphql/crm/queries.js +107 -1
  17. package/dist/src/graphql/crm_camping/queries.js +49 -19
  18. package/dist/src/graphql/fragments/product.d.ts +38 -0
  19. package/dist/src/graphql/fragments/product.js +196 -0
  20. package/dist/src/graphql/orderGraphQL/queries.d.ts +7 -5
  21. package/dist/src/graphql/orderGraphQL/queries.js +11 -1
  22. package/dist/src/graphql/paymentV2/mutations.d.ts +5 -0
  23. package/dist/src/graphql/paymentV2/mutations.js +120 -0
  24. package/dist/src/graphql/paymentV2/queries.d.ts +9 -0
  25. package/dist/src/graphql/paymentV2/queries.js +257 -0
  26. package/dist/src/graphql/product/queries.d.ts +2 -0
  27. package/dist/src/graphql/product/queries.js +41 -1
  28. package/dist/src/graphql/store/mutations.d.ts +1 -0
  29. package/dist/src/graphql/store/mutations.js +29 -0
  30. package/dist/src/graphql/store/queries.d.ts +1 -0
  31. package/dist/src/graphql/store/queries.js +29 -0
  32. package/dist/src/lib/accounting/index.d.ts +5 -0
  33. package/dist/src/lib/accounting/index.js +32 -0
  34. package/dist/src/lib/auth/index.d.ts +1 -1
  35. package/dist/src/lib/auth/index.js +3 -4
  36. package/dist/src/lib/campaign/index.d.ts +20 -0
  37. package/dist/src/lib/campaign/index.js +218 -0
  38. package/dist/src/lib/cashbook/index.d.ts +6 -0
  39. package/dist/src/lib/cashbook/index.js +56 -0
  40. package/dist/src/lib/cloud/index.d.ts +7 -0
  41. package/dist/src/lib/cloud/index.js +123 -0
  42. package/dist/src/lib/comhub/index.d.ts +6 -0
  43. package/dist/src/lib/comhub/index.js +50 -0
  44. package/dist/src/lib/computing/index.d.ts +1 -0
  45. package/dist/src/lib/computing/index.js +17 -0
  46. package/dist/src/lib/crm/index.d.ts +8 -0
  47. package/dist/src/lib/crm/index.js +141 -0
  48. package/dist/src/lib/crm_camping/index.d.ts +2 -2
  49. package/dist/src/lib/crm_camping/index.js +13 -8
  50. package/dist/src/lib/deepLinkVietQr/index.d.ts +7 -0
  51. package/dist/src/lib/deepLinkVietQr/index.js +58 -0
  52. package/dist/src/lib/fileService/index.d.ts +34 -0
  53. package/dist/src/lib/fileService/index.js +80 -0
  54. package/dist/src/lib/getImage/index.d.ts +4 -0
  55. package/dist/src/lib/getImage/index.js +10 -0
  56. package/dist/src/lib/image/index.d.ts +7 -0
  57. package/dist/src/lib/image/index.js +49 -0
  58. package/dist/src/lib/omnigateway/index.d.ts +7 -0
  59. package/dist/src/lib/omnigateway/index.js +58 -0
  60. package/dist/src/lib/orderGraphQL/index.d.ts +1 -0
  61. package/dist/src/lib/orderGraphQL/index.js +16 -0
  62. package/dist/src/lib/paymentV2/index.d.ts +18 -0
  63. package/dist/src/lib/paymentV2/index.js +245 -0
  64. package/dist/src/lib/portal/index.d.ts +23 -0
  65. package/dist/src/lib/portal/index.js +255 -0
  66. package/dist/src/lib/product/index.d.ts +2 -0
  67. package/dist/src/lib/product/index.js +34 -0
  68. package/dist/src/lib/resource_permission/index.d.ts +2 -2
  69. package/dist/src/lib/resource_permission/index.js +4 -4
  70. package/dist/src/lib/shareZalo/index.d.ts +5 -0
  71. package/dist/src/lib/shareZalo/index.js +32 -0
  72. package/dist/src/lib/store/index.d.ts +30 -0
  73. package/dist/src/lib/store/index.js +74 -0
  74. package/dist/src/lib/token/index.d.ts +5 -0
  75. package/dist/src/lib/token/index.js +32 -0
  76. package/dist/src/lib/upload/index.d.ts +5 -0
  77. package/dist/src/lib/upload/index.js +35 -0
  78. package/dist/src/lib/warehouseV2/index.d.ts +13 -0
  79. package/dist/src/lib/warehouseV2/index.js +54 -0
  80. package/dist/src/lib/zca/index.d.ts +12 -0
  81. package/dist/src/lib/zca/index.js +41 -0
  82. package/dist/src/types/campaign.d.ts +14 -0
  83. package/dist/src/types/campaign.js +2 -0
  84. package/dist/src/types/common.d.ts +264 -0
  85. package/dist/src/types/common.js +35 -0
  86. package/dist/src/types/invoice.d.ts +13 -0
  87. package/dist/src/types/invoice.js +2 -0
  88. package/dist/src/types/portal.d.ts +7 -0
  89. package/dist/src/types/portal.js +2 -0
  90. package/dist/src/types/store.d.ts +158 -0
  91. package/dist/src/types/store.js +3 -0
  92. package/dist/src/utils/errorHandler.d.ts +64 -0
  93. package/dist/src/utils/errorHandler.js +197 -0
  94. package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
  95. package/dist/src/utils/validatePhoneNumber.js +20 -0
  96. package/package.json +1 -1
  97. package/dist/src/lib/service.d.ts +0 -14
  98. package/dist/src/lib/service.js +0 -101
  99. package/dist/src/utils/build-field-string.d.ts +0 -1
  100. package/dist/src/utils/build-field-string.js +0 -16
@@ -61,4 +61,5 @@ export declare class ComputingService extends Service {
61
61
  updateCPU(computingId: string, socket: number, corePerSocket: number, updateBy: string): Promise<any>;
62
62
  updateRAM(computingId: string, size: number, unit: string, updateBy: string): Promise<any>;
63
63
  getComputingsDynamic(userId: string, fields: string[]): Promise<any>;
64
+ createComputingForEC(createComputingInputForEC: any, createBy: string): Promise<any>;
64
65
  }
@@ -906,5 +906,22 @@ class ComputingService extends serviceSDK_1.Service {
906
906
  }
907
907
  });
908
908
  }
909
+ createComputingForEC(createComputingInputForEC, createBy) {
910
+ return __awaiter(this, void 0, void 0, function* () {
911
+ const mutation = mutations_1.CREATE_COMPUTING_FOR_EC;
912
+ const variables = {
913
+ createComputingInputForEC,
914
+ createBy,
915
+ };
916
+ try {
917
+ const response = yield this.graphqlMutationV2(mutation, variables);
918
+ return response.createComputingForEC;
919
+ }
920
+ catch (error) {
921
+ console.log(`Error fetching get createComputingForEC method: ${error}`);
922
+ throw error;
923
+ }
924
+ });
925
+ }
909
926
  }
910
927
  exports.ComputingService = ComputingService;
@@ -14,8 +14,10 @@ export declare class CrmService extends Service {
14
14
  updateWorkEffortStatus(performerId: string, workEffortId: string, source: string, status: string): Promise<any>;
15
15
  addAttachmentForWorkEffort(performerId: string, workEffortId: string, attachments: [{}]): Promise<any>;
16
16
  getListTicket(performerId: string, getTicketRequest: getTicketRequest): Promise<any>;
17
+ getListTicketDynamic(performerId: string, getTicketRequest: getTicketRequest, fields: string[]): Promise<any>;
17
18
  addTicket(performerId: string, addTicketRequest: AddTicketRequest, addAttachmentRequest: [AddAttachmentRequest]): Promise<any>;
18
19
  getTicketById(ticketId: string): Promise<any>;
20
+ getTicketByIdDynamic(ticketId: string, fields: string[]): Promise<any>;
19
21
  getAttachmentByWorkEffortId(workEffortIds: [string]): Promise<any>;
20
22
  getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
21
23
  addComment(params: any): Promise<any>;
@@ -28,4 +30,10 @@ export declare class CrmService extends Service {
28
30
  cloneResume(resumeOriginalId: string, domain: string, createdBy: string): Promise<any>;
29
31
  linkingResumeDomainAndContact(resumeDomainId: string, resumeContactId: string, contactType: string, linkedBy: string): Promise<any>;
30
32
  getResumeDomainByServiceId(serviceId: string): Promise<any>;
33
+ getCollegesByProvinceId(provinceId: string | null): Promise<any>;
34
+ getRelatedResourceByResourceType(fromId: string, fromResourceType: string, toResourceType: string): Promise<any>;
35
+ addResourceRelated(fromId: string, fromResourceType: string, toIds: string[], toResourceType: string, createdBy: string): Promise<any>;
36
+ getResumeInfoByCustomerId(customerId: string): Promise<any>;
37
+ createResumeInfo(data: any): Promise<any>;
38
+ updateFieldResume(resumeId: string, fieldName: string, value: string, resourceType: string, updatedBy: string): Promise<any>;
31
39
  }
@@ -205,6 +205,24 @@ class CrmService extends serviceSDK_1.Service {
205
205
  }
206
206
  });
207
207
  }
208
+ getListTicketDynamic(performerId, getTicketRequest, fields) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ const query = (0, queries_1.GET_LIST_TICKET_DYNAMIC)(fields);
211
+ const variables = {
212
+ partyId: this.orgId,
213
+ performerId,
214
+ getTicketRequest,
215
+ };
216
+ try {
217
+ const response = yield this.graphqlQueryV2(query, variables);
218
+ return response.getListTicket;
219
+ }
220
+ catch (error) {
221
+ console.log(`Error fetching get getListTicketDynamic method: ${error}`);
222
+ throw error;
223
+ }
224
+ });
225
+ }
208
226
  addTicket(performerId, addTicketRequest, addAttachmentRequest) {
209
227
  return __awaiter(this, void 0, void 0, function* () {
210
228
  const mutation = mutations_1.ADD_TICKED;
@@ -240,6 +258,22 @@ class CrmService extends serviceSDK_1.Service {
240
258
  }
241
259
  });
242
260
  }
261
+ getTicketByIdDynamic(ticketId, fields) {
262
+ return __awaiter(this, void 0, void 0, function* () {
263
+ const query = (0, queries_1.GET_LIST_TICKET_BY_ID_DYNAMIC)(fields);
264
+ const variables = {
265
+ ticketId,
266
+ };
267
+ try {
268
+ const response = yield this.graphqlQueryV2(query, variables);
269
+ return response.getTicketById;
270
+ }
271
+ catch (error) {
272
+ console.log(`Error in getTicketByIdDynamic: ${error}`);
273
+ throw error;
274
+ }
275
+ });
276
+ }
243
277
  getAttachmentByWorkEffortId(workEffortIds) {
244
278
  return __awaiter(this, void 0, void 0, function* () {
245
279
  const query = queries_1.GET_ATTACHMENT_BY_WORK_EFFORT_ID;
@@ -457,5 +491,112 @@ class CrmService extends serviceSDK_1.Service {
457
491
  }
458
492
  });
459
493
  }
494
+ getCollegesByProvinceId(provinceId) {
495
+ return __awaiter(this, void 0, void 0, function* () {
496
+ const query = queries_1.GET_COLLEGES_BY_PROVINCE_ID;
497
+ const variables = {
498
+ provinceId,
499
+ };
500
+ try {
501
+ const response = yield this.graphqlQueryV2(query, variables);
502
+ return response.getCollegesByProvinceId;
503
+ }
504
+ catch (error) {
505
+ console.log(`Error in getCollegesByProvinceId: ${error}`);
506
+ throw error;
507
+ }
508
+ });
509
+ }
510
+ getRelatedResourceByResourceType(fromId, fromResourceType, toResourceType) {
511
+ return __awaiter(this, void 0, void 0, function* () {
512
+ const query = queries_1.GET_RELATED_RESOURCE_BY_RESOURCE_TYPE;
513
+ const variables = {
514
+ fromId,
515
+ fromResourceType,
516
+ toResourceType,
517
+ accessToken: this.token,
518
+ partnerId: this.orgId,
519
+ };
520
+ try {
521
+ const response = yield this.graphqlQueryV2(query, variables);
522
+ return response.getRelatedResourceByResourceType;
523
+ }
524
+ catch (error) {
525
+ console.log(`Error in getRelatedResourceByResourceType: ${error}`);
526
+ throw error;
527
+ }
528
+ });
529
+ }
530
+ addResourceRelated(fromId, fromResourceType, toIds, toResourceType, createdBy) {
531
+ return __awaiter(this, void 0, void 0, function* () {
532
+ const mutation = mutations_1.ADD_RESOURCE_RELATED;
533
+ const variables = {
534
+ fromId,
535
+ fromResourceType,
536
+ toIds,
537
+ toResourceType,
538
+ createdBy,
539
+ };
540
+ try {
541
+ const response = yield this.graphqlMutationV2(mutation, variables);
542
+ return response.addResourceRelated;
543
+ }
544
+ catch (error) {
545
+ console.log(`Error in addResourceRelated: ${error}`);
546
+ throw error;
547
+ }
548
+ });
549
+ }
550
+ getResumeInfoByCustomerId(customerId) {
551
+ return __awaiter(this, void 0, void 0, function* () {
552
+ const query = queries_1.GET_RESUME_INFO_BY_CUSTOMER_ID;
553
+ const variables = {
554
+ customerId,
555
+ orgId: this.orgId,
556
+ };
557
+ try {
558
+ const response = yield this.graphqlQueryV2(query, variables);
559
+ return response.getResumeInfoByCustomerId;
560
+ }
561
+ catch (error) {
562
+ console.log(`Error in getResumeInfoByCustomerId: ${error}`);
563
+ throw error;
564
+ }
565
+ });
566
+ }
567
+ createResumeInfo(data) {
568
+ return __awaiter(this, void 0, void 0, function* () {
569
+ const mutation = mutations_1.CREATE_RUSUME_INFO;
570
+ const variables = Object.assign(Object.assign({}, data), { orgId: this.orgId });
571
+ try {
572
+ const response = yield this.graphqlMutationV2(mutation, variables);
573
+ return response.createResumeInfo;
574
+ }
575
+ catch (error) {
576
+ console.log(`Error in createResumeInfo: ${error}`);
577
+ throw error;
578
+ }
579
+ });
580
+ }
581
+ updateFieldResume(resumeId, fieldName, value, resourceType, updatedBy) {
582
+ return __awaiter(this, void 0, void 0, function* () {
583
+ const mutation = mutations_1.UPDATE_FIELD_RESUME;
584
+ const variables = {
585
+ resumeId,
586
+ fieldName,
587
+ value,
588
+ resourceType,
589
+ updatedBy,
590
+ };
591
+ try {
592
+ const response = yield this.graphqlMutationV2(mutation, variables);
593
+ return response.updateFieldResume;
594
+ }
595
+ catch (error) {
596
+ console.log(`Error in updateFieldResume: ${error}`);
597
+ throw error;
598
+ }
599
+ });
600
+ }
460
601
  }
461
602
  exports.CrmService = CrmService;
@@ -6,11 +6,11 @@ export declare class CrmCampingService extends Service {
6
6
  searchProductQuantityPromotionAction(productId: string): Promise<any>;
7
7
  addCustomerToVoucher(userId: string, voucherCode: string): Promise<any>;
8
8
  getCampaignActionById(campaignActionId: string): Promise<any>;
9
- suggestVoucher(customerId: string, scope: string | null, isNewCustomer: boolean): Promise<any>;
9
+ suggestVoucher(customerId: string, scopeIgnore: string | null, scope: string | null, isNewCustomer: boolean): Promise<any>;
10
10
  searchVouchers(campaignId: String, campaignActionId: String, campaignActionType: String, customerId: String, pageNumber: number, pageSize: number): Promise<any>;
11
11
  getAverageRating(targetIds: [string], customerId: string, evaluationType: string): Promise<any>;
12
12
  getUrlEvaluation(targetIds: [string], customerId: string, evaluationType: string): Promise<any>;
13
13
  getNumberOfTicketEvaluation(customerId: string): Promise<any>;
14
- searchProductGiftPromotionResponse(productId: string): Promise<any>;
14
+ searchProductGiftPromotionResponse(parameterSearchProductGift: any): Promise<any>;
15
15
  addProductGiftPromotion(orderId: string, updatedBy: string, addData: any): Promise<any>;
16
16
  }
@@ -89,7 +89,7 @@ class CrmCampingService extends serviceSDK_1.Service {
89
89
  // throw error;
90
90
  // }
91
91
  // }
92
- suggestVoucher(customerId, scope, isNewCustomer) {
92
+ suggestVoucher(customerId, scopeIgnore, scope, isNewCustomer) {
93
93
  return __awaiter(this, void 0, void 0, function* () {
94
94
  const query = queries_1.SUGGEST_VOUCHER;
95
95
  const variables = {
@@ -97,7 +97,8 @@ class CrmCampingService extends serviceSDK_1.Service {
97
97
  excludeExpired: true,
98
98
  customerId,
99
99
  scope,
100
- isNewCustomer
100
+ isNewCustomer,
101
+ scopeIgnore,
101
102
  };
102
103
  try {
103
104
  const response = yield this.graphqlQueryV2(query, variables);
@@ -137,7 +138,7 @@ class CrmCampingService extends serviceSDK_1.Service {
137
138
  targetIds,
138
139
  customerId,
139
140
  evaluationType,
140
- orgId: this.orgId
141
+ orgId: this.orgId,
141
142
  };
142
143
  try {
143
144
  const response = yield this.graphqlQueryV2(query, variables);
@@ -156,7 +157,7 @@ class CrmCampingService extends serviceSDK_1.Service {
156
157
  targetIds,
157
158
  customerId,
158
159
  evaluationType,
159
- orgId: this.orgId
160
+ orgId: this.orgId,
160
161
  };
161
162
  try {
162
163
  const response = yield this.graphqlQueryV2(query, variables);
@@ -173,7 +174,7 @@ class CrmCampingService extends serviceSDK_1.Service {
173
174
  const query = queries_1.GET_NUMBER_OF_TICKET_EVALUATION;
174
175
  const variables = {
175
176
  customerId,
176
- orgId: this.orgId
177
+ orgId: this.orgId,
177
178
  };
178
179
  try {
179
180
  const response = yield this.graphqlQueryV2(query, variables);
@@ -185,13 +186,17 @@ class CrmCampingService extends serviceSDK_1.Service {
185
186
  }
186
187
  });
187
188
  }
188
- searchProductGiftPromotionResponse(productId) {
189
+ searchProductGiftPromotionResponse(parameterSearchProductGift) {
189
190
  return __awaiter(this, void 0, void 0, function* () {
191
+ // console.log("🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ parameterSearchProductGift:", parameterSearchProductGift)
190
192
  const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
191
193
  const variables = {
192
- partyId: this.orgId,
193
- productId
194
+ parameterSearchProductGift: Object.assign({ partyId: this.orgId }, parameterSearchProductGift),
194
195
  };
196
+ // console.log(
197
+ // "🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ variables:",
198
+ // variables
199
+ // );
195
200
  try {
196
201
  const response = yield this.graphqlQueryV2(query, variables);
197
202
  return response.searchProductGiftPromotionResponse;
@@ -0,0 +1,7 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class DeepLinkVietQrService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ getAndroidBank(): Promise<any>;
5
+ getIosBank(): Promise<any>;
6
+ getBank(): Promise<any>;
7
+ }
@@ -0,0 +1,58 @@
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.DeepLinkVietQrService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class DeepLinkVietQrService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ getAndroidBank() {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = `/android-app-deeplinks`;
21
+ const method = "GET";
22
+ try {
23
+ const response = yield this.restApiCallWithToken(endpoint, method);
24
+ return response;
25
+ }
26
+ catch (error) {
27
+ throw error;
28
+ }
29
+ });
30
+ }
31
+ getIosBank() {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const endpoint = `/ios-app-deeplinks`;
34
+ const method = "GET";
35
+ try {
36
+ const response = yield this.restApiCallWithToken(endpoint, method);
37
+ return response;
38
+ }
39
+ catch (error) {
40
+ throw error;
41
+ }
42
+ });
43
+ }
44
+ getBank() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const endpoint = `/banks`;
47
+ const method = "GET";
48
+ try {
49
+ const response = yield this.restApiCallWithToken(endpoint, method);
50
+ return response;
51
+ }
52
+ catch (error) {
53
+ throw error;
54
+ }
55
+ });
56
+ }
57
+ }
58
+ exports.DeepLinkVietQrService = DeepLinkVietQrService;
@@ -0,0 +1,34 @@
1
+ import { Service } from "../serviceSDK";
2
+ export interface UploadFileRequest {
3
+ uploadFile: File;
4
+ path: string;
5
+ parentId?: string;
6
+ parentType?: string;
7
+ }
8
+ export interface UploadFileResponse {
9
+ fileName: string;
10
+ filePath: string;
11
+ fileSize: number;
12
+ }
13
+ export declare class FileServiceSerVice extends Service {
14
+ constructor(endpoint: string, orgId: string, storeId: string);
15
+ /**
16
+ * Upload file to the file service
17
+ * @param uploadFile - File object to upload
18
+ * @param path - Directory path to save the file
19
+ * @param parentId - Reference ID of parent object (optional)
20
+ * @param parentType - Type of parent object reference (optional)
21
+ * @returns Promise<UploadFileResponse>
22
+ */
23
+ uploadFile(uploadFile: File, path: string, parentId?: string, parentType?: string): Promise<UploadFileResponse>;
24
+ /**
25
+ * Upload image file (convenience method)
26
+ * @param imageFile - Image file to upload
27
+ * @param path - Directory path to save the image (default: "public")
28
+ * @param parentId - Reference ID of parent object (optional)
29
+ * @param parentType - Type of parent object reference (optional)
30
+ * @returns Promise<UploadFileResponse>
31
+ */
32
+ uploadImage(imageFile: File, path?: string, parentId?: string, parentType?: string): Promise<UploadFileResponse>;
33
+ getImage(parentId: string, parenttype: string): Promise<any>;
34
+ }
@@ -0,0 +1,80 @@
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.FileServiceSerVice = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class FileServiceSerVice extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ /**
19
+ * Upload file to the file service
20
+ * @param uploadFile - File object to upload
21
+ * @param path - Directory path to save the file
22
+ * @param parentId - Reference ID of parent object (optional)
23
+ * @param parentType - Type of parent object reference (optional)
24
+ * @returns Promise<UploadFileResponse>
25
+ */
26
+ uploadFile(uploadFile, path, parentId, parentType) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ const endpoint = `/files/upload`;
29
+ const method = "POST";
30
+ try {
31
+ const formData = new FormData();
32
+ formData.append("uploadFile", uploadFile);
33
+ formData.append("path", path);
34
+ if (parentId) {
35
+ formData.append("parentId", parentId);
36
+ }
37
+ if (parentType) {
38
+ formData.append("parentType", parentType);
39
+ }
40
+ const response = yield this.restApiCallWithNoHeader(endpoint, method, formData);
41
+ return response;
42
+ }
43
+ catch (error) {
44
+ console.error("Error uploading file:", error);
45
+ throw error;
46
+ }
47
+ });
48
+ }
49
+ /**
50
+ * Upload image file (convenience method)
51
+ * @param imageFile - Image file to upload
52
+ * @param path - Directory path to save the image (default: "public")
53
+ * @param parentId - Reference ID of parent object (optional)
54
+ * @param parentType - Type of parent object reference (optional)
55
+ * @returns Promise<UploadFileResponse>
56
+ */
57
+ uploadImage(imageFile_1) {
58
+ return __awaiter(this, arguments, void 0, function* (imageFile, path = "public", parentId, parentType) {
59
+ // Validate that the file is an image
60
+ if (!imageFile.type.startsWith("image/")) {
61
+ throw new Error("File must be an image");
62
+ }
63
+ return this.uploadFile(imageFile, path, parentId, parentType);
64
+ });
65
+ }
66
+ getImage(parentId, parenttype) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const endpoint = `/files/gets/${parentId}/${parenttype}`;
69
+ const method = "GET";
70
+ try {
71
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
72
+ return response;
73
+ }
74
+ catch (error) {
75
+ throw error;
76
+ }
77
+ });
78
+ }
79
+ }
80
+ exports.FileServiceSerVice = FileServiceSerVice;
@@ -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,7 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class ImageService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ setToken(token: string): void;
5
+ getImageProduct(imageId: string): Promise<any>;
6
+ getImageProducts(productCode: string): Promise<any>;
7
+ }
@@ -0,0 +1,49 @@
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.ImageService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class ImageService extends serviceSDK_1.Service {
15
+ constructor(endpoint, orgId, storeId) {
16
+ super(endpoint, orgId, storeId);
17
+ }
18
+ setToken(token) {
19
+ this.token = token;
20
+ }
21
+ getImageProduct(imageId) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const endpoint = `/${this.orgId}/${imageId}/images-url`;
24
+ const method = "GET";
25
+ try {
26
+ const response = yield this.restApiCallWithNoToken(endpoint, method);
27
+ return response;
28
+ }
29
+ catch (error) {
30
+ throw error;
31
+ }
32
+ });
33
+ }
34
+ getImageProducts(productCode) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ try {
37
+ const response = yield fetch(`https://product-service.dev.longvan.vn/product-service/v1/products/${this.orgId}/${productCode}/images-url`);
38
+ if (!response.ok) {
39
+ throw new Error("Failed to get image products");
40
+ }
41
+ return response.json();
42
+ }
43
+ catch (error) {
44
+ console.error("Error getting image products:", error);
45
+ }
46
+ });
47
+ }
48
+ }
49
+ exports.ImageService = ImageService;
@@ -0,0 +1,7 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class OmnigatewayService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ requestJoinRoom(roomId: string, listUser: [string]): Promise<any>;
5
+ getTemplate(type: string): Promise<any>;
6
+ getInfoChatApp(): Promise<any>;
7
+ }
@@ -0,0 +1,58 @@
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(roomId, listUser) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const endpoint = `/topics/room/${roomId}/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
+ getTemplate(type) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const endpoint = `/message-templates/partner/${this.orgId}/type/${type}`;
34
+ const method = "GET";
35
+ try {
36
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
37
+ return response;
38
+ }
39
+ catch (error) {
40
+ throw error;
41
+ }
42
+ });
43
+ }
44
+ getInfoChatApp() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const endpoint = `/channels/partner/${this.orgId}/social`;
47
+ const method = "GET";
48
+ try {
49
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
50
+ return response;
51
+ }
52
+ catch (error) {
53
+ throw error;
54
+ }
55
+ });
56
+ }
57
+ }
58
+ exports.OmnigatewayService = OmnigatewayService;
@@ -5,6 +5,7 @@ export declare class OrderGraphQLService extends Service {
5
5
  setStoreId(storeId: string): void;
6
6
  createOrder(input: any): Promise<any>;
7
7
  getOrderDetail(orderId: string): Promise<any>;
8
+ getOrderDetailDynamic(orderId: string, fields: string[]): Promise<any>;
8
9
  getQuantityOrderLineItems(orderId: string): Promise<any>;
9
10
  updateQuantityV2(payload: any): Promise<any>;
10
11
  getOrderLineItemByServiceId(serviceId: string): Promise<any>;
@@ -55,6 +55,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
55
55
  }
56
56
  });
57
57
  }
58
+ getOrderDetailDynamic(orderId, fields) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const query = (0, queries_1.GET_ORDER_DETAIL_DYNAMIC)(fields);
61
+ const variables = {
62
+ orderId,
63
+ };
64
+ try {
65
+ const response = yield this.graphqlQueryV2(query, variables);
66
+ return response.orderDetail;
67
+ }
68
+ catch (error) {
69
+ console.log(`Error in orderDetailDynamic: ${error}`);
70
+ throw error;
71
+ }
72
+ });
73
+ }
58
74
  getQuantityOrderLineItems(orderId) {
59
75
  return __awaiter(this, void 0, void 0, function* () {
60
76
  const query = queries_1.GET_QUANTITY_ORDER_LINEITEMS;