@ichgamer999/wmctest 1.0.0 → 1.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.
- package/README.md +142 -0
- package/dist/app/backend/backend-demo.component.d.ts +11 -0
- package/dist/app/backend/backend-demo.component.d.ts.map +1 -0
- package/dist/app/backend/backend-demo.component.js +162 -0
- package/dist/app/backend/backend.service.d.ts +20 -0
- package/dist/app/backend/backend.service.d.ts.map +1 -0
- package/dist/app/backend/backend.service.js +51 -0
- package/dist/app/home/home.component.d.ts.map +1 -1
- package/dist/app/home/home.component.js +26 -4
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/wmctest/3rdpartylicenses.txt +52 -52
- package/dist/wmctest/browser/chunk-AAHIOVR7.js +1 -0
- package/dist/wmctest/browser/chunk-IOFOGN3P.js +1 -0
- package/dist/wmctest/browser/chunk-LVFMTH2I.js +5 -0
- package/dist/wmctest/browser/chunk-U3WW7TST.js +1 -0
- package/dist/wmctest/browser/chunk-WM5SAM2A.js +1 -0
- package/dist/wmctest/browser/index.html +1 -1
- package/dist/wmctest/browser/main-EHFDL22K.js +1 -0
- package/package.json +8 -2
- package/src/app/app.routes.ts +5 -0
- package/src/app/backend/backend-demo.component.ts +176 -0
- package/src/app/backend/backend.service.ts +67 -0
- package/src/app/home/home.component.ts +26 -4
- package/src/public-api.ts +3 -0
- package/tsconfig.lib.json +2 -1
- package/dist/wmctest/browser/chunk-7JWVLKWP.js +0 -1
- package/dist/wmctest/browser/chunk-DMFXUAXO.js +0 -5
- package/dist/wmctest/browser/chunk-LJ47X2MA.js +0 -1
- package/dist/wmctest/browser/main-MA2WJZFH.js +0 -1
package/README.md
CHANGED
|
@@ -203,3 +203,145 @@ npm run build:lib
|
|
|
203
203
|
## License
|
|
204
204
|
|
|
205
205
|
MIT
|
|
206
|
+
|
|
207
|
+
## BackendService (NEW in v1.0.1)
|
|
208
|
+
|
|
209
|
+
Generic HTTP service for backend communication with automatic JWT authentication.
|
|
210
|
+
|
|
211
|
+
### Basic Usage
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { Component, inject } from '@angular/core';
|
|
215
|
+
import { BackendService } from '@yourusername/angular-auth-template';
|
|
216
|
+
|
|
217
|
+
interface User {
|
|
218
|
+
id: number;
|
|
219
|
+
name: string;
|
|
220
|
+
email: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@Component({
|
|
224
|
+
selector: 'app-users',
|
|
225
|
+
template: `
|
|
226
|
+
@for (user of users(); track user.id) {
|
|
227
|
+
<div>{{ user.name }}</div>
|
|
228
|
+
}
|
|
229
|
+
`
|
|
230
|
+
})
|
|
231
|
+
export class UsersComponent {
|
|
232
|
+
backendService = inject(BackendService);
|
|
233
|
+
users = signal<User[]>([]);
|
|
234
|
+
|
|
235
|
+
ngOnInit() {
|
|
236
|
+
// GET request with automatic JWT token
|
|
237
|
+
this.backendService.get<User[]>('/users').subscribe(
|
|
238
|
+
users => this.users.set(users)
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Available Methods
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
// GET request
|
|
248
|
+
backendService.get<T>(endpoint: string, params?: Record<string, string | number>)
|
|
249
|
+
|
|
250
|
+
// POST request
|
|
251
|
+
backendService.post<T>(endpoint: string, body: any)
|
|
252
|
+
|
|
253
|
+
// PUT request
|
|
254
|
+
backendService.put<T>(endpoint: string, body: any)
|
|
255
|
+
|
|
256
|
+
// PATCH request
|
|
257
|
+
backendService.patch<T>(endpoint: string, body: any)
|
|
258
|
+
|
|
259
|
+
// DELETE request
|
|
260
|
+
backendService.delete<T>(endpoint: string)
|
|
261
|
+
|
|
262
|
+
// GET with standardized response
|
|
263
|
+
backendService.getWithResponse<T>(endpoint: string, params?)
|
|
264
|
+
|
|
265
|
+
// POST with standardized response
|
|
266
|
+
backendService.postWithResponse<T>(endpoint: string, body: any)
|
|
267
|
+
|
|
268
|
+
// Upload file
|
|
269
|
+
backendService.uploadFile<T>(endpoint: string, file: File, additionalData?)
|
|
270
|
+
|
|
271
|
+
// Download file
|
|
272
|
+
backendService.downloadFile(endpoint: string): Observable<Blob>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Examples
|
|
276
|
+
|
|
277
|
+
**With Query Parameters:**
|
|
278
|
+
```typescript
|
|
279
|
+
backendService.get<User[]>('/users', { page: 1, limit: 10 }).subscribe();
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Create Resource:**
|
|
283
|
+
```typescript
|
|
284
|
+
const newUser = { name: 'John', email: 'john@example.com' };
|
|
285
|
+
backendService.post<User>('/users', newUser).subscribe();
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Update Resource:**
|
|
289
|
+
```typescript
|
|
290
|
+
const updates = { name: 'Jane' };
|
|
291
|
+
backendService.put<User>('/users/123', updates).subscribe();
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Delete Resource:**
|
|
295
|
+
```typescript
|
|
296
|
+
backendService.delete<void>('/users/123').subscribe();
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**File Upload:**
|
|
300
|
+
```typescript
|
|
301
|
+
const file = event.target.files[0];
|
|
302
|
+
backendService.uploadFile('/upload', file, { category: 'profile' }).subscribe();
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**File Download:**
|
|
306
|
+
```typescript
|
|
307
|
+
backendService.downloadFile('/export/users').subscribe(blob => {
|
|
308
|
+
const url = window.URL.createObjectURL(blob);
|
|
309
|
+
const a = document.createElement('a');
|
|
310
|
+
a.href = url;
|
|
311
|
+
a.download = 'users.csv';
|
|
312
|
+
a.click();
|
|
313
|
+
});
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### ApiResponse Interface
|
|
317
|
+
|
|
318
|
+
For standardized API responses:
|
|
319
|
+
|
|
320
|
+
```typescript
|
|
321
|
+
interface ApiResponse<T> {
|
|
322
|
+
data: T;
|
|
323
|
+
message?: string;
|
|
324
|
+
success: boolean;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Usage
|
|
328
|
+
backendService.getWithResponse<User[]>('/users').subscribe(response => {
|
|
329
|
+
if (response.success) {
|
|
330
|
+
console.log(response.data);
|
|
331
|
+
console.log(response.message);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Configuration
|
|
337
|
+
|
|
338
|
+
Set your API base URL:
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
ngOnInit() {
|
|
342
|
+
this.backendService.baseUrl = 'https://api.example.com';
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Note:** All requests automatically include the JWT token via `authInterceptor`.
|
|
347
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class BackendDemoComponent {
|
|
2
|
+
private backendService;
|
|
3
|
+
loading: import("@angular/core").WritableSignal<boolean>;
|
|
4
|
+
error: import("@angular/core").WritableSignal<string>;
|
|
5
|
+
response: import("@angular/core").WritableSignal<any>;
|
|
6
|
+
getUsers(): void;
|
|
7
|
+
createUser(): void;
|
|
8
|
+
updateUser(): void;
|
|
9
|
+
deleteUser(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=backend-demo.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend-demo.component.d.ts","sourceRoot":"","sources":["../../../src/app/backend/backend-demo.component.ts"],"names":[],"mappings":"AAUA,qBAqFa,oBAAoB;IAC/B,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,kDAAiB;IACxB,KAAK,iDAAc;IACnB,QAAQ,8CAAqB;IAE7B,QAAQ;IAgBR,UAAU;IAqBV,UAAU;IAqBV,UAAU;CAeX"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Component, inject, signal } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { BackendService } from './backend.service';
|
|
5
|
+
let BackendDemoComponent = class BackendDemoComponent {
|
|
6
|
+
backendService = inject(BackendService);
|
|
7
|
+
loading = signal(false);
|
|
8
|
+
error = signal('');
|
|
9
|
+
response = signal(null);
|
|
10
|
+
getUsers() {
|
|
11
|
+
this.loading.set(true);
|
|
12
|
+
this.error.set('');
|
|
13
|
+
this.backendService.get('/users').subscribe({
|
|
14
|
+
next: (users) => {
|
|
15
|
+
this.loading.set(false);
|
|
16
|
+
this.response.set(users);
|
|
17
|
+
},
|
|
18
|
+
error: (err) => {
|
|
19
|
+
this.loading.set(false);
|
|
20
|
+
this.error.set(err.message || 'Failed to fetch users');
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
createUser() {
|
|
25
|
+
this.loading.set(true);
|
|
26
|
+
this.error.set('');
|
|
27
|
+
const newUser = {
|
|
28
|
+
name: 'John Doe',
|
|
29
|
+
email: 'john@example.com'
|
|
30
|
+
};
|
|
31
|
+
this.backendService.post('/users', newUser).subscribe({
|
|
32
|
+
next: (user) => {
|
|
33
|
+
this.loading.set(false);
|
|
34
|
+
this.response.set(user);
|
|
35
|
+
},
|
|
36
|
+
error: (err) => {
|
|
37
|
+
this.loading.set(false);
|
|
38
|
+
this.error.set(err.message || 'Failed to create user');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
updateUser() {
|
|
43
|
+
this.loading.set(true);
|
|
44
|
+
this.error.set('');
|
|
45
|
+
const updatedUser = {
|
|
46
|
+
name: 'Jane Doe',
|
|
47
|
+
email: 'jane@example.com'
|
|
48
|
+
};
|
|
49
|
+
this.backendService.put('/users/1', updatedUser).subscribe({
|
|
50
|
+
next: (user) => {
|
|
51
|
+
this.loading.set(false);
|
|
52
|
+
this.response.set(user);
|
|
53
|
+
},
|
|
54
|
+
error: (err) => {
|
|
55
|
+
this.loading.set(false);
|
|
56
|
+
this.error.set(err.message || 'Failed to update user');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
deleteUser() {
|
|
61
|
+
this.loading.set(true);
|
|
62
|
+
this.error.set('');
|
|
63
|
+
this.backendService.delete('/users/1').subscribe({
|
|
64
|
+
next: () => {
|
|
65
|
+
this.loading.set(false);
|
|
66
|
+
this.response.set({ message: 'User deleted successfully' });
|
|
67
|
+
},
|
|
68
|
+
error: (err) => {
|
|
69
|
+
this.loading.set(false);
|
|
70
|
+
this.error.set(err.message || 'Failed to delete user');
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
BackendDemoComponent = __decorate([
|
|
76
|
+
Component({
|
|
77
|
+
selector: 'app-backend-demo',
|
|
78
|
+
standalone: true,
|
|
79
|
+
imports: [CommonModule],
|
|
80
|
+
template: `
|
|
81
|
+
<div class="demo-container">
|
|
82
|
+
<h2>Backend Service Demo</h2>
|
|
83
|
+
|
|
84
|
+
<div class="actions">
|
|
85
|
+
<button (click)="getUsers()">Get Users</button>
|
|
86
|
+
<button (click)="createUser()">Create User</button>
|
|
87
|
+
<button (click)="updateUser()">Update User</button>
|
|
88
|
+
<button (click)="deleteUser()">Delete User</button>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
@if (loading()) {
|
|
92
|
+
<div class="loading">Loading...</div>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@if (error()) {
|
|
96
|
+
<div class="error">{{ error() }}</div>
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@if (response()) {
|
|
100
|
+
<div class="response">
|
|
101
|
+
<h3>Response:</h3>
|
|
102
|
+
<pre>{{ response() | json }}</pre>
|
|
103
|
+
</div>
|
|
104
|
+
}
|
|
105
|
+
</div>
|
|
106
|
+
`,
|
|
107
|
+
styles: [`
|
|
108
|
+
.demo-container {
|
|
109
|
+
padding: 2rem;
|
|
110
|
+
max-width: 800px;
|
|
111
|
+
margin: 0 auto;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.actions {
|
|
115
|
+
display: flex;
|
|
116
|
+
gap: 1rem;
|
|
117
|
+
margin: 2rem 0;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
button {
|
|
122
|
+
padding: 0.75rem 1.5rem;
|
|
123
|
+
background: #007bff;
|
|
124
|
+
color: white;
|
|
125
|
+
border: none;
|
|
126
|
+
border-radius: 4px;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
button:hover {
|
|
131
|
+
background: #0056b3;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.loading, .error, .response {
|
|
135
|
+
padding: 1rem;
|
|
136
|
+
margin: 1rem 0;
|
|
137
|
+
border-radius: 4px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.loading {
|
|
141
|
+
background: #e3f2fd;
|
|
142
|
+
color: #1976d2;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.error {
|
|
146
|
+
background: #ffebee;
|
|
147
|
+
color: #c62828;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.response {
|
|
151
|
+
background: #f5f5f5;
|
|
152
|
+
border: 1px solid #ddd;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
pre {
|
|
156
|
+
overflow-x: auto;
|
|
157
|
+
margin: 0.5rem 0 0;
|
|
158
|
+
}
|
|
159
|
+
`]
|
|
160
|
+
})
|
|
161
|
+
], BackendDemoComponent);
|
|
162
|
+
export { BackendDemoComponent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export interface ApiResponse<T> {
|
|
3
|
+
data: T;
|
|
4
|
+
message?: string;
|
|
5
|
+
success: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class BackendService {
|
|
8
|
+
private readonly http;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
get<T>(endpoint: string, params?: Record<string, string | number>): Observable<T>;
|
|
11
|
+
post<T>(endpoint: string, body: any): Observable<T>;
|
|
12
|
+
put<T>(endpoint: string, body: any): Observable<T>;
|
|
13
|
+
patch<T>(endpoint: string, body: any): Observable<T>;
|
|
14
|
+
delete<T>(endpoint: string): Observable<T>;
|
|
15
|
+
getWithResponse<T>(endpoint: string, params?: Record<string, string | number>): Observable<ApiResponse<T>>;
|
|
16
|
+
postWithResponse<T>(endpoint: string, body: any): Observable<ApiResponse<T>>;
|
|
17
|
+
uploadFile<T>(endpoint: string, file: File, additionalData?: Record<string, any>): Observable<T>;
|
|
18
|
+
downloadFile(endpoint: string): Observable<Blob>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=backend.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.service.d.ts","sourceRoot":"","sources":["../../../src/app/backend/backend.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAGa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAE3C,OAAO,SAA+B;IAEtC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAKjF,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;IAInD,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;IAIlD,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC;IAIpD,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAI1C,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAK1G,gBAAgB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAI5E,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAahG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC;CAKjD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { Injectable, inject } from '@angular/core';
|
|
3
|
+
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
4
|
+
let BackendService = class BackendService {
|
|
5
|
+
http = inject(HttpClient);
|
|
6
|
+
baseUrl = 'http://localhost:3000/api';
|
|
7
|
+
get(endpoint, params) {
|
|
8
|
+
const httpParams = params ? new HttpParams({ fromObject: params }) : undefined;
|
|
9
|
+
return this.http.get(`${this.baseUrl}${endpoint}`, { params: httpParams });
|
|
10
|
+
}
|
|
11
|
+
post(endpoint, body) {
|
|
12
|
+
return this.http.post(`${this.baseUrl}${endpoint}`, body);
|
|
13
|
+
}
|
|
14
|
+
put(endpoint, body) {
|
|
15
|
+
return this.http.put(`${this.baseUrl}${endpoint}`, body);
|
|
16
|
+
}
|
|
17
|
+
patch(endpoint, body) {
|
|
18
|
+
return this.http.patch(`${this.baseUrl}${endpoint}`, body);
|
|
19
|
+
}
|
|
20
|
+
delete(endpoint) {
|
|
21
|
+
return this.http.delete(`${this.baseUrl}${endpoint}`);
|
|
22
|
+
}
|
|
23
|
+
getWithResponse(endpoint, params) {
|
|
24
|
+
const httpParams = params ? new HttpParams({ fromObject: params }) : undefined;
|
|
25
|
+
return this.http.get(`${this.baseUrl}${endpoint}`, { params: httpParams });
|
|
26
|
+
}
|
|
27
|
+
postWithResponse(endpoint, body) {
|
|
28
|
+
return this.http.post(`${this.baseUrl}${endpoint}`, body);
|
|
29
|
+
}
|
|
30
|
+
uploadFile(endpoint, file, additionalData) {
|
|
31
|
+
const formData = new FormData();
|
|
32
|
+
formData.append('file', file);
|
|
33
|
+
if (additionalData) {
|
|
34
|
+
Object.keys(additionalData).forEach(key => {
|
|
35
|
+
formData.append(key, additionalData[key]);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return this.http.post(`${this.baseUrl}${endpoint}`, formData);
|
|
39
|
+
}
|
|
40
|
+
downloadFile(endpoint) {
|
|
41
|
+
return this.http.get(`${this.baseUrl}${endpoint}`, {
|
|
42
|
+
responseType: 'blob'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
BackendService = __decorate([
|
|
47
|
+
Injectable({
|
|
48
|
+
providedIn: 'root'
|
|
49
|
+
})
|
|
50
|
+
], BackendService);
|
|
51
|
+
export { BackendService };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.component.d.ts","sourceRoot":"","sources":["../../../src/app/home/home.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,
|
|
1
|
+
{"version":3,"file":"home.component.d.ts","sourceRoot":"","sources":["../../../src/app/home/home.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,qBAgFa,aAAa;IACxB,WAAW,cAAuB;IAElC,MAAM;CAGP"}
|
|
@@ -22,7 +22,10 @@ HomeComponent = __decorate([
|
|
|
22
22
|
<p>You are logged in as: <strong>{{ username }}</strong></p>
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
<
|
|
25
|
+
<div class="actions">
|
|
26
|
+
<a href="/demo" class="btn btn-primary">Backend Service Demo</a>
|
|
27
|
+
<button (click)="logout()" class="btn btn-danger">Logout</button>
|
|
28
|
+
</div>
|
|
26
29
|
</div>
|
|
27
30
|
</div>
|
|
28
31
|
`,
|
|
@@ -52,17 +55,36 @@ HomeComponent = __decorate([
|
|
|
52
55
|
color: #666;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
|
|
58
|
+
.actions {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 1rem;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.btn {
|
|
56
65
|
padding: 0.75rem 2rem;
|
|
57
|
-
background: #dc3545;
|
|
58
66
|
color: white;
|
|
59
67
|
border: none;
|
|
60
68
|
border-radius: 4px;
|
|
61
69
|
font-size: 1rem;
|
|
62
70
|
cursor: pointer;
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
display: inline-block;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.btn-primary {
|
|
76
|
+
background: #007bff;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.btn-primary:hover {
|
|
80
|
+
background: #0056b3;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.btn-danger {
|
|
84
|
+
background: #dc3545;
|
|
63
85
|
}
|
|
64
86
|
|
|
65
|
-
|
|
87
|
+
.btn-danger:hover {
|
|
66
88
|
background: #c82333;
|
|
67
89
|
}
|
|
68
90
|
`]
|
package/dist/public-api.d.ts
CHANGED
|
@@ -3,4 +3,7 @@ export { authInterceptor } from './app/auth/auth.interceptor';
|
|
|
3
3
|
export { authGuard } from './app/guards/auth.guard';
|
|
4
4
|
export { LoginComponent } from './app/login/login.component';
|
|
5
5
|
export { HomeComponent } from './app/home/home.component';
|
|
6
|
+
export { BackendService } from './app/backend/backend.service';
|
|
7
|
+
export { BackendDemoComponent } from './app/backend/backend-demo.component';
|
|
8
|
+
export type { ApiResponse } from './app/backend/backend.service';
|
|
6
9
|
//# sourceMappingURL=public-api.d.ts.map
|
package/dist/public-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,YAAY,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/public-api.js
CHANGED
|
@@ -3,3 +3,5 @@ export { authInterceptor } from './app/auth/auth.interceptor';
|
|
|
3
3
|
export { authGuard } from './app/guards/auth.guard';
|
|
4
4
|
export { LoginComponent } from './app/login/login.component';
|
|
5
5
|
export { HomeComponent } from './app/home/home.component';
|
|
6
|
+
export { BackendService } from './app/backend/backend.service';
|
|
7
|
+
export { BackendDemoComponent } from './app/backend/backend-demo.component';
|
|
@@ -25,6 +25,58 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
25
25
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
26
|
THE SOFTWARE.
|
|
27
27
|
|
|
28
|
+
--------------------------------------------------------------------------------
|
|
29
|
+
Package: @angular/platform-browser
|
|
30
|
+
License: "MIT"
|
|
31
|
+
|
|
32
|
+
The MIT License
|
|
33
|
+
|
|
34
|
+
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
|
|
35
|
+
|
|
36
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
37
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
38
|
+
in the Software without restriction, including without limitation the rights
|
|
39
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
40
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
41
|
+
furnished to do so, subject to the following conditions:
|
|
42
|
+
|
|
43
|
+
The above copyright notice and this permission notice shall be included in
|
|
44
|
+
all copies or substantial portions of the Software.
|
|
45
|
+
|
|
46
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
47
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
48
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
49
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
50
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
51
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
52
|
+
THE SOFTWARE.
|
|
53
|
+
|
|
54
|
+
--------------------------------------------------------------------------------
|
|
55
|
+
Package: @angular/router
|
|
56
|
+
License: "MIT"
|
|
57
|
+
|
|
58
|
+
The MIT License
|
|
59
|
+
|
|
60
|
+
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
|
|
61
|
+
|
|
62
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
64
|
+
in the Software without restriction, including without limitation the rights
|
|
65
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
66
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
67
|
+
furnished to do so, subject to the following conditions:
|
|
68
|
+
|
|
69
|
+
The above copyright notice and this permission notice shall be included in
|
|
70
|
+
all copies or substantial portions of the Software.
|
|
71
|
+
|
|
72
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
73
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
74
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
75
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
76
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
77
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
78
|
+
THE SOFTWARE.
|
|
79
|
+
|
|
28
80
|
--------------------------------------------------------------------------------
|
|
29
81
|
Package: @angular/core
|
|
30
82
|
License: "MIT"
|
|
@@ -301,55 +353,3 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
301
353
|
THE SOFTWARE.
|
|
302
354
|
|
|
303
355
|
--------------------------------------------------------------------------------
|
|
304
|
-
Package: @angular/platform-browser
|
|
305
|
-
License: "MIT"
|
|
306
|
-
|
|
307
|
-
The MIT License
|
|
308
|
-
|
|
309
|
-
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
|
|
310
|
-
|
|
311
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
312
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
313
|
-
in the Software without restriction, including without limitation the rights
|
|
314
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
315
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
316
|
-
furnished to do so, subject to the following conditions:
|
|
317
|
-
|
|
318
|
-
The above copyright notice and this permission notice shall be included in
|
|
319
|
-
all copies or substantial portions of the Software.
|
|
320
|
-
|
|
321
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
322
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
323
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
324
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
325
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
326
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
327
|
-
THE SOFTWARE.
|
|
328
|
-
|
|
329
|
-
--------------------------------------------------------------------------------
|
|
330
|
-
Package: @angular/router
|
|
331
|
-
License: "MIT"
|
|
332
|
-
|
|
333
|
-
The MIT License
|
|
334
|
-
|
|
335
|
-
Copyright (c) 2010-2026 Google LLC. https://angular.dev/license
|
|
336
|
-
|
|
337
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
338
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
339
|
-
in the Software without restriction, including without limitation the rights
|
|
340
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
341
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
342
|
-
furnished to do so, subject to the following conditions:
|
|
343
|
-
|
|
344
|
-
The above copyright notice and this permission notice shall be included in
|
|
345
|
-
all copies or substantial portions of the Software.
|
|
346
|
-
|
|
347
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
348
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
349
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
350
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
351
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
352
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
353
|
-
THE SOFTWARE.
|
|
354
|
-
|
|
355
|
-
--------------------------------------------------------------------------------
|