@longvansoftware/storefront-js-client 2.9.0 → 2.9.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 (33) hide show
  1. package/README.md +93 -93
  2. package/dist/src/graphql/auth/mutations.js +130 -130
  3. package/dist/src/graphql/auth/queries.js +55 -55
  4. package/dist/src/graphql/campaign/mutations.js +26 -26
  5. package/dist/src/graphql/campaign/queries.js +375 -375
  6. package/dist/src/graphql/cloud/mutations.js +103 -103
  7. package/dist/src/graphql/cloud/queries.js +112 -112
  8. package/dist/src/graphql/computing/mutations.js +96 -96
  9. package/dist/src/graphql/computing/queries.js +41 -41
  10. package/dist/src/graphql/crm/mutations.js +813 -813
  11. package/dist/src/graphql/crm/queries.js +661 -661
  12. package/dist/src/graphql/payment/mutations.d.ts +1 -0
  13. package/dist/src/graphql/payment/mutations.js +148 -125
  14. package/dist/src/graphql/payment/queries.d.ts +1 -0
  15. package/dist/src/graphql/payment/queries.js +112 -93
  16. package/dist/src/graphql/paymentV2/mutations.js +47 -47
  17. package/dist/src/graphql/paymentV2/queries.js +176 -176
  18. package/dist/src/graphql/product/mutations.js +94 -94
  19. package/dist/src/graphql/product/queries.js +464 -464
  20. package/dist/src/graphql/service/mutations.js +304 -304
  21. package/dist/src/graphql/service/queries.js +131 -131
  22. package/dist/src/graphql/user/mutations.js +142 -142
  23. package/dist/src/graphql/user/queries.js +298 -298
  24. package/dist/src/lib/order/index.d.ts +2 -1
  25. package/dist/src/lib/order/index.js +4 -4
  26. package/dist/src/lib/payment/index.d.ts +2 -0
  27. package/dist/src/lib/payment/index.js +33 -0
  28. package/dist/src/lib/serviceSDK.js +12 -12
  29. package/dist/src/lib/shareZalo/index.d.ts +5 -0
  30. package/dist/src/lib/shareZalo/index.js +32 -0
  31. package/dist/src/lib/zca/index.d.ts +1 -1
  32. package/dist/src/lib/zca/index.js +2 -2
  33. package/package.json +43 -43
@@ -183,5 +183,38 @@ class PaymentService extends serviceSDK_1.Service {
183
183
  }
184
184
  });
185
185
  }
186
+ updateInvoiceItem(invoiceId, updateInvoiceItemDTO, byUser) {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ const mutation = mutations_1.UPDATE_INVOICE_ITEM;
189
+ const variables = {
190
+ partnerId: this.orgId,
191
+ invoiceId,
192
+ updateInvoiceItemDTO,
193
+ byUser,
194
+ };
195
+ try {
196
+ const response = yield this.graphqlMutationV3(mutation, variables);
197
+ return response.updateInvoiceItem;
198
+ }
199
+ catch (error) {
200
+ throw error;
201
+ }
202
+ });
203
+ }
204
+ getInvoiceItemOfInvoie(invoiceId) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ const query = queries_1.GET_INVOICE_ITEM_OF_INVOICE;
207
+ const variables = {
208
+ invoiceId,
209
+ };
210
+ try {
211
+ const response = yield this.graphqlQueryV3(query, variables);
212
+ return response.getInvoiceItemOfInvoie;
213
+ }
214
+ catch (error) {
215
+ throw error;
216
+ }
217
+ });
218
+ }
186
219
  }
187
220
  exports.PaymentService = PaymentService;
@@ -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;
@@ -8,5 +8,5 @@ export declare class ZcaService extends Service {
8
8
  */
9
9
  constructor(endpoint: string, orgId: string, storeId: string);
10
10
  setToken(token: string): void;
11
- loginQR(sessionId: string): Promise<any>;
11
+ loginQR(sessionId: string, appId: string): Promise<any>;
12
12
  }
@@ -24,9 +24,9 @@ class ZcaService extends serviceSDK_1.Service {
24
24
  setToken(token) {
25
25
  this.token = token;
26
26
  }
27
- loginQR(sessionId) {
27
+ loginQR(sessionId, appId) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- const endpoint = `/login?sessionId=${sessionId}&orgId=${this.orgId}&storeId=${this.storeId}`;
29
+ const endpoint = `/login?sessionId=${sessionId}&orgId=${this.orgId}&storeId=${this.storeId}&appId=${appId}`;
30
30
  const method = "GET";
31
31
  try {
32
32
  const response = yield this.restApiCallWithNoHeader(endpoint, method);
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.9.0",
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.9.2",
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
+ }