@stacksjs/types 0.75.539 → 0.75.541
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/cli.d.ts +3 -8
- package/dist/dashboard.d.ts +41 -37
- package/dist/stack-extensions.d.ts +6 -7
- package/package.json +5 -5
package/dist/cli.d.ts
CHANGED
|
@@ -99,6 +99,8 @@ export declare interface TinkerOptions extends CliOptions {
|
|
|
99
99
|
print?: string | boolean
|
|
100
100
|
banner?: boolean
|
|
101
101
|
preload?: string
|
|
102
|
+
serve?: boolean
|
|
103
|
+
bare?: boolean
|
|
102
104
|
}
|
|
103
105
|
export declare interface TypesOptions extends CliOptions {}
|
|
104
106
|
declare type ArrayBufferView = NodeJS.TypedArray | DataView;
|
|
@@ -224,14 +226,7 @@ export type AddOptions = {
|
|
|
224
226
|
[key in AddOption]?: boolean
|
|
225
227
|
} & CliOptions;
|
|
226
228
|
export type CreateStringOption = 'name';
|
|
227
|
-
export type CreateBooleanOption =
|
|
228
|
-
| 'components'
|
|
229
|
-
| 'web-components'
|
|
230
|
-
| 'views'
|
|
231
|
-
| 'functions'
|
|
232
|
-
| 'api'
|
|
233
|
-
| 'database'
|
|
234
|
-
| 'minimal';
|
|
229
|
+
export type CreateBooleanOption = 'minimal';
|
|
235
230
|
export type CreateOptions = {
|
|
236
231
|
[key in CreateBooleanOption]: boolean
|
|
237
232
|
} & {
|
package/dist/dashboard.d.ts
CHANGED
|
@@ -89,43 +89,6 @@ export declare interface DashboardProviderOptions {
|
|
|
89
89
|
errors?: DashboardProviderSelection
|
|
90
90
|
analytics?: DashboardProviderSelection
|
|
91
91
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Per-model dashboard configuration (stacksjs/stacks#1843).
|
|
94
|
-
*
|
|
95
|
-
* Attach to a model definition to influence how the model surfaces in the
|
|
96
|
-
* dashboard sidebar without touching the framework's dashboard internals:
|
|
97
|
-
*
|
|
98
|
-
* ```ts
|
|
99
|
-
* defineModel({
|
|
100
|
-
* name: 'AuditLog',
|
|
101
|
-
* table: 'audit_logs',
|
|
102
|
-
* dashboard: {
|
|
103
|
-
* section: 'management',
|
|
104
|
-
* icon: 'shield',
|
|
105
|
-
* roles: ['admin'],
|
|
106
|
-
* description: 'Append-only audit trail (admin-only)',
|
|
107
|
-
* },
|
|
108
|
-
* attributes: { … },
|
|
109
|
-
* })
|
|
110
|
-
* ```
|
|
111
|
-
*
|
|
112
|
-
* Resolution chain (most specific → fallback):
|
|
113
|
-
*
|
|
114
|
-
* 1. `dashboard.enabled === false` → model is hidden from the sidebar
|
|
115
|
-
* entirely. The dynamic ORM viewer (`/models/<id>`) still works for
|
|
116
|
-
* direct navigation, but the row is suppressed.
|
|
117
|
-
* 2. `dashboard.section` → pins the model to that section, overriding
|
|
118
|
-
* the path-based auto-categorisation (commerce/, Content/, etc.).
|
|
119
|
-
* 3. `dashboard.label` / `dashboard.icon` → display overrides; fall back
|
|
120
|
-
* to the model name and `iconMap` lookup.
|
|
121
|
-
* 4. `dashboard.roles` → role-gates the sidebar row AND the API the
|
|
122
|
-
* `useApi` trait generates. The sidebar builder emits the row with role
|
|
123
|
-
* metadata and the client filters it out for users who lack a matching
|
|
124
|
-
* role, permissively by default (unauthenticated viewers see everything -
|
|
125
|
-
* see `useRole.ts`); the route generator appends `role:<the list>` to the
|
|
126
|
-
* resolved middleware, which `dashboard.enforce: false` opts out of
|
|
127
|
-
* (stacksjs/stacks#2883).
|
|
128
|
-
*/
|
|
129
92
|
export declare interface DashboardModelOptions {
|
|
130
93
|
access?: boolean
|
|
131
94
|
enabled?: boolean
|
|
@@ -143,6 +106,8 @@ export declare interface DashboardModelOptions {
|
|
|
143
106
|
| 'utilities'
|
|
144
107
|
| 'data'
|
|
145
108
|
| 'app'
|
|
109
|
+
columns?: string[]
|
|
110
|
+
writes?: DashboardModelWrite[]
|
|
146
111
|
roles?: string[]
|
|
147
112
|
enforce?: boolean
|
|
148
113
|
description?: string
|
|
@@ -201,3 +166,42 @@ export type DashboardRouteGroup = | '/ai'
|
|
|
201
166
|
*/
|
|
202
167
|
export type DashboardProviderName = 'local' | 'hq';
|
|
203
168
|
export type DashboardConfig = Partial<DashboardOptions>;
|
|
169
|
+
/**
|
|
170
|
+
* Per-model dashboard configuration (stacksjs/stacks#1843).
|
|
171
|
+
*
|
|
172
|
+
* Attach to a model definition to influence how the model surfaces in the
|
|
173
|
+
* dashboard sidebar without touching the framework's dashboard internals:
|
|
174
|
+
*
|
|
175
|
+
* ```ts
|
|
176
|
+
* defineModel({
|
|
177
|
+
* name: 'AuditLog',
|
|
178
|
+
* table: 'audit_logs',
|
|
179
|
+
* dashboard: {
|
|
180
|
+
* section: 'management',
|
|
181
|
+
* icon: 'shield',
|
|
182
|
+
* roles: ['admin'],
|
|
183
|
+
* description: 'Append-only audit trail (admin-only)',
|
|
184
|
+
* },
|
|
185
|
+
* attributes: { … },
|
|
186
|
+
* })
|
|
187
|
+
* ```
|
|
188
|
+
*
|
|
189
|
+
* Resolution chain (most specific → fallback):
|
|
190
|
+
*
|
|
191
|
+
* 1. `dashboard.enabled === false` → model is hidden from the sidebar
|
|
192
|
+
* entirely. The dynamic ORM viewer (`/models/<id>`) still works for
|
|
193
|
+
* direct navigation, but the row is suppressed.
|
|
194
|
+
* 2. `dashboard.section` → pins the model to that section, overriding
|
|
195
|
+
* the path-based auto-categorisation (commerce/, Content/, etc.).
|
|
196
|
+
* 3. `dashboard.label` / `dashboard.icon` → display overrides; fall back
|
|
197
|
+
* to the model name and `iconMap` lookup.
|
|
198
|
+
* 4. `dashboard.roles` → role-gates the sidebar row AND the API the
|
|
199
|
+
* `useApi` trait generates. The sidebar builder emits the row with role
|
|
200
|
+
* metadata and the client filters it out for users who lack a matching
|
|
201
|
+
* role, permissively by default (unauthenticated viewers see everything -
|
|
202
|
+
* see `useRole.ts`); the route generator appends `role:<the list>` to the
|
|
203
|
+
* resolved middleware, which `dashboard.enforce: false` opts out of
|
|
204
|
+
* (stacksjs/stacks#2883).
|
|
205
|
+
*/
|
|
206
|
+
/** A write the dashboard can make to a model's rows, in the `useApi` route vocabulary. */
|
|
207
|
+
export type DashboardModelWrite = 'store' | 'update' | 'destroy';
|
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
* Third-party stack authors: submit a PR to add your stack here.
|
|
5
5
|
* Once merged, all Stacks users will get autocomplete for your stack name.
|
|
6
6
|
*/
|
|
7
|
-
export declare const stackExtensionRegistry: Record<string, StackRegistryEntry
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* All known stack extension names, derived from the registry.
|
|
11
|
-
* Uses `(string & {})` to also accept any custom/unregistered stack name.
|
|
12
|
-
*/
|
|
13
|
-
export type KnownStackName = keyof typeof stackExtensionRegistry | (string & {});
|
|
7
|
+
export declare const stackExtensionRegistry: Record<string, StackRegistryEntry>;
|
|
14
8
|
// ─── Stack Extensions Registry ──────────────────────────────────────────────
|
|
15
9
|
//
|
|
16
10
|
// This is the central registry of known stack extensions. Third-party authors
|
|
@@ -152,6 +146,11 @@ export type StackDirectory = | 'app'
|
|
|
152
146
|
| 'locales'
|
|
153
147
|
| 'docs'
|
|
154
148
|
| (string & {});
|
|
149
|
+
/**
|
|
150
|
+
* All known stack extension names, derived from the registry.
|
|
151
|
+
* Uses `(string & {})` to also accept any custom/unregistered stack name.
|
|
152
|
+
*/
|
|
153
|
+
export type KnownStackName = keyof typeof stackExtensionRegistry | (string & {});
|
|
155
154
|
export type ConflictStrategy = 'skip' | 'overwrite' | 'backup';
|
|
156
155
|
/**
|
|
157
156
|
* The registry type for `config/stacks.ts`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.75.
|
|
4
|
+
"version": "0.75.541",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@stacksjs/bunpress": "^0.2.15",
|
|
66
66
|
"@stacksjs/clapp": "^0.2.12",
|
|
67
|
-
"@stacksjs/events": "0.75.
|
|
68
|
-
"@stacksjs/strings": "0.75.
|
|
69
|
-
"@stacksjs/stx": "0.2.842",
|
|
67
|
+
"@stacksjs/events": "0.75.541",
|
|
68
|
+
"@stacksjs/strings": "0.75.541",
|
|
69
|
+
"@stacksjs/stx": "^0.2.842",
|
|
70
70
|
"@stacksjs/ts-validation": "^0.5.7",
|
|
71
71
|
"bun-query-builder": "^0.3.44"
|
|
72
72
|
},
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@stacksjs/validation": "0.75.
|
|
86
|
+
"@stacksjs/validation": "0.75.541",
|
|
87
87
|
"better-dx": "^0.2.24",
|
|
88
88
|
"meilisearch": "^0.62.0",
|
|
89
89
|
"stripe": "23.0.0"
|