@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.
Files changed (75) hide show
  1. package/dist/config/config.js +11 -11
  2. package/dist/src/graphql/accounting_service/mutations.d.ts +2 -0
  3. package/dist/src/graphql/accounting_service/mutations.js +100 -0
  4. package/dist/src/graphql/accounting_service/queries.d.ts +1 -0
  5. package/dist/src/graphql/accounting_service/queries.js +62 -0
  6. package/dist/src/graphql/content_api/queries.d.ts +2 -0
  7. package/dist/src/graphql/content_api/queries.js +23 -0
  8. package/dist/src/graphql/crm_camping/mutations.d.ts +1 -0
  9. package/dist/src/graphql/crm_camping/mutations.js +37 -0
  10. package/dist/src/graphql/crm_camping/queries.d.ts +14 -0
  11. package/dist/src/graphql/crm_camping/queries.js +420 -0
  12. package/dist/src/graphql/orderGraphQL/mutations.d.ts +10 -0
  13. package/dist/src/graphql/orderGraphQL/mutations.js +410 -0
  14. package/dist/src/graphql/orderGraphQL/queries.d.ts +10 -0
  15. package/dist/src/graphql/orderGraphQL/queries.js +480 -0
  16. package/dist/src/graphql/paymentLV/mutations.d.ts +2 -0
  17. package/dist/src/graphql/paymentLV/mutations.js +31 -0
  18. package/dist/src/graphql/paymentLV/queries.d.ts +5 -0
  19. package/dist/src/graphql/paymentLV/queries.js +135 -0
  20. package/dist/src/graphql/product/queries.d.ts +31 -26
  21. package/dist/src/graphql/product/queries.js +420 -18
  22. package/dist/src/graphql/quicklab_service/mutations.d.ts +8 -0
  23. package/dist/src/graphql/quicklab_service/mutations.js +171 -0
  24. package/dist/src/graphql/quicklab_service/queries.d.ts +7 -0
  25. package/dist/src/graphql/quicklab_service/queries.js +131 -0
  26. package/dist/src/graphql/remote_access_service/mutations.d.ts +7 -0
  27. package/dist/src/graphql/remote_access_service/mutations.js +89 -0
  28. package/dist/src/graphql/remote_access_service/queries.d.ts +2 -0
  29. package/dist/src/graphql/remote_access_service/queries.js +34 -0
  30. package/dist/src/graphql/resource_permission/mutations.d.ts +2 -0
  31. package/dist/src/graphql/resource_permission/mutations.js +65 -0
  32. package/dist/src/graphql/resource_permission/queries.d.ts +1 -0
  33. package/dist/src/graphql/resource_permission/queries.js +18 -0
  34. package/dist/src/graphql/storage_s3/mutations.d.ts +27 -0
  35. package/dist/src/graphql/storage_s3/mutations.js +603 -0
  36. package/dist/src/graphql/storage_s3/queries.d.ts +12 -0
  37. package/dist/src/graphql/storage_s3/queries.js +129 -0
  38. package/dist/src/lib/accounting_service/index.d.ts +9 -0
  39. package/dist/src/lib/accounting_service/index.js +69 -0
  40. package/dist/src/lib/cloud_rest/index.d.ts +17 -0
  41. package/dist/src/lib/cloud_rest/index.js +101 -0
  42. package/dist/src/lib/content_api/index.d.ts +7 -0
  43. package/dist/src/lib/content_api/index.js +43 -0
  44. package/dist/src/lib/crm_camping/index.d.ts +21 -0
  45. package/dist/src/lib/crm_camping/index.js +302 -0
  46. package/dist/src/lib/dns/index.d.ts +7 -0
  47. package/dist/src/lib/{cloudService → dns}/index.js +16 -11
  48. package/dist/src/lib/orderGraphQL/index.d.ts +24 -0
  49. package/dist/src/lib/orderGraphQL/index.js +342 -0
  50. package/dist/src/lib/order_cloud_rest/index.d.ts +7 -0
  51. package/dist/src/lib/order_cloud_rest/index.js +39 -0
  52. package/dist/src/lib/paymentLV/index.d.ts +13 -0
  53. package/dist/src/lib/paymentLV/index.js +149 -0
  54. package/dist/src/lib/product/index.d.ts +4 -0
  55. package/dist/src/lib/product/index.js +63 -0
  56. package/dist/src/lib/quicklab_service/index.d.ts +19 -0
  57. package/dist/src/lib/quicklab_service/index.js +211 -0
  58. package/dist/src/lib/remote_access_service/index.d.ts +16 -0
  59. package/dist/src/lib/remote_access_service/index.js +181 -0
  60. package/dist/src/lib/resource_permission/index.d.ts +9 -0
  61. package/dist/src/lib/resource_permission/index.js +82 -0
  62. package/dist/src/lib/service.d.ts +14 -0
  63. package/dist/src/lib/service.js +101 -0
  64. package/dist/src/lib/storage_s3/index.d.ts +42 -0
  65. package/dist/src/lib/storage_s3/index.js +736 -0
  66. package/dist/src/types/remote_access_service.d.ts +12 -0
  67. package/dist/src/types/remote_access_service.js +2 -0
  68. package/dist/src/types/storage_s3.d.ts +10 -0
  69. package/dist/src/types/storage_s3.js +2 -0
  70. package/dist/src/utils/build-field-string.d.ts +1 -0
  71. package/dist/src/utils/build-field-string.js +16 -0
  72. package/package.json +3 -2
  73. package/dist/src/graphql/cloudService/queries.d.ts +0 -1
  74. package/dist/src/graphql/cloudService/queries.js +0 -71
  75. package/dist/src/lib/cloudService/index.d.ts +0 -5
