@dudousxd/nestjs-catalog-dashboard 0.3.1 → 0.3.2

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -0
  3. package/package.json +8 -8
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Davide Carvalho
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @dudousxd/nestjs-catalog-dashboard
2
+
3
+ The console for [`@dudousxd/nestjs-catalog`](https://www.npmjs.com/package/@dudousxd/nestjs-catalog):
4
+ Model, Objects, Query, Dashboards, Connectors, Workflows, Lineage, Activity, Access.
5
+
6
+ The screens come from [`@dudousxd/nestjs-catalog-react`](https://www.npmjs.com/package/@dudousxd/nestjs-catalog-react).
7
+ This package is the part a component library cannot do for itself: mounting them, serving their
8
+ assets, and guarding the way in.
9
+
10
+ ```bash
11
+ pnpm add @dudousxd/nestjs-catalog-dashboard
12
+ ```
13
+
14
+ ## Mount it
15
+
16
+ ```ts
17
+ import { CatalogDashboardModule } from '@dudousxd/nestjs-catalog-dashboard';
18
+
19
+ CatalogDashboardModule.forRoot({
20
+ path: '/catalog', // where the console is served
21
+ apiPath: '/api/catalog-service', // where its API already lives
22
+ auth: { secret, session, revalidate },
23
+ });
24
+ ```
25
+
26
+ `forRootAsync` is the same mount with the auth built from DI, for when validating a session means
27
+ asking a user store or a session service.
28
+
29
+ **It does not proxy the API.** `apiPath` only tells the SPA where to call — the catalog's HTTP
30
+ surface is mounted by `CatalogModule` and `CatalogPipelineModule`, and a second copy behind this
31
+ console would be a second set of routes to keep authorised.
32
+
33
+ ## Two things a host must get right
34
+
35
+ **Exclude the console from a global API prefix.** A host calling `setGlobalPrefix('api')` otherwise
36
+ moves it to `/api/catalog` while the SPA still asks for `/catalog/assets/…`, and it loads as a blank
37
+ page with 404s — which reads as a broken build rather than a routing mistake.
38
+
39
+ ```ts
40
+ setGlobalPrefix('api', {
41
+ exclude: [...catalogDashboardMountPaths({ path: '/catalog' })],
42
+ });
43
+ ```
44
+
45
+ The helper derives its paths from the same defaulting `forRoot` mounts with, so the two cannot drift.
46
+
47
+ **Decide whether it is open.** Omit `auth` and the console is open — and it can rewrite a catalog's
48
+ model and run its connectors. A host that would rather be shut than open passes a denying `guards`
49
+ entry, which needs no secret, no DI and no session:
50
+
51
+ ```ts
52
+ guards: process.env.CONSOLE_SECRET ? [] : [DenyEverythingGuard],
53
+ ```
54
+
55
+ `auth` and `guards` are separate for exactly this: `auth` describes how a session is *validated*, so
56
+ a host that has not configured it yet has an open console. `guards` is what makes "unconfigured" mean
57
+ shut.
58
+
59
+ ## Opening it from your own UI
60
+
61
+ Minting the session is this library's business, so it ships the call rather than documenting an
62
+ endpoint. Three levels:
63
+
64
+ ```ts
65
+ import { openCatalogConsole } from '@dudousxd/nestjs-catalog-dashboard/client';
66
+ import {
67
+ useOpenCatalogConsole,
68
+ OpenCatalogConsoleButton,
69
+ } from '@dudousxd/nestjs-catalog-dashboard/react';
70
+ ```
71
+
72
+ - `openCatalogConsole(...)` — no React, you own everything
73
+ - `useOpenCatalogConsole(...)` — state for a launcher, you own the markup
74
+ - `<OpenCatalogConsoleButton />` — drop-in, unstyled
75
+
76
+ `openCatalogConsoleMutationOptions` wires the same call into TanStack Query without this package
77
+ depending on TanStack. React is an optional peer: a host that only mounts the NestJS module never
78
+ pulls it in.
79
+
80
+ When the host authenticates, the SPA skips its own sign-in entirely — a console embedded in an
81
+ application that already knows who you are has no business asking again.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-catalog-dashboard",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "The catalog console for @dudousxd/nestjs-catalog: model, objects, query, dashboards, connectors, workflows, lineage, activity and access, served as a mountable NestJS module.",
5
5
  "license": "MIT",
6
6
  "author": "Davide Carvalho",
@@ -44,10 +44,6 @@
44
44
  "files": [
45
45
  "dist"
46
46
  ],
47
- "scripts": {
48
- "build": "vite build && tsup && tsc -p tsconfig.react.json",
49
- "typecheck": "tsc -p tsconfig.server.json --noEmit"
50
- },
51
47
  "peerDependencies": {
52
48
  "@nestjs/common": ">=10",
53
49
  "@nestjs/core": ">=10",
@@ -59,7 +55,6 @@
59
55
  "@types/node": "25.6.0",
60
56
  "typescript": "5.9.3",
61
57
  "tsup": "8.3.5",
62
- "@dudousxd/nestjs-catalog-react": "workspace:*",
63
58
  "@tanstack/react-query": "5.62.7",
64
59
  "@vitejs/plugin-react": "4.3.4",
65
60
  "lucide-react": "0.468.0",
@@ -70,11 +65,16 @@
70
65
  "vite": "6.0.3",
71
66
  "tailwindcss": "4.2.4",
72
67
  "@tailwindcss/vite": "4.2.4",
73
- "tailwindcss-animate": "1.0.7"
68
+ "tailwindcss-animate": "1.0.7",
69
+ "@dudousxd/nestjs-catalog-react": "0.1.0"
74
70
  },
75
71
  "peerDependenciesMeta": {
76
72
  "react": {
77
73
  "optional": true
78
74
  }
75
+ },
76
+ "scripts": {
77
+ "build": "vite build && tsup && tsc -p tsconfig.react.json",
78
+ "typecheck": "tsc -p tsconfig.server.json --noEmit"
79
79
  }
80
- }
80
+ }