@esolve/ng-esolve-connect 0.8.0 → 0.9.0
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/esm2020/lib/account/esolve-account.service.mjs +81 -1
- package/esm2020/lib/account/esolve-change-password-result.mjs +8 -0
- package/esm2020/lib/account/esolve-forgot-password-response.mjs +2 -0
- package/esm2020/lib/account/esolve-reset-password-result.mjs +11 -0
- package/esm2020/lib/payment/esolve-payment.service.mjs +21 -1
- package/esm2020/lib/shared/error-handler/esolve-error-handler.service.mjs +56 -25
- package/esm2020/lib/shared/esolve-response.mjs +1 -1
- package/esm2020/lib/shared/esolve-result.mjs +8 -0
- package/esm2020/public-api.mjs +4 -1
- package/fesm2015/esolve-ng-esolve-connect.mjs +178 -25
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +178 -25
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/account/esolve-account.service.d.ts +10 -3
- package/lib/account/esolve-change-password-result.d.ts +6 -0
- package/lib/account/esolve-forgot-password-response.d.ts +7 -0
- package/lib/account/esolve-reset-password-result.d.ts +9 -0
- package/lib/payment/esolve-payment.service.d.ts +2 -0
- package/lib/shared/error-handler/esolve-error-handler.service.d.ts +7 -2
- package/lib/shared/esolve-response.d.ts +15 -9
- package/lib/shared/esolve-result.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
package/esm2020/public-api.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './lib/ng-esolve-connect.module';
|
|
5
5
|
export * from './lib/shared/esolve-response';
|
|
6
|
+
export * from './lib/shared/esolve-result';
|
|
6
7
|
export * from './lib/shared/error-handler/esolve-http-error';
|
|
7
8
|
export * from './lib/shared/error-handler/esolve-error-handler.service';
|
|
8
9
|
export * from './lib/shared/response-handler/esolve-response-result';
|
|
@@ -24,6 +25,8 @@ export * from './lib/account/esolve-user-account-data';
|
|
|
24
25
|
export * from './lib/account/esolve-user-account-result';
|
|
25
26
|
export * from './lib/account/esolve-registration-data';
|
|
26
27
|
export * from './lib/account/esolve-registration-result';
|
|
28
|
+
export * from './lib/account/esolve-change-password-result';
|
|
29
|
+
export * from './lib/account/esolve-reset-password-result';
|
|
27
30
|
export * from './lib/account/esolve-account.service';
|
|
28
31
|
// Media
|
|
29
32
|
export * from './lib/media/esolve-media-article';
|
|
@@ -81,4 +84,4 @@ export * from './lib/shipping/esolve-shipping.service';
|
|
|
81
84
|
// Locations
|
|
82
85
|
export * from './lib/locations/esolve-stock-location';
|
|
83
86
|
export * from './lib/locations/esolve-locations.service';
|
|
84
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25nLWVzb2x2ZS1jb25uZWN0L3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxnQ0FBZ0MsQ0FBQztBQUcvQyxjQUFjLDhCQUE4QixDQUFDO0FBQzdDLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYyw4Q0FBOEMsQ0FBQztBQUM3RCxjQUFjLHlEQUF5RCxDQUFDO0FBQ3hFLGNBQWMsc0RBQXNELENBQUM7QUFDckUsY0FBYywrREFBK0QsQ0FBQztBQUU5RSxNQUFNO0FBQ04sY0FBYyxrQ0FBa0MsQ0FBQztBQUNqRCxjQUFjLHFDQUFxQyxDQUFDO0FBRXBELFVBQVU7QUFDVixjQUFjLDhCQUE4QixDQUFDO0FBQzdDLGNBQWMsc0NBQXNDLENBQUM7QUFFckQsT0FBTztBQUNQLGNBQWMsZ0NBQWdDLENBQUM7QUF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Rpb25zL2Vzb2x2ZS1sb2NhdGlvbnMuc2VydmljZSc7XHJcbiJdfQ==
|
|
@@ -199,6 +199,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImpor
|
|
|
199
199
|
}]
|
|
200
200
|
}] });
|
|
201
201
|
|
|
202
|
+
class EsolveResult {
|
|
203
|
+
constructor(status, code, message) {
|
|
204
|
+
this.status = status;
|
|
205
|
+
this.code = code;
|
|
206
|
+
this.message = message;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
202
210
|
class EsolveHttpError {
|
|
203
211
|
constructor(type, message, error_code) {
|
|
204
212
|
this.type = type;
|
|
@@ -209,11 +217,62 @@ class EsolveHttpError {
|
|
|
209
217
|
|
|
210
218
|
class EsolveErrorHandlerService {
|
|
211
219
|
constructor() { }
|
|
220
|
+
handleHttpPostError(service_type, errorRes) {
|
|
221
|
+
if (!(errorRes instanceof HttpErrorResponse) &&
|
|
222
|
+
!('service_type' in errorRes) &&
|
|
223
|
+
(('id' in errorRes) &&
|
|
224
|
+
('esolve_id' in errorRes) &&
|
|
225
|
+
('transaction_type' in errorRes) &&
|
|
226
|
+
('status' in errorRes) &&
|
|
227
|
+
('log' in errorRes))) {
|
|
228
|
+
return throwError(this.parsePostErrors(errorRes));
|
|
229
|
+
}
|
|
230
|
+
return this.handleHttpError(service_type, errorRes);
|
|
231
|
+
}
|
|
232
|
+
handleHttpDeleteError(service_type, errorRes) {
|
|
233
|
+
const is_not_base = (!(errorRes instanceof HttpErrorResponse) &&
|
|
234
|
+
!('service_type' in errorRes) &&
|
|
235
|
+
(('id' in errorRes) &&
|
|
236
|
+
('status' in errorRes) &&
|
|
237
|
+
('message' in errorRes) &&
|
|
238
|
+
('code' in errorRes)));
|
|
239
|
+
if (is_not_base) {
|
|
240
|
+
return throwError(this.parseDeleteError(errorRes));
|
|
241
|
+
}
|
|
242
|
+
return this.handleHttpError(service_type, errorRes);
|
|
243
|
+
}
|
|
244
|
+
handleHttpError(service_type, errorRes) {
|
|
245
|
+
if (errorRes instanceof HttpErrorResponse) {
|
|
246
|
+
if (errorRes.status === 500) {
|
|
247
|
+
const server_error = errorRes.error;
|
|
248
|
+
if (('service_type' in server_error) &&
|
|
249
|
+
(server_error.service_type === service_type)) {
|
|
250
|
+
return throwError(this.parseException(server_error));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
if (('service_type' in errorRes) &&
|
|
256
|
+
(errorRes.service_type === service_type)) {
|
|
257
|
+
if (errorRes.type === 'exception') {
|
|
258
|
+
return throwError(this.parseException(errorRes));
|
|
259
|
+
}
|
|
260
|
+
else if (errorRes.type === 'error') {
|
|
261
|
+
return throwError(this.parseResponseError(errorRes));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return throwError(errorRes);
|
|
266
|
+
}
|
|
212
267
|
parseException(exception) {
|
|
213
268
|
const error = new EsolveHttpError('exception', exception.message || 'Unknown exception has occurred', exception.additional_data.exception_type || 'unknown');
|
|
214
269
|
return error;
|
|
215
270
|
}
|
|
216
|
-
|
|
271
|
+
parseResponseError(exception) {
|
|
272
|
+
const error = new EsolveHttpError('error', exception.message || 'Unknown error has occurred', exception.code || 'unknown');
|
|
273
|
+
return error;
|
|
274
|
+
}
|
|
275
|
+
parsePostErrors(response) {
|
|
217
276
|
const error = new EsolveHttpError('error', 'Unknown error has occurred', 'unknown');
|
|
218
277
|
if ((response.status.state === 'none') && (response.log.length > 0)) {
|
|
219
278
|
error.error_code = 'no_response';
|
|
@@ -226,29 +285,9 @@ class EsolveErrorHandlerService {
|
|
|
226
285
|
}
|
|
227
286
|
return error;
|
|
228
287
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const server_error = errorRes.error;
|
|
233
|
-
if ((server_error.service_type === service_type) ||
|
|
234
|
-
(server_error.type !== undefined) ||
|
|
235
|
-
(server_error.message !== undefined) ||
|
|
236
|
-
(server_error.additional_data !== undefined)) {
|
|
237
|
-
return throwError(this.parseException(server_error));
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
if (errorRes.type !== undefined) {
|
|
243
|
-
if ((errorRes.type === 'exception') || (errorRes.type === 'error')) {
|
|
244
|
-
return throwError(this.parseException(errorRes));
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
else if (errorRes.transaction_type !== undefined) {
|
|
248
|
-
return throwError(this.parseErrors(errorRes));
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return throwError(errorRes);
|
|
288
|
+
parseDeleteError(result) {
|
|
289
|
+
const error = new EsolveHttpError('error', result.message, result.code);
|
|
290
|
+
return error;
|
|
252
291
|
}
|
|
253
292
|
}
|
|
254
293
|
EsolveErrorHandlerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EsolveErrorHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -653,6 +692,23 @@ class EsolveRegistrationResult extends EsolveResponseResult {
|
|
|
653
692
|
}
|
|
654
693
|
}
|
|
655
694
|
|
|
695
|
+
class EsolveChangePasswordResult extends EsolveResponseResult {
|
|
696
|
+
constructor(response) {
|
|
697
|
+
super(response);
|
|
698
|
+
this.password_updated = (response.status.state === 'success');
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
class EsolveResetPasswordResult extends EsolveResponseResult {
|
|
703
|
+
constructor(response) {
|
|
704
|
+
super(response);
|
|
705
|
+
this.id = response.esolve_id;
|
|
706
|
+
this.reset_success = response.reset_success;
|
|
707
|
+
this.password_matches_old = response.password_matches_old;
|
|
708
|
+
this.login_required = response.login_required;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
656
712
|
class EsolveAccountService {
|
|
657
713
|
constructor(config, http, sessionService, errorHandler, responseHandler) {
|
|
658
714
|
this.config = config;
|
|
@@ -765,6 +821,25 @@ class EsolveAccountService {
|
|
|
765
821
|
return this.processUserAddress(response.records);
|
|
766
822
|
}));
|
|
767
823
|
}
|
|
824
|
+
deleteAddress(id) {
|
|
825
|
+
return this.http.delete(`${this.config.api_url}/service/delete-address.php`, {
|
|
826
|
+
params: {
|
|
827
|
+
ws_id: this.config.wsid,
|
|
828
|
+
id: id
|
|
829
|
+
},
|
|
830
|
+
responseType: 'json',
|
|
831
|
+
observe: 'body'
|
|
832
|
+
}).pipe(map(http_response => {
|
|
833
|
+
if ((http_response.result === undefined) ||
|
|
834
|
+
(http_response.result === null) ||
|
|
835
|
+
(http_response.result.status !== 'success')) {
|
|
836
|
+
throw http_response;
|
|
837
|
+
}
|
|
838
|
+
return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
|
|
839
|
+
}), catchError((errorRes) => {
|
|
840
|
+
return this.errorHandler.handleHttpPostError('delete-address', errorRes);
|
|
841
|
+
}));
|
|
842
|
+
}
|
|
768
843
|
register(user_registration) {
|
|
769
844
|
const body = {
|
|
770
845
|
user: user_registration
|
|
@@ -787,6 +862,64 @@ class EsolveAccountService {
|
|
|
787
862
|
return this.errorHandler.handleHttpPostError('set-registration', errorRes);
|
|
788
863
|
}));
|
|
789
864
|
}
|
|
865
|
+
changePassword(password, confirm_password) {
|
|
866
|
+
const body = {
|
|
867
|
+
password,
|
|
868
|
+
confirm_password
|
|
869
|
+
};
|
|
870
|
+
return this.http.post(`${this.config.api_url}/service/set-change-password.php`, body, {
|
|
871
|
+
headers: {
|
|
872
|
+
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
|
|
873
|
+
},
|
|
874
|
+
params: {
|
|
875
|
+
ws_id: this.config.wsid
|
|
876
|
+
},
|
|
877
|
+
responseType: 'json',
|
|
878
|
+
observe: 'body'
|
|
879
|
+
}).pipe(map(http_response => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
880
|
+
return new EsolveChangePasswordResult(response);
|
|
881
|
+
})), catchError((errorRes) => {
|
|
882
|
+
return this.errorHandler.handleHttpPostError('set-change-password', errorRes);
|
|
883
|
+
}));
|
|
884
|
+
}
|
|
885
|
+
sendForgotPasswordRequest(email) {
|
|
886
|
+
return this.http.get(`${this.config.api_url}/service/get-forgot-password.php`, {
|
|
887
|
+
params: {
|
|
888
|
+
ws_id: this.config.wsid,
|
|
889
|
+
email: email
|
|
890
|
+
}
|
|
891
|
+
}).pipe(map(response => {
|
|
892
|
+
if ((response.records === undefined) ||
|
|
893
|
+
!('reset_link_sent' in response.records)) {
|
|
894
|
+
throw response;
|
|
895
|
+
}
|
|
896
|
+
return response.records.reset_link_sent;
|
|
897
|
+
}));
|
|
898
|
+
}
|
|
899
|
+
resetPassword(reset_key, password, confirm_password, auto_login = true) {
|
|
900
|
+
return this.http.post(`${this.config.api_url}/service/set-forgot-password.php`, {
|
|
901
|
+
reset_key,
|
|
902
|
+
password,
|
|
903
|
+
confirm_password,
|
|
904
|
+
auto_login
|
|
905
|
+
}, {
|
|
906
|
+
headers: {
|
|
907
|
+
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
|
|
908
|
+
},
|
|
909
|
+
params: {
|
|
910
|
+
ws_id: this.config.wsid
|
|
911
|
+
},
|
|
912
|
+
responseType: 'json',
|
|
913
|
+
observe: 'body'
|
|
914
|
+
}).pipe(map(http_response => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
915
|
+
if (!response.login_required) {
|
|
916
|
+
this.sessionService.handleUpdateSession(response.esolve_id);
|
|
917
|
+
}
|
|
918
|
+
return new EsolveResetPasswordResult(response);
|
|
919
|
+
})), catchError((errorRes) => {
|
|
920
|
+
return this.errorHandler.handleHttpPostError('set-forgot-password', errorRes);
|
|
921
|
+
}));
|
|
922
|
+
}
|
|
790
923
|
}
|
|
791
924
|
EsolveAccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EsolveAccountService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$1.HttpClient }, { token: EsolveSessionService }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
792
925
|
EsolveAccountService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EsolveAccountService, providedIn: 'root' });
|
|
@@ -2318,6 +2451,25 @@ class EsolvePaymentService {
|
|
|
2318
2451
|
return this.errorHandler.handleHttpPostError('set-vault', errorRes);
|
|
2319
2452
|
}));
|
|
2320
2453
|
}
|
|
2454
|
+
deleteVaultItem(id) {
|
|
2455
|
+
return this.http.delete(`${this.config.api_url}/service/delete-vault.php`, {
|
|
2456
|
+
params: {
|
|
2457
|
+
ws_id: this.config.wsid,
|
|
2458
|
+
id: id
|
|
2459
|
+
},
|
|
2460
|
+
responseType: 'json',
|
|
2461
|
+
observe: 'body'
|
|
2462
|
+
}).pipe(map(http_response => {
|
|
2463
|
+
if ((http_response.result === undefined) ||
|
|
2464
|
+
(http_response.result === null) ||
|
|
2465
|
+
(http_response.result.status !== 'success')) {
|
|
2466
|
+
throw http_response;
|
|
2467
|
+
}
|
|
2468
|
+
return new EsolveResult(http_response.result.status, http_response.result.code, http_response.result.message);
|
|
2469
|
+
}), catchError((errorRes) => {
|
|
2470
|
+
return this.errorHandler.handleHttpPostError('delete-vault', errorRes);
|
|
2471
|
+
}));
|
|
2472
|
+
}
|
|
2321
2473
|
/**
|
|
2322
2474
|
* Sets the payment for the specified transaction using selected payment method.
|
|
2323
2475
|
* @param transaction_id eSolve ID to the transaction
|
|
@@ -2655,4 +2807,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImpor
|
|
|
2655
2807
|
* Generated bundle index. Do not edit.
|
|
2656
2808
|
*/
|
|
2657
2809
|
|
|
2658
|
-
export { EsolveAccountService, EsolveAddress, EsolveAddressResult, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveCheckoutResult, EsolveErrorHandlerService, EsolveHttpError, EsolveLocationsService, EsolveMediaArticle, EsolveMediaService, EsolveMenuItem, EsolveMenuService, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRegistrationResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveSEOInfo, EsolveSeoService, EsolveSession, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveStockBadge, EsolveStockItem, EsolveStockItemList, EsolveStockLocation, EsolveStockPrice, EsolveStockService, EsolveTag, EsolveTopic, EsolveTopicService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveVaultItem, EsolveVaultItemResult, NgEsolveConnectModule };
|
|
2810
|
+
export { EsolveAccountService, EsolveAddress, EsolveAddressResult, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveErrorHandlerService, EsolveHttpError, EsolveLocationsService, EsolveMediaArticle, EsolveMediaService, EsolveMenuItem, EsolveMenuService, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSEOInfo, EsolveSeoService, EsolveSession, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveStockBadge, EsolveStockItem, EsolveStockItemList, EsolveStockLocation, EsolveStockPrice, EsolveStockService, EsolveTag, EsolveTopic, EsolveTopicService, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveVaultItem, EsolveVaultItemResult, NgEsolveConnectModule };
|
|
2811
|
+
//# sourceMappingURL=esolve-ng-esolve-connect.mjs.map
|