@esolve/ng-esolve-connect 0.22.1 → 0.24.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.
Files changed (46) hide show
  1. package/esm2020/lib/account/confirmation/esolve-account-confirmation-post-response-item.interface.mjs +2 -0
  2. package/esm2020/lib/account/confirmation/esolve-account-confirmation-result.model.mjs +10 -0
  3. package/esm2020/lib/account/confirmation/index.mjs +3 -0
  4. package/esm2020/lib/account/esolve-account.service.mjs +34 -1
  5. package/esm2020/lib/account/index.mjs +2 -1
  6. package/esm2020/lib/cart/esolve-checkout-response.interface.mjs +1 -1
  7. package/esm2020/lib/cart/esolve-checkout-result.model.mjs +2 -1
  8. package/esm2020/lib/cart/index.mjs +2 -1
  9. package/esm2020/lib/payment/esolve-payment.service.mjs +6 -3
  10. package/esm2020/lib/payment/interfaces/esolve-payment-redirect-links.interface.mjs +2 -0
  11. package/esm2020/lib/payment/interfaces/esolve-payment-set-body.interface.mjs +1 -1
  12. package/esm2020/lib/payment/interfaces/index.mjs +2 -1
  13. package/esm2020/lib/suppliers/classes/esolve-supplier.model.mjs +27 -0
  14. package/esm2020/lib/suppliers/classes/index.mjs +2 -0
  15. package/esm2020/lib/suppliers/esolve-suppliers.service.mjs +59 -0
  16. package/esm2020/lib/suppliers/index.mjs +5 -0
  17. package/esm2020/lib/suppliers/interfaces/esolve-supplier-options.interface.mjs +2 -0
  18. package/esm2020/lib/suppliers/interfaces/esolve-supplier-record.interface.mjs +2 -0
  19. package/esm2020/lib/suppliers/interfaces/index.mjs +3 -0
  20. package/esm2020/lib/wishlist/esolve-wishlist.service.mjs +6 -3
  21. package/esm2020/public-api.mjs +3 -1
  22. package/fesm2015/esolve-ng-esolve-connect.mjs +136 -4
  23. package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
  24. package/fesm2020/esolve-ng-esolve-connect.mjs +132 -4
  25. package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
  26. package/lib/account/confirmation/esolve-account-confirmation-post-response-item.interface.d.ts +7 -0
  27. package/lib/account/confirmation/esolve-account-confirmation-result.model.d.ts +8 -0
  28. package/lib/account/confirmation/index.d.ts +2 -0
  29. package/lib/account/esolve-account.service.d.ts +10 -0
  30. package/lib/account/index.d.ts +1 -0
  31. package/lib/cart/esolve-checkout-response.interface.d.ts +1 -0
  32. package/lib/cart/esolve-checkout-result.model.d.ts +1 -0
  33. package/lib/payment/esolve-payment.service.d.ts +2 -2
  34. package/lib/payment/interfaces/esolve-payment-redirect-links.interface.d.ts +4 -0
  35. package/lib/payment/interfaces/esolve-payment-set-body.interface.d.ts +2 -0
  36. package/lib/payment/interfaces/index.d.ts +1 -0
  37. package/lib/suppliers/classes/esolve-supplier.model.d.ts +26 -0
  38. package/lib/suppliers/classes/index.d.ts +1 -0
  39. package/lib/suppliers/esolve-suppliers.service.d.ts +16 -0
  40. package/lib/suppliers/index.d.ts +3 -0
  41. package/lib/suppliers/interfaces/esolve-supplier-options.interface.d.ts +4 -0
  42. package/lib/suppliers/interfaces/esolve-supplier-record.interface.d.ts +24 -0
  43. package/lib/suppliers/interfaces/index.d.ts +2 -0
  44. package/lib/wishlist/esolve-wishlist.service.d.ts +4 -1
  45. package/package.json +1 -1
  46. package/public-api.d.ts +1 -0
