@longvansoftware/storefront-js-client 3.4.6 → 3.4.8

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 (49) hide show
  1. package/dist/config/config.js +2 -2
  2. package/dist/src/graphql/accounting_service/mutations.d.ts +2 -0
  3. package/dist/src/graphql/accounting_service/mutations.js +102 -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/auth/mutations.d.ts +3 -0
  7. package/dist/src/graphql/auth/mutations.js +41 -3
  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 +8 -0
  11. package/dist/src/graphql/crm_camping/queries.js +279 -0
  12. package/dist/src/graphql/orderGraphQL/mutations.d.ts +4 -0
  13. package/dist/src/graphql/orderGraphQL/mutations.js +359 -0
  14. package/dist/src/graphql/orderGraphQL/queries.d.ts +7 -0
  15. package/dist/src/graphql/orderGraphQL/queries.js +402 -0
  16. package/dist/src/graphql/paymentLV/mutations.d.ts +2 -0
  17. package/dist/src/graphql/paymentLV/mutations.js +25 -0
  18. package/dist/src/graphql/paymentLV/queries.d.ts +4 -0
  19. package/dist/src/graphql/paymentLV/queries.js +83 -0
  20. package/dist/src/graphql/quicklab_service/mutations.d.ts +8 -0
  21. package/dist/src/graphql/quicklab_service/mutations.js +171 -0
  22. package/dist/src/graphql/quicklab_service/queries.d.ts +6 -0
  23. package/dist/src/graphql/quicklab_service/queries.js +121 -0
  24. package/dist/src/graphql/resource_permission/mutations.d.ts +2 -0
  25. package/dist/src/graphql/resource_permission/mutations.js +63 -0
  26. package/dist/src/graphql/resource_permission/queries.d.ts +1 -0
  27. package/dist/src/graphql/resource_permission/queries.js +18 -0
  28. package/dist/src/lib/accounting_service/index.d.ts +9 -0
  29. package/dist/src/lib/accounting_service/index.js +69 -0
  30. package/dist/src/lib/auth/index.d.ts +7 -3
  31. package/dist/src/lib/auth/index.js +68 -3
  32. package/dist/src/lib/cloud_rest/index.d.ts +17 -0
  33. package/dist/src/lib/cloud_rest/index.js +101 -0
  34. package/dist/src/lib/crm_camping/index.d.ts +16 -0
  35. package/dist/src/lib/crm_camping/index.js +227 -0
  36. package/dist/src/lib/dns/index.d.ts +7 -0
  37. package/dist/src/lib/dns/index.js +40 -0
  38. package/dist/src/lib/fileService/index.js +2 -2
  39. package/dist/src/lib/orderGraphQL/index.d.ts +16 -0
  40. package/dist/src/lib/orderGraphQL/index.js +192 -0
  41. package/dist/src/lib/order_cloud_rest/index.d.ts +7 -0
  42. package/dist/src/lib/order_cloud_rest/index.js +39 -0
  43. package/dist/src/lib/paymentLV/index.d.ts +12 -0
  44. package/dist/src/lib/paymentLV/index.js +132 -0
  45. package/dist/src/lib/quicklab_service/index.d.ts +18 -0
  46. package/dist/src/lib/quicklab_service/index.js +197 -0
  47. package/dist/src/lib/resource_permission/index.d.ts +9 -0
  48. package/dist/src/lib/resource_permission/index.js +81 -0
  49. package/package.json +1 -1
