@esolve/ng-esolve-connect 0.130.0 → 0.132.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/fesm2022/esolve-ng-esolve-connect-media.mjs +3 -0
- package/fesm2022/esolve-ng-esolve-connect-media.mjs.map +1 -1
- package/fesm2022/esolve-ng-esolve-connect.mjs +411 -141
- package/fesm2022/esolve-ng-esolve-connect.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/auth/services/esolve-auth.service.d.ts +14 -1
- package/lib/cart/classes/esolve-cart-stock-item.model.d.ts +1 -0
- package/lib/cart/classes/esolve-checkout-result.model.d.ts +1 -0
- package/lib/cart/esolve-cart.service.d.ts +2 -2
- package/lib/cart/interfaces/esolve-cart-item-record.interface.d.ts +1 -0
- package/lib/cart/interfaces/esolve-checkout-response.interface.d.ts +1 -0
- package/lib/notifications/classes/esolve-event.model.d.ts +11 -0
- package/{notifications/lib → lib/notifications}/classes/esolve-notification-button-action.model.d.ts +1 -1
- package/lib/notifications/classes/index.d.ts +5 -0
- package/lib/notifications/enums/esolve-event-type.enum.d.ts +6 -0
- package/lib/notifications/enums/index.d.ts +1 -0
- package/lib/notifications/index.d.ts +5 -0
- package/lib/notifications/interfaces/esolve-event-record.interface.d.ts +6 -0
- package/{notifications/lib → lib/notifications}/interfaces/esolve-notification-button-action-record.interface.d.ts +1 -1
- package/lib/notifications/interfaces/index.d.ts +7 -0
- package/lib/notifications/services/esolve-event-target.service.d.ts +11 -0
- package/lib/notifications/services/index.d.ts +2 -0
- package/lib/notifications/types/index.d.ts +3 -0
- package/lib/stock/classes/esolve-stock-barcode.model.d.ts +9 -0
- package/lib/stock/classes/index.d.ts +2 -1
- package/lib/stock/esolve-stock.service.d.ts +14 -2
- package/lib/stock/interfaces/esolve-stock-barcode-options.interface.d.ts +4 -0
- package/lib/stock/interfaces/esolve-stock-barcode-record.interface.d.ts +7 -0
- package/lib/stock/interfaces/index.d.ts +3 -1
- package/lib/stock/types/esolve-barcode-type.type.d.ts +1 -0
- package/media/lib/classes/esolve-media-article.model.d.ts +1 -0
- package/media/lib/interfaces/esolve-media-record.interface.d.ts +1 -1
- package/package.json +1 -5
- package/fesm2022/esolve-ng-esolve-connect-notifications.mjs +0 -114
- package/fesm2022/esolve-ng-esolve-connect-notifications.mjs.map +0 -1
- package/notifications/README.md +0 -3
- package/notifications/index.d.ts +0 -4
- package/notifications/lib/classes/index.d.ts +0 -4
- package/notifications/lib/interfaces/index.d.ts +0 -6
- package/notifications/lib/services/index.d.ts +0 -1
- package/notifications/lib/types/index.d.ts +0 -3
- package/{notifications/lib → lib/notifications}/classes/esolve-notification-dates.model.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/classes/esolve-system-notification-type.model.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/classes/esolve-system-notification.model.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/interfaces/esolve-notification-date-record.interface.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/interfaces/esolve-notification-dates-record.interface.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/interfaces/esolve-system-notification-options.interface.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/interfaces/esolve-system-notification-record.interface.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/interfaces/esolve-system-notification-type-record.interface.d.ts +0 -0
- package/{notifications/lib → lib/notifications}/services/esolve-notifications.service.d.ts +1 -1
- /package/{notifications/lib → lib/notifications}/types/esolve-notification-position.type.d.ts +0 -0
- /package/{notifications/lib → lib/notifications}/types/esolve-notification-size.type.d.ts +0 -0
- /package/{notifications/lib → lib/notifications}/types/esolve-notification-type.type.d.ts +0 -0
package/index.d.ts
CHANGED
|
@@ -7,9 +7,22 @@ export declare class EsolveAuthService {
|
|
|
7
7
|
private readonly http;
|
|
8
8
|
private readonly session;
|
|
9
9
|
private readonly errorHandler;
|
|
10
|
-
|
|
10
|
+
private readonly platformId;
|
|
11
|
+
private readonly esolveEventTarget;
|
|
12
|
+
private readonly is_browser;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum number of session validation and refresh retries allowed until
|
|
15
|
+
* the application needs to be reloaded
|
|
16
|
+
*/
|
|
17
|
+
private readonly maximum_retries;
|
|
18
|
+
/**
|
|
19
|
+
* Time to wait before attempting to refresh the token if validation fails
|
|
20
|
+
*/
|
|
21
|
+
private readonly validation_delay;
|
|
11
22
|
private readonly validating_session$;
|
|
23
|
+
private readonly fatal_session_error_message$;
|
|
12
24
|
constructor();
|
|
25
|
+
onSessionError(): Observable<string>;
|
|
13
26
|
getAccessToken(email: string, password: string, anonymous?: boolean): Observable<EsolveAuthGetResponse>;
|
|
14
27
|
getAnonymousSession(): Observable<EsolveAuthGetResponse>;
|
|
15
28
|
autoLogin(): Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { EsolveResponseResult } from '../../shared/response';
|
|
|
2
2
|
import { EsolveCheckoutResponse } from '../interfaces';
|
|
3
3
|
export declare class EsolveCheckoutResult extends EsolveResponseResult {
|
|
4
4
|
id: number;
|
|
5
|
+
key: string;
|
|
5
6
|
process_payment: boolean;
|
|
6
7
|
constructor(response: EsolveCheckoutResponse);
|
|
7
8
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { EsolveResponseResult } from '../shared/response';
|
|
3
2
|
import { EsolveResult } from '../shared/esolve-result.model';
|
|
3
|
+
import { EsolveResponseResult } from '../shared/response';
|
|
4
4
|
import { EsolveTransactionType } from '../transactions';
|
|
5
5
|
import { EsolveCartTotals, EsolveCheckoutResult, EsolveEmptyCartResult, EsolveTransactionAnalyticsData } from './classes';
|
|
6
6
|
import { EsolveAdditionalWhere, EsolveCartItemResponse, EsolveCartSetItem, EsolveTimeSlotCheckout } from './interfaces';
|
|
7
|
-
import { EsolveCart,
|
|
7
|
+
import { EsolveCart, EsolveCartAlternativesMap, EsolveCartSetAction } from './types';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export declare class EsolveCartService {
|
|
10
10
|
private readonly config;
|
|
@@ -41,6 +41,7 @@ export interface EsolveCartItemRecord {
|
|
|
41
41
|
ignore_onhand_check: boolean;
|
|
42
42
|
subcategory_min_level: number;
|
|
43
43
|
image_name: string;
|
|
44
|
+
category_id: string;
|
|
44
45
|
is_dependency?: boolean;
|
|
45
46
|
additional_parameters?: EsolveCartAdditionalParams;
|
|
46
47
|
badges?: EsolveStockBadgeRecord[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EsolveEventType } from '../enums';
|
|
2
|
+
import { EsolveEventRecord } from '../interfaces';
|
|
3
|
+
export declare class EsolveEvent {
|
|
4
|
+
private _type;
|
|
5
|
+
private _message;
|
|
6
|
+
private _additional_data?;
|
|
7
|
+
get type(): EsolveEventType;
|
|
8
|
+
get message(): string;
|
|
9
|
+
get additional_data(): any;
|
|
10
|
+
constructor(record: EsolveEventRecord);
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EsolveEvent } from './esolve-event.model';
|
|
2
|
+
export { EsolveNotificationButtonAction } from './esolve-notification-button-action.model';
|
|
3
|
+
export { EsolveNotificationDates } from './esolve-notification-dates.model';
|
|
4
|
+
export { EsolveSystemNotificationType } from './esolve-system-notification-type.model';
|
|
5
|
+
export { EsolveSystemNotification } from './esolve-system-notification.model';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EsolveEventType } from './esolve-event-type.enum';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EsolveEvent, EsolveNotificationButtonAction, EsolveNotificationDates, EsolveSystemNotification, EsolveSystemNotificationType, } from './classes';
|
|
2
|
+
export { EsolveEventType } from './enums';
|
|
3
|
+
export type { EsolveEventRecord, EsolveNotificationButtonActionRecord, EsolveNotificationDateRecord, EsolveNotificationDatesRecord, EsolveSystemNotificationOptions, EsolveSystemNotificationRecord, EsolveSystemNotificationTypeRecord, } from './interfaces';
|
|
4
|
+
export { EsolveEventTargetService, EsolveNotificationsService, } from './services';
|
|
5
|
+
export type { EsolveNotificationPosition, EsolveNotificationSize, EsolveNotificationType, } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { EsolveEventRecord } from './esolve-event-record.interface';
|
|
2
|
+
export type { EsolveNotificationButtonActionRecord } from './esolve-notification-button-action-record.interface';
|
|
3
|
+
export type { EsolveNotificationDateRecord } from './esolve-notification-date-record.interface';
|
|
4
|
+
export type { EsolveNotificationDatesRecord } from './esolve-notification-dates-record.interface';
|
|
5
|
+
export type { EsolveSystemNotificationOptions } from './esolve-system-notification-options.interface';
|
|
6
|
+
export type { EsolveSystemNotificationRecord } from './esolve-system-notification-record.interface';
|
|
7
|
+
export type { EsolveSystemNotificationTypeRecord } from './esolve-system-notification-type-record.interface';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EsolveEvent } from '../classes';
|
|
2
|
+
import { EsolveEventType } from '../enums';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class EsolveEventTargetService {
|
|
5
|
+
private readonly listeners;
|
|
6
|
+
addEventListener(event_name: EsolveEventType, callback: (event: EsolveEvent) => void): void;
|
|
7
|
+
removeEventListener(event_name: EsolveEventType, callback: (event: EsolveEvent) => void): void;
|
|
8
|
+
dispatchEvent(event: EsolveEvent | EsolveEventType): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EsolveEventTargetService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EsolveEventTargetService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EsolveStockBarcodeRecord } from '../interfaces';
|
|
2
|
+
import { EsolveBarcodeType } from '../types/esolve-barcode-type.type';
|
|
3
|
+
export declare class EsolveStockBarcode {
|
|
4
|
+
id: number;
|
|
5
|
+
code: string;
|
|
6
|
+
barcode: string;
|
|
7
|
+
barcode_type: EsolveBarcodeType;
|
|
8
|
+
constructor(record?: Partial<EsolveStockBarcodeRecord>);
|
|
9
|
+
}
|
|
@@ -6,16 +6,17 @@ export * from './esolve-media-stock-item.model';
|
|
|
6
6
|
export * from './esolve-recipe-stock-item.model';
|
|
7
7
|
export * from './esolve-set-notify-result.model';
|
|
8
8
|
export * from './esolve-stock-badge.model';
|
|
9
|
+
export * from './esolve-stock-barcode.model';
|
|
9
10
|
export * from './esolve-stock-group-item.model';
|
|
10
11
|
export * from './esolve-stock-group.model';
|
|
11
12
|
export * from './esolve-stock-image-collection.model';
|
|
12
13
|
export * from './esolve-stock-image.model';
|
|
13
14
|
export * from './esolve-stock-item-base.model';
|
|
14
15
|
export * from './esolve-stock-item-list.model';
|
|
16
|
+
export * from './esolve-stock-item-location-level.model';
|
|
15
17
|
export * from './esolve-stock-item.model';
|
|
16
18
|
export * from './esolve-stock-lead-times.model';
|
|
17
19
|
export * from './esolve-stock-price.model';
|
|
18
20
|
export * from './esolve-stock-reviews-report.model';
|
|
19
21
|
export * from './esolve-stock-transaction-sales.model';
|
|
20
22
|
export * from './esolve-suggested-stock-item.model';
|
|
21
|
-
export * from './esolve-stock-item-location-level.model';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { EsolveCustomFields } from '../shared/custom-fields';
|
|
3
3
|
import { EsolveFilterList } from '../shared/filters';
|
|
4
|
-
import { EsolveLinkedStockItem, EsolveRecipeStockItem, EsolveSetNotifyResult, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemList, EsolveStockItemLocationLevel, EsolveSuggestedStockItem } from './classes';
|
|
5
|
-
import { EsolveMediaStockItemOptions, EsolveRecipeStockOptions, EsolveStockFilterOptions, EsolveStockItemHistoryOptions, EsolveStockItemOptions, EsolveTransactionSalesStockItemOptions } from './interfaces';
|
|
4
|
+
import { EsolveLinkedStockItem, EsolveRecipeStockItem, EsolveSetNotifyResult, EsolveStockBarcode, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemList, EsolveStockItemLocationLevel, EsolveSuggestedStockItem } from './classes';
|
|
5
|
+
import { EsolveMediaStockItemOptions, EsolveRecipeStockOptions, EsolveStockBarcodeOptions, EsolveStockFilterOptions, EsolveStockItemHistoryOptions, EsolveStockItemOptions, EsolveTransactionSalesStockItemOptions } from './interfaces';
|
|
6
6
|
import { EsolveMediaStockItemList } from './types';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
export declare class EsolveStockService<T extends EsolveCustomFields = EsolveCustomFields> {
|
|
@@ -73,6 +73,12 @@ export declare class EsolveStockService<T extends EsolveCustomFields = EsolveCus
|
|
|
73
73
|
*/
|
|
74
74
|
getStockImageCollection(code: string): Observable<EsolveStockImageCollection>;
|
|
75
75
|
getStockFilters(options: EsolveStockFilterOptions): Observable<EsolveFilterList>;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieve list of stock codes associated with a given barcode
|
|
78
|
+
*
|
|
79
|
+
* @param options Barcode filter options
|
|
80
|
+
*/
|
|
81
|
+
getStockBarcodes(options: EsolveStockBarcodeOptions): Observable<EsolveStockBarcode[]>;
|
|
76
82
|
private parseBaseStockItemOptions;
|
|
77
83
|
/**
|
|
78
84
|
* Processes the eSolve stock item record and converts it to an object.
|
|
@@ -127,6 +133,12 @@ export declare class EsolveStockService<T extends EsolveCustomFields = EsolveCus
|
|
|
127
133
|
private getStockHistoryRecords;
|
|
128
134
|
private getTransactionSalesStockItems;
|
|
129
135
|
private getTransactionSalesStockRecords;
|
|
136
|
+
/**
|
|
137
|
+
* Processes the eSolve stock barcode record and converts it to an object.
|
|
138
|
+
*
|
|
139
|
+
* @param record eSolve stock barcode record
|
|
140
|
+
*/
|
|
141
|
+
private processStockBarcodes;
|
|
130
142
|
setNotify(code: string, notification_type?: string): Observable<EsolveSetNotifyResult>;
|
|
131
143
|
static ɵfac: i0.ɵɵFactoryDeclaration<EsolveStockService<any>, never>;
|
|
132
144
|
static ɵprov: i0.ɵɵInjectableDeclaration<EsolveStockService<any>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './esolve-additional-stock-image-record.interface';
|
|
2
|
+
export * from './esolve-stock-barcode-options.interface';
|
|
3
|
+
export * from './esolve-stock-barcode-record.interface';
|
|
2
4
|
export * from './esolve-colour-record.interface';
|
|
3
5
|
export * from './esolve-dependant-item-record.interface';
|
|
4
6
|
export * from './esolve-linked-stock-record.interface';
|
|
@@ -12,10 +14,10 @@ export * from './esolve-stock-filter-options.interface';
|
|
|
12
14
|
export * from './esolve-stock-image-collection-record.interface';
|
|
13
15
|
export * from './esolve-stock-item-base-options.interface';
|
|
14
16
|
export * from './esolve-stock-item-history-options.interface';
|
|
17
|
+
export * from './esolve-stock-item-location-level-record.interface';
|
|
15
18
|
export * from './esolve-stock-item-options.interface';
|
|
16
19
|
export * from './esolve-stock-lead-times-record.interface';
|
|
17
20
|
export * from './esolve-stock-linked-category-record.interface';
|
|
18
21
|
export * from './esolve-stock-record.interface';
|
|
19
22
|
export * from './esolve-stock-reviews-report-record.interface';
|
|
20
23
|
export * from './esolve-transaction-sales-stock-item-options.interface';
|
|
21
|
-
export * from './esolve-stock-item-location-level-record.interface';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EsolveBarcodeType = 'ean13' | 'qr' | 'code39' | 'code128';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esolve/ng-esolve-connect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.132.0",
|
|
4
4
|
"homepage": "https://www.esolve.co.za/",
|
|
5
5
|
"description": "An Angular library that speaks to an eSolve instance's API",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -30,10 +30,6 @@
|
|
|
30
30
|
"types": "./media/index.d.ts",
|
|
31
31
|
"default": "./fesm2022/esolve-ng-esolve-connect-media.mjs"
|
|
32
32
|
},
|
|
33
|
-
"./notifications": {
|
|
34
|
-
"types": "./notifications/index.d.ts",
|
|
35
|
-
"default": "./fesm2022/esolve-ng-esolve-connect-notifications.mjs"
|
|
36
|
-
},
|
|
37
33
|
"./survey": {
|
|
38
34
|
"types": "./survey/index.d.ts",
|
|
39
35
|
"default": "./fesm2022/esolve-ng-esolve-connect-survey.mjs"
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
4
|
-
import { map } from 'rxjs';
|
|
5
|
-
import { EsolveConfigService } from '@esolve/ng-esolve-connect';
|
|
6
|
-
|
|
7
|
-
class EsolveNotificationButtonAction {
|
|
8
|
-
constructor(record) {
|
|
9
|
-
this.text = '';
|
|
10
|
-
this.url = '';
|
|
11
|
-
this.module = '';
|
|
12
|
-
this.target = '_self';
|
|
13
|
-
if (record) {
|
|
14
|
-
this.text = record.text;
|
|
15
|
-
this.url = record.url;
|
|
16
|
-
this.module = record.module;
|
|
17
|
-
this.target = record.target;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
class EsolveNotificationDates {
|
|
23
|
-
constructor(record) {
|
|
24
|
-
this.from = new Date(record.from.timestamp * 1000);
|
|
25
|
-
this.to = new Date(record.to.timestamp * 1000);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
class EsolveSystemNotificationType {
|
|
30
|
-
constructor(record) {
|
|
31
|
-
this.id = 0;
|
|
32
|
-
this.identifier = '';
|
|
33
|
-
this.title = '';
|
|
34
|
-
this.system_disable_order = false;
|
|
35
|
-
this.id = +record.id;
|
|
36
|
-
this.identifier = record.identifier;
|
|
37
|
-
this.title = record.title;
|
|
38
|
-
this.system_disable_order = !!+record.system_disable_order;
|
|
39
|
-
this.type = record.type;
|
|
40
|
-
this.size = record.size;
|
|
41
|
-
this.position = record.position;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
class EsolveSystemNotification {
|
|
46
|
-
constructor(record) {
|
|
47
|
-
this.id = 0;
|
|
48
|
-
this.identifier = '';
|
|
49
|
-
this.title = '';
|
|
50
|
-
this.message = '';
|
|
51
|
-
this.timeout = 0;
|
|
52
|
-
this.display_every = 0;
|
|
53
|
-
this.button_actions = [];
|
|
54
|
-
this.id = +record.id;
|
|
55
|
-
this.identifier = record.identifier;
|
|
56
|
-
this.title = record.title;
|
|
57
|
-
this.message = record.message;
|
|
58
|
-
this.timeout = +record.timeout;
|
|
59
|
-
this.display_every = +record.display_every;
|
|
60
|
-
this.type = new EsolveSystemNotificationType(record.type);
|
|
61
|
-
for (const action of record.button_actions) {
|
|
62
|
-
this.button_actions.push(new EsolveNotificationButtonAction(action));
|
|
63
|
-
}
|
|
64
|
-
if (record.dates) {
|
|
65
|
-
this.dates = new EsolveNotificationDates(record.dates);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
class EsolveNotificationsService {
|
|
71
|
-
constructor() {
|
|
72
|
-
this.config = inject(EsolveConfigService);
|
|
73
|
-
this.http = inject(HttpClient);
|
|
74
|
-
}
|
|
75
|
-
getSystemNotifications(options) {
|
|
76
|
-
let params = new HttpParams();
|
|
77
|
-
if (options) {
|
|
78
|
-
if (options.exclude_ids) {
|
|
79
|
-
params = params.set('exclude_ids', options.exclude_ids.join(','));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return this.http
|
|
83
|
-
.get(`${this.config.api_url}/get-system-notifications.php`, { params })
|
|
84
|
-
.pipe(map((response) => {
|
|
85
|
-
if (response.records === undefined ||
|
|
86
|
-
response.records.length <= 0) {
|
|
87
|
-
throw response;
|
|
88
|
-
}
|
|
89
|
-
return this.processNotifications(response.records);
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
processNotifications(records) {
|
|
93
|
-
const notifications = [];
|
|
94
|
-
for (const record of records) {
|
|
95
|
-
notifications.push(new EsolveSystemNotification(record));
|
|
96
|
-
}
|
|
97
|
-
return notifications;
|
|
98
|
-
}
|
|
99
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EsolveNotificationsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
100
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EsolveNotificationsService, providedIn: 'root' }); }
|
|
101
|
-
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: EsolveNotificationsService, decorators: [{
|
|
103
|
-
type: Injectable,
|
|
104
|
-
args: [{
|
|
105
|
-
providedIn: 'root',
|
|
106
|
-
}]
|
|
107
|
-
}] });
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Generated bundle index. Do not edit.
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
export { EsolveNotificationButtonAction, EsolveNotificationDates, EsolveNotificationsService, EsolveSystemNotification, EsolveSystemNotificationType };
|
|
114
|
-
//# sourceMappingURL=esolve-ng-esolve-connect-notifications.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esolve-ng-esolve-connect-notifications.mjs","sources":["../../../../libs/ng-esolve-connect/notifications/src/lib/classes/esolve-notification-button-action.model.ts","../../../../libs/ng-esolve-connect/notifications/src/lib/classes/esolve-notification-dates.model.ts","../../../../libs/ng-esolve-connect/notifications/src/lib/classes/esolve-system-notification-type.model.ts","../../../../libs/ng-esolve-connect/notifications/src/lib/classes/esolve-system-notification.model.ts","../../../../libs/ng-esolve-connect/notifications/src/lib/services/esolve-notifications.service.ts","../../../../libs/ng-esolve-connect/notifications/src/esolve-ng-esolve-connect-notifications.ts"],"sourcesContent":["import { EsolveUrlTarget } from '@esolve/ng-esolve-connect';\n\nimport { EsolveNotificationButtonActionRecord } from '../interfaces';\n\nexport class EsolveNotificationButtonAction {\n public text = '';\n public url = '';\n public module = '';\n public target: EsolveUrlTarget = '_self';\n\n constructor(record?: EsolveNotificationButtonActionRecord) {\n if (record) {\n this.text = record.text;\n this.url = record.url;\n this.module = record.module;\n this.target = record.target;\n }\n }\n}\n","import { EsolveNotificationDatesRecord } from '../interfaces';\n\nexport class EsolveNotificationDates {\n public from: Date;\n public to: Date;\n\n constructor(record: EsolveNotificationDatesRecord) {\n this.from = new Date(record.from.timestamp * 1000);\n this.to = new Date(record.to.timestamp * 1000);\n }\n}\n","import { EsolveSystemNotificationTypeRecord } from '../interfaces';\nimport {\n EsolveNotificationPosition,\n EsolveNotificationSize,\n EsolveNotificationType,\n} from '../types';\n\nexport class EsolveSystemNotificationType {\n public id = 0;\n public identifier = '';\n public title = '';\n public system_disable_order = false;\n public position: EsolveNotificationPosition;\n public size: EsolveNotificationSize;\n public type: EsolveNotificationType;\n\n constructor(record: EsolveSystemNotificationTypeRecord) {\n this.id = +record.id;\n this.identifier = record.identifier;\n this.title = record.title;\n this.system_disable_order = !!+record.system_disable_order;\n this.type = record.type;\n this.size = record.size;\n this.position = record.position;\n }\n}\n","import { EsolveSystemNotificationRecord } from '../interfaces';\nimport { EsolveNotificationButtonAction } from './esolve-notification-button-action.model';\nimport { EsolveNotificationDates } from './esolve-notification-dates.model';\nimport { EsolveSystemNotificationType } from './esolve-system-notification-type.model';\n\nexport class EsolveSystemNotification {\n public id = 0;\n public identifier = '';\n public title = '';\n public message = '';\n public timeout = 0;\n public display_every = 0;\n public button_actions: EsolveNotificationButtonAction[] = [];\n public type: EsolveSystemNotificationType;\n public dates?: EsolveNotificationDates;\n\n constructor(record: EsolveSystemNotificationRecord) {\n this.id = +record.id;\n this.identifier = record.identifier;\n this.title = record.title;\n this.message = record.message;\n this.timeout = +record.timeout;\n this.display_every = +record.display_every;\n\n this.type = new EsolveSystemNotificationType(record.type);\n\n for (const action of record.button_actions) {\n this.button_actions.push(\n new EsolveNotificationButtonAction(action),\n );\n }\n\n if (record.dates) {\n this.dates = new EsolveNotificationDates(record.dates);\n }\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpClient, HttpParams } from '@angular/common/http';\n\nimport { Observable, map } from 'rxjs';\n\nimport {\n EsolveConfigService,\n EsolveGetResponse,\n} from '@esolve/ng-esolve-connect';\n\nimport {\n EsolveSystemNotificationOptions,\n EsolveSystemNotificationRecord,\n} from '../interfaces';\nimport { EsolveSystemNotification } from '../classes';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EsolveNotificationsService {\n private readonly config = inject(EsolveConfigService);\n private readonly http = inject(HttpClient);\n\n public getSystemNotifications(\n options?: EsolveSystemNotificationOptions,\n ): Observable<EsolveSystemNotification[]> {\n let params = new HttpParams();\n\n if (options) {\n if (options.exclude_ids) {\n params = params.set(\n 'exclude_ids',\n options.exclude_ids.join(','),\n );\n }\n }\n\n return this.http\n .get<EsolveGetResponse<EsolveSystemNotificationRecord[]>>(\n `${this.config.api_url}/get-system-notifications.php`,\n { params },\n )\n .pipe(\n map((response) => {\n if (\n response.records === undefined ||\n response.records.length <= 0\n ) {\n throw response;\n }\n\n return this.processNotifications(response.records);\n }),\n );\n }\n\n private processNotifications(\n records: EsolveSystemNotificationRecord[],\n ): EsolveSystemNotification[] {\n const notifications: EsolveSystemNotification[] = [];\n\n for (const record of records) {\n notifications.push(new EsolveSystemNotification(record));\n }\n\n return notifications;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAIa,8BAA8B,CAAA;AAMvC,IAAA,WAAA,CAAY,MAA6C,EAAA;QALlD,IAAA,CAAA,IAAI,GAAG,EAAE;QACT,IAAA,CAAA,GAAG,GAAG,EAAE;QACR,IAAA,CAAA,MAAM,GAAG,EAAE;QACX,IAAA,CAAA,MAAM,GAAoB,OAAO;QAGpC,IAAI,MAAM,EAAE;AACR,YAAA,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;AACvB,YAAA,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG;AACr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ve-notification-button-action-record.interface';
|
|
2
|
-
export * from './esolve-notification-date-record.interface';
|
|
3
|
-
export * from './esolve-notification-dates-record.interface';
|
|
4
|
-
export * from './esolve-system-notification-options.interface';
|
|
5
|
-
export * from './esolve-system-notification-record.interface';
|
|
6
|
-
export * from './esolve-system-notification-type-record.interface';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './esolve-notifications.service';
|
package/{notifications/lib → lib/notifications}/classes/esolve-notification-dates.model.d.ts
RENAMED
|
File without changes
|
package/{notifications/lib → lib/notifications}/classes/esolve-system-notification-type.model.d.ts
RENAMED
|
File without changes
|
package/{notifications/lib → lib/notifications}/classes/esolve-system-notification.model.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { EsolveSystemNotificationOptions } from '../interfaces';
|
|
3
2
|
import { EsolveSystemNotification } from '../classes';
|
|
3
|
+
import { EsolveSystemNotificationOptions } from '../interfaces';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class EsolveNotificationsService {
|
|
6
6
|
private readonly config;
|
/package/{notifications/lib → lib/notifications}/types/esolve-notification-position.type.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|