@objectstack/lint 14.7.0 → 15.0.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/index.cjs +145 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -23
- package/dist/index.d.ts +100 -23
- package/dist/index.js +142 -25
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -70,7 +70,7 @@ interface WidgetBindingFinding {
|
|
|
70
70
|
/** How to fix (or deliberately suppress) it. */
|
|
71
71
|
hint: string;
|
|
72
72
|
}
|
|
73
|
-
type AnyRec$
|
|
73
|
+
type AnyRec$f = Record<string, unknown>;
|
|
74
74
|
/**
|
|
75
75
|
* Validate every dashboard widget's dataset binding. Returns the list of
|
|
76
76
|
* findings (empty = clean). Caller decides how to surface them: `error`
|
|
@@ -78,7 +78,7 @@ type AnyRec$e = Record<string, unknown>;
|
|
|
78
78
|
* should fail validate/build; `warning` findings are advisory and must
|
|
79
79
|
* never fail the build on their own.
|
|
80
80
|
*/
|
|
81
|
-
declare function validateWidgetBindings(stack: AnyRec$
|
|
81
|
+
declare function validateWidgetBindings(stack: AnyRec$f): WidgetBindingFinding[];
|
|
82
82
|
|
|
83
83
|
interface ExprIssue {
|
|
84
84
|
where: string;
|
|
@@ -91,12 +91,12 @@ interface ExprIssue {
|
|
|
91
91
|
*/
|
|
92
92
|
severity?: 'error' | 'warning';
|
|
93
93
|
}
|
|
94
|
-
type AnyRec$
|
|
94
|
+
type AnyRec$e = Record<string, unknown>;
|
|
95
95
|
/**
|
|
96
96
|
* Validate every predicate in the stack. Returns the list of issues (empty =
|
|
97
97
|
* clean). Caller decides how to surface / whether to fail the build.
|
|
98
98
|
*/
|
|
99
|
-
declare function validateStackExpressions(stack: AnyRec$
|
|
99
|
+
declare function validateStackExpressions(stack: AnyRec$e): ExprIssue[];
|
|
100
100
|
|
|
101
101
|
type ListViewModeSeverity = 'error' | 'warning';
|
|
102
102
|
interface ListViewModeFinding {
|
|
@@ -110,7 +110,7 @@ interface ListViewModeFinding {
|
|
|
110
110
|
hint: string;
|
|
111
111
|
}
|
|
112
112
|
declare const LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
113
|
-
type AnyRec$
|
|
113
|
+
type AnyRec$d = Record<string, unknown>;
|
|
114
114
|
/**
|
|
115
115
|
* Flag ADR-0047 "views" mode violations on an object's built-in named views or a
|
|
116
116
|
* `defineView` default `list` / named `listViews`: `quickFilters`, or a `tabs`
|
|
@@ -120,7 +120,7 @@ type AnyRec$c = Record<string, unknown>;
|
|
|
120
120
|
*
|
|
121
121
|
* Feed the PRE-parse stack (normalizeStackInput output) — see file header.
|
|
122
122
|
*/
|
|
123
|
-
declare function validateListViewMode(stack: AnyRec$
|
|
123
|
+
declare function validateListViewMode(stack: AnyRec$d): ListViewModeFinding[];
|
|
124
124
|
|
|
125
125
|
type StyleSeverity = 'error' | 'warning';
|
|
126
126
|
interface StyleFinding {
|
|
@@ -138,14 +138,14 @@ declare const STYLE_CLASSNAME_TAILWIND = "style-classname-tailwind";
|
|
|
138
138
|
declare const STYLE_RESPONSIVE_NO_BASE = "style-responsive-no-base";
|
|
139
139
|
declare const STYLE_UNKNOWN_CSS_PROPERTY = "style-unknown-css-property";
|
|
140
140
|
declare const STYLE_UNKNOWN_TOKEN = "style-unknown-token";
|
|
141
|
-
type AnyRec$
|
|
141
|
+
type AnyRec$c = Record<string, unknown>;
|
|
142
142
|
/**
|
|
143
143
|
* Validate every page's component tree for SDUI styling correctness (ADR-0065).
|
|
144
144
|
* Returns findings (empty = clean). `error` findings describe styles that are
|
|
145
145
|
* silently dropped and should fail validate/build; `warning` findings are
|
|
146
146
|
* advisory (typos, drift, footguns).
|
|
147
147
|
*/
|
|
148
|
-
declare function validateResponsiveStyles(stack: AnyRec$
|
|
148
|
+
declare function validateResponsiveStyles(stack: AnyRec$c): StyleFinding[];
|
|
149
149
|
|
|
150
150
|
type JsxPageSeverity = 'error' | 'warning';
|
|
151
151
|
interface JsxPageFinding {
|
|
@@ -158,8 +158,8 @@ interface JsxPageFinding {
|
|
|
158
158
|
message: string;
|
|
159
159
|
hint: string;
|
|
160
160
|
}
|
|
161
|
-
type AnyRec$
|
|
162
|
-
declare function validateJsxPages(stack: AnyRec$
|
|
161
|
+
type AnyRec$b = Record<string, unknown>;
|
|
162
|
+
declare function validateJsxPages(stack: AnyRec$b, opts?: {
|
|
163
163
|
manifest?: Manifest;
|
|
164
164
|
}): JsxPageFinding[];
|
|
165
165
|
|
|
@@ -172,8 +172,8 @@ interface ReactPageFinding {
|
|
|
172
172
|
message: string;
|
|
173
173
|
hint: string;
|
|
174
174
|
}
|
|
175
|
-
type AnyRec$
|
|
176
|
-
declare function validateReactPages(stack: AnyRec$
|
|
175
|
+
type AnyRec$a = Record<string, unknown>;
|
|
176
|
+
declare function validateReactPages(stack: AnyRec$a): ReactPageFinding[];
|
|
177
177
|
|
|
178
178
|
type ReactPropSeverity = 'error' | 'warning';
|
|
179
179
|
interface ReactPropFinding {
|
|
@@ -184,8 +184,8 @@ interface ReactPropFinding {
|
|
|
184
184
|
message: string;
|
|
185
185
|
hint: string;
|
|
186
186
|
}
|
|
187
|
-
type AnyRec$
|
|
188
|
-
declare function validateReactPageProps(stack: AnyRec$
|
|
187
|
+
type AnyRec$9 = Record<string, unknown>;
|
|
188
|
+
declare function validateReactPageProps(stack: AnyRec$9): ReactPropFinding[];
|
|
189
189
|
|
|
190
190
|
type SourceStyleSeverity = 'error' | 'warning';
|
|
191
191
|
interface SourceStyleFinding {
|
|
@@ -197,8 +197,8 @@ interface SourceStyleFinding {
|
|
|
197
197
|
hint: string;
|
|
198
198
|
}
|
|
199
199
|
declare const PAGE_SOURCE_CLASSNAME = "page-source-className-tailwind";
|
|
200
|
-
type AnyRec$
|
|
201
|
-
declare function validatePageSourceStyling(stack: AnyRec$
|
|
200
|
+
type AnyRec$8 = Record<string, unknown>;
|
|
201
|
+
declare function validatePageSourceStyling(stack: AnyRec$8): SourceStyleFinding[];
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Build-time record-title diagnostics (ADR-0079).
|
|
@@ -242,14 +242,14 @@ interface RecordTitleFinding {
|
|
|
242
242
|
/** How to fix it. */
|
|
243
243
|
hint: string;
|
|
244
244
|
}
|
|
245
|
-
type AnyRec$
|
|
245
|
+
type AnyRec$7 = Record<string, unknown>;
|
|
246
246
|
/**
|
|
247
247
|
* Validate every object's record-title declaration. Returns the list of
|
|
248
248
|
* findings (empty = clean). Both rules are advisory (`warning`): the caller
|
|
249
249
|
* must never fail the build on them alone — auto-provision + the `Record #<id>`
|
|
250
250
|
* floor guarantee a resolvable title at runtime.
|
|
251
251
|
*/
|
|
252
|
-
declare function validateRecordTitle(stack: AnyRec$
|
|
252
|
+
declare function validateRecordTitle(stack: AnyRec$7): RecordTitleFinding[];
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* Build-time semantic-role diagnostics (ADR-0085).
|
|
@@ -286,13 +286,13 @@ interface SemanticRoleFinding {
|
|
|
286
286
|
/** How to fix it. */
|
|
287
287
|
hint: string;
|
|
288
288
|
}
|
|
289
|
-
type AnyRec$
|
|
289
|
+
type AnyRec$6 = Record<string, unknown>;
|
|
290
290
|
/**
|
|
291
291
|
* Validate every object's semantic-role pointers. Returns the list of
|
|
292
292
|
* findings (empty = clean). Advisory only — the caller must never fail the
|
|
293
293
|
* build on these alone.
|
|
294
294
|
*/
|
|
295
|
-
declare function validateSemanticRoles(stack: AnyRec$
|
|
295
|
+
declare function validateSemanticRoles(stack: AnyRec$6): SemanticRoleFinding[];
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* Build-time form-layout diagnostics (#2578).
|
|
@@ -335,12 +335,89 @@ interface FormLayoutFinding {
|
|
|
335
335
|
/** How to fix it. */
|
|
336
336
|
hint: string;
|
|
337
337
|
}
|
|
338
|
-
type AnyRec$
|
|
338
|
+
type AnyRec$5 = Record<string, unknown>;
|
|
339
339
|
/**
|
|
340
340
|
* Validate authored form-view layout. Returns findings (empty = clean).
|
|
341
341
|
* Advisory only — the caller must never fail the build on these alone.
|
|
342
342
|
*/
|
|
343
|
-
declare function validateFormLayout(stack: AnyRec$
|
|
343
|
+
declare function validateFormLayout(stack: AnyRec$5): FormLayoutFinding[];
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Build-time conditional-visibility diagnostics (ADR-0089 D3b).
|
|
347
|
+
*
|
|
348
|
+
* ADR-0089 unifies the conditional-visibility predicate under the single
|
|
349
|
+
* canonical key **`visibleWhen`** across data fields, view form sections/fields,
|
|
350
|
+
* and page components. The deprecated spellings — `visibleOn` (view form) and
|
|
351
|
+
* `visibility` (page component) — stay accepted and are folded into `visibleWhen`
|
|
352
|
+
* at the schema boundary (a zod `.transform()`). Because that fold happens during
|
|
353
|
+
* `parse()`, the aliases are gone from the *parsed* stack — so this rule runs on
|
|
354
|
+
* the **pre-parse** (normalized) stack, exactly like `validate-list-view-mode`,
|
|
355
|
+
* to see what the author actually wrote.
|
|
356
|
+
*
|
|
357
|
+
* Two advisory rules (both `warning` — nothing is broken, the alias still works
|
|
358
|
+
* and a mis-rooted predicate just never matches):
|
|
359
|
+
*
|
|
360
|
+
* - `visibility-alias-deprecated` — a `visibleOn` / `visibility` key in authored
|
|
361
|
+
* source. Autofix intent: rename the key to `visibleWhen` (same value).
|
|
362
|
+
* - `visibility-root-mislayered` — a visibility predicate whose binding root does
|
|
363
|
+
* not match its layer (ADR-0089 D3, §Context). The check is **bidirectional**:
|
|
364
|
+
* - **runtime** view/page surfaces (`*.view.ts` / `*.page.ts`) bind
|
|
365
|
+
* `record` + `current_user` (pages also expose `page.<var>`), so a `data.`-rooted
|
|
366
|
+
* predicate here is a wrong-layer paste that silently never matches; and
|
|
367
|
+
* - **metadata-editing** forms (`*.form.ts` — the row under edit) bind `data`, so
|
|
368
|
+
* a `record.`-rooted predicate there is the same bug in the other direction.
|
|
369
|
+
* The layer is supplied by the caller (`opts.layer`, default `'runtime'`): the
|
|
370
|
+
* app-lint path (`os validate` / `compile`) always lints runtime surfaces, while a
|
|
371
|
+
* file-aware caller linting a `*.form.ts` passes `layer: 'metadata'`.
|
|
372
|
+
*
|
|
373
|
+
* Scope: `views` (form `sections` / legacy `groups`, and their `fields`) and
|
|
374
|
+
* `pages` (`regions[].components[]`). Data-field `visibleWhen` is already covered
|
|
375
|
+
* by `validate-expressions` and is not re-checked here.
|
|
376
|
+
*/
|
|
377
|
+
declare const VISIBILITY_ALIAS_DEPRECATED = "visibility-alias-deprecated";
|
|
378
|
+
declare const VISIBILITY_ROOT_MISLAYERED = "visibility-root-mislayered";
|
|
379
|
+
type VisibilitySeverity = 'error' | 'warning';
|
|
380
|
+
/**
|
|
381
|
+
* Which binding environment the linted surface belongs to (ADR-0089 §Context):
|
|
382
|
+
* - `runtime` — `*.view.ts` / `*.page.ts`; binds `record` + `current_user` (+ `page`).
|
|
383
|
+
* - `metadata` — `*.form.ts` metadata-editing forms; binds `data` (the row under edit).
|
|
384
|
+
*/
|
|
385
|
+
type VisibilityLayer = 'runtime' | 'metadata';
|
|
386
|
+
/** Options for {@link validateVisibilityPredicates}. */
|
|
387
|
+
interface VisibilityOptions {
|
|
388
|
+
/** Binding layer of the surface being linted. Defaults to `'runtime'`. */
|
|
389
|
+
layer?: VisibilityLayer;
|
|
390
|
+
}
|
|
391
|
+
interface VisibilityFinding {
|
|
392
|
+
/** Always `warning` today — both rules are advisory (see module note). */
|
|
393
|
+
severity: VisibilitySeverity;
|
|
394
|
+
/** Diagnostic rule id, e.g. `visibility-alias-deprecated`. */
|
|
395
|
+
rule: string;
|
|
396
|
+
/** Human-readable location, e.g. `view "contact_form"`. */
|
|
397
|
+
where: string;
|
|
398
|
+
/** Config path, e.g. `views[2].sections[0].fields[3]`. */
|
|
399
|
+
path: string;
|
|
400
|
+
/** What is wrong. */
|
|
401
|
+
message: string;
|
|
402
|
+
/** How to fix it. */
|
|
403
|
+
hint: string;
|
|
404
|
+
}
|
|
405
|
+
type AnyRec$4 = Record<string, unknown>;
|
|
406
|
+
/**
|
|
407
|
+
* Validate conditional-visibility keys across authored views and pages.
|
|
408
|
+
*
|
|
409
|
+
* Runs on the **pre-parse** (normalized) stack so it can see the deprecated
|
|
410
|
+
* `visibleOn` / `visibility` aliases before the schema folds them into
|
|
411
|
+
* `visibleWhen`. Returns findings (empty = clean); all advisory (`warning`) —
|
|
412
|
+
* the caller must never fail the build on these alone.
|
|
413
|
+
*
|
|
414
|
+
* The binding-root check is layer-directional (ADR-0089 D3): pass
|
|
415
|
+
* `opts.layer = 'metadata'` when linting a `*.form.ts` metadata-editing form (so a
|
|
416
|
+
* `record.`-rooted predicate is flagged), or leave it at the `'runtime'` default for
|
|
417
|
+
* `*.view.ts` / `*.page.ts` surfaces (so a `data.`-rooted predicate is flagged). The
|
|
418
|
+
* alias-deprecated check is layer-agnostic.
|
|
419
|
+
*/
|
|
420
|
+
declare function validateVisibilityPredicates(stack: AnyRec$4, opts?: VisibilityOptions): VisibilityFinding[];
|
|
344
421
|
|
|
345
422
|
declare const CAPABILITY_REFERENCE_UNKNOWN = "capability-reference-unknown";
|
|
346
423
|
type CapabilityRefSeverity = 'error' | 'warning';
|
|
@@ -450,4 +527,4 @@ declare function buildAccessMatrix(stack: AnyRec): AccessMatrix;
|
|
|
450
527
|
*/
|
|
451
528
|
declare function diffAccessMatrix(before: AccessMatrix, after: AccessMatrix): string[];
|
|
452
529
|
|
|
453
|
-
export { APPROVAL_APPROVER_TYPE_UNKNOWN, APPROVAL_ESCALATION_REASSIGN_NO_TARGET, APPROVAL_ROLE_NOT_MEMBERSHIP_TIER, type ApprovalApproverFinding, type ApprovalApproverSeverity, CAPABILITY_REFERENCE_UNKNOWN, CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type CapabilityRefFinding, type CapabilityRefSeverity, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, FORM_COLSPAN_ABSOLUTE, FORM_FIELD_UNKNOWN, type FormLayoutFinding, type FormLayoutSeverity, type JsxPageFinding, type JsxPageSeverity, LIST_VIEW_FILTERS_IN_VIEWS_MODE, type ListViewModeFinding, type ListViewModeSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SECURITY_ANCHOR_HIGH_PRIVILEGE, SECURITY_BOOK_AUDIENCE_UNKNOWN_SET, SECURITY_DELEGATION_MISSING_REASON, SECURITY_EXTERNAL_WIDER, SECURITY_GRANT_EXPIRED_AT_AUTHORING, SECURITY_MASTER_DETAIL_UNGRANTED, SECURITY_OWD_ALIAS, SECURITY_OWD_UNSET, SECURITY_PRIVATE_NO_READSCOPE, SECURITY_ROLE_WORD, SECURITY_WILDCARD_VAMA, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SecurityFinding, type SecuritySeverity, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, buildAccessMatrix, diffAccessMatrix, validateApprovalApprovers, validateCapabilityReferences, validateFormLayout, validateJsxPages, validateListViewMode, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSecurityPosture, validateSemanticRoles, validateStackExpressions, validateWidgetBindings };
|
|
530
|
+
export { APPROVAL_APPROVER_TYPE_UNKNOWN, APPROVAL_ESCALATION_REASSIGN_NO_TARGET, APPROVAL_ROLE_NOT_MEMBERSHIP_TIER, type ApprovalApproverFinding, type ApprovalApproverSeverity, CAPABILITY_REFERENCE_UNKNOWN, CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type CapabilityRefFinding, type CapabilityRefSeverity, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, FORM_COLSPAN_ABSOLUTE, FORM_FIELD_UNKNOWN, type FormLayoutFinding, type FormLayoutSeverity, type JsxPageFinding, type JsxPageSeverity, LIST_VIEW_FILTERS_IN_VIEWS_MODE, type ListViewModeFinding, type ListViewModeSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SECURITY_ANCHOR_HIGH_PRIVILEGE, SECURITY_BOOK_AUDIENCE_UNKNOWN_SET, SECURITY_DELEGATION_MISSING_REASON, SECURITY_EXTERNAL_WIDER, SECURITY_GRANT_EXPIRED_AT_AUTHORING, SECURITY_MASTER_DETAIL_UNGRANTED, SECURITY_OWD_ALIAS, SECURITY_OWD_UNSET, SECURITY_PRIVATE_NO_READSCOPE, SECURITY_ROLE_WORD, SECURITY_WILDCARD_VAMA, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SecurityFinding, type SecuritySeverity, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, VISIBILITY_ALIAS_DEPRECATED, VISIBILITY_ROOT_MISLAYERED, type VisibilityFinding, type VisibilityLayer, type VisibilityOptions, type VisibilitySeverity, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, buildAccessMatrix, diffAccessMatrix, validateApprovalApprovers, validateCapabilityReferences, validateFormLayout, validateJsxPages, validateListViewMode, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSecurityPosture, validateSemanticRoles, validateStackExpressions, validateVisibilityPredicates, validateWidgetBindings };
|
package/dist/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ interface WidgetBindingFinding {
|
|
|
70
70
|
/** How to fix (or deliberately suppress) it. */
|
|
71
71
|
hint: string;
|
|
72
72
|
}
|
|
73
|
-
type AnyRec$
|
|
73
|
+
type AnyRec$f = Record<string, unknown>;
|
|
74
74
|
/**
|
|
75
75
|
* Validate every dashboard widget's dataset binding. Returns the list of
|
|
76
76
|
* findings (empty = clean). Caller decides how to surface them: `error`
|
|
@@ -78,7 +78,7 @@ type AnyRec$e = Record<string, unknown>;
|
|
|
78
78
|
* should fail validate/build; `warning` findings are advisory and must
|
|
79
79
|
* never fail the build on their own.
|
|
80
80
|
*/
|
|
81
|
-
declare function validateWidgetBindings(stack: AnyRec$
|
|
81
|
+
declare function validateWidgetBindings(stack: AnyRec$f): WidgetBindingFinding[];
|
|
82
82
|
|
|
83
83
|
interface ExprIssue {
|
|
84
84
|
where: string;
|
|
@@ -91,12 +91,12 @@ interface ExprIssue {
|
|
|
91
91
|
*/
|
|
92
92
|
severity?: 'error' | 'warning';
|
|
93
93
|
}
|
|
94
|
-
type AnyRec$
|
|
94
|
+
type AnyRec$e = Record<string, unknown>;
|
|
95
95
|
/**
|
|
96
96
|
* Validate every predicate in the stack. Returns the list of issues (empty =
|
|
97
97
|
* clean). Caller decides how to surface / whether to fail the build.
|
|
98
98
|
*/
|
|
99
|
-
declare function validateStackExpressions(stack: AnyRec$
|
|
99
|
+
declare function validateStackExpressions(stack: AnyRec$e): ExprIssue[];
|
|
100
100
|
|
|
101
101
|
type ListViewModeSeverity = 'error' | 'warning';
|
|
102
102
|
interface ListViewModeFinding {
|
|
@@ -110,7 +110,7 @@ interface ListViewModeFinding {
|
|
|
110
110
|
hint: string;
|
|
111
111
|
}
|
|
112
112
|
declare const LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
113
|
-
type AnyRec$
|
|
113
|
+
type AnyRec$d = Record<string, unknown>;
|
|
114
114
|
/**
|
|
115
115
|
* Flag ADR-0047 "views" mode violations on an object's built-in named views or a
|
|
116
116
|
* `defineView` default `list` / named `listViews`: `quickFilters`, or a `tabs`
|
|
@@ -120,7 +120,7 @@ type AnyRec$c = Record<string, unknown>;
|
|
|
120
120
|
*
|
|
121
121
|
* Feed the PRE-parse stack (normalizeStackInput output) — see file header.
|
|
122
122
|
*/
|
|
123
|
-
declare function validateListViewMode(stack: AnyRec$
|
|
123
|
+
declare function validateListViewMode(stack: AnyRec$d): ListViewModeFinding[];
|
|
124
124
|
|
|
125
125
|
type StyleSeverity = 'error' | 'warning';
|
|
126
126
|
interface StyleFinding {
|
|
@@ -138,14 +138,14 @@ declare const STYLE_CLASSNAME_TAILWIND = "style-classname-tailwind";
|
|
|
138
138
|
declare const STYLE_RESPONSIVE_NO_BASE = "style-responsive-no-base";
|
|
139
139
|
declare const STYLE_UNKNOWN_CSS_PROPERTY = "style-unknown-css-property";
|
|
140
140
|
declare const STYLE_UNKNOWN_TOKEN = "style-unknown-token";
|
|
141
|
-
type AnyRec$
|
|
141
|
+
type AnyRec$c = Record<string, unknown>;
|
|
142
142
|
/**
|
|
143
143
|
* Validate every page's component tree for SDUI styling correctness (ADR-0065).
|
|
144
144
|
* Returns findings (empty = clean). `error` findings describe styles that are
|
|
145
145
|
* silently dropped and should fail validate/build; `warning` findings are
|
|
146
146
|
* advisory (typos, drift, footguns).
|
|
147
147
|
*/
|
|
148
|
-
declare function validateResponsiveStyles(stack: AnyRec$
|
|
148
|
+
declare function validateResponsiveStyles(stack: AnyRec$c): StyleFinding[];
|
|
149
149
|
|
|
150
150
|
type JsxPageSeverity = 'error' | 'warning';
|
|
151
151
|
interface JsxPageFinding {
|
|
@@ -158,8 +158,8 @@ interface JsxPageFinding {
|
|
|
158
158
|
message: string;
|
|
159
159
|
hint: string;
|
|
160
160
|
}
|
|
161
|
-
type AnyRec$
|
|
162
|
-
declare function validateJsxPages(stack: AnyRec$
|
|
161
|
+
type AnyRec$b = Record<string, unknown>;
|
|
162
|
+
declare function validateJsxPages(stack: AnyRec$b, opts?: {
|
|
163
163
|
manifest?: Manifest;
|
|
164
164
|
}): JsxPageFinding[];
|
|
165
165
|
|
|
@@ -172,8 +172,8 @@ interface ReactPageFinding {
|
|
|
172
172
|
message: string;
|
|
173
173
|
hint: string;
|
|
174
174
|
}
|
|
175
|
-
type AnyRec$
|
|
176
|
-
declare function validateReactPages(stack: AnyRec$
|
|
175
|
+
type AnyRec$a = Record<string, unknown>;
|
|
176
|
+
declare function validateReactPages(stack: AnyRec$a): ReactPageFinding[];
|
|
177
177
|
|
|
178
178
|
type ReactPropSeverity = 'error' | 'warning';
|
|
179
179
|
interface ReactPropFinding {
|
|
@@ -184,8 +184,8 @@ interface ReactPropFinding {
|
|
|
184
184
|
message: string;
|
|
185
185
|
hint: string;
|
|
186
186
|
}
|
|
187
|
-
type AnyRec$
|
|
188
|
-
declare function validateReactPageProps(stack: AnyRec$
|
|
187
|
+
type AnyRec$9 = Record<string, unknown>;
|
|
188
|
+
declare function validateReactPageProps(stack: AnyRec$9): ReactPropFinding[];
|
|
189
189
|
|
|
190
190
|
type SourceStyleSeverity = 'error' | 'warning';
|
|
191
191
|
interface SourceStyleFinding {
|
|
@@ -197,8 +197,8 @@ interface SourceStyleFinding {
|
|
|
197
197
|
hint: string;
|
|
198
198
|
}
|
|
199
199
|
declare const PAGE_SOURCE_CLASSNAME = "page-source-className-tailwind";
|
|
200
|
-
type AnyRec$
|
|
201
|
-
declare function validatePageSourceStyling(stack: AnyRec$
|
|
200
|
+
type AnyRec$8 = Record<string, unknown>;
|
|
201
|
+
declare function validatePageSourceStyling(stack: AnyRec$8): SourceStyleFinding[];
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Build-time record-title diagnostics (ADR-0079).
|
|
@@ -242,14 +242,14 @@ interface RecordTitleFinding {
|
|
|
242
242
|
/** How to fix it. */
|
|
243
243
|
hint: string;
|
|
244
244
|
}
|
|
245
|
-
type AnyRec$
|
|
245
|
+
type AnyRec$7 = Record<string, unknown>;
|
|
246
246
|
/**
|
|
247
247
|
* Validate every object's record-title declaration. Returns the list of
|
|
248
248
|
* findings (empty = clean). Both rules are advisory (`warning`): the caller
|
|
249
249
|
* must never fail the build on them alone — auto-provision + the `Record #<id>`
|
|
250
250
|
* floor guarantee a resolvable title at runtime.
|
|
251
251
|
*/
|
|
252
|
-
declare function validateRecordTitle(stack: AnyRec$
|
|
252
|
+
declare function validateRecordTitle(stack: AnyRec$7): RecordTitleFinding[];
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* Build-time semantic-role diagnostics (ADR-0085).
|
|
@@ -286,13 +286,13 @@ interface SemanticRoleFinding {
|
|
|
286
286
|
/** How to fix it. */
|
|
287
287
|
hint: string;
|
|
288
288
|
}
|
|
289
|
-
type AnyRec$
|
|
289
|
+
type AnyRec$6 = Record<string, unknown>;
|
|
290
290
|
/**
|
|
291
291
|
* Validate every object's semantic-role pointers. Returns the list of
|
|
292
292
|
* findings (empty = clean). Advisory only — the caller must never fail the
|
|
293
293
|
* build on these alone.
|
|
294
294
|
*/
|
|
295
|
-
declare function validateSemanticRoles(stack: AnyRec$
|
|
295
|
+
declare function validateSemanticRoles(stack: AnyRec$6): SemanticRoleFinding[];
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
298
|
* Build-time form-layout diagnostics (#2578).
|
|
@@ -335,12 +335,89 @@ interface FormLayoutFinding {
|
|
|
335
335
|
/** How to fix it. */
|
|
336
336
|
hint: string;
|
|
337
337
|
}
|
|
338
|
-
type AnyRec$
|
|
338
|
+
type AnyRec$5 = Record<string, unknown>;
|
|
339
339
|
/**
|
|
340
340
|
* Validate authored form-view layout. Returns findings (empty = clean).
|
|
341
341
|
* Advisory only — the caller must never fail the build on these alone.
|
|
342
342
|
*/
|
|
343
|
-
declare function validateFormLayout(stack: AnyRec$
|
|
343
|
+
declare function validateFormLayout(stack: AnyRec$5): FormLayoutFinding[];
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Build-time conditional-visibility diagnostics (ADR-0089 D3b).
|
|
347
|
+
*
|
|
348
|
+
* ADR-0089 unifies the conditional-visibility predicate under the single
|
|
349
|
+
* canonical key **`visibleWhen`** across data fields, view form sections/fields,
|
|
350
|
+
* and page components. The deprecated spellings — `visibleOn` (view form) and
|
|
351
|
+
* `visibility` (page component) — stay accepted and are folded into `visibleWhen`
|
|
352
|
+
* at the schema boundary (a zod `.transform()`). Because that fold happens during
|
|
353
|
+
* `parse()`, the aliases are gone from the *parsed* stack — so this rule runs on
|
|
354
|
+
* the **pre-parse** (normalized) stack, exactly like `validate-list-view-mode`,
|
|
355
|
+
* to see what the author actually wrote.
|
|
356
|
+
*
|
|
357
|
+
* Two advisory rules (both `warning` — nothing is broken, the alias still works
|
|
358
|
+
* and a mis-rooted predicate just never matches):
|
|
359
|
+
*
|
|
360
|
+
* - `visibility-alias-deprecated` — a `visibleOn` / `visibility` key in authored
|
|
361
|
+
* source. Autofix intent: rename the key to `visibleWhen` (same value).
|
|
362
|
+
* - `visibility-root-mislayered` — a visibility predicate whose binding root does
|
|
363
|
+
* not match its layer (ADR-0089 D3, §Context). The check is **bidirectional**:
|
|
364
|
+
* - **runtime** view/page surfaces (`*.view.ts` / `*.page.ts`) bind
|
|
365
|
+
* `record` + `current_user` (pages also expose `page.<var>`), so a `data.`-rooted
|
|
366
|
+
* predicate here is a wrong-layer paste that silently never matches; and
|
|
367
|
+
* - **metadata-editing** forms (`*.form.ts` — the row under edit) bind `data`, so
|
|
368
|
+
* a `record.`-rooted predicate there is the same bug in the other direction.
|
|
369
|
+
* The layer is supplied by the caller (`opts.layer`, default `'runtime'`): the
|
|
370
|
+
* app-lint path (`os validate` / `compile`) always lints runtime surfaces, while a
|
|
371
|
+
* file-aware caller linting a `*.form.ts` passes `layer: 'metadata'`.
|
|
372
|
+
*
|
|
373
|
+
* Scope: `views` (form `sections` / legacy `groups`, and their `fields`) and
|
|
374
|
+
* `pages` (`regions[].components[]`). Data-field `visibleWhen` is already covered
|
|
375
|
+
* by `validate-expressions` and is not re-checked here.
|
|
376
|
+
*/
|
|
377
|
+
declare const VISIBILITY_ALIAS_DEPRECATED = "visibility-alias-deprecated";
|
|
378
|
+
declare const VISIBILITY_ROOT_MISLAYERED = "visibility-root-mislayered";
|
|
379
|
+
type VisibilitySeverity = 'error' | 'warning';
|
|
380
|
+
/**
|
|
381
|
+
* Which binding environment the linted surface belongs to (ADR-0089 §Context):
|
|
382
|
+
* - `runtime` — `*.view.ts` / `*.page.ts`; binds `record` + `current_user` (+ `page`).
|
|
383
|
+
* - `metadata` — `*.form.ts` metadata-editing forms; binds `data` (the row under edit).
|
|
384
|
+
*/
|
|
385
|
+
type VisibilityLayer = 'runtime' | 'metadata';
|
|
386
|
+
/** Options for {@link validateVisibilityPredicates}. */
|
|
387
|
+
interface VisibilityOptions {
|
|
388
|
+
/** Binding layer of the surface being linted. Defaults to `'runtime'`. */
|
|
389
|
+
layer?: VisibilityLayer;
|
|
390
|
+
}
|
|
391
|
+
interface VisibilityFinding {
|
|
392
|
+
/** Always `warning` today — both rules are advisory (see module note). */
|
|
393
|
+
severity: VisibilitySeverity;
|
|
394
|
+
/** Diagnostic rule id, e.g. `visibility-alias-deprecated`. */
|
|
395
|
+
rule: string;
|
|
396
|
+
/** Human-readable location, e.g. `view "contact_form"`. */
|
|
397
|
+
where: string;
|
|
398
|
+
/** Config path, e.g. `views[2].sections[0].fields[3]`. */
|
|
399
|
+
path: string;
|
|
400
|
+
/** What is wrong. */
|
|
401
|
+
message: string;
|
|
402
|
+
/** How to fix it. */
|
|
403
|
+
hint: string;
|
|
404
|
+
}
|
|
405
|
+
type AnyRec$4 = Record<string, unknown>;
|
|
406
|
+
/**
|
|
407
|
+
* Validate conditional-visibility keys across authored views and pages.
|
|
408
|
+
*
|
|
409
|
+
* Runs on the **pre-parse** (normalized) stack so it can see the deprecated
|
|
410
|
+
* `visibleOn` / `visibility` aliases before the schema folds them into
|
|
411
|
+
* `visibleWhen`. Returns findings (empty = clean); all advisory (`warning`) —
|
|
412
|
+
* the caller must never fail the build on these alone.
|
|
413
|
+
*
|
|
414
|
+
* The binding-root check is layer-directional (ADR-0089 D3): pass
|
|
415
|
+
* `opts.layer = 'metadata'` when linting a `*.form.ts` metadata-editing form (so a
|
|
416
|
+
* `record.`-rooted predicate is flagged), or leave it at the `'runtime'` default for
|
|
417
|
+
* `*.view.ts` / `*.page.ts` surfaces (so a `data.`-rooted predicate is flagged). The
|
|
418
|
+
* alias-deprecated check is layer-agnostic.
|
|
419
|
+
*/
|
|
420
|
+
declare function validateVisibilityPredicates(stack: AnyRec$4, opts?: VisibilityOptions): VisibilityFinding[];
|
|
344
421
|
|
|
345
422
|
declare const CAPABILITY_REFERENCE_UNKNOWN = "capability-reference-unknown";
|
|
346
423
|
type CapabilityRefSeverity = 'error' | 'warning';
|
|
@@ -450,4 +527,4 @@ declare function buildAccessMatrix(stack: AnyRec): AccessMatrix;
|
|
|
450
527
|
*/
|
|
451
528
|
declare function diffAccessMatrix(before: AccessMatrix, after: AccessMatrix): string[];
|
|
452
529
|
|
|
453
|
-
export { APPROVAL_APPROVER_TYPE_UNKNOWN, APPROVAL_ESCALATION_REASSIGN_NO_TARGET, APPROVAL_ROLE_NOT_MEMBERSHIP_TIER, type ApprovalApproverFinding, type ApprovalApproverSeverity, CAPABILITY_REFERENCE_UNKNOWN, CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type CapabilityRefFinding, type CapabilityRefSeverity, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, FORM_COLSPAN_ABSOLUTE, FORM_FIELD_UNKNOWN, type FormLayoutFinding, type FormLayoutSeverity, type JsxPageFinding, type JsxPageSeverity, LIST_VIEW_FILTERS_IN_VIEWS_MODE, type ListViewModeFinding, type ListViewModeSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SECURITY_ANCHOR_HIGH_PRIVILEGE, SECURITY_BOOK_AUDIENCE_UNKNOWN_SET, SECURITY_DELEGATION_MISSING_REASON, SECURITY_EXTERNAL_WIDER, SECURITY_GRANT_EXPIRED_AT_AUTHORING, SECURITY_MASTER_DETAIL_UNGRANTED, SECURITY_OWD_ALIAS, SECURITY_OWD_UNSET, SECURITY_PRIVATE_NO_READSCOPE, SECURITY_ROLE_WORD, SECURITY_WILDCARD_VAMA, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SecurityFinding, type SecuritySeverity, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, buildAccessMatrix, diffAccessMatrix, validateApprovalApprovers, validateCapabilityReferences, validateFormLayout, validateJsxPages, validateListViewMode, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSecurityPosture, validateSemanticRoles, validateStackExpressions, validateWidgetBindings };
|
|
530
|
+
export { APPROVAL_APPROVER_TYPE_UNKNOWN, APPROVAL_ESCALATION_REASSIGN_NO_TARGET, APPROVAL_ROLE_NOT_MEMBERSHIP_TIER, type ApprovalApproverFinding, type ApprovalApproverSeverity, CAPABILITY_REFERENCE_UNKNOWN, CHART_CONFIG_MISSING, CHART_FIELD_UNKNOWN, type CapabilityRefFinding, type CapabilityRefSeverity, type ExprIssue, FIELD_GROUP_EMPTY, FIELD_GROUP_UNDECLARED, FORM_COLSPAN_ABSOLUTE, FORM_FIELD_UNKNOWN, type FormLayoutFinding, type FormLayoutSeverity, type JsxPageFinding, type JsxPageSeverity, LIST_VIEW_FILTERS_IN_VIEWS_MODE, type ListViewModeFinding, type ListViewModeSeverity, MEASURE_AGGREGATE_INCOHERENT, PAGE_SOURCE_CLASSNAME, type ReactPageFinding, type ReactPageSeverity, type ReactPropFinding, type ReactPropSeverity, type RecordTitleFinding, type RecordTitleSeverity, SECURITY_ANCHOR_HIGH_PRIVILEGE, SECURITY_BOOK_AUDIENCE_UNKNOWN_SET, SECURITY_DELEGATION_MISSING_REASON, SECURITY_EXTERNAL_WIDER, SECURITY_GRANT_EXPIRED_AT_AUTHORING, SECURITY_MASTER_DETAIL_UNGRANTED, SECURITY_OWD_ALIAS, SECURITY_OWD_UNSET, SECURITY_PRIVATE_NO_READSCOPE, SECURITY_ROLE_WORD, SECURITY_WILDCARD_VAMA, SEMANTIC_ROLE_FIELD_UNKNOWN, STYLE_CLASSNAME_TAILWIND, STYLE_NODE_MISSING_ID, STYLE_RESPONSIVE_NO_BASE, STYLE_UNKNOWN_CSS_PROPERTY, STYLE_UNKNOWN_TOKEN, type SecurityFinding, type SecuritySeverity, type SemanticRoleFinding, type SemanticRoleSeverity, type SourceStyleFinding, type SourceStyleSeverity, type StyleFinding, type StyleSeverity, TABLE_COUNT_ONLY, TITLE_FORMAT_RETIRED, TITLE_UNRESOLVABLE, VISIBILITY_ALIAS_DEPRECATED, VISIBILITY_ROOT_MISLAYERED, type VisibilityFinding, type VisibilityLayer, type VisibilityOptions, type VisibilitySeverity, WIDGET_DATASET_UNKNOWN, WIDGET_DIMENSION_UNKNOWN, WIDGET_MEASURE_UNKNOWN, type WidgetBindingFinding, type WidgetBindingSeverity, buildAccessMatrix, diffAccessMatrix, validateApprovalApprovers, validateCapabilityReferences, validateFormLayout, validateJsxPages, validateListViewMode, validatePageSourceStyling, validateReactPageProps, validateReactPages, validateRecordTitle, validateResponsiveStyles, validateSecurityPosture, validateSemanticRoles, validateStackExpressions, validateVisibilityPredicates, validateWidgetBindings };
|