@senior-gestao-empresarial/angular-components 6.12.0 → 7.0.0-730a64d6-86d2-4d71-8f00-64b50fcf1e75
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/bundles/senior-gestao-empresarial-angular-components.umd.js +499 -255
- package/bundles/senior-gestao-empresarial-angular-components.umd.js.map +1 -1
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js +2 -2
- package/bundles/senior-gestao-empresarial-angular-components.umd.min.js.map +1 -1
- package/components/lookups/entities/e-006-pai-lookup.d.ts +8 -0
- package/components/lookups/index.d.ts +1 -0
- package/components/utils/async-lock.d.ts +6 -0
- package/components/websocket/index.d.ts +2 -0
- package/components/websocket/models/index.d.ts +1 -0
- package/components/websocket/models/primitive-manager.d.ts +19 -0
- package/components/websocket/protocols/index.d.ts +2 -0
- package/components/websocket/protocols/on-event-options.d.ts +8 -0
- package/components/websocket/protocols/primitive-event.d.ts +10 -0
- package/components/websocket/user-information.service.d.ts +7 -0
- package/components/websocket/websocket.service.d.ts +78 -74
- package/esm2015/components/lookups/entities/e-006-pai-lookup.js +48 -0
- package/esm2015/components/lookups/index.js +2 -1
- package/esm2015/components/utils/async-lock.js +34 -0
- package/esm2015/components/websocket/index.js +2 -1
- package/esm2015/components/websocket/models/index.js +2 -0
- package/esm2015/components/websocket/models/primitive-manager.js +39 -0
- package/esm2015/components/websocket/protocols/index.js +1 -0
- package/esm2015/components/websocket/protocols/on-event-options.js +1 -0
- package/esm2015/components/websocket/protocols/primitive-event.js +1 -0
- package/esm2015/components/websocket/user-information.service.js +34 -0
- package/esm2015/components/websocket/websocket.service.js +269 -195
- package/esm2015/senior-gestao-empresarial-angular-components.js +4 -3
- package/esm5/components/lookups/entities/e-006-pai-lookup.js +51 -0
- package/esm5/components/lookups/index.js +2 -1
- package/esm5/components/utils/async-lock.js +43 -0
- package/esm5/components/websocket/index.js +2 -1
- package/esm5/components/websocket/models/index.js +2 -0
- package/esm5/components/websocket/models/primitive-manager.js +58 -0
- package/esm5/components/websocket/protocols/index.js +1 -0
- package/esm5/components/websocket/protocols/on-event-options.js +1 -0
- package/esm5/components/websocket/protocols/primitive-event.js +1 -0
- package/esm5/components/websocket/user-information.service.js +38 -0
- package/esm5/components/websocket/websocket.service.js +326 -255
- package/esm5/senior-gestao-empresarial-angular-components.js +4 -3
- package/fesm2015/senior-gestao-empresarial-angular-components.js +405 -193
- package/fesm2015/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/fesm5/senior-gestao-empresarial-angular-components.js +495 -254
- package/fesm5/senior-gestao-empresarial-angular-components.js.map +1 -1
- package/package.json +3 -3
- package/senior-gestao-empresarial-angular-components.d.ts +3 -2
- package/senior-gestao-empresarial-angular-components.metadata.json +1 -1
|
@@ -3,8 +3,8 @@ import { Input, Component, NgModule, Injectable, Inject, ɵɵdefineInjectable,
|
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { Subject, throwError, interval, of, BehaviorSubject,
|
|
7
|
-
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize
|
|
6
|
+
import { Subject, throwError, interval, of, BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
7
|
+
import { takeUntil, filter, catchError, map, takeWhile, switchMap, take, finalize } from 'rxjs/operators';
|
|
8
8
|
import * as moment_ from 'moment';
|
|
9
9
|
import { FormField, FieldType } from '@seniorsistemas/angular-components';
|
|
10
10
|
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
@@ -13,9 +13,9 @@ import { TranslateService } from '@ngx-translate/core';
|
|
|
13
13
|
import { HttpInterceptorModule } from '@seniorsistemas/platform-components';
|
|
14
14
|
import { user } from '@seniorsistemas/senior-platform-data';
|
|
15
15
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
16
|
-
import {
|
|
17
|
-
import { get } from 'js-cookie';
|
|
16
|
+
import { Client, FrameImpl } from '@stomp/stompjs';
|
|
18
17
|
import * as SockJS from 'sockjs-client';
|
|
18
|
+
import { get } from 'js-cookie';
|
|
19
19
|
|
|
20
20
|
var BreadcrumbComponent = /** @class */ (function () {
|
|
21
21
|
function BreadcrumbComponent(activatedRoute, router) {
|
|
@@ -749,6 +749,50 @@ var E007UfsLookup = /** @class */ (function (_super) {
|
|
|
749
749
|
return E007UfsLookup;
|
|
750
750
|
}(ErpLookups));
|
|
751
751
|
|
|
752
|
+
var codPai = "codPai";
|
|
753
|
+
var nomPai = "nomPai";
|
|
754
|
+
var E006PaiLookup = /** @class */ (function (_super) {
|
|
755
|
+
__extends(E006PaiLookup, _super);
|
|
756
|
+
function E006PaiLookup(lookupService, translate) {
|
|
757
|
+
var _this = _super.call(this, lookupService, translate, "e006pai", [
|
|
758
|
+
{
|
|
759
|
+
name: codPai,
|
|
760
|
+
type: FieldType.String
|
|
761
|
+
}, {
|
|
762
|
+
name: nomPai,
|
|
763
|
+
type: FieldType.String
|
|
764
|
+
}
|
|
765
|
+
], [
|
|
766
|
+
{
|
|
767
|
+
name: codPai,
|
|
768
|
+
type: FieldType.String
|
|
769
|
+
}, {
|
|
770
|
+
name: nomPai,
|
|
771
|
+
type: FieldType.String
|
|
772
|
+
}
|
|
773
|
+
], [
|
|
774
|
+
{
|
|
775
|
+
name: codPai,
|
|
776
|
+
type: FieldType.Integer
|
|
777
|
+
}, {
|
|
778
|
+
name: nomPai,
|
|
779
|
+
type: FieldType.String
|
|
780
|
+
}
|
|
781
|
+
], "erpx_fnd", "empresa") || this;
|
|
782
|
+
_this.lookupService = lookupService;
|
|
783
|
+
_this.translate = translate;
|
|
784
|
+
return _this;
|
|
785
|
+
}
|
|
786
|
+
E006PaiLookup.ctorParameters = function () { return [
|
|
787
|
+
{ type: ErpLookupsService },
|
|
788
|
+
{ type: TranslateService }
|
|
789
|
+
]; };
|
|
790
|
+
E006PaiLookup = __decorate([
|
|
791
|
+
Injectable()
|
|
792
|
+
], E006PaiLookup);
|
|
793
|
+
return E006PaiLookup;
|
|
794
|
+
}(ErpLookups));
|
|
795
|
+
|
|
752
796
|
var E008CepLookup = /** @class */ (function (_super) {
|
|
753
797
|
__extends(E008CepLookup, _super);
|
|
754
798
|
function E008CepLookup(lookupService, translate) {
|
|
@@ -7206,320 +7250,517 @@ var NpsService = /** @class */ (function () {
|
|
|
7206
7250
|
return NpsService;
|
|
7207
7251
|
}());
|
|
7208
7252
|
|
|
7253
|
+
var AsyncLock = /** @class */ (function () {
|
|
7254
|
+
function AsyncLock() {
|
|
7255
|
+
this.queue = [];
|
|
7256
|
+
this.acquired = false;
|
|
7257
|
+
}
|
|
7258
|
+
AsyncLock.prototype.acquire = function () {
|
|
7259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7260
|
+
var _this = this;
|
|
7261
|
+
return __generator(this, function (_a) {
|
|
7262
|
+
if (!this.acquired) {
|
|
7263
|
+
this.acquired = true;
|
|
7264
|
+
return [2 /*return*/, Promise.resolve()];
|
|
7265
|
+
}
|
|
7266
|
+
else {
|
|
7267
|
+
return [2 /*return*/, new Promise(function (resolve, _) {
|
|
7268
|
+
_this.queue.push(resolve);
|
|
7269
|
+
})];
|
|
7270
|
+
}
|
|
7271
|
+
return [2 /*return*/];
|
|
7272
|
+
});
|
|
7273
|
+
});
|
|
7274
|
+
};
|
|
7275
|
+
AsyncLock.prototype.release = function () {
|
|
7276
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7277
|
+
var continuation;
|
|
7278
|
+
return __generator(this, function (_a) {
|
|
7279
|
+
if (this.queue.length === 0 && this.acquired) {
|
|
7280
|
+
this.acquired = false;
|
|
7281
|
+
return [2 /*return*/, Promise.resolve()];
|
|
7282
|
+
}
|
|
7283
|
+
continuation = this.queue.shift();
|
|
7284
|
+
return [2 /*return*/, new Promise(function (res) {
|
|
7285
|
+
continuation();
|
|
7286
|
+
res();
|
|
7287
|
+
})];
|
|
7288
|
+
});
|
|
7289
|
+
});
|
|
7290
|
+
};
|
|
7291
|
+
return AsyncLock;
|
|
7292
|
+
}());
|
|
7293
|
+
|
|
7294
|
+
var UserInformationService = /** @class */ (function () {
|
|
7295
|
+
function UserInformationService() {
|
|
7296
|
+
}
|
|
7297
|
+
UserInformationService_1 = UserInformationService;
|
|
7298
|
+
UserInformationService.prototype.getAuthToken = function () {
|
|
7299
|
+
var cookieValue = get(UserInformationService_1.TOKEN_COOKIE_KEY) || '{}';
|
|
7300
|
+
var authToken = JSON.parse(cookieValue);
|
|
7301
|
+
return authToken.access_token;
|
|
7302
|
+
};
|
|
7303
|
+
UserInformationService.prototype.getTenantDomain = function () {
|
|
7304
|
+
var cookieValue = get(UserInformationService_1.TOKEN_COOKIE_KEY) || '{}';
|
|
7305
|
+
var authToken = JSON.parse(cookieValue);
|
|
7306
|
+
return authToken.username.split('@')[1];
|
|
7307
|
+
};
|
|
7308
|
+
UserInformationService.prototype.getWebSocketUrl = function () {
|
|
7309
|
+
var baseUrl = get(UserInformationService_1.BASE_URL_COOKIE_KEY);
|
|
7310
|
+
if (baseUrl && !baseUrl.endsWith('/')) {
|
|
7311
|
+
baseUrl += '/';
|
|
7312
|
+
}
|
|
7313
|
+
return baseUrl + 'websocket';
|
|
7314
|
+
};
|
|
7315
|
+
var UserInformationService_1;
|
|
7316
|
+
UserInformationService.BASE_URL_COOKIE_KEY = 'com.senior.base.url';
|
|
7317
|
+
UserInformationService.TOKEN_COOKIE_KEY = 'com.senior.token';
|
|
7318
|
+
UserInformationService.ɵprov = ɵɵdefineInjectable({ factory: function UserInformationService_Factory() { return new UserInformationService(); }, token: UserInformationService, providedIn: "root" });
|
|
7319
|
+
UserInformationService = UserInformationService_1 = __decorate([
|
|
7320
|
+
Injectable({
|
|
7321
|
+
providedIn: 'root'
|
|
7322
|
+
})
|
|
7323
|
+
], UserInformationService);
|
|
7324
|
+
return UserInformationService;
|
|
7325
|
+
}());
|
|
7326
|
+
|
|
7327
|
+
var PrimitiveManager = /** @class */ (function () {
|
|
7328
|
+
function PrimitiveManager(domain, service, primitive) {
|
|
7329
|
+
this.domain = domain;
|
|
7330
|
+
this.service = service;
|
|
7331
|
+
this.primitive = primitive;
|
|
7332
|
+
this.stompSubscriptions = [];
|
|
7333
|
+
this.event$ = new Subject();
|
|
7334
|
+
this.subscribed$ = new BehaviorSubject(false);
|
|
7335
|
+
}
|
|
7336
|
+
PrimitiveManager.prototype.unsubscribe = function () {
|
|
7337
|
+
var e_1, _a;
|
|
7338
|
+
this.event$.complete();
|
|
7339
|
+
try {
|
|
7340
|
+
for (var _b = __values(this.stompSubscriptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7341
|
+
var stompSubscription = _c.value;
|
|
7342
|
+
stompSubscription.unsubscribe();
|
|
7343
|
+
}
|
|
7344
|
+
}
|
|
7345
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7346
|
+
finally {
|
|
7347
|
+
try {
|
|
7348
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7349
|
+
}
|
|
7350
|
+
finally { if (e_1) throw e_1.error; }
|
|
7351
|
+
}
|
|
7352
|
+
this.subscribed$.complete();
|
|
7353
|
+
};
|
|
7354
|
+
PrimitiveManager.prototype.fireEvent = function (event) {
|
|
7355
|
+
this.event$.next(event);
|
|
7356
|
+
};
|
|
7357
|
+
PrimitiveManager.prototype.subscribe = function () {
|
|
7358
|
+
var _a;
|
|
7359
|
+
var subscriptions = [];
|
|
7360
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
7361
|
+
subscriptions[_i] = arguments[_i];
|
|
7362
|
+
}
|
|
7363
|
+
(_a = this.stompSubscriptions).push.apply(_a, __spread(subscriptions));
|
|
7364
|
+
this.subscribed$.next(true);
|
|
7365
|
+
};
|
|
7366
|
+
PrimitiveManager.prototype.getEventObservable = function () {
|
|
7367
|
+
return this.event$.asObservable();
|
|
7368
|
+
};
|
|
7369
|
+
PrimitiveManager.prototype.getSubscriptionObservable = function () {
|
|
7370
|
+
return this.subscribed$.asObservable();
|
|
7371
|
+
};
|
|
7372
|
+
PrimitiveManager.prototype.hasObservers = function () {
|
|
7373
|
+
// @IMPORTANT: Replace .observers.length === 1 with .observed in rxjs 7.0+
|
|
7374
|
+
return this.event$.observers.length !== 1;
|
|
7375
|
+
};
|
|
7376
|
+
PrimitiveManager.prototype.getObserversCount = function () {
|
|
7377
|
+
return this.event$.observers.length;
|
|
7378
|
+
};
|
|
7379
|
+
return PrimitiveManager;
|
|
7380
|
+
}());
|
|
7381
|
+
|
|
7382
|
+
var RECONNECT_INTERVAL_MILLISECONDS = 3000;
|
|
7383
|
+
var CONNECTION_TIMEOUT_MILLISECONDS = 5000;
|
|
7209
7384
|
var WebsocketService = /** @class */ (function () {
|
|
7210
|
-
function WebsocketService() {
|
|
7211
|
-
|
|
7212
|
-
this.wasConnected = false;
|
|
7213
|
-
/** @private */
|
|
7214
|
-
this.isConnected = false;
|
|
7215
|
-
/** @private */
|
|
7216
|
-
this.isConnecting = false;
|
|
7217
|
-
/** @private */
|
|
7218
|
-
this.primitiveManagers = new Map();
|
|
7219
|
-
/** @private */
|
|
7385
|
+
function WebsocketService(userInformationService) {
|
|
7386
|
+
this.userInformationService = userInformationService;
|
|
7220
7387
|
this.connected$ = new BehaviorSubject(false);
|
|
7221
|
-
|
|
7222
|
-
this.
|
|
7223
|
-
/** @private */
|
|
7224
|
-
this.reconnect$ = new Subject();
|
|
7225
|
-
/** @private */
|
|
7388
|
+
this.disconnected$ = new Subject();
|
|
7389
|
+
this.reconnected$ = new Subject();
|
|
7226
7390
|
this.error$ = new Subject();
|
|
7227
7391
|
this.subscribed$ = new Subject();
|
|
7392
|
+
this.primitiveManagers = new Map();
|
|
7393
|
+
this.connectionLock = new AsyncLock();
|
|
7394
|
+
this.debugEnable = false;
|
|
7395
|
+
this.lostConnection = false;
|
|
7228
7396
|
}
|
|
7229
|
-
WebsocketService_1 = WebsocketService;
|
|
7230
7397
|
/**
|
|
7231
|
-
*
|
|
7232
|
-
* @return Um `Observable<void>` que emite uma notificação quando a conexão websocket é estabelecida pela primeira vez.
|
|
7398
|
+
* Enables stompjs debug logs and additional info
|
|
7233
7399
|
*/
|
|
7234
|
-
WebsocketService.prototype.
|
|
7235
|
-
|
|
7400
|
+
WebsocketService.prototype.enableDebugLogs = function () {
|
|
7401
|
+
this.debugEnable = true;
|
|
7236
7402
|
};
|
|
7237
7403
|
/**
|
|
7238
|
-
*
|
|
7239
|
-
* @return Um `Observable<void>` que emite uma notificação quando a conexão é desconectada.
|
|
7404
|
+
* Manually starts the connection
|
|
7240
7405
|
*/
|
|
7241
|
-
WebsocketService.prototype.
|
|
7242
|
-
return this
|
|
7406
|
+
WebsocketService.prototype.connect = function () {
|
|
7407
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7408
|
+
var stompConfig;
|
|
7409
|
+
var _this = this;
|
|
7410
|
+
return __generator(this, function (_a) {
|
|
7411
|
+
switch (_a.label) {
|
|
7412
|
+
case 0: return [4 /*yield*/, this.connectionLock.acquire()];
|
|
7413
|
+
case 1:
|
|
7414
|
+
_a.sent();
|
|
7415
|
+
_a.label = 2;
|
|
7416
|
+
case 2:
|
|
7417
|
+
_a.trys.push([2, , 3, 5]);
|
|
7418
|
+
if (this.isConnected() || this.isConnecting()) {
|
|
7419
|
+
return [2 /*return*/];
|
|
7420
|
+
}
|
|
7421
|
+
this.lostConnection = false;
|
|
7422
|
+
stompConfig = {
|
|
7423
|
+
webSocketFactory: function () {
|
|
7424
|
+
return new SockJS(_this.getSubscriptionUrl(), null, {
|
|
7425
|
+
timeout: CONNECTION_TIMEOUT_MILLISECONDS
|
|
7426
|
+
});
|
|
7427
|
+
},
|
|
7428
|
+
connectionTimeout: CONNECTION_TIMEOUT_MILLISECONDS,
|
|
7429
|
+
reconnectDelay: RECONNECT_INTERVAL_MILLISECONDS,
|
|
7430
|
+
debug: this.debug.bind(this),
|
|
7431
|
+
onConnect: this.handleOnConnected.bind(this),
|
|
7432
|
+
onDisconnect: this.handleOnDisconnect.bind(this),
|
|
7433
|
+
onWebSocketClose: this.handleOnWebSocketClose.bind(this),
|
|
7434
|
+
onStompError: this.handleOnStompError.bind(this),
|
|
7435
|
+
onWebSocketError: this.handleOnWebSocketError.bind(this)
|
|
7436
|
+
};
|
|
7437
|
+
this.debug('Connecting the Webscoket');
|
|
7438
|
+
this.stompClient = new Client(stompConfig);
|
|
7439
|
+
this.stompClient.activate();
|
|
7440
|
+
return [3 /*break*/, 5];
|
|
7441
|
+
case 3: return [4 /*yield*/, this.connectionLock.release()];
|
|
7442
|
+
case 4:
|
|
7443
|
+
_a.sent();
|
|
7444
|
+
return [7 /*endfinally*/];
|
|
7445
|
+
case 5: return [2 /*return*/];
|
|
7446
|
+
}
|
|
7447
|
+
});
|
|
7448
|
+
});
|
|
7243
7449
|
};
|
|
7244
7450
|
/**
|
|
7245
|
-
*
|
|
7246
|
-
* @return Um `Observable<void>` que emite uma notificação quando a conexão é reconectada.
|
|
7451
|
+
* Manually disconnect the websocket. The reconnect loop will be stopped.
|
|
7247
7452
|
*/
|
|
7248
|
-
WebsocketService.prototype.
|
|
7249
|
-
return this
|
|
7453
|
+
WebsocketService.prototype.disconnect = function () {
|
|
7454
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7455
|
+
var _a, _b, primitiveManager;
|
|
7456
|
+
var e_1, _c;
|
|
7457
|
+
return __generator(this, function (_d) {
|
|
7458
|
+
switch (_d.label) {
|
|
7459
|
+
case 0:
|
|
7460
|
+
if (!this.isConnected()) {
|
|
7461
|
+
return [2 /*return*/];
|
|
7462
|
+
}
|
|
7463
|
+
return [4 /*yield*/, this.connectionLock.acquire()];
|
|
7464
|
+
case 1:
|
|
7465
|
+
_d.sent();
|
|
7466
|
+
_d.label = 2;
|
|
7467
|
+
case 2:
|
|
7468
|
+
_d.trys.push([2, , 5, 7]);
|
|
7469
|
+
try {
|
|
7470
|
+
for (_a = __values(this.primitiveManagers.values()), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
7471
|
+
primitiveManager = _b.value;
|
|
7472
|
+
primitiveManager.unsubscribe();
|
|
7473
|
+
}
|
|
7474
|
+
}
|
|
7475
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7476
|
+
finally {
|
|
7477
|
+
try {
|
|
7478
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
7479
|
+
}
|
|
7480
|
+
finally { if (e_1) throw e_1.error; }
|
|
7481
|
+
}
|
|
7482
|
+
this.primitiveManagers.clear();
|
|
7483
|
+
this.connected$.next(false);
|
|
7484
|
+
if (!this.stompClient) return [3 /*break*/, 4];
|
|
7485
|
+
return [4 /*yield*/, this.stompClient.deactivate()];
|
|
7486
|
+
case 3:
|
|
7487
|
+
_d.sent();
|
|
7488
|
+
_d.label = 4;
|
|
7489
|
+
case 4: return [3 /*break*/, 7];
|
|
7490
|
+
case 5: return [4 /*yield*/, this.connectionLock.release()];
|
|
7491
|
+
case 6:
|
|
7492
|
+
_d.sent();
|
|
7493
|
+
return [7 /*endfinally*/];
|
|
7494
|
+
case 7: return [2 /*return*/];
|
|
7495
|
+
}
|
|
7496
|
+
});
|
|
7497
|
+
});
|
|
7250
7498
|
};
|
|
7251
7499
|
/**
|
|
7252
|
-
*
|
|
7253
|
-
* @return
|
|
7500
|
+
* Check if the websocket is connected
|
|
7501
|
+
* @return `boolean` representing if the websocket is connected
|
|
7254
7502
|
*/
|
|
7255
|
-
WebsocketService.prototype.
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
return this.
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
}
|
|
7503
|
+
WebsocketService.prototype.isConnected = function () {
|
|
7504
|
+
if (!this.stompClient) {
|
|
7505
|
+
return false;
|
|
7506
|
+
}
|
|
7507
|
+
return this.stompClient.connected;
|
|
7508
|
+
};
|
|
7509
|
+
/**
|
|
7510
|
+
* Check if the websocket is tring to connect
|
|
7511
|
+
* @return `boolean` representing if the websocket status
|
|
7512
|
+
*/
|
|
7513
|
+
WebsocketService.prototype.isConnecting = function () {
|
|
7514
|
+
if (!this.stompClient) {
|
|
7515
|
+
return false;
|
|
7516
|
+
}
|
|
7517
|
+
return !this.stompClient.connected && this.stompClient.active;
|
|
7518
|
+
};
|
|
7519
|
+
/**
|
|
7520
|
+
* Event responsable to emit an event when the connection is established.
|
|
7521
|
+
* Do not forget to unsubscribe the observable when you don't need it anymore.
|
|
7522
|
+
* @return `Observable<boolean>`
|
|
7523
|
+
*/
|
|
7524
|
+
WebsocketService.prototype.onConnect = function () {
|
|
7525
|
+
return this.connected$.asObservable()
|
|
7526
|
+
.pipe(filter(function (p) { return p === true; }));
|
|
7527
|
+
};
|
|
7528
|
+
/**
|
|
7529
|
+
* Event responsable to emit an event when the connection is closed.
|
|
7530
|
+
* Do not forget to unsubscribe the observable when you don't need it anymore.
|
|
7531
|
+
* @return `Observable<void>`
|
|
7532
|
+
*/
|
|
7533
|
+
WebsocketService.prototype.onDisconnect = function () {
|
|
7534
|
+
return this.disconnected$.asObservable();
|
|
7535
|
+
};
|
|
7536
|
+
/**
|
|
7537
|
+
* Event responsable to emit an event when the connection is reestablished.
|
|
7538
|
+
* Do not forget to unsubscribe the observable when you don't need it anymore.
|
|
7539
|
+
* @return `Observable<void>`
|
|
7540
|
+
*/
|
|
7541
|
+
WebsocketService.prototype.onReconnect = function () {
|
|
7542
|
+
return this.reconnected$.asObservable();
|
|
7269
7543
|
};
|
|
7270
7544
|
/**
|
|
7271
|
-
*
|
|
7272
|
-
*
|
|
7545
|
+
* Event responsable to emit an event when an error ocurred.
|
|
7546
|
+
* Do not forget to unsubscribe the observable when you don't need it anymore.
|
|
7547
|
+
* @return `Observable<FrameImpl>`
|
|
7273
7548
|
*/
|
|
7274
7549
|
WebsocketService.prototype.onError = function () {
|
|
7275
7550
|
return this.error$.asObservable();
|
|
7276
7551
|
};
|
|
7277
7552
|
/**
|
|
7278
|
-
*
|
|
7279
|
-
*
|
|
7280
|
-
* @
|
|
7281
|
-
* @param {
|
|
7282
|
-
* @
|
|
7283
|
-
* @return Um Observable<T> que emite notificações toda vez que o respectivo evento é publicado.
|
|
7553
|
+
* Event responsible to emit an event when a primitive is called.
|
|
7554
|
+
* Do not forget to unsubscribe the observable when you don't need it anymore.
|
|
7555
|
+
* @typeParam `<T>` Object type that will be used in the observable for the `data` property.
|
|
7556
|
+
* @param {OnEventOptions} options Configurations for the event.
|
|
7557
|
+
* @return `Observable<PrimitiveEvent<T>>` Observable that emits an event when the service calls the primitive.
|
|
7284
7558
|
*/
|
|
7285
7559
|
WebsocketService.prototype.onEvent = function (options) {
|
|
7286
7560
|
var _this = this;
|
|
7287
|
-
this.connect();
|
|
7288
7561
|
var domain = options.domain, service = options.service, primitive = options.primitive;
|
|
7289
|
-
var key = this.
|
|
7562
|
+
var key = this.buildPrimitiveManagerKey(domain, service, primitive);
|
|
7290
7563
|
if (this.primitiveManagers.has(key)) {
|
|
7291
|
-
return this.primitiveManagers.get(key).
|
|
7564
|
+
return this.primitiveManagers.get(key).getEventObservable();
|
|
7292
7565
|
}
|
|
7293
|
-
var primitiveManager =
|
|
7294
|
-
domain: domain,
|
|
7295
|
-
service: service,
|
|
7296
|
-
primitive: primitive,
|
|
7297
|
-
stompSubscriptions: [],
|
|
7298
|
-
event$: new Subject(),
|
|
7299
|
-
subscribed$: new BehaviorSubject(false)
|
|
7300
|
-
};
|
|
7566
|
+
var primitiveManager = new PrimitiveManager(domain, service, primitive);
|
|
7301
7567
|
this.primitiveManagers.set(key, primitiveManager);
|
|
7302
|
-
this.
|
|
7303
|
-
.
|
|
7304
|
-
|
|
7305
|
-
|
|
7568
|
+
this.connect().then(function () {
|
|
7569
|
+
_this.onConnect()
|
|
7570
|
+
.pipe(take(1))
|
|
7571
|
+
.subscribe(function () {
|
|
7572
|
+
_this.createStompSubscriptions(primitiveManager);
|
|
7573
|
+
});
|
|
7306
7574
|
});
|
|
7307
|
-
return primitiveManager
|
|
7308
|
-
.
|
|
7309
|
-
.pipe(finalize(function () { return _this.
|
|
7310
|
-
};
|
|
7311
|
-
/** @private */
|
|
7312
|
-
WebsocketService.prototype.createStompSubscriptions = function (primitiveManager) {
|
|
7313
|
-
var withTokenUrl = this.getSubscriptionUrlWithToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7314
|
-
var stompSubscriptionWithToken = this.createStompSubscription(withTokenUrl, primitiveManager);
|
|
7315
|
-
var withoutTokenUrl = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7316
|
-
var stompSubscriptionWithoutToken = this.createStompSubscription(withoutTokenUrl, primitiveManager);
|
|
7317
|
-
primitiveManager.stompSubscriptions = [
|
|
7318
|
-
stompSubscriptionWithToken,
|
|
7319
|
-
stompSubscriptionWithoutToken
|
|
7320
|
-
];
|
|
7321
|
-
primitiveManager.subscribed$.next(true);
|
|
7322
|
-
this.subscribed$.next(primitiveManager);
|
|
7575
|
+
return primitiveManager
|
|
7576
|
+
.getEventObservable()
|
|
7577
|
+
.pipe(finalize(function () { return _this.unsubscribePrimitiveOnFinalize(primitiveManager); }));
|
|
7323
7578
|
};
|
|
7324
|
-
/**
|
|
7325
|
-
|
|
7579
|
+
/**
|
|
7580
|
+
* Event responsible to emit an event when a subscription is created for the primitive.
|
|
7581
|
+
* Do not forget to unsubscribe the observable when you don't need it anymore.
|
|
7582
|
+
* @param {OnEventOptions} options Configurations for the event.
|
|
7583
|
+
* Observable responsável por emitir uma notificação após o subscribe do evento pela primeira vez.
|
|
7584
|
+
* @return `Observable<boolean>` Observable that emits an event when the service calls the primitive.
|
|
7585
|
+
*/
|
|
7586
|
+
WebsocketService.prototype.onSubscribe = function (options) {
|
|
7326
7587
|
var _this = this;
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
this.
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
_this.reconnectPrimitives();
|
|
7336
|
-
_this.connected$.next(true);
|
|
7337
|
-
_this.reconnect$.next();
|
|
7588
|
+
var domain = options.domain, service = options.service, primitive = options.primitive;
|
|
7589
|
+
var key = this.buildPrimitiveManagerKey(domain, service, primitive);
|
|
7590
|
+
return this.onConnect().pipe(take(1), switchMap(function () {
|
|
7591
|
+
if (_this.primitiveManagers.has(key)) {
|
|
7592
|
+
return _this.primitiveManagers
|
|
7593
|
+
.get(key)
|
|
7594
|
+
.getSubscriptionObservable()
|
|
7595
|
+
.pipe(take(1));
|
|
7338
7596
|
}
|
|
7339
|
-
|
|
7340
|
-
_this.
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
}, function (error) {
|
|
7344
|
-
_this.isConnected = false;
|
|
7345
|
-
_this.connected$.next(false);
|
|
7346
|
-
_this.error$.next(error);
|
|
7347
|
-
race(_this.disconnect$.pipe(take(1), map(function () { return ({ wasDisconnected: true }); })), timer(WebsocketService_1.RECONNECT_INTERVAL).pipe(take(1), switchMap(function () {
|
|
7348
|
-
return iif(function () { return document.hidden; }, fromEvent(document, 'visibilitychange').pipe(first()), of(void 0));
|
|
7349
|
-
}), map(function () { return ({ wasDisconnected: false }); })))
|
|
7350
|
-
.pipe(take(1))
|
|
7351
|
-
.subscribe({
|
|
7352
|
-
next: function (_a) {
|
|
7353
|
-
var wasDisconnected = _a.wasDisconnected;
|
|
7354
|
-
if (!wasDisconnected &&
|
|
7355
|
-
!(_this.isConnected || _this.isConnecting)) {
|
|
7356
|
-
_this.connect();
|
|
7357
|
-
}
|
|
7358
|
-
}
|
|
7359
|
-
});
|
|
7360
|
-
});
|
|
7597
|
+
return _this.subscribed$.asObservable().pipe(filter(function (primitiveManager) {
|
|
7598
|
+
return _this.buildPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive) === key;
|
|
7599
|
+
}), map(function () { return true; }), take(1));
|
|
7600
|
+
}));
|
|
7361
7601
|
};
|
|
7362
|
-
WebsocketService.prototype.
|
|
7363
|
-
var
|
|
7364
|
-
|
|
7602
|
+
WebsocketService.prototype.debug = function (message) {
|
|
7603
|
+
var optionalParams = [];
|
|
7604
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
7605
|
+
optionalParams[_i - 1] = arguments[_i];
|
|
7606
|
+
}
|
|
7607
|
+
if (!this.debugEnable) {
|
|
7365
7608
|
return;
|
|
7366
7609
|
}
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7610
|
+
console.log.apply(console, __spread(['WS debug: ' + message], optionalParams));
|
|
7611
|
+
};
|
|
7612
|
+
WebsocketService.prototype.info = function (message) {
|
|
7613
|
+
console.info('WS info: ' + message);
|
|
7614
|
+
};
|
|
7615
|
+
WebsocketService.prototype.handleOnConnected = function () {
|
|
7616
|
+
this.info('Webscoket connected');
|
|
7617
|
+
this.connected$.next(true);
|
|
7618
|
+
if (this.lostConnection) {
|
|
7619
|
+
this.info('Webscoket reconnected, recriating subscriptions');
|
|
7620
|
+
this.handleReconnection();
|
|
7621
|
+
}
|
|
7622
|
+
};
|
|
7623
|
+
WebsocketService.prototype.handleOnDisconnect = function () {
|
|
7624
|
+
this.info('Webscoket disconnected');
|
|
7625
|
+
this.connected$.next(false);
|
|
7626
|
+
this.disconnected$.next();
|
|
7627
|
+
};
|
|
7628
|
+
WebsocketService.prototype.handleOnWebSocketClose = function (data) {
|
|
7629
|
+
if (data.reason && data.reason.toLowerCase().indexOf("go away") !== -1) {
|
|
7630
|
+
this.lostConnection = true;
|
|
7631
|
+
this.handleError('AuthenticationError', new FrameImpl({
|
|
7632
|
+
command: data.type,
|
|
7633
|
+
headers: {
|
|
7634
|
+
message: data.reason
|
|
7382
7635
|
}
|
|
7383
|
-
}
|
|
7636
|
+
}));
|
|
7637
|
+
return;
|
|
7384
7638
|
}
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
try {
|
|
7388
|
-
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
7389
|
-
}
|
|
7390
|
-
finally { if (e_1) throw e_1.error; }
|
|
7639
|
+
if (data.wasClean) {
|
|
7640
|
+
return;
|
|
7391
7641
|
}
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7642
|
+
this.lostConnection = true;
|
|
7643
|
+
};
|
|
7644
|
+
WebsocketService.prototype.handleOnStompError = function (data) {
|
|
7645
|
+
this.handleError('StompError', data);
|
|
7646
|
+
if (this.isAuthenticationError(data)) {
|
|
7647
|
+
this.info('Authentication error, recriating subscriptions');
|
|
7648
|
+
this.handleReconnection();
|
|
7397
7649
|
}
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7650
|
+
};
|
|
7651
|
+
WebsocketService.prototype.isAuthenticationError = function (data) {
|
|
7652
|
+
var _a;
|
|
7653
|
+
var errorMessage = (_a = data === null || data === void 0 ? void 0 : data.headers) === null || _a === void 0 ? void 0 : _a.message;
|
|
7654
|
+
if (!errorMessage) {
|
|
7655
|
+
return false;
|
|
7404
7656
|
}
|
|
7405
|
-
|
|
7406
|
-
this._stompClient.disconnect();
|
|
7407
|
-
this._stompClient.deactivate();
|
|
7408
|
-
this.isConnected = false;
|
|
7409
|
-
this.isConnecting = false;
|
|
7410
|
-
this.wasConnected = false;
|
|
7411
|
-
this.connected$.next(false);
|
|
7412
|
-
this.disconnect$.next();
|
|
7657
|
+
return errorMessage.toLowerCase().indexOf('forbiddenexception') !== -1;
|
|
7413
7658
|
};
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
var tenant = WebsocketService_1.TOKEN
|
|
7417
|
-
? WebsocketService_1.TOKEN.username.split('@')[1]
|
|
7418
|
-
: null;
|
|
7419
|
-
var token = WebsocketService_1.TOKEN
|
|
7420
|
-
? WebsocketService_1.TOKEN.access_token
|
|
7421
|
-
: null;
|
|
7422
|
-
return "/topic/" + tenant + "/" + token + "/" + domain + "/" + service + "/" + primitive;
|
|
7659
|
+
WebsocketService.prototype.handleOnWebSocketError = function (data) {
|
|
7660
|
+
this.handleError('WebSocketError', data);
|
|
7423
7661
|
};
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
? WebsocketService_1.TOKEN.username.split('@')[1]
|
|
7428
|
-
: null;
|
|
7429
|
-
return "/topic/" + tenant + "/" + domain + "/" + service + "/" + primitive;
|
|
7662
|
+
WebsocketService.prototype.handleError = function (origin, data) {
|
|
7663
|
+
console.error(origin, data);
|
|
7664
|
+
this.error$.next(data);
|
|
7430
7665
|
};
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
primitiveManager.event$.next(event);
|
|
7436
|
-
});
|
|
7437
|
-
};
|
|
7438
|
-
/** @private */
|
|
7439
|
-
WebsocketService.prototype.createStompClient = function () {
|
|
7440
|
-
var ws = new SockJS(WebsocketService_1.WEBSOCKET_URL + "subscription", null, { timeout: WebsocketService_1.CONNECTION_TIMEOUT });
|
|
7441
|
-
this._stompClient = Stomp.over(ws);
|
|
7442
|
-
this._stompClient.debug = function () { return null; };
|
|
7666
|
+
WebsocketService.prototype.handleReconnection = function () {
|
|
7667
|
+
this.lostConnection = false;
|
|
7668
|
+
this.reconnectPrimitives();
|
|
7669
|
+
this.reconnected$.next();
|
|
7443
7670
|
};
|
|
7444
|
-
/** @private */
|
|
7445
7671
|
WebsocketService.prototype.reconnectPrimitives = function () {
|
|
7446
|
-
var
|
|
7672
|
+
var e_2, _a;
|
|
7447
7673
|
try {
|
|
7448
7674
|
for (var _b = __values(this.primitiveManagers.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7449
7675
|
var primitiveManager = _c.value;
|
|
7450
7676
|
this.createStompSubscriptions(primitiveManager);
|
|
7451
7677
|
}
|
|
7452
7678
|
}
|
|
7453
|
-
catch (
|
|
7679
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
7454
7680
|
finally {
|
|
7455
7681
|
try {
|
|
7456
7682
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7457
7683
|
}
|
|
7458
|
-
finally { if (
|
|
7684
|
+
finally { if (e_2) throw e_2.error; }
|
|
7459
7685
|
}
|
|
7460
7686
|
};
|
|
7461
|
-
|
|
7687
|
+
WebsocketService.prototype.buildSubscriptionUrlWithToken = function (domain, service, primitive) {
|
|
7688
|
+
var authToken = this.userInformationService.getAuthToken();
|
|
7689
|
+
var tenant = this.userInformationService.getTenantDomain();
|
|
7690
|
+
return "/topic/" + tenant + "/" + authToken + "/" + domain + "/" + service + "/" + primitive;
|
|
7691
|
+
};
|
|
7692
|
+
WebsocketService.prototype.getSubscriptionUrlWithoutToken = function (domain, service, primitive) {
|
|
7693
|
+
var tenant = this.userInformationService.getTenantDomain();
|
|
7694
|
+
return "/topic/" + tenant + "/" + domain + "/" + service + "/" + primitive;
|
|
7695
|
+
};
|
|
7696
|
+
WebsocketService.prototype.buildPrimitiveManagerKey = function (domain, service, primitive) {
|
|
7697
|
+
return domain + "/" + service + "/" + primitive;
|
|
7698
|
+
};
|
|
7699
|
+
WebsocketService.prototype.unsubscribePrimitiveOnFinalize = function (primitiveManager) {
|
|
7700
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7701
|
+
var key;
|
|
7702
|
+
return __generator(this, function (_a) {
|
|
7703
|
+
switch (_a.label) {
|
|
7704
|
+
case 0:
|
|
7705
|
+
if (primitiveManager.hasObservers()) {
|
|
7706
|
+
return [2 /*return*/];
|
|
7707
|
+
}
|
|
7708
|
+
primitiveManager.unsubscribe();
|
|
7709
|
+
key = this.buildPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7710
|
+
this.primitiveManagers.delete(key);
|
|
7711
|
+
return [4 /*yield*/, this.disconnectIfNoMoreObservables()];
|
|
7712
|
+
case 1:
|
|
7713
|
+
_a.sent();
|
|
7714
|
+
return [2 /*return*/];
|
|
7715
|
+
}
|
|
7716
|
+
});
|
|
7717
|
+
});
|
|
7718
|
+
};
|
|
7719
|
+
WebsocketService.prototype.disconnectIfNoMoreObservables = function () {
|
|
7720
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7721
|
+
return __generator(this, function (_a) {
|
|
7722
|
+
switch (_a.label) {
|
|
7723
|
+
case 0:
|
|
7724
|
+
if (!(this.getObserversCount() === 0)) return [3 /*break*/, 2];
|
|
7725
|
+
this.debug('Manually disconnecting because there are no more observers');
|
|
7726
|
+
return [4 /*yield*/, this.disconnect()];
|
|
7727
|
+
case 1:
|
|
7728
|
+
_a.sent();
|
|
7729
|
+
_a.label = 2;
|
|
7730
|
+
case 2: return [2 /*return*/];
|
|
7731
|
+
}
|
|
7732
|
+
});
|
|
7733
|
+
});
|
|
7734
|
+
};
|
|
7462
7735
|
WebsocketService.prototype.getObserversCount = function () {
|
|
7463
|
-
var e_5, _a;
|
|
7464
7736
|
var observersCount = 0;
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
observersCount += primitiveManager.event$.observers.length;
|
|
7469
|
-
}
|
|
7470
|
-
}
|
|
7471
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
7472
|
-
finally {
|
|
7473
|
-
try {
|
|
7474
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7475
|
-
}
|
|
7476
|
-
finally { if (e_5) throw e_5.error; }
|
|
7477
|
-
}
|
|
7737
|
+
this.primitiveManagers.forEach(function (primitiveManager) {
|
|
7738
|
+
observersCount += primitiveManager.getObserversCount();
|
|
7739
|
+
});
|
|
7478
7740
|
return observersCount;
|
|
7479
7741
|
};
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
if (hasObservers)
|
|
7486
|
-
return;
|
|
7487
|
-
primitiveManager.event$.complete();
|
|
7488
|
-
try {
|
|
7489
|
-
for (var _b = __values(primitiveManager.stompSubscriptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7490
|
-
var stompSubscription = _c.value;
|
|
7491
|
-
stompSubscription.unsubscribe();
|
|
7492
|
-
}
|
|
7493
|
-
}
|
|
7494
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
7495
|
-
finally {
|
|
7496
|
-
try {
|
|
7497
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7498
|
-
}
|
|
7499
|
-
finally { if (e_6) throw e_6.error; }
|
|
7500
|
-
}
|
|
7501
|
-
primitiveManager.subscribed$.complete();
|
|
7502
|
-
var key = this.getPrimitiveManagerKey(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7503
|
-
this.primitiveManagers.delete(key);
|
|
7504
|
-
this.disconnect();
|
|
7742
|
+
WebsocketService.prototype.createStompSubscription = function (destination, primitiveManager) {
|
|
7743
|
+
return this.stompClient.subscribe(destination, function (message) {
|
|
7744
|
+
var event = JSON.parse(message.body || '{}');
|
|
7745
|
+
primitiveManager.fireEvent(event);
|
|
7746
|
+
});
|
|
7505
7747
|
};
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7748
|
+
WebsocketService.prototype.createStompSubscriptions = function (primitiveManager) {
|
|
7749
|
+
var subscriptionUrlWithToken = this.buildSubscriptionUrlWithToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7750
|
+
var subscriptionUrlWithoutToken = this.getSubscriptionUrlWithoutToken(primitiveManager.domain, primitiveManager.service, primitiveManager.primitive);
|
|
7751
|
+
var stompSubscriptionWithToken = this.createStompSubscription(subscriptionUrlWithToken, primitiveManager);
|
|
7752
|
+
var stompSubscriptionWithoutToken = this.createStompSubscription(subscriptionUrlWithoutToken, primitiveManager);
|
|
7753
|
+
primitiveManager.subscribe(stompSubscriptionWithToken, stompSubscriptionWithoutToken);
|
|
7754
|
+
this.subscribed$.next(primitiveManager);
|
|
7755
|
+
};
|
|
7756
|
+
WebsocketService.prototype.getSubscriptionUrl = function () {
|
|
7757
|
+
return this.userInformationService.getWebSocketUrl() + "/subscription";
|
|
7509
7758
|
};
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
WebsocketService
|
|
7515
|
-
/** @private */
|
|
7516
|
-
WebsocketService.TOKEN_COOKIE = 'com.senior.token';
|
|
7517
|
-
/** @private */
|
|
7518
|
-
WebsocketService.TOKEN = JSON.parse(get(WebsocketService_1.TOKEN_COOKIE) || '{}');
|
|
7519
|
-
/** @private */
|
|
7520
|
-
WebsocketService.WEBSOCKET_URL = get(WebsocketService_1.BASE_URL_COOKIE) + '/websocket/';
|
|
7521
|
-
WebsocketService.ɵprov = ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(); }, token: WebsocketService, providedIn: "root" });
|
|
7522
|
-
WebsocketService = WebsocketService_1 = __decorate([
|
|
7759
|
+
WebsocketService.ctorParameters = function () { return [
|
|
7760
|
+
{ type: UserInformationService }
|
|
7761
|
+
]; };
|
|
7762
|
+
WebsocketService.ɵprov = ɵɵdefineInjectable({ factory: function WebsocketService_Factory() { return new WebsocketService(ɵɵinject(UserInformationService)); }, token: WebsocketService, providedIn: "root" });
|
|
7763
|
+
WebsocketService = __decorate([
|
|
7523
7764
|
Injectable({
|
|
7524
7765
|
providedIn: 'root'
|
|
7525
7766
|
})
|
|
@@ -7680,5 +7921,5 @@ var ModulesEnum;
|
|
|
7680
7921
|
* Generated bundle index. Do not edit.
|
|
7681
7922
|
*/
|
|
7682
7923
|
|
|
7683
|
-
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E043MpcLookup, E043PcmLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EnumAnaSin as ɵb, EnumNatCtb as ɵc, StorageService as ɵd,
|
|
7924
|
+
export { AgreementLookup, BankLookup, BeneficioFiscalLookup, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ContaInternaFilialLookup, CountryLookup, CplTriNotaSaidaE001EndLookup, CplTriNotaSaidaE001PesLookup, CplTriNotaSaidaE001TnsLookup, CplTriNotaSaidaE007UfsLookup, CplTriNotaSaidaE008RaiLookup, CplTriNotaSaidaE015MedLookup, CplTriNotaSaidaE020SnfLookup, CplTriNotaSaidaE024MsgLookup, CplTriNotaSaidaE028CpgLookup, CplTriNotaSaidaE032EdcLookup, CplTriNotaSaidaE051DisLookup, CplTriNotaSaidaE066FpgLookup, CplTriNotaSaidaE070EmpLookup, CplTriNotaSaidaE070FilLookup, CplTriNotaSaidaE075DerLookup, CplTriNotaSaidaE080SerLookup, CplTriNotaSaidaNaturezaReceitaPisCofinsLookup, CplTriNotaSaidaNcmLookup, CplTriNotaSaidaNfEntradaLookup, CplTriNotaSaidaNfSaidaLookup, CurrencyLookup, DocumentoLookup, E001EndLookup, E001PesLookup, E001TnsLookup, E001TnsSupEstLookup, E002TptLookup, E006PaiLookup, E007UfsLookup, E008CepLookup, E008RaiLookup, E012FamLookup, E015MedLookup, E020SnfLookup, E021MotLookup, E023CrpLookup, E024MsgLookup, E027EqiLookup, E027StrLookup, E028CpgLookup, E030AgeLookup, E030BanLookup, E031MoeLookup, E032EdcLookup, E035OcrLookup, E036InsLookup, E039PorLookup, E043MpcLookup, E043PcmLookup, E044CcuFinRatDepLookup, E044CcuLookup, E045PlaLookup, E046HpdLookup, E047NtgLookup, E048FctLookup, E048SfcLookup, E051DisLookup, E066FpgLookup, E067FinLookup, E069GreLookup, E070EmpLookup, E070EntLookup, E070FilLookup, E073PesLookup, E073VeiLookup, E075DerLookup, E080SerLookup, E081TabLookup, E082TprLookup, E085PesLookup, E089DocLookup, E090HrpComGerLookup, E090PesLookup, E091PlfFinRatLookup, E095PesLookup, E099UsuComGerLookup, E099UsuSupCprLookup, E140InsLookup, E140NfsLookup, E200LotLookup, E200SerLookup, E205DepLookup, E210DxpE075DerLookup, E210DxpLookup, E301TcrLookup, E403FprLookup, E420IcpLookup, E420IpcLookup, E420OcpLookup, E501TcpLookup, E600CcoLookup, E640LotLookup, EntityPersonProductLookup, EnumLogicalOperator, EquipmentLookup, ErpLookups, ErpLookupsModule, ErpPolling, ExportUtils, FiltersStorageService, FormUtilsService, HTTP_STATUS_CODE, LigacaoItemFornecedorLookup, LookupValidationUtils, ModulesEnum, NcmLookup, NotaFiscalEntradaLookup, NpsService, ParametersLookup, PrimitiveManager, ProdutoServicoLookup, QuantidadeDisponivelDemandaLookup, RequisicaoLookup, SegmentoLookup, TypeTaxesLookup, UnidadeMedidaLookup, UtilsModule, VerifyModulePermission, VerifyModulePermissions, WebsocketService, naturezaReceitaPisCofins, ɵ0, ErpLookupsService as ɵa, EnumAnaSin as ɵb, EnumNatCtb as ɵc, StorageService as ɵd, UserInformationService as ɵe, VerifyModulePermissionService as ɵf, VerifyModulePermissionsService as ɵg };
|
|
7684
7925
|
//# sourceMappingURL=senior-gestao-empresarial-angular-components.js.map
|