@longvansoftware/storefront-js-client 4.6.2-truedoc.1 → 4.6.3
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.
- package/dist/config/config.js +11 -11
- package/dist/src/graphql/accounting_service/mutations.d.ts +2 -0
- package/dist/src/graphql/accounting_service/mutations.js +100 -0
- package/dist/src/graphql/accounting_service/queries.d.ts +1 -0
- package/dist/src/graphql/accounting_service/queries.js +62 -0
- package/dist/src/graphql/content_api/queries.d.ts +2 -0
- package/dist/src/graphql/content_api/queries.js +23 -0
- package/dist/src/graphql/crm_camping/mutations.d.ts +1 -0
- package/dist/src/graphql/crm_camping/mutations.js +37 -0
- package/dist/src/graphql/crm_camping/queries.d.ts +14 -0
- package/dist/src/graphql/crm_camping/queries.js +420 -0
- package/dist/src/graphql/orderGraphQL/mutations.d.ts +10 -0
- package/dist/src/graphql/orderGraphQL/mutations.js +410 -0
- package/dist/src/graphql/orderGraphQL/queries.d.ts +10 -0
- package/dist/src/graphql/orderGraphQL/queries.js +480 -0
- package/dist/src/graphql/paymentLV/mutations.d.ts +2 -0
- package/dist/src/graphql/paymentLV/mutations.js +31 -0
- package/dist/src/graphql/paymentLV/queries.d.ts +5 -0
- package/dist/src/graphql/paymentLV/queries.js +135 -0
- package/dist/src/graphql/product/queries.d.ts +31 -26
- package/dist/src/graphql/product/queries.js +420 -18
- package/dist/src/graphql/quicklab_service/mutations.d.ts +8 -0
- package/dist/src/graphql/quicklab_service/mutations.js +171 -0
- package/dist/src/graphql/quicklab_service/queries.d.ts +7 -0
- package/dist/src/graphql/quicklab_service/queries.js +131 -0
- package/dist/src/graphql/remote_access_service/mutations.d.ts +7 -0
- package/dist/src/graphql/remote_access_service/mutations.js +89 -0
- package/dist/src/graphql/remote_access_service/queries.d.ts +2 -0
- package/dist/src/graphql/remote_access_service/queries.js +34 -0
- package/dist/src/graphql/resource_permission/mutations.d.ts +2 -0
- package/dist/src/graphql/resource_permission/mutations.js +65 -0
- package/dist/src/graphql/resource_permission/queries.d.ts +1 -0
- package/dist/src/graphql/resource_permission/queries.js +18 -0
- package/dist/src/graphql/storage_s3/mutations.d.ts +27 -0
- package/dist/src/graphql/storage_s3/mutations.js +603 -0
- package/dist/src/graphql/storage_s3/queries.d.ts +12 -0
- package/dist/src/graphql/storage_s3/queries.js +129 -0
- package/dist/src/lib/accounting_service/index.d.ts +9 -0
- package/dist/src/lib/accounting_service/index.js +69 -0
- package/dist/src/lib/cloud_rest/index.d.ts +17 -0
- package/dist/src/lib/cloud_rest/index.js +101 -0
- package/dist/src/lib/content_api/index.d.ts +7 -0
- package/dist/src/lib/content_api/index.js +43 -0
- package/dist/src/lib/crm_camping/index.d.ts +21 -0
- package/dist/src/lib/crm_camping/index.js +302 -0
- package/dist/src/lib/dns/index.d.ts +7 -0
- package/dist/src/lib/{cloudService → dns}/index.js +16 -11
- package/dist/src/lib/orderGraphQL/index.d.ts +24 -0
- package/dist/src/lib/orderGraphQL/index.js +342 -0
- package/dist/src/lib/order_cloud_rest/index.d.ts +7 -0
- package/dist/src/lib/order_cloud_rest/index.js +39 -0
- package/dist/src/lib/paymentLV/index.d.ts +13 -0
- package/dist/src/lib/paymentLV/index.js +149 -0
- package/dist/src/lib/product/index.d.ts +4 -0
- package/dist/src/lib/product/index.js +63 -0
- package/dist/src/lib/quicklab_service/index.d.ts +19 -0
- package/dist/src/lib/quicklab_service/index.js +211 -0
- package/dist/src/lib/remote_access_service/index.d.ts +16 -0
- package/dist/src/lib/remote_access_service/index.js +181 -0
- package/dist/src/lib/resource_permission/index.d.ts +9 -0
- package/dist/src/lib/resource_permission/index.js +82 -0
- package/dist/src/lib/service.d.ts +14 -0
- package/dist/src/lib/service.js +101 -0
- package/dist/src/lib/storage_s3/index.d.ts +42 -0
- package/dist/src/lib/storage_s3/index.js +736 -0
- package/dist/src/types/remote_access_service.d.ts +12 -0
- package/dist/src/types/remote_access_service.js +2 -0
- package/dist/src/types/storage_s3.d.ts +10 -0
- package/dist/src/types/storage_s3.js +2 -0
- package/dist/src/utils/build-field-string.d.ts +1 -0
- package/dist/src/utils/build-field-string.js +16 -0
- package/package.json +3 -2
- package/dist/src/graphql/cloudService/queries.d.ts +0 -1
- package/dist/src/graphql/cloudService/queries.js +0 -71
- package/dist/src/lib/cloudService/index.d.ts +0 -5
|
@@ -0,0 +1,211 @@
|
|
|
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.QuicklabService = void 0;
|
|
13
|
+
const mutations_1 = require("../../graphql/quicklab_service/mutations");
|
|
14
|
+
const queries_1 = require("../../graphql/quicklab_service/queries");
|
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
16
|
+
class QuicklabService 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
|
+
getTemplatesByArticleId(articleId) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const query = queries_1.GET_TEMPLATE_BY_ARTICLE_ID;
|
|
29
|
+
const variables = {
|
|
30
|
+
articleId,
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
34
|
+
return response.getTemplatesByArticleId;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.log(`Error in getTemplatesByArticleId : ${error}`);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getTypeLabSessions() {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const query = queries_1.GET_TYPE_LAB_SESSION;
|
|
45
|
+
const variables = {};
|
|
46
|
+
try {
|
|
47
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
48
|
+
return response.getTypeLabSessions;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.log(`Error in getTypeLabSessions : ${error}`);
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
getLabSessionsByUserId(userId) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const query = queries_1.GET_LAB_SESSIONS_BY_USER_ID;
|
|
59
|
+
const variables = { userId };
|
|
60
|
+
try {
|
|
61
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
62
|
+
return response.getLabSessionsByUserId;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.log(`Error in getLabSessionsByUserId : ${error}`);
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
getLabSessionsByUserIdAndArticleId(userId, articleId) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const query = queries_1.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID;
|
|
73
|
+
const variables = { userId, articleId };
|
|
74
|
+
try {
|
|
75
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
76
|
+
return response.getLabSessionsByUserIdAndArticleId;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.log(`Error in getLabSessionsByUserIdAndArticleId : ${error}`);
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
createLabSessionByTemplateId(templateId, userId, articleId, typeLabSessionCode) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
const mutation = mutations_1.CREATE_LAB_SESSION_BY_TEMPLATE_ID;
|
|
87
|
+
const variables = { templateId, userId, articleId, typeLabSessionCode };
|
|
88
|
+
try {
|
|
89
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
90
|
+
return response.createLabSessionByTemplateId;
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
console.log(`Error in createLabSessionByTemplateId : ${error}`);
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
createLabSessionByLabSessionId(labSessionId, userId, articleId) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const mutation = mutations_1.CREATE_LAB_SESSION_BY_LAB_SESSION_ID;
|
|
101
|
+
const variables = { labSessionId, userId, articleId };
|
|
102
|
+
try {
|
|
103
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
104
|
+
return response.createLabSessionByLabSessionId;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.log(`Error in createLabSessionByLabSessionId : ${error}`);
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
createLabSessionByComputingId(computingId, userId, articleId) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const mutation = mutations_1.CREATE_LAB_SESSION_BY_COMPUTING_ID;
|
|
115
|
+
const variables = { computingId, userId, articleId };
|
|
116
|
+
try {
|
|
117
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
118
|
+
return response.createLabSessionByComputingId;
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
console.log(`Error in createLabSessionByComputingId : ${error}`);
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
updateEndTimeLabSession(labSessionId, userId) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const mutation = mutations_1.UPDATE_END_TIME_LAB_SESSION;
|
|
129
|
+
const variables = { labSessionId, userId };
|
|
130
|
+
try {
|
|
131
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
132
|
+
return response.updateEndTimeLabSession;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
console.log(`Error in updateEndTimeLabSession : ${error}`);
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
stopLabSession(labSessionId, userId, note) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
const mutation = mutations_1.STOP_LAB_SESSION;
|
|
143
|
+
const variables = { labSessionId, userId, note };
|
|
144
|
+
try {
|
|
145
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
146
|
+
return response.stopLabSession;
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.log(`Error in stopLabSession : ${error}`);
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
updateTypeLabSession(labSessionId, typeLabSessionCode, userId) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
const mutation = mutations_1.UPDATE_TYPE_LAB_SESSION;
|
|
157
|
+
const variables = { labSessionId, typeLabSessionCode, userId };
|
|
158
|
+
try {
|
|
159
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
160
|
+
return response.updateTypeLabSession;
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
console.log(`Error in updateTypeLabSession : ${error}`);
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
getLabSessionsChillByParent(labSessionId, userId) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
const query = queries_1.GET_LAB_SESSIONS_CHILL_BY_PARENT;
|
|
171
|
+
const variables = { labSessionId, userId };
|
|
172
|
+
try {
|
|
173
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
174
|
+
return response.getLabSessionsChillByParent;
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
console.log(`Error in getLabSessionsChillByParent : ${error}`);
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
stopLabSessionForCustomer(labSessionId, userId, note) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
const mutation = mutations_1.STOP_LAB_SESSION_FOR_CUSTOMER;
|
|
185
|
+
const variables = { labSessionId, userId, note };
|
|
186
|
+
try {
|
|
187
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
188
|
+
return response.stopLabSessionForCustomer;
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
console.log(`Error in stopLabSessionForCustomer : ${error}`);
|
|
192
|
+
throw error;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
getLabDoingAndDoneByUserId(userId, fields) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
const query = (0, queries_1.GET_LAB_DOING_AND_DONE_BY_USERID)(fields);
|
|
199
|
+
const variables = { partnerId: this.orgId, userId };
|
|
200
|
+
try {
|
|
201
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
202
|
+
return response.getLabDoingAndDoneByUserId;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
console.log(`Error in getLabDoingAndDoneByUserId : ${error}`);
|
|
206
|
+
throw error;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.QuicklabService = QuicklabService;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UpdateRemoteAccessDTO } from "../../types/remote_access_service";
|
|
2
|
+
import { Service } from "../serviceSDK";
|
|
3
|
+
export declare class RemoteAccessService extends Service {
|
|
4
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
5
|
+
setToken(token: string): void;
|
|
6
|
+
setStoreId(storeId: string): void;
|
|
7
|
+
GetRemoteAccessByTargetIdAndTargetType(targetId: string, targetType: string): Promise<any>;
|
|
8
|
+
GetConnectionInfoFromRemoteAccessById(remoteAccessId: string): Promise<any>;
|
|
9
|
+
createRemoteAccess(data: any): Promise<any>;
|
|
10
|
+
updateRemoteAccessName(remoteAccessId: string, name: string, updatedBy: string): Promise<any>;
|
|
11
|
+
updateRemoteAccessDescription(remoteAccessId: string, description: string, updatedBy: string): Promise<any>;
|
|
12
|
+
updateRemoteAccessType(remoteAccessId: string, type: string, updatedBy: string): Promise<any>;
|
|
13
|
+
updateRemoteAccessInfo(remoteAccessId: string, remoteAccessInfoInput: any, updatedBy: string): Promise<any>;
|
|
14
|
+
updateRemoteAccess(remoteAccessId: string, updateRemoteAccessDTO: UpdateRemoteAccessDTO, updatedBy: string): Promise<any>;
|
|
15
|
+
deleteRemoteAccess(remoteAccessId: string, updatedBy: string): Promise<any>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
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.RemoteAccessService = void 0;
|
|
13
|
+
const mutations_1 = require("../../graphql/remote_access_service/mutations");
|
|
14
|
+
const queries_1 = require("../../graphql/remote_access_service/queries");
|
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
16
|
+
class RemoteAccessService 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
|
+
GetRemoteAccessByTargetIdAndTargetType(targetId, targetType) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const query = queries_1.GET_REMOTE_ACCESS_BY_TARGETID_AND_TARGETTYPE;
|
|
29
|
+
const variables = {
|
|
30
|
+
targetId,
|
|
31
|
+
targetType,
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
35
|
+
return response.getRemoteAccessByTargetIdAndTargetType;
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.log(`Error in GetRemoteAccessByTargetIdAndTargetType : ${error}`);
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
GetConnectionInfoFromRemoteAccessById(remoteAccessId) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const query = queries_1.GET_CONNECTION_INFO_FROM_REMOTE_ACCESS_BY_ID;
|
|
46
|
+
const variables = {
|
|
47
|
+
remoteAccessId,
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
51
|
+
return response.getConnectionInfoFromRemoteAccessById;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.log(`Error in GetConnectionInfoFromRemoteAccessById : ${error}`);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
createRemoteAccess(data) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const mutation = mutations_1.CREATE_REMOTE_ACCESS;
|
|
62
|
+
const variables = Object.assign({}, data);
|
|
63
|
+
try {
|
|
64
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
65
|
+
return response.createRemoteAccess;
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.log(`Error in createRemoteAccess : ${error}`);
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
updateRemoteAccessName(remoteAccessId, name, updatedBy) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const mutation = mutations_1.UPDATE_REMOTE_ACCESS_NAME;
|
|
76
|
+
const variables = {
|
|
77
|
+
remoteAccessId,
|
|
78
|
+
name,
|
|
79
|
+
updatedBy,
|
|
80
|
+
};
|
|
81
|
+
try {
|
|
82
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
83
|
+
return response.updateRemoteAccessName;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.log(`Error in updateRemoteAccessName : ${error}`);
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
updateRemoteAccessDescription(remoteAccessId, description, updatedBy) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const mutation = mutations_1.UPDATE_REMOTE_ACCESS_DESCRIPTION;
|
|
94
|
+
const variables = {
|
|
95
|
+
remoteAccessId,
|
|
96
|
+
description,
|
|
97
|
+
updatedBy,
|
|
98
|
+
};
|
|
99
|
+
try {
|
|
100
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
101
|
+
return response.updateRemoteAccessDescription;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
console.log(`Error in updateRemoteAccessDescription : ${error}`);
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
updateRemoteAccessType(remoteAccessId, type, updatedBy) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
const mutation = mutations_1.UPDATE_REMOTE_ACCESS_TYPE;
|
|
112
|
+
const variables = {
|
|
113
|
+
remoteAccessId,
|
|
114
|
+
type,
|
|
115
|
+
updatedBy,
|
|
116
|
+
};
|
|
117
|
+
try {
|
|
118
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
119
|
+
return response.updateRemoteAccessType;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
console.log(`Error in updateRemoteAccessType : ${error}`);
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
updateRemoteAccessInfo(remoteAccessId, remoteAccessInfoInput, updatedBy) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const mutation = mutations_1.UPDATE_REMOTE_ACCESS_INFO;
|
|
130
|
+
const variables = {
|
|
131
|
+
remoteAccessId,
|
|
132
|
+
remoteAccessInfoInput,
|
|
133
|
+
updatedBy,
|
|
134
|
+
};
|
|
135
|
+
try {
|
|
136
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
137
|
+
return response.updateRemoteAccessInfo;
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
console.log(`Error in updateRemoteAccessInfo : ${error}`);
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
updateRemoteAccess(remoteAccessId, updateRemoteAccessDTO, updatedBy) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const mutation = mutations_1.UPDATE_REMOTE_ACCESS;
|
|
148
|
+
const variables = {
|
|
149
|
+
remoteAccessId,
|
|
150
|
+
updateRemoteAccessDTO,
|
|
151
|
+
updatedBy,
|
|
152
|
+
};
|
|
153
|
+
try {
|
|
154
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
155
|
+
return response.updateRemoteAccess;
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
console.log(`Error in updateRemoteAccess : ${error}`);
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
deleteRemoteAccess(remoteAccessId, updatedBy) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
const mutation = mutations_1.DELETE_REMOTE_ACCESS;
|
|
166
|
+
const variables = {
|
|
167
|
+
remoteAccessId,
|
|
168
|
+
updatedBy,
|
|
169
|
+
};
|
|
170
|
+
try {
|
|
171
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
172
|
+
return response.deleteRemoteAccess;
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
console.log(`Error in deleteRemoteAccess : ${error}`);
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
exports.RemoteAccessService = RemoteAccessService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class ResourcePermissionService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
setToken(token: string): void;
|
|
5
|
+
setStoreId(storeId: string): void;
|
|
6
|
+
shareResource(createModel: any): Promise<any>;
|
|
7
|
+
removeShareParty(resourceId: string, sharePartyId: string, resourceType: string, userLoginId: string): Promise<any>;
|
|
8
|
+
getSharedUserByService(resourceType: string, resourceId: string): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}
|