@longvansoftware/service-js-client 1.16.4 → 1.16.6

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/cloud/mutations.d.ts +0 -4
  2. package/dist/src/graphql/cloud/mutations.js +1 -47
  3. package/dist/src/graphql/cloud/queries.d.ts +0 -1
  4. package/dist/src/graphql/cloud/queries.js +1 -26
  5. package/dist/src/graphql/computing/mutations.d.ts +0 -1
  6. package/dist/src/graphql/computing/mutations.js +1 -15
  7. package/dist/src/graphql/crm/mutations.d.ts +0 -3
  8. package/dist/src/graphql/crm/mutations.js +1 -54
  9. package/dist/src/graphql/crm/queries.d.ts +0 -3
  10. package/dist/src/graphql/crm/queries.js +1 -71
  11. package/dist/src/graphql/crm_camping/queries.js +19 -49
  12. package/dist/src/graphql/orderGraphQL/queries.d.ts +5 -7
  13. package/dist/src/graphql/orderGraphQL/queries.js +1 -11
  14. package/dist/src/graphql/product/queries.d.ts +0 -2
  15. package/dist/src/graphql/product/queries.js +1 -32
  16. package/dist/src/lib/auth/index.d.ts +1 -1
  17. package/dist/src/lib/auth/index.js +4 -3
  18. package/dist/src/lib/cloud/index.d.ts +0 -5
  19. package/dist/src/lib/cloud/index.js +0 -85
  20. package/dist/src/lib/computing/index.d.ts +0 -1
  21. package/dist/src/lib/computing/index.js +0 -17
  22. package/dist/src/lib/crm/index.d.ts +0 -6
  23. package/dist/src/lib/crm/index.js +0 -107
  24. package/dist/src/lib/crm_camping/index.d.ts +2 -2
  25. package/dist/src/lib/crm_camping/index.js +8 -13
  26. package/dist/src/lib/orderGraphQL/index.d.ts +0 -1
  27. package/dist/src/lib/orderGraphQL/index.js +0 -16
  28. package/dist/src/lib/product/index.d.ts +0 -2
  29. package/dist/src/lib/product/index.js +0 -34
  30. package/dist/src/lib/resource_permission/index.d.ts +2 -2
  31. package/dist/src/lib/resource_permission/index.js +4 -4
  32. package/dist/src/lib/service.d.ts +14 -0
  33. package/dist/src/lib/service.js +101 -0
  34. package/dist/src/utils/build-field-string.d.ts +1 -0
  35. package/dist/src/utils/build-field-string.js +16 -0
  36. package/package.json +1 -1
  37. package/dist/src/graphql/campaign/mutations.d.ts +0 -1
  38. package/dist/src/graphql/campaign/mutations.js +0 -34
  39. package/dist/src/graphql/campaign/queries.d.ts +0 -9
  40. package/dist/src/graphql/campaign/queries.js +0 -427
  41. package/dist/src/graphql/cashbook/queries.d.ts +0 -2
  42. package/dist/src/graphql/cashbook/queries.js +0 -99
  43. package/dist/src/graphql/fragments/product.d.ts +0 -38
  44. package/dist/src/graphql/fragments/product.js +0 -196
  45. package/dist/src/graphql/paymentV2/mutations.d.ts +0 -5
  46. package/dist/src/graphql/paymentV2/mutations.js +0 -120
  47. package/dist/src/graphql/paymentV2/queries.d.ts +0 -9
  48. package/dist/src/graphql/paymentV2/queries.js +0 -257
  49. package/dist/src/graphql/store/mutations.d.ts +0 -1
  50. package/dist/src/graphql/store/mutations.js +0 -29
  51. package/dist/src/graphql/store/queries.d.ts +0 -1
  52. package/dist/src/graphql/store/queries.js +0 -29
  53. package/dist/src/lib/accounting/index.d.ts +0 -5
  54. package/dist/src/lib/accounting/index.js +0 -32
  55. package/dist/src/lib/campaign/index.d.ts +0 -20
  56. package/dist/src/lib/campaign/index.js +0 -218
  57. package/dist/src/lib/cashbook/index.d.ts +0 -6
  58. package/dist/src/lib/cashbook/index.js +0 -56
  59. package/dist/src/lib/comhub/index.d.ts +0 -6
  60. package/dist/src/lib/comhub/index.js +0 -50
  61. package/dist/src/lib/deepLinkVietQr/index.d.ts +0 -7
  62. package/dist/src/lib/deepLinkVietQr/index.js +0 -58
  63. package/dist/src/lib/fileService/index.d.ts +0 -34
  64. package/dist/src/lib/fileService/index.js +0 -80
  65. package/dist/src/lib/getImage/index.d.ts +0 -4
  66. package/dist/src/lib/getImage/index.js +0 -10
  67. package/dist/src/lib/image/index.d.ts +0 -7
  68. package/dist/src/lib/image/index.js +0 -49
  69. package/dist/src/lib/omnigateway/index.d.ts +0 -7
  70. package/dist/src/lib/omnigateway/index.js +0 -58
  71. package/dist/src/lib/paymentV2/index.d.ts +0 -18
  72. package/dist/src/lib/paymentV2/index.js +0 -245
  73. package/dist/src/lib/portal/index.d.ts +0 -23
  74. package/dist/src/lib/portal/index.js +0 -255
  75. package/dist/src/lib/shareZalo/index.d.ts +0 -5
  76. package/dist/src/lib/shareZalo/index.js +0 -32
  77. package/dist/src/lib/store/index.d.ts +0 -30
  78. package/dist/src/lib/store/index.js +0 -74
  79. package/dist/src/lib/token/index.d.ts +0 -5
  80. package/dist/src/lib/token/index.js +0 -32
  81. package/dist/src/lib/upload/index.d.ts +0 -5
  82. package/dist/src/lib/upload/index.js +0 -35
  83. package/dist/src/lib/warehouseV2/index.d.ts +0 -13
  84. package/dist/src/lib/warehouseV2/index.js +0 -54
  85. package/dist/src/lib/zca/index.d.ts +0 -12
  86. package/dist/src/lib/zca/index.js +0 -41
  87. package/dist/src/types/campaign.d.ts +0 -14
  88. package/dist/src/types/campaign.js +0 -2
  89. package/dist/src/types/common.d.ts +0 -264
  90. package/dist/src/types/common.js +0 -35
  91. package/dist/src/types/invoice.d.ts +0 -13
  92. package/dist/src/types/invoice.js +0 -2
  93. package/dist/src/types/portal.d.ts +0 -7
  94. package/dist/src/types/portal.js +0 -2
  95. package/dist/src/types/store.d.ts +0 -158
  96. package/dist/src/types/store.js +0 -3
  97. package/dist/src/utils/errorHandler.d.ts +0 -64
  98. package/dist/src/utils/errorHandler.js +0 -197
  99. package/dist/src/utils/validatePhoneNumber.d.ts +0 -1
  100. package/dist/src/utils/validatePhoneNumber.js +0 -20
