ngrx-entity-crud 19.4.0-beta.4 → 19.4.0-beta.6
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 +91 -0
- package/devtools/agnostic-selectors.d.ts +32 -0
- package/devtools/agnostic-selectors.d.ts.map +1 -0
- package/devtools/idb-adapter.token.d.ts +11 -0
- package/devtools/idb-adapter.token.d.ts.map +1 -0
- package/devtools/index.d.ts +6 -0
- package/devtools/mask.d.ts +15 -0
- package/devtools/mask.d.ts.map +1 -0
- package/devtools/models.d.ts +93 -0
- package/devtools/models.d.ts.map +1 -0
- package/devtools/nec-dashboard.component.d.ts +46 -0
- package/devtools/nec-dashboard.component.d.ts.map +1 -0
- package/devtools/ngrx-entity-crud-devtools.d.ts.map +1 -0
- package/devtools/package.json +3 -0
- package/devtools/probes/nec-indexeddb-probe.service.d.ts +25 -0
- package/devtools/probes/nec-indexeddb-probe.service.d.ts.map +1 -0
- package/devtools/probes/nec-local-storage-probe.service.d.ts +27 -0
- package/devtools/probes/nec-local-storage-probe.service.d.ts.map +1 -0
- package/devtools/probes/nec-store-probe.service.d.ts +30 -0
- package/devtools/probes/nec-store-probe.service.d.ts.map +1 -0
- package/devtools/public-api.d.ts +16 -0
- package/devtools/public-api.d.ts.map +1 -0
- package/fesm2022/ngrx-entity-crud-devtools.mjs +1033 -0
- package/fesm2022/ngrx-entity-crud-devtools.mjs.map +1 -0
- package/fesm2022/ngrx-entity-crud.mjs.map +1 -1
- package/lib/reducer.d.ts +2 -2
- package/lib/reducer.d.ts.map +1 -1
- package/package.json +5 -1
- package/schematics/collection.json +5 -0
- package/schematics/dashboard/files/primeng/__clazz@dasherize__/__clazz@dasherize__-main/__clazz@dasherize__-main.component.html +12 -0
- package/schematics/dashboard/files/primeng/__clazz@dasherize__/__clazz@dasherize__-main/__clazz@dasherize__-main.component.ts +14 -0
- package/schematics/dashboard/files/primeng/__clazz@dasherize__/__clazz@dasherize__-routing.module.ts +30 -0
- package/schematics/dashboard/files/primeng/__clazz@dasherize__/__clazz@dasherize__.module.ts +21 -0
- package/schematics/dashboard/index.d.ts +12 -0
- package/schematics/dashboard/index.js +71 -0
- package/schematics/dashboard/index.js.map +1 -0
- package/schematics/dashboard/index.ts +77 -0
- package/schematics/dashboard/schema.d.ts +21 -0
- package/schematics/dashboard/schema.json +31 -0
- package/schematics/lazy-report/index.js +59 -9
- package/schematics/lazy-report/index.js.map +1 -1
- package/schematics/lazy-report/index.ts +63 -10
- package/schematics/lazy-report/schema.d.ts +5 -0
- package/schematics/lazy-report/schema.json +5 -0
package/README.md
CHANGED
|
@@ -309,6 +309,17 @@ Infrastructure stores excluded from lazy candidates (folder names).
|
|
|
309
309
|
- Type: `string[]`
|
|
310
310
|
- Default: `["router-store"]`
|
|
311
311
|
|
|
312
|
+
Include detected persistence providers (localStorage/IndexedDB) from `package.json` in the report.
|
|
313
|
+
- `--storage`
|
|
314
|
+
- Type: `boolean`
|
|
315
|
+
- Default: `true`
|
|
316
|
+
|
|
317
|
+
The JSON report (`--format=json`) also includes a top-level `generatedAt` (ISO timestamp, for
|
|
318
|
+
staleness detection) and, per store, the structured booleans `lazyRoute` and `isLazyCandidate`
|
|
319
|
+
(so tools can correlate without parsing the textual `verdict`). When `--storage` is enabled it
|
|
320
|
+
adds a `storage` object `{ providers, source }`. The `{ paths, stores }` shape is unchanged
|
|
321
|
+
(additive, backward-compatible).
|
|
322
|
+
|
|
312
323
|
#### Examples
|
|
313
324
|
|
|
314
325
|
```sh
|
|
@@ -327,6 +338,86 @@ Example output (excerpt):
|
|
|
327
338
|
| menu-store | Menu | CRUD-PLURAL | - | 0 | - | si | tieni eager (usato dalla shell) |
|
|
328
339
|
```
|
|
329
340
|
|
|
341
|
+
## dashboard
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### Overview
|
|
346
|
+
|
|
347
|
+
Scaffolds a **project dashboard** view with three runtime summaries: localStorage usage,
|
|
348
|
+
IndexedDB usage (agnostic to the persistence library you use), and NgRx stores + lazy-loading
|
|
349
|
+
candidates. The generated module is a thin PrimeNG wrapper that hosts `<nec-dashboard>`, the
|
|
350
|
+
standalone component exported by the secondary entry-point `ngrx-entity-crud/devtools`; all the
|
|
351
|
+
diagnostic logic lives in the library (versioned and tested), not in generated code.
|
|
352
|
+
|
|
353
|
+
By default it also generates `src/assets/lazy-report.json` (reusing `lazy-report --format=json`),
|
|
354
|
+
which the dashboard reads at runtime to correlate the loaded/lazy state of each store.
|
|
355
|
+
|
|
356
|
+
The dashboard can run in **production**: by default it shows only keys, sizes and counts — never
|
|
357
|
+
raw values. Value reveal is opt-in (`[allowRevealValues]="true"`) and always masks sensitive
|
|
358
|
+
patterns (token/JWT/email/secret); keys that look sensitive are flagged.
|
|
359
|
+
|
|
360
|
+
### Command
|
|
361
|
+
|
|
362
|
+
```sh
|
|
363
|
+
ng generate ngrx-entity-crud:dashboard [options]
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Options
|
|
367
|
+
|
|
368
|
+
Feature name (drives the lazy route and the generated file names).
|
|
369
|
+
- `--clazz`
|
|
370
|
+
- Type: `string`
|
|
371
|
+
- Default: `Dashboard`
|
|
372
|
+
|
|
373
|
+
Generate the lazy-report JSON read by the dashboard.
|
|
374
|
+
- `--include-lazy-report`
|
|
375
|
+
- Type: `boolean`
|
|
376
|
+
- Default: `true`
|
|
377
|
+
|
|
378
|
+
Path of the generated lazy-report JSON.
|
|
379
|
+
- `--lazy-report-output`
|
|
380
|
+
- Type: `string`
|
|
381
|
+
- Default: `src/assets/lazy-report.json`
|
|
382
|
+
|
|
383
|
+
The name of the project.
|
|
384
|
+
- `--project`
|
|
385
|
+
- Type: `string`
|
|
386
|
+
|
|
387
|
+
#### Using the standalone component directly
|
|
388
|
+
|
|
389
|
+
If you prefer not to scaffold, import the component from the secondary entry-point and mount it
|
|
390
|
+
anywhere (e.g. behind a dev-only route):
|
|
391
|
+
|
|
392
|
+
```ts
|
|
393
|
+
import { NecDashboardComponent } from 'ngrx-entity-crud/devtools';
|
|
394
|
+
|
|
395
|
+
@Component({
|
|
396
|
+
standalone: true,
|
|
397
|
+
imports: [NecDashboardComponent],
|
|
398
|
+
template: `<nec-dashboard
|
|
399
|
+
lazyReportUrl="assets/lazy-report.json"
|
|
400
|
+
[idbDatabaseNames]="['NgRxStateStore']"
|
|
401
|
+
[allowRevealValues]="false"
|
|
402
|
+
[pollingMs]="0"></nec-dashboard>`,
|
|
403
|
+
})
|
|
404
|
+
export class DevPanelComponent {}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Inputs: `blacklist` / `whitelist` (`string[]`, filter store slices), `lazyReportUrl`
|
|
408
|
+
(default `assets/lazy-report.json`; empty string disables the static correlation),
|
|
409
|
+
`idbDatabaseNames` (`string[]`, DB names to inspect where `indexedDB.databases()` is unsupported —
|
|
410
|
+
Firefox / older Safari), `pollingMs` (`number`, auto-refresh; `0` = manual), `allowRevealValues`
|
|
411
|
+
(`boolean`, opt-in masked value reveal).
|
|
412
|
+
|
|
413
|
+
Notes:
|
|
414
|
+
- IndexedDB is introspected **agnostically** via native APIs (`indexedDB.databases()` + `count()`),
|
|
415
|
+
with an optional `NEC_IDB_ADAPTER` injection token for custom providers. Byte sizes per
|
|
416
|
+
record/store are not measurable; only record counts and the aggregate origin quota
|
|
417
|
+
(`navigator.storage.estimate()`) are shown.
|
|
418
|
+
- `<nec-dashboard>` requires Angular 17+ on the consumer (standalone component + control flow);
|
|
419
|
+
the main entry-point keeps the wider peer range.
|
|
420
|
+
|
|
330
421
|
## Running unit tests
|
|
331
422
|
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
332
423
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MemoizedSelector } from '@ngrx/store';
|
|
2
|
+
/**
|
|
3
|
+
* Versione FACTORY (parametrizzabile) dei selettori agnostici di loading/error che il
|
|
4
|
+
* template `ng-add` installa in `root-store/selectors.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Il template resta invariato (retro-compatibilità): qui la logica è IDENTICA ma con
|
|
7
|
+
* `rootSelector`/`blacklist`/`whitelist` resi parametri invece che costanti hardcoded, così
|
|
8
|
+
* è riutilizzabile dal pacchetto npm (entry-point `ngrx-entity-crud/devtools`).
|
|
9
|
+
*
|
|
10
|
+
* Scandisce lo stato sfruttando la convenzione `EntityCrudBaseState`: ogni slice CRUD espone
|
|
11
|
+
* `isLoading: boolean` ed `error: string | null` al livello top.
|
|
12
|
+
*/
|
|
13
|
+
export interface AgnosticLoadingSelectorsOptions {
|
|
14
|
+
/** Selettore della radice da scandire (default: l'intero stato root). */
|
|
15
|
+
rootSelector?: (state: any) => Record<string, any>;
|
|
16
|
+
/** Chiavi di slice da escludere dallo scan. */
|
|
17
|
+
blacklist?: ReadonlyArray<string>;
|
|
18
|
+
/** Se valorizzata, considera SOLO queste chiavi (precede la blacklist). */
|
|
19
|
+
whitelist?: ReadonlyArray<string>;
|
|
20
|
+
}
|
|
21
|
+
export interface AgnosticLoadingSelectors {
|
|
22
|
+
/** Nomi delle slice attualmente in caricamento (`isLoading === true`). */
|
|
23
|
+
selectLoadingNames: MemoizedSelector<any, string[]>;
|
|
24
|
+
/** `true` se almeno una slice CRUD è in caricamento. */
|
|
25
|
+
selectIsLoading: MemoizedSelector<any, boolean>;
|
|
26
|
+
/** Elenco degli errori non vuoti presenti nelle slice CRUD. */
|
|
27
|
+
selectErrors: MemoizedSelector<any, string[]>;
|
|
28
|
+
/** Concatenazione degli errori non vuoti (stringa vuota se non ce ne sono). */
|
|
29
|
+
selectError: MemoizedSelector<any, string>;
|
|
30
|
+
}
|
|
31
|
+
export declare function createAgnosticLoadingSelectors(options?: AgnosticLoadingSelectorsOptions): AgnosticLoadingSelectors;
|
|
32
|
+
//# sourceMappingURL=agnostic-selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agnostic-selectors.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/agnostic-selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,+BAA+B;IAC9C,yEAAyE;IACzE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnD,+CAA+C;IAC/C,SAAS,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAClC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,kBAAkB,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,wDAAwD;IACxD,eAAe,EAAE,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAChD,+DAA+D;IAC/D,YAAY,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,+EAA+E;IAC/E,WAAW,EAAE,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;CAC5C;AAOD,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,+BAAoC,GAC5C,wBAAwB,CAoC1B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { NecIdbAdapter } from './models';
|
|
3
|
+
/**
|
|
4
|
+
* Adapter IndexedDB OPZIONALE, agnostico rispetto alla libreria di persistenza.
|
|
5
|
+
*
|
|
6
|
+
* Fornendolo, il `NecIndexedDbProbeService` lo usa con priorità per enumerare i database
|
|
7
|
+
* (utile quando la libreria del consumer nasconde i nomi DB o su browser senza
|
|
8
|
+
* `indexedDB.databases()`, es. Firefox). Quando NON fornito, il probe usa solo le API native.
|
|
9
|
+
*/
|
|
10
|
+
export declare const NEC_IDB_ADAPTER: InjectionToken<NecIdbAdapter>;
|
|
11
|
+
//# sourceMappingURL=idb-adapter.token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idb-adapter.token.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/idb-adapter.token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,+BAAuD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility di privacy per la dashboard: poiché può girare anche in PRODUZIONE, i valori non
|
|
3
|
+
* vengono mai mostrati di default e — quando il consumer abilita esplicitamente il reveal —
|
|
4
|
+
* vengono comunque mascherati i pattern sensibili (token/JWT/email/segreti).
|
|
5
|
+
*/
|
|
6
|
+
/** `true` se il nome chiave suggerisce un contenuto sensibile (token, password, ecc.). */
|
|
7
|
+
export declare function looksSensitiveKey(key: string): boolean;
|
|
8
|
+
/** Redige nel testo i pattern sensibili comuni (JWT, email, token/hex lunghi). */
|
|
9
|
+
export declare function redactSensitive(value: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Valore "sicuro da mostrare": se la chiave è sensibile, nasconde tutto (mostra solo la
|
|
12
|
+
* lunghezza); altrimenti redige i pattern sensibili e tronca a `maxLength`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function maskValue(key: string, value: string, maxLength?: number): string;
|
|
15
|
+
//# sourceMappingURL=mask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/mask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAS7E"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modelli dei report prodotti dai probe della dashboard (`ngrx-entity-crud/devtools`).
|
|
3
|
+
*
|
|
4
|
+
* Sono volutamente indipendenti dai tipi del main entry-point: i probe leggono lo stato
|
|
5
|
+
* per CONVENZIONE (vedi `EntityCrudBaseState` in `src/lib/models.ts`), non per tipo, così
|
|
6
|
+
* il sotto-modulo `devtools` resta autonomo e agnostico rispetto alla persistenza usata.
|
|
7
|
+
*/
|
|
8
|
+
export interface NecStorageEntry {
|
|
9
|
+
key: string;
|
|
10
|
+
/** Byte verso la quota (UTF-16): `(key.length + value.length) * 2`. Metrica primaria. */
|
|
11
|
+
bytesUtf16: number;
|
|
12
|
+
/** Byte della serializzazione UTF-8 (`TextEncoder`/`Blob`). Metrica secondaria. */
|
|
13
|
+
bytesUtf8: number;
|
|
14
|
+
}
|
|
15
|
+
export interface NecStorageReport {
|
|
16
|
+
available: boolean;
|
|
17
|
+
type: 'local' | 'session';
|
|
18
|
+
entries: NecStorageEntry[];
|
|
19
|
+
count: number;
|
|
20
|
+
totalBytesUtf16: number;
|
|
21
|
+
totalBytesUtf8: number;
|
|
22
|
+
}
|
|
23
|
+
/** Stima quota AGGREGATA per-origine (localStorage + IndexedDB + Cache), non scorporabile. */
|
|
24
|
+
export interface NecQuotaEstimate {
|
|
25
|
+
available: boolean;
|
|
26
|
+
usage?: number;
|
|
27
|
+
quota?: number;
|
|
28
|
+
/** Non-standard (solo Chromium): byte per area. Assente su Firefox/Safari. */
|
|
29
|
+
usageDetails?: Record<string, number>;
|
|
30
|
+
}
|
|
31
|
+
export interface NecIdbStoreReport {
|
|
32
|
+
name: string;
|
|
33
|
+
/** Numero record (`objectStore.count()`); `null` se non determinabile. */
|
|
34
|
+
count: number | null;
|
|
35
|
+
}
|
|
36
|
+
export interface NecIdbDbReport {
|
|
37
|
+
name: string;
|
|
38
|
+
version: number | null;
|
|
39
|
+
stores: NecIdbStoreReport[];
|
|
40
|
+
note?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface NecIdbReport {
|
|
43
|
+
available: boolean;
|
|
44
|
+
/** `false` se non è stato possibile elencare i database (es. Firefox senza nomi forniti). */
|
|
45
|
+
enumerable: boolean;
|
|
46
|
+
/** Nome dell'adapter usato: `'native'`, il nome di un `NecIdbAdapter`, o `null`. */
|
|
47
|
+
adapter: string | null;
|
|
48
|
+
databases: NecIdbDbReport[];
|
|
49
|
+
note?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Punto di estensione agnostico: il consumer può fornire un adapter esplicito (via
|
|
53
|
+
* `NEC_IDB_ADAPTER`) per conteggi accurati quando la sua libreria di persistenza nasconde
|
|
54
|
+
* i nomi DB. Quando assente, il probe usa solo le API native.
|
|
55
|
+
*/
|
|
56
|
+
export interface NecIdbAdapter {
|
|
57
|
+
name: string;
|
|
58
|
+
isAvailable(): boolean;
|
|
59
|
+
listDatabases(): Promise<NecIdbDbReport[]>;
|
|
60
|
+
}
|
|
61
|
+
export type NecSliceKind = 'plural' | 'singular' | 'unknown';
|
|
62
|
+
export interface NecStoreSlice {
|
|
63
|
+
key: string;
|
|
64
|
+
kind: NecSliceKind;
|
|
65
|
+
isLoading: boolean;
|
|
66
|
+
isLoaded: boolean;
|
|
67
|
+
error: string | null;
|
|
68
|
+
/** Numero entità (solo slice `plural`). */
|
|
69
|
+
entityCount?: number;
|
|
70
|
+
responsesCount: number;
|
|
71
|
+
}
|
|
72
|
+
export type NecRuntimeStatus = 'loaded' | 'lazy-not-loaded' | 'unknown';
|
|
73
|
+
export interface NecLazyEntry {
|
|
74
|
+
name: string;
|
|
75
|
+
clazz?: string;
|
|
76
|
+
type?: string;
|
|
77
|
+
verdict?: string;
|
|
78
|
+
isLazyCandidate: boolean;
|
|
79
|
+
lazyRoute?: boolean;
|
|
80
|
+
sections: string[];
|
|
81
|
+
usedByShell: boolean;
|
|
82
|
+
runtimeStatus: NecRuntimeStatus;
|
|
83
|
+
}
|
|
84
|
+
export interface NecStoreReport {
|
|
85
|
+
slices: NecStoreSlice[];
|
|
86
|
+
loadingNames: string[];
|
|
87
|
+
errors: string[];
|
|
88
|
+
/** Presente solo se è stato fornito un `lazyReportUrl` e il fetch è riuscito. */
|
|
89
|
+
lazy?: NecLazyEntry[];
|
|
90
|
+
/** Timestamp ISO di generazione del `lazy-report.json` (per segnalare snapshot stantii). */
|
|
91
|
+
lazyReportGeneratedAt?: string;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/models.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,yFAAyF;IACzF,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,8FAA8F;AAC9F,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAMD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,6FAA6F;IAC7F,UAAU,EAAE,OAAO,CAAC;IACpB,oFAAoF;IACpF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,IAAI,OAAO,CAAC;IACvB,aAAa,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC5C;AAMD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,iFAAiF;IACjF,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;IACtB,4FAA4F;IAC5F,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { NecIdbReport, NecQuotaEstimate, NecStorageReport, NecStoreReport } from './models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* `<nec-dashboard>` — dashboard di gestione progetto plug-and-play.
|
|
6
|
+
*
|
|
7
|
+
* Standalone, OnPush, template HTML inline (nessun PrimeNG → importabile ovunque). Tre
|
|
8
|
+
* pannelli: localStorage, IndexedDB (agnostico), store NgRx + sezioni lazy. Per privacy
|
|
9
|
+
* mostra SOLO chiavi/dimensioni/conteggi, mai i valori grezzi. Refresh manuale di default;
|
|
10
|
+
* polling opt-in via `pollingMs`. Pensato per essere usabile anche in produzione.
|
|
11
|
+
*/
|
|
12
|
+
export declare class NecDashboardComponent implements OnInit, OnDestroy {
|
|
13
|
+
private readonly localStorageProbe;
|
|
14
|
+
private readonly indexedDbProbe;
|
|
15
|
+
private readonly storeProbe;
|
|
16
|
+
/** Chiavi di slice da escludere dallo scan dello store. */
|
|
17
|
+
blacklist: string[];
|
|
18
|
+
/** Se valorizzata, considera SOLO queste chiavi di slice (precede la blacklist). */
|
|
19
|
+
whitelist: string[];
|
|
20
|
+
/** URL del report statico (`lazy-report --format=json`); `null`/'' per disattivarlo. */
|
|
21
|
+
lazyReportUrl: string | null;
|
|
22
|
+
/** Nomi DB IndexedDB da ispezionare dove `databases()` non è supportato (es. Firefox). */
|
|
23
|
+
idbDatabaseNames: string[];
|
|
24
|
+
/** Intervallo di auto-refresh in ms; 0 = solo manuale (default). */
|
|
25
|
+
pollingMs: number;
|
|
26
|
+
/** Abilita il reveal opt-in dei valori localStorage (sempre mascherati). Default: false. */
|
|
27
|
+
allowRevealValues: boolean;
|
|
28
|
+
readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
29
|
+
readonly lastUpdated: import("@angular/core").WritableSignal<string>;
|
|
30
|
+
readonly storage: import("@angular/core").WritableSignal<NecStorageReport>;
|
|
31
|
+
readonly quota: import("@angular/core").WritableSignal<NecQuotaEstimate>;
|
|
32
|
+
readonly idb: import("@angular/core").WritableSignal<NecIdbReport>;
|
|
33
|
+
readonly storeReport: import("@angular/core").WritableSignal<NecStoreReport>;
|
|
34
|
+
readonly revealed: import("@angular/core").WritableSignal<Record<string, string>>;
|
|
35
|
+
private timer;
|
|
36
|
+
ngOnInit(): void;
|
|
37
|
+
ngOnDestroy(): void;
|
|
38
|
+
refresh(): Promise<void>;
|
|
39
|
+
/** Reveal opt-in di un valore localStorage, sempre passato per `maskValue` (privacy). */
|
|
40
|
+
reveal(key: string): void;
|
|
41
|
+
isSensitive(key: string): boolean;
|
|
42
|
+
formatBytes(n: number | undefined | null): string;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NecDashboardComponent, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NecDashboardComponent, "nec-dashboard", never, { "blacklist": { "alias": "blacklist"; "required": false; }; "whitelist": { "alias": "whitelist"; "required": false; }; "lazyReportUrl": { "alias": "lazyReportUrl"; "required": false; }; "idbDatabaseNames": { "alias": "idbDatabaseNames"; "required": false; }; "pollingMs": { "alias": "pollingMs"; "required": false; }; "allowRevealValues": { "alias": "allowRevealValues"; "required": false; }; }, {}, never, never, true, never>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=nec-dashboard.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nec-dashboard.component.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/nec-dashboard.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACT,MAAM,EAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;;AAM1F;;;;;;;GAOG;AACH,qBAsRa,qBAAsB,YAAW,MAAM,EAAE,SAAS;IAC7D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuC;IACzE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoC;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgC;IAE3D,2DAA2D;IAClD,SAAS,EAAE,MAAM,EAAE,CAAM;IAClC,oFAAoF;IAC3E,SAAS,EAAE,MAAM,EAAE,CAAM;IAClC,wFAAwF;IAC/E,aAAa,EAAE,MAAM,GAAG,IAAI,CAA6B;IAClE,0FAA0F;IACjF,gBAAgB,EAAE,MAAM,EAAE,CAAM;IACzC,oEAAoE;IAC3D,SAAS,SAAK;IACvB,4FAA4F;IACnF,iBAAiB,UAAS;IAEnC,QAAQ,CAAC,IAAI,kDAAiB;IAC9B,QAAQ,CAAC,WAAW,iDAA+B;IACnD,QAAQ,CAAC,OAAO,2DAAyC;IACzD,QAAQ,CAAC,KAAK,2DAAyC;IACvD,QAAQ,CAAC,GAAG,uDAAqC;IACjD,QAAQ,CAAC,WAAW,yDAAuC;IAC3D,QAAQ,CAAC,QAAQ,iEAAsC;IAEvD,OAAO,CAAC,KAAK,CAA+C;IAE5D,QAAQ,IAAI,IAAI;IAOhB,WAAW,IAAI,IAAI;IAOb,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAuB9B,yFAAyF;IACzF,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKzB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIjC,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM;yCA3EtC,qBAAqB;2CAArB,qBAAqB;CAuFjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngrx-entity-crud-devtools.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/ngrx-entity-crud-devtools.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NecIdbAdapter, NecIdbReport } from '../models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Riepilogo IndexedDB AGNOSTICO rispetto alla libreria di persistenza.
|
|
5
|
+
*
|
|
6
|
+
* Priorità reale: (1) `NEC_IDB_ADAPTER` esplicito, (2) API native
|
|
7
|
+
* (`indexedDB.databases()` + `open()` + `count()`). NESSUN import di librerie di
|
|
8
|
+
* persistenza. Mostra il numero di record per object store; i byte per-store NON sono
|
|
9
|
+
* misurabili e non vengono promessi (solo la quota aggregata, altrove).
|
|
10
|
+
*/
|
|
11
|
+
export declare class NecIndexedDbProbeService {
|
|
12
|
+
private readonly adapter;
|
|
13
|
+
constructor(adapter: NecIdbAdapter | null);
|
|
14
|
+
/**
|
|
15
|
+
* @param fallbackDatabaseNames nomi DB da ispezionare quando `indexedDB.databases()` non
|
|
16
|
+
* è supportato (Firefox / Safari vecchi). Passa qui i nomi noti della tua persistenza.
|
|
17
|
+
* @param openTimeoutMs timeout per ogni `open()` (default 3000ms).
|
|
18
|
+
*/
|
|
19
|
+
read(fallbackDatabaseNames?: string[], openTimeoutMs?: number): Promise<NecIdbReport>;
|
|
20
|
+
private listDatabaseNames;
|
|
21
|
+
private inspectDatabase;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NecIndexedDbProbeService, [{ optional: true; }]>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NecIndexedDbProbeService>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=nec-indexeddb-probe.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nec-indexeddb-probe.service.d.ts","sourceRoot":"","sources":["../../../../libs/ngrx-entity-crud/devtools/probes/nec-indexeddb-probe.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAkB,YAAY,EAAoB,MAAM,WAAW,CAAC;;AAGzF;;;;;;;GAOG;AACH,qBACa,wBAAwB;IACc,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa,GAAG,IAAI;IAE/F;;;;OAIG;IACG,IAAI,CAAC,qBAAqB,GAAE,MAAM,EAAO,EAAE,aAAa,SAAO,GAAG,OAAO,CAAC,YAAY,CAAC;YA2C/E,iBAAiB;IAkB/B,OAAO,CAAC,eAAe;yCArEZ,wBAAwB;6CAAxB,wBAAwB;CA0KpC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NecQuotaEstimate, NecStorageReport } from '../models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Riepilogo di `localStorage` / `sessionStorage`.
|
|
5
|
+
*
|
|
6
|
+
* Sincrono per la lettura delle chiavi. NON espone i valori: solo chiavi e dimensioni
|
|
7
|
+
* (privacy). La metrica primaria verso la quota è UTF-16 `(key.length + value.length) * 2`,
|
|
8
|
+
* perché è ciò che conta verso il limite ~5-10MB; la metrica UTF-8 è secondaria.
|
|
9
|
+
*/
|
|
10
|
+
export declare class NecLocalStorageProbeService {
|
|
11
|
+
read(type?: 'local' | 'session'): NecStorageReport;
|
|
12
|
+
/**
|
|
13
|
+
* Legge ON-DEMAND il valore grezzo di una singola chiave (per il reveal esplicito in UI).
|
|
14
|
+
* Non viene mai incluso nel report: la dashboard lo richiede solo su azione dell'utente e lo
|
|
15
|
+
* maschera tramite `maskValue`.
|
|
16
|
+
*/
|
|
17
|
+
readValue(key: string, type?: 'local' | 'session'): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Stima quota AGGREGATA per-origine (include anche IndexedDB e Cache): NON è scorporabile
|
|
20
|
+
* per area. Può essere assente (Safari/contesto non sicuro) o arrotondata (anti-fingerprint).
|
|
21
|
+
*/
|
|
22
|
+
estimate(): Promise<NecQuotaEstimate>;
|
|
23
|
+
private utf8Bytes;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NecLocalStorageProbeService, never>;
|
|
25
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NecLocalStorageProbeService>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=nec-local-storage-probe.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nec-local-storage-probe.service.d.ts","sourceRoot":"","sources":["../../../../libs/ngrx-entity-crud/devtools/probes/nec-local-storage-probe.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAmB,gBAAgB,EAAC,MAAM,WAAW,CAAC;;AAE9E;;;;;;GAMG;AACH,qBACa,2BAA2B;IACtC,IAAI,CAAC,IAAI,GAAE,OAAO,GAAG,SAAmB,GAAG,gBAAgB;IA0D3D;;;;OAIG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,OAAO,GAAG,SAAmB,GAAG,MAAM,GAAG,IAAI;IAY1E;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAsB3C,OAAO,CAAC,SAAS;yCAtGN,2BAA2B;6CAA3B,2BAA2B;CAuHvC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NecStoreReport } from '../models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
interface ProbeOptions {
|
|
4
|
+
blacklist?: string[];
|
|
5
|
+
whitelist?: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Riepilogo degli store NgRx a runtime.
|
|
9
|
+
*
|
|
10
|
+
* Enumera le slice CRUD montate per CONVENZIONE (`typeof value.isLoading === 'boolean'`,
|
|
11
|
+
* vedi `EntityCrudBaseState`), senza dipendere dai selettori per-dominio. Una slice lazy non
|
|
12
|
+
* ancora caricata semplicemente non ha la chiave nello stato root.
|
|
13
|
+
*/
|
|
14
|
+
export declare class NecStoreProbeService {
|
|
15
|
+
private readonly store;
|
|
16
|
+
/** Lettura sincrona dello stato root (NgRx emette il valore corrente all'iscrizione). */
|
|
17
|
+
read(opts?: ProbeOptions): NecStoreReport;
|
|
18
|
+
/** Come `read()`, ma correla con l'inventario statico di `lazy-report.json` (se raggiungibile). */
|
|
19
|
+
readWithLazyReport(url: string, opts?: ProbeOptions): Promise<NecStoreReport>;
|
|
20
|
+
private fetchLazyReport;
|
|
21
|
+
/**
|
|
22
|
+
* Best-effort: il root state usa `strings.underscore(name)` come chiave di slice, mentre il
|
|
23
|
+
* report usa il nome dasherizzato. (Fase 1: far emettere a `lazy-report` la feature key reale.)
|
|
24
|
+
*/
|
|
25
|
+
private toSliceKey;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NecStoreProbeService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NecStoreProbeService>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=nec-store-probe.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nec-store-probe.service.d.ts","sourceRoot":"","sources":["../../../../libs/ngrx-entity-crud/devtools/probes/nec-store-probe.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAA6B,cAAc,EAAgB,MAAM,WAAW,CAAC;;AAEpF,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,qBACa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IAEvC,yFAAyF;IACzF,IAAI,CAAC,IAAI,GAAE,YAAiB,GAAG,cAAc;IA4D7C,mGAAmG;IAC7F,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;YASzE,eAAe;IA6C7B;;;OAGG;IACH,OAAO,CAAC,UAAU;yCA3HP,oBAAoB;6CAApB,oBAAoB;CA8HhC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secondary entry-point `ngrx-entity-crud/devtools`.
|
|
3
|
+
*
|
|
4
|
+
* Dashboard di gestione progetto: riepiloghi runtime di localStorage, IndexedDB (agnostico)
|
|
5
|
+
* e store NgRx + sezioni promovibili al lazy loading. Tree-shakable: chi non lo importa non
|
|
6
|
+
* lo paga nel bundle. Vedi `ngrx-entity-crud-dashboard-plan.md`.
|
|
7
|
+
*/
|
|
8
|
+
export * from './models';
|
|
9
|
+
export * from './idb-adapter.token';
|
|
10
|
+
export * from './agnostic-selectors';
|
|
11
|
+
export * from './mask';
|
|
12
|
+
export * from './probes/nec-local-storage-probe.service';
|
|
13
|
+
export * from './probes/nec-indexeddb-probe.service';
|
|
14
|
+
export * from './probes/nec-store-probe.service';
|
|
15
|
+
export * from './nec-dashboard.component';
|
|
16
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../../libs/ngrx-entity-crud/devtools/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC"}
|