@stacksjs/types 0.70.88 → 0.70.90

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.
Files changed (77) hide show
  1. package/dist/ai.d.ts +37 -0
  2. package/dist/analytics.d.ts +36 -0
  3. package/dist/api.d.ts +26 -0
  4. package/dist/app.d.ts +28 -0
  5. package/dist/attributes.d.ts +1 -0
  6. package/dist/auth.d.ts +62 -0
  7. package/dist/auto-imports.d.ts +8 -0
  8. package/dist/binary.d.ts +11 -0
  9. package/dist/cache.d.ts +88 -0
  10. package/dist/cdn.d.ts +4 -0
  11. package/dist/chat.d.ts +69 -0
  12. package/dist/cli.d.ts +316 -0
  13. package/dist/cloud.d.ts +366 -0
  14. package/dist/cms.d.ts +12 -0
  15. package/dist/commerce.d.ts +14 -0
  16. package/dist/components.d.ts +9 -0
  17. package/dist/configure.d.ts +12 -0
  18. package/dist/cors.d.ts +47 -0
  19. package/dist/cron-jobs.d.ts +61 -0
  20. package/dist/dashboard.d.ts +108 -0
  21. package/dist/database.d.ts +76 -0
  22. package/dist/dependencies.d.ts +17 -0
  23. package/dist/deploy.d.ts +16 -0
  24. package/dist/dns.d.ts +362 -0
  25. package/dist/docs.d.ts +23 -0
  26. package/dist/email.d.ts +207 -0
  27. package/dist/env.d.ts +1 -0
  28. package/dist/errors.d.ts +84 -0
  29. package/dist/events.d.ts +31 -0
  30. package/dist/exit-code.d.ts +10 -0
  31. package/dist/feature-flags.d.ts +17 -0
  32. package/dist/file-systems.d.ts +60 -0
  33. package/dist/git.d.ts +60 -0
  34. package/dist/hashing.d.ts +57 -0
  35. package/dist/helpers.d.ts +1 -0
  36. package/dist/i18n.d.ts +65 -0
  37. package/dist/index.d.ts +80 -0
  38. package/dist/index.js +2 -0
  39. package/dist/library.d.ts +799 -0
  40. package/dist/logging.d.ts +15 -0
  41. package/dist/manifest.d.ts +9 -0
  42. package/dist/marketing.d.ts +12 -0
  43. package/dist/model-dashboard-augmentation.d.ts +8 -0
  44. package/dist/model-names.d.ts +1 -0
  45. package/dist/model.d.ts +256 -0
  46. package/dist/monitoring.d.ts +12 -0
  47. package/dist/notifications.d.ts +126 -0
  48. package/dist/oauth.d.ts +290 -0
  49. package/dist/pages.d.ts +10 -0
  50. package/dist/payments.d.ts +322 -0
  51. package/dist/phone.d.ts +65 -0
  52. package/dist/ports.d.ts +20 -0
  53. package/dist/promise.d.ts +1 -0
  54. package/dist/push.d.ts +108 -0
  55. package/dist/queue.d.ts +312 -0
  56. package/dist/reactivity.d.ts +1 -0
  57. package/dist/realtime.d.ts +443 -0
  58. package/dist/request.d.ts +265 -0
  59. package/dist/response.d.ts +15 -0
  60. package/dist/router.d.ts +105 -0
  61. package/dist/saas.d.ts +32 -0
  62. package/dist/scheduler.d.ts +1 -0
  63. package/dist/search-engine.d.ts +129 -0
  64. package/dist/security.d.ts +18 -0
  65. package/dist/server.d.ts +16 -0
  66. package/dist/services.d.ts +149 -0
  67. package/dist/settings-config.d.ts +9 -0
  68. package/dist/sms.d.ts +144 -0
  69. package/dist/stack-extensions.d.ts +137 -0
  70. package/dist/stacks.d.ts +46 -0
  71. package/dist/storage.d.ts +104 -0
  72. package/dist/table-names.d.ts +1 -0
  73. package/dist/tables.d.ts +34 -0
  74. package/dist/team.d.ts +7 -0
  75. package/dist/ui.d.ts +55 -0
  76. package/dist/utils.d.ts +39 -0
  77. package/package.json +3 -3
