@longvansoftware/storefront-js-client 4.3.7-beta.1 → 4.3.7

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 (38) hide show
  1. package/README.md +221 -221
  2. package/dist/src/graphql/auth/mutations.js +309 -309
  3. package/dist/src/graphql/auth/queries.js +209 -209
  4. package/dist/src/graphql/campaign/mutations.js +26 -26
  5. package/dist/src/graphql/campaign/queries.js +457 -457
  6. package/dist/src/graphql/cashbook/queries.js +93 -93
  7. package/dist/src/graphql/cloud/mutations.js +103 -103
  8. package/dist/src/graphql/cloud/queries.js +112 -112
  9. package/dist/src/graphql/cloudCloud/mutations.js +12 -12
  10. package/dist/src/graphql/cloudCloud/queries.js +117 -117
  11. package/dist/src/graphql/cloudService/queries.d.ts +1 -0
  12. package/dist/src/graphql/cloudService/queries.js +71 -0
  13. package/dist/src/graphql/computing/mutations.js +96 -96
  14. package/dist/src/graphql/computing/queries.js +41 -41
  15. package/dist/src/graphql/crm/mutations.js +1064 -1064
  16. package/dist/src/graphql/crm/queries.js +920 -920
  17. package/dist/src/graphql/orderCloud/mutations.js +7 -7
  18. package/dist/src/graphql/orderCloud/queries.js +7 -7
  19. package/dist/src/graphql/payment/mutations.js +194 -194
  20. package/dist/src/graphql/payment/queries.js +117 -117
  21. package/dist/src/graphql/paymentV2/mutations.js +115 -115
  22. package/dist/src/graphql/paymentV2/queries.js +263 -263
  23. package/dist/src/graphql/product/mutations.js +652 -652
  24. package/dist/src/graphql/product/queries.js +990 -989
  25. package/dist/src/graphql/service/mutations.js +304 -304
  26. package/dist/src/graphql/service/queries.js +131 -131
  27. package/dist/src/graphql/store/mutations.js +24 -24
  28. package/dist/src/graphql/store/queries.js +24 -24
  29. package/dist/src/graphql/user/mutations.js +201 -201
  30. package/dist/src/graphql/user/queries.js +339 -339
  31. package/dist/src/lib/cloudService/index.d.ts +5 -0
  32. package/dist/src/lib/cloudService/index.js +35 -0
  33. package/dist/src/lib/order/index.d.ts +0 -9
  34. package/dist/src/lib/order/index.js +0 -21
  35. package/dist/src/lib/serviceSDK.js +14 -14
  36. package/package.json +43 -43
  37. package/dist/index.d.ts +0 -1698
  38. package/dist/index.js +0 -13673
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class CloudServiceService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ searchService(data: any): Promise<any>;
5
+ }
@@ -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.CloudServiceService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ const queries_1 = require("../../graphql/cloudService/queries");
15
+ class CloudServiceService extends serviceSDK_1.Service {
16
+ constructor(endpoint, orgId, storeId) {
17
+ super(endpoint, orgId, storeId);
18
+ }
19
+ searchService(data) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const query = queries_1.SEARCH_SERVICE;
22
+ const variables = {
23
+ filter: data,
24
+ };
25
+ try {
26
+ const response = yield this.graphqlQueryV4(query, variables);
27
+ return response.searchService;
28
+ }
29
+ catch (error) {
30
+ throw error;
31
+ }
32
+ });
33
+ }
34
+ }
35
+ exports.CloudServiceService = CloudServiceService;
@@ -518,15 +518,6 @@ export declare class OrderService extends Service {
518
518
  removeShippingAddress(orderId: string, updateBy: string): Promise<any>;
519
519
  removeShippingInfo(orderId: string, updateBy: string): Promise<any>;
520
520
  updateVatInorder(orderId: string, orderItemId: string, vatRate: string): Promise<any>;
521
- /**
522
- * Updates VAT for an order item by VAT rate name
523
- * @param orderId - The ID of the order
524
- * @param orderItemId - The ID of the order item
525
- * @param vatRateName - The VAT rate name to update
526
- * @returns A promise that resolves when the VAT is updated
527
- * @throws If an error occurs while updating the VAT
528
- */
529
- updateVatByRateName(orderId: string, orderItemId: string, vatRateName: string): Promise<any>;
530
521
  /**
531
522
  * Updates the referral code for an order
532
523
  * @param orderId - The ID of the order
@@ -1599,27 +1599,6 @@ class OrderService extends serviceSDK_1.Service {
1599
1599
  }
1600
1600
  });
1601
1601
  }
1602
- /**
1603
- * Updates VAT for an order item by VAT rate name
1604
- * @param orderId - The ID of the order
1605
- * @param orderItemId - The ID of the order item
1606
- * @param vatRateName - The VAT rate name to update
1607
- * @returns A promise that resolves when the VAT is updated
1608
- * @throws If an error occurs while updating the VAT
1609
- */
1610
- updateVatByRateName(orderId, orderItemId, vatRateName) {
1611
- return __awaiter(this, void 0, void 0, function* () {
1612
- const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/${orderItemId}/vat-rate-name/${vatRateName}`;
1613
- const method = "PUT";
1614
- try {
1615
- const response = yield this.restApiCallWithToken(endpoint, method);
1616
- return response;
1617
- }
1618
- catch (error) {
1619
- throw error;
1620
- }
1621
- });
1622
- }
1623
1602
  /**
1624
1603
  * Updates the referral code for an order
1625
1604
  * @param orderId - The ID of the order
@@ -58,8 +58,8 @@ class Service {
58
58
  return __awaiter(this, void 0, void 0, function* () {
59
59
  try {
60
60
  const { data, errors } = yield this.client.query({
61
- query: (0, client_1.gql) `
62
- ${query}
61
+ query: (0, client_1.gql) `
62
+ ${query}
63
63
  `,
64
64
  variables,
65
65
  context: {
@@ -85,8 +85,8 @@ class Service {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
86
  try {
87
87
  const { data, errors } = yield this.client.mutate({
88
- mutation: (0, client_1.gql) `
89
- ${mutation}
88
+ mutation: (0, client_1.gql) `
89
+ ${mutation}
90
90
  `,
91
91
  variables,
92
92
  context: {
@@ -170,8 +170,8 @@ class Service {
170
170
  return __awaiter(this, void 0, void 0, function* () {
171
171
  try {
172
172
  const { data, errors } = yield this.client.query({
173
- query: (0, client_1.gql) `
174
- ${query}
173
+ query: (0, client_1.gql) `
174
+ ${query}
175
175
  `,
176
176
  variables,
177
177
  context: {
@@ -198,8 +198,8 @@ class Service {
198
198
  return __awaiter(this, void 0, void 0, function* () {
199
199
  try {
200
200
  const { data, errors } = yield this.client.mutate({
201
- mutation: (0, client_1.gql) `
202
- ${mutation}
201
+ mutation: (0, client_1.gql) `
202
+ ${mutation}
203
203
  `,
204
204
  variables,
205
205
  context: {
@@ -225,8 +225,8 @@ class Service {
225
225
  return __awaiter(this, void 0, void 0, function* () {
226
226
  try {
227
227
  const { data, errors } = yield this.client.query({
228
- query: (0, client_1.gql) `
229
- ${query}
228
+ query: (0, client_1.gql) `
229
+ ${query}
230
230
  `,
231
231
  variables,
232
232
  context: {
@@ -253,8 +253,8 @@ class Service {
253
253
  return __awaiter(this, void 0, void 0, function* () {
254
254
  try {
255
255
  const { data, errors } = yield this.client.query({
256
- query: (0, client_1.gql) `
257
- ${query}
256
+ query: (0, client_1.gql) `
257
+ ${query}
258
258
  `,
259
259
  variables,
260
260
  context: {
@@ -281,8 +281,8 @@ class Service {
281
281
  return __awaiter(this, void 0, void 0, function* () {
282
282
  try {
283
283
  const { data, errors } = yield this.client.mutate({
284
- mutation: (0, client_1.gql) `
285
- ${mutation}
284
+ mutation: (0, client_1.gql) `
285
+ ${mutation}
286
286
  `,
287
287
  variables,
288
288
  context: {
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.3.7-beta.1",
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": "4.3.7",
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
+ }