@stacksjs/types 0.75.725 → 0.75.730

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.
@@ -0,0 +1,54 @@
1
+ /** A user the debugbar's "Sign in as" tab offers. */
2
+ export declare interface DebugbarUser {
3
+ id: number | string
4
+ name: string
5
+ email?: string
6
+ badge?: string
7
+ description?: string
8
+ }
9
+ export declare interface DebugbarQueriesConfig {
10
+ slowThresholdMs?: number
11
+ nPlusOneThreshold?: number
12
+ backtrace?: boolean
13
+ maxQueries?: number
14
+ }
15
+ export declare interface DebugbarSignInAsConfig {
16
+ enabled?: boolean
17
+ users?: () => DebugbarUser[] | Promise<DebugbarUser[]>
18
+ tokenStorageKey?: string
19
+ }
20
+ /**
21
+ * Configuration for `@stacksjs/debugbar`.
22
+ *
23
+ * Nothing here can turn the debugbar on in production: when the app
24
+ * environment is `production` the package registers nothing, whatever this
25
+ * says.
26
+ */
27
+ export declare interface DebugbarConfig {
28
+ enabled?: boolean
29
+ allowRemote?: boolean
30
+ storage?: {
31
+ path?: string
32
+ maxRequests?: number
33
+ }
34
+ except?: string[]
35
+ collectors?: Partial<Record<DebugbarCollectorName, boolean>>
36
+ queries?: DebugbarQueriesConfig
37
+ shortcut?: string | false
38
+ signInAs?: DebugbarSignInAsConfig
39
+ }
40
+ /** The sections a request record is made of. Each can be switched off. */
41
+ export type DebugbarCollectorName = | 'request'
42
+ | 'route'
43
+ | 'timeline'
44
+ | 'queries'
45
+ | 'views'
46
+ | 'messages'
47
+ | 'logs'
48
+ | 'exceptions'
49
+ | 'events'
50
+ | 'cache'
51
+ | 'mail'
52
+ | 'jobs'
53
+ | 'auth'
54
+ | 'environment';
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from './configure';
23
23
  export * from './cors';
24
24
  export * from './cron-jobs';
25
25
  export * from './dashboard';
26
+ export * from './debugbar';
26
27
  // Module-augments bun-query-builder's BrowserModelDefinition with the
27
28
  // stacks `dashboard` slot. Importing this file (transitively via the
28
29
  // barrel) is what makes `defineModel({ dashboard: {...} })` typecheck.
@@ -47,6 +48,7 @@ export * from './images';
47
48
  export * from './library';
48
49
  export * from './lint';
49
50
  export * from './logging';
51
+ export * from './malware';
50
52
  export * from './manifest';
51
53
  export * from './marketing';
52
54
  export * from './model';
