@longvansoftware/service-js-client 2.6.0 → 2.6.2

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 (81) 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 +11 -0
  4. package/dist/src/graphql/campaign/queries.js +496 -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/cloudCloud/mutations.d.ts +3 -0
  8. package/dist/src/graphql/cloudCloud/mutations.js +41 -0
  9. package/dist/src/graphql/cloudCloud/queries.d.ts +5 -0
  10. package/dist/src/graphql/cloudCloud/queries.js +185 -0
  11. package/dist/src/graphql/orderCloud/mutations.d.ts +1 -0
  12. package/dist/src/graphql/orderCloud/mutations.js +12 -0
  13. package/dist/src/graphql/orderCloud/queries.d.ts +1 -0
  14. package/dist/src/graphql/orderCloud/queries.js +12 -0
  15. package/dist/src/graphql/orderGraphQL/mutations.d.ts +2 -0
  16. package/dist/src/graphql/orderGraphQL/mutations.js +11 -1
  17. package/dist/src/graphql/paymentV2/mutations.d.ts +5 -0
  18. package/dist/src/graphql/paymentV2/mutations.js +124 -0
  19. package/dist/src/graphql/paymentV2/queries.d.ts +10 -0
  20. package/dist/src/graphql/paymentV2/queries.js +277 -0
  21. package/dist/src/graphql/store/mutations.d.ts +1 -0
  22. package/dist/src/graphql/store/mutations.js +29 -0
  23. package/dist/src/graphql/store/queries.d.ts +1 -0
  24. package/dist/src/graphql/store/queries.js +29 -0
  25. package/dist/src/graphql/truedoc/queries.d.ts +1 -0
  26. package/dist/src/graphql/truedoc/queries.js +18 -0
  27. package/dist/src/graphql/user/mutations.d.ts +13 -11
  28. package/dist/src/graphql/user/mutations.js +12 -1
  29. package/dist/src/lib/accounting/index.d.ts +5 -0
  30. package/dist/src/lib/accounting/index.js +32 -0
  31. package/dist/src/lib/campaign/index.d.ts +22 -0
  32. package/dist/src/lib/campaign/index.js +252 -0
  33. package/dist/src/lib/cashbook/index.d.ts +6 -0
  34. package/dist/src/lib/cashbook/index.js +56 -0
  35. package/dist/src/lib/cloudCloud/index.d.ts +12 -0
  36. package/dist/src/lib/cloudCloud/index.js +142 -0
  37. package/dist/src/lib/comhub/index.d.ts +6 -0
  38. package/dist/src/lib/comhub/index.js +50 -0
  39. package/dist/src/lib/deepLinkVietQr/index.d.ts +7 -0
  40. package/dist/src/lib/deepLinkVietQr/index.js +58 -0
  41. package/dist/src/lib/fileService/index.d.ts +34 -0
  42. package/dist/src/lib/fileService/index.js +80 -0
  43. package/dist/src/lib/getImage/index.d.ts +4 -0
  44. package/dist/src/lib/getImage/index.js +10 -0
  45. package/dist/src/lib/image/index.d.ts +7 -0
  46. package/dist/src/lib/image/index.js +49 -0
  47. package/dist/src/lib/omnigateway/index.d.ts +7 -0
  48. package/dist/src/lib/omnigateway/index.js +58 -0
  49. package/dist/src/lib/orderCloud/index.d.ts +5 -0
  50. package/dist/src/lib/orderCloud/index.js +37 -0
  51. package/dist/src/lib/orderGraphQL/index.d.ts +2 -0
  52. package/dist/src/lib/orderGraphQL/index.js +32 -0
  53. package/dist/src/lib/paymentV2/index.d.ts +19 -0
  54. package/dist/src/lib/paymentV2/index.js +264 -0
  55. package/dist/src/lib/portal/index.d.ts +33 -0
  56. package/dist/src/lib/portal/index.js +456 -0
  57. package/dist/src/lib/store/index.d.ts +30 -0
  58. package/dist/src/lib/store/index.js +74 -0
  59. package/dist/src/lib/token/index.d.ts +5 -0
  60. package/dist/src/lib/token/index.js +32 -0
  61. package/dist/src/lib/truedoc/index.d.ts +5 -0
  62. package/dist/src/lib/truedoc/index.js +35 -0
  63. package/dist/src/lib/upload/index.d.ts +5 -0
  64. package/dist/src/lib/upload/index.js +35 -0
  65. package/dist/src/lib/user/index.d.ts +1 -0
  66. package/dist/src/lib/user/index.js +20 -0
  67. package/dist/src/lib/warehouseV2/index.d.ts +13 -0
  68. package/dist/src/lib/warehouseV2/index.js +54 -0
  69. package/dist/src/lib/zca/index.d.ts +12 -0
  70. package/dist/src/lib/zca/index.js +41 -0
  71. package/dist/src/types/campaign.d.ts +14 -0
  72. package/dist/src/types/campaign.js +2 -0
  73. package/dist/src/types/invoice.d.ts +14 -0
  74. package/dist/src/types/invoice.js +2 -0
  75. package/dist/src/types/portal.d.ts +7 -0
  76. package/dist/src/types/portal.js +2 -0
  77. package/dist/src/types/store.d.ts +158 -0
  78. package/dist/src/types/store.js +3 -0
  79. package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
  80. package/dist/src/utils/validatePhoneNumber.js +20 -0
  81. package/package.json +1 -1
