ngrx-entity-crud 19.2.5 → 19.4.0-beta.10
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 +190 -24
- 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 +113 -0
- package/devtools/models.d.ts.map +1 -0
- package/devtools/nec-dashboard.component.d.ts +103 -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 +35 -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 +48 -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 +1493 -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 +16 -2
- package/schematics/collection.json +9 -4
- package/schematics/dashboard/files/primeng/__clazz@dasherize__/__clazz@dasherize__-main/__clazz@dasherize__-main.component.html +15 -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.d.ts +2 -0
- package/schematics/lazy-report/index.js +288 -0
- package/schematics/lazy-report/index.js.map +1 -0
- package/schematics/lazy-report/index.ts +332 -0
- package/schematics/lazy-report/schema.d.ts +23 -0
- package/schematics/lazy-report/schema.json +33 -0
- package/schematics/my-utility.d.ts +0 -16
- package/schematics/my-utility.js +0 -34
- package/schematics/my-utility.js.map +1 -1
- package/schematics/my-utility.ts +0 -51
- package/schematics/ng-add/files/src/app/app.component.ts +3 -16
- package/schematics/ng-add/files/src/app/app.module.ts +6 -2
- package/schematics/ng-add/files/src/app/core/theme/components/footer.component.ts +1 -0
- package/schematics/ng-add/files/src/app/core/theme/components/header.component.ts +1 -5
- package/schematics/ng-add/files/src/app/core/theme/components/main.component.ts +3 -4
- package/schematics/ng-add/files/src/app/core/theme/components/menu-item.component.ts +3 -5
- package/schematics/ng-add/files/src/app/core/theme/components/progress.component.ts +2 -6
- package/schematics/ng-add/files/src/app/core/theme/components/slide-menu-pro.component.ts +1 -6
- package/schematics/ng-add/files/src/app/core/theme/components/slide-menu.component.ts +1 -7
- package/schematics/ng-add/files/src/app/core/theme/theme-jng.module.ts +22 -18
- package/schematics/ng-add/files/src/app/root-store/selectors.ts +80 -19
- package/schematics/store/index.js +24 -14
- package/schematics/store/index.js.map +1 -1
- package/schematics/store/index.ts +26 -15
- package/schematics/store/schema.d.ts +8 -0
- package/schematics/store/schema.json +16 -0
- package/schematics/auth0/files/store/auth-store/actions.ts +0 -21
- package/schematics/auth0/files/store/auth-store/auth-store.module.ts +0 -32
- package/schematics/auth0/files/store/auth-store/auth.guard.ts +0 -44
- package/schematics/auth0/files/store/auth-store/authentication.service.ts +0 -32
- package/schematics/auth0/files/store/auth-store/conf.ts +0 -2
- package/schematics/auth0/files/store/auth-store/effects.ts +0 -59
- package/schematics/auth0/files/store/auth-store/index.d.ts +0 -13
- package/schematics/auth0/files/store/auth-store/index.ts +0 -13
- package/schematics/auth0/files/store/auth-store/login.component.ts +0 -75
- package/schematics/auth0/files/store/auth-store/names.ts +0 -3
- package/schematics/auth0/files/store/auth-store/profile.ts +0 -12
- package/schematics/auth0/files/store/auth-store/reducer.ts +0 -23
- package/schematics/auth0/files/store/auth-store/selectors.ts +0 -24
- package/schematics/auth0/files/store/auth-store/state.ts +0 -11
- package/schematics/auth0/index.d.ts +0 -2
- package/schematics/auth0/index.js +0 -66
- package/schematics/auth0/index.js.map +0 -1
- package/schematics/auth0/index.ts +0 -76
- package/schematics/auth0/schema.d.ts +0 -21
- package/schematics/auth0/schema.json +0 -21
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Commands for code generation:
|
|
|
4
4
|
- `store`: Generates a feature set containing an `entity`, `actions`, `reducer`, ... file.
|
|
5
5
|
- `section`: Generates a new Angular CRUD page containing an `list`, `detail`, `search`, ... file.
|
|
6
6
|
- `auth`: Generates a boilerplate for authentication implementation containing an `store section` and `components` file.
|
|
7
|
-
- `
|
|
7
|
+
- `lazy-report`: Scans the project and reports which stores are good candidates to become lazy.
|
|
8
8
|
|
|
9
9
|
# How to use it?
|
|
10
10
|
To create your first project, follow this [guide](https://github.com/jucasoft/ngrx-entity-crud-prime-ng-boilerplate).
|
|
@@ -49,8 +49,28 @@ Store type:
|
|
|
49
49
|
- Enum: `"CRUD-PLURAL", "CRUD-SINGULAR", "CRUD+GRAPHQL", "BASE"`
|
|
50
50
|
- Default: `false`
|
|
51
51
|
|
|
52
|
+
Store registration strategy:
|
|
53
|
+
- `eager`: the store is declared in the application `RootStoreModule` (historical behavior); reducers/effects are loaded at startup.
|
|
54
|
+
- `lazy`: the store is **not** registered in the root; the view feature module is responsible for importing `<Clazz>StoreModule`, so reducers/effects are loaded only when the section is opened.
|
|
55
|
+
|
|
56
|
+
- `--registration`
|
|
57
|
+
- Type: `string`
|
|
58
|
+
- Enum: `"eager", "lazy"`
|
|
59
|
+
- Optional. If omitted, the schematic asks interactively. In non-interactive runs (CI/scripts) it falls back to `eager`, so existing pipelines keep working unchanged.
|
|
60
|
+
|
|
61
|
+
> **Lazy mode notes**
|
|
62
|
+
> - With `--registration=lazy` nothing registers the store automatically: you must import `<Clazz>StoreModule` in the feature module generated for the view (e.g. `coin.module.ts`).
|
|
63
|
+
> - The generated slice is declared as **optional** in `root-store/state.ts`, because it does not exist in the runtime state until the section is loaded.
|
|
64
|
+
> - `root-store/selectors.ts` exposes the global loading/error selectors (`selectIsLoading`, `selectError`, `selectLoadingNames`) in a **store-agnostic** way: they scan the root state using the `EntityCrudBaseState` convention (every CRUD slice exposes `isLoading`/`error` at the top level), so lazily-registered stores contribute to the global loading/error state without coupling the root to any specific domain.
|
|
65
|
+
|
|
52
66
|
#### Examples
|
|
53
67
|
|
|
68
|
+
```sh
|
|
69
|
+
ng generate ngrx-entity-crud:store --name=coin --clazz=Coin --type=CRUD-PLURAL --registration=lazy
|
|
70
|
+
```
|
|
71
|
+
With `--registration=lazy` the store is not added to `RootStoreModule`; remember to import `CoinStoreModule` in the view feature module.
|
|
72
|
+
|
|
73
|
+
|
|
54
74
|
```sh
|
|
55
75
|
ng generate ngrx-entity-crud:store --name=coin --clazz=Coin --type=CRUD-PLURAL
|
|
56
76
|
```
|
|
@@ -242,50 +262,196 @@ UPDATE src/app/root-store/__clazz@dasherize__.state.ts (184 bytes)
|
|
|
242
262
|
UPDATE src/app/root-store/root-store.module.ts (1051 bytes)
|
|
243
263
|
```
|
|
244
264
|
|
|
245
|
-
##
|
|
265
|
+
## lazy-report
|
|
246
266
|
|
|
247
267
|
---
|
|
248
268
|
|
|
249
269
|
### Overview
|
|
250
270
|
|
|
251
|
-
|
|
271
|
+
Read-only analysis command. It scans the project and produces a report that maps each store to
|
|
272
|
+
the sections that use it, then suggests which stores are good candidates to be registered as
|
|
273
|
+
**lazy** (see the `--registration` option of the `store` command). Nothing is modified except the
|
|
274
|
+
generated report file: you decide what to convert.
|
|
275
|
+
|
|
276
|
+
How a store is classified:
|
|
277
|
+
- **candidato lazy**: used by exactly one section, and that section is on a lazy route (`loadChildren`).
|
|
278
|
+
- **multi-sezione**: used by more than one section (evaluate a shared lazy module).
|
|
279
|
+
- **tieni eager (usato dalla shell)**: referenced by the app shell (`core/`, `main/components`, `app.component`) — must stay eager.
|
|
280
|
+
- **sezione non lazy-routed**: its only section is loaded eagerly, so going lazy gives little benefit.
|
|
281
|
+
- **infra (eager)**: infrastructure store (e.g. `router-store`), excluded from candidates.
|
|
282
|
+
- **orfano**: not referenced by any section.
|
|
283
|
+
|
|
284
|
+
The scan is static and relies on the naming convention (`XxxStoreActions/Selectors/State/Module`).
|
|
285
|
+
Paths are read from `ngrx-entity-crud.conf.json` when present, otherwise defaults are used
|
|
286
|
+
(`src/app/root-store`, `src/app/main/views`, `src/app`).
|
|
252
287
|
|
|
253
288
|
### Command
|
|
254
289
|
|
|
255
290
|
```sh
|
|
256
|
-
ng generate ngrx-entity-crud:
|
|
291
|
+
ng generate ngrx-entity-crud:lazy-report [options]
|
|
257
292
|
```
|
|
258
293
|
|
|
294
|
+
### Options
|
|
295
|
+
|
|
296
|
+
Report file to write (relative to the workspace root); empty string = console only.
|
|
297
|
+
- `--output`
|
|
298
|
+
- Type: `string`
|
|
299
|
+
- Default: `lazy-report.md`
|
|
300
|
+
|
|
301
|
+
Format of the written report.
|
|
302
|
+
- `--format`
|
|
303
|
+
- Type: `string`
|
|
304
|
+
- Enum: `"md", "json"`
|
|
305
|
+
- Default: `md`
|
|
306
|
+
|
|
307
|
+
Infrastructure stores excluded from lazy candidates (folder names).
|
|
308
|
+
- `--infra-stores`
|
|
309
|
+
- Type: `string[]`
|
|
310
|
+
- Default: `["router-store"]`
|
|
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
|
+
|
|
259
323
|
#### Examples
|
|
260
324
|
|
|
261
325
|
```sh
|
|
262
|
-
ng generate ngrx-entity-crud:
|
|
326
|
+
ng generate ngrx-entity-crud:lazy-report
|
|
327
|
+
ng generate ngrx-entity-crud:lazy-report --format=json --output=lazy-report.json
|
|
328
|
+
ng generate ngrx-entity-crud:lazy-report --output= # solo console
|
|
263
329
|
```
|
|
264
330
|
|
|
265
|
-
|
|
331
|
+
Example output (excerpt):
|
|
332
|
+
|
|
333
|
+
```md
|
|
334
|
+
| store | clazz | type | sezioni | n | lazy route | shell | verdetto |
|
|
335
|
+
|---|---|---|---|---|---|---|---|
|
|
336
|
+
| coin-store | Coin | CRUD-PLURAL | coin | 1 | si | no | candidato lazy |
|
|
337
|
+
| currency-store | Currency | CRUD-PLURAL | coin, invoice | 2 | si | no | multi-sezione (2) -> valuta modulo condiviso |
|
|
338
|
+
| menu-store | Menu | CRUD-PLURAL | - | 0 | - | si | tieni eager (usato dalla shell) |
|
|
339
|
+
```
|
|
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 hosts `<nec-dashboard>`, the standalone component exported by the
|
|
350
|
+
secondary entry-point `ngrx-entity-crud/devtools`; all the diagnostic logic lives in the library
|
|
351
|
+
(versioned and tested), not in generated code.
|
|
352
|
+
|
|
353
|
+
`<nec-dashboard>` is built on **PrimeNG** components (`p-card`, `p-table`, `p-tag`, `p-tree`, the
|
|
354
|
+
`pButton` directive), so the `ngrx-entity-crud/devtools` entry-point requires `primeng` and
|
|
355
|
+
`primeicons` in your app (declared as **optional** peerDependencies — the core entry-point does
|
|
356
|
+
not need them). The component uses the `pButton` severity *classes* and the `success`/`info`/
|
|
357
|
+
`danger` tag severities, an idiom compatible with PrimeNG 16 (the consumer baseline) through the
|
|
358
|
+
later majors.
|
|
359
|
+
|
|
360
|
+
By default it also generates `src/assets/lazy-report.json` (reusing `lazy-report --format=json`),
|
|
361
|
+
which the dashboard reads at runtime to correlate the loaded/lazy state of each store.
|
|
362
|
+
|
|
363
|
+
The dashboard can run in **production**: by default it shows only keys, sizes and counts — never
|
|
364
|
+
raw values. Value reveal is opt-in (`[allowRevealValues]="true"`) and always masks sensitive
|
|
365
|
+
patterns (token/JWT/email/secret); keys that look sensitive are flagged.
|
|
366
|
+
|
|
367
|
+
### Command
|
|
266
368
|
|
|
267
369
|
```sh
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
CREATE src/app/root-store/auth-store/auth.guard.ts (1359 bytes)
|
|
271
|
-
CREATE src/app/root-store/auth-store/authentication.service.ts (675 bytes)
|
|
272
|
-
CREATE src/app/root-store/auth-store/conf.ts (75 bytes)
|
|
273
|
-
CREATE src/app/root-store/auth-store/__clazz@dasherize__.effects.ts (1754 bytes)
|
|
274
|
-
CREATE src/app/root-store/auth-store/index.d.ts (271 bytes)
|
|
275
|
-
CREATE src/app/root-store/auth-store/index.ts (271 bytes)
|
|
276
|
-
CREATE src/app/root-store/auth-store/login.component.ts (2117 bytes)
|
|
277
|
-
CREATE src/app/root-store/auth-store/__clazz@dasherize__.names.ts (47 bytes)
|
|
278
|
-
CREATE src/app/root-store/auth-store/profile.ts (224 bytes)
|
|
279
|
-
CREATE src/app/root-store/auth-store/__clazz@dasherize__.reducer.ts (475 bytes)
|
|
280
|
-
CREATE src/app/root-store/auth-store/__clazz@dasherize__.selectors.ts (699 bytes)
|
|
281
|
-
CREATE src/app/root-store/auth-store/__clazz@dasherize__.state.ts (192 bytes)
|
|
370
|
+
ng generate ngrx-entity-crud:dashboard [options]
|
|
371
|
+
```
|
|
282
372
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
373
|
+
### Options
|
|
374
|
+
|
|
375
|
+
Feature name (drives the lazy route and the generated file names).
|
|
376
|
+
- `--clazz`
|
|
377
|
+
- Type: `string`
|
|
378
|
+
- Default: `Dashboard`
|
|
379
|
+
|
|
380
|
+
Generate the lazy-report JSON read by the dashboard.
|
|
381
|
+
- `--include-lazy-report`
|
|
382
|
+
- Type: `boolean`
|
|
383
|
+
- Default: `true`
|
|
384
|
+
|
|
385
|
+
Path of the generated lazy-report JSON.
|
|
386
|
+
- `--lazy-report-output`
|
|
387
|
+
- Type: `string`
|
|
388
|
+
- Default: `src/assets/lazy-report.json`
|
|
389
|
+
|
|
390
|
+
The name of the project.
|
|
391
|
+
- `--project`
|
|
392
|
+
- Type: `string`
|
|
393
|
+
|
|
394
|
+
#### Using the standalone component directly
|
|
395
|
+
|
|
396
|
+
If you prefer not to scaffold, import the component from the secondary entry-point and mount it
|
|
397
|
+
anywhere (e.g. behind a dev-only route):
|
|
398
|
+
|
|
399
|
+
```ts
|
|
400
|
+
import { NecDashboardComponent } from 'ngrx-entity-crud/devtools';
|
|
401
|
+
|
|
402
|
+
@Component({
|
|
403
|
+
standalone: true,
|
|
404
|
+
imports: [NecDashboardComponent],
|
|
405
|
+
template: `<nec-dashboard
|
|
406
|
+
lazyReportUrl="assets/lazy-report.json"
|
|
407
|
+
[idbDatabaseNames]="['NgRxStateStore']"
|
|
408
|
+
[allowRevealValues]="false"
|
|
409
|
+
[pollingMs]="0"
|
|
410
|
+
(sliceReset)="onSliceReset($event)"></nec-dashboard>`,
|
|
411
|
+
})
|
|
412
|
+
export class DevPanelComponent {
|
|
413
|
+
onSliceReset(sliceKey: string): void {
|
|
414
|
+
// reactivity hook: a CRUD slice has just been reset to its initial state
|
|
415
|
+
}
|
|
416
|
+
}
|
|
287
417
|
```
|
|
288
418
|
|
|
419
|
+
Inputs: `blacklist` / `whitelist` (`string[]`, filter store slices), `lazyReportUrl`
|
|
420
|
+
(default `assets/lazy-report.json`; empty string disables the static correlation),
|
|
421
|
+
`idbDatabaseNames` (`string[]`, DB names to inspect where `indexedDB.databases()` is unsupported —
|
|
422
|
+
Firefox / older Safari), `pollingMs` (`number`, auto-refresh; `0` = manual), `allowRevealValues`
|
|
423
|
+
(`boolean`, opt-in masked value reveal — gates both localStorage values and IndexedDB record
|
|
424
|
+
values), `idbEntryLimit` (`number`, default `50`, max records read per object store in the
|
|
425
|
+
IndexedDB tree).
|
|
426
|
+
|
|
427
|
+
Outputs: `sliceReset` (`EventEmitter<string>`) emits the slice key whenever a full `Reset` is
|
|
428
|
+
dispatched (including via the global **Azzera tutte** button).
|
|
429
|
+
|
|
430
|
+
Notes:
|
|
431
|
+
- The **Store NgRx** panel exposes per-row actions: **reset** dispatches the library's `Reset`
|
|
432
|
+
action (`[key] Reset`), restoring the slice to its `initialState` (empty entities, selection,
|
|
433
|
+
criteria and responses); **reset responses** dispatches the lighter `ResetResponses`
|
|
434
|
+
(`[key] Reset Response`). A toolbar **Azzera tutte** button resets every listed slice at once.
|
|
435
|
+
All three are destructive and require an inline two-step confirmation before dispatching.
|
|
436
|
+
Because the slice key in the root state matches the action name by convention (the `store`
|
|
437
|
+
schematic feeds the same `Names.NAME` to both `StoreModule.forFeature` and `createCrudActions`),
|
|
438
|
+
the dashboard can target the right action from the slice key alone — no per-domain wiring needed.
|
|
439
|
+
After a reset the dashboard refreshes its counts; if you persist the NgRx state (e.g. to
|
|
440
|
+
IndexedDB), your persistence layer will write back the emptied state, clearing the local data.
|
|
441
|
+
- The **Store NgRx** panel has a toggle button: by default it lists every mounted slice, but
|
|
442
|
+
**Mostra solo le slice con dati** filters down to slices that actually hold data (entities for
|
|
443
|
+
`plural`, an `item` for `singular`, or cached responses).
|
|
444
|
+
- IndexedDB is introspected **agnostically** via native APIs (`indexedDB.databases()` + `count()`),
|
|
445
|
+
with an optional `NEC_IDB_ADAPTER` injection token for custom providers. Byte sizes per
|
|
446
|
+
record/store are not measurable; only record counts and the aggregate origin quota
|
|
447
|
+
(`navigator.storage.estimate()`) are shown. The panel renders a PrimeNG `p-tree` (database →
|
|
448
|
+
object store → record): expanding an object store **lazily** reads up to `idbEntryLimit` records
|
|
449
|
+
and lists their keys; with `[allowRevealValues]="true"` each record can be expanded further to
|
|
450
|
+
show its value (serialized to JSON and masked for sensitive patterns).
|
|
451
|
+
- `<nec-dashboard>` is a standalone component that imports PrimeNG modules and uses the classic
|
|
452
|
+
structural directives (`*ngIf`/`*ngFor`), so it stays compatible with Angular 16+ consumers; the
|
|
453
|
+
core entry-point keeps the wider peer range and has no PrimeNG dependency.
|
|
454
|
+
|
|
289
455
|
## Running unit tests
|
|
290
456
|
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
291
457
|
|
|
@@ -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,113 @@
|
|
|
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
|
+
/** Un record di un object store IndexedDB, letto ON-DEMAND per la vista ad albero. */
|
|
52
|
+
export interface NecIdbEntry {
|
|
53
|
+
/** Chiave primaria del record, serializzata a stringa. */
|
|
54
|
+
key: string;
|
|
55
|
+
/** Valore grezzo del record; la dashboard lo serializza/maschera prima di mostrarlo. */
|
|
56
|
+
value: unknown;
|
|
57
|
+
}
|
|
58
|
+
/** Risultato della lettura on-demand dei record di un object store (vista ad albero). */
|
|
59
|
+
export interface NecIdbStoreEntries {
|
|
60
|
+
db: string;
|
|
61
|
+
store: string;
|
|
62
|
+
entries: NecIdbEntry[];
|
|
63
|
+
/** Conteggio totale dei record (`count()`); `null` se non determinabile. */
|
|
64
|
+
total: number | null;
|
|
65
|
+
/** `true` se `entries` è troncato rispetto a `total` (raggiunto il `limit`). */
|
|
66
|
+
truncated: boolean;
|
|
67
|
+
note?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Punto di estensione agnostico: il consumer può fornire un adapter esplicito (via
|
|
71
|
+
* `NEC_IDB_ADAPTER`) per conteggi accurati quando la sua libreria di persistenza nasconde
|
|
72
|
+
* i nomi DB. Quando assente, il probe usa solo le API native.
|
|
73
|
+
*/
|
|
74
|
+
export interface NecIdbAdapter {
|
|
75
|
+
name: string;
|
|
76
|
+
isAvailable(): boolean;
|
|
77
|
+
listDatabases(): Promise<NecIdbDbReport[]>;
|
|
78
|
+
}
|
|
79
|
+
export type NecSliceKind = 'plural' | 'singular' | 'unknown';
|
|
80
|
+
export interface NecStoreSlice {
|
|
81
|
+
key: string;
|
|
82
|
+
kind: NecSliceKind;
|
|
83
|
+
isLoading: boolean;
|
|
84
|
+
isLoaded: boolean;
|
|
85
|
+
error: string | null;
|
|
86
|
+
/** Numero entità (solo slice `plural`). */
|
|
87
|
+
entityCount?: number;
|
|
88
|
+
responsesCount: number;
|
|
89
|
+
/** `true` se la slice contiene dati: entità (`plural`), item (`singular`) o response. */
|
|
90
|
+
hasData: boolean;
|
|
91
|
+
}
|
|
92
|
+
export type NecRuntimeStatus = 'loaded' | 'lazy-not-loaded' | 'unknown';
|
|
93
|
+
export interface NecLazyEntry {
|
|
94
|
+
name: string;
|
|
95
|
+
clazz?: string;
|
|
96
|
+
type?: string;
|
|
97
|
+
verdict?: string;
|
|
98
|
+
isLazyCandidate: boolean;
|
|
99
|
+
lazyRoute?: boolean;
|
|
100
|
+
sections: string[];
|
|
101
|
+
usedByShell: boolean;
|
|
102
|
+
runtimeStatus: NecRuntimeStatus;
|
|
103
|
+
}
|
|
104
|
+
export interface NecStoreReport {
|
|
105
|
+
slices: NecStoreSlice[];
|
|
106
|
+
loadingNames: string[];
|
|
107
|
+
errors: string[];
|
|
108
|
+
/** Presente solo se è stato fornito un `lazyReportUrl` e il fetch è riuscito. */
|
|
109
|
+
lazy?: NecLazyEntry[];
|
|
110
|
+
/** Timestamp ISO di generazione del `lazy-report.json` (per segnalare snapshot stantii). */
|
|
111
|
+
lazyReportGeneratedAt?: string;
|
|
112
|
+
}
|
|
113
|
+
//# 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,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AAC,EAAE,YAAY,EAAE,CAAC;IACtB,4FAA4F;IAC5F,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { TreeNode } from 'primeng/api';
|
|
3
|
+
import { NecIdbReport, NecQuotaEstimate, NecStorageReport, NecStoreReport } from './models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* `<nec-dashboard>` — dashboard di gestione progetto plug-and-play.
|
|
7
|
+
*
|
|
8
|
+
* Standalone, OnPush, costruita sui componenti **PrimeNG** (`p-card`, `p-table`, `p-tag`,
|
|
9
|
+
* `p-tree`, direttiva `pButton`): richiede quindi `primeng` + `primeicons` nell'app consumer
|
|
10
|
+
* (peerDependencies opzionali del solo entry-point `devtools`). Quattro pannelli: quota
|
|
11
|
+
* origine, localStorage, IndexedDB (agnostico, con `p-tree` espandibile e lazy-load dei
|
|
12
|
+
* record), store NgRx + sezioni lazy. Per privacy mostra di default SOLO chiavi/dimensioni/
|
|
13
|
+
* conteggi; i valori (localStorage e record IndexedDB) sono rivelabili solo con
|
|
14
|
+
* `allowRevealValues` e comunque mascherati. Refresh manuale di default; polling opt-in via
|
|
15
|
+
* `pollingMs`. Usabile anche in produzione.
|
|
16
|
+
*
|
|
17
|
+
* I pulsanti usano la direttiva `pButton` con le **classi** severity (`p-button-danger`,
|
|
18
|
+
* `-text`, `-sm`) e i tag solo le severity `success`/`info`/`danger`: questo idioma è
|
|
19
|
+
* compatibile sia con PrimeNG 16 (target dell'app consumer) sia con le major successive.
|
|
20
|
+
* Il template usa le direttive strutturali classiche (`*ngIf`/`*ngFor`) anziché il
|
|
21
|
+
* control-flow `@if`/`@for`, per restare compatibile con Angular 16+.
|
|
22
|
+
*/
|
|
23
|
+
export declare class NecDashboardComponent implements OnInit, OnDestroy {
|
|
24
|
+
private readonly localStorageProbe;
|
|
25
|
+
private readonly indexedDbProbe;
|
|
26
|
+
private readonly storeProbe;
|
|
27
|
+
/** Chiavi di slice da escludere dallo scan dello store. */
|
|
28
|
+
blacklist: string[];
|
|
29
|
+
/** Se valorizzata, considera SOLO queste chiavi di slice (precede la blacklist). */
|
|
30
|
+
whitelist: string[];
|
|
31
|
+
/** URL del report statico (`lazy-report --format=json`); `null`/'' per disattivarlo. */
|
|
32
|
+
lazyReportUrl: string | null;
|
|
33
|
+
/** Nomi DB IndexedDB da ispezionare dove `databases()` non è supportato (es. Firefox). */
|
|
34
|
+
idbDatabaseNames: string[];
|
|
35
|
+
/** Intervallo di auto-refresh in ms; 0 = solo manuale (default). */
|
|
36
|
+
pollingMs: number;
|
|
37
|
+
/** Abilita il reveal opt-in dei valori localStorage e dei record IndexedDB (sempre mascherati). Default: false. */
|
|
38
|
+
allowRevealValues: boolean;
|
|
39
|
+
/** Numero massimo di record letti per object store nella vista ad albero IndexedDB. Default: 50. */
|
|
40
|
+
idbEntryLimit: number;
|
|
41
|
+
/** Emesso (con la slice key) a ogni `Reset` completo dispacciato, incluso l'azzera-tutte. */
|
|
42
|
+
sliceReset: EventEmitter<string>;
|
|
43
|
+
readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
44
|
+
readonly lastUpdated: import("@angular/core").WritableSignal<string>;
|
|
45
|
+
readonly storage: import("@angular/core").WritableSignal<NecStorageReport>;
|
|
46
|
+
readonly quota: import("@angular/core").WritableSignal<NecQuotaEstimate>;
|
|
47
|
+
readonly idb: import("@angular/core").WritableSignal<NecIdbReport>;
|
|
48
|
+
readonly storeReport: import("@angular/core").WritableSignal<NecStoreReport>;
|
|
49
|
+
readonly revealed: import("@angular/core").WritableSignal<Record<string, string>>;
|
|
50
|
+
/** Slice in attesa di conferma per il `Reset` completo (conferma a due step). */
|
|
51
|
+
readonly pendingResetKey: import("@angular/core").WritableSignal<string>;
|
|
52
|
+
/** Slice in attesa di conferma per il `ResetResponses`. */
|
|
53
|
+
readonly pendingResponsesKey: import("@angular/core").WritableSignal<string>;
|
|
54
|
+
/** `true` quando è in attesa di conferma l'azzeramento globale di tutte le slice. */
|
|
55
|
+
readonly pendingResetAll: import("@angular/core").WritableSignal<boolean>;
|
|
56
|
+
/** `true` per mostrare solo le slice che contengono dati (filtro del pannello Store NgRx). */
|
|
57
|
+
readonly onlyWithData: import("@angular/core").WritableSignal<boolean>;
|
|
58
|
+
/** Slice visibili in base al filtro `onlyWithData`. */
|
|
59
|
+
readonly visibleSlices: import("@angular/core").Signal<import("./models").NecStoreSlice[]>;
|
|
60
|
+
/** Nodi `p-tree` della vista IndexedDB (DB → object store; i record sono lazy-load). */
|
|
61
|
+
readonly idbTreeNodes: import("@angular/core").WritableSignal<TreeNode<any>[]>;
|
|
62
|
+
/** `true` mentre `p-tree` sta caricando i record di un object store espanso. */
|
|
63
|
+
readonly idbLoading: import("@angular/core").WritableSignal<boolean>;
|
|
64
|
+
private timer;
|
|
65
|
+
/** Un refresh richiesto mentre un altro è già in corso: viene ri-eseguito al termine. */
|
|
66
|
+
private pendingRefresh;
|
|
67
|
+
ngOnInit(): void;
|
|
68
|
+
ngOnDestroy(): void;
|
|
69
|
+
refresh(): Promise<void>;
|
|
70
|
+
/** Reveal opt-in di un valore localStorage, sempre passato per `maskValue` (privacy). */
|
|
71
|
+
reveal(key: string): void;
|
|
72
|
+
/** Alterna fra "tutte le slice" e "solo le slice con dati". */
|
|
73
|
+
toggleOnlyWithData(): void;
|
|
74
|
+
/** Costruisce i nodi DB → object store dal report; i record restano vuoti (lazy-load). */
|
|
75
|
+
private buildIdbTree;
|
|
76
|
+
/** Lazy-load: alla prima espansione di un object store ne legge i record e ne crea i nodi. */
|
|
77
|
+
onNodeExpand(event: {
|
|
78
|
+
node: TreeNode;
|
|
79
|
+
}): Promise<void>;
|
|
80
|
+
/** Trasforma i record letti in nodi `record` (più nodi `note` per store vuoto/troncato). */
|
|
81
|
+
private buildRecordNodes;
|
|
82
|
+
/** Serializza e maschera (privacy) il valore grezzo di un record IndexedDB per la UI. */
|
|
83
|
+
formatIdbValue(value: unknown): string;
|
|
84
|
+
/** Step 1: chiede conferma per il `Reset` completo della slice. */
|
|
85
|
+
requestReset(key: string): void;
|
|
86
|
+
/** Step 1: chiede conferma per il `ResetResponses` della slice. */
|
|
87
|
+
requestResetResponses(key: string): void;
|
|
88
|
+
/** Step 1: chiede conferma per l'azzeramento globale di tutte le slice. */
|
|
89
|
+
requestResetAll(): void;
|
|
90
|
+
/** Annulla qualsiasi conferma pendente (reset/responses/azzera-tutte). */
|
|
91
|
+
cancelPending(): void;
|
|
92
|
+
/** Step 2: dispaccia il `Reset` della slice, emette `sliceReset` e ricarica i conteggi. */
|
|
93
|
+
confirmReset(key: string): void;
|
|
94
|
+
/** Step 2: dispaccia il `ResetResponses` della slice e ricarica i conteggi. */
|
|
95
|
+
confirmResetResponses(key: string): void;
|
|
96
|
+
/** Step 2: dispaccia il `Reset` su tutte le slice elencate, emettendo `sliceReset` per ciascuna. */
|
|
97
|
+
confirmResetAll(): void;
|
|
98
|
+
isSensitive(key: string): boolean;
|
|
99
|
+
formatBytes(n: number | undefined | null): string;
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NecDashboardComponent, never>;
|
|
101
|
+
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; }; "idbEntryLimit": { "alias": "idbEntryLimit"; "required": false; }; }, { "sliceReset": "sliceReset"; }, never, never, true, never>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=nec-dashboard.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nec-dashboard.component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GAAG,SAAS,GAAG,IAAI,GAAG,MAAM;yCAhQtC,qBAAqB;2CAArB,qBAAqB;CA4QjC"}
|
|
@@ -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,35 @@
|
|
|
1
|
+
import { NecIdbAdapter, NecIdbReport, NecIdbStoreEntries } 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
|
+
/**
|
|
23
|
+
* Legge ON-DEMAND i record di un object store, per la vista ad albero della dashboard.
|
|
24
|
+
*
|
|
25
|
+
* Usa un cursore e si ferma a `limit` record (default 50) per non caricare in memoria interi
|
|
26
|
+
* store enormi; `truncated` segnala se ci sono altri record oltre il limite. Restituisce i
|
|
27
|
+
* valori GREZZI: la serializzazione/mascheratura per la privacy spetta alla dashboard.
|
|
28
|
+
*/
|
|
29
|
+
readStoreEntries(dbName: string, storeName: string, limit?: number, openTimeoutMs?: number): Promise<NecIdbStoreEntries>;
|
|
30
|
+
/** Serializza una `IDBValidKey` (stringa/numero/Date/array) in stringa per la UI. */
|
|
31
|
+
private stringifyKey;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NecIndexedDbProbeService, [{ optional: true; }]>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NecIndexedDbProbeService>;
|
|
34
|
+
}
|
|
35
|
+
//# 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,EACL,aAAa,EAGb,YAAY,EACZ,kBAAkB,EAEnB,MAAM,WAAW,CAAC;;AAGnB;;;;;;;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;IAsGvB;;;;;;OAMG;IACG,gBAAgB,CACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,SAAK,EACV,aAAa,SAAO,GACnB,OAAO,CAAC,kBAAkB,CAAC;IAqH9B,qFAAqF;IACrF,OAAO,CAAC,YAAY;yCA7ST,wBAAwB;6CAAxB,wBAAwB;CAuTpC"}
|
|
@@ -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
|