@flusys/ng-shared 1.0.0-rc → 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 +28 -3
- package/fesm2022/flusys-ng-shared.mjs +377 -572
- package/fesm2022/flusys-ng-shared.mjs.map +1 -1
- package/package.json +9 -9
- package/types/flusys-ng-shared.d.ts +270 -528
package/README.md
CHANGED
|
@@ -316,6 +316,12 @@ enum IconTypeEnum {
|
|
|
316
316
|
|
|
317
317
|
Signal-based CRUD service using Angular 21 `resource()` API. All endpoints use POST (RPC-style).
|
|
318
318
|
|
|
319
|
+
**ServiceName Type:**
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
type ServiceName = 'auth' | 'administration' | 'iam' | 'storage' | 'formBuilder' | 'email';
|
|
323
|
+
```
|
|
324
|
+
|
|
319
325
|
**Define a service:**
|
|
320
326
|
|
|
321
327
|
```typescript
|
|
@@ -326,11 +332,29 @@ import { ApiResourceService } from '@flusys/ng-shared';
|
|
|
326
332
|
@Injectable({ providedIn: 'root' })
|
|
327
333
|
export class UserService extends ApiResourceService<UserDto, IUser> {
|
|
328
334
|
constructor(http: HttpClient) {
|
|
329
|
-
|
|
335
|
+
// Option 1: Use global apiBaseUrl (default)
|
|
336
|
+
super('users', http);
|
|
337
|
+
// Base URL: APP_CONFIG.apiBaseUrl + '/users'
|
|
338
|
+
|
|
339
|
+
// Option 2: Use feature-specific service URL (recommended)
|
|
340
|
+
super('users', http, 'administration');
|
|
341
|
+
// Base URL: APP_CONFIG.services.administration.baseUrl + '/users'
|
|
330
342
|
}
|
|
331
343
|
}
|
|
332
344
|
```
|
|
333
345
|
|
|
346
|
+
**Constructor Parameters:**
|
|
347
|
+
|
|
348
|
+
| Parameter | Type | Required | Description |
|
|
349
|
+
|-----------|------|----------|-------------|
|
|
350
|
+
| `moduleApiName` | `string` | Yes | API path segment (e.g., 'users', 'file-manager') |
|
|
351
|
+
| `http` | `HttpClient` | Yes | Angular HttpClient instance |
|
|
352
|
+
| `serviceName` | `ServiceName` | No | Feature service name for URL resolution |
|
|
353
|
+
|
|
354
|
+
**Service URL Resolution:**
|
|
355
|
+
- If `serviceName` is provided, uses `getServiceUrl(config, serviceName)` to resolve the base URL
|
|
356
|
+
- Falls back to `APP_CONFIG.apiBaseUrl` if service not found or `serviceName` not provided
|
|
357
|
+
|
|
334
358
|
**Endpoint mapping:**
|
|
335
359
|
|
|
336
360
|
| Method | HTTP | Endpoint | Response |
|
|
@@ -1306,7 +1330,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
1306
1330
|
|
|
1307
1331
|
| Service | Description |
|
|
1308
1332
|
| ------------------------------ | ------------------------------------- |
|
|
1309
|
-
| `ApiResourceService<DTO, T>` | Signal-based CRUD with resource() API |
|
|
1333
|
+
| `ApiResourceService<DTO, T>` | Signal-based CRUD with resource() API (accepts optional `serviceName` for feature-specific URLs) |
|
|
1310
1334
|
| `FileUrlService` | Cloud storage URL fetching |
|
|
1311
1335
|
| `PermissionValidatorService` | Permission state management |
|
|
1312
1336
|
| `CookieService` | SSR-aware cookie reading |
|
|
@@ -1369,6 +1393,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
1369
1393
|
| `IUserListItem` | Base user for list operations |
|
|
1370
1394
|
| `IUserListAction` | User list action definition |
|
|
1371
1395
|
| `IUserListColumn` | Extra column for user list |
|
|
1396
|
+
| `ServiceName` | `'auth' \| 'administration' \| 'iam' \| 'storage' \| 'formBuilder' \| 'email'` |
|
|
1372
1397
|
|
|
1373
1398
|
### Injection Tokens
|
|
1374
1399
|
|
|
@@ -1391,5 +1416,5 @@ export const appConfig: ApplicationConfig = {
|
|
|
1391
1416
|
|
|
1392
1417
|
---
|
|
1393
1418
|
|
|
1394
|
-
**Last Updated:** 2026-02-
|
|
1419
|
+
**Last Updated:** 2026-02-22
|
|
1395
1420
|
**Angular Version:** 21
|