http-request-manager 18.5.10 → 18.5.12
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.
|
@@ -2853,21 +2853,20 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2853
2853
|
this.shouldRetry = true;
|
|
2854
2854
|
this.wsRetryAttempts = new BehaviorSubject(0);
|
|
2855
2855
|
this.wsRetryAttempts$ = this.wsRetryAttempts.asObservable();
|
|
2856
|
-
this.messages
|
|
2857
|
-
this.
|
|
2856
|
+
this.messages = new BehaviorSubject([]);
|
|
2857
|
+
this.messages$ = this.messages.asObservable();
|
|
2858
2858
|
this.userList = new BehaviorSubject([]);
|
|
2859
2859
|
this.userList$ = this.userList.asObservable();
|
|
2860
2860
|
this.user = new BehaviorSubject(null);
|
|
2861
2861
|
this.user$ = this.user.asObservable();
|
|
2862
|
+
this.channels = new BehaviorSubject(null);
|
|
2863
|
+
this.channels$ = this.channels.asObservable();
|
|
2862
2864
|
this.communicationMessages = new BehaviorSubject([]);
|
|
2863
2865
|
this.communicationMessages$ = this.communicationMessages.asObservable();
|
|
2864
2866
|
this.latestCommunicationMessages = new BehaviorSubject(null);
|
|
2865
2867
|
this.latestCommunicationMessages$ = this.latestCommunicationMessages.asObservable();
|
|
2866
2868
|
this.userAction = new BehaviorSubject(null);
|
|
2867
2869
|
this.userAction$ = this.userAction.asObservable();
|
|
2868
|
-
this.channels = [];
|
|
2869
|
-
this.channelList = [];
|
|
2870
|
-
this.messages = [];
|
|
2871
2870
|
this.wsConnection = false;
|
|
2872
2871
|
this.wsOptions = WSOptions.adapt();
|
|
2873
2872
|
// WebSocket
|
|
@@ -2878,6 +2877,9 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2878
2877
|
})), this.httpManagerService.messages$.pipe(tap((message) => {
|
|
2879
2878
|
if (!message)
|
|
2880
2879
|
return;
|
|
2880
|
+
// Add message to messages array
|
|
2881
|
+
const currentMessages = this.messages.value;
|
|
2882
|
+
this.messages.next([...currentMessages, message]);
|
|
2881
2883
|
console.log('Received:', message);
|
|
2882
2884
|
if (message.error === 'JWT_INVALID') {
|
|
2883
2885
|
this.shouldRetry = false;
|
|
@@ -2892,13 +2894,13 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2892
2894
|
switch (message.type) {
|
|
2893
2895
|
case 'channelsList':
|
|
2894
2896
|
console.log('💬 Channels:', message.channels);
|
|
2895
|
-
this.channelList = message.channels
|
|
2896
|
-
if (this.channelList.includes(wsOptions.id)) {
|
|
2897
|
-
|
|
2898
|
-
}
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2897
|
+
// this.channelList = message.channels
|
|
2898
|
+
// if (this.channelList.includes(wsOptions.id)) {
|
|
2899
|
+
// this.httpManagerService.subscribeToChannel(wsOptions.id)
|
|
2900
|
+
// } else {
|
|
2901
|
+
// this.httpManagerService.createChannel(wsOptions.id)
|
|
2902
|
+
// }
|
|
2903
|
+
this.channels.next(message.channels);
|
|
2902
2904
|
break;
|
|
2903
2905
|
case 'stateMangerMessage':
|
|
2904
2906
|
;
|
|
@@ -2924,8 +2926,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2924
2926
|
this.userList.next(message.data.users);
|
|
2925
2927
|
break;
|
|
2926
2928
|
default:
|
|
2927
|
-
|
|
2928
|
-
this.messages.push(message);
|
|
2929
|
+
// Messages are already added at the beginning of the tap
|
|
2929
2930
|
break;
|
|
2930
2931
|
}
|
|
2931
2932
|
}))))));
|
|
@@ -2934,9 +2935,9 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2934
2935
|
console.warn('Database storage requires dataType to be ARRAY');
|
|
2935
2936
|
if (!this.apiOptions.adapter)
|
|
2936
2937
|
console.warn('Database storage requires an adapter to define the data shape');
|
|
2937
|
-
if (this.
|
|
2938
|
+
if (this.databaseOptions && this.databaseOptions?.table === '')
|
|
2938
2939
|
console.warn('Database storage requires a table name');
|
|
2939
|
-
}), filter(() => this.dataType === DataType.ARRAY && !!this.apiOptions.adapter && !!this.
|
|
2940
|
+
}), filter(() => this.dataType === DataType.ARRAY && !!this.apiOptions.adapter && !!this.databaseOptions?.table), switchMap(() => {
|
|
2940
2941
|
const sampleData = this.apiOptions.adapter?.({}) || {};
|
|
2941
2942
|
const schemaKeys = Object.keys(sampleData).filter(key => sampleData[key] !== undefined);
|
|
2942
2943
|
let schema = '++id';
|
|
@@ -2947,7 +2948,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2947
2948
|
}
|
|
2948
2949
|
}
|
|
2949
2950
|
const tableDef = TableSchemaDef.adapt({
|
|
2950
|
-
table: this.
|
|
2951
|
+
table: this.databaseOptions?.table,
|
|
2951
2952
|
schema: schema
|
|
2952
2953
|
});
|
|
2953
2954
|
return this.dbManagerService.createDatabaseTable(tableDef);
|
|
@@ -3033,11 +3034,11 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3033
3034
|
this.setData$({});
|
|
3034
3035
|
}
|
|
3035
3036
|
}), concatMap(() => {
|
|
3036
|
-
if (this.hasDatabase && this.
|
|
3037
|
+
if (this.hasDatabase && this.databaseOptions?.table) {
|
|
3037
3038
|
const currentData = this.get()?.data;
|
|
3038
3039
|
const idsToDelete = Array.isArray(currentData) ? currentData.map((r) => r.id) : [];
|
|
3039
3040
|
if (idsToDelete.length > 0) {
|
|
3040
|
-
return this.dbManagerService.deleteTableRecords(this.
|
|
3041
|
+
return this.dbManagerService.deleteTableRecords(this.databaseOptions.table, idsToDelete);
|
|
3041
3042
|
}
|
|
3042
3043
|
}
|
|
3043
3044
|
return of(null);
|
|
@@ -3053,39 +3054,39 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3053
3054
|
data = (!data) ? (this.dataType === DataType.ARRAY) ? [] : {} : data;
|
|
3054
3055
|
this.setData$(data);
|
|
3055
3056
|
}), concatMap((data) => {
|
|
3056
|
-
if (this.hasDatabase && this.
|
|
3057
|
+
if (this.hasDatabase && this.databaseOptions?.table && Array.isArray(data) && data.length > 0) {
|
|
3057
3058
|
this.localStorageManagerService.updateStore({
|
|
3058
|
-
name: this.
|
|
3059
|
-
data: { ...this.
|
|
3059
|
+
name: this.databaseOptions.table,
|
|
3060
|
+
data: { ...this.databaseOptions, ...{ expires: this.utils.expires(this.databaseOptions.expiresIn) } }
|
|
3060
3061
|
});
|
|
3061
|
-
return this.dbManagerService.createTableRecords(this.
|
|
3062
|
+
return this.dbManagerService.createTableRecords(this.databaseOptions.table, data);
|
|
3062
3063
|
}
|
|
3063
3064
|
return of(data);
|
|
3064
3065
|
}));
|
|
3065
3066
|
};
|
|
3066
|
-
if (this.hasDatabase && this.
|
|
3067
|
+
if (this.hasDatabase && this.databaseOptions?.table) {
|
|
3067
3068
|
return this.dbManagerService.databaseExists().pipe(switchMap((dbExists) => {
|
|
3068
3069
|
if (!dbExists) {
|
|
3069
3070
|
const initObs = this.initDBStorageAsync();
|
|
3070
3071
|
return initObs.pipe(switchMap(() => fetchFromAPI()));
|
|
3071
3072
|
}
|
|
3072
|
-
return this.dbManagerService.hasDatabaseTable(this.
|
|
3073
|
+
return this.dbManagerService.hasDatabaseTable(this.databaseOptions.table).pipe(switchMap((tableExists) => {
|
|
3073
3074
|
if (!tableExists) {
|
|
3074
3075
|
const initObs = this.initDBStorageAsync();
|
|
3075
3076
|
return initObs.pipe(switchMap(() => fetchFromAPI()));
|
|
3076
3077
|
}
|
|
3077
|
-
return this.localStorageManagerService.store$(this.
|
|
3078
|
+
return this.localStorageManagerService.store$(this.databaseOptions.table).pipe(take(1), switchMap((storeData) => {
|
|
3078
3079
|
const expires = storeData?.expires || 0;
|
|
3079
3080
|
const hasExpired = expires > 0 && this.utils.hasExpired(expires);
|
|
3080
3081
|
if (hasExpired) {
|
|
3081
|
-
return this.dbManagerService.clearTable(this.
|
|
3082
|
+
return this.dbManagerService.clearTable(this.databaseOptions.table).pipe(switchMap(() => fetchFromAPI()), tap(() => {
|
|
3082
3083
|
this.localStorageManagerService.updateStore({
|
|
3083
|
-
name: this.
|
|
3084
|
-
data: { ...this.
|
|
3084
|
+
name: this.databaseOptions.table,
|
|
3085
|
+
data: { ...this.databaseOptions, ...{ expires: this.utils.expires(this.databaseOptions.expiresIn) } }
|
|
3085
3086
|
});
|
|
3086
3087
|
}));
|
|
3087
3088
|
}
|
|
3088
|
-
return this.dbManagerService.getTableRecords(this.
|
|
3089
|
+
return this.dbManagerService.getTableRecords(this.databaseOptions.table).pipe(switchMap((dbData) => {
|
|
3089
3090
|
if (Array.isArray(dbData) && dbData.length > 0) {
|
|
3090
3091
|
this.setData$(dbData);
|
|
3091
3092
|
return of(dbData);
|
|
@@ -3113,14 +3114,14 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3113
3114
|
if (method === 'CREATE')
|
|
3114
3115
|
this.addData$(data);
|
|
3115
3116
|
}), concatMap((data) => {
|
|
3116
|
-
if (this.hasDatabase && this.
|
|
3117
|
+
if (this.hasDatabase && this.databaseOptions?.table) {
|
|
3117
3118
|
const id = options.path?.length ? options.path[options.path.length - 1] : null;
|
|
3118
3119
|
if (method === 'DELETE' && id)
|
|
3119
|
-
return this.dbManagerService.deleteTableRecord(this.
|
|
3120
|
+
return this.dbManagerService.deleteTableRecord(this.databaseOptions.table, id);
|
|
3120
3121
|
if (method === 'UPDATE' && data)
|
|
3121
|
-
return this.dbManagerService.updateTableRecord(this.
|
|
3122
|
+
return this.dbManagerService.updateTableRecord(this.databaseOptions.table, data);
|
|
3122
3123
|
if (method === 'CREATE' && data)
|
|
3123
|
-
return this.dbManagerService.createTableRecord(this.
|
|
3124
|
+
return this.dbManagerService.createTableRecord(this.databaseOptions.table, data);
|
|
3124
3125
|
}
|
|
3125
3126
|
return of(data);
|
|
3126
3127
|
}));
|
|
@@ -3136,8 +3137,8 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3136
3137
|
if (this.wsConnection)
|
|
3137
3138
|
this.wsCommunication('CREATE', [...options?.path || [], data.id]);
|
|
3138
3139
|
}), concatMap((data) => {
|
|
3139
|
-
if (this.hasDatabase && this.
|
|
3140
|
-
return this.dbManagerService.createTableRecord(this.
|
|
3140
|
+
if (this.hasDatabase && this.databaseOptions?.table && data?.id) {
|
|
3141
|
+
return this.dbManagerService.createTableRecord(this.databaseOptions.table, data);
|
|
3141
3142
|
}
|
|
3142
3143
|
return of(data);
|
|
3143
3144
|
}));
|
|
@@ -3153,8 +3154,8 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3153
3154
|
if (this.wsConnection)
|
|
3154
3155
|
this.wsCommunication('UPDATE', [...options?.path || []]);
|
|
3155
3156
|
}), concatMap((data) => {
|
|
3156
|
-
if (this.hasDatabase && this.
|
|
3157
|
-
return this.dbManagerService.updateTableRecord(this.
|
|
3157
|
+
if (this.hasDatabase && this.databaseOptions?.table && data?.id) {
|
|
3158
|
+
return this.dbManagerService.updateTableRecord(this.databaseOptions.table, data);
|
|
3158
3159
|
}
|
|
3159
3160
|
return of(data);
|
|
3160
3161
|
}));
|
|
@@ -3170,8 +3171,8 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3170
3171
|
if (this.wsConnection)
|
|
3171
3172
|
this.wsCommunication('DELETE', [...options?.path || []]);
|
|
3172
3173
|
}), concatMap((data) => {
|
|
3173
|
-
if (this.hasDatabase && this.
|
|
3174
|
-
return this.dbManagerService.deleteTableRecord(this.
|
|
3174
|
+
if (this.hasDatabase && this.databaseOptions?.table && data?.id) {
|
|
3175
|
+
return this.dbManagerService.deleteTableRecord(this.databaseOptions.table, data.id);
|
|
3175
3176
|
}
|
|
3176
3177
|
return of(data);
|
|
3177
3178
|
}));
|
|
@@ -3221,16 +3222,17 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3221
3222
|
}
|
|
3222
3223
|
}));
|
|
3223
3224
|
})));
|
|
3225
|
+
this.databaseOptions = database;
|
|
3224
3226
|
this.maxRetries = this.apiOptions.ws?.retry?.times || 3;
|
|
3225
3227
|
this.retryDelay = (this.apiOptions.ws?.retry?.delay && this.apiOptions.ws.retry.delay * 1000) || 5 * 1000;
|
|
3226
3228
|
this.wsNextRetry = new BehaviorSubject(this.retryDelay);
|
|
3227
3229
|
this.wsNextRetry$ = this.wsNextRetry.asObservable();
|
|
3228
3230
|
this.setApiRequestOptions(apiOptions, dataType, database);
|
|
3229
|
-
this.
|
|
3230
|
-
if (this.
|
|
3231
|
+
this.connectionStatus$ = this.setupConnectionStatus();
|
|
3232
|
+
if (this.databaseOptions && this.databaseOptions.table) {
|
|
3231
3233
|
this.localStorageManagerService.createStore({
|
|
3232
|
-
name: this.
|
|
3233
|
-
data: { ...this.
|
|
3234
|
+
name: this.databaseOptions.table,
|
|
3235
|
+
data: { ...this.databaseOptions, ...{ expires: this.utils.expires(this.databaseOptions.expiresIn) } },
|
|
3234
3236
|
options: SettingOptions.adapt({
|
|
3235
3237
|
storage: StorageType.GLOBAL,
|
|
3236
3238
|
encrypted: false,
|
|
@@ -3241,15 +3243,18 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3241
3243
|
setApiRequestOptions(apiOptions, dataType, database) {
|
|
3242
3244
|
this.apiOptions = ApiRequest.adapt(apiOptions);
|
|
3243
3245
|
this.dataType = (dataType) ? dataType : DataType.ARRAY;
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
+
// Only update database options if a database parameter is explicitly provided
|
|
3247
|
+
if (database !== undefined) {
|
|
3248
|
+
this.hasDatabase = (database?.table) ? true : false;
|
|
3249
|
+
this.databaseOptions = (this.hasDatabase) ? DatabaseStorage.adapt(database) : undefined;
|
|
3250
|
+
}
|
|
3246
3251
|
// Update WebSocket retry settings when options change
|
|
3247
3252
|
if (this.apiOptions.ws?.retry) {
|
|
3248
3253
|
this.maxRetries = this.apiOptions.ws.retry.times || 3;
|
|
3249
3254
|
this.retryDelay = (this.apiOptions.ws.retry.delay && this.apiOptions.ws.retry.delay * 1000) || 5 * 1000;
|
|
3250
3255
|
this.wsNextRetry.next(this.retryDelay);
|
|
3251
3256
|
}
|
|
3252
|
-
if (this.
|
|
3257
|
+
if (this.databaseOptions)
|
|
3253
3258
|
this.initDBStorage();
|
|
3254
3259
|
if (this.apiOptions.ws)
|
|
3255
3260
|
this.initWS(this.apiOptions.ws);
|
|
@@ -3346,7 +3351,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3346
3351
|
console.warn('Database storage requires an adapter to define the data shape');
|
|
3347
3352
|
return of(null);
|
|
3348
3353
|
}
|
|
3349
|
-
if (!this.
|
|
3354
|
+
if (!this.databaseOptions?.table) {
|
|
3350
3355
|
console.warn('Database storage requires a table name');
|
|
3351
3356
|
return of(null);
|
|
3352
3357
|
}
|
|
@@ -3360,7 +3365,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
3360
3365
|
}
|
|
3361
3366
|
}
|
|
3362
3367
|
const tableDef = TableSchemaDef.adapt({
|
|
3363
|
-
table: this.
|
|
3368
|
+
table: this.databaseOptions?.table,
|
|
3364
3369
|
schema: schema
|
|
3365
3370
|
});
|
|
3366
3371
|
return this.dbManagerService.createDatabaseTable(tableDef);
|
|
@@ -4098,7 +4103,8 @@ class StateRequestServiceDemo extends HTTPManagerStateService {
|
|
|
4098
4103
|
}),
|
|
4099
4104
|
}
|
|
4100
4105
|
});
|
|
4101
|
-
this.userAction
|
|
4106
|
+
this.userAction$
|
|
4107
|
+
.subscribe(user => {
|
|
4102
4108
|
console.log('User Action:', user);
|
|
4103
4109
|
});
|
|
4104
4110
|
}
|
|
@@ -4107,6 +4113,9 @@ class StateRequestServiceDemo extends HTTPManagerStateService {
|
|
|
4107
4113
|
console.log('sendMessage', data);
|
|
4108
4114
|
this.wsMessaging(data);
|
|
4109
4115
|
}
|
|
4116
|
+
getAllChannels() {
|
|
4117
|
+
this.httpManagerService.getAllChannels();
|
|
4118
|
+
}
|
|
4110
4119
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StateRequestServiceDemo, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4111
4120
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StateRequestServiceDemo, providedIn: 'root' }); }
|
|
4112
4121
|
}
|
|
@@ -4144,8 +4153,10 @@ class StateDataRequestService extends HTTPManagerStateService {
|
|
|
4144
4153
|
}));
|
|
4145
4154
|
this.attempts$ = this.wsRetryAttempts$;
|
|
4146
4155
|
this.nextRetry$ = this.wsNextRetry$;
|
|
4156
|
+
this.path = ['ai', 'tests'];
|
|
4147
4157
|
}
|
|
4148
|
-
updateConnection(server, wsServer, jwtToken, user) {
|
|
4158
|
+
updateConnection(server, wsServer, jwtToken, user, path = ['ai', 'tests']) {
|
|
4159
|
+
this.path = path;
|
|
4149
4160
|
this.setApiRequestOptions({
|
|
4150
4161
|
server,
|
|
4151
4162
|
retry: RetryOptions.adapt({
|
|
@@ -4173,7 +4184,7 @@ class StateDataRequestService extends HTTPManagerStateService {
|
|
|
4173
4184
|
"email": "mikeboni@hotmail.com",
|
|
4174
4185
|
"first_name": "mike"
|
|
4175
4186
|
};
|
|
4176
|
-
this.createRecord(newData, RequestOptions.adapt({ path:
|
|
4187
|
+
this.createRecord(newData, RequestOptions.adapt({ path: this.path }));
|
|
4177
4188
|
}
|
|
4178
4189
|
sendMessage(data) {
|
|
4179
4190
|
debugger;
|
|
@@ -4181,15 +4192,15 @@ class StateDataRequestService extends HTTPManagerStateService {
|
|
|
4181
4192
|
this.wsMessaging(data);
|
|
4182
4193
|
}
|
|
4183
4194
|
getData() {
|
|
4184
|
-
this.fetchRecords(RequestOptions.adapt({ path:
|
|
4195
|
+
this.fetchRecords(RequestOptions.adapt({ path: this.path }));
|
|
4185
4196
|
}
|
|
4186
4197
|
updateData(data) {
|
|
4187
|
-
const sampleOptions = RequestOptions.adapt({ path: [
|
|
4198
|
+
const sampleOptions = RequestOptions.adapt({ path: [...this.path, data.id] });
|
|
4188
4199
|
console.log('updateData', sampleOptions);
|
|
4189
4200
|
this.updateRecord(data, sampleOptions);
|
|
4190
4201
|
}
|
|
4191
4202
|
deleteData(data) {
|
|
4192
|
-
const sampleOptions = RequestOptions.adapt({ path: [
|
|
4203
|
+
const sampleOptions = RequestOptions.adapt({ path: [...this.path, data.id] });
|
|
4193
4204
|
console.log('deleteData', sampleOptions);
|
|
4194
4205
|
this.deleteRecord(sampleOptions);
|
|
4195
4206
|
}
|
|
@@ -4205,6 +4216,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
4205
4216
|
|
|
4206
4217
|
class WsDataControlComponent {
|
|
4207
4218
|
constructor() {
|
|
4219
|
+
this.path = ['ai', 'tests'];
|
|
4208
4220
|
this.stateDataRequestService = inject(StateDataRequestService);
|
|
4209
4221
|
this.user$ = this.stateDataRequestService.user$;
|
|
4210
4222
|
this.users$ = this.stateDataRequestService.userList$;
|
|
@@ -4216,7 +4228,7 @@ class WsDataControlComponent {
|
|
|
4216
4228
|
};
|
|
4217
4229
|
}
|
|
4218
4230
|
ngOnInit() {
|
|
4219
|
-
this.stateDataRequestService.updateConnection(this.server, this.wsServer, this.jwtToken, this.user);
|
|
4231
|
+
this.stateDataRequestService.updateConnection(this.server, this.wsServer, this.jwtToken, this.user, this.path);
|
|
4220
4232
|
this.stateDataRequestService.getData();
|
|
4221
4233
|
}
|
|
4222
4234
|
onGetData() {
|
|
@@ -4241,7 +4253,7 @@ class WsDataControlComponent {
|
|
|
4241
4253
|
this.stateDataRequestService.deleteData(lastRec);
|
|
4242
4254
|
}
|
|
4243
4255
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsDataControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4244
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem;\">\n @if ((users$ |async); as users) {\n <div>\n @if (users.length > 0) {\n <h3 style=\"margin: 0;\">Connected Users</h3>\n } @else {\n <h3 style=\"margin: 0;\">No Users</h3>\n }\n <mat-chip-set>\n @for (user of users; track user) {\n <mat-chip\n [class.user-chip--primary]=\"isUser(user, (user$ | async))\"\n [style.color]=\"isUser(user, (user$ | async)) ? '#fff' : null\"\n [disableRipple]=\"true\"\n >\n {{ user.content.name }}\n </mat-chip>\n }\n </mat-chip-set>\n </div>\n }\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"box\" style=\"margin-bottom: 1rem;\" *ngIf=\"(userAction$ | async) as userAction\">\n {{ userAction?.content.user.name }} has {{ userAction?.content.method }}\n </div>\n\n <h3 style=\"margin: 0;\">Data Actions</h3>\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button color=\"accent\" (click)=\"onUpdateData(data)\">Update Data</button>\n <button mat-stroked-button color=\"warn\" (click)=\"onRemoveData(data)\">Remove Data</button>\n <button mat-stroked-button color=\"primary\" (click)=\"onAddData()\">Add Data</button>\n </div>\n @if (data.length > 0) {\n <div>\n <table mat-table [dataSource]=\"data\" style=\"border: 1px solid grey;\">\n <ng-container matColumnDef=\"id\">\n <th mat-header-cell *matHeaderCellDef> ID </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.id}} </td>\n </ng-container>\n <ng-container matColumnDef=\"spiffe\">\n <th mat-header-cell *matHeaderCellDef> Spiffe </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.spiffe}} </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef> Name </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.first_name}} {{element.last_name}}</td>\n </ng-container>\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef> Email </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.email}} </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"['id', 'spiffe', 'name', 'email']\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: ['id', 'spiffe', 'name', 'email'];\"></tr>\n </table>\n <div style=\"border: 1px solid grey; padding: .5rem; border-top: none;\">\n <h3 style=\"margin: 0;\">Total Records {{ data.length }}</h3>\n </div>\n </div>\n } @else {\n <div style=\"margin-top: 1rem; font-style: italic;\">\n No Data Available\n </div>\n }\n </div>\n}\n\n", styles: [".user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}.user-chip--primary :is(.mdc-evolution-chip__text-label,.mdc-evolution-chip__action,.mdc-evolution-chip__cell,.mat-mdc-chip-action-label){color:#fff!important}.user-chip--primary,.user-chip--primary *{color:#fff!important}:host ::ng-deep .user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}:host ::ng-deep .user-chip--primary .mdc-evolution-chip__text-label,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__action,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__cell,:host ::ng-deep .user-chip--primary .mat-mdc-chip-action-label,:host ::ng-deep .user-chip--primary *{color:#fff!important}.box{padding:.5rem;border:1px solid rgb(174,174,13);background-color:#ececaf}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i3$1.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i11.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
4256
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user", path: "path" }, ngImport: i0, template: "@if ((data$ | async); as data) {\n <div style=\"margin: 1rem;\">\n @if ((users$ |async); as users) {\n <div>\n @if (users.length > 0) {\n <h3 style=\"margin: 0;\">Connected Users</h3>\n } @else {\n <h3 style=\"margin: 0;\">No Users</h3>\n }\n <mat-chip-set>\n @for (user of users; track user) {\n <mat-chip\n [class.user-chip--primary]=\"isUser(user, (user$ | async))\"\n [style.color]=\"isUser(user, (user$ | async)) ? '#fff' : null\"\n [disableRipple]=\"true\"\n >\n {{ user.content.name }}\n </mat-chip>\n }\n </mat-chip-set>\n </div>\n }\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <div class=\"box\" style=\"margin-bottom: 1rem;\" *ngIf=\"(userAction$ | async) as userAction\">\n {{ userAction?.content.user.name }} has {{ userAction?.content.method }}\n </div>\n\n <h3 style=\"margin: 0;\">Data Actions</h3>\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button color=\"accent\" (click)=\"onUpdateData(data)\">Update Data</button>\n <button mat-stroked-button color=\"warn\" (click)=\"onRemoveData(data)\">Remove Data</button>\n <button mat-stroked-button color=\"primary\" (click)=\"onAddData()\">Add Data</button>\n </div>\n @if (data.length > 0) {\n <div>\n <table mat-table [dataSource]=\"data\" style=\"border: 1px solid grey;\">\n <ng-container matColumnDef=\"id\">\n <th mat-header-cell *matHeaderCellDef> ID </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.id}} </td>\n </ng-container>\n <ng-container matColumnDef=\"spiffe\">\n <th mat-header-cell *matHeaderCellDef> Spiffe </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.spiffe}} </td>\n </ng-container>\n <ng-container matColumnDef=\"name\">\n <th mat-header-cell *matHeaderCellDef> Name </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.first_name}} {{element.last_name}}</td>\n </ng-container>\n <ng-container matColumnDef=\"email\">\n <th mat-header-cell *matHeaderCellDef> Email </th>\n <td mat-cell *matCellDef=\"let element\"> {{element.email}} </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"['id', 'spiffe', 'name', 'email']\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: ['id', 'spiffe', 'name', 'email'];\"></tr>\n </table>\n <div style=\"border: 1px solid grey; padding: .5rem; border-top: none;\">\n <h3 style=\"margin: 0;\">Total Records {{ data.length }}</h3>\n </div>\n </div>\n } @else {\n <div style=\"margin-top: 1rem; font-style: italic;\">\n No Data Available\n </div>\n }\n </div>\n}\n\n", styles: [".user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}.user-chip--primary :is(.mdc-evolution-chip__text-label,.mdc-evolution-chip__action,.mdc-evolution-chip__cell,.mat-mdc-chip-action-label){color:#fff!important}.user-chip--primary,.user-chip--primary *{color:#fff!important}:host ::ng-deep .user-chip--primary{background-color:var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5))!important;color:#fff!important;--mdc-evolution-chip-container-color: var(--mdc-theme-primary, var(--md-sys-color-primary, #3f51b5));--mdc-evolution-chip-label-text-color: #fff}:host ::ng-deep .user-chip--primary .mdc-evolution-chip__text-label,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__action,:host ::ng-deep .user-chip--primary .mdc-evolution-chip__cell,:host ::ng-deep .user-chip--primary .mat-mdc-chip-action-label,:host ::ng-deep .user-chip--primary *{color:#fff!important}.box{padding:.5rem;border:1px solid rgb(174,174,13);background-color:#ececaf}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i3$1.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i11.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
4245
4257
|
}
|
|
4246
4258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsDataControlComponent, decorators: [{
|
|
4247
4259
|
type: Component,
|
|
@@ -4254,16 +4266,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
4254
4266
|
type: Input
|
|
4255
4267
|
}], user: [{
|
|
4256
4268
|
type: Input
|
|
4269
|
+
}], path: [{
|
|
4270
|
+
type: Input
|
|
4257
4271
|
}] } });
|
|
4258
4272
|
|
|
4259
4273
|
class WsMessagingComponent {
|
|
4260
4274
|
constructor() {
|
|
4261
4275
|
this.fb = inject(FormBuilder);
|
|
4262
4276
|
this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
|
|
4277
|
+
this.channels$ = this.stateRequestServiceDemo.channels$;
|
|
4263
4278
|
this.user$ = this.stateRequestServiceDemo.user$;
|
|
4264
4279
|
this.users$ = this.stateRequestServiceDemo.userList$;
|
|
4265
4280
|
this.data$ = this.stateRequestServiceDemo.data$;
|
|
4281
|
+
this.connectionStatus$ = this.stateRequestServiceDemo.connectionStatus$;
|
|
4266
4282
|
this.messages = this.fb.group({
|
|
4283
|
+
channels: this.fb.control(null, Validators.required),
|
|
4267
4284
|
toUsers: this.fb.control(null, Validators.required),
|
|
4268
4285
|
content: this.fb.control(null, Validators.required),
|
|
4269
4286
|
});
|
|
@@ -4305,6 +4322,9 @@ class WsMessagingComponent {
|
|
|
4305
4322
|
return { user: mainUser, messages };
|
|
4306
4323
|
}));
|
|
4307
4324
|
}
|
|
4325
|
+
get channels() {
|
|
4326
|
+
return this.messages.get('channels');
|
|
4327
|
+
}
|
|
4308
4328
|
get toUsers() {
|
|
4309
4329
|
return this.messages.get('toUsers');
|
|
4310
4330
|
}
|
|
@@ -4317,6 +4337,10 @@ class WsMessagingComponent {
|
|
|
4317
4337
|
ngOnInit() {
|
|
4318
4338
|
this.stateRequestServiceDemo.updateConnection(this.server, this.wsServer, this.jwtToken, this.user);
|
|
4319
4339
|
// this.stateRequestServiceDemo.getData()
|
|
4340
|
+
this.connectionStatus$
|
|
4341
|
+
.subscribe(status => {
|
|
4342
|
+
this.stateRequestServiceDemo.getAllChannels();
|
|
4343
|
+
});
|
|
4320
4344
|
}
|
|
4321
4345
|
onSendMessage(user) {
|
|
4322
4346
|
this.messages.markAllAsTouched();
|
|
@@ -4340,11 +4364,11 @@ class WsMessagingComponent {
|
|
|
4340
4364
|
this.content.reset();
|
|
4341
4365
|
}
|
|
4342
4366
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsMessagingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4343
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "
|
|
4367
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "\n @if ((data$ | async); as data) {\n <div style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n <div>\n\n <div>\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"flex:1\" [formGroup]=\"messages\">\n\n <div style=\"display:flex; gap: 1rem\">\n @if ((channels$ | async); as channels) {\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Channels</mat-label>\n <mat-select formControlName=\"channels\" multiple #channelsSelect>\n <mat-select-trigger>\n {{ (channelsSelect.value?.[0] === 'allChannels' ? 'All Channels' : channelsSelect.value?.[0]?.content?.name) || '' }}\n @if ((channelsSelect.value?.length || 0) > 1) {\n <span>\n (+{{(channelsSelect.value?.length || 0) - 1}} {{channelsSelect.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n <mat-option value=\"allChannels\">\n All Channels\n </mat-option>\n @for (channel of channels; track channel) {\n <mat-option [value]=\"channel\">\n {{ channel }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n @if ((users$ | async); as users) {\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUsers\" multiple #userSelect>\n <mat-select-trigger>\n {{ (userSelect.value?.[0] === 'allUsers' ? 'All Users' : userSelect.value?.[0]?.content?.name) || '' }}\n @if ((userSelect.value?.length || 0) > 1) {\n <span>\n (+{{(userSelect.value?.length || 0) - 1}} {{userSelect.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n <mat-option value=\"allChannels\">\n All Users\n </mat-option>\n @for (user of users; track user) {\n <mat-option [value]=\"user\">\n {{ user.content.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n </div>\n\n @if ((users$ | async); as users) {\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Send a Message</mat-label>\n <textarea\n matInput placeholder=\"Ex. It makes me feel...\"\n formControlName=\"content\"\n (keydown.enter)=\"onSendMessage(user); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n }\n\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendAlert()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendMessage(user)\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n @if ((chat$ | async); as chat) {\n <div style=\"border: thin gray solid; padding: 1rem; margin-top: 1rem;\">\n <!-- <app-messenger-chat\n [user]=\"chat.user\"\n [messages]=\"chat.messages\"\n ></app-messenger-chat> -->\n </div>\n }\n </div>\n\n </div>\n </div>\n }\n\n\n {{ channels$ | async | json }}\n", styles: [""], dependencies: [{ kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "component", type: i4.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i4.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i12.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.JsonPipe, name: "json" }] }); }
|
|
4344
4368
|
}
|
|
4345
4369
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: WsMessagingComponent, decorators: [{
|
|
4346
4370
|
type: Component,
|
|
4347
|
-
args: [{ selector: 'app-ws-messaging', standalone: false, template: "
|
|
4371
|
+
args: [{ selector: 'app-ws-messaging', standalone: false, template: "\n @if ((data$ | async); as data) {\n <div style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n <div>\n\n <div>\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"flex:1\" [formGroup]=\"messages\">\n\n <div style=\"display:flex; gap: 1rem\">\n @if ((channels$ | async); as channels) {\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Channels</mat-label>\n <mat-select formControlName=\"channels\" multiple #channelsSelect>\n <mat-select-trigger>\n {{ (channelsSelect.value?.[0] === 'allChannels' ? 'All Channels' : channelsSelect.value?.[0]?.content?.name) || '' }}\n @if ((channelsSelect.value?.length || 0) > 1) {\n <span>\n (+{{(channelsSelect.value?.length || 0) - 1}} {{channelsSelect.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n <mat-option value=\"allChannels\">\n All Channels\n </mat-option>\n @for (channel of channels; track channel) {\n <mat-option [value]=\"channel\">\n {{ channel }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n @if ((users$ | async); as users) {\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUsers\" multiple #userSelect>\n <mat-select-trigger>\n {{ (userSelect.value?.[0] === 'allUsers' ? 'All Users' : userSelect.value?.[0]?.content?.name) || '' }}\n @if ((userSelect.value?.length || 0) > 1) {\n <span>\n (+{{(userSelect.value?.length || 0) - 1}} {{userSelect.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n <mat-option value=\"allChannels\">\n All Users\n </mat-option>\n @for (user of users; track user) {\n <mat-option [value]=\"user\">\n {{ user.content.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n </div>\n\n @if ((users$ | async); as users) {\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Send a Message</mat-label>\n <textarea\n matInput placeholder=\"Ex. It makes me feel...\"\n formControlName=\"content\"\n (keydown.enter)=\"onSendMessage(user); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n }\n\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendAlert()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendMessage(user)\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n @if ((chat$ | async); as chat) {\n <div style=\"border: thin gray solid; padding: 1rem; margin-top: 1rem;\">\n <!-- <app-messenger-chat\n [user]=\"chat.user\"\n [messages]=\"chat.messages\"\n ></app-messenger-chat> -->\n </div>\n }\n </div>\n\n </div>\n </div>\n }\n\n\n {{ channels$ | async | json }}\n" }]
|
|
4348
4372
|
}], propDecorators: { server: [{
|
|
4349
4373
|
type: Input
|
|
4350
4374
|
}], wsServer: [{
|
|
@@ -4384,12 +4408,13 @@ class RequestManagerWsDemoComponent {
|
|
|
4384
4408
|
this.httpManagerService = inject(HTTPManagerService);
|
|
4385
4409
|
this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
|
|
4386
4410
|
this.fb = inject(FormBuilder);
|
|
4411
|
+
this.path = ['ai', 'tests'];
|
|
4387
4412
|
this.user$ = this.stateRequestServiceDemo.user$;
|
|
4388
4413
|
// users$ = this.stateRequestServiceDemo.userList$
|
|
4389
4414
|
this.attempts$ = this.stateRequestServiceDemo.attempts$;
|
|
4390
4415
|
this.nextRetry$ = this.stateRequestServiceDemo.nextRetry$;
|
|
4391
|
-
this.connectionStatus$ = this.stateRequestServiceDemo.
|
|
4392
|
-
|
|
4416
|
+
this.connectionStatus$ = this.stateRequestServiceDemo.connectionStatus$;
|
|
4417
|
+
this.data$ = this.stateRequestServiceDemo.data$;
|
|
4393
4418
|
this.isPending$ = this.stateRequestServiceDemo.isPending$;
|
|
4394
4419
|
}
|
|
4395
4420
|
// messages = this.fb.group<any>({
|
|
@@ -4451,11 +4476,11 @@ class RequestManagerWsDemoComponent {
|
|
|
4451
4476
|
// this.stateRequestServiceDemo.updateConnection(this.server, this.wsServer, this.jwtToken, this.user);
|
|
4452
4477
|
}
|
|
4453
4478
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RequestManagerWsDemoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4454
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user" }, ngImport: i0, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n <!-- MESSAGING -->\n <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <!-- WS - Custom Messaging -->\n <app-ws-notifications></app-ws-notifications>\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <!-- WS - AI Messaging -->\n <app-ws-ai-messaging></app-ws-ai-messaging>\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i1$3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: WsNotificationsComponent, selector: "app-ws-notifications" }, { kind: "component", type: WsAiMessagingComponent, selector: "app-ws-ai-messaging" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
4479
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken", user: "user", path: "path" }, ngImport: i0, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\" [selectedIndex]=\"1\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n [path]=\"path\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n <!-- MESSAGING -->\n <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <!-- WS - Custom Messaging -->\n <app-ws-notifications></app-ws-notifications>\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <!-- WS - AI Messaging -->\n <app-ws-ai-messaging></app-ws-ai-messaging>\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i1$3.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: i9.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: WsDataControlComponent, selector: "app-ws-data-control", inputs: ["server", "wsServer", "jwtToken", "user", "path"] }, { kind: "component", type: WsMessagingComponent, selector: "app-ws-messaging", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: WsNotificationsComponent, selector: "app-ws-notifications" }, { kind: "component", type: WsAiMessagingComponent, selector: "app-ws-ai-messaging" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] }); }
|
|
4455
4480
|
}
|
|
4456
4481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RequestManagerWsDemoComponent, decorators: [{
|
|
4457
4482
|
type: Component,
|
|
4458
|
-
args: [{ selector: 'app-request-manager-ws-demo', standalone: false, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n <!-- MESSAGING -->\n <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <!-- WS - Custom Messaging -->\n <app-ws-notifications></app-ws-notifications>\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <!-- WS - AI Messaging -->\n <app-ws-ai-messaging></app-ws-ai-messaging>\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n" }]
|
|
4483
|
+
args: [{ selector: 'app-request-manager-ws-demo', standalone: false, template: "<div style=\"margin: 2rem;\">\n\n <h2 style=\"display: flex;\">\n <span style=\"flex:1\">HTTP Request State Manager - Websockets</span>\n @if ((connectionStatus$ | async); as connected) {\n <span>\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n } @else {\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n }\n </h2>\n\n <div>\n\n @if ((user$ | async); as userInfo) {\n <div>\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.content.name }}</div>\n <div>({{ userInfo.content.ldap }})</div>\n </div>\n </mat-toolbar>\n </div>\n }\n\n @if ((isPending$ | async)) {\n <div>\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\n </div>\n }\n\n <mat-tab-group animationDuration=\"0ms\" [selectedIndex]=\"1\">\n\n <mat-tab label=\"WS - Data Control\">\n <!-- DATA CONTROL -->\n <app-ws-data-control\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n [path]=\"path\"\n ></app-ws-data-control>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n <!-- MESSAGING -->\n <app-ws-messaging\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-ws-messaging>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Notifications\" [disabled]=\"true\">\n <!-- WS - Custom Messaging -->\n <app-ws-notifications></app-ws-notifications>\n </mat-tab>\n\n <mat-tab label=\"WS - AI Messaging\" [disabled]=\"true\">\n <!-- WS - AI Messaging -->\n <app-ws-ai-messaging></app-ws-ai-messaging>\n </mat-tab>\n\n </mat-tab-group>\n</div>\n\n</div>\n\n" }]
|
|
4459
4484
|
}], propDecorators: { server: [{
|
|
4460
4485
|
type: Input
|
|
4461
4486
|
}], wsServer: [{
|
|
@@ -4464,6 +4489,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
4464
4489
|
type: Input
|
|
4465
4490
|
}], user: [{
|
|
4466
4491
|
type: Input
|
|
4492
|
+
}], path: [{
|
|
4493
|
+
type: Input
|
|
4467
4494
|
}] } });
|
|
4468
4495
|
|
|
4469
4496
|
let ClientInfo$1 = class ClientInfo {
|
|
@@ -5965,6 +5992,7 @@ class HttpRequestServicesDemoComponent {
|
|
|
5965
5992
|
this.wsServer = 'ws:';
|
|
5966
5993
|
this.jwtToken = '';
|
|
5967
5994
|
this.server = 'http:';
|
|
5995
|
+
this.path = ['ai', 'tests'];
|
|
5968
5996
|
this.requestTypes = [
|
|
5969
5997
|
{ name: "Http Service", value: 'http_service' },
|
|
5970
5998
|
// { name: "Http Signals Service", value: 'http_signals_service', new: true },
|
|
@@ -5985,11 +6013,11 @@ class HttpRequestServicesDemoComponent {
|
|
|
5985
6013
|
this.selectedService = this.requestTypes[type].value;
|
|
5986
6014
|
}
|
|
5987
6015
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HttpRequestServicesDemoComponent, deps: [{ token: CONFIG_SETTINGS_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5988
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: HttpRequestServicesDemoComponent, selector: "app-http-request-services-demo", inputs: { wsServer: "wsServer", jwtToken: "jwtToken", server: "server", user: "user", adapter: "adapter", mapper: "mapper" }, ngImport: i0, template: "<mat-toolbar style=\"display:flex\">\n <div>Http Request Manager Services</div>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button [matMenuTriggerFor]=\"menu\">Services</button>\n <mat-menu #menu=\"matMenu\">\n @for (type of requestTypes; track type; let i = $index) {\n @if (type?.divider) {\n <div\n style=\"margin-top: .5rem; margin-bottom: .5rem;\"\n >\n <mat-divider></mat-divider>\n </div>\n }\n <button\n mat-menu-item\n (click)=\"onSelected(i)\"\n [disabled]=\"type.disabled\"\n >\n {{ type.name }}\n </button>\n }\n\n </mat-menu>\n</mat-toolbar>\n\n<span>\n @switch (selectedService) {\n @case ('http_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'http_signals_service'\">\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-signals-manager-demo></app-request-signals-manager-demo>\n </p> -->\n @case ('http_state_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-state-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-state-demo>\n </p>\n }\n @case ('http_state_service_ws') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-ws-demo\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-request-manager-ws-demo>\n </p>\n }\n @case ('database_service') {\n <p>\n <app-database-data-demo></app-database-data-demo>\n </p>\n }\n @case ('local_storage_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-demo></app-local-storage-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'local_storage_signals_service'\">\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-signals-demo></app-local-storage-signals-demo>\n</p> -->\n@case ('store_state_manager') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-store-state-manager-demo></app-store-state-manager-demo>\n </p>\n}\n@default {\n <p>\n Other\n </p>\n}\n}\n</span>\n\n<ng-template #HTTP_OPTIONS>\n @if (injectionOptions?.httpRequestOptions) {\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - HTTP Options</h3>\n {{ injectionOptions?.httpRequestOptions| json }}\n </div>\n }\n</ng-template>\n\n<ng-template #LOCAL_OPTIONS>\n @if (injectionOptions?.LocalStorageOptions) {\n <ng-container class=\"box\">\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - LocalStorage Options</h3>\n {{ injectionOptions?.LocalStorageOptions| json }}\n </div>\n </ng-container>\n }\n</ng-template>\n\n\n", styles: [".box{padding:1rem;background-color:#f5f5f5;border:thin gray solid;margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i11.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: RequestManagerStateDemoComponent, selector: "app-request-manager-state-demo", inputs: ["server", "adapter", "mapper"] }, { kind: "component", type: RequestManagerDemoComponent, selector: "app-request-manager-demo", inputs: ["server", "adapter", "mapper"] }, { kind: "component", type: LocalStorageDemoComponent, selector: "app-local-storage-demo" }, { kind: "component", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: ["server", "wsServer", "jwtToken", "user"] }, { kind: "component", type: StoreStateManagerDemoComponent, selector: "app-store-state-manager-demo" }, { kind: "component", type: DatabaseDataDemoComponent, selector: "app-database-data-demo" }, { kind: "pipe", type: i1$1.JsonPipe, name: "json" }] }); }
|
|
6016
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: HttpRequestServicesDemoComponent, selector: "app-http-request-services-demo", inputs: { wsServer: "wsServer", jwtToken: "jwtToken", server: "server", user: "user", path: "path", adapter: "adapter", mapper: "mapper" }, ngImport: i0, template: "<mat-toolbar style=\"display:flex\">\n <div>Http Request Manager Services</div>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button [matMenuTriggerFor]=\"menu\">Services</button>\n <mat-menu #menu=\"matMenu\">\n @for (type of requestTypes; track type; let i = $index) {\n @if (type?.divider) {\n <div\n style=\"margin-top: .5rem; margin-bottom: .5rem;\"\n >\n <mat-divider></mat-divider>\n </div>\n }\n <button\n mat-menu-item\n (click)=\"onSelected(i)\"\n [disabled]=\"type.disabled\"\n >\n {{ type.name }}\n </button>\n }\n\n </mat-menu>\n</mat-toolbar>\n\n<span>\n @switch (selectedService) {\n @case ('http_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'http_signals_service'\">\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-signals-manager-demo></app-request-signals-manager-demo>\n </p> -->\n @case ('http_state_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-state-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-state-demo>\n </p>\n }\n @case ('http_state_service_ws') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-ws-demo\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n [path]=\"path\"\n ></app-request-manager-ws-demo>\n </p>\n }\n @case ('database_service') {\n <p>\n <app-database-data-demo></app-database-data-demo>\n </p>\n }\n @case ('local_storage_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-demo></app-local-storage-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'local_storage_signals_service'\">\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-signals-demo></app-local-storage-signals-demo>\n</p> -->\n@case ('store_state_manager') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-store-state-manager-demo></app-store-state-manager-demo>\n </p>\n}\n@default {\n <p>\n Other\n </p>\n}\n}\n</span>\n\n<ng-template #HTTP_OPTIONS>\n @if (injectionOptions?.httpRequestOptions) {\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - HTTP Options</h3>\n {{ injectionOptions?.httpRequestOptions| json }}\n </div>\n }\n</ng-template>\n\n<ng-template #LOCAL_OPTIONS>\n @if (injectionOptions?.LocalStorageOptions) {\n <ng-container class=\"box\">\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - LocalStorage Options</h3>\n {{ injectionOptions?.LocalStorageOptions| json }}\n </div>\n </ng-container>\n }\n</ng-template>\n\n\n", styles: [".box{padding:1rem;background-color:#f5f5f5;border:thin gray solid;margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i6.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i11.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: RequestManagerStateDemoComponent, selector: "app-request-manager-state-demo", inputs: ["server", "adapter", "mapper"] }, { kind: "component", type: RequestManagerDemoComponent, selector: "app-request-manager-demo", inputs: ["server", "adapter", "mapper"] }, { kind: "component", type: LocalStorageDemoComponent, selector: "app-local-storage-demo" }, { kind: "component", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: ["server", "wsServer", "jwtToken", "user", "path"] }, { kind: "component", type: StoreStateManagerDemoComponent, selector: "app-store-state-manager-demo" }, { kind: "component", type: DatabaseDataDemoComponent, selector: "app-database-data-demo" }, { kind: "pipe", type: i1$1.JsonPipe, name: "json" }] }); }
|
|
5989
6017
|
}
|
|
5990
6018
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HttpRequestServicesDemoComponent, decorators: [{
|
|
5991
6019
|
type: Component,
|
|
5992
|
-
args: [{ selector: 'app-http-request-services-demo', standalone: false, template: "<mat-toolbar style=\"display:flex\">\n <div>Http Request Manager Services</div>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button [matMenuTriggerFor]=\"menu\">Services</button>\n <mat-menu #menu=\"matMenu\">\n @for (type of requestTypes; track type; let i = $index) {\n @if (type?.divider) {\n <div\n style=\"margin-top: .5rem; margin-bottom: .5rem;\"\n >\n <mat-divider></mat-divider>\n </div>\n }\n <button\n mat-menu-item\n (click)=\"onSelected(i)\"\n [disabled]=\"type.disabled\"\n >\n {{ type.name }}\n </button>\n }\n\n </mat-menu>\n</mat-toolbar>\n\n<span>\n @switch (selectedService) {\n @case ('http_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'http_signals_service'\">\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-signals-manager-demo></app-request-signals-manager-demo>\n </p> -->\n @case ('http_state_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-state-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-state-demo>\n </p>\n }\n @case ('http_state_service_ws') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-ws-demo\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n ></app-request-manager-ws-demo>\n </p>\n }\n @case ('database_service') {\n <p>\n <app-database-data-demo></app-database-data-demo>\n </p>\n }\n @case ('local_storage_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-demo></app-local-storage-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'local_storage_signals_service'\">\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-signals-demo></app-local-storage-signals-demo>\n</p> -->\n@case ('store_state_manager') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-store-state-manager-demo></app-store-state-manager-demo>\n </p>\n}\n@default {\n <p>\n Other\n </p>\n}\n}\n</span>\n\n<ng-template #HTTP_OPTIONS>\n @if (injectionOptions?.httpRequestOptions) {\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - HTTP Options</h3>\n {{ injectionOptions?.httpRequestOptions| json }}\n </div>\n }\n</ng-template>\n\n<ng-template #LOCAL_OPTIONS>\n @if (injectionOptions?.LocalStorageOptions) {\n <ng-container class=\"box\">\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - LocalStorage Options</h3>\n {{ injectionOptions?.LocalStorageOptions| json }}\n </div>\n </ng-container>\n }\n</ng-template>\n\n\n", styles: [".box{padding:1rem;background-color:#f5f5f5;border:thin gray solid;margin-top:1rem}\n"] }]
|
|
6020
|
+
args: [{ selector: 'app-http-request-services-demo', standalone: false, template: "<mat-toolbar style=\"display:flex\">\n <div>Http Request Manager Services</div>\n <div style=\"flex:1\"></div>\n <button mat-stroked-button [matMenuTriggerFor]=\"menu\">Services</button>\n <mat-menu #menu=\"matMenu\">\n @for (type of requestTypes; track type; let i = $index) {\n @if (type?.divider) {\n <div\n style=\"margin-top: .5rem; margin-bottom: .5rem;\"\n >\n <mat-divider></mat-divider>\n </div>\n }\n <button\n mat-menu-item\n (click)=\"onSelected(i)\"\n [disabled]=\"type.disabled\"\n >\n {{ type.name }}\n </button>\n }\n\n </mat-menu>\n</mat-toolbar>\n\n<span>\n @switch (selectedService) {\n @case ('http_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'http_signals_service'\">\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-signals-manager-demo></app-request-signals-manager-demo>\n </p> -->\n @case ('http_state_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-state-demo\n [server]=\"server\"\n [adapter]=\"adapter\"\n [mapper]=\"mapper\"\n ></app-request-manager-state-demo>\n </p>\n }\n @case ('http_state_service_ws') {\n <p>\n <ng-container *ngTemplateOutlet=\"HTTP_OPTIONS\"></ng-container>\n <app-request-manager-ws-demo\n [server]=\"server\"\n [wsServer]=\"wsServer\"\n [jwtToken]=\"jwtToken\"\n [user]=\"user\"\n [path]=\"path\"\n ></app-request-manager-ws-demo>\n </p>\n }\n @case ('database_service') {\n <p>\n <app-database-data-demo></app-database-data-demo>\n </p>\n }\n @case ('local_storage_service') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-demo></app-local-storage-demo>\n </p>\n }\n <!-- <p *ngSwitchCase=\"'local_storage_signals_service'\">\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-local-storage-signals-demo></app-local-storage-signals-demo>\n</p> -->\n@case ('store_state_manager') {\n <p>\n <ng-container *ngTemplateOutlet=\"LOCAL_OPTIONS\"></ng-container>\n <app-store-state-manager-demo></app-store-state-manager-demo>\n </p>\n}\n@default {\n <p>\n Other\n </p>\n}\n}\n</span>\n\n<ng-template #HTTP_OPTIONS>\n @if (injectionOptions?.httpRequestOptions) {\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - HTTP Options</h3>\n {{ injectionOptions?.httpRequestOptions| json }}\n </div>\n }\n</ng-template>\n\n<ng-template #LOCAL_OPTIONS>\n @if (injectionOptions?.LocalStorageOptions) {\n <ng-container class=\"box\">\n <div class=\"box\">\n <h3 style=\"font-weight: bold;\">Injection Token Detected - LocalStorage Options</h3>\n {{ injectionOptions?.LocalStorageOptions| json }}\n </div>\n </ng-container>\n }\n</ng-template>\n\n\n", styles: [".box{padding:1rem;background-color:#f5f5f5;border:thin gray solid;margin-top:1rem}\n"] }]
|
|
5993
6021
|
}], ctorParameters: () => [{ type: ConfigOptions, decorators: [{
|
|
5994
6022
|
type: Inject,
|
|
5995
6023
|
args: [CONFIG_SETTINGS_TOKEN]
|
|
@@ -6001,6 +6029,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
6001
6029
|
type: Input
|
|
6002
6030
|
}], user: [{
|
|
6003
6031
|
type: Input
|
|
6032
|
+
}], path: [{
|
|
6033
|
+
type: Input
|
|
6004
6034
|
}], adapter: [{
|
|
6005
6035
|
type: Input
|
|
6006
6036
|
}], mapper: [{
|