@longvansoftware/service-js-client 1.15.7 → 1.15.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.
Files changed (93) hide show
  1. package/README.md +93 -93
  2. package/dist/src/graphql/accounting_service/mutations.js +96 -96
  3. package/dist/src/graphql/accounting_service/queries.js +57 -57
  4. package/dist/src/graphql/auth/mutations.js +235 -235
  5. package/dist/src/graphql/auth/queries.js +68 -68
  6. package/dist/src/graphql/campaign/mutations.d.ts +1 -0
  7. package/dist/src/graphql/campaign/mutations.js +34 -0
  8. package/dist/src/graphql/campaign/queries.d.ts +9 -0
  9. package/dist/src/graphql/campaign/queries.js +412 -0
  10. package/dist/src/graphql/cashbook/queries.d.ts +2 -0
  11. package/dist/src/graphql/cashbook/queries.js +99 -0
  12. package/dist/src/graphql/cloud/mutations.d.ts +4 -0
  13. package/dist/src/graphql/cloud/mutations.js +287 -241
  14. package/dist/src/graphql/cloud/queries.js +341 -341
  15. package/dist/src/graphql/computing/mutations.js +303 -303
  16. package/dist/src/graphql/computing/queries.js +548 -548
  17. package/dist/src/graphql/crm/mutations.d.ts +1 -0
  18. package/dist/src/graphql/crm/mutations.js +392 -375
  19. package/dist/src/graphql/crm/queries.d.ts +1 -0
  20. package/dist/src/graphql/crm/queries.js +359 -332
  21. package/dist/src/graphql/crm_camping/mutations.js +32 -32
  22. package/dist/src/graphql/crm_camping/queries.js +198 -198
  23. package/dist/src/graphql/orderGraphQL/mutations.js +351 -351
  24. package/dist/src/graphql/orderGraphQL/queries.js +387 -387
  25. package/dist/src/graphql/payment/mutations.js +45 -45
  26. package/dist/src/graphql/payment/queries.js +60 -60
  27. package/dist/src/graphql/paymentLV/mutations.js +19 -19
  28. package/dist/src/graphql/paymentLV/queries.js +75 -75
  29. package/dist/src/graphql/paymentV2/mutations.d.ts +3 -0
  30. package/dist/src/graphql/paymentV2/mutations.js +54 -0
  31. package/dist/src/graphql/paymentV2/queries.d.ts +6 -0
  32. package/dist/src/graphql/paymentV2/queries.js +186 -0
  33. package/dist/src/graphql/product/queries.js +891 -891
  34. package/dist/src/graphql/quicklab_service/mutations.js +154 -154
  35. package/dist/src/graphql/quicklab_service/queries.js +108 -108
  36. package/dist/src/graphql/resource_permission/mutations.js +57 -57
  37. package/dist/src/graphql/resource_permission/queries.js +13 -13
  38. package/dist/src/graphql/service/mutations.js +228 -228
  39. package/dist/src/graphql/service/queries.js +128 -128
  40. package/dist/src/graphql/store/mutations.d.ts +1 -0
  41. package/dist/src/graphql/store/mutations.js +29 -0
  42. package/dist/src/graphql/store/queries.d.ts +1 -0
  43. package/dist/src/graphql/store/queries.js +29 -0
  44. package/dist/src/graphql/user/mutations.js +214 -214
  45. package/dist/src/graphql/user/queries.js +312 -312
  46. package/dist/src/lib/accounting/index.d.ts +5 -0
  47. package/dist/src/lib/accounting/index.js +32 -0
  48. package/dist/src/lib/campaign/index.d.ts +20 -0
  49. package/dist/src/lib/campaign/index.js +213 -0
  50. package/dist/src/lib/cashbook/index.d.ts +6 -0
  51. package/dist/src/lib/cashbook/index.js +56 -0
  52. package/dist/src/lib/cloud/index.d.ts +4 -0
  53. package/dist/src/lib/cloud/index.js +69 -0
  54. package/dist/src/lib/comhub/index.d.ts +6 -0
  55. package/dist/src/lib/comhub/index.js +50 -0
  56. package/dist/src/lib/crm/index.d.ts +2 -0
  57. package/dist/src/lib/crm/index.js +40 -0
  58. package/dist/src/lib/deepLinkVietQr/index.d.ts +6 -0
  59. package/dist/src/lib/deepLinkVietQr/index.js +45 -0
  60. package/dist/src/lib/getImage/index.d.ts +4 -0
  61. package/dist/src/lib/getImage/index.js +10 -0
  62. package/dist/src/lib/image/index.d.ts +7 -0
  63. package/dist/src/lib/image/index.js +49 -0
  64. package/dist/src/lib/omnigateway/index.d.ts +7 -0
  65. package/dist/src/lib/omnigateway/index.js +58 -0
  66. package/dist/src/lib/paymentV2/index.d.ts +13 -0
  67. package/dist/src/lib/paymentV2/index.js +163 -0
  68. package/dist/src/lib/portal/index.d.ts +21 -0
  69. package/dist/src/lib/portal/index.js +225 -0
  70. package/dist/src/lib/serviceSDK.js +12 -12
  71. package/dist/src/lib/store/index.d.ts +30 -0
  72. package/dist/src/lib/store/index.js +74 -0
  73. package/dist/src/lib/token/index.d.ts +5 -0
  74. package/dist/src/lib/token/index.js +32 -0
  75. package/dist/src/lib/upload/index.d.ts +5 -0
  76. package/dist/src/lib/upload/index.js +35 -0
  77. package/dist/src/lib/warehouseV2/index.d.ts +13 -0
  78. package/dist/src/lib/warehouseV2/index.js +54 -0
  79. package/dist/src/lib/zca/index.d.ts +12 -0
  80. package/dist/src/lib/zca/index.js +41 -0
  81. package/dist/src/types/campaign.d.ts +14 -0
  82. package/dist/src/types/campaign.js +2 -0
  83. package/dist/src/types/invoice.d.ts +13 -0
  84. package/dist/src/types/invoice.js +2 -0
  85. package/dist/src/types/store.d.ts +158 -0
  86. package/dist/src/types/store.js +3 -0
  87. package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
  88. package/dist/src/utils/validatePhoneNumber.js +20 -0
  89. package/package.json +44 -43
  90. package/dist/src/lib/service.d.ts +0 -14
  91. package/dist/src/lib/service.js +0 -101
  92. package/dist/src/utils/build-field-string.d.ts +0 -1
  93. package/dist/src/utils/build-field-string.js +0 -16