@@ -0,0 +1,62 @@
1
+ export declare interface MalwareScanResult {
2
+ verdict: MalwareVerdict
3
+ signature?: string
4
+ containerPath?: string
5
+ durationMs: number
6
+ driver: string
7
+ bytes?: number
8
+ error?: string
9
+ }
10
+ export declare interface MalwareClamdConfig {
11
+ socket?: string
12
+ host?: string
13
+ port?: number
14
+ }
15
+ export declare interface MalwareGuardianConfig {
16
+ socket?: string
17
+ library?: string
18
+ }
19
+ export declare interface MalwareQuarantineConfig {
20
+ enabled?: boolean
21
+ path?: string
22
+ }
23
+ export declare interface MalwareStagingConfig {
24
+ prefix?: string
25
+ }
26
+ export declare interface MalwareConfig {
27
+ driver: MalwareDriverName
28
+ failClosed?: boolean
29
+ maxScanBytes?: number
30
+ timeoutMs?: number
31
+ clamd?: MalwareClamdConfig
32
+ guardian?: MalwareGuardianConfig
33
+ quarantine?: MalwareQuarantineConfig
34
+ staging?: MalwareStagingConfig
35
+ surfaces?: Partial<Record<MalwareSurface, boolean>>
36
+ }
37
+ /**
38
+ * Malware scanning (`@stacksjs/malware`).
39
+ *
40
+ * One `scan()` call, one `config/malware.ts`, pluggable drivers. Every
41
+ * framework surface that persists bytes from outside (storage, forms,
42
+ * email, AI ingestion, the file manager, validation) asks this package
43
+ * for a verdict before it writes.
44
+ */
45
+ /** What a scan concluded. `error` means the scanner could not answer. */
46
+ export type MalwareVerdict = 'clean' | 'infected' | 'suspicious' | 'error';
47
+ /**
48
+ * Scanner drivers.
49
+ *
50
+ * - `auto`: use a reachable zavd or clamd socket when one exists, and fall
51
+ * back to `none` (with a warning logged once) when none is found
52
+ * - `guardian`: the Guardian engine in process through `@zig-utils/anti-virus`,
53
+ * falling back to the zavd socket
54
+ * - `clamd`: the clamd wire protocol over a Unix socket or TCP; covers clamd
55
+ * and zavd endpoints alike
56
+ * - `eicar`: detects only the EICAR test signature, for test suites and local
57
+ * development without a daemon
58
+ * - `none`: always clean, logged once so a disabled scanner is visible
59
+ */
60
+ export type MalwareDriverName = 'auto' | 'guardian' | 'clamd' | 'eicar' | 'none';
61
+ /** The framework surfaces that can scan, each switchable on its own. */
62
+ export type MalwareSurface = 'storage' | 'forms' | 'email' | 'ai' | 'fileManager' | 'validation';
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, FormsConfig, SitesConfig, SmsConfig, SocialsConfig, SecurityConfig, ServerConfig, ServicesConfig, Team, UiConfig } from './index';
1
+ import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, CmsConfig, CommerceConfig, CorsConfig, DashboardConfig, DatabaseConfig, DebugbarConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FeatureFlagsConfig, FilesystemsConfig, GitConfig, HashingConfig, ImagesConfig, LibraryConfig, LoggingConfig, MalwareConfig, MarketingConfig, MonitoringConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, FormsConfig, SitesConfig, SmsConfig, SocialsConfig, SecurityConfig, ServerConfig, ServicesConfig, Team, UiConfig } from './index';
2
2
  /**
3
3
  * **Stacks Options**
4
4
  *
@@ -20,10 +20,12 @@ export declare interface StacksOptions {
20
20
  commerce: CommerceConfig
21
21
  dashboard: DashboardConfig
22
22
  database: DatabaseConfig
23
+ debugbar: DebugbarConfig
23
24
  dns: DnsConfig
24
25
  docs: DocsConfig
25
26
  email: EmailConfig
26
27
  featureFlags: FeatureFlagsConfig
28
+ malware: MalwareConfig
27
29
  errors: ErrorConfig
28
30
  git: GitConfig
29
31
  hashing: HashingConfig
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.75.725",
4
+ "version": "0.75.730",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -68,10 +68,10 @@
68
68
  "prepublishOnly": "bun run build"
69
69
  },
70
70
  "dependencies": {
71
- "@stacksjs/bunpress": "^0.2.35",
71
+ "@stacksjs/bunpress": "^0.2.36",
72
72
  "@stacksjs/clapp": "^0.2.17",
73
- "@stacksjs/events": "0.75.725",
74
- "@stacksjs/strings": "0.75.725",
73
+ "@stacksjs/events": "0.75.730",
74
+ "@stacksjs/strings": "0.75.730",
75
75
  "@stacksjs/stx": "^0.2.960",
76
76
  "@stacksjs/ts-validation": "^0.5.7",
77
77
  "bun-query-builder": "^0.6.4",
@@ -79,7 +79,7 @@
79
79
  "stripe": "23.0.0"
80
80
  },
81
81
  "devDependencies": {
82
- "@stacksjs/validation": "0.75.725",
82
+ "@stacksjs/validation": "0.75.730",
83
83
  "better-dx": "^0.2.39"
84
84
  },
85
85
  "sideEffects": false,
@@ -111,7 +111,7 @@
111
111
  }
112
112
  },
113
113
  "peerDependencies": {
114
- "@stacksjs/actions": "0.75.725",
115
- "@stacksjs/scheduler": "0.75.725"
114
+ "@stacksjs/actions": "0.75.730",
115
+ "@stacksjs/scheduler": "0.75.730"
116
116
  }
117
117
  }