@newhomestar/sdk 0.8.6 → 0.8.8

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/dist/index.js CHANGED
@@ -682,8 +682,10 @@ export function runHttpServer(def, opts = {}) {
682
682
  tokenSigningAlg: 'RS256',
683
683
  });
684
684
  // Apply JWKS middleware to all routes EXCEPT public paths
685
+ // Exact match OR prefix match (paths ending with '/' act as prefix matchers)
685
686
  app.use((req, res, next) => {
686
- if (publicPaths.has(req.path)) {
687
+ if (publicPaths.has(req.path) ||
688
+ [...publicPaths].some(p => p.endsWith('/') && req.path.startsWith(p))) {
687
689
  return next();
688
690
  }
689
691
  return jwtCheck(req, res, next);
@@ -936,7 +938,7 @@ export function runHttpServer(def, opts = {}) {
936
938
  Object.entries(def.actions).forEach(([actionName, actionDef]) => {
937
939
  const method = (actionDef.method || 'POST').toUpperCase();
938
940
  const path = actionDef.path || `/${def.name}/${actionName}`;
939
- const isPublic = publicPaths.has(path) ? ' 🔓' : ' 🔐';
941
+ const isPublic = (publicPaths.has(path) || [...publicPaths].some(p => p.endsWith('/') && path.startsWith(p))) ? ' 🔓' : ' 🔐';
940
942
  console.log(`[nova] ${method} ${path} -> ${actionName}${isPublic}`);
941
943
  });
942
944
  });
package/dist/next.d.ts CHANGED
@@ -68,6 +68,23 @@ export interface NovaFgaRelationDef {
68
68
  implies?: string[];
69
69
  /** Priority for ordering (default: 0). Higher = evaluated first. */
70
70
  priority?: number;
71
+ /**
72
+ * Human-readable display name shown in UI dropdowns and permission selectors.
73
+ * Falls back to the raw `relation` string if not provided.
74
+ * e.g. 'Administrator', 'Editor', 'Viewer'
75
+ */
76
+ display_name?: string;
77
+ /**
78
+ * Description of what this relation grants, shown as helper text in the UI.
79
+ * e.g. 'Full management access including settings and user management'
80
+ */
81
+ description?: string;
82
+ /**
83
+ * Subject types allowed to hold this relation (e.g. ['user', 'group', 'division']).
84
+ * Acts like OpenFGA type restrictions — the IAM service rejects grants where the
85
+ * subject_type is not in this list. Empty array or omitted = any subject type allowed.
86
+ */
87
+ subject_types?: string[];
71
88
  }
72
89
  /**
73
90
  * IAM resource declaration for `defineService().iam.resources[]`.
package/package.json CHANGED
@@ -1,58 +1,58 @@
1
- {
2
- "name": "@newhomestar/sdk",
3
- "version": "0.8.6",
4
- "description": "Type-safe SDK for building Nova pipelines (workers & functions)",
5
- "homepage": "https://github.com/newhomestar/nova-node-sdk#readme",
6
- "bugs": {
7
- "url": "https://github.com/newhomestar/nova-node-sdk/issues"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/newhomestar/nova-node-sdk.git"
12
- },
13
- "license": "ISC",
14
- "author": "Christian Gomez",
15
- "type": "module",
16
- "main": "dist/index.js",
17
- "types": "dist/index.d.ts",
18
- "exports": {
19
- ".": {
20
- "import": "./dist/index.js",
21
- "types": "./dist/index.d.ts"
22
- },
23
- "./next": {
24
- "import": "./dist/next.js",
25
- "types": "./dist/next.d.ts"
26
- },
27
- "./events": {
28
- "import": "./dist/events.js",
29
- "types": "./dist/events.d.ts"
30
- }
31
- },
32
- "files": [
33
- "dist"
34
- ],
35
- "scripts": {
36
- "build": "tsc"
37
- },
38
- "dependencies": {
39
- "@openfga/sdk": "^0.9.0",
40
- "@orpc/openapi": "1.7.4",
41
- "@orpc/server": "1.7.4",
42
- "@supabase/supabase-js": "^2.39.0",
43
- "body-parser": "^1.20.2",
44
- "dotenv": "^16.4.3",
45
- "express": "^4.18.2",
46
- "express-oauth2-jwt-bearer": "^1.7.4",
47
- "undici": "^7.24.4",
48
- "yaml": "^2.7.1"
49
- },
50
- "peerDependencies": {
51
- "zod": ">=4.0.0"
52
- },
53
- "devDependencies": {
54
- "@types/node": "^20.11.17",
55
- "typescript": "^5.4.4",
56
- "zod": "^4.3.0"
57
- }
58
- }
1
+ {
2
+ "name": "@newhomestar/sdk",
3
+ "version": "0.8.8",
4
+ "description": "Type-safe SDK for building Nova pipelines (workers & functions)",
5
+ "homepage": "https://github.com/newhomestar/nova-node-sdk#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/newhomestar/nova-node-sdk/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/newhomestar/nova-node-sdk.git"
12
+ },
13
+ "license": "ISC",
14
+ "author": "Christian Gomez",
15
+ "type": "module",
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/index.js",
21
+ "types": "./dist/index.d.ts"
22
+ },
23
+ "./next": {
24
+ "import": "./dist/next.js",
25
+ "types": "./dist/next.d.ts"
26
+ },
27
+ "./events": {
28
+ "import": "./dist/events.js",
29
+ "types": "./dist/events.d.ts"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsc"
37
+ },
38
+ "dependencies": {
39
+ "@openfga/sdk": "^0.9.0",
40
+ "@orpc/openapi": "1.7.4",
41
+ "@orpc/server": "1.7.4",
42
+ "@supabase/supabase-js": "^2.39.0",
43
+ "body-parser": "^1.20.2",
44
+ "dotenv": "^16.4.3",
45
+ "express": "^4.18.2",
46
+ "express-oauth2-jwt-bearer": "^1.7.4",
47
+ "undici": "^7.24.4",
48
+ "yaml": "^2.7.1"
49
+ },
50
+ "peerDependencies": {
51
+ "zod": ">=4.0.0"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^20.11.17",
55
+ "typescript": "^5.4.4",
56
+ "zod": "^4.3.0"
57
+ }
58
+ }