@@ -1,18 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class PaymentServiceV2 extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- paymentsByOrders(orderIds: [string]): Promise<any>;
5
- cancelPayment(paymentId: string, reason: string): Promise<any>;
6
- paymentMethods(): Promise<any>;
7
- getPaymentMethodTypes(): Promise<any>;
8
- paymentInfo(paymentId: string): Promise<any>;
9
- confirmToGateway(paymentId: string, methodCode: string, returnUrl: string): Promise<any>;
10
- paymentStatus(paymentId: string): Promise<any>;
11
- gwConfigDetail(configId: string): Promise<any>;
12
- confirmPaymentSuccessManual(paymentId: string, transactionNo: string, note: string, confirmBy: string): Promise<any>;
13
- getPaymentMethodTitles(methodCode: string): Promise<any>;
14
- handleCreateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
15
- handleUpdateGatewayConfig(input: any, cassoApiKey: string): Promise<any>;
16
- getPaymentGatewaysByMethodCode(methodCode: string): Promise<any>;
17
- getPaymentMethodTypesV2(storeActive: any, allMethodTypes: boolean): Promise<any>;
18
- }
@@ -1,245 +0,0 @@
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.PaymentServiceV2 = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- const queries_1 = require("../../graphql/paymentV2/queries");
15
- const mutations_1 = require("../../graphql/paymentV2/mutations");
16
- class PaymentServiceV2 extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- paymentsByOrders(orderIds) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- const query = queries_1.PAYMENTS_BY_ORDERS;
23
- const variables = {
24
- orderIds: orderIds,
25
- };
26
- try {
27
- const response = yield this.graphqlQueryV3(query, variables);
28
- return response.paymentsByOrders;
29
- }
30
- catch (error) {
31
- throw error;
32
- }
33
- });
34
- }
35
- cancelPayment(paymentId, reason) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const mutation = mutations_1.CANCEL_PAYMENT;
38
- const variables = {
39
- paymentId: paymentId,
40
- reason: reason,
41
- };
42
- try {
43
- const respone = yield this.graphqlMutationV3(mutation, variables);
44
- return respone.cancelPayment;
45
- }
46
- catch (error) {
47
- throw error;
48
- }
49
- });
50
- }
51
- paymentMethods() {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- const query = queries_1.PAYMENT_METHODS;
54
- const variables = {};
55
- try {
56
- const response = yield this.graphqlQueryV3(query, variables);
57
- return response.paymentMethods;
58
- }
59
- catch (error) {
60
- throw error;
61
- }
62
- });
63
- }
64
- getPaymentMethodTypes() {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const query = queries_1.GET_PAYMENT_METHOD_TYPES;
67
- const variables = {
68
- partnerId: this.orgId,
69
- storeId: this.storeId,
70
- };
71
- try {
72
- const response = yield this.graphqlQueryV3(query, variables);
73
- return response.getPaymentMethodTypes;
74
- }
75
- catch (error) {
76
- throw error;
77
- }
78
- });
79
- }
80
- paymentInfo(paymentId) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- const query = queries_1.PAYMENT_INFO;
83
- const variables = {
84
- paymentId,
85
- };
86
- try {
87
- const response = yield this.graphqlQueryV3(query, variables);
88
- return response.paymentInfo;
89
- }
90
- catch (error) {
91
- throw error;
92
- }
93
- });
94
- }
95
- confirmToGateway(paymentId, methodCode, returnUrl) {
96
- return __awaiter(this, void 0, void 0, function* () {
97
- const mutation = mutations_1.CONFIRM_TO_GATEWAY;
98
- const variables = {
99
- paymentId,
100
- methodCode,
101
- returnUrl,
102
- };
103
- try {
104
- const response = yield this.graphqlMutationV3(mutation, variables);
105
- return response.confirmToGateway;
106
- }
107
- catch (error) {
108
- throw error;
109
- }
110
- });
111
- }
112
- paymentStatus(paymentId) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- const query = queries_1.PAYMENT_STATUS;
115
- const variables = {
116
- paymentId,
117
- };
118
- try {
119
- const response = yield this.graphqlQueryV3(query, variables);
120
- return response.paymentStatus;
121
- }
122
- catch (error) {
123
- throw error;
124
- }
125
- });
126
- }
127
- gwConfigDetail(configId) {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- const query = queries_1.GW_CONFIG_DETAIL;
130
- const variables = {
131
- configId,
132
- };
133
- try {
134
- const response = yield this.graphqlQueryV3(query, variables);
135
- return response.gwConfigDetail;
136
- }
137
- catch (error) {
138
- throw error;
139
- }
140
- });
141
- }
142
- confirmPaymentSuccessManual(paymentId, transactionNo, note, confirmBy) {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- const mutation = mutations_1.CONFIRM_PAYMENT_SUCCESS_MANUAL;
145
- const variables = {
146
- paymentId: paymentId,
147
- transactionNo: transactionNo,
148
- note: note,
149
- confirmBy: confirmBy,
150
- };
151
- try {
152
- const response = yield this.graphqlMutationV3(mutation, variables);
153
- return response.confirmPaymentSuccessManual;
154
- }
155
- catch (error) {
156
- throw error;
157
- }
158
- });
159
- }
160
- getPaymentMethodTitles(methodCode) {
161
- return __awaiter(this, void 0, void 0, function* () {
162
- const query = queries_1.GET_PAYMENT_METHOD_TITLES;
163
- const variables = {
164
- methodCode,
165
- };
166
- try {
167
- const response = yield this.graphqlQueryV3(query, variables);
168
- return response.getPaymentMethodTitles;
169
- }
170
- catch (error) {
171
- throw error;
172
- }
173
- });
174
- }
175
- handleCreateGatewayConfig(input, cassoApiKey) {
176
- return __awaiter(this, void 0, void 0, function* () {
177
- const mutation = mutations_1.HANDLE_CREATE_GATEWAY_CONFIG;
178
- const data = Object.assign(Object.assign({}, input), { partnerCode: this.orgId });
179
- const variable = {
180
- input: data,
181
- cassoApiKey,
182
- };
183
- try {
184
- const response = yield this.graphqlMutationV3(mutation, variable);
185
- return response.handleCreateGatewayConfig;
186
- }
187
- catch (error) {
188
- throw error;
189
- }
190
- });
191
- }
192
- handleUpdateGatewayConfig(input, cassoApiKey) {
193
- return __awaiter(this, void 0, void 0, function* () {
194
- const mutation = mutations_1.HANDLE_UPDATE_GATEWAY_CONFIG;
195
- const data = Object.assign(Object.assign({}, input), { partnerCode: this.orgId });
196
- const variable = {
197
- input: data,
198
- cassoApiKey,
199
- };
200
- try {
201
- const response = yield this.graphqlMutationV3(mutation, variable);
202
- return response.handleUpdateGatewayConfig;
203
- }
204
- catch (error) {
205
- throw error;
206
- }
207
- });
208
- }
209
- getPaymentGatewaysByMethodCode(methodCode) {
210
- return __awaiter(this, void 0, void 0, function* () {
211
- const query = queries_1.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE;
212
- const variables = {
213
- partnerId: this.orgId,
214
- methodCode,
215
- storeId: this.storeId
216
- };
217
- try {
218
- const response = yield this.graphqlQueryV3(query, variables);
219
- return response.getPaymentGatewaysByMethodCode;
220
- }
221
- catch (error) {
222
- throw error;
223
- }
224
- });
225
- }
226
- getPaymentMethodTypesV2(storeActive, allMethodTypes) {
227
- return __awaiter(this, void 0, void 0, function* () {
228
- const queries = queries_1.GET_PAYMENT_METHOD_TYPES_V2;
229
- const variables = {
230
- partnerId: this.orgId,
231
- storeId: this.storeId,
232
- storeActive: storeActive,
233
- allMethodTypes: allMethodTypes
234
- };
235
- try {
236
- const response = yield this.graphqlQueryV3(queries, variables);
237
- return response.getPaymentMethodTypes;
238
- }
239
- catch (error) {
240
- throw error;
241
- }
242
- });
243
- }
244
- }
245
- exports.PaymentServiceV2 = PaymentServiceV2;
@@ -1,23 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- export declare class PortalService extends Service {
3
- constructor(endpoint: string, orgId: string, storeId: string);
4
- getDynamicForm(dataRequest: any): Promise<any>;
5
- updateDynamicForm(dataRequest: any): Promise<any>;
6
- createTag(title: string, createBy: string, partnerId?: string): Promise<any>;
7
- searchTag(partnerId?: string, title?: string, id?: string, search?: string): Promise<any>;
8
- redirectLink(sku?: string, id?: string): string;
9
- imageProduct(parentId: string, parentType: string, width?: number, height?: number): string;
10
- imagesProduct(parentId: string, parentType: string, width?: number, height?: number): string;
11
- completeOrder(orderId: string, byUser: string): Promise<any>;
12
- pushMessage(message: any): Promise<any>;
13
- confirmExport(orderId: string, updateBy: string): Promise<any>;
14
- confirmPackage(orderId: string, packageBoxId: string, byUser: string): Promise<any>;
15
- handlePackage(orderId: string, byUser: string): Promise<any>;
16
- packageBoxes(): Promise<any>;
17
- shipmentParameter(orderId: string): Promise<any>;
18
- connectShipment(orderId: string, byUser: string, pickupType: string, trackingCode: string): Promise<any>;
19
- ffmStage(orderId: string): Promise<any>;
20
- completeCancelFFMOrder(orderId: string, note: string, reason: string): Promise<any>;
21
- saveTextEditor(saveTextEditor: any): Promise<any>;
22
- getContent(type: string, relativeId: string): Promise<any>;
23
- }
@@ -1,255 +0,0 @@
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.PortalService = void 0;
13
- const serviceSDK_1 = require("../serviceSDK");
14
- class PortalService extends serviceSDK_1.Service {
15
- constructor(endpoint, orgId, storeId) {
16
- super(endpoint, orgId, storeId);
17
- }
18
- // GET
19
- getDynamicForm(dataRequest) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const endpoint = `/dynamic-collection/public/v2/formApi/F.diaries`;
22
- const method = "POST";
23
- try {
24
- const response = yield this.restApiCallWithNoHeader(endpoint, method, dataRequest);
25
- return response;
26
- }
27
- catch (error) {
28
- throw error;
29
- }
30
- });
31
- }
32
- // POST
33
- updateDynamicForm(dataRequest) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const endpoint = `/dynamic-collection/public/v2/formApi/F.diaries`;
36
- const method = "PUT";
37
- try {
38
- const response = yield this.restApiCallWithNoHeader(endpoint, method, dataRequest);
39
- return response;
40
- }
41
- catch (error) {
42
- throw error;
43
- }
44
- });
45
- }
46
- // TAG-order
47
- //Create- tag
48
- createTag(title, createBy, partnerId) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- const endpoint = `/tag-api/public/tag-core/tag/create?title=${title}&createBy=${createBy}&partnerId=${this.orgId}`;
51
- const method = "POST";
52
- try {
53
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
54
- return response;
55
- }
56
- catch (error) {
57
- throw error;
58
- }
59
- });
60
- }
61
- // search tag
62
- searchTag(partnerId, title, id, search) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const endpoint = `/tag-api/public/tag-core/tag/get?partnerId=${this.orgId}&title=${title}&id=${id}&search=${search}`;
65
- const method = "GET";
66
- try {
67
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
68
- return response;
69
- }
70
- catch (error) {
71
- throw error;
72
- }
73
- });
74
- }
75
- //
76
- redirectLink(sku, id) {
77
- const url = `${this.endpoint}/facility/manager/session/inventory-item-by-product.xhtml?${sku ? `sku=${sku}` : `id=${id}`}&orgId=${this.orgId}`;
78
- return url;
79
- }
80
- imageProduct(parentId, parentType, width, height) {
81
- const url = `${this.endpoint}/image-gateway/public/image/${parentType}/${parentId}${width ? `?w=${width}` : ``}${`${height ? `&h=${height}` : ``}`} `;
82
- return url;
83
- }
84
- imagesProduct(parentId, parentType, width, height) {
85
- const url = `${this.endpoint}/image-gateway/public/images/${parentType}/${parentId}?w=${width}&h=${height}`;
86
- return url;
87
- }
88
- completeOrder(orderId, byUser) {
89
- return __awaiter(this, void 0, void 0, function* () {
90
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/complete-fulfillment/${byUser}`;
91
- const method = "PUT";
92
- try {
93
- const response = yield this.restApiCallWithToken(endpoint, method);
94
- return response;
95
- }
96
- catch (error) {
97
- throw error;
98
- }
99
- });
100
- }
101
- pushMessage(message) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- const endpoint = `/dynamic-collection/public/v2/webhook/push_message`;
104
- const method = "POST";
105
- console.log("endpoint", endpoint);
106
- const data = message;
107
- try {
108
- const response = yield this.restApiCallWithNoToken(endpoint, method, message);
109
- return response;
110
- }
111
- catch (error) {
112
- throw error;
113
- }
114
- });
115
- }
116
- confirmExport(orderId, updateBy) {
117
- return __awaiter(this, void 0, void 0, function* () {
118
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/confirm-export/${updateBy}`;
119
- const method = "PUT";
120
- try {
121
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
122
- return response;
123
- }
124
- catch (error) {
125
- throw error;
126
- }
127
- });
128
- }
129
- confirmPackage(orderId, packageBoxId, byUser) {
130
- return __awaiter(this, void 0, void 0, function* () {
131
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/confirm-package/${packageBoxId}/${byUser}`;
132
- const method = "PUT";
133
- try {
134
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
135
- return response;
136
- }
137
- catch (error) {
138
- throw error;
139
- }
140
- });
141
- }
142
- handlePackage(orderId, byUser) {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/handle-package/${byUser}`;
145
- const method = "PUT";
146
- try {
147
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
148
- return response;
149
- }
150
- catch (error) {
151
- throw error;
152
- }
153
- });
154
- }
155
- packageBoxes() {
156
- return __awaiter(this, void 0, void 0, function* () {
157
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/packageBoxes`;
158
- const method = "GET";
159
- try {
160
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
161
- return response;
162
- }
163
- catch (error) {
164
- throw error;
165
- }
166
- });
167
- }
168
- shipmentParameter(orderId) {
169
- return __awaiter(this, void 0, void 0, function* () {
170
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/shipment-parameters`;
171
- const method = "GET";
172
- try {
173
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
174
- return response;
175
- }
176
- catch (error) {
177
- throw error;
178
- }
179
- });
180
- }
181
- connectShipment(orderId, byUser, pickupType, trackingCode) {
182
- return __awaiter(this, void 0, void 0, function* () {
183
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/connect-shipment/${byUser}?pickupType=${pickupType}`;
184
- const method = "POST";
185
- const dataBody = {
186
- trackingCode,
187
- };
188
- try {
189
- const response = yield this.restApiCallWithNoHeader(endpoint, method, dataBody);
190
- return response;
191
- }
192
- catch (error) {
193
- throw error;
194
- }
195
- });
196
- }
197
- ffmStage(orderId) {
198
- return __awaiter(this, void 0, void 0, function* () {
199
- const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/fulfillment-stage`;
200
- const method = "GET";
201
- try {
202
- const response = yield this.restApiCallWithNoHeader(endpoint, method);
203
- return response;
204
- }
205
- catch (error) {
206
- throw error;
207
- }
208
- });
209
- }
210
- completeCancelFFMOrder(orderId, note, reason) {
211
- return __awaiter(this, void 0, void 0, function* () {
212
- const endpoint = `/fulfillment-api/public/fulfillment/FOX/${orderId}/completeCancelOrder`;
213
- const method = "PUT";
214
- const reqData = {
215
- note: note,
216
- reason: reason,
217
- };
218
- try {
219
- const response = yield this.restApiCallWithNoHeader(endpoint, method, reqData);
220
- return response;
221
- }
222
- catch (error) {
223
- throw error;
224
- }
225
- });
226
- }
227
- // save text editor
228
- saveTextEditor(saveTextEditor) {
229
- return __awaiter(this, void 0, void 0, function* () {
230
- const method = "POST";
231
- const endpoint = `/content/public/rich-text-editor/save`;
232
- try {
233
- const response = yield this.restApiCallWithNoToken(endpoint, method, saveTextEditor);
234
- return response;
235
- }
236
- catch (error) {
237
- throw error;
238
- }
239
- });
240
- }
241
- getContent(type, relativeId) {
242
- return __awaiter(this, void 0, void 0, function* () {
243
- const method = "GET";
244
- const endpoint = `/content/public/rich-text-editor/contentCurrent/${type}/${relativeId}`;
245
- try {
246
- const response = yield this.restApiCallWithNoToken(endpoint, method);
247
- return response;
248
- }
249
- catch (error) {
250
- throw error;
251
- }
252
- });
253
- }
254
- }
255
- exports.PortalService = PortalService;
@@ -1,5 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
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.restApiCallWithNoHeader(endpoint, method, dataRequet);
24
- return response;
25
- }
26
- catch (error) {
27
- throw error;
28
- }
29
- });
30
- }
31
- }
32
- exports.ShareZaloService = ShareZaloService;
@@ -1,30 +0,0 @@
1
- import { Service } from "../serviceSDK";
2
- /**
3
- * Service class for managing store-related operations.
4
- */
5
- export declare class StoreService extends Service {
6
- /**
7
- * Constructs a new StoreService instance.
8
- * @param endpoint - The endpoint URL for the service.
9
- * @param orgId - The organization ID.
10
- * @param storeId - The store ID.
11
- */
12
- constructor(endpoint: string, orgId: string, storeId: string);
13
- setToken(token: string): void;
14
- /**
15
- * Creates a store channel.
16
- *
17
- * @param storeChannelData - The data for creating the store channel.
18
- * @returns A promise that resolves to the created store channel response.
19
- * @throws If an error occurs while creating the store channel.
20
- */
21
- createStoreChannel(storeChannelData: any): Promise<any>;
22
- /**
23
- * Gets available store channels for an employee.
24
- *
25
- * @param empId - The employee ID.
26
- * @returns A promise that resolves to the available store channels.
27
- * @throws If an error occurs while fetching the store channels.
28
- */
29
- getAvailableStoreChannels(empId: string): Promise<any>;
30
- }
@@ -1,74 +0,0 @@
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.StoreService = void 0;
13
- // src/lib/store/index.ts
14
- const serviceSDK_1 = require("../serviceSDK");
15
- /**
16
- * Service class for managing store-related operations.
17
- */
18
- class StoreService extends serviceSDK_1.Service {
19
- /**
20
- * Constructs a new StoreService instance.
21
- * @param endpoint - The endpoint URL for the service.
22
- * @param orgId - The organization ID.
23
- * @param storeId - The store ID.
24
- */
25
- constructor(endpoint, orgId, storeId) {
26
- super(endpoint, orgId, storeId);
27
- }
28
- setToken(token) {
29
- this.token = token;
30
- }
31
- /**
32
- * Creates a store channel.
33
- *
34
- * @param storeChannelData - The data for creating the store channel.
35
- * @returns A promise that resolves to the created store channel response.
36
- * @throws If an error occurs while creating the store channel.
37
- */
38
- createStoreChannel(storeChannelData) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const endpoint = `/store-channels/${this.orgId}`;
41
- const method = "POST";
42
- try {
43
- const response = yield this.restApiCallWithToken(endpoint, method, Object.assign(Object.assign({}, storeChannelData), { partyId: this.orgId }));
44
- return response;
45
- }
46
- catch (error) {
47
- console.log(`Error in createStoreChannel: ${error}`);
48
- throw error;
49
- }
50
- });
51
- }
52
- /**
53
- * Gets available store channels for an employee.
54
- *
55
- * @param empId - The employee ID.
56
- * @returns A promise that resolves to the available store channels.
57
- * @throws If an error occurs while fetching the store channels.
58
- */
59
- getAvailableStoreChannels(empId) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- const endpoint = `/store-channels/LONGVAN/available/${empId}`;
62
- const method = "GET";
63
- try {
64
- const response = yield this.restApiCallWithToken(endpoint, method);
65
- return response;
66
- }
67
- catch (error) {
68
- console.log(`Error in getAvailableStoreChannels: ${error}`);
69
- throw error;
70
- }
71
- });
72
- }
73
- }
74
- exports.StoreService = StoreService;