@@ -0,0 +1,264 @@
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, methodTypeCode, 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
+ storeId: this.storeId,
101
+ methodTypeCode,
102
+ methodCode,
103
+ returnUrl,
104
+ };
105
+ try {
106
+ const response = yield this.graphqlMutationV3(mutation, variables);
107
+ return response.confirmToGateway;
108
+ }
109
+ catch (error) {
110
+ throw error;
111
+ }
112
+ });
113
+ }
114
+ paymentStatus(paymentId) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ const query = queries_1.PAYMENT_STATUS;
117
+ const variables = {
118
+ paymentId,
119
+ };
120
+ try {
121
+ const response = yield this.graphqlQueryV3(query, variables);
122
+ return response.paymentStatus;
123
+ }
124
+ catch (error) {
125
+ throw error;
126
+ }
127
+ });
128
+ }
129
+ gwConfigDetail(configId) {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ const query = queries_1.GW_CONFIG_DETAIL;
132
+ const variables = {
133
+ configId,
134
+ };
135
+ try {
136
+ const response = yield this.graphqlQueryV3(query, variables);
137
+ return response.gwConfigDetail;
138
+ }
139
+ catch (error) {
140
+ throw error;
141
+ }
142
+ });
143
+ }
144
+ confirmPaymentSuccessManual(paymentId, transactionNo, note, confirmBy) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ const mutation = mutations_1.CONFIRM_PAYMENT_SUCCESS_MANUAL;
147
+ const variables = {
148
+ paymentId: paymentId,
149
+ transactionNo: transactionNo,
150
+ note: note,
151
+ confirmBy: confirmBy,
152
+ };
153
+ try {
154
+ const response = yield this.graphqlMutationV3(mutation, variables);
155
+ return response.confirmPaymentSuccessManual;
156
+ }
157
+ catch (error) {
158
+ throw error;
159
+ }
160
+ });
161
+ }
162
+ getPaymentMethodTitles(methodCode) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const query = queries_1.GET_PAYMENT_METHOD_TITLES;
165
+ const variables = {
166
+ methodCode,
167
+ };
168
+ try {
169
+ const response = yield this.graphqlQueryV3(query, variables);
170
+ return response.getPaymentMethodTitles;
171
+ }
172
+ catch (error) {
173
+ throw error;
174
+ }
175
+ });
176
+ }
177
+ handleCreateGatewayConfig(input, cassoApiKey) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ const mutation = mutations_1.HANDLE_CREATE_GATEWAY_CONFIG;
180
+ const data = Object.assign(Object.assign({}, input), { partnerCode: this.orgId });
181
+ const variable = {
182
+ input: data,
183
+ cassoApiKey,
184
+ };
185
+ try {
186
+ const response = yield this.graphqlMutationV3(mutation, variable);
187
+ return response.handleCreateGatewayConfig;
188
+ }
189
+ catch (error) {
190
+ throw error;
191
+ }
192
+ });
193
+ }
194
+ handleUpdateGatewayConfig(input, cassoApiKey) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ const mutation = mutations_1.HANDLE_UPDATE_GATEWAY_CONFIG;
197
+ const data = Object.assign(Object.assign({}, input), { partnerCode: this.orgId });
198
+ const variable = {
199
+ input: data,
200
+ cassoApiKey,
201
+ };
202
+ try {
203
+ const response = yield this.graphqlMutationV3(mutation, variable);
204
+ return response.handleUpdateGatewayConfig;
205
+ }
206
+ catch (error) {
207
+ throw error;
208
+ }
209
+ });
210
+ }
211
+ getPaymentGatewaysByMethodCode(methodCode) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ const query = queries_1.GET_PAYEMNT_GATEWAYS_BY_METHOD_CODE;
214
+ const variables = {
215
+ partnerId: this.orgId,
216
+ methodCode,
217
+ storeId: this.storeId,
218
+ };
219
+ try {
220
+ const response = yield this.graphqlQueryV3(query, variables);
221
+ return response.getPaymentGatewaysByMethodCode;
222
+ }
223
+ catch (error) {
224
+ throw error;
225
+ }
226
+ });
227
+ }
228
+ getPaymentMethodTypesV2(storeActive, allMethodTypes) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ const queries = queries_1.GET_PAYMENT_METHOD_TYPES_V2;
231
+ const variables = {
232
+ partnerId: this.orgId,
233
+ storeId: this.storeId,
234
+ storeActive: storeActive,
235
+ allMethodTypes: allMethodTypes,
236
+ };
237
+ try {
238
+ const response = yield this.graphqlQueryV3(queries, variables);
239
+ return response.getPaymentMethodTypes;
240
+ }
241
+ catch (error) {
242
+ throw error;
243
+ }
244
+ });
245
+ }
246
+ getTransferInfo(storeId, paymentId) {
247
+ return __awaiter(this, void 0, void 0, function* () {
248
+ const queries = queries_1.GET_TRANSFER_INFO;
249
+ const variables = {
250
+ partnerId: this.orgId,
251
+ storeId,
252
+ paymentId,
253
+ };
254
+ try {
255
+ const response = yield this.graphqlMutationV3(queries, variables);
256
+ return response.getTransferInfo;
257
+ }
258
+ catch (error) {
259
+ throw error;
260
+ }
261
+ });
262
+ }
263
+ }
264
+ exports.PaymentServiceV2 = PaymentServiceV2;
@@ -0,0 +1,33 @@
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
+ getCalendarStudent(studentId?: string, classId?: string, startDate?: number, endDate?: number): Promise<any>;
24
+ getClass(studentId?: string): Promise<any>;
25
+ getMenus(menuId: string): Promise<any>;
26
+ getBooking(query?: Record<string, any>): Promise<any>;
27
+ bookingSchedule(data: Record<string, any>): Promise<any>;
28
+ getWorkSchedule(orgId: string, query?: Record<string, any>): Promise<any>;
29
+ updateSchedule(orgId: string, data: Record<string, any>): Promise<any>;
30
+ getPosition(query?: Record<string, any>): Promise<any>;
31
+ getPositionForTime(query?: Record<string, any>): Promise<any>;
32
+ getBookingCount(query?: Record<string, any>): Promise<any>;
33
+ }