@ontrails/permits 1.0.0-beta.30 → 1.0.0-beta.39
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/CHANGELOG.md +35 -0
- package/package.json +2 -2
- package/src/index.ts +5 -1
- package/src/rules.ts +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @ontrails/permits
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.39
|
|
4
|
+
|
|
5
|
+
## 1.0.0-beta.38
|
|
6
|
+
|
|
7
|
+
## 1.0.0-beta.37
|
|
8
|
+
|
|
9
|
+
## 1.0.0-beta.36
|
|
10
|
+
|
|
11
|
+
## 1.0.0-beta.35
|
|
12
|
+
|
|
13
|
+
## 1.0.0-beta.34
|
|
14
|
+
|
|
15
|
+
## 1.0.0-beta.33
|
|
16
|
+
|
|
17
|
+
## 1.0.0-beta.32
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 3e5c0fc: Export shared diagnostic base types from core and align governance diagnostic
|
|
22
|
+
severity vocabulary across adapter checks, permits, and Warden.
|
|
23
|
+
- Updated dependencies [3e5c0fc]
|
|
24
|
+
- Updated dependencies [f3c4fef]
|
|
25
|
+
- Updated dependencies [cb0a9d8]
|
|
26
|
+
- Updated dependencies [21c6dda]
|
|
27
|
+
- Updated dependencies [fe72b84]
|
|
28
|
+
- @ontrails/core@1.0.0-beta.32
|
|
29
|
+
|
|
30
|
+
## 1.0.0-beta.31
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [4cd5d4e]
|
|
35
|
+
- Updated dependencies [38907cc]
|
|
36
|
+
- @ontrails/core@1.0.0-beta.31
|
|
37
|
+
|
|
3
38
|
## 1.0.0-beta.30
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ontrails/permits",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.39",
|
|
4
4
|
"files": [
|
|
5
5
|
"src/**/*.ts",
|
|
6
6
|
"!src/**/__tests__/**",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@ontrails/core": "^1.0.0-beta.
|
|
27
|
+
"@ontrails/core": "^1.0.0-beta.39",
|
|
28
28
|
"zod": "^4.3.5"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/index.ts
CHANGED
|
@@ -26,4 +26,8 @@ export {
|
|
|
26
26
|
type PermitExtractionInput,
|
|
27
27
|
} from './extraction.js';
|
|
28
28
|
export { type Permit, getPermit } from './permit.js';
|
|
29
|
-
export {
|
|
29
|
+
export {
|
|
30
|
+
validatePermits,
|
|
31
|
+
type PermitDiagnostic,
|
|
32
|
+
type PermitDiagnosticSeverity,
|
|
33
|
+
} from './rules.js';
|
package/src/rules.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
DiagnosticSeverity,
|
|
3
|
+
RuleDiagnosticBase,
|
|
4
|
+
Trail,
|
|
5
|
+
} from '@ontrails/core';
|
|
2
6
|
|
|
3
7
|
// ---------------------------------------------------------------------------
|
|
4
8
|
// Diagnostic type
|
|
5
9
|
// ---------------------------------------------------------------------------
|
|
6
10
|
|
|
11
|
+
export type PermitDiagnosticSeverity = DiagnosticSeverity;
|
|
12
|
+
|
|
7
13
|
/** A single governance finding from a permit rule. */
|
|
8
|
-
export interface PermitDiagnostic {
|
|
14
|
+
export interface PermitDiagnostic extends RuleDiagnosticBase {
|
|
9
15
|
readonly trailId: string;
|
|
10
16
|
readonly rule: string;
|
|
11
|
-
readonly severity:
|
|
17
|
+
readonly severity: PermitDiagnosticSeverity;
|
|
12
18
|
readonly message: string;
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -70,7 +76,7 @@ export const writeWithoutPermit: Rule = (trails) =>
|
|
|
70
76
|
.map((t) => ({
|
|
71
77
|
message: `Trail "${t.id}" has write intent but no permit declaration`,
|
|
72
78
|
rule: 'writeWithoutPermit',
|
|
73
|
-
severity: '
|
|
79
|
+
severity: 'warn' as const,
|
|
74
80
|
trailId: t.id,
|
|
75
81
|
}));
|
|
76
82
|
|
|
@@ -101,7 +107,7 @@ export const scopeNamingConsistency: Rule = (trails) =>
|
|
|
101
107
|
.map((scope) => ({
|
|
102
108
|
message: `Scope "${scope}" on trail "${t.id}" does not follow entity:action convention`,
|
|
103
109
|
rule: 'scopeNamingConsistency',
|
|
104
|
-
severity: '
|
|
110
|
+
severity: 'warn' as const,
|
|
105
111
|
trailId: t.id,
|
|
106
112
|
}))
|
|
107
113
|
);
|
|
@@ -143,7 +149,7 @@ const orphanDiagnostics = (
|
|
|
143
149
|
.map(([scope, ids]) => ({
|
|
144
150
|
message: `Scope "${scope}" appears only on trail "${[...ids][0]}" — possible typo`,
|
|
145
151
|
rule: 'orphanScopeDetection',
|
|
146
|
-
severity: '
|
|
152
|
+
severity: 'warn' as const,
|
|
147
153
|
trailId: [...ids][0] ?? '',
|
|
148
154
|
}));
|
|
149
155
|
|