@longvansoftware/storefront-js-client 4.6.3 → 4.6.5

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 (82) hide show
  1. package/dist/config/config.d.ts +2 -0
  2. package/dist/config/config.js +2 -0
  3. package/dist/src/graphql/cloudService/queries.d.ts +1 -0
  4. package/dist/src/graphql/cloudService/queries.js +71 -0
  5. package/dist/src/graphql/marketplace/mutations.d.ts +3 -0
  6. package/dist/src/graphql/marketplace/mutations.js +54 -0
  7. package/dist/src/graphql/marketplace/queries.d.ts +2 -0
  8. package/dist/src/graphql/marketplace/queries.js +45 -0
  9. package/dist/src/graphql/product/mutations.js +0 -3
  10. package/dist/src/graphql/product/queries.js +0 -81
  11. package/dist/src/lib/SDK.d.ts +3 -0
  12. package/dist/src/lib/SDK.js +5 -0
  13. package/dist/src/lib/cloudService/index.d.ts +5 -0
  14. package/dist/src/lib/{dns → cloudService}/index.js +11 -16
  15. package/dist/src/lib/marketplace/index.d.ts +9 -0
  16. package/dist/src/lib/marketplace/index.js +106 -0
  17. package/package.json +1 -1
  18. package/dist/src/graphql/accounting_service/mutations.d.ts +0 -2
  19. package/dist/src/graphql/accounting_service/mutations.js +0 -100
  20. package/dist/src/graphql/accounting_service/queries.d.ts +0 -1
  21. package/dist/src/graphql/accounting_service/queries.js +0 -62
  22. package/dist/src/graphql/content_api/queries.d.ts +0 -2
  23. package/dist/src/graphql/content_api/queries.js +0 -23
  24. package/dist/src/graphql/crm_camping/mutations.d.ts +0 -1
  25. package/dist/src/graphql/crm_camping/mutations.js +0 -37
  26. package/dist/src/graphql/crm_camping/queries.d.ts +0 -14
  27. package/dist/src/graphql/crm_camping/queries.js +0 -420
  28. package/dist/src/graphql/orderGraphQL/mutations.d.ts +0 -10
  29. package/dist/src/graphql/orderGraphQL/mutations.js +0 -410
  30. package/dist/src/graphql/orderGraphQL/queries.d.ts +0 -10
  31. package/dist/src/graphql/orderGraphQL/queries.js +0 -480
  32. package/dist/src/graphql/paymentLV/mutations.d.ts +0 -2
  33. package/dist/src/graphql/paymentLV/mutations.js +0 -31
  34. package/dist/src/graphql/paymentLV/queries.d.ts +0 -5
  35. package/dist/src/graphql/paymentLV/queries.js +0 -135
  36. package/dist/src/graphql/quicklab_service/mutations.d.ts +0 -8
  37. package/dist/src/graphql/quicklab_service/mutations.js +0 -171
  38. package/dist/src/graphql/quicklab_service/queries.d.ts +0 -7
  39. package/dist/src/graphql/quicklab_service/queries.js +0 -131
  40. package/dist/src/graphql/remote_access_service/mutations.d.ts +0 -7
  41. package/dist/src/graphql/remote_access_service/mutations.js +0 -89
  42. package/dist/src/graphql/remote_access_service/queries.d.ts +0 -2
  43. package/dist/src/graphql/remote_access_service/queries.js +0 -34
  44. package/dist/src/graphql/resource_permission/mutations.d.ts +0 -2
  45. package/dist/src/graphql/resource_permission/mutations.js +0 -65
  46. package/dist/src/graphql/resource_permission/queries.d.ts +0 -1
  47. package/dist/src/graphql/resource_permission/queries.js +0 -18
  48. package/dist/src/graphql/storage_s3/mutations.d.ts +0 -27
  49. package/dist/src/graphql/storage_s3/mutations.js +0 -603
  50. package/dist/src/graphql/storage_s3/queries.d.ts +0 -12
  51. package/dist/src/graphql/storage_s3/queries.js +0 -129
  52. package/dist/src/lib/accounting_service/index.d.ts +0 -9
  53. package/dist/src/lib/accounting_service/index.js +0 -69
  54. package/dist/src/lib/cloud_rest/index.d.ts +0 -17
  55. package/dist/src/lib/cloud_rest/index.js +0 -101
  56. package/dist/src/lib/content_api/index.d.ts +0 -7
  57. package/dist/src/lib/content_api/index.js +0 -43
  58. package/dist/src/lib/crm_camping/index.d.ts +0 -21
  59. package/dist/src/lib/crm_camping/index.js +0 -302
  60. package/dist/src/lib/dns/index.d.ts +0 -7
  61. package/dist/src/lib/orderGraphQL/index.d.ts +0 -24
  62. package/dist/src/lib/orderGraphQL/index.js +0 -342
  63. package/dist/src/lib/order_cloud_rest/index.d.ts +0 -7
  64. package/dist/src/lib/order_cloud_rest/index.js +0 -39
  65. package/dist/src/lib/paymentLV/index.d.ts +0 -13
  66. package/dist/src/lib/paymentLV/index.js +0 -149
  67. package/dist/src/lib/quicklab_service/index.d.ts +0 -19
  68. package/dist/src/lib/quicklab_service/index.js +0 -211
  69. package/dist/src/lib/remote_access_service/index.d.ts +0 -16
  70. package/dist/src/lib/remote_access_service/index.js +0 -181
  71. package/dist/src/lib/resource_permission/index.d.ts +0 -9
  72. package/dist/src/lib/resource_permission/index.js +0 -82
  73. package/dist/src/lib/service.d.ts +0 -14
  74. package/dist/src/lib/service.js +0 -101
  75. package/dist/src/lib/storage_s3/index.d.ts +0 -42
  76. package/dist/src/lib/storage_s3/index.js +0 -736
  77. package/dist/src/types/remote_access_service.d.ts +0 -12
  78. package/dist/src/types/remote_access_service.js +0 -2
  79. package/dist/src/types/storage_s3.d.ts +0 -10
  80. package/dist/src/types/storage_s3.js +0 -2
  81. package/dist/src/utils/build-field-string.d.ts +0 -1
  82. package/dist/src/utils/build-field-string.js +0 -16
