@longvansoftware/storefront-js-client 4.3.8 → 4.3.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.
Files changed (39) 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.d.ts +1 -0
  24. package/dist/src/graphql/product/mutations.js +671 -653
  25. package/dist/src/graphql/product/queries.js +996 -990
  26. package/dist/src/graphql/service/mutations.js +304 -304
  27. package/dist/src/graphql/service/queries.js +131 -131
  28. package/dist/src/graphql/store/mutations.js +24 -24
  29. package/dist/src/graphql/store/queries.js +24 -24
  30. package/dist/src/graphql/user/mutations.js +201 -201
  31. package/dist/src/graphql/user/queries.js +339 -339
  32. package/dist/src/lib/cloudService/index.d.ts +5 -0
  33. package/dist/src/lib/cloudService/index.js +35 -0
  34. package/dist/src/lib/product/index.d.ts +1 -0
  35. package/dist/src/lib/product/index.js +17 -0
  36. package/dist/src/lib/serviceSDK.js +14 -14
  37. package/package.json +43 -43
  38. package/dist/index.d.ts +0 -1698
  39. 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;
@@ -80,4 +80,5 @@ export declare class ProductService extends Service {
80
80
  UpdateProductSubtype(productId: string, subType: string): Promise<any>;
81
81
  getCategoryById(categoryId: string): Promise<any>;
82
82
  getCategoryByHandle(handle: string): Promise<any>;
83
+ updateAttributeMetadata(productId: string, attributeId: string, attributeMetadata: any): Promise<any>;
83
84
  }
@@ -896,5 +896,22 @@ class ProductService extends serviceSDK_1.Service {
896
896
  }
897
897
  });
898
898
  }
899
+ updateAttributeMetadata(productId, attributeId, attributeMetadata) {
900
+ return __awaiter(this, void 0, void 0, function* () {
901
+ const mutation = mutations_1.UPDATE_ATTRIBUTE_METADATA;
902
+ const variables = {
903
+ productId,
904
+ attributeId,
905
+ attributeMetadata,
906
+ };
907
+ try {
908
+ const response = yield this.graphqlMutation(mutation, variables);
909
+ return response.updateAttributeMetadata;
910
+ }
911
+ catch (error) {
912
+ throw error;
913
+ }
914
+ });
915
+ }
899
916
  }
900
917
  exports.ProductService = ProductService;
@@ -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.8",
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.9",
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
+ }