wt-front-shared 1.0.27 → 1.0.29
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/core/services/index.mjs +2 -1
- package/esm2020/lib/core/services/websocket.service.mjs +74 -0
- package/esm2020/public-api.mjs +1 -1
- package/fesm2015/wt-front-shared.mjs +77 -4
- package/fesm2015/wt-front-shared.mjs.map +1 -1
- package/fesm2020/wt-front-shared.mjs +75 -4
- package/fesm2020/wt-front-shared.mjs.map +1 -1
- package/lib/core/services/index.d.ts +1 -0
- package/lib/core/services/websocket.service.d.ts +23 -0
- package/package.json +1 -1
|
@@ -5588,6 +5588,80 @@ const StorageProvider = {
|
|
|
5588
5588
|
useFactory: cookiesProviderFactory,
|
|
5589
5589
|
};
|
|
5590
5590
|
|
|
5591
|
+
const CORE_CONFIG = new InjectionToken('SHARED_CORE_CONFIG');
|
|
5592
|
+
// export const AUTH_SERVICE_CONFIG: InjectionToken<SocialAuthServiceConfig> = new InjectionToken<SocialAuthServiceConfig>('AUTH_SERVICE_CONFIG');
|
|
5593
|
+
|
|
5594
|
+
var WebsocketMessageTypes;
|
|
5595
|
+
(function (WebsocketMessageTypes) {
|
|
5596
|
+
WebsocketMessageTypes["USER_ACTIVITY"] = "user-activity";
|
|
5597
|
+
})(WebsocketMessageTypes || (WebsocketMessageTypes = {}));
|
|
5598
|
+
var WebsocketMessageSubTypes;
|
|
5599
|
+
(function (WebsocketMessageSubTypes) {
|
|
5600
|
+
WebsocketMessageSubTypes["CHANGE_PAGE"] = "change-page";
|
|
5601
|
+
WebsocketMessageSubTypes["OPEN_BOOKING_FORM"] = "open-booking-form";
|
|
5602
|
+
WebsocketMessageSubTypes["OPEN_FIRM_CONTACT"] = "open-firm-contact";
|
|
5603
|
+
})(WebsocketMessageSubTypes || (WebsocketMessageSubTypes = {}));
|
|
5604
|
+
class WebsocketService {
|
|
5605
|
+
constructor(config) {
|
|
5606
|
+
this.config = config;
|
|
5607
|
+
this.wsIsLoaded = false;
|
|
5608
|
+
this.maxNumbersOfReloads = 10;
|
|
5609
|
+
this.numbersOfReloads = 0;
|
|
5610
|
+
this.connectToWebSocket();
|
|
5611
|
+
}
|
|
5612
|
+
connectToWebSocket() {
|
|
5613
|
+
if ("WebSocket" in window) {
|
|
5614
|
+
this.ws = new WebSocket(this.config.websocketUrl);
|
|
5615
|
+
this.ws.onopen = () => {
|
|
5616
|
+
this.numbersOfReloads = 0;
|
|
5617
|
+
console.info('[ document ][ WS ][ Connection opened ]', this.sessionKey || '', this.config.websocketUrl);
|
|
5618
|
+
this.wsIsLoaded = true;
|
|
5619
|
+
};
|
|
5620
|
+
this.ws.onmessage = (event) => {
|
|
5621
|
+
let message;
|
|
5622
|
+
try {
|
|
5623
|
+
message = JSON.parse(event.data);
|
|
5624
|
+
}
|
|
5625
|
+
catch (e) {
|
|
5626
|
+
console.info('[ document ][ WS ][ Incorrect message ]', { message: event.data, error: e });
|
|
5627
|
+
}
|
|
5628
|
+
if (message && !this.sessionKey) {
|
|
5629
|
+
if (message?.sessionKey) {
|
|
5630
|
+
this.sessionKey = message.sessionKey;
|
|
5631
|
+
}
|
|
5632
|
+
console.info('[ document ][ WS ][ Message received ]', this.sessionKey, message);
|
|
5633
|
+
}
|
|
5634
|
+
};
|
|
5635
|
+
this.ws.onclose = () => {
|
|
5636
|
+
console.info('[ document ][ WS ][ Connection closed ]');
|
|
5637
|
+
this.wsIsLoaded = false;
|
|
5638
|
+
setTimeout(() => {
|
|
5639
|
+
if (this.numbersOfReloads < this.maxNumbersOfReloads) {
|
|
5640
|
+
this.numbersOfReloads++;
|
|
5641
|
+
this.connectToWebSocket();
|
|
5642
|
+
}
|
|
5643
|
+
}, 10000);
|
|
5644
|
+
};
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5647
|
+
wsSentMessage(type, subType, message) {
|
|
5648
|
+
if (this.wsIsLoaded) {
|
|
5649
|
+
this.ws.send(JSON.stringify({ type, subType, message, sessionKey: this.sessionKey }));
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5652
|
+
}
|
|
5653
|
+
WebsocketService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, deps: [{ token: CORE_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5654
|
+
WebsocketService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, providedIn: 'root' });
|
|
5655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: WebsocketService, decorators: [{
|
|
5656
|
+
type: Injectable,
|
|
5657
|
+
args: [{
|
|
5658
|
+
providedIn: 'root'
|
|
5659
|
+
}]
|
|
5660
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
5661
|
+
type: Inject,
|
|
5662
|
+
args: [CORE_CONFIG]
|
|
5663
|
+
}] }]; } });
|
|
5664
|
+
|
|
5591
5665
|
class RouterFacade {
|
|
5592
5666
|
constructor(store) {
|
|
5593
5667
|
this.store = store;
|
|
@@ -10813,9 +10887,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
10813
10887
|
}]
|
|
10814
10888
|
}] });
|
|
10815
10889
|
|
|
10816
|
-
const CORE_CONFIG = new InjectionToken('SHARED_CORE_CONFIG');
|
|
10817
|
-
// export const AUTH_SERVICE_CONFIG: InjectionToken<SocialAuthServiceConfig> = new InjectionToken<SocialAuthServiceConfig>('AUTH_SERVICE_CONFIG');
|
|
10818
|
-
|
|
10819
10890
|
class HeadersInterceptor {
|
|
10820
10891
|
constructor(authenticationService, routerFacade, usersFacade, formErrorsFacade, formsFacade, filesFacade, publicationMessagesFacade, requestsFacade, notificationsFacade) {
|
|
10821
10892
|
this.authenticationService = authenticationService;
|
|
@@ -11050,5 +11121,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
11050
11121
|
* Generated bundle index. Do not edit.
|
|
11051
11122
|
*/
|
|
11052
11123
|
|
|
11053
|
-
export { AccessDeniedComponent, AccessDeniedModule, ActionsEndpointTypes, ActionsFacade, ActionsMetaStatus, ActionsModel, ActionsSendRequest, ActionsService, AsyncValidators, AsyncValidatorsMessages, AsyncValidatorsType, AuthEndpointTypes, AuthenticationService, AutoFormMainComponent, AutoFormModule, AutoFormService, AutoFormShowComponent, Back, BaseAPI, BaseAPIService, BaseAutoFormService, BaseErrors, BaseModelAdapter, BaseResponseFactory, BreadCrumbsComponent, BreadCrumbsModule, ButtonComponent, ButtonModule, CORE_CONFIG, CacheDataEndpointTypes, CacheDataFacade, CacheDataModel, CacheDataService, ChipsInputComponent, ChipsInputModule, ClearStaticData, CommonDialogComponent, CookiesService, CoreFacade, CoreLoadError, CoreLoaded, CountFormatPipe, CreateRequestListener, DateFormatPipe, DeleteComponent, DeleteRequest, DeleteRequestWaiter, DialogService, DialogsModule, EntitiesReportsRequest, Entity, EntityQueryFieldNames, EntitySortType, EntityType, FieldType, FileFieldNames, FileModel, FileUpdateModel, FilesDeleteRequest, FilesDeleteResponseFactory, FilesEndpointTypes, FilesFacade, FilesLoadRequest, FilesLoadResponseFactory, FilesService, FilesSortRequest, FilesSortResponseFactory, FilesUpdateRequest, FilesUpdateResponseFactory, FilesUploadComponent, FilesUploadModule, FormDeleteFileBaseEndpointTypes, FormDeleteFileFacade, FormDeleteFileRequest, FormDeleteFileService, FormErrorModel, FormErrorsFacade, FormFieldErrorComponent, FormFieldErrorModule, FormFieldPublishErrorComponent, FormFieldPublishErrorModule, FormValidationCheckRequest, FormValidationEndpointTypes, FormValidationFacade, FormValidationService, FormsFacade, Forward, GetCacheDataRequest, GetRequest, GlobalErrorMessages, GlobalEvent, Go, GoFail, HeaderComponent, HeaderModule, HeadersInterceptor, IFormFieldFormat, IconComponent, ImageComponent, ImageModule, InputTagsComponent, InputTagsModule, JwtInterceptor, LoadCore, LoadUsers, LoadUsersFail, LoadUsersSuccess, LoginSend, LoginSendCreateRequest, LoginSendCreateResponseFactory, LoginSendFail, LoginSendSuccess, MainConst, MainFacade, MapperRegistry, MapperUtil, MetaModel, NOTIFICATION_LONG_TIMEOUT, NOTIFICATION_TIMEOUT, NotificationAdd, NotificationAddFail, NotificationModel, NotificationShowingType, NotificationsEffects, NotificationsFacade, PaginationComponent, PaginationModule, PagingModel, PanelComponent, PanelHeaderComponent, PanelHeaderModule, PanelModule, PasswordRules, PhonePipe, PipesModule, PostRequest, PublicationMessageFieldNames, PublicationMessagesFacade, PublishDataModel, PublishEndpointTypes, PublishErrors, PublishPostRequest, PublishResultModel, PublishService, PutRequest, QueryFieldsAdapter, ReducerService, RefreshToken, RefreshTokenFail, RefreshTokenSuccess, ReportsEndpointTypes, ReportsFacade, ReportsModel, ReportsService, Request, RequestMethods, RequestStatus, RequestsEffects, RequestsFacade, ResponseStatus, RouterEffects, RouterFacade, RouterService, STICKY_SIDEBAR_OPTIONS, SafePipe, SequelizeUniqueConstraintError, SetLoaded, SetRouterQueryParams, SharedFormErrors, SharedIconModule, SharedReducer, SharedSpinnerModule, SmartProgressBarComponent, SmartProgressBarModule, SocialAuthService, SpinnerComponent, StarRatingComponent, StarRatingModule, StaticDataCreate, StaticDataCreateFail, StaticDataCreateRequest, StaticDataCreateSuccess, StaticDataDelete, StaticDataDeleteFail, StaticDataDeleteRequest, StaticDataDeleteSuccess, StaticDataEffects, StaticDataEndpointTypes, StaticDataFacade, StaticDataGet, StaticDataGetFail, StaticDataGetList, StaticDataGetListCategories, StaticDataGetListCategoriesFail, StaticDataGetListCategoriesRequest, StaticDataGetListCategoriesSuccess, StaticDataGetListFail, StaticDataGetListRequest, StaticDataGetListSuccess, StaticDataGetRequest, StaticDataGetSubRouting, StaticDataGetSubRoutingFail, StaticDataGetSubRoutingSuccess, StaticDataGetSuccess, StaticDataMetaStatus, StaticDataModel, StaticDataPartUpdate, StaticDataService, StaticDataSubRoutingGetRequest, StaticDataUpdate, StaticDataUpdateFail, StaticDataUpdateRequest, StaticDataUpdateSuccess, StickySidebarDirective, StickySidebarInnerDirective, StickySidebarModule, StorageProvider, StorageService, TableMenuComponent, TableMenuModule, TagCloudComponent, TagCloudModule, TagEntitiesRequest, TagEntityModel, TagModel, TagsEndpointTypes, TagsFacade, TagsLoadRequest, TagsLoadResponseFactory, TagsService, TextWithLinkMoreComponent, TextWithLinkMoreModule, USERS_FEATURE_KEY, UiUnitIds, UiUnitsEffects, UiUnitsFacade, UnPublishPostRequest, UpdateRequestData, UserFieldNames, UserModel, UserRole, UserSectionRightModel, UsersEffects, UsersFacade, UsersService, ValidatorsType, VersionsModel, WtFrontSharedModule, appearFromLeft, appearFromLeftHideToRight, appearFromLeftWithDelay, appearFromRight, appearFromRightWithDelay, appearOpacity, appearOpacity2, componentDestroyed, coreQuery, defaultStickySidebarOptions, entityScheme, expandCollapse, fileMapper, fileScheme, getAll, getAllUiUnits, getRequestInfo, getRouterLastRoute, getRouterLastRouteParams, getRouterQueryParams, getRouterRoot, getRouterUrl, getUIUnit, getUiUnitDataById, getUserAuthData, guid, hideToTopOpacity, initialState$b as initialState, mappet, notificationQuery, publicationMessageMapper, publicationMessageScheme, requestsQuery, sharedEffects, sharedFacades, staticDataQuery, trackById, uiUnitsQuery, untilComponentDestroyed, userMapper, userReducer, userScheme, usersQuery };
|
|
11124
|
+
export { AccessDeniedComponent, AccessDeniedModule, ActionsEndpointTypes, ActionsFacade, ActionsMetaStatus, ActionsModel, ActionsSendRequest, ActionsService, AsyncValidators, AsyncValidatorsMessages, AsyncValidatorsType, AuthEndpointTypes, AuthenticationService, AutoFormMainComponent, AutoFormModule, AutoFormService, AutoFormShowComponent, Back, BaseAPI, BaseAPIService, BaseAutoFormService, BaseErrors, BaseModelAdapter, BaseResponseFactory, BreadCrumbsComponent, BreadCrumbsModule, ButtonComponent, ButtonModule, CORE_CONFIG, CacheDataEndpointTypes, CacheDataFacade, CacheDataModel, CacheDataService, ChipsInputComponent, ChipsInputModule, ClearStaticData, CommonDialogComponent, CookiesService, CoreFacade, CoreLoadError, CoreLoaded, CountFormatPipe, CreateRequestListener, DateFormatPipe, DeleteComponent, DeleteRequest, DeleteRequestWaiter, DialogService, DialogsModule, EntitiesReportsRequest, Entity, EntityQueryFieldNames, EntitySortType, EntityType, FieldType, FileFieldNames, FileModel, FileUpdateModel, FilesDeleteRequest, FilesDeleteResponseFactory, FilesEndpointTypes, FilesFacade, FilesLoadRequest, FilesLoadResponseFactory, FilesService, FilesSortRequest, FilesSortResponseFactory, FilesUpdateRequest, FilesUpdateResponseFactory, FilesUploadComponent, FilesUploadModule, FormDeleteFileBaseEndpointTypes, FormDeleteFileFacade, FormDeleteFileRequest, FormDeleteFileService, FormErrorModel, FormErrorsFacade, FormFieldErrorComponent, FormFieldErrorModule, FormFieldPublishErrorComponent, FormFieldPublishErrorModule, FormValidationCheckRequest, FormValidationEndpointTypes, FormValidationFacade, FormValidationService, FormsFacade, Forward, GetCacheDataRequest, GetRequest, GlobalErrorMessages, GlobalEvent, Go, GoFail, HeaderComponent, HeaderModule, HeadersInterceptor, IFormFieldFormat, IconComponent, ImageComponent, ImageModule, InputTagsComponent, InputTagsModule, JwtInterceptor, LoadCore, LoadUsers, LoadUsersFail, LoadUsersSuccess, LoginSend, LoginSendCreateRequest, LoginSendCreateResponseFactory, LoginSendFail, LoginSendSuccess, MainConst, MainFacade, MapperRegistry, MapperUtil, MetaModel, NOTIFICATION_LONG_TIMEOUT, NOTIFICATION_TIMEOUT, NotificationAdd, NotificationAddFail, NotificationModel, NotificationShowingType, NotificationsEffects, NotificationsFacade, PaginationComponent, PaginationModule, PagingModel, PanelComponent, PanelHeaderComponent, PanelHeaderModule, PanelModule, PasswordRules, PhonePipe, PipesModule, PostRequest, PublicationMessageFieldNames, PublicationMessagesFacade, PublishDataModel, PublishEndpointTypes, PublishErrors, PublishPostRequest, PublishResultModel, PublishService, PutRequest, QueryFieldsAdapter, ReducerService, RefreshToken, RefreshTokenFail, RefreshTokenSuccess, ReportsEndpointTypes, ReportsFacade, ReportsModel, ReportsService, Request, RequestMethods, RequestStatus, RequestsEffects, RequestsFacade, ResponseStatus, RouterEffects, RouterFacade, RouterService, STICKY_SIDEBAR_OPTIONS, SafePipe, SequelizeUniqueConstraintError, SetLoaded, SetRouterQueryParams, SharedFormErrors, SharedIconModule, SharedReducer, SharedSpinnerModule, SmartProgressBarComponent, SmartProgressBarModule, SocialAuthService, SpinnerComponent, StarRatingComponent, StarRatingModule, StaticDataCreate, StaticDataCreateFail, StaticDataCreateRequest, StaticDataCreateSuccess, StaticDataDelete, StaticDataDeleteFail, StaticDataDeleteRequest, StaticDataDeleteSuccess, StaticDataEffects, StaticDataEndpointTypes, StaticDataFacade, StaticDataGet, StaticDataGetFail, StaticDataGetList, StaticDataGetListCategories, StaticDataGetListCategoriesFail, StaticDataGetListCategoriesRequest, StaticDataGetListCategoriesSuccess, StaticDataGetListFail, StaticDataGetListRequest, StaticDataGetListSuccess, StaticDataGetRequest, StaticDataGetSubRouting, StaticDataGetSubRoutingFail, StaticDataGetSubRoutingSuccess, StaticDataGetSuccess, StaticDataMetaStatus, StaticDataModel, StaticDataPartUpdate, StaticDataService, StaticDataSubRoutingGetRequest, StaticDataUpdate, StaticDataUpdateFail, StaticDataUpdateRequest, StaticDataUpdateSuccess, StickySidebarDirective, StickySidebarInnerDirective, StickySidebarModule, StorageProvider, StorageService, TableMenuComponent, TableMenuModule, TagCloudComponent, TagCloudModule, TagEntitiesRequest, TagEntityModel, TagModel, TagsEndpointTypes, TagsFacade, TagsLoadRequest, TagsLoadResponseFactory, TagsService, TextWithLinkMoreComponent, TextWithLinkMoreModule, USERS_FEATURE_KEY, UiUnitIds, UiUnitsEffects, UiUnitsFacade, UnPublishPostRequest, UpdateRequestData, UserFieldNames, UserModel, UserRole, UserSectionRightModel, UsersEffects, UsersFacade, UsersService, ValidatorsType, VersionsModel, WebsocketMessageSubTypes, WebsocketMessageTypes, WebsocketService, WtFrontSharedModule, appearFromLeft, appearFromLeftHideToRight, appearFromLeftWithDelay, appearFromRight, appearFromRightWithDelay, appearOpacity, appearOpacity2, componentDestroyed, coreQuery, defaultStickySidebarOptions, entityScheme, expandCollapse, fileMapper, fileScheme, getAll, getAllUiUnits, getRequestInfo, getRouterLastRoute, getRouterLastRouteParams, getRouterQueryParams, getRouterRoot, getRouterUrl, getUIUnit, getUiUnitDataById, getUserAuthData, guid, hideToTopOpacity, initialState$b as initialState, mappet, notificationQuery, publicationMessageMapper, publicationMessageScheme, requestsQuery, sharedEffects, sharedFacades, staticDataQuery, trackById, uiUnitsQuery, untilComponentDestroyed, userMapper, userReducer, userScheme, usersQuery };
|
|
11054
11125
|
//# sourceMappingURL=wt-front-shared.mjs.map
|