@@ -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;
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,163 @@
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
+ partnerCode: this.orgId,
56
+ };
57
+ try {
58
+ const response = yield this.graphqlQueryV3(query, variables);
59
+ return response.paymentMethods;
60
+ }
61
+ catch (error) {
62
+ throw error;
63
+ }
64
+ });
65
+ }
66
+ getPaymentMethodTypes() {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const query = queries_1.GET_PAYMENT_METHOD_TYPES;
69
+ const variables = {
70
+ partnerId: this.orgId,
71
+ storeId: this.storeId,
72
+ };
73
+ try {
74
+ const response = yield this.graphqlQueryV3(query, variables);
75
+ return response.getPaymentMethodTypes;
76
+ }
77
+ catch (error) {
78
+ throw error;
79
+ }
80
+ });
81
+ }
82
+ paymentInfo(paymentId) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const query = queries_1.PAYMENT_INFO;
85
+ const variables = {
86
+ paymentId,
87
+ };
88
+ try {
89
+ const response = yield this.graphqlQueryV3(query, variables);
90
+ return response.paymentInfo;
91
+ }
92
+ catch (error) {
93
+ throw error;
94
+ }
95
+ });
96
+ }
97
+ confirmToGateway(paymentId, methodCode, returnUrl) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ const mutation = mutations_1.CONFIRM_TO_GATEWAY;
100
+ const variables = {
101
+ paymentId,
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
+ }
163
+ exports.PaymentServiceV2 = PaymentServiceV2;
@@ -0,0 +1,21 @@
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): Promise<any>;
19
+ ffmStage(orderId: string): Promise<any>;
20
+ completeCancelFFMOrder(orderId: string, note: string, reason: string): Promise<any>;
21
+ }
@@ -0,0 +1,225 @@
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) {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/connect-shipment/${byUser}`;
184
+ const method = "POST";
185
+ try {
186
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
187
+ return response;
188
+ }
189
+ catch (error) {
190
+ throw error;
191
+ }
192
+ });
193
+ }
194
+ ffmStage(orderId) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ const endpoint = `/fulfillment-api/public/fulfillment/${this.orgId}/${orderId}/fulfillment-stage`;
197
+ const method = "GET";
198
+ try {
199
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
200
+ return response;
201
+ }
202
+ catch (error) {
203
+ throw error;
204
+ }
205
+ });
206
+ }
207
+ completeCancelFFMOrder(orderId, note, reason) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ const endpoint = `/fulfillment-api/public/fulfillment/FOX/${orderId}/completeCancelOrder`;
210
+ const method = "PUT";
211
+ const reqData = {
212
+ note: note,
213
+ reason: reason,
214
+ };
215
+ try {
216
+ const response = yield this.restApiCallWithNoHeader(endpoint, method, reqData);
217
+ return response;
218
+ }
219
+ catch (error) {
220
+ throw error;
221
+ }
222
+ });
223
+ }
224
+ }
225
+ exports.PortalService = PortalService;
@@ -44,8 +44,8 @@ class Service {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  try {
46
46
  const { data, errors } = yield this.client.query({
47
- query: (0, client_1.gql) `
48
- ${query}
47
+ query: (0, client_1.gql) `
48
+ ${query}
49
49
  `,
50
50
  variables,
51
51
  fetchPolicy: "no-cache",
@@ -72,8 +72,8 @@ class Service {
72
72
  return __awaiter(this, void 0, void 0, function* () {
73
73
  try {
74
74
  const { data, errors } = yield this.client.mutate({
75
- mutation: (0, client_1.gql) `
76
- ${mutation}
75
+ mutation: (0, client_1.gql) `
76
+ ${mutation}
77
77
  `,
78
78
  variables,
79
79
  fetchPolicy: "no-cache",
@@ -134,8 +134,8 @@ class Service {
134
134
  return __awaiter(this, void 0, void 0, function* () {
135
135
  try {
136
136
  const { data, errors } = yield this.client.query({
137
- query: (0, client_1.gql) `
138
- ${query}
137
+ query: (0, client_1.gql) `
138
+ ${query}
139
139
  `,
140
140
  variables,
141
141
  fetchPolicy: "no-cache",
@@ -163,8 +163,8 @@ class Service {
163
163
  return __awaiter(this, void 0, void 0, function* () {
164
164
  try {
165
165
  const { data, errors } = yield this.client.mutate({
166
- mutation: (0, client_1.gql) `
167
- ${mutation}
166
+ mutation: (0, client_1.gql) `
167
+ ${mutation}
168
168
  `,
169
169
  variables,
170
170
  fetchPolicy: "no-cache",
@@ -192,8 +192,8 @@ class Service {
192
192
  try {
193
193
  const headers = Object.assign({ "Content-Type": "application/json" }, additionalHeaders);
194
194
  const { data, errors } = yield this.client.query({
195
- query: (0, client_1.gql) `
196
- ${query}
195
+ query: (0, client_1.gql) `
196
+ ${query}
197
197
  `,
198
198
  variables,
199
199
  fetchPolicy: "no-cache",
@@ -218,8 +218,8 @@ class Service {
218
218
  try {
219
219
  const headers = Object.assign({ "Content-Type": "application/json" }, additionalHeaders);
220
220
  const { data, errors } = yield this.client.mutate({
221
- mutation: (0, client_1.gql) `
222
- ${mutation}
221
+ mutation: (0, client_1.gql) `
222
+ ${mutation}
223
223
  `,
224
224
  variables,
225
225
  fetchPolicy: "no-cache",
@@ -0,0 +1,30 @@
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
+ }
@@ -0,0 +1,74 @@
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;
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class AuthorizationService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ checkToken(orgId: string, token: string): Promise<any>;
5
+ }