@@ -0,0 +1,302 @@
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.CrmCampingService = void 0;
13
+ const mutations_1 = require("../../graphql/crm_camping/mutations");
14
+ const queries_1 = require("../../graphql/crm_camping/queries");
15
+ const serviceSDK_1 = require("../serviceSDK");
16
+ class CrmCampingService 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
+ searchProductQuantityPromotionAction(productId) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ const query = queries_1.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION;
29
+ const variables = {
30
+ productId,
31
+ partyId: this.orgId,
32
+ storeChannel: this.storeId,
33
+ };
34
+ try {
35
+ const response = yield this.graphqlQueryV2(query, variables);
36
+ return response.searchProductQuantityPromotionAction;
37
+ }
38
+ catch (error) {
39
+ console.log(`Error in searchProductQuantityPromotionAction: ${error}`);
40
+ throw error;
41
+ }
42
+ });
43
+ }
44
+ addCustomerToVoucher(userId, voucherCode) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const mutation = mutations_1.ADD_CUSTOMER_TO_VOUCHER;
47
+ const variables = {
48
+ partyId: this.orgId,
49
+ userId,
50
+ voucherCode,
51
+ };
52
+ try {
53
+ const response = yield this.graphqlMutationV2(mutation, variables);
54
+ return response.addCustomerToVoucher;
55
+ }
56
+ catch (error) {
57
+ console.log(`Error in addCustomerToVoucher: ${error}`);
58
+ throw error;
59
+ }
60
+ });
61
+ }
62
+ getCampaignActionById(campaignActionId) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const query = queries_1.GET_CAMPAIGN_ACTION_BY_ID;
65
+ const variables = { id: campaignActionId };
66
+ try {
67
+ const response = yield this.graphqlQueryV2(query, variables);
68
+ return response.getCampaignActionById;
69
+ }
70
+ catch (error) {
71
+ console.log(`Error in getCampaignActionById: ${error}`);
72
+ throw error;
73
+ }
74
+ });
75
+ }
76
+ getProductDiscountBuyWithDynamic(productId, fields) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ const query = (0, queries_1.GET_PRODUCT_DISCOUNT_BUY_WITH_DYNAMIC)(fields);
79
+ const variables = {
80
+ partnerId: this.orgId,
81
+ storeId: this.storeId,
82
+ productId,
83
+ };
84
+ try {
85
+ const response = yield this.graphqlQueryV2(query, variables);
86
+ return response.getProductDiscountBuyWith;
87
+ }
88
+ catch (error) {
89
+ console.log(`Error in getProductDiscountBuyWithDynamic: ${error}`);
90
+ throw error;
91
+ }
92
+ });
93
+ }
94
+ suggestVoucher(customerId, scopeIgnore, scope, isNewCustomer, voucherCode) {
95
+ return __awaiter(this, void 0, void 0, function* () {
96
+ const query = queries_1.SUGGEST_VOUCHER;
97
+ const variables = {
98
+ searchVoucherRequest: {
99
+ partyId: this.orgId,
100
+ excludeExpired: true,
101
+ customerId,
102
+ scope,
103
+ isNewCustomer,
104
+ scopeIgnore,
105
+ isPageAble: false,
106
+ voucherCode
107
+ },
108
+ };
109
+ try {
110
+ const response = yield this.graphqlQueryV2(query, variables);
111
+ return response.suggestVoucher;
112
+ }
113
+ catch (error) {
114
+ throw error;
115
+ }
116
+ });
117
+ }
118
+ searchVouchers(campaignId, campaignActionId, campaignActionType, customerId, pageNumber, pageSize) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ const query = queries_1.GET_VOUCHERS;
121
+ const variables = {
122
+ partyId: this.orgId,
123
+ campaignId,
124
+ campaignActionId,
125
+ campaignActionType,
126
+ customerId,
127
+ pageNumber,
128
+ pageSize,
129
+ };
130
+ try {
131
+ const response = yield this.graphqlQuery(query, variables);
132
+ return response.searchVoucher;
133
+ }
134
+ catch (error) {
135
+ console.log(`Error fetching searchVoucher: ${error}`);
136
+ throw error;
137
+ }
138
+ });
139
+ }
140
+ getAverageRating(targetIds, customerId, evaluationType) {
141
+ return __awaiter(this, void 0, void 0, function* () {
142
+ const query = queries_1.GET_AVERAGE_RATING;
143
+ const variables = {
144
+ targetIds,
145
+ customerId,
146
+ evaluationType,
147
+ orgId: this.orgId,
148
+ };
149
+ try {
150
+ const response = yield this.graphqlQueryV2(query, variables);
151
+ return response.getAverageRating;
152
+ }
153
+ catch (error) {
154
+ console.log(`Error in getAverageRating: ${error}`);
155
+ throw error;
156
+ }
157
+ });
158
+ }
159
+ getUrlEvaluation(targetIds, customerId, evaluationType) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const query = queries_1.GET_URL_EVALUATION;
162
+ const variables = {
163
+ targetIds,
164
+ customerId,
165
+ evaluationType,
166
+ orgId: this.orgId,
167
+ };
168
+ try {
169
+ const response = yield this.graphqlQueryV2(query, variables);
170
+ return response.getUrlEvaluation;
171
+ }
172
+ catch (error) {
173
+ console.log(`Error in getUrlEvaluation: ${error}`);
174
+ throw error;
175
+ }
176
+ });
177
+ }
178
+ getNumberOfTicketEvaluation(customerId) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ const query = queries_1.GET_NUMBER_OF_TICKET_EVALUATION;
181
+ const variables = {
182
+ customerId,
183
+ orgId: this.orgId,
184
+ };
185
+ try {
186
+ const response = yield this.graphqlQueryV2(query, variables);
187
+ return response.getNumberOfTicketEvaluation;
188
+ }
189
+ catch (error) {
190
+ console.log(`Error in getNumberOfTicketEvaluation: ${error}`);
191
+ throw error;
192
+ }
193
+ });
194
+ }
195
+ searchProductGiftPromotionResponse(parameterSearchProductGift) {
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ // console.log("🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ parameterSearchProductGift:", parameterSearchProductGift)
198
+ const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
199
+ const variables = {
200
+ parameterSearchProductGift: Object.assign({ partyId: this.orgId }, parameterSearchProductGift),
201
+ };
202
+ // console.log(
203
+ // "🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ variables:",
204
+ // variables
205
+ // );
206
+ try {
207
+ const response = yield this.graphqlQueryV2(query, variables);
208
+ return response.searchProductGiftPromotionResponse;
209
+ }
210
+ catch (error) {
211
+ throw error;
212
+ }
213
+ });
214
+ }
215
+ addProductGiftPromotion(orderId, updatedBy, addData) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/orderLineItem?updated_by=${updatedBy}`;
218
+ const method = "POST";
219
+ const data = addData;
220
+ console.log("data in add sdk", data);
221
+ try {
222
+ const response = yield this.restApiCallWithToken(endpoint, method, data);
223
+ console.log(response);
224
+ return response;
225
+ }
226
+ catch (error) {
227
+ console.log(`Error in addProductGiftPromotion: ${error}`);
228
+ throw error;
229
+ }
230
+ });
231
+ }
232
+ searchVouchersV2(searchVoucherRequest) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ const query = queries_1.GET_VOUCHERS_V2;
235
+ const variables = {
236
+ searchVoucherRequest: Object.assign({ partyId: this.orgId }, searchVoucherRequest),
237
+ };
238
+ try {
239
+ const response = yield this.graphqlQuery(query, variables);
240
+ return response.searchVoucher;
241
+ }
242
+ catch (error) {
243
+ console.log(`Error fetching searchVoucher: ${error}`);
244
+ throw error;
245
+ }
246
+ });
247
+ }
248
+ searchCampaign(searchCampaignRequest) {
249
+ return __awaiter(this, void 0, void 0, function* () {
250
+ const query = queries_1.SEARCH_CAMPAIGN;
251
+ const variables = {
252
+ searchCampaignRequest: Object.assign({ partyId: this.orgId }, searchCampaignRequest),
253
+ };
254
+ try {
255
+ const response = yield this.graphqlQuery(query, variables);
256
+ return response.searchCampaign;
257
+ }
258
+ catch (error) {
259
+ console.log(`Error fetching searchCampaign: ${error}`);
260
+ throw error;
261
+ }
262
+ });
263
+ }
264
+ getConditionByOrgIdCampaignActionIds(campaignActionIds) {
265
+ return __awaiter(this, void 0, void 0, function* () {
266
+ const query = queries_1.GET_CONDITION_BY_ORGID_CAMPAIGN_ACTIONIDS;
267
+ const variables = {
268
+ orgId: this.orgId,
269
+ campaignActionIds,
270
+ };
271
+ try {
272
+ const response = yield this.graphqlQuery(query, variables);
273
+ return response.getConditionByOrgIdCampaignActionIds;
274
+ }
275
+ catch (error) {
276
+ console.log(`Error fetching getConditionByOrgIdCampaignActionIds: ${error}`);
277
+ throw error;
278
+ }
279
+ });
280
+ }
281
+ getVouchersForUser(orderId, customerId, fields) {
282
+ return __awaiter(this, void 0, void 0, function* () {
283
+ const query = (0, queries_1.GET_VOUCHERS_FOR_USER)(fields);
284
+ const variables = {
285
+ voucherForUserRequest: {
286
+ orderId: orderId,
287
+ customerId: customerId,
288
+ storeId: this.storeId,
289
+ }
290
+ };
291
+ try {
292
+ const response = yield this.graphqlQuery(query, variables);
293
+ return response.getVouchersForUser;
294
+ }
295
+ catch (error) {
296
+ console.log(`Error fetching getVouchersForUser: ${error}`);
297
+ throw error;
298
+ }
299
+ });
300
+ }
301
+ }
302
+ exports.CrmCampingService = CrmCampingService;
@@ -0,0 +1,7 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class DnsService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ setToken(token: string): void;
5
+ setStoreId(storeId: string): void;
6
+ getDomain(params: any): Promise<any>;
7
+ }
@@ -9,27 +9,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CloudServiceService = void 0;
12
+ exports.DnsService = void 0;
13
13
  const serviceSDK_1 = require("../serviceSDK");
14
- const queries_1 = require("../../graphql/cloudService/queries");
15
- class CloudServiceService extends serviceSDK_1.Service {
14
+ class DnsService extends serviceSDK_1.Service {
16
15
  constructor(endpoint, orgId, storeId) {
17
16
  super(endpoint, orgId, storeId);
18
17
  }
19
- searchService(data) {
18
+ setToken(token) {
19
+ this.token = token;
20
+ }
21
+ setStoreId(storeId) {
22
+ this.storeId = storeId;
23
+ }
24
+ getDomain(params) {
20
25
  return __awaiter(this, void 0, void 0, function* () {
21
- const query = queries_1.SEARCH_SERVICE;
22
- const variables = {
23
- filter: data,
24
- };
26
+ console.log("🚀 ~ DnsService ~ getDomain ~ params:", params);
27
+ const endpoint = `/domain`;
28
+ const method = "POST";
25
29
  try {
26
- const response = yield this.graphqlQueryV4(query, variables);
27
- return response.searchService;
30
+ const response = yield this.restApiCallWithToken(endpoint, method, params);
31
+ return response;
28
32
  }
29
33
  catch (error) {
34
+ console.log(`Error in addVoucher: ${error}`);
30
35
  throw error;
31
36
  }
32
37
  });
33
38
  }
34
39
  }
35
- exports.CloudServiceService = CloudServiceService;
40
+ exports.DnsService = DnsService;
@@ -0,0 +1,24 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class OrderGraphQLService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ setToken(token: string): void;
5
+ setStoreId(storeId: string): void;
6
+ createOrder(input: any): Promise<any>;
7
+ getOrderDetail(orderId: string): Promise<any>;
8
+ getOrderDetailDynamic(orderId: string, fields: string[]): Promise<any>;
9
+ getQuantityOrderLineItems(orderId: string): Promise<any>;
10
+ updateQuantityV2(payload: any): Promise<any>;
11
+ getOrderLineItemByServiceId(serviceId: string): Promise<any>;
12
+ getOrderByServiceId(serviceId: string): Promise<any>;
13
+ addToCart(serviceId: string, actorId: string, cartId: string): Promise<any>;
14
+ removeProductOptionOrderLineItem(orderLineItemId: string, optionId: string, updateBy: string): Promise<any>;
15
+ findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
16
+ calcExchangePriceExtendResourceDetail(serviceId: string, productBaseIdNew: string, durationQuantity: string, durationUnit: string, fields: string[]): Promise<any>;
17
+ searchOrderDynamic(params: any, fields: string[]): Promise<any>;
18
+ addItemIntoOrderByProductJsonResource(serviceId: string, orderId: string, itemInput: any, durationQuantity: number, durationUnit: string, actorId: string, fields: string[]): Promise<any>;
19
+ updateOrderLineItemParentId(orderLineItemChildIds: string[], orderLineItemParentId: string, updateBy: string): Promise<any>;
20
+ updateProductOptionOrderLineItem(orderLineItemId: string, productOptionUpdate: any, updateBy: string): Promise<any>;
21
+ calculateResourceChangePrice(productIds: string[], quantity: string, unit: string, storeId: string, fields: string[], serviceId: string): Promise<any>;
22
+ applyReferralCode(input: any): Promise<any>;
23
+ removeReferralCode(input: any): Promise<any>;
24
+ }