@longvansoftware/service-js-client 1.15.8 → 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.
- package/README.md +93 -93
- package/dist/src/graphql/accounting_service/mutations.js +96 -96
- package/dist/src/graphql/accounting_service/queries.js +57 -57
- package/dist/src/graphql/auth/mutations.js +235 -235
- package/dist/src/graphql/auth/queries.js +68 -68
- package/dist/src/graphql/campaign/mutations.d.ts +1 -0
- package/dist/src/graphql/campaign/mutations.js +34 -0
- package/dist/src/graphql/campaign/queries.d.ts +9 -0
- package/dist/src/graphql/campaign/queries.js +412 -0
- package/dist/src/graphql/cashbook/queries.d.ts +2 -0
- package/dist/src/graphql/cashbook/queries.js +99 -0
- package/dist/src/graphql/cloud/mutations.js +282 -282
- package/dist/src/graphql/cloud/queries.js +341 -341
- package/dist/src/graphql/computing/mutations.js +303 -303
- package/dist/src/graphql/computing/queries.js +548 -548
- package/dist/src/graphql/crm/mutations.d.ts +1 -0
- package/dist/src/graphql/crm/mutations.js +392 -375
- package/dist/src/graphql/crm/queries.d.ts +1 -0
- package/dist/src/graphql/crm/queries.js +359 -332
- package/dist/src/graphql/crm_camping/mutations.js +32 -32
- package/dist/src/graphql/crm_camping/queries.js +198 -198
- package/dist/src/graphql/orderGraphQL/mutations.js +351 -351
- package/dist/src/graphql/orderGraphQL/queries.js +387 -387
- package/dist/src/graphql/payment/mutations.js +45 -45
- package/dist/src/graphql/payment/queries.js +60 -60
- package/dist/src/graphql/paymentLV/mutations.js +19 -19
- package/dist/src/graphql/paymentLV/queries.js +75 -75
- package/dist/src/graphql/paymentV2/mutations.d.ts +3 -0
- package/dist/src/graphql/paymentV2/mutations.js +54 -0
- package/dist/src/graphql/paymentV2/queries.d.ts +6 -0
- package/dist/src/graphql/paymentV2/queries.js +186 -0
- package/dist/src/graphql/product/queries.js +891 -891
- package/dist/src/graphql/quicklab_service/mutations.js +154 -154
- package/dist/src/graphql/quicklab_service/queries.js +108 -108
- package/dist/src/graphql/resource_permission/mutations.js +57 -57
- package/dist/src/graphql/resource_permission/queries.js +13 -13
- package/dist/src/graphql/service/mutations.js +228 -228
- package/dist/src/graphql/service/queries.js +128 -128
- package/dist/src/graphql/store/mutations.d.ts +1 -0
- package/dist/src/graphql/store/mutations.js +29 -0
- package/dist/src/graphql/store/queries.d.ts +1 -0
- package/dist/src/graphql/store/queries.js +29 -0
- package/dist/src/graphql/user/mutations.js +214 -214
- package/dist/src/graphql/user/queries.js +312 -312
- package/dist/src/lib/accounting/index.d.ts +5 -0
- package/dist/src/lib/accounting/index.js +32 -0
- package/dist/src/lib/campaign/index.d.ts +20 -0
- package/dist/src/lib/campaign/index.js +213 -0
- package/dist/src/lib/cashbook/index.d.ts +6 -0
- package/dist/src/lib/cashbook/index.js +56 -0
- package/dist/src/lib/comhub/index.d.ts +6 -0
- package/dist/src/lib/comhub/index.js +50 -0
- package/dist/src/lib/crm/index.d.ts +2 -0
- package/dist/src/lib/crm/index.js +40 -0
- package/dist/src/lib/deepLinkVietQr/index.d.ts +6 -0
- package/dist/src/lib/deepLinkVietQr/index.js +45 -0
- package/dist/src/lib/getImage/index.d.ts +4 -0
- package/dist/src/lib/getImage/index.js +10 -0
- package/dist/src/lib/image/index.d.ts +7 -0
- package/dist/src/lib/image/index.js +49 -0
- package/dist/src/lib/omnigateway/index.d.ts +7 -0
- package/dist/src/lib/omnigateway/index.js +58 -0
- package/dist/src/lib/paymentV2/index.d.ts +13 -0
- package/dist/src/lib/paymentV2/index.js +163 -0
- package/dist/src/lib/portal/index.d.ts +21 -0
- package/dist/src/lib/portal/index.js +225 -0
- package/dist/src/lib/serviceSDK.js +12 -12
- package/dist/src/lib/store/index.d.ts +30 -0
- package/dist/src/lib/store/index.js +74 -0
- package/dist/src/lib/token/index.d.ts +5 -0
- package/dist/src/lib/token/index.js +32 -0
- package/dist/src/lib/upload/index.d.ts +5 -0
- package/dist/src/lib/upload/index.js +35 -0
- package/dist/src/lib/warehouseV2/index.d.ts +13 -0
- package/dist/src/lib/warehouseV2/index.js +54 -0
- package/dist/src/lib/zca/index.d.ts +12 -0
- package/dist/src/lib/zca/index.js +41 -0
- package/dist/src/types/campaign.d.ts +14 -0
- package/dist/src/types/campaign.js +2 -0
- package/dist/src/types/invoice.d.ts +13 -0
- package/dist/src/types/invoice.js +2 -0
- package/dist/src/types/store.d.ts +158 -0
- package/dist/src/types/store.js +3 -0
- package/dist/src/utils/validatePhoneNumber.d.ts +1 -0
- package/dist/src/utils/validatePhoneNumber.js +20 -0
- package/package.json +44 -43
@@ -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,32 @@
|
|
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.AuthorizationService = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class AuthorizationService extends serviceSDK_1.Service {
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
16
|
+
super(endpoint, orgId, storeId);
|
17
|
+
}
|
18
|
+
checkToken(orgId, token) {
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
20
|
+
const endpoint = `/${orgId}/oauth2/api/v1/token/${token}`;
|
21
|
+
const method = "GET";
|
22
|
+
try {
|
23
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
24
|
+
return response;
|
25
|
+
}
|
26
|
+
catch (error) {
|
27
|
+
throw error;
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
}
|
32
|
+
exports.AuthorizationService = AuthorizationService;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.UploadService = void 0;
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
14
|
+
class UploadService extends serviceSDK_1.Service {
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
16
|
+
super(endpoint, orgId, storeId);
|
17
|
+
}
|
18
|
+
uploadImage(imageCode) {
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
20
|
+
const endpoint = "";
|
21
|
+
const method = "POST";
|
22
|
+
try {
|
23
|
+
const formData = new FormData();
|
24
|
+
formData.append("uploadFile", imageCode);
|
25
|
+
formData.append("path", "public");
|
26
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method, formData);
|
27
|
+
return response;
|
28
|
+
}
|
29
|
+
catch (error) {
|
30
|
+
throw error;
|
31
|
+
}
|
32
|
+
});
|
33
|
+
}
|
34
|
+
}
|
35
|
+
exports.UploadService = UploadService;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Service } from "../serviceSDK";
|
2
|
+
export declare class WarehouseServiceV2 extends Service {
|
3
|
+
/**
|
4
|
+
* Constructs a new OrderService instance.
|
5
|
+
* @param endpoint - The endpoint URL for the service.
|
6
|
+
* @param orgId - The organization ID.
|
7
|
+
* @param storeId - The store ID.
|
8
|
+
*/
|
9
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
10
|
+
setToken(token: string): void;
|
11
|
+
getInventory(warehouseId: string, data: any[]): Promise<any>;
|
12
|
+
getInfoWarehouse(warehouseId: string): Promise<any>;
|
13
|
+
}
|