http-request-manager 18.4.2 → 18.4.4
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/README.md +55 -2
- package/esm2022/lib/http-request-services-demo/request-manager-ws-demo/request-manager-ws-demo.component.mjs +19 -19
- package/esm2022/lib/http-request-services-demo/request-manager-ws-demo/services/state-request-demo.service.mjs +97 -0
- package/fesm2022/http-request-manager.mjs +21 -21
- package/fesm2022/http-request-manager.mjs.map +1 -1
- package/http-request-manager-18.4.4.tgz +0 -0
- package/lib/http-request-services-demo/request-manager-ws-demo/request-manager-ws-demo.component.d.ts +2 -2
- package/lib/http-request-services-demo/request-manager-ws-demo/services/{state-request.service.d.ts → state-request-demo.service.d.ts} +3 -3
- package/package.json +1 -1
- package/esm2022/lib/http-request-services-demo/request-manager-ws-demo/services/state-request.service.mjs +0 -97
- package/http-request-manager-18.4.2.tgz +0 -0
|
@@ -4028,7 +4028,7 @@ class OIDCClient {
|
|
|
4028
4028
|
}
|
|
4029
4029
|
}
|
|
4030
4030
|
|
|
4031
|
-
class
|
|
4031
|
+
class StateRequestServiceDemo extends HTTPManagerStateService {
|
|
4032
4032
|
constructor() {
|
|
4033
4033
|
super(ApiRequest.adapt({
|
|
4034
4034
|
server: 'https://oidc.example.com',
|
|
@@ -4109,10 +4109,10 @@ class StateRequestService extends HTTPManagerStateService {
|
|
|
4109
4109
|
console.log('deleteData', sampleOptions);
|
|
4110
4110
|
this.deleteRecord(sampleOptions);
|
|
4111
4111
|
}
|
|
4112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
4113
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
4112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StateRequestServiceDemo, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4113
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StateRequestServiceDemo, providedIn: 'root' }); }
|
|
4114
4114
|
}
|
|
4115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type:
|
|
4115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: StateRequestServiceDemo, decorators: [{
|
|
4116
4116
|
type: Injectable,
|
|
4117
4117
|
args: [{
|
|
4118
4118
|
providedIn: 'root'
|
|
@@ -4122,23 +4122,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
4122
4122
|
class RequestManagerWsDemoComponent {
|
|
4123
4123
|
constructor() {
|
|
4124
4124
|
this.httpManagerService = inject(HTTPManagerService);
|
|
4125
|
-
this.
|
|
4125
|
+
this.stateRequestServiceDemo = inject(StateRequestServiceDemo);
|
|
4126
4126
|
this.fb = inject(FormBuilder);
|
|
4127
|
-
this.user$ = this.
|
|
4128
|
-
this.users$ = this.
|
|
4129
|
-
this.attempts$ = this.
|
|
4130
|
-
this.nextRetry$ = this.
|
|
4131
|
-
this.connectionStatus$ = this.
|
|
4127
|
+
this.user$ = this.stateRequestServiceDemo.user$;
|
|
4128
|
+
this.users$ = this.stateRequestServiceDemo.userList$;
|
|
4129
|
+
this.attempts$ = this.stateRequestServiceDemo.attempts$;
|
|
4130
|
+
this.nextRetry$ = this.stateRequestServiceDemo.nextRetry$;
|
|
4131
|
+
this.connectionStatus$ = this.stateRequestServiceDemo.status$;
|
|
4132
4132
|
this.messages = this.fb.group({
|
|
4133
4133
|
toUser: this.fb.control(null, Validators.required),
|
|
4134
4134
|
content: this.fb.control(null, Validators.required),
|
|
4135
4135
|
});
|
|
4136
|
-
this.data$ = this.
|
|
4136
|
+
this.data$ = this.stateRequestServiceDemo.data$;
|
|
4137
4137
|
this.fromMe = (user, fromUser) => {
|
|
4138
4138
|
return user === fromUser;
|
|
4139
4139
|
};
|
|
4140
|
-
this.communicationMessages$ = this.
|
|
4141
|
-
this.latestCommunicationMessages$ = this.
|
|
4140
|
+
this.communicationMessages$ = this.stateRequestServiceDemo.communicationMessages$;
|
|
4141
|
+
this.latestCommunicationMessages$ = this.stateRequestServiceDemo.latestCommunicationMessages$;
|
|
4142
4142
|
this.chat$ = combineLatest([this.user$, this.communicationMessages$])
|
|
4143
4143
|
.pipe(map$1(([user, messages]) => ({ user, messages })), map$1(obj => {
|
|
4144
4144
|
if (!obj.user)
|
|
@@ -4185,14 +4185,14 @@ class RequestManagerWsDemoComponent {
|
|
|
4185
4185
|
return this.toUser.valid;
|
|
4186
4186
|
}
|
|
4187
4187
|
ngOnInit() {
|
|
4188
|
-
this.
|
|
4189
|
-
this.
|
|
4188
|
+
this.stateRequestServiceDemo.updateConnection(this.server, this.wsServer, this.jwtToken);
|
|
4189
|
+
this.stateRequestServiceDemo.getData();
|
|
4190
4190
|
}
|
|
4191
4191
|
onGetData() {
|
|
4192
|
-
this.
|
|
4192
|
+
this.stateRequestServiceDemo.getData();
|
|
4193
4193
|
}
|
|
4194
4194
|
onAddData() {
|
|
4195
|
-
this.
|
|
4195
|
+
this.stateRequestServiceDemo.addData();
|
|
4196
4196
|
}
|
|
4197
4197
|
onUpdateData(data) {
|
|
4198
4198
|
const num = RandomNumber(1000, 9999);
|
|
@@ -4203,14 +4203,14 @@ class RequestManagerWsDemoComponent {
|
|
|
4203
4203
|
"email": "mikeboni@hotmail.com",
|
|
4204
4204
|
"first_name": "mike"
|
|
4205
4205
|
};
|
|
4206
|
-
this.
|
|
4206
|
+
this.stateRequestServiceDemo.updateData(newData);
|
|
4207
4207
|
}
|
|
4208
4208
|
onSendMessage() {
|
|
4209
4209
|
this.messages.markAllAsTouched();
|
|
4210
4210
|
if (this.messages.invalid)
|
|
4211
4211
|
return;
|
|
4212
4212
|
const message = ChannelMessage.adapt(this.messages.value);
|
|
4213
|
-
this.
|
|
4213
|
+
this.stateRequestServiceDemo.sendMessage(message);
|
|
4214
4214
|
this.content.reset();
|
|
4215
4215
|
}
|
|
4216
4216
|
onSendAlert() {
|
|
@@ -4218,12 +4218,12 @@ class RequestManagerWsDemoComponent {
|
|
|
4218
4218
|
if (this.messages.invalid)
|
|
4219
4219
|
return;
|
|
4220
4220
|
const message = ChannelMessage.adapt({ ...this.messages.value, type: CommunicationType.ALERT });
|
|
4221
|
-
this.
|
|
4221
|
+
this.stateRequestServiceDemo.sendMessage(message);
|
|
4222
4222
|
this.content.reset();
|
|
4223
4223
|
}
|
|
4224
4224
|
onRemoveData(data) {
|
|
4225
4225
|
const lastRec = data[data.length - 1];
|
|
4226
|
-
this.
|
|
4226
|
+
this.stateRequestServiceDemo.deleteData(lastRec);
|
|
4227
4227
|
}
|
|
4228
4228
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RequestManagerWsDemoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4229
4229
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: RequestManagerWsDemoComponent, selector: "app-request-manager-ws-demo", inputs: { server: "server", wsServer: "wsServer", jwtToken: "jwtToken" }, 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 <span *ngIf=\"(connectionStatus$ | async) as connected; else NOT_CONNECTED\">\n WS -\n <span style=\"color: green;\">Connected</span>\n </span>\n <ng-template #NOT_CONNECTED>\n <span style=\"color: red;\">Disconnected {{ attempts$ | async }} - {{ nextRetry$ |async }}</span>\n </ng-template>\n </h2>\n\n <div>\n\n <div *ngIf=\"(user$ | async) as userInfo\">\n <mat-toolbar>\n <div style=\"display: flex; flex:1\">\n <div style=\"flex:1\">{{ userInfo.name }}</div>\n <div>({{ userInfo.username }})</div>\n </div>\n </mat-toolbar>\n </div>\n\n <mat-tab-group animationDuration=\"0ms\">\n\n <mat-tab label=\"WS - Data Control\">\n\n <div *ngIf=\"(data$ | async) as data\" style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n\n <div *ngIf=\"(users$ |async) as users\">\n <mat-chip-set>\n <mat-chip *ngFor=\"let user of users\">\n {{ user.name }}\n </mat-chip>\n </mat-chip-set>\n </div>\n\n <div style=\"display: flex; gap: 1rem; margin-bottom: 1rem;\">\n <button mat-stroked-button (click)=\"onGetData()\">Get Data</button>\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\n <div style=\"display: flex; gap: 1rem; flex-direction: column;\">\n <div>{{ data | json }}</div>\n <h2>{{ data.length }}</h2>\n </div>\n\n </div>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Messaging\">\n\n <div *ngIf=\"(data$ | async) as data\" style=\"margin: 1rem; display: flex; gap: 1rem; flex-direction: column;\">\n\n <div *ngIf=\"(user$ | async) as userInfo\">\n\n <div *ngIf=\"(users$ | async) as users\">\n\n <div style=\"display: flex; gap: 1rem\">\n\n <div style=\"flex:1\" [formGroup]=\"messages\">\n <div style=\"display:flex\">\n <mat-form-field style=\"flex:1\" appearance=\"outline\">\n <mat-label>Users</mat-label>\n <mat-select formControlName=\"toUser\">\n <mat-option value=\"allChannels\" #selectedUser>\n All Users\n </mat-option>\n <mat-option *ngFor=\"let user of users\" [value]=\"user\">\n {{ user.username }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\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(); $event.preventDefault()\"\n [disabled]=\"!isValid\"\n ></textarea>\n </mat-form-field>\n </div>\n <div style=\"display:flex; gap: .5rem;\">\n <div style=\"flex:1\"></div>\n <button mat-stroked-button (click)=\"onSendMessage()\" color=\"warn\">\n Send Alert\n </button>\n <button mat-stroked-button (click)=\"onSendAlert()\">\n Send Message\n </button>\n </div>\n </div>\n </div>\n\n <div *ngIf=\"(chat$ | async) as chat\" 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\n </div>\n\n </mat-tab>\n\n <mat-tab label=\"WS - Custom Channel Messaging\" [disabled]=\"true\">\n WS - Custom Channel Messaging\n </mat-tab>\n\n </mat-tab-group>\n </div>\n\n</div>\n\n\n<div style=\"margin: 1rem;\">\n <h3>\n user: {{ user$ | async | json}}\n </h3>\n\n <h3>\n users: {{ users$ | async | json}}\n </h3>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i4$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i4$1.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: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "component", type: i5.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: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i8$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: i8$1.MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "directive", type: i13.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: "component", type: i10$1.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.JsonPipe, name: "json" }] }); }
|