@@ -1,82 +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.ResourcePermissionService = void 0;
13
- const mutations_1 = require("../../graphql/resource_permission/mutations");
14
- const queries_1 = require("../../graphql/resource_permission/queries");
15
- const serviceSDK_1 = require("../serviceSDK");
16
- class ResourcePermissionService extends serviceSDK_1.Service {
17
- constructor(endpoint, orgId, storeId) {
18
- super(endpoint, orgId, storeId);
19
- }
20
- setToken(token) {
21
- this.token = token;
22
- }
23
- setStoreId(storeId) {
24
- this.storeId = storeId;
25
- }
26
- shareResource(createModel) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const mutation = mutations_1.SHARE_RESOURCE;
29
- const variables = {
30
- partnerId: this.orgId,
31
- createModel,
32
- };
33
- try {
34
- const response = yield this.graphqlMutationV2(mutation, variables);
35
- return response.shareResource;
36
- }
37
- catch (error) {
38
- console.log(`Error in shareResource: ${error}`);
39
- throw error;
40
- }
41
- });
42
- }
43
- removeShareParty(resourceId, sharePartyId, resourceType, userLoginId) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- const mutation = mutations_1.REMOVE_SHARE_PARTY;
46
- const variables = {
47
- partnerId: this.orgId,
48
- orgId: this.orgId,
49
- resourceType,
50
- resourceId,
51
- sharePartyId,
52
- ownerId: userLoginId
53
- };
54
- try {
55
- const response = yield this.graphqlMutationV2(mutation, variables);
56
- return response.removeShareParty;
57
- }
58
- catch (error) {
59
- console.log(`Error in removeShareParty: ${error}`);
60
- throw error;
61
- }
62
- });
63
- }
64
- getSharedUserByService(resourceType, resourceId) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const query = queries_1.GET_SHARED_USER_BY_SERVICE;
67
- const variables = {
68
- resourceType,
69
- resourceId,
70
- };
71
- try {
72
- const response = yield this.graphqlQueryV2(query, variables);
73
- return response.getSharedUserByService;
74
- }
75
- catch (error) {
76
- console.log(`Error in getSharedUserByService: ${error}`);
77
- throw error;
78
- }
79
- });
80
- }
81
- }
82
- exports.ResourcePermissionService = ResourcePermissionService;
@@ -1,14 +0,0 @@
1
- import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
2
- import { DocumentNode } from "graphql";
3
- export declare class Service {
4
- protected token: string | null;
5
- protected client: ApolloClient<NormalizedCacheObject>;
6
- protected orgId: string;
7
- protected storeId: string;
8
- protected endpoint: string;
9
- constructor(endpoint: string, orgId: string, storeId: string);
10
- setToken(token: string): void;
11
- protected graphqlQuery(query: DocumentNode, variables: any): Promise<any>;
12
- protected graphqlMutation(mutation: DocumentNode, variables: any): Promise<any>;
13
- protected restApiCallWithToken(path: string, method: "GET" | "POST" | "PUT" | "DELETE", data?: any, headers?: any): Promise<any>;
14
- }
@@ -1,101 +0,0 @@
1
- "use strict";
2
- // src/service.ts
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Service = void 0;
17
- const client_1 = require("@apollo/client");
18
- const axios_1 = __importDefault(require("axios"));
19
- class Service {
20
- constructor(endpoint, orgId, storeId) {
21
- this.token = null;
22
- this.client = new client_1.ApolloClient({
23
- uri: endpoint,
24
- cache: new client_1.InMemoryCache(),
25
- defaultOptions: {
26
- query: {
27
- fetchPolicy: "network-only",
28
- },
29
- },
30
- });
31
- this.orgId = orgId;
32
- this.storeId = storeId;
33
- this.endpoint = endpoint;
34
- }
35
- setToken(token) {
36
- this.token = token;
37
- }
38
- // setOrgId(orgId: string) {
39
- // this.orgId = orgId;
40
- // }
41
- graphqlQuery(query, variables) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- try {
44
- const { data, errors } = yield this.client.query({
45
- query: (0, client_1.gql) `
46
- ${query}
47
- `,
48
- variables,
49
- });
50
- if (errors) {
51
- throw new Error(`GraphQL error! errors: ${errors}`);
52
- }
53
- return data;
54
- }
55
- catch (error) {
56
- console.log(`Error in graphqlQuery: ${error}`);
57
- throw error;
58
- }
59
- });
60
- }
61
- graphqlMutation(mutation, variables) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- try {
64
- const { data, errors } = yield this.client.mutate({
65
- mutation: (0, client_1.gql) `
66
- ${mutation}
67
- `,
68
- variables,
69
- });
70
- if (errors) {
71
- throw new Error(`GraphQL error! errors: ${errors}`);
72
- }
73
- return data;
74
- }
75
- catch (error) {
76
- console.log(`Error in graphqlMutation: ${error}`);
77
- throw error;
78
- }
79
- });
80
- }
81
- restApiCallWithToken(path, method, data, headers) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- try {
84
- const modifiedHeaders = Object.assign(Object.assign({}, headers), { "Partner-Id": this.orgId, "X-Ecomos-Access-Token": this.token });
85
- console.log("🚀 ~ Service ~ modifiedHeaders:", modifiedHeaders);
86
- const response = yield (0, axios_1.default)({
87
- url: this.endpoint + path,
88
- method,
89
- data,
90
- headers: modifiedHeaders,
91
- });
92
- return response.data;
93
- }
94
- catch (error) {
95
- console.log(`Error in restApiCallWithToken: ${error}`);
96
- throw error;
97
- }
98
- });
99
- }
100
- }
101
- exports.Service = Service;
@@ -1,42 +0,0 @@
1
- import { FileInfoInput, FileTrashInput } from '../../types/storage_s3';
2
- import { Service } from '../serviceSDK';
3
- export declare class StorageS3Service extends Service {
4
- constructor(endpoint: string, orgId: string, storeId: string);
5
- getListS3UserByServiceId(serviceId: string, fields: string[]): Promise<any>;
6
- getListS3UserActiveByServiceId(serviceId: string, fields: string[]): Promise<any>;
7
- getListBucketByS3UserId(s3UserId: string, serviceId: string, fields: string[]): Promise<any>;
8
- getListObject(s3UserId: string, bucketId: string, key: string, serviceId: string, fields: string[]): Promise<any>;
9
- uploadFolder(userId: string, bucketId: string, fileInfo: [FileInfoInput], basePrefix: string, serviceId: string, fields: string[]): Promise<any>;
10
- uploadFile(s3UserId: string, bucketId: string, key: string, fields: string[]): Promise<any>;
11
- updateAclPermissionFile(s3UserId: string, bucketId: string, key: string, isPublic: boolean, serviceId: string, fields: string[]): Promise<any>;
12
- renameFile(s3UserId: string, bucketId: string, key: string, fileNewName: boolean, serviceId: string, fields: string[]): Promise<any>;
13
- shareLinkFileByTime(s3UserId: string, bucketId: string, key: string, quantityHour: number, serviceId: string): Promise<any>;
14
- copyFile(s3UserId: string, bucketId: string, srcFileKey: string, dstFileKey: string, serviceId: string, fields: string[]): Promise<any>;
15
- moveFile(s3UserId: string, bucketId: string, srcFileKey: string, dstFileKey: string, serviceId: string, fields: string[]): Promise<any>;
16
- removeFile(s3UserId: string, bucketId: string, keys: string[], serviceId: string, fields: string[]): Promise<any>;
17
- createFolder(s3UserId: string, bucketId: string, folderName: string, key: string, serviceId: string, fields: string[]): Promise<any>;
18
- removeFolder(s3UserId: string, bucketId: string, key: string, serviceId: string, fields: string[]): Promise<any>;
19
- createBucket(s3UserId: string, bucketName: string, internalId: string, randomInternalId: boolean, enableObjectLock: boolean, enableBucketVersioning: boolean, byUser: string, serviceId: string, fields: string[]): Promise<any>;
20
- renameBucket(bucketId: string, bucketName: string, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
21
- deleteBucket(bucketId: string, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
22
- updateAclPermissionBucket(s3UserId: string, bucketId: string, isPublic: boolean, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
23
- updateBucketVersioning(s3UserId: string, bucketId: string, isOn: boolean, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
24
- getListFileTrash(s3UserId: string, bucketId: string, serviceId: string, fields: string[]): Promise<any>;
25
- restoreFileTrash(s3UserId: string, bucketId: string, key: string, versionId: string, serviceId: string, fields: string[]): Promise<any>;
26
- removeFileTrash(s3UserId: string, bucketId: string, files: [FileTrashInput], serviceId: string, fields: string[]): Promise<any>;
27
- getListS3DomainByS3UserId(s3UserId: string, serviceId: string, fields: string[]): Promise<any>;
28
- addS3Domain(s3UserId: string, domain: string, byUser: string, serviceId: string, fields: string[]): Promise<any>;
29
- removeS3Domain(s3UserId: string, domainId: string, byUser: string, serviceId: string, fields: string[]): Promise<any>;
30
- getListCorsByS3UserId(s3UserId: string, bucketId: string, serviceId: string, fields: string[]): Promise<any>;
31
- addCorsBucket(s3UserId: string, bucketId: string, allowedMethods: string[], allowedOrigins: string[], allowedHeaders: string[], exposeHeaders: string[], maxAgeSeconds: number, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
32
- updateCorsBucket(bucketId: string, corsId: string, allowedMethods: string[], allowedOrigins: string[], allowedHeaders: string[], exposeHeaders: string[], maxAgeSeconds: number, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
33
- removeCorsBucket(bucketId: string, corsId: string, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
34
- getListFileOtherVersion(s3UserId: string, bucketId: string, key: string, serviceId: string, fields: string[]): Promise<any>;
35
- restoreFileOtherVersion(s3UserId: string, bucketId: string, key: string, versionId: string, serviceId: string, fields: string[]): Promise<any>;
36
- removeFileOtherVersion(s3UserId: string, bucketId: string, key: string, versionId: string, serviceId: string, fields: string[]): Promise<any>;
37
- resetKey(s3UserId: string, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
38
- actionSyncUserFromS3(s3UserId: string, updateBy: string, serviceId: string, fields: string[]): Promise<any>;
39
- chartInYear(s3UserId: string, year: number, month: number, serviceId: string, fields: string[]): Promise<any>;
40
- getIPConsul(userId: string, serviceId: string): Promise<any>;
41
- filterListObject(s3UserId: string, bucketId: string, maxKeys: number, key: string, prefixSearch: string, continuationToken: string, serviceId: string, fields: string[]): Promise<any>;
42
- }