@ldu-anguboot/http 0.4.0 → 0.5.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # REL: Version bumped to v0.5.0 (2026-02-23)
2
+ - FEAT: project modernize
3
+
4
+ # REL: Version bumped to v0.4.1 (2026-02-23)
5
+ - HOTFIX: Missing library publish content
6
+
7
+ # REL: Version bumped to v0.4.0 (2026-02-23)
8
+ - REFACT: http service
9
+ - FEAT: LDu AnguBoot API configuration
10
+
11
+ # REL: Version bumped to v0.3.0 (2026-02-23)
12
+ - FEAT: Readme markdown file informations
13
+ - FEAT: Licensing to lildworks
14
+ - FEAT: npm publish only dist folder
15
+ - FEAT: Angular Library project
16
+
17
+ # REL: Version bumped to v0.2.0 (2026-02-20)
18
+ - FEAT: LDu AnguBoot API Url config
19
+ - FEAT: Public API created
20
+ - FEAT: LDu AnguBoot Http service
21
+ - FEAT: LDu AnguBoot API service
22
+ - FEAT: LDu AnguBoot API config
23
+ - Project init
24
+ - Initial commit
package/README.md CHANGED
@@ -1 +1 @@
1
- # LilDworks Development Utils - AnguBoot HTTP & API Library
1
+ # LilDworks Development Utils - AnguBoot - HTTP Library
@@ -0,0 +1,76 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, Injectable } from '@angular/core';
3
+ import { firstValueFrom } from 'rxjs';
4
+ import { HttpClient } from '@angular/common/http';
5
+
6
+ const API = new InjectionToken('API');
7
+
8
+ class LDuAnguBootHttpService {
9
+ http$ = inject(HttpClient);
10
+ GET(url) {
11
+ return this.http.get(url);
12
+ }
13
+ POST(url, data) {
14
+ return this.http.post(url, data);
15
+ }
16
+ PUT(url, data) {
17
+ return this.http.put(url, data);
18
+ }
19
+ DELETE(url) {
20
+ return this.http.delete(url);
21
+ }
22
+ get http() { return this.http$; }
23
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LDuAnguBootHttpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
24
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LDuAnguBootHttpService, providedIn: 'root' });
25
+ }
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LDuAnguBootHttpService, decorators: [{
27
+ type: Injectable,
28
+ args: [{ providedIn: 'root' }]
29
+ }] });
30
+
31
+ class LDuAnguBootApiService {
32
+ API$ = inject(API);
33
+ httpService = inject(LDuAnguBootHttpService);
34
+ url(endpoint) {
35
+ if (endpoint.startsWith('/')) {
36
+ endpoint = endpoint.substring(1);
37
+ }
38
+ return `${this.API$.url}/${endpoint}`;
39
+ }
40
+ GET(endpoint) {
41
+ return this.httpService.GET(this.url(endpoint));
42
+ }
43
+ POST(endpoint, data) {
44
+ return this.httpService.POST(this.url(endpoint), data);
45
+ }
46
+ PUT(endpoint, data) {
47
+ return this.httpService.PUT(this.url(endpoint), data);
48
+ }
49
+ DELETE(endpoint) {
50
+ return this.httpService.DELETE(this.url(endpoint));
51
+ }
52
+ getEcho() {
53
+ return this.GET(`/echo`);
54
+ }
55
+ async getVersion() {
56
+ try {
57
+ return await firstValueFrom(this.GET(`/version`));
58
+ }
59
+ catch {
60
+ return { version: null };
61
+ }
62
+ }
63
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LDuAnguBootApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
64
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LDuAnguBootApiService, providedIn: 'root' });
65
+ }
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: LDuAnguBootApiService, decorators: [{
67
+ type: Injectable,
68
+ args: [{ providedIn: 'root' }]
69
+ }] });
70
+
71
+ /**
72
+ * Generated bundle index. Do not edit.
73
+ */
74
+
75
+ export { API, LDuAnguBootApiService, LDuAnguBootHttpService };
76
+ //# sourceMappingURL=ldu-anguboot-http.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ldu-anguboot-http.mjs","sources":["../../src/config/ldu-anguboot-api.config.ts","../../src/services/ldu-anguboot-http.service.ts","../../src/services/ldu-anguboot-api.service.ts","../../src/ldu-anguboot-http.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const API = new InjectionToken<{\n url: string;\n}>('API');\n","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class LDuAnguBootHttpService {\n\n private readonly http$ = inject(HttpClient);\n\n GET<T>(url: string) {\n return this.http.get<T>(url);\n }\n\n POST<T>(url: string, data: T) {\n return this.http.post<T>(url, data);\n }\n\n PUT<T>(url: string, data: T) {\n return this.http.put<T>(url, data);\n }\n\n DELETE<T>(url: string) {\n return this.http.delete<T>(url);\n }\n\n get http() { return this.http$; }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { firstValueFrom, Observable } from 'rxjs';\nimport { API } from '../config/ldu-anguboot-api.config';\nimport { LDuAnguBootHttpService } from './ldu-anguboot-http.service';\n\n@Injectable({ providedIn: 'root' })\nexport class LDuAnguBootApiService {\n\n private readonly API$ = inject(API);\n\n private readonly httpService = inject(LDuAnguBootHttpService);\n\n url(endpoint: string) {\n if (endpoint.startsWith('/')) {\n endpoint = endpoint.substring(1);\n }\n return `${this.API$.url}/${endpoint}`;\n }\n\n GET<T>(endpoint: string) {\n return this.httpService.GET<T>(this.url(endpoint));\n }\n\n POST<T>(endpoint: string, data: T) {\n return this.httpService.POST<T>(this.url(endpoint), data);\n }\n\n PUT<T>(endpoint: string, data: T) {\n return this.httpService.PUT<T>(this.url(endpoint), data);\n }\n\n DELETE<T>(endpoint: string) {\n return this.httpService.DELETE<T>(this.url(endpoint));\n }\n\n getEcho(): Observable<Response> {\n return this.GET(`/echo`);\n }\n\n async getVersion(): Promise<{ version: string | null; }> {\n try {\n return await firstValueFrom(this.GET(`/version`));\n } catch {\n return { version: null };\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAEa,GAAG,GAAG,IAAI,cAAc,CAElC,KAAK;;MCAK,sBAAsB,CAAA;AAEd,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAE3C,IAAA,GAAG,CAAI,GAAW,EAAA;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAI,GAAG,CAAC;IAChC;IAEA,IAAI,CAAI,GAAW,EAAE,IAAO,EAAA;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAI,GAAG,EAAE,IAAI,CAAC;IACvC;IAEA,GAAG,CAAI,GAAW,EAAE,IAAO,EAAA;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAI,GAAG,EAAE,IAAI,CAAC;IACtC;AAEA,IAAA,MAAM,CAAI,GAAW,EAAA;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAI,GAAG,CAAC;IACnC;IAEA,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;uGApBvB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;MCGrB,qBAAqB,CAAA;AAEb,IAAA,IAAI,GA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AI,EAAE;QAC5B;IACJ;uGAvCS,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAArB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,MAAM,EAAA,CAAA;;2FACnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,31 +1,24 @@
1
1
  {
2
- "name": "@ldu-anguboot/http",
3
- "version": "0.4.0",
4
- "scripts": {
5
- "ng": "ng",
6
- "start": "ng serve",
7
- "build": "ng build",
8
- "watch": "ng build --watch --configuration development",
9
- "test": "ng test"
2
+ "name": "@ldu-anguboot/http",
3
+ "version": "0.5.0",
4
+ "peerDependencies": {
5
+ "@angular/common": "^21.0.0",
6
+ "@angular/core": "^21.1.0",
7
+ "rxjs": "~7.8.0"
8
+ },
9
+ "module": "fesm2022/ldu-anguboot-http.mjs",
10
+ "typings": "types/ldu-anguboot-http.d.ts",
11
+ "exports": {
12
+ "./package.json": {
13
+ "default": "./package.json"
10
14
  },
11
- "peerDependencies": {
12
- "@angular/common": "^21.0.0",
13
- "@angular/core": "^21.1.0",
14
- "rxjs": "~7.8.0"
15
- },
16
- "devDependencies": {
17
- "@angular/build": "^21.0.0",
18
- "@angular/cli": "^21.0.0",
19
- "@angular/common": "^21.0.0",
20
- "@angular/compiler": "^21.0.0",
21
- "@angular/compiler-cli": "^21.0.0",
22
- "@angular/core": "^21.0.0",
23
- "@angular/platform-browser": "^21.0.0",
24
- "@angular/router": "^21.0.0",
25
- "jsdom": "^27.1.0",
26
- "ng-packagr": "^21.0.0",
27
- "tslib": "^2.3.0",
28
- "typescript": "~5.9.2",
29
- "vitest": "^4.0.8"
15
+ ".": {
16
+ "types": "./types/ldu-anguboot-http.d.ts",
17
+ "default": "./fesm2022/ldu-anguboot-http.mjs"
30
18
  }
19
+ },
20
+ "sideEffects": false,
21
+ "dependencies": {
22
+ "tslib": "^2.3.0"
23
+ }
31
24
  }
@@ -0,0 +1,38 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken } from '@angular/core';
3
+ import * as rxjs from 'rxjs';
4
+ import { Observable } from 'rxjs';
5
+ import { HttpClient } from '@angular/common/http';
6
+
7
+ declare const API: InjectionToken<{
8
+ url: string;
9
+ }>;
10
+
11
+ declare class LDuAnguBootApiService {
12
+ private readonly API$;
13
+ private readonly httpService;
14
+ url(endpoint: string): string;
15
+ GET<T>(endpoint: string): Observable<T>;
16
+ POST<T>(endpoint: string, data: T): Observable<T>;
17
+ PUT<T>(endpoint: string, data: T): Observable<T>;
18
+ DELETE<T>(endpoint: string): Observable<T>;
19
+ getEcho(): Observable<Response>;
20
+ getVersion(): Promise<{
21
+ version: string | null;
22
+ }>;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<LDuAnguBootApiService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<LDuAnguBootApiService>;
25
+ }
26
+
27
+ declare class LDuAnguBootHttpService {
28
+ private readonly http$;
29
+ GET<T>(url: string): rxjs.Observable<T>;
30
+ POST<T>(url: string, data: T): rxjs.Observable<T>;
31
+ PUT<T>(url: string, data: T): rxjs.Observable<T>;
32
+ DELETE<T>(url: string): rxjs.Observable<T>;
33
+ get http(): HttpClient;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<LDuAnguBootHttpService, never>;
35
+ static ɵprov: i0.ɵɵInjectableDeclaration<LDuAnguBootHttpService>;
36
+ }
37
+
38
+ export { API, LDuAnguBootApiService, LDuAnguBootHttpService };