@@ -0,0 +1,137 @@
1
+ /**
2
+ * The central registry of known stack extensions.
3
+ *
4
+ * Third-party stack authors: submit a PR to add your stack here.
5
+ * Once merged, all Stacks users will get autocomplete for your stack name.
6
+ */
7
+ export declare const stackExtensionRegistry: Record<string, StackRegistryEntry>;
8
+ // ─── Stack Extensions Registry ──────────────────────────────────────────────
9
+ //
10
+ // This is the central registry of known stack extensions. Third-party authors
11
+ // can submit a PR to add their stack here. Once merged, all Stacks users get
12
+ // autocomplete and type safety for the new stack name.
13
+ //
14
+ // To add your stack, add a new entry below following the pattern:
15
+ // 'your-stack-name': { package: '@your-org/your-stack', description: '...' },
16
+ //
17
+ // Requirements for PRs:
18
+ // - The package must be published to npm
19
+ // - The package.json must contain a valid `stacks` field with a `name`
20
+ // - The description should be concise (under 80 chars)
21
+ // ─────────────────────────────────────────────────────────────────────────────
22
+ declare interface StackRegistryEntry {
23
+ package: string
24
+ description: string
25
+ github?: string
26
+ }
27
+ /**
28
+ * Metadata for a stack extension, defined in the `stacks` field of a stack's package.json.
29
+ *
30
+ * @example
31
+ * ```json
32
+ * {
33
+ * "name": "@stacksjs/blog",
34
+ * "stacks": {
35
+ * "name": "blog",
36
+ * "description": "Blog functionality for Stacks",
37
+ * "directories": ["app", "config", "database", "resources"]
38
+ * }
39
+ * }
40
+ * ```
41
+ */
42
+ export declare interface StackMeta {
43
+ name: KnownStackName
44
+ description?: string
45
+ version?: string
46
+ directories?: StackDirectory[]
47
+ hooks?: {
48
+ preInstall?: string
49
+ postInstall?: string
50
+ preUninstall?: string
51
+ postUninstall?: string
52
+ }
53
+ }
54
+ /** Tracks a single installed stack in the lock file */
55
+ export declare interface StackManifestEntry {
56
+ packageName: string
57
+ name: string
58
+ version: string
59
+ installedAt: string
60
+ files: string[]
61
+ skipped: string[]
62
+ conflictStrategy: ConflictStrategy
63
+ }
64
+ /** The stacks.lock.json file format */
65
+ export declare interface StackLock {
66
+ version: 1
67
+ generatedAt: string
68
+ stacks: Record<string, StackManifestEntry>
69
+ }
70
+ export declare interface StackInstallOptions {
71
+ name: KnownStackName
72
+ conflict?: ConflictStrategy
73
+ force?: boolean
74
+ dryRun?: boolean
75
+ verbose?: boolean
76
+ }
77
+ export declare interface StackUninstallOptions {
78
+ name: KnownStackName
79
+ force?: boolean
80
+ verbose?: boolean
81
+ }
82
+ /** Display format for the `stack:list` command */
83
+ export declare interface StackListEntry {
84
+ name: string
85
+ packageName: string
86
+ version: string
87
+ description?: string
88
+ installed: boolean
89
+ installedAt?: string
90
+ fileCount?: number
91
+ }
92
+ /**
93
+ * A stack extension entry in the registry (`config/stacks.ts`).
94
+ *
95
+ * Can be either:
96
+ * - A string (the stack name or package name)
97
+ * - A full object with name, URL, and GitHub repository
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * export default [
102
+ * 'blog', // shorthand — autocomplete from registry
103
+ * '@stacksjs/commerce', // scoped package shorthand
104
+ * { name: 'analytics', github: 'stacksjs/analytics-stack' },
105
+ * ] satisfies StackExtensionRegistry
106
+ * ```
107
+ */
108
+ export declare interface StackExtensionEntry {
109
+ name: KnownStackName
110
+ url?: string
111
+ github?: string
112
+ package?: string
113
+ }
114
+ /**
115
+ * Known top-level directories in a Stacks project that a stack extension can provide.
116
+ * Uses `(string & {})` to allow custom directories while still providing autocomplete.
117
+ */
118
+ export type StackDirectory = | 'app'
119
+ | 'config'
120
+ | 'database'
121
+ | 'resources'
122
+ | 'routes'
123
+ | 'public'
124
+ | 'locales'
125
+ | 'docs'
126
+ | (string & {});
127
+ /**
128
+ * All known stack extension names, derived from the registry.
129
+ * Uses `(string & {})` to also accept any custom/unregistered stack name.
130
+ */
131
+ export type KnownStackName = keyof typeof stackExtensionRegistry | (string & {});
132
+ export type ConflictStrategy = 'skip' | 'overwrite' | 'backup';
133
+ /**
134
+ * The registry type for `config/stacks.ts`.
135
+ * Accepts both string shorthands and full objects.
136
+ */
137
+ export type StackExtensionRegistry = (KnownStackName | StackExtensionEntry)[];
@@ -0,0 +1,46 @@
1
+ import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, CmsConfig, CommerceConfig, CorsConfig, DashboardConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FeatureFlagsConfig, FilesystemsConfig, GitConfig, HashingConfig, LibraryConfig, LoggingConfig, MarketingConfig, MonitoringConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, Team, UiConfig } from '.';
2
+ /**
3
+ * **Stacks Options**
4
+ *
5
+ * This configuration defines all of your Stacks options. Because Stacks is fully-typed,
6
+ * you may hover any of the options below and the definitions will be provided. In case
7
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
8
+ */
9
+ export declare interface StacksOptions {
10
+ ai: AiConfig
11
+ analytics: AnalyticsConfig
12
+ app: AppConfig
13
+ auth: AuthConfig
14
+ cors?: CorsConfig
15
+ realtime: RealtimeConfig
16
+ cache: CacheConfig
17
+ cli: BinaryConfig
18
+ cloud: CloudConfig
19
+ cms: CmsConfig
20
+ commerce: CommerceConfig
21
+ dashboard: DashboardConfig
22
+ database: DatabaseConfig
23
+ dns: DnsConfig
24
+ docs: DocsConfig
25
+ email: EmailConfig
26
+ featureFlags: FeatureFlagsConfig
27
+ errors: ErrorConfig
28
+ git: GitConfig
29
+ hashing: HashingConfig
30
+ library: LibraryConfig
31
+ logging: LoggingConfig
32
+ marketing: MarketingConfig
33
+ monitoring: MonitoringConfig
34
+ notification: NotificationConfig
35
+ payment: PaymentConfig
36
+ ports: Ports
37
+ queue: QueueConfig
38
+ saas: SaasConfig
39
+ security: SecurityConfig
40
+ searchEngine: SearchEngineConfig
41
+ services: ServicesConfig
42
+ filesystems: FilesystemsConfig
43
+ team: Team
44
+ ui: UiConfig
45
+ }
46
+ export type StacksConfig = Partial<StacksOptions>;
@@ -0,0 +1,104 @@
1
+ import type { Buffer } from 'node:buffer';
2
+ /**
3
+ * File stat entry information
4
+ */
5
+ export declare interface StatEntry {
6
+ path: string
7
+ type: 'file' | 'directory'
8
+ visibility: Visibility
9
+ size: number
10
+ lastModified: number
11
+ mimeType?: string
12
+ metadata?: Record<string, any>
13
+ }
14
+ /**
15
+ * Directory listing entry
16
+ */
17
+ export declare interface DirectoryEntry {
18
+ path: string
19
+ type: 'file' | 'directory'
20
+ }
21
+ /**
22
+ * Directory listing iterator
23
+ */
24
+ export declare interface DirectoryListing extends AsyncIterable<DirectoryEntry> {
25
+ [Symbol.asyncIterator](): AsyncIterator<DirectoryEntry>
26
+ }
27
+ /**
28
+ * Options for generating public URLs
29
+ */
30
+ export declare interface PublicUrlOptions {
31
+ domain?: string
32
+ }
33
+ /**
34
+ * Options for generating temporary URLs
35
+ */
36
+ export declare interface TemporaryUrlOptions {
37
+ expiresIn: number | Date
38
+ }
39
+ /**
40
+ * Checksum algorithm options
41
+ */
42
+ export declare interface ChecksumOptions {
43
+ algorithm?: 'md5' | 'sha1' | 'sha256'
44
+ }
45
+ /**
46
+ * MIME type detection options
47
+ */
48
+ export declare interface MimeTypeOptions {
49
+ useExtension?: boolean
50
+ }
51
+ export declare interface StorageOptions {
52
+ driver: 's3' | 'efs' | 'local' | 'bun' | 'memory'
53
+ root?: string
54
+ s3?: {
55
+ bucket: string
56
+ region?: string
57
+ prefix?: string
58
+ credentials?: {
59
+ accessKeyId: string
60
+ secretAccessKey: string
61
+ }
62
+ endpoint?: string
63
+ }
64
+ publicUrl?: {
65
+ domain?: string
66
+ }
67
+ defaultVisibility?: Visibility
68
+ }
69
+ export declare interface StorageDriver {
70
+ list: (path: string, options?: any) => DirectoryListing
71
+ changeVisibility: (path: string, visibility: Visibility) => Promise<void>
72
+ visibility: (path: string) => Promise<Visibility>
73
+ fileExists: (path: string) => Promise<boolean>
74
+ directoryExists: (path: string) => Promise<boolean>
75
+ publicUrl: (path: string, options: PublicUrlOptions) => Promise<string>
76
+ temporaryUrl: (path: string, options: TemporaryUrlOptions) => Promise<string>
77
+ checksum: (path: string, options: ChecksumOptions) => Promise<string>
78
+ mimeType: (path: string, options: MimeTypeOptions) => Promise<string>
79
+ lastModified: (path: string) => Promise<number>
80
+ fileSize: (path: string) => Promise<number>
81
+ read: (path: string) => Promise<FileContents>
82
+ readToString: (path: string) => Promise<string>
83
+ readToBuffer: (path: string) => Promise<Buffer>
84
+ readToUint8Array: (path: string) => Promise<Uint8Array>
85
+ deleteFile: (path: string) => Promise<void>
86
+ copyFile: (from: string, to: string) => Promise<void>
87
+ moveFile: (from: string, to: string) => Promise<void>
88
+ stat: (path: string) => Promise<StatEntry>
89
+ createDirectory: (path: string) => Promise<void>
90
+ write: (path: string, contents: FileContents) => Promise<void>
91
+ }
92
+ /**
93
+ * File contents can be a string, Buffer, Uint8Array, or ReadableStream
94
+ */
95
+ export type FileContents = string | Buffer | Uint8Array | ReadableStream;
96
+ /**
97
+ * Visibility options for files
98
+ */
99
+ export type Visibility = 'public' | 'private';
100
+ export type StorageConfig = Partial<StorageOptions>;
101
+ /**
102
+ * Filesystem configuration (Laravel-style alias)
103
+ */
104
+ export type FilesystemsConfig = StorageConfig;
@@ -0,0 +1 @@
1
+ export type TableNames = 'tags' | 'taggables' | 'categorizables' | 'comments' | 'commentables' | 'commentable_upvotes' | 'passkeys' | 'password_resets' | 'query_logs' | 'migrations' | 'tags' | 'payment_products' | 'failed_jobs' | 'social_posts' | 'payment_methods' | 'campaigns' | 'payment_transactions' | 'requests' | 'activities' | 'email_lists' | 'notifications' | 'jobs' | 'logs' | 'subscriptions' | 'errors' | 'comments' | 'users' | 'websockets' | 'pages' | 'authors' | 'posts' | 'print_devices' | 'categories' | 'payments' | 'drivers' | 'waitlist_products' | 'digital_deliveries' | 'manufacturers' | 'order_items' | 'shipping_zones' | 'customers' | 'products' | 'receipts' | 'product_variants' | 'license_keys' | 'waitlist_restaurants' | 'reviews' | 'product_units' | 'gift_cards' | 'orders' | 'coupons' | 'tax_rates' | 'transactions' | 'loyalty_points' | 'loyalty_rewards' | 'shipping_methods' | 'shipping_rates' | 'carts' | 'delivery_routes' | 'cart_items' | 'subscribers' | 'subscriber_emails';
@@ -0,0 +1,34 @@
1
+ import type { Hits, SearchResponse } from 'meilisearch';
2
+ /**
3
+ * the TableStore interface is primarily used to unify the persisting of data to localStorage
4
+ */
5
+ export declare interface TableStore {
6
+ index: string
7
+ results?: SearchResponse<Record<string, any>>
8
+ hits?: Hits
9
+ columns: string[]
10
+ source?: string
11
+ password?: string
12
+ searchable?: string | boolean
13
+ query?: string
14
+ sortable?: string | boolean
15
+ sort?: string
16
+ sorts?: string | string[]
17
+ filterable?: string | boolean
18
+ filters?: string | string[]
19
+ filterValue?: any[]
20
+ actionable?: string | boolean
21
+ actions?: string | string[]
22
+ perPage: number
23
+ selectable?: string | boolean
24
+ selectedRows?: number[] | string[]
25
+ selectedAll?: boolean
26
+ goToNextPage: number
27
+ goToPage: number
28
+ goToPrevPage: number
29
+ lastPageNumber: number
30
+ searchFilters?: object
31
+ searchParams?: object
32
+ setTotalHits: number
33
+ currentPage: number
34
+ }
package/dist/team.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare interface Team {
2
+ name: string
3
+ members?: TeamMembers
4
+ }
5
+ declare type TeamMemberName = string;
6
+ declare type Email = string;
7
+ declare type TeamMembers = Record<TeamMemberName, Email>;
package/dist/ui.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ // Local mirror of crosswind's `Options` shape so we don't bring crosswind
2
+ // into @stacksjs/types as a hard dependency. Apps that import these types
3
+ // only need the structural surface (shortcuts/theme/variants); when full
4
+ // crosswind type fidelity is needed, projects can import directly from
5
+ // `crosswind`.
6
+ declare interface CrosswindOptions {
7
+ shortcuts?: unknown
8
+ theme?: unknown
9
+ variants?: unknown
10
+ [key: string]: unknown
11
+ }
12
+ export declare interface FontInfo {
13
+ title: string
14
+ text: string
15
+ }
16
+ export declare interface WebFontMeta {
17
+ name: string
18
+ weights?: (string | number)[]
19
+ italic?: boolean
20
+ provider?: WebFontsProviders
21
+ }
22
+ /**
23
+ * **UI Engine Options**
24
+ *
25
+ * This type defines all of your UI Engine options. Because Stacks is fully-typed, you may
26
+ * hover any of the options below and the definitions will be provided. In case you
27
+ * have any questions, feel free to reach out via Discord or GitHub Discussions.
28
+ */
29
+ export declare interface UiOptions {
30
+ shortcuts: Shortcuts
31
+ safelist: string
32
+ trigger?: string
33
+ classPrefix?: string
34
+ hashFn?: (str: string) => string
35
+ reset?: ResetPreset
36
+ fonts?: any
37
+ useWebFonts?: boolean | WebFontsProviders
38
+ icons: Icon | Icon[]
39
+ theme: CrosswindOptions['theme']
40
+ variants: CrosswindOptions['variants']
41
+ }
42
+ export type Font = 'inter' | 'mona' | 'hubot';
43
+ export type Icon = 'heroicons' | 'hugeicons';
44
+ export type WebFontsProviders = 'google' | 'bunny' | 'fontshare';
45
+ export type Shortcuts = CrosswindOptions['shortcuts'];
46
+ export type UiConfig = Partial<UiOptions>;
47
+ /**
48
+ * **Style Reset — Preset**
49
+ *
50
+ * This value sets the "reset preset." A preset defines certain
51
+ * CSS defaults to be applied.
52
+ *
53
+ * @default "tailwind"
54
+ */
55
+ export type ResetPreset = 'tailwind' | 'normalize' | 'sanitize' | 'eric-meyer' | 'antfu' | null;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Null or whatever.
3
+ */
4
+ export type Nullable<T> = T | null | undefined;
5
+ /**
6
+ * Function
7
+ */
8
+ export type Fn<T = void> = () => T;
9
+ /**
10
+ * Array, or not yet
11
+ */
12
+ export type Arrayable<T> = T | Array<T>;
13
+ /**
14
+ * Constructor.
15
+ */
16
+ export type Constructor<T = void> = new (..._args: any[]) => T;
17
+ /**
18
+ * Defines an intersection type of all union items.
19
+ *
20
+ * @param U Union of any types that will be intersected.
21
+ * @returns U items intersected
22
+ * @see https://stackoverflow.com/a/50375286/9259330
23
+ */
24
+ export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void
25
+ ? I
26
+ : never;
27
+ export type MergeInsertions<T> = T extends object ? { [K in keyof T]: MergeInsertions<T[K]> } : T;
28
+ export type DeepMerge<F, S> = MergeInsertions<{
29
+ [K in keyof F | keyof S]: K extends keyof S & keyof F
30
+ ? DeepMerge<F[K], S[K]>
31
+ : K extends keyof S
32
+ ? S[K]
33
+ : K extends keyof F
34
+ ? F[K]
35
+ : never
36
+ }>;
37
+ export type DeepPartial<T> = {
38
+ [P in keyof T]?: DeepPartial<T[P]>
39
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.70.88",
4
+ "version": "0.70.90",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -54,7 +54,7 @@
54
54
  "@stacksjs/bunpress": "^0.1.12",
55
55
  "@stacksjs/clapp": "^0.2.10",
56
56
  "@stacksjs/ts-validation": "^0.5.0",
57
- "bun-query-builder": "^0.1.47"
57
+ "bun-query-builder": "^0.1.50"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "meilisearch": "^0.59.0"
@@ -65,7 +65,7 @@
65
65
  }
66
66
  },
67
67
  "devDependencies": {
68
- "@stacksjs/validation": "0.70.88",
68
+ "@stacksjs/validation": "0.70.90",
69
69
  "@types/bun": "^1.3.11",
70
70
  "meilisearch": "^0.59.0",
71
71
  "typescript": "^7.0.2"