@longvansoftware/storefront-js-client 4.6.2 → 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/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 -29
- package/dist/src/graphql/product/queries.js +20 -10
- 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 +1 -0
- package/dist/src/lib/product/index.js +18 -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,342 @@
|
|
|
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.OrderGraphQLService = void 0;
|
|
13
|
+
const mutations_1 = require("../../graphql/orderGraphQL/mutations");
|
|
14
|
+
const queries_1 = require("../../graphql/orderGraphQL/queries");
|
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
16
|
+
class OrderGraphQLService 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
|
+
createOrder(input) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const mutation = mutations_1.CREATE_ORDER;
|
|
29
|
+
const variables = {
|
|
30
|
+
input,
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
34
|
+
return response.createOrder;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.log(`Error in createOrder: ${error}`);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getOrderDetail(orderId) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const query = queries_1.GET_ORDER_DETAIL;
|
|
45
|
+
const variables = {
|
|
46
|
+
orderId,
|
|
47
|
+
};
|
|
48
|
+
try {
|
|
49
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
50
|
+
return response.orderDetail;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.log(`Error in orderDetail: ${error}`);
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getOrderDetailDynamic(orderId, fields) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const query = (0, queries_1.GET_ORDER_DETAIL_DYNAMIC)(fields);
|
|
61
|
+
const variables = {
|
|
62
|
+
orderId,
|
|
63
|
+
};
|
|
64
|
+
try {
|
|
65
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
66
|
+
return response.orderDetail;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.log(`Error in orderDetailDynamic: ${error}`);
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
getQuantityOrderLineItems(orderId) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const query = queries_1.GET_QUANTITY_ORDER_LINEITEMS;
|
|
77
|
+
const variables = {
|
|
78
|
+
orderId,
|
|
79
|
+
};
|
|
80
|
+
try {
|
|
81
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
82
|
+
return response.orderDetail;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.log(`Error in orderDetail: ${error}`);
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
updateQuantityV2(payload) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const mutations = mutations_1.UPDATE_QUANTITY_V2;
|
|
93
|
+
const variables = Object.assign({ partnerId: this.orgId }, payload);
|
|
94
|
+
try {
|
|
95
|
+
const response = yield this.graphqlMutationV2(mutations, variables);
|
|
96
|
+
return response.updateQuantityV2;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
console.log(`Error in updateQuantityV2: ${error}`);
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
getOrderLineItemByServiceId(serviceId) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const query = queries_1.GET_ORDER_LINE_ITEM_BY_SERVICE_ID;
|
|
107
|
+
const variables = {
|
|
108
|
+
partnerId: this.orgId,
|
|
109
|
+
serviceId,
|
|
110
|
+
};
|
|
111
|
+
try {
|
|
112
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
113
|
+
return response.getOrderLineItemByServiceId;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
console.log(`Error in getOrderLineItemByServiceId: ${error}`);
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
getOrderByServiceId(serviceId) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const query = queries_1.GET_ORDER_BY_SERVICE_ID;
|
|
124
|
+
const variables = {
|
|
125
|
+
serviceId,
|
|
126
|
+
};
|
|
127
|
+
try {
|
|
128
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
129
|
+
return response.getOrderByServiceId;
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
console.log(`Error in getOrderByServiceId: ${error}`);
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
addToCart(serviceId, actorId, cartId) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const mutation = mutations_1.ADD_TO_CART;
|
|
140
|
+
const variables = {
|
|
141
|
+
serviceId,
|
|
142
|
+
actorId,
|
|
143
|
+
cartId,
|
|
144
|
+
};
|
|
145
|
+
try {
|
|
146
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
147
|
+
return response.addToCart;
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
console.log(`Error in addToCart: ${error}`);
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
removeProductOptionOrderLineItem(orderLineItemId, optionId, updateBy) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const mutation = mutations_1.REMOVE_PRODUCT_OPTION_ORDER_LINE_ITEM;
|
|
158
|
+
const variables = {
|
|
159
|
+
partnerId: this.orgId,
|
|
160
|
+
orderLineItemId,
|
|
161
|
+
optionId,
|
|
162
|
+
updateBy,
|
|
163
|
+
};
|
|
164
|
+
try {
|
|
165
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
166
|
+
return response.removeProductOptionOrderLineItem;
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
console.log(`Error in removeProductOptionOrderLineItem: ${error}`);
|
|
170
|
+
throw error;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
findOrderByOwnerPartyId(ownerPartyId) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
const query = queries_1.FIND_ORDER_BY_OWNER_PARTYID;
|
|
177
|
+
const variables = {
|
|
178
|
+
partnerId: this.orgId,
|
|
179
|
+
ownerPartyId,
|
|
180
|
+
};
|
|
181
|
+
try {
|
|
182
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
183
|
+
return response.findOrderByOwnerPartyId;
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
console.log(`Error in findOrderByOwnerPartyId: ${error}`);
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
calcExchangePriceExtendResourceDetail(serviceId, productBaseIdNew, durationQuantity, durationUnit, fields) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
const query = (0, queries_1.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC)(fields);
|
|
194
|
+
const variables = {
|
|
195
|
+
partnerId: this.orgId,
|
|
196
|
+
storeId: this.storeId,
|
|
197
|
+
serviceId,
|
|
198
|
+
productBaseIdNew,
|
|
199
|
+
durationQuantity,
|
|
200
|
+
durationUnit,
|
|
201
|
+
};
|
|
202
|
+
try {
|
|
203
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
204
|
+
return response.calcExchangePriceExtendResourceDetail;
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
console.log(`Error in calcExchangePriceExtendResourceDetail: ${error}`);
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
searchOrderDynamic(params, fields) {
|
|
213
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
214
|
+
console.log("🚀 ~ OrderGraphQLService ~ searchOrderDynamic ~ params:", params);
|
|
215
|
+
const query = (0, queries_1.SEARCH_ORDER_DYNAMIC)(fields);
|
|
216
|
+
const variables = {
|
|
217
|
+
filter: params,
|
|
218
|
+
};
|
|
219
|
+
try {
|
|
220
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
221
|
+
return response.searchOrder;
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
console.log(`Error in searchOrderDynamic: ${error}`);
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
addItemIntoOrderByProductJsonResource(serviceId, orderId, itemInput, durationQuantity, durationUnit, actorId, fields) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
const mutation = (0, mutations_1.ADD_ITEM_INTO_ORDER_BY_PRODUCT_JSON_RESOURCE)(fields);
|
|
232
|
+
const variables = {
|
|
233
|
+
partnerId: this.orgId,
|
|
234
|
+
serviceId,
|
|
235
|
+
orderId,
|
|
236
|
+
itemInput,
|
|
237
|
+
durationQuantity,
|
|
238
|
+
durationUnit,
|
|
239
|
+
actorId,
|
|
240
|
+
};
|
|
241
|
+
try {
|
|
242
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
243
|
+
return response.addItemIntoOrderByProductJsonResource;
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
console.log(`Error in addItemIntoOrderByProductJsonResource: ${error}`);
|
|
247
|
+
throw error;
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
updateOrderLineItemParentId(orderLineItemChildIds, orderLineItemParentId, updateBy) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
const mutation = mutations_1.UPDATE_ORDER_LINE_ITEM_PARENT_ID;
|
|
254
|
+
const variables = {
|
|
255
|
+
partnerId: this.orgId,
|
|
256
|
+
orderLineItemChildIds,
|
|
257
|
+
orderLineItemParentId,
|
|
258
|
+
updateBy,
|
|
259
|
+
};
|
|
260
|
+
try {
|
|
261
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
262
|
+
return response.updateOrderLineItemParentId;
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
console.log(`Error in addItemIntoOrderByProductJsonResource: ${error}`);
|
|
266
|
+
throw error;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
updateProductOptionOrderLineItem(orderLineItemId, productOptionUpdate, updateBy) {
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
const mutation = mutations_1.UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM;
|
|
273
|
+
const variables = {
|
|
274
|
+
orderLineItemId,
|
|
275
|
+
productOptionUpdate,
|
|
276
|
+
updateBy,
|
|
277
|
+
};
|
|
278
|
+
try {
|
|
279
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
280
|
+
return response.updateProductOptionOrderLineItem;
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
console.log(`Error in updateProductOptionOrderLineItem: ${error}`);
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
calculateResourceChangePrice(productIds, quantity, unit, storeId, fields, serviceId) {
|
|
289
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
+
const query = (0, queries_1.CALCULATE_RESOURCE_CHANGE_PRICE)(fields);
|
|
291
|
+
const variables = {
|
|
292
|
+
partnerId: this.orgId,
|
|
293
|
+
storeId: storeId ? storeId : this.storeId,
|
|
294
|
+
productIds,
|
|
295
|
+
quantity,
|
|
296
|
+
unit,
|
|
297
|
+
serviceId
|
|
298
|
+
};
|
|
299
|
+
try {
|
|
300
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
301
|
+
return response.calculateResourceChangePrice;
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
console.log(`Error in calculateResourceChangePrice: ${error}`);
|
|
305
|
+
throw error;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
applyReferralCode(input) {
|
|
310
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
+
const mutation = mutations_1.APPLY_REFERRAL_CODE;
|
|
312
|
+
const variables = {
|
|
313
|
+
input,
|
|
314
|
+
};
|
|
315
|
+
try {
|
|
316
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
317
|
+
return response.applyReferralCode;
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
console.log(`Error in applyReferralCode: ${error}`);
|
|
321
|
+
throw error;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
removeReferralCode(input) {
|
|
326
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
327
|
+
const mutation = mutations_1.REMOVE_REFERRAL_CODE;
|
|
328
|
+
const variables = {
|
|
329
|
+
input,
|
|
330
|
+
};
|
|
331
|
+
try {
|
|
332
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
333
|
+
return response.removeReferralCode;
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
console.log(`Error in removeReferralCode: ${error}`);
|
|
337
|
+
throw error;
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.OrderGraphQLService = OrderGraphQLService;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class OrderCloudRestService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
setToken(token: string): void;
|
|
5
|
+
setStoreId(storeId: string): void;
|
|
6
|
+
updateOrderConfirmation(orderId: string, createBy: string): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.OrderCloudRestService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class OrderCloudRestService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
setToken(token) {
|
|
19
|
+
this.token = token;
|
|
20
|
+
}
|
|
21
|
+
setStoreId(storeId) {
|
|
22
|
+
this.storeId = storeId;
|
|
23
|
+
}
|
|
24
|
+
updateOrderConfirmation(orderId, createBy) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const endpoint = `/service-webhook?partnerId=${this.orgId}&orderId=${orderId}&createBy=${createBy}`;
|
|
27
|
+
const method = "GET";
|
|
28
|
+
try {
|
|
29
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.log(`Error in updateOrderConfirmation: ${error}`);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.OrderCloudRestService = OrderCloudRestService;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class PaymentLVService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
setToken(token: string): void;
|
|
5
|
+
setStoreId(storeId: string): void;
|
|
6
|
+
paymentsByOrders(orderIds: [string]): Promise<any>;
|
|
7
|
+
getTransferInfo(paymentId: string, store: string): Promise<any>;
|
|
8
|
+
cancelPayment(paymentId: string, reason: string, createBy: string): Promise<any>;
|
|
9
|
+
confirmPaidManual(paymentId: string, confirmBy: string): Promise<any>;
|
|
10
|
+
getPaymentMethodTypes(store: string): Promise<any>;
|
|
11
|
+
paymentMethods(): Promise<any>;
|
|
12
|
+
paymentStatus(paymentId: string): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
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.PaymentLVService = void 0;
|
|
13
|
+
const mutations_1 = require("../../graphql/paymentLV/mutations");
|
|
14
|
+
const queries_1 = require("../../graphql/paymentLV/queries");
|
|
15
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
16
|
+
class PaymentLVService 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
|
+
paymentsByOrders(orderIds) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const query = queries_1.PAYMENTS_BY_ORDERS;
|
|
29
|
+
const variables = {
|
|
30
|
+
orderIds,
|
|
31
|
+
};
|
|
32
|
+
// const headers = { PartnerId: this.orgId };
|
|
33
|
+
try {
|
|
34
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables
|
|
35
|
+
// headers
|
|
36
|
+
);
|
|
37
|
+
return response.paymentsByOrders;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.log(`Error in paymentsByOrders: ${error}`);
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getTransferInfo(paymentId, store) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const query = queries_1.GET_TRANSFER_INFO;
|
|
48
|
+
const variables = {
|
|
49
|
+
partnerId: this.orgId,
|
|
50
|
+
storeId: store ? store : this.storeId,
|
|
51
|
+
paymentId,
|
|
52
|
+
};
|
|
53
|
+
try {
|
|
54
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
|
55
|
+
return response.getTransferInfo;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.log(`Error fetching get getTransferInfo method: ${error}`);
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
cancelPayment(paymentId, reason, createBy) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
const mutation = mutations_1.CANCEL_PAYMENT;
|
|
66
|
+
const variables = {
|
|
67
|
+
paymentId,
|
|
68
|
+
safeMode: true,
|
|
69
|
+
reason,
|
|
70
|
+
createBy,
|
|
71
|
+
};
|
|
72
|
+
try {
|
|
73
|
+
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
|
74
|
+
return response.cancelPayment;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.log(`Error fetching get cancelPayment method: ${error}`);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
confirmPaidManual(paymentId, confirmBy) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const mutation = mutations_1.CONFIRM_PAID_MANUAL;
|
|
85
|
+
const variables = {
|
|
86
|
+
paymentId,
|
|
87
|
+
confirmBy,
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
const response = yield this.graphqlMutationCustomHeader(mutation, variables);
|
|
91
|
+
return response.confirmPaidManual;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.log(`Error fetching get confirmPaidManual method: ${error}`);
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
getPaymentMethodTypes(store) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const query = queries_1.GET_PAYMENT_METHOD_TYPES;
|
|
102
|
+
const variables = {
|
|
103
|
+
partnerId: this.orgId,
|
|
104
|
+
storeId: store ? store : this.storeId,
|
|
105
|
+
};
|
|
106
|
+
try {
|
|
107
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
|
108
|
+
return response.getPaymentMethodTypes;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
console.log(`Error fetching get getPaymentMethodTypes method: ${error}`);
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
paymentMethods() {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
const query = queries_1.PAYMENT_METHODS;
|
|
119
|
+
const variables = {
|
|
120
|
+
partnerCode: this.orgId,
|
|
121
|
+
};
|
|
122
|
+
try {
|
|
123
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
|
124
|
+
return response.paymentMethods;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
console.log(`Error fetching get paymentMethods method: ${error}`);
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
paymentStatus(paymentId) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
const query = queries_1.PAYMENT_STATUS;
|
|
135
|
+
const variables = {
|
|
136
|
+
paymentId,
|
|
137
|
+
};
|
|
138
|
+
try {
|
|
139
|
+
const response = yield this.graphqlQueryCustomHeader(query, variables);
|
|
140
|
+
return response.paymentStatus;
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
console.log(`Error fetching get paymentStatus method: ${error}`);
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.PaymentLVService = PaymentLVService;
|
|
@@ -92,4 +92,5 @@ export declare class ProductService extends Service {
|
|
|
92
92
|
getProductMarketplaceDetailBySlug(storeChannel: string, slug: string): Promise<any>;
|
|
93
93
|
getProductMarketplaceDetailById(storeChannel: string, id: string): Promise<any>;
|
|
94
94
|
getProductMarketplaceBySupplier(dataQuery: any): Promise<any>;
|
|
95
|
+
getProductSimpleByHandle(handle: string, store: string, fields: string[]): Promise<any>;
|
|
95
96
|
}
|
|
@@ -1074,5 +1074,23 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
|
+
getProductSimpleByHandle(handle, store, fields) {
|
|
1078
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1079
|
+
const query = (0, queries_1.GET_PRODUCT_SIMPLE_BY_HANDLE_DYNAMIC)(fields);
|
|
1080
|
+
const variablesHandle = {
|
|
1081
|
+
partnerId: this.orgId,
|
|
1082
|
+
storeChannel: store ? store : this.storeId,
|
|
1083
|
+
handle,
|
|
1084
|
+
};
|
|
1085
|
+
try {
|
|
1086
|
+
const response = yield this.graphqlQuery(query, variablesHandle);
|
|
1087
|
+
return response.getProductSimpleByHandle;
|
|
1088
|
+
}
|
|
1089
|
+
catch (error) {
|
|
1090
|
+
console.log(`Error fetching getProductSimpleByHandle : ${error}`);
|
|
1091
|
+
throw error;
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1077
1095
|
}
|
|
1078
1096
|
exports.ProductService = ProductService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Service } from "../serviceSDK";
|
|
2
|
+
export declare class QuicklabService extends Service {
|
|
3
|
+
constructor(endpoint: string, orgId: string, storeId: string);
|
|
4
|
+
setToken(token: string): void;
|
|
5
|
+
setStoreId(storeId: string): void;
|
|
6
|
+
getTemplatesByArticleId(articleId: string): Promise<any>;
|
|
7
|
+
getTypeLabSessions(): Promise<any>;
|
|
8
|
+
getLabSessionsByUserId(userId: string): Promise<any>;
|
|
9
|
+
getLabSessionsByUserIdAndArticleId(userId: string, articleId: string): Promise<any>;
|
|
10
|
+
createLabSessionByTemplateId(templateId: string, userId: string, articleId: string, typeLabSessionCode: string): Promise<any>;
|
|
11
|
+
createLabSessionByLabSessionId(labSessionId: string, userId: string, articleId: string): Promise<any>;
|
|
12
|
+
createLabSessionByComputingId(computingId: string, userId: string, articleId: string): Promise<any>;
|
|
13
|
+
updateEndTimeLabSession(labSessionId: string, userId: string): Promise<any>;
|
|
14
|
+
stopLabSession(labSessionId: string, userId: string, note: string): Promise<any>;
|
|
15
|
+
updateTypeLabSession(labSessionId: string, typeLabSessionCode: string, userId: string): Promise<any>;
|
|
16
|
+
getLabSessionsChillByParent(labSessionId: string, userId: string): Promise<any>;
|
|
17
|
+
stopLabSessionForCustomer(labSessionId: string, userId: string, note: string): Promise<any>;
|
|
18
|
+
getLabDoingAndDoneByUserId(userId: string, fields: string[]): Promise<any>;
|
|
19
|
+
}
|