@longvansoftware/storefront-js-client 2.5.1 → 2.5.3
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/auth/mutations.js +88 -88
- package/dist/src/graphql/auth/queries.js +20 -20
- package/dist/src/graphql/campaign/queries.js +250 -250
- package/dist/src/graphql/cloud/mutations.js +103 -103
- package/dist/src/graphql/cloud/queries.js +112 -112
- package/dist/src/graphql/computing/mutations.js +96 -96
- package/dist/src/graphql/computing/queries.js +41 -41
- package/dist/src/graphql/crm/mutations.js +813 -813
- package/dist/src/graphql/crm/queries.js +661 -661
- package/dist/src/graphql/payment/mutations.js +39 -39
- package/dist/src/graphql/payment/queries.js +57 -57
- package/dist/src/graphql/paymentV2/mutations.d.ts +1 -0
- package/dist/src/graphql/paymentV2/mutations.js +39 -26
- package/dist/src/graphql/paymentV2/queries.js +175 -175
- package/dist/src/graphql/product/queries.js +453 -453
- package/dist/src/graphql/service/mutations.js +304 -304
- package/dist/src/graphql/service/queries.js +131 -131
- package/dist/src/graphql/user/mutations.js +110 -110
- package/dist/src/graphql/user/queries.js +279 -279
- package/dist/src/lib/order/index.d.ts +46 -1
- package/dist/src/lib/order/index.js +97 -3
- package/dist/src/lib/paymentV2/index.d.ts +1 -0
- package/dist/src/lib/paymentV2/index.js +17 -0
- package/dist/src/lib/serviceSDK.js +12 -12
- package/package.json +43 -43
- package/dist/src/lib/shareZalo/index.d.ts +0 -5
- package/dist/src/lib/shareZalo/index.js +0 -32
|
@@ -1348,10 +1348,104 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1348
1348
|
const res = (0, validatePhoneNumber_1.validatePhoneNumber)(phoneNumer);
|
|
1349
1349
|
return res;
|
|
1350
1350
|
}
|
|
1351
|
-
|
|
1351
|
+
// statistic
|
|
1352
|
+
/**
|
|
1353
|
+
*report by date month year
|
|
1354
|
+
* @param employee_assign
|
|
1355
|
+
* @param type_view
|
|
1356
|
+
* @param date_from
|
|
1357
|
+
* @param date_to
|
|
1358
|
+
* @returns A promise that resolves with the created order.
|
|
1359
|
+
* @throws If an error occurs while creating the order.
|
|
1360
|
+
*/
|
|
1361
|
+
reportDateMonthYear(employee_assign, type_view, date_from, date_to) {
|
|
1352
1362
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1353
|
-
const endpoint = `/orders/${this.orgId}/${
|
|
1354
|
-
const method = "
|
|
1363
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportDateMonthYear?type_view=${type_view}&date_from=${date_from}&date_to=${date_to}`;
|
|
1364
|
+
const method = "GET";
|
|
1365
|
+
try {
|
|
1366
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1367
|
+
return response;
|
|
1368
|
+
}
|
|
1369
|
+
catch (error) {
|
|
1370
|
+
throw error;
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* report by sale employee
|
|
1376
|
+
* @param employee_assign
|
|
1377
|
+
* @param date_from
|
|
1378
|
+
* @param date_to
|
|
1379
|
+
* @returns A promise that resolves with the created order.
|
|
1380
|
+
* @throws If an error occurs while creating the order.
|
|
1381
|
+
*/
|
|
1382
|
+
reportBySaleEmployee(employee_assign, date_from, date_to) {
|
|
1383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1384
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportBySaleEmployee?date_from=${date_from}&date_to=${date_to}`;
|
|
1385
|
+
const method = "GET";
|
|
1386
|
+
try {
|
|
1387
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1388
|
+
return response;
|
|
1389
|
+
}
|
|
1390
|
+
catch (error) {
|
|
1391
|
+
throw error;
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* report by sale employee
|
|
1397
|
+
* @param employee_assign
|
|
1398
|
+
* @param date_from
|
|
1399
|
+
* @param date_to
|
|
1400
|
+
* @returns A promise that resolves with the created order.
|
|
1401
|
+
* @throws If an error occurs while creating the order.
|
|
1402
|
+
*/
|
|
1403
|
+
reportByPaymentMethod(employee_assign, date_from, date_to) {
|
|
1404
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1405
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportByPaymentMethod?date_from=${date_from}&date_to=${date_to}`;
|
|
1406
|
+
const method = "GET";
|
|
1407
|
+
try {
|
|
1408
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1409
|
+
return response;
|
|
1410
|
+
}
|
|
1411
|
+
catch (error) {
|
|
1412
|
+
throw error;
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* report by detail
|
|
1418
|
+
* @param employee_assign
|
|
1419
|
+
* @param type_view
|
|
1420
|
+
* @param date_from
|
|
1421
|
+
* @param date_to
|
|
1422
|
+
* @returns A promise that resolves with the created order.
|
|
1423
|
+
* @throws If an error occurs while creating the order.
|
|
1424
|
+
*/
|
|
1425
|
+
reportByDetail(employee_assign, type_view, date_from, date_to) {
|
|
1426
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1427
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/${employee_assign}/reportByDetail?type_view=${type_view}&date_from=${date_from}&date_to=${date_to}`;
|
|
1428
|
+
const method = "GET";
|
|
1429
|
+
try {
|
|
1430
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1431
|
+
return response;
|
|
1432
|
+
}
|
|
1433
|
+
catch (error) {
|
|
1434
|
+
throw error;
|
|
1435
|
+
}
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* report by store
|
|
1440
|
+
* @param date_from
|
|
1441
|
+
* @param date_to
|
|
1442
|
+
* @returns A promise that resolves with the created order.
|
|
1443
|
+
* @throws If an error occurs while creating the order.
|
|
1444
|
+
*/
|
|
1445
|
+
reporByStores(date_from, date_to) {
|
|
1446
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1447
|
+
const endpoint = `/orders/${this.orgId}/${this.storeId}/reportByStores?date_from=${date_from}&date_to=${date_to}`;
|
|
1448
|
+
const method = "GET";
|
|
1355
1449
|
try {
|
|
1356
1450
|
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1357
1451
|
return response;
|
|
@@ -9,4 +9,5 @@ export declare class PaymentServiceV2 extends Service {
|
|
|
9
9
|
confirmToGateway(paymentId: string, methodCode: string, returnUrl: string): Promise<any>;
|
|
10
10
|
paymentStatus(paymentId: string): Promise<any>;
|
|
11
11
|
gwConfigDetail(configId: string): Promise<any>;
|
|
12
|
+
confirmPaymentSuccessManual(paymentId: string, transactionNo: string, confirmBy: string): Promise<any>;
|
|
12
13
|
}
|
|
@@ -141,5 +141,22 @@ class PaymentServiceV2 extends serviceSDK_1.Service {
|
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
+
confirmPaymentSuccessManual(paymentId, transactionNo, 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
|
+
confirmBy: confirmBy,
|
|
151
|
+
};
|
|
152
|
+
try {
|
|
153
|
+
const response = yield this.graphqlMutationV3(mutation, variables);
|
|
154
|
+
return response.confirmPaymentSuccessManual;
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
144
161
|
}
|
|
145
162
|
exports.PaymentServiceV2 = PaymentServiceV2;
|
|
@@ -57,8 +57,8 @@ class Service {
|
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
try {
|
|
59
59
|
const { data, errors } = yield this.client.query({
|
|
60
|
-
query: (0, client_1.gql) `
|
|
61
|
-
${query}
|
|
60
|
+
query: (0, client_1.gql) `
|
|
61
|
+
${query}
|
|
62
62
|
`,
|
|
63
63
|
variables,
|
|
64
64
|
context: {
|
|
@@ -84,8 +84,8 @@ class Service {
|
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
85
|
try {
|
|
86
86
|
const { data, errors } = yield this.client.mutate({
|
|
87
|
-
mutation: (0, client_1.gql) `
|
|
88
|
-
${mutation}
|
|
87
|
+
mutation: (0, client_1.gql) `
|
|
88
|
+
${mutation}
|
|
89
89
|
`,
|
|
90
90
|
variables,
|
|
91
91
|
context: {
|
|
@@ -169,8 +169,8 @@ class Service {
|
|
|
169
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
170
|
try {
|
|
171
171
|
const { data, errors } = yield this.client.query({
|
|
172
|
-
query: (0, client_1.gql) `
|
|
173
|
-
${query}
|
|
172
|
+
query: (0, client_1.gql) `
|
|
173
|
+
${query}
|
|
174
174
|
`,
|
|
175
175
|
variables,
|
|
176
176
|
context: {
|
|
@@ -197,8 +197,8 @@ class Service {
|
|
|
197
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
198
|
try {
|
|
199
199
|
const { data, errors } = yield this.client.mutate({
|
|
200
|
-
mutation: (0, client_1.gql) `
|
|
201
|
-
${mutation}
|
|
200
|
+
mutation: (0, client_1.gql) `
|
|
201
|
+
${mutation}
|
|
202
202
|
`,
|
|
203
203
|
variables,
|
|
204
204
|
context: {
|
|
@@ -224,8 +224,8 @@ class Service {
|
|
|
224
224
|
return __awaiter(this, void 0, void 0, function* () {
|
|
225
225
|
try {
|
|
226
226
|
const { data, errors } = yield this.client.query({
|
|
227
|
-
query: (0, client_1.gql) `
|
|
228
|
-
${query}
|
|
227
|
+
query: (0, client_1.gql) `
|
|
228
|
+
${query}
|
|
229
229
|
`,
|
|
230
230
|
variables,
|
|
231
231
|
context: {
|
|
@@ -252,8 +252,8 @@ class Service {
|
|
|
252
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
253
253
|
try {
|
|
254
254
|
const { data, errors } = yield this.client.mutate({
|
|
255
|
-
mutation: (0, client_1.gql) `
|
|
256
|
-
${mutation}
|
|
255
|
+
mutation: (0, client_1.gql) `
|
|
256
|
+
${mutation}
|
|
257
257
|
`,
|
|
258
258
|
variables,
|
|
259
259
|
context: {
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@longvansoftware/storefront-js-client",
|
|
3
|
-
"version": "2.5.
|
|
4
|
-
"main": "dist/src/index.js",
|
|
5
|
-
"types": "dist/src/index.d.ts",
|
|
6
|
-
"files": [
|
|
7
|
-
"dist/**/*.d.ts",
|
|
8
|
-
"dist/**/*.js"
|
|
9
|
-
],
|
|
10
|
-
"directories": {
|
|
11
|
-
"test": "jest"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"test": "jest",
|
|
15
|
-
"build": "tsc",
|
|
16
|
-
"publish": "npm run build && npm publish"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [],
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@apollo/client": "3.9.11",
|
|
23
|
-
"apollo-boost": "^0.4.9",
|
|
24
|
-
"axios": "^1.6.8",
|
|
25
|
-
"cross-fetch": "^4.0.0",
|
|
26
|
-
"crypto-js": "^4.2.0",
|
|
27
|
-
"graphql": "^15.8.0",
|
|
28
|
-
"graphql-request": "^6.1.0",
|
|
29
|
-
"graphql-tag": "^2.12.6",
|
|
30
|
-
"react": "^18.2.0",
|
|
31
|
-
"ts-node": "^10.9.2"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/axios": "^0.14.0",
|
|
35
|
-
"@types/crypto-js": "^4.2.2",
|
|
36
|
-
"@types/jest": "^29.5.12",
|
|
37
|
-
"@types/node": "^20.12.7",
|
|
38
|
-
"jest": "^29.7.0",
|
|
39
|
-
"ts-jest": "^29.1.2",
|
|
40
|
-
"typescript": "^5.4.5"
|
|
41
|
-
},
|
|
42
|
-
"description": ""
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@longvansoftware/storefront-js-client",
|
|
3
|
+
"version": "2.5.3",
|
|
4
|
+
"main": "dist/src/index.js",
|
|
5
|
+
"types": "dist/src/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/**/*.d.ts",
|
|
8
|
+
"dist/**/*.js"
|
|
9
|
+
],
|
|
10
|
+
"directories": {
|
|
11
|
+
"test": "jest"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"publish": "npm run build && npm publish"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [],
|
|
19
|
+
"author": "",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@apollo/client": "3.9.11",
|
|
23
|
+
"apollo-boost": "^0.4.9",
|
|
24
|
+
"axios": "^1.6.8",
|
|
25
|
+
"cross-fetch": "^4.0.0",
|
|
26
|
+
"crypto-js": "^4.2.0",
|
|
27
|
+
"graphql": "^15.8.0",
|
|
28
|
+
"graphql-request": "^6.1.0",
|
|
29
|
+
"graphql-tag": "^2.12.6",
|
|
30
|
+
"react": "^18.2.0",
|
|
31
|
+
"ts-node": "^10.9.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/axios": "^0.14.0",
|
|
35
|
+
"@types/crypto-js": "^4.2.2",
|
|
36
|
+
"@types/jest": "^29.5.12",
|
|
37
|
+
"@types/node": "^20.12.7",
|
|
38
|
+
"jest": "^29.7.0",
|
|
39
|
+
"ts-jest": "^29.1.2",
|
|
40
|
+
"typescript": "^5.4.5"
|
|
41
|
+
},
|
|
42
|
+
"description": ""
|
|
43
|
+
}
|
|
@@ -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;
|