@substrat-run/cli 0.45.0 → 0.47.0

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/bump.d.ts ADDED
@@ -0,0 +1,86 @@
1
+ export type Level = 'patch' | 'minor' | 'major';
2
+ export type Bump = 'none' | Level;
3
+ export type Artifact = 'model' | 'openapi' | 'permissions';
4
+ export interface Change {
5
+ readonly level: Level;
6
+ readonly artifact: Artifact;
7
+ /** Where in the artifact, as a reader would name it (`POST /api/lists`, `entities.item.fields.text`). */
8
+ readonly path: string;
9
+ readonly detail: string;
10
+ /** A permission change the human checkpoint must read, whatever the bump. */
11
+ readonly flagged?: boolean;
12
+ }
13
+ export interface Classification {
14
+ readonly bump: Bump;
15
+ readonly changes: readonly Change[];
16
+ }
17
+ export declare const rank: (b: Bump) => number;
18
+ export declare const maxBump: (a: Bump, b: Bump) => Bump;
19
+ export declare const isBump: (s: string) => s is Bump;
20
+ /**
21
+ * Every local `$ref` (`#/…`) replaced by its target, recursively, against `root`. Compared
22
+ * unresolved, a break inside a shared component reads as an unchanged `{"$ref": …}` on both
23
+ * sides. A reference that loops back is left as the reference.
24
+ */
25
+ export declare function resolveRefs(node: unknown, root?: unknown, seen?: readonly string[]): unknown;
26
+ /**
27
+ * Which way a schema's values travel. An `input` is what a caller SENDS: requiring more of it
28
+ * breaks the caller, accepting more does not. An `output` is what a caller READS (a response, a
29
+ * stored row, an event payload): promising less of it breaks the reader, promising more does not.
30
+ */
31
+ export type Direction = 'input' | 'output';
32
+ export declare function classifyModel(baseText: string | null, headText: string | null): Classification;
33
+ export declare function classifyOpenApi(baseText: string | null, headText: string | null): Classification;
34
+ /**
35
+ * The parts of `PERMISSIONS.md` that carry a fact: one map per section, from a row's first
36
+ * cell (a key, a role, an entity type, a scheduled operation) to the row.
37
+ */
38
+ export interface PermissionSnapshot {
39
+ /** Permission key → its description and declaring module. */
40
+ readonly registry: Record<string, string[]>;
41
+ /** Role → the keys it holds. */
42
+ readonly roles: Record<string, string[]>;
43
+ /** Entity type → keys granted per entity, then its remaining cells as written. */
44
+ readonly grantShapes: Record<string, {
45
+ keys: string[];
46
+ terms: string[];
47
+ }>;
48
+ /** Scheduled operation → the keys its system principal holds, then the remaining cells. */
49
+ readonly schedules: Record<string, {
50
+ keys: string[];
51
+ terms: string[];
52
+ }>;
53
+ /**
54
+ * Operation → the key it declares it checks, then how it narrows and who declares it (#2384).
55
+ * `undefined` when the artifact has no Operations section: an emitter that predates it.
56
+ */
57
+ operations?: Record<string, {
58
+ keys: string[];
59
+ terms: string[];
60
+ }>;
61
+ /**
62
+ * The Operations heading is present but its table is not the one the emitter writes — header
63
+ * gone or renamed, a row with the wrong number of cells, or no rows and no "none" line. What
64
+ * cannot be read is judged major, never read as every operation removed.
65
+ */
66
+ operationsUnreadable?: string;
67
+ /** Modules the section says are registered as a bare manifest, so their operations are not known. */
68
+ operationsUnknownFor?: string[];
69
+ /** Sections this parser does not read, by heading, with their text: judged whole. */
70
+ readonly unread: Record<string, string>;
71
+ }
72
+ /**
73
+ * Parse a `PERMISSIONS.md` that `tools/permission-diff.mts` emitted. Sections are found by
74
+ * their heading's words, not their number: the numbering shifts with which sections a vertical
75
+ * has (§4 is grant shapes in one file and "not covered" in another).
76
+ */
77
+ export declare function parsePermissions(text: string): PermissionSnapshot;
78
+ export declare function classifyPermissions(baseText: string | null, headText: string | null): Classification;
79
+ /** One vertical's three artifacts as text, `null` where the file does not exist. */
80
+ export interface Artifacts {
81
+ readonly model: string | null;
82
+ readonly openapi: string | null;
83
+ readonly permissions: string | null;
84
+ }
85
+ export declare function classify(base: Artifacts, head: Artifacts): Classification;
86
+ //# sourceMappingURL=bump.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bump.d.ts","sourceRoot":"","sources":["../src/bump.ts"],"names":[],"mappings":"AAoDA,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAChD,MAAM,MAAM,IAA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