@@ -0,0 +1,7 @@
1
+ import { EsolvePostResponseItem } from '../../shared/response';
2
+ export interface EsolveAccountConfirmationPostResponseItem extends EsolvePostResponseItem {
3
+ esolve_id: number;
4
+ location_id: number;
5
+ recalculated_cart: boolean;
6
+ auto_login: boolean;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { EsolveResponseResult } from '../../shared/response';
2
+ import { EsolveAccountConfirmationPostResponseItem } from './esolve-account-confirmation-post-response-item.interface';
3
+ export declare class EsolveAccountConfirmationResult extends EsolveResponseResult {
4
+ user_id: number;
5
+ location_id: number;
6
+ recalculated_cart: boolean;
7
+ constructor(response: EsolveAccountConfirmationPostResponseItem);
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './esolve-account-confirmation-result.model';
2
+ export * from './esolve-account-confirmation-post-response-item.interface';
@@ -11,6 +11,7 @@ import { EsolveAddress, EsolveAddressResult, EsolveAddressPostData } from './add
11
11
  import { EsolveChangePasswordResult, EsolveResetPasswordResult } from './password';
12
12
  import { EsolveTransaction, EsolveTransactionOptions, EsolveTransactionList } from './transaction';
13
13
  import { EsolveUserAccount, EsolveUserAccountData, EsolveUserAccountResult } from './user-account';
14
+ import { EsolveAccountConfirmationResult } from './confirmation';
14
15
  import * as i0 from "@angular/core";
15
16
  export declare class EsolveAccountService {
16
17
  private config;
@@ -29,6 +30,15 @@ export declare class EsolveAccountService {
29
30
  deleteAddress(id: number): Observable<EsolveResult>;
30
31
  register(user_registration: EsolveRegistrationData): Observable<EsolveRegistrationResult>;
31
32
  changePassword(password: string, confirm_password: string): Observable<EsolveChangePasswordResult>;
33
+ /**
34
+ * Submits the users confirmation key to the relevant backend server in order to
35
+ * confirm the accounts validity. The key was emailed to the user hence if he received
36
+ * it and enters the value, the email account can be seen as valid.
37
+ *
38
+ * @param key The key that was emailed to the registered user's email account.
39
+ * @returns An `Observable` that contains the result of the account confirmation request.
40
+ */
41
+ accountConfirmationRequest(key: string): Observable<EsolveAccountConfirmationResult>;
32
42
  sendForgotPasswordRequest(email: string): Observable<boolean>;
33
43
  resetPassword(reset_key: string, password: string, confirm_password: string, auto_login?: boolean): Observable<EsolveResetPasswordResult>;
34
44
  updateLocation(location_id: number): Observable<EsolveLocationUpdateResult>;
@@ -3,4 +3,5 @@ export * from './user-account';
3
3
  export * from './transaction';
4
4
  export * from './password';
5
5
  export * from './registration';
6
+ export * from './confirmation';
6
7
  export * from './esolve-account.service';
@@ -1,4 +1,5 @@
1
1
  import { EsolvePostResponseItem } from '../shared/response';
2
2
  export interface EsolveCheckoutResponse extends EsolvePostResponseItem {
3
3
  esolve_id: number;
4
+ process_payment?: boolean;
4
5
  }
@@ -2,5 +2,6 @@ import { EsolveResponseResult } from '../shared/response';
2
2
  import { EsolveCheckoutResponse } from './esolve-checkout-response.interface';
3
3
  export declare class EsolveCheckoutResult extends EsolveResponseResult {
4
4
  id: number;
5
+ process_payment: boolean;
5
6
  constructor(response: EsolveCheckoutResponse);
6
7
  }
@@ -5,7 +5,7 @@ import { EsolveErrorHandlerService } from '../shared/errors/esolve-error-handler
5
5
  import { EsolveResult } from '../shared/esolve-result.model';
6
6
  import { EsolveResponseHandlerService } from '../shared/response';
7
7
  import { EsolvePaymentMethod, EsolvePaymentResult, EsolveVaultItem, EsolveVaultItemResult } from './classes';
8
- import { EsolveCardData, EsolvePaymentMethodOptions } from './interfaces';
8
+ import { EsolveCardData, EsolvePaymentMethodOptions, EsolvePaymentRedirectLinks } from './interfaces';
9
9
  import * as i0 from "@angular/core";
10
10
  export declare class EsolvePaymentService {
11
11
  private config;
@@ -64,7 +64,7 @@ export declare class EsolvePaymentService {
64
64
  *
65
65
  * @returns An `Observable` with the result of the payment
66
66
  */
67
- setPayment(transaction_id: number, payment_methods_id: number, card?: EsolveCardData | number): Observable<EsolvePaymentResult>;
67
+ setPayment(transaction_id: number, payment_methods_id: number, card?: EsolveCardData | number, links?: EsolvePaymentRedirectLinks): Observable<EsolvePaymentResult>;
68
68
  /**
69
69
  * Processes the eSolve payment method records.
70
70
  *
@@ -0,0 +1,4 @@
1
+ export interface EsolvePaymentRedirectLinks {
2
+ success?: string;
3
+ failure?: string;
4
+ }
@@ -1,3 +1,4 @@
1
+ import { EsolvePaymentRedirectLinks } from './esolve-payment-redirect-links.interface';
1
2
  export interface EsolvePaymentSetBody {
2
3
  payment: {
3
4
  cart_id: number;
@@ -10,4 +11,5 @@ export interface EsolvePaymentSetBody {
10
11
  card_cvv: string;
11
12
  card_expiry: string;
12
13
  };
14
+ links?: EsolvePaymentRedirectLinks;
13
15
  }
@@ -5,3 +5,4 @@ export * from './esolve-vault-record.interface';
5
5
  export * from './esolve-payment-response.interface';
6
6
  export * from './esolve-payment-method-options.interface';
7
7
  export * from './esolve-payment-method-record.interface';
8
+ export * from './esolve-payment-redirect-links.interface';
@@ -0,0 +1,26 @@
1
+ import { EsolveSupplierRecord } from '../interfaces';
2
+ export declare class EsolveSupplier {
3
+ id?: number;
4
+ internal_account?: string;
5
+ external_account?: string;
6
+ company_name: string;
7
+ owner_firstname: string;
8
+ owner_surname: string;
9
+ owner_email: string;
10
+ owner_contact_number: string;
11
+ rep_firstname: string;
12
+ rep_surname: string;
13
+ rep_email: string;
14
+ rep_contact_number: string;
15
+ street: string;
16
+ suburb: string;
17
+ city: string;
18
+ province: string;
19
+ country: string;
20
+ postal_code: string;
21
+ catalogue_ref_1: string;
22
+ catalogue_ref_2: string;
23
+ is_active?: boolean;
24
+ industry_type: string;
25
+ constructor(record?: Partial<EsolveSupplierRecord>);
26
+ }
@@ -0,0 +1 @@
1
+ export * from './esolve-supplier.model';
@@ -0,0 +1,16 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { EsolveConnectConfig } from '../esolve-connect.config';
4
+ import { EsolveSupplier } from './classes';
5
+ import { EsolveSupplierOptions } from './interfaces';
6
+ import * as i0 from "@angular/core";
7
+ export declare class EsolveSuppliersService {
8
+ private config;
9
+ private http;
10
+ constructor(config: EsolveConnectConfig, http: HttpClient);
11
+ getSuppliers(options?: EsolveSupplierOptions): Observable<EsolveSupplier[]>;
12
+ private getSupplierRecords;
13
+ private processSuppliers;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsolveSuppliersService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<EsolveSuppliersService>;
16
+ }
@@ -0,0 +1,3 @@
1
+ export * from './classes';
2
+ export * from './interfaces';
3
+ export * from './esolve-suppliers.service';
@@ -0,0 +1,4 @@
1
+ export interface EsolveSupplierOptions {
2
+ industry_type?: string;
3
+ internal_account?: string;
4
+ }
@@ -0,0 +1,24 @@
1
+ export interface EsolveSupplierRecord {
2
+ id: number;
3
+ internal_account?: string;
4
+ external_account?: string;
5
+ company_name: string;
6
+ owner_firstname: string;
7
+ owner_surname: string;
8
+ owner_email: string;
9
+ owner_contact_number: string;
10
+ rep_firstname: string;
11
+ rep_surname: string;
12
+ rep_email: string;
13
+ rep_contact_number: string;
14
+ street: string;
15
+ suburb: string;
16
+ city: string;
17
+ province: string;
18
+ country: string;
19
+ postal_code: string;
20
+ catalogue_ref_1: string;
21
+ catalogue_ref_2: string;
22
+ is_active: boolean;
23
+ industry_type: string;
24
+ }
@@ -0,0 +1,2 @@
1
+ export * from './esolve-supplier-record.interface';
2
+ export * from './esolve-supplier-options.interface';
@@ -24,7 +24,8 @@ export declare class EsolveWishlistService {
24
24
  * Updates the wishlist by preforming various actions, such as adding, editing or removing items from the list.
25
25
  *
26
26
  * @param items An array of options to update the wishlist
27
- * @param action The default action to preform
27
+ * @param default_action The default action to preform
28
+ *
28
29
  * @returns An `Observable` with an array of responses that gives feedback on the requested changes
29
30
  */
30
31
  setWishlist(items: EsolveWishlistSetItem[], default_action?: EsolveWishlistSetAction): Observable<EsolveWishlistItemResponse[]>;
@@ -38,11 +39,13 @@ export declare class EsolveWishlistService {
38
39
  * Processes the eSolve wishlist records
39
40
  *
40
41
  * @param wishlist_item_records Records to process
42
+ *
41
43
  * @returns An array of processed cart items
42
44
  */
43
45
  private processWishlist;
44
46
  /**
45
47
  * Retrieves stock records from HTTP params.
48
+ *
46
49
  * @param params HTTP client parameters
47
50
  */
48
51
  private getWishlistRecords;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esolve/ng-esolve-connect",
3
- "version": "0.22.1",
3
+ "version": "0.24.0",
4
4
  "description": "An Angular library that speaks to an eSolve instance's API",
5
5
  "ng-add": {
6
6
  "save": "true"
package/public-api.d.ts CHANGED
@@ -32,3 +32,4 @@ export * from './lib/shipping';
32
32
  export * from './lib/locations';
33
33
  export * from './lib/enquiry';
34
34
  export * from './lib/wishlist';
35
+ export * from './lib/suppliers';