@stacksjs/types 0.70.293 → 0.70.296

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/auth.d.ts CHANGED
@@ -1,3 +1,19 @@
1
+ /**
2
+ * The browser cookie that carries a personal access token.
3
+ *
4
+ * One name, in one place. Before stacksjs/stacks#2236 there were two: the
5
+ * writer (`authCookie()`) defaulted to `stacks_auth` while every reader looked
6
+ * for `config.auth.defaultTokenName` (`auth-token`), so a cookie the framework
7
+ * set was never one the framework read.
8
+ */
9
+ export declare interface AuthCookieConfig {
10
+ name?: string
11
+ path?: string
12
+ domain?: string
13
+ maxAge?: number
14
+ secure?: boolean
15
+ sameSite?: 'Strict' | 'Lax' | 'None'
16
+ }
1
17
  export declare interface AuthOptions {
2
18
  enabled?: boolean
3
19
  env?: string[]
@@ -21,6 +37,7 @@ export declare interface AuthOptions {
21
37
  tokenRotation: number
22
38
  defaultAbilities: string[]
23
39
  defaultTokenName: string
40
+ cookie: AuthCookieConfig
24
41
  passwordReset: {
25
42
  expire: number
26
43
  throttle: number
@@ -36,6 +53,9 @@ export declare interface AuthOptions {
36
53
  registration?: {
37
54
  preventEnumeration?: boolean
38
55
  }
56
+ socials?: {
57
+ matching?: 'link' | 'create' | 'refuse'
58
+ }
39
59
  }
40
60
  export declare interface AuthInstance {
41
61
  guard: string
@@ -99,6 +99,9 @@ export declare interface DatabaseOptions {
99
99
  }
100
100
  migrations: string
101
101
  migrationLocks: string
102
+ models?: {
103
+ includeFrameworkDefaults?: boolean
104
+ }
102
105
  reads?: ReadPolicyOptions
103
106
  safety?: {
104
107
  confirmMigrate?: boolean
package/dist/model.d.ts CHANGED
@@ -156,7 +156,7 @@ export declare interface Relations {
156
156
  }
157
157
  export declare interface ApiSettings {
158
158
  uri: string
159
- middleware: string[]
159
+ middleware: ApiMiddleware
160
160
  routes:
161
161
  | {
162
162
  [key in ApiRoutes]: Action
@@ -306,6 +306,25 @@ export type ApiRoutes = 'index' | 'show' | 'store' | 'update' | 'destroy';
306
306
  export type SocialProviders = 'google' | 'github' | 'apple' | 'twitter' | 'facebook';
307
307
  declare type LogAttribute = string;
308
308
  export type SocialOptions = SocialProviders[];
309
+ /**
310
+ * Middleware for the auto-generated REST routes.
311
+ *
312
+ * Omit it and both reads and writes get `auth` — an undeclared read route is
313
+ * how a customer list leaks (stacksjs/stacks#2224). A flat list applies to
314
+ * both sides; the split form states them separately, which is the only way to
315
+ * express the common "public catalog, authenticated writes" shape:
316
+ *
317
+ * ```ts
318
+ * middleware: ['auth'] // both sides
319
+ * middleware: [] // both sides public (warns at boot)
320
+ * middleware: { read: [], write: ['auth'] } // public reads, guarded writes
321
+ * ```
322
+ *
323
+ * An omitted side of the split form falls back to `auth`, not to public.
324
+ */
325
+ export type ApiMiddleware = | string
326
+ | string[]
327
+ | { read?: string | string[], write?: string | string[] }
309
328
  declare type ApiOptions = DeepPartial<ApiSettings>;
310
329
  /**
311
330
  * The attribute VALUES of one model row, as handed to a computed getter or
package/dist/server.d.ts CHANGED
@@ -1,3 +1,29 @@
1
+ /**` prefix, or a mutating verb - which made a plain `GET /health`
2
+ * declared on the API process unreachable, and pushed URL design around an
3
+ * internal deployment detail (stacksjs/stacks#2230).
4
+ *
5
+ * The route table cannot be consulted from the views process: it is registered
6
+ * in the API process, which is a separate process under `buddy dev` and
7
+ * potentially a separate host in production. So the app states it here, the way
8
+ * a Next app states `rewrites()`.
9
+ *
10
+ * Note that stx runs its request hook BEFORE static file serving, so a path
11
+ * listed here shadows a `public/` file of the same name.
12
+ */
13
+ export declare interface ApiProxyOptions {
14
+ prefixes?: string[]
15
+ paths?: string[]
16
+ methods?: string[]
17
+ }
18
+ /**
19
+ * **Server Options** - `config/server.ts`.
20
+ *
21
+ * How the views server behaves in the split views/API topology, shared by
22
+ * `buddy dev` and `buddy serve`.
23
+ */
24
+ export declare interface ServerConfig {
25
+ proxy?: ApiProxyOptions
26
+ }
1
27
  export declare interface ServerOptions {
2
28
  type?:
3
29
  | 'frontend'
package/dist/stacks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, CmsConfig, CommerceConfig, CorsConfig, DashboardConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FeatureFlagsConfig, FilesystemsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, LoggingConfig, MarketingConfig, MonitoringConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, Team, UiConfig } from '.';
1
+ import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, CmsConfig, CommerceConfig, CorsConfig, DashboardConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FeatureFlagsConfig, FilesystemsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, LoggingConfig, MarketingConfig, MonitoringConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, SecurityConfig, ServerConfig, ServicesConfig, Team, UiConfig } from '.';
2
2
  /**
3
3
  * **Stacks Options**
4
4
  *
@@ -39,6 +39,7 @@ export declare interface StacksOptions {
39
39
  saas: SaasConfig
40
40
  security: SecurityConfig
41
41
  searchEngine: SearchEngineConfig
42
+ server: ServerConfig
42
43
  services: ServicesConfig
43
44
  filesystems: FilesystemsConfig
44
45
  team: Team
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.70.293",
4
+ "version": "0.70.296",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -71,7 +71,7 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "@stacksjs/validation": "0.70.293",
74
+ "@stacksjs/validation": "0.70.296",
75
75
  "better-dx": "^0.2.17",
76
76
  "meilisearch": "^0.59.0"
77
77
  },