@longvansoftware/storefront-js-client 2.9.5 → 2.9.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 (33) hide show
  1. package/README.md +185 -185
  2. package/dist/config/config.d.ts +2 -0
  3. package/dist/config/config.js +2 -0
  4. package/dist/src/graphql/auth/mutations.js +130 -130
  5. package/dist/src/graphql/auth/queries.js +55 -55
  6. package/dist/src/graphql/campaign/mutations.js +26 -26
  7. package/dist/src/graphql/campaign/queries.js +375 -375
  8. package/dist/src/graphql/cashbook/queries.d.ts +2 -0
  9. package/dist/src/graphql/cashbook/queries.js +99 -0
  10. package/dist/src/graphql/cloud/mutations.js +103 -103
  11. package/dist/src/graphql/cloud/queries.js +112 -112
  12. package/dist/src/graphql/computing/mutations.js +96 -96
  13. package/dist/src/graphql/computing/queries.js +41 -41
  14. package/dist/src/graphql/crm/mutations.js +813 -813
  15. package/dist/src/graphql/crm/queries.js +661 -661
  16. package/dist/src/graphql/payment/mutations.js +146 -146
  17. package/dist/src/graphql/payment/queries.js +116 -116
  18. package/dist/src/graphql/paymentV2/mutations.js +47 -47
  19. package/dist/src/graphql/paymentV2/queries.js +176 -176
  20. package/dist/src/graphql/product/mutations.js +94 -94
  21. package/dist/src/graphql/product/queries.js +468 -468
  22. package/dist/src/graphql/service/mutations.js +304 -304
  23. package/dist/src/graphql/service/queries.js +131 -131
  24. package/dist/src/graphql/user/mutations.js +142 -142
  25. package/dist/src/graphql/user/queries.js +298 -298
  26. package/dist/src/lib/SDK.d.ts +3 -0
  27. package/dist/src/lib/SDK.js +5 -0
  28. package/dist/src/lib/cashbook/index.d.ts +6 -0
  29. package/dist/src/lib/cashbook/index.js +56 -0
  30. package/dist/src/lib/serviceSDK.js +12 -12
  31. package/dist/src/lib/shareZalo/index.d.ts +5 -0
  32. package/dist/src/lib/shareZalo/index.js +32 -0
  33. package/package.json +43 -44
@@ -0,0 +1,56 @@
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.CashbookService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ const queries_1 = require("../../graphql/cashbook/queries");
15
+ class CashbookService extends serviceSDK_1.Service {
16
+ constructor(endpoint, orgId, storeId) {
17
+ super(endpoint, orgId, storeId);
18
+ }
19
+ searchTransactions(keyword, dateFrom, dateTo, currentPage, pageSize) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const query = queries_1.SEARCH_TRANSACTIONS;
22
+ const variables = {
23
+ partnerId: this.orgId,
24
+ keyword,
25
+ dateFrom,
26
+ dateTo,
27
+ currentPage,
28
+ pageSize,
29
+ };
30
+ try {
31
+ const response = yield this.graphqlQueryV3(query, variables);
32
+ return response.searchTransactions;
33
+ }
34
+ catch (error) {
35
+ throw error;
36
+ }
37
+ });
38
+ }
39
+ getCashbookTransactionDetail(cashTransactionId) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const query = queries_1.GET_CASHBOOK_TRANSACTION_DETAIL;
42
+ const variables = {
43
+ partnerId: this.orgId,
44
+ cashTransactionId,
45
+ };
46
+ try {
47
+ const response = yield this.graphqlQueryV3(query, variables);
48
+ return response.getCashbookTransactionDetail;
49
+ }
50
+ catch (error) {
51
+ throw error;
52
+ }
53
+ });
54
+ }
55
+ }
56
+ exports.CashbookService = CashbookService;
@@ -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: {
@@ -0,0 +1,5 @@
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
+ }
@@ -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.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;
package/package.json CHANGED
@@ -1,44 +1,43 @@
1
- {
2
- "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.9.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
- "packageManager": "yarn@4.7.0+sha512.5a0afa1d4c1d844b3447ee3319633797bcd6385d9a44be07993ae52ff4facabccafb4af5dcd1c2f9a94ac113e5e9ff56f6130431905884414229e284e37bb7c9"
44
- }
1
+ {
2
+ "name": "@longvansoftware/storefront-js-client",
3
+ "version": "2.9.6",
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
+ }