@eurosat/http 10.0.0 → 14.0.1

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.
@@ -0,0 +1,196 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { HttpResponse, HttpParams, HttpHeaders, HttpClientModule } from '@angular/common/http';
5
+ import * as i2 from '@angular/material/snack-bar';
6
+ import { MatSnackBarConfig } from '@angular/material/snack-bar';
7
+ import { throwError } from 'rxjs';
8
+ import { catchError } from 'rxjs/operators';
9
+
10
+ // @dynamic --> NEMAZAT https://github.com/dherges/ng-packagr/issues/641
11
+ class HttpService {
12
+ constructor(http, snackBar) {
13
+ this.http = http;
14
+ this.snackBar = snackBar;
15
+ if (!HttpService.instance) { // není to prasárna?
16
+ HttpService.instance = this;
17
+ }
18
+ }
19
+ static handleError(error) {
20
+ HttpService.errorStatus(error);
21
+ // Todo: In a real world app, you might use a remote logging infrastructure
22
+ let errMsg;
23
+ if (error instanceof HttpResponse) {
24
+ const body = error.body || '';
25
+ const err = body.error || JSON.stringify(body);
26
+ errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
27
+ }
28
+ else {
29
+ errMsg = error.message ? error.message : error.toString();
30
+ }
31
+ console.error(errMsg);
32
+ return throwError(errMsg);
33
+ }
34
+ static errorStatus(err) {
35
+ switch (err.status) {
36
+ case 300:
37
+ case 301:
38
+ HttpService.handleRedirect(err);
39
+ break;
40
+ // case 302:
41
+ // HttpService.handleRedirect(err);
42
+ // break;
43
+ case 403:
44
+ HttpService.handleErrorMessage(err);
45
+ break;
46
+ case 503:
47
+ HttpService.handleErrorMessage(err);
48
+ break;
49
+ case 601:
50
+ HttpService.handleRedirect(err);
51
+ break;
52
+ }
53
+ // todo 413 Request Entity Too Large - upload file z formu
54
+ }
55
+ // private static handleLoginRedirect(res: HttpResponse<any>) {
56
+ // const error = res['error'];
57
+ //
58
+ // }
59
+ static handleRedirect(res) {
60
+ const error = res['error'];
61
+ if (error.login) {
62
+ let path = window.location.pathname;
63
+ path = path[0] === '/' ? path.substr(1) : path; // '/front/' => 'front/'
64
+ // console.log('Redirect ' + `${error.url}?r=${path}`);
65
+ window.location.href = `${error.url}?r=${path}`;
66
+ }
67
+ else {
68
+ window.location.href = `${error.url}`;
69
+ }
70
+ }
71
+ static handleErrorMessage(res) {
72
+ const message = res['error'];
73
+ if (res['error'] instanceof Blob) {
74
+ const reader = new FileReader();
75
+ reader.addEventListener('loadend', (e) => {
76
+ HttpService.createSnackBar(e.srcElement['result']);
77
+ });
78
+ reader.readAsText(res['error']);
79
+ }
80
+ else {
81
+ HttpService.createSnackBar(message);
82
+ }
83
+ }
84
+ static createSnackBar(message) {
85
+ const config = new MatSnackBarConfig();
86
+ config.duration = 2000;
87
+ config.panelClass = 'es-snackbar-alert-danger'; // AppSnackbarPanelClass.DANGER;
88
+ HttpService.instance.snackBar.open(message, null, config);
89
+ }
90
+ get(url, options) {
91
+ if (!options) {
92
+ options = {};
93
+ }
94
+ if (!options.params) {
95
+ options.params = new HttpParams();
96
+ }
97
+ options.params = options.params.set('_req_s', HttpService.ANGULAR_REQUEST_CONST); // pridava se nejakej param na formy pro angular
98
+ return this.http.get(url, options)
99
+ .pipe(catchError(HttpService.handleError));
100
+ }
101
+ // tslint:disable-next-line:max-line-length
102
+ post(url, body, options) {
103
+ if (!options) {
104
+ options = {};
105
+ }
106
+ if (!options.params) {
107
+ options.params = new HttpParams();
108
+ }
109
+ options.params = options.params.set('_req_s', HttpService.ANGULAR_REQUEST_CONST);
110
+ return this.http.post(url, body, options)
111
+ .pipe(catchError(HttpService.handleError));
112
+ }
113
+ // upload file s vypnutym service workerem -> header{disable-ngsw: true}
114
+ // v ekj projektu fix-ngsw.sh
115
+ // tslint:disable-next-line:max-line-length
116
+ // sed -i '/onFetch(event) {/,/const req = event.request;/c onFetch(event){const req=event.request;if(req.headers.get('disable-ngsw')==="true")return;' ./front/ngsw-worker.js
117
+ // tslint:disable-next-line:max-line-length
118
+ postFiles(url, body, options) {
119
+ if (!options) {
120
+ options = {};
121
+ }
122
+ if (!options.params) {
123
+ options.params = new HttpParams();
124
+ }
125
+ options.params = options.params.set('_req_s', HttpService.ANGULAR_REQUEST_CONST);
126
+ const headers = new HttpHeaders();
127
+ options['headers'] = headers.set('disable-ngsw', 'true');
128
+ return this.http.post(url, body, options)
129
+ .pipe(catchError(HttpService.handleError));
130
+ }
131
+ delete(url, options) {
132
+ return this.http.delete(url, options)
133
+ .pipe(catchError(HttpService.handleError));
134
+ }
135
+ }
136
+ HttpService.ANGULAR_REQUEST_CONST = '2';
137
+ /** @nocollapse */ HttpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, deps: [{ token: i1.HttpClient }, { token: i2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
138
+ /** @nocollapse */ HttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, providedIn: 'root' });
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpService, decorators: [{
140
+ type: Injectable,
141
+ args: [{
142
+ providedIn: 'root'
143
+ }]
144
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.MatSnackBar }]; } });
145
+
146
+ class HttpComponent {
147
+ constructor() { }
148
+ ngOnInit() {
149
+ }
150
+ }
151
+ /** @nocollapse */ HttpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
152
+ /** @nocollapse */ HttpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: HttpComponent, selector: "es-http", ngImport: i0, template: `
153
+ <p>
154
+ http works!
155
+ </p>
156
+ `, isInline: true });
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpComponent, decorators: [{
158
+ type: Component,
159
+ args: [{ selector: 'es-http', template: `
160
+ <p>
161
+ http works!
162
+ </p>
163
+ ` }]
164
+ }], ctorParameters: function () { return []; } });
165
+
166
+ class HttpModule {
167
+ }
168
+ /** @nocollapse */ HttpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
169
+ /** @nocollapse */ HttpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: HttpModule, declarations: [HttpComponent], imports: [HttpClientModule] });
170
+ /** @nocollapse */ HttpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpModule, providers: [
171
+ HttpService
172
+ ], imports: [HttpClientModule] });
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: HttpModule, decorators: [{
174
+ type: NgModule,
175
+ args: [{
176
+ imports: [
177
+ HttpClientModule
178
+ ],
179
+ declarations: [HttpComponent],
180
+ providers: [
181
+ HttpService
182
+ ],
183
+ exports: [],
184
+ }]
185
+ }] });
186
+
187
+ /*
188
+ * Public API Surface of http
189
+ */
190
+
191
+ /**
192
+ * Generated bundle index. Do not edit.
193
+ */
194
+
195
+ export { HttpComponent, HttpModule, HttpService };
196
+ //# sourceMappingURL=eurosat-http.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eurosat-http.mjs","sources":["../../../projects/http/src/lib/http.service.ts","../../../projects/http/src/lib/http.component.ts","../../../projects/http/src/lib/http.module.ts","../../../projects/http/src/public_api.ts","../../../projects/http/src/eurosat-http.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {HttpClient, HttpHeaders, HttpParams, HttpResponse} from '@angular/common/http';\nimport {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar';\nimport {Observable, throwError} from 'rxjs';\nimport {catchError} from 'rxjs/operators';\n// @dynamic --> NEMAZAT https://github.com/dherges/ng-packagr/issues/641\n@Injectable({\n providedIn: 'root'\n})\nexport class HttpService {\n\n public static ANGULAR_REQUEST_CONST = '2';\n\n private static instance: HttpService; // není to prasárna?\n\n constructor(\n private http: HttpClient,\n private snackBar: MatSnackBar,\n ) {\n if (!HttpService.instance) { // není to prasárna?\n HttpService.instance = this;\n }\n }\n\n public static handleError (error: HttpResponse<any> | any) {\n HttpService.errorStatus(error);\n\n // Todo: In a real world app, you might use a remote logging infrastructure\n let errMsg: string;\n if (error instanceof HttpResponse) {\n const body = error.body || '';\n const err = body.error || JSON.stringify(body);\n errMsg = `${error.status} - ${error.statusText || ''} ${err}`;\n } else {\n errMsg = error.message ? error.message : error.toString();\n }\n console.error(errMsg);\n return throwError(errMsg);\n }\n\n private static errorStatus(err: HttpResponse<any>) {\n switch (err.status) {\n case 300:\n case 301:\n HttpService.handleRedirect(err);\n break;\n // case 302:\n // HttpService.handleRedirect(err);\n // break;\n case 403:\n HttpService.handleErrorMessage(err);\n break;\n case 503:\n HttpService.handleErrorMessage(err);\n break;\n case 601:\n HttpService.handleRedirect(err);\n break;\n }\n\n // todo 413 Request Entity Too Large - upload file z formu\n }\n\n // private static handleLoginRedirect(res: HttpResponse<any>) {\n // const error = res['error'];\n //\n // }\n\n private static handleRedirect(res: HttpResponse<any>) {\n const error = res['error'];\n if (error.login) {\n let path = window.location.pathname;\n path = path[0] === '/' ? path.substr(1) : path; // '/front/' => 'front/'\n // console.log('Redirect ' + `${error.url}?r=${path}`);\n window.location.href = `${error.url}?r=${path}`;\n } else {\n window.location.href = `${error.url}`;\n }\n }\n\n private static handleErrorMessage(res: HttpResponse<any>) {\n const message = res['error'];\n if (res['error'] instanceof Blob) {\n const reader = new FileReader();\n\n reader.addEventListener('loadend', (e) => {\n HttpService.createSnackBar(e.srcElement['result']);\n });\n\n reader.readAsText(res['error']);\n } else {\n HttpService.createSnackBar(message);\n }\n }\n\n private static createSnackBar(message) {\n const config = new MatSnackBarConfig();\n config.duration = 2000;\n config.panelClass = 'es-snackbar-alert-danger'; // AppSnackbarPanelClass.DANGER;\n HttpService.instance.snackBar.open(message, null, config);\n }\n\n get(url: string, options?: {params?: HttpParams, responseType?, observe?}): Observable<any> {\n if (!options) { options = {}; }\n if (!options.params) {\n options.params = new HttpParams();\n }\n options.params = options.params.set('_req_s', HttpService.ANGULAR_REQUEST_CONST); // pridava se nejakej param na formy pro angular\n return this.http.get(url, options)\n .pipe(catchError(HttpService.handleError));\n }\n\n // tslint:disable-next-line:max-line-length\n post(url: string, body: any | null, options?: {params?: HttpParams, responseType?, reportProgress?: boolean, observe?: any}): Observable<any> {\n if (!options) { options = {}; }\n if (!options.params) {\n options.params = new HttpParams();\n }\n options.params = options.params.set('_req_s', HttpService.ANGULAR_REQUEST_CONST);\n\n return this.http.post(url, body, options)\n .pipe(catchError(HttpService.handleError));\n }\n\n // upload file s vypnutym service workerem -> header{disable-ngsw: true}\n // v ekj projektu fix-ngsw.sh\n // tslint:disable-next-line:max-line-length\n // sed -i '/onFetch(event) {/,/const req = event.request;/c onFetch(event){const req=event.request;if(req.headers.get('disable-ngsw')===\"true\")return;' ./front/ngsw-worker.js\n // tslint:disable-next-line:max-line-length\n postFiles(url: string, body: any | null, options?: {params?: HttpParams, responseType?, reportProgress?: boolean, observe?: any}): Observable<any> {\n if (!options) { options = {}; }\n if (!options.params) {\n options.params = new HttpParams();\n }\n options.params = options.params.set('_req_s', HttpService.ANGULAR_REQUEST_CONST);\n const headers = new HttpHeaders();\n options['headers'] = headers.set('disable-ngsw', 'true');\n return this.http.post(url, body, options)\n .pipe(catchError(HttpService.handleError));\n }\n\n delete(url: string, options?: {}): Observable<Object> {\n return this.http.delete(url, options)\n .pipe(catchError(HttpService.handleError));\n }\n\n\n // private extractMsgpack(res: Response) {\n //\n // let buffer = res.arrayBuffer();\n // // console.log(buffer);\n //\n // let array = new Uint8Array(buffer);\n // // console.log(array);\n // // console.log('Decode ' + msgpack.decode(array));\n //\n // return msgpack.decode(array);\n // }\n\n\n\n}\n","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'es-http',\n template: `\n <p>\n http works!\n </p>\n `,\n styles: []\n})\nexport class HttpComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import {NgModule} from '@angular/core';\nimport {HttpComponent} from './http.component';\nimport {HttpClientModule} from '@angular/common/http';\nimport {HttpService} from './http.service';\n\n@NgModule({\n imports: [\n HttpClientModule\n ],\n declarations: [HttpComponent],\n providers: [\n HttpService\n ],\n exports: [],\n})\nexport class HttpModule { }\n","/*\n * Public API Surface of http\n */\n\nexport * from './lib/http.service';\nexport * from './lib/http.component';\nexport * from './lib/http.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAKA;MAIa,WAAW,CAAA;IAMpB,WACY,CAAA,IAAgB,EAChB,QAAqB,EAAA;QADrB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QAChB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAa;AAE7B,QAAA,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;AACvB,YAAA,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC/B,SAAA;KACJ;IAEM,OAAO,WAAW,CAAE,KAA8B,EAAA;AACrD,QAAA,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;;AAG/B,QAAA,IAAI,MAAc,CAAC;QACnB,IAAI,KAAK,YAAY,YAAY,EAAE;AAC/B,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;AAC9B,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC/C,YAAA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"}
@@ -1,4 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@eurosat/http" />
5
+ export * from './public_api';
@@ -1,5 +1,8 @@
1
- import { OnInit } from '@angular/core';
2
- export declare class HttpComponent implements OnInit {
3
- constructor();
4
- ngOnInit(): void;
5
- }
1
+ import { OnInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class HttpComponent implements OnInit {
4
+ constructor();
5
+ ngOnInit(): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<HttpComponent, "es-http", never, {}, {}, never, never, false>;
8
+ }
@@ -1,2 +1,8 @@
1
- export declare class HttpModule {
2
- }
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./http.component";
3
+ import * as i2 from "@angular/common/http";
4
+ export declare class HttpModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HttpModule, [typeof i1.HttpComponent], [typeof i2.HttpClientModule], never>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<HttpModule>;
8
+ }
@@ -1,33 +1,36 @@
1
- import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
2
- import { MatSnackBar } from '@angular/material/snack-bar';
3
- import { Observable } from 'rxjs';
4
- export declare class HttpService {
5
- private http;
6
- private snackBar;
7
- static ANGULAR_REQUEST_CONST: string;
8
- private static instance;
9
- constructor(http: HttpClient, snackBar: MatSnackBar);
10
- static handleError(error: HttpResponse<any> | any): Observable<never>;
11
- private static errorStatus;
12
- private static handleRedirect;
13
- private static handleErrorMessage;
14
- private static createSnackBar;
15
- get(url: string, options?: {
16
- params?: HttpParams;
17
- responseType?: any;
18
- observe?: any;
19
- }): Observable<any>;
20
- post(url: string, body: any | null, options?: {
21
- params?: HttpParams;
22
- responseType?: any;
23
- reportProgress?: boolean;
24
- observe?: any;
25
- }): Observable<any>;
26
- postFiles(url: string, body: any | null, options?: {
27
- params?: HttpParams;
28
- responseType?: any;
29
- reportProgress?: boolean;
30
- observe?: any;
31
- }): Observable<any>;
32
- delete(url: string, options?: {}): Observable<Object>;
33
- }
1
+ import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
2
+ import { MatSnackBar } from '@angular/material/snack-bar';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class HttpService {
6
+ private http;
7
+ private snackBar;
8
+ static ANGULAR_REQUEST_CONST: string;
9
+ private static instance;
10
+ constructor(http: HttpClient, snackBar: MatSnackBar);
11
+ static handleError(error: HttpResponse<any> | any): Observable<never>;
12
+ private static errorStatus;
13
+ private static handleRedirect;
14
+ private static handleErrorMessage;
15
+ private static createSnackBar;
16
+ get(url: string, options?: {
17
+ params?: HttpParams;
18
+ responseType?: any;
19
+ observe?: any;
20
+ }): Observable<any>;
21
+ post(url: string, body: any | null, options?: {
22
+ params?: HttpParams;
23
+ responseType?: any;
24
+ reportProgress?: boolean;
25
+ observe?: any;
26
+ }): Observable<any>;
27
+ postFiles(url: string, body: any | null, options?: {
28
+ params?: HttpParams;
29
+ responseType?: any;
30
+ reportProgress?: boolean;
31
+ observe?: any;
32
+ }): Observable<any>;
33
+ delete(url: string, options?: {}): Observable<Object>;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<HttpService, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
36
+ }
package/package.json CHANGED
@@ -1,19 +1,31 @@
1
1
  {
2
2
  "name": "@eurosat/http",
3
- "version": "10.0.0",
3
+ "version": "14.0.1",
4
4
  "peerDependencies": {
5
- "@angular/common": "^10.2.5",
6
- "@angular/core": "^10.2.5"
5
+ "@angular/common": "^14.3.0",
6
+ "@angular/core": "^14.3.0"
7
+ },
8
+ "module": "fesm2015/eurosat-http.mjs",
9
+ "es2020": "fesm2020/eurosat-http.mjs",
10
+ "esm2020": "esm2020/eurosat-http.mjs",
11
+ "fesm2020": "fesm2020/eurosat-http.mjs",
12
+ "fesm2015": "fesm2015/eurosat-http.mjs",
13
+ "typings": "index.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ },
18
+ ".": {
19
+ "types": "./index.d.ts",
20
+ "esm2020": "./esm2020/eurosat-http.mjs",
21
+ "es2020": "./fesm2020/eurosat-http.mjs",
22
+ "es2015": "./fesm2015/eurosat-http.mjs",
23
+ "node": "./fesm2015/eurosat-http.mjs",
24
+ "default": "./fesm2020/eurosat-http.mjs"
25
+ }
7
26
  },
8
- "main": "bundles/eurosat-http.umd.js",
9
- "module": "fesm2015/eurosat-http.js",
10
- "es2015": "fesm2015/eurosat-http.js",
11
- "esm2015": "esm2015/eurosat-http.js",
12
- "fesm2015": "fesm2015/eurosat-http.js",
13
- "typings": "eurosat-http.d.ts",
14
- "metadata": "eurosat-http.metadata.json",
15
27
  "sideEffects": false,
16
28
  "dependencies": {
17
- "tslib": "^2.0.0"
29
+ "tslib": "^2.3.0"
18
30
  }
19
- }
31
+ }
package/public_api.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './lib/http.service';
2
- export * from './lib/http.component';
3
- export * from './lib/http.module';
1
+ export * from './lib/http.service';
2
+ export * from './lib/http.component';
3
+ export * from './lib/http.module';