@@ -0,0 +1,227 @@
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
+ // async suggestVoucher(customerId: String){
77
+ // const query = SUGGEST_VOUCHER;
78
+ // const variables = {
79
+ // partyId: this.orgId,
80
+ // customerId
81
+ // };
82
+ // console.log("🚀 Query:", SUGGEST_VOUCHER);
83
+ // console.log("🚀 Variables:", { partyId: this.orgId, customerId });
84
+ // try {
85
+ // const response = await this.graphqlQueryV2(query, variables);
86
+ // return response.suggestVoucher;
87
+ // } catch (error) {
88
+ // console.log(`Error in suggestVoucher: ${error}`);
89
+ // throw error;
90
+ // }
91
+ // }
92
+ suggestVoucher(customerId, scopeIgnore, scope, isNewCustomer) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ const query = queries_1.SUGGEST_VOUCHER;
95
+ const variables = {
96
+ partyId: this.orgId,
97
+ excludeExpired: true,
98
+ customerId,
99
+ scope,
100
+ isNewCustomer,
101
+ scopeIgnore,
102
+ };
103
+ try {
104
+ const response = yield this.graphqlQueryV2(query, variables);
105
+ return response.suggestVoucher;
106
+ }
107
+ catch (error) {
108
+ throw error;
109
+ }
110
+ });
111
+ }
112
+ searchVouchers(campaignId, campaignActionId, campaignActionType, customerId, pageNumber, pageSize) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ const query = queries_1.GET_VOUCHERS;
115
+ const variables = {
116
+ partyId: this.orgId,
117
+ campaignId,
118
+ campaignActionId,
119
+ campaignActionType,
120
+ customerId,
121
+ pageNumber,
122
+ pageSize,
123
+ };
124
+ try {
125
+ const response = yield this.graphqlQuery(query, variables);
126
+ return response.searchVoucher;
127
+ }
128
+ catch (error) {
129
+ console.log(`Error fetching searchVoucher: ${error}`);
130
+ throw error;
131
+ }
132
+ });
133
+ }
134
+ getAverageRating(targetIds, customerId, evaluationType) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const query = queries_1.GET_AVERAGE_RATING;
137
+ const variables = {
138
+ targetIds,
139
+ customerId,
140
+ evaluationType,
141
+ orgId: this.orgId,
142
+ };
143
+ try {
144
+ const response = yield this.graphqlQueryV2(query, variables);
145
+ return response.getAverageRating;
146
+ }
147
+ catch (error) {
148
+ console.log(`Error in getAverageRating: ${error}`);
149
+ throw error;
150
+ }
151
+ });
152
+ }
153
+ getUrlEvaluation(targetIds, customerId, evaluationType) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const query = queries_1.GET_URL_EVALUATION;
156
+ const variables = {
157
+ targetIds,
158
+ customerId,
159
+ evaluationType,
160
+ orgId: this.orgId,
161
+ };
162
+ try {
163
+ const response = yield this.graphqlQueryV2(query, variables);
164
+ return response.getUrlEvaluation;
165
+ }
166
+ catch (error) {
167
+ console.log(`Error in getUrlEvaluation: ${error}`);
168
+ throw error;
169
+ }
170
+ });
171
+ }
172
+ getNumberOfTicketEvaluation(customerId) {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ const query = queries_1.GET_NUMBER_OF_TICKET_EVALUATION;
175
+ const variables = {
176
+ customerId,
177
+ orgId: this.orgId,
178
+ };
179
+ try {
180
+ const response = yield this.graphqlQueryV2(query, variables);
181
+ return response.getNumberOfTicketEvaluation;
182
+ }
183
+ catch (error) {
184
+ console.log(`Error in getNumberOfTicketEvaluation: ${error}`);
185
+ throw error;
186
+ }
187
+ });
188
+ }
189
+ searchProductGiftPromotionResponse(parameterSearchProductGift) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ // console.log("🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ parameterSearchProductGift:", parameterSearchProductGift)
192
+ const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
193
+ const variables = {
194
+ parameterSearchProductGift: Object.assign({ partyId: this.orgId }, parameterSearchProductGift),
195
+ };
196
+ // console.log(
197
+ // "🚀 ~ CrmCampingService ~ searchProductGiftPromotionResponse ~ variables:",
198
+ // variables
199
+ // );
200
+ try {
201
+ const response = yield this.graphqlQueryV2(query, variables);
202
+ return response.searchProductGiftPromotionResponse;
203
+ }
204
+ catch (error) {
205
+ throw error;
206
+ }
207
+ });
208
+ }
209
+ addProductGiftPromotion(orderId, updatedBy, addData) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/orderLineItem?updated_by=${updatedBy}`;
212
+ const method = "POST";
213
+ const data = addData;
214
+ console.log("data in add sdk", data);
215
+ try {
216
+ const response = yield this.restApiCallWithToken(endpoint, method, data);
217
+ console.log(response);
218
+ return response;
219
+ }
220
+ catch (error) {
221
+ console.log(`Error in addProductGiftPromotion: ${error}`);
222
+ throw error;
223
+ }
224
+ });
225
+ }
226
+ }
227
+ 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
+ }
@@ -0,0 +1,40 @@
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.DnsService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ class DnsService 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
+ getDomain(params) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ console.log("🚀 ~ DnsService ~ getDomain ~ params:", params);
27
+ const endpoint = `/domain`;
28
+ const method = "POST";
29
+ try {
30
+ const response = yield this.restApiCallWithToken(endpoint, method, params);
31
+ return response;
32
+ }
33
+ catch (error) {
34
+ console.log(`Error in addVoucher: ${error}`);
35
+ throw error;
36
+ }
37
+ });
38
+ }
39
+ }
40
+ exports.DnsService = DnsService;
@@ -25,7 +25,7 @@ class FileServiceSerVice extends serviceSDK_1.Service {
25
25
  */
26
26
  uploadFile(uploadFile, path, parentId, parentType) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- const endpoint = `/omnichannel/files/upload`;
28
+ const endpoint = `/files/upload`;
29
29
  const method = "POST";
30
30
  try {
31
31
  const formData = new FormData();
@@ -65,7 +65,7 @@ class FileServiceSerVice extends serviceSDK_1.Service {
65
65
  }
66
66
  getImage(parentId, parenttype) {
67
67
  return __awaiter(this, void 0, void 0, function* () {
68
- const endpoint = `/omnichannel/files/gets/${parentId}/${parenttype}`;
68
+ const endpoint = `/files/gets/${parentId}/${parenttype}`;
69
69
  const method = "GET";
70
70
  try {
71
71
  const response = yield this.restApiCallWithNoHeader(endpoint, method);
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,192 @@
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
+ }
192
+ 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,12 @@
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
+ }