@stacksjs/types 0.70.23 → 0.70.25

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 (161) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/src/ai.d.ts +37 -0
  3. package/dist/src/analytics.d.ts +36 -0
  4. package/dist/src/api.d.ts +26 -0
  5. package/dist/src/app.d.ts +28 -0
  6. package/dist/src/attributes.d.ts +1 -0
  7. package/dist/src/auth.d.ts +49 -0
  8. package/dist/src/auto-imports.d.ts +8 -0
  9. package/dist/{binary.d.ts → src/binary.d.ts} +4 -1
  10. package/dist/src/cache.d.ts +79 -0
  11. package/dist/{cdn.d.ts → src/cdn.d.ts} +1 -1
  12. package/dist/{chat.d.ts → src/chat.d.ts} +29 -48
  13. package/dist/src/cli.d.ts +308 -0
  14. package/dist/{cloud.d.ts → src/cloud.d.ts} +81 -26
  15. package/dist/{components.d.ts → src/components.d.ts} +1 -4
  16. package/dist/{configure.d.ts → src/configure.d.ts} +1 -1
  17. package/dist/{cron-jobs.d.ts → src/cron-jobs.d.ts} +33 -37
  18. package/dist/src/dashboard.d.ts +33 -0
  19. package/dist/{database.d.ts → src/database.d.ts} +20 -12
  20. package/dist/src/dependencies.d.ts +17 -0
  21. package/dist/src/deploy.d.ts +16 -0
  22. package/dist/{dns.d.ts → src/dns.d.ts} +59 -59
  23. package/dist/src/docs.d.ts +23 -0
  24. package/dist/src/email.d.ts +201 -0
  25. package/dist/src/env.d.ts +1 -0
  26. package/dist/{errors.d.ts → src/errors.d.ts} +17 -24
  27. package/dist/src/events.d.ts +31 -0
  28. package/dist/src/exit-code.d.ts +10 -0
  29. package/dist/{file-systems.d.ts → src/file-systems.d.ts} +10 -6
  30. package/dist/{git.d.ts → src/git.d.ts} +9 -6
  31. package/dist/src/hashing.d.ts +57 -0
  32. package/dist/src/helpers.d.ts +1 -0
  33. package/dist/src/i18n.d.ts +65 -0
  34. package/dist/src/index.d.ts +70 -0
  35. package/dist/{library.d.ts → src/library.d.ts} +31 -33
  36. package/dist/src/logging.d.ts +12 -0
  37. package/dist/{manifest.d.ts → src/manifest.d.ts} +4 -1
  38. package/dist/src/model-names.d.ts +1 -0
  39. package/dist/src/model.d.ts +251 -0
  40. package/dist/{notifications.d.ts → src/notifications.d.ts} +1 -26
  41. package/dist/src/oauth.d.ts +290 -0
  42. package/dist/{pages.d.ts → src/pages.d.ts} +1 -1
  43. package/dist/src/payments.d.ts +322 -0
  44. package/dist/src/phone.d.ts +52 -0
  45. package/dist/src/ports.d.ts +20 -0
  46. package/dist/src/promise.d.ts +1 -0
  47. package/dist/src/push.d.ts +108 -0
  48. package/dist/src/queue.d.ts +310 -0
  49. package/dist/src/reactivity.d.ts +1 -0
  50. package/dist/src/realtime.d.ts +443 -0
  51. package/dist/src/request.d.ts +154 -0
  52. package/dist/{response.d.ts → src/response.d.ts} +1 -1
  53. package/dist/src/router.d.ts +105 -0
  54. package/dist/{saas.d.ts → src/saas.d.ts} +2 -2
  55. package/dist/src/scheduler.d.ts +1 -0
  56. package/dist/{search-engine.d.ts → src/search-engine.d.ts} +41 -45
  57. package/dist/{security.d.ts → src/security.d.ts} +4 -8
  58. package/dist/{server.d.ts → src/server.d.ts} +1 -1
  59. package/dist/src/services.d.ts +140 -0
  60. package/dist/{settings-config.d.ts → src/settings-config.d.ts} +1 -1
  61. package/dist/src/sms.d.ts +144 -0
  62. package/dist/src/stack-extensions.d.ts +137 -0
  63. package/dist/src/stacks.d.ts +40 -0
  64. package/dist/src/storage.d.ts +105 -0
  65. package/dist/src/table-names.d.ts +1 -0
  66. package/dist/src/tables.d.ts +34 -0
  67. package/dist/src/team.d.ts +7 -0
  68. package/dist/src/ui.d.ts +55 -0
  69. package/dist/src/utils.d.ts +39 -0
  70. package/package.json +13 -32
  71. package/src/ai.ts +20 -6
  72. package/src/analytics.ts +38 -1
  73. package/src/app.ts +38 -0
  74. package/src/attributes.ts +5 -1
  75. package/src/auth.ts +122 -0
  76. package/src/auto-imports.ts +8 -1
  77. package/src/cache.ts +226 -69
  78. package/src/chat.ts +0 -20
  79. package/src/cli.ts +24 -9
  80. package/src/cloud.ts +40 -1
  81. package/src/components.ts +3 -5
  82. package/src/cron-jobs.ts +1 -1
  83. package/src/dashboard.ts +40 -0
  84. package/src/database.ts +18 -2
  85. package/src/dns.ts +1 -1
  86. package/src/docs.ts +3 -3
  87. package/src/email.ts +303 -13
  88. package/src/errors.ts +2 -3
  89. package/src/events.ts +10 -5
  90. package/src/git.ts +3 -3
  91. package/src/hashing.ts +15 -19
  92. package/src/i18n.ts +105 -3
  93. package/src/index.ts +9 -5
  94. package/src/library.ts +0 -5
  95. package/src/model-names.ts +1 -1
  96. package/src/model.ts +87 -10
  97. package/src/oauth.ts +488 -0
  98. package/src/payments.ts +370 -27
  99. package/src/phone.ts +62 -0
  100. package/src/push.ts +107 -0
  101. package/src/queue.ts +386 -28
  102. package/src/reactivity.ts +1 -1
  103. package/src/realtime.ts +584 -0
  104. package/src/request.ts +344 -22
  105. package/src/router.ts +62 -4
  106. package/src/search-engine.ts +13 -13
  107. package/src/services.ts +100 -5
  108. package/src/sms.ts +263 -3
  109. package/src/stack-extensions.ts +184 -0
  110. package/src/stacks.ts +34 -4
  111. package/src/storage.ts +140 -6
  112. package/src/table-names.ts +1 -1
  113. package/src/ui.ts +20 -12
  114. package/src/utils.ts +1 -1
  115. package/dist/ai.d.ts +0 -20
  116. package/dist/analytics.d.ts +0 -13
  117. package/dist/api.d.ts +0 -26
  118. package/dist/app.d.ts +0 -32
  119. package/dist/attributes.d.ts +0 -1
  120. package/dist/auto-imports.d.ts +0 -1
  121. package/dist/build.d.ts +0 -2
  122. package/dist/cache.d.ts +0 -49
  123. package/dist/cli.d.ts +0 -310
  124. package/dist/dependencies.d.ts +0 -16
  125. package/dist/deploy.d.ts +0 -10
  126. package/dist/docs.d.ts +0 -26
  127. package/dist/email.d.ts +0 -107
  128. package/dist/events.d.ts +0 -5
  129. package/dist/exit-code.d.ts +0 -5
  130. package/dist/hashing.d.ts +0 -36
  131. package/dist/helpers.d.ts +0 -1
  132. package/dist/i18n.d.ts +0 -11
  133. package/dist/index.d.ts +0 -65
  134. package/dist/inspect.d.ts +0 -3
  135. package/dist/logging.d.ts +0 -6
  136. package/dist/model-names.d.ts +0 -1
  137. package/dist/model.d.ts +0 -232
  138. package/dist/payments.d.ts +0 -94
  139. package/dist/ports.d.ts +0 -13
  140. package/dist/promise.d.ts +0 -1
  141. package/dist/push.d.ts +0 -35
  142. package/dist/pwa.d.ts +0 -3
  143. package/dist/queue.d.ts +0 -45
  144. package/dist/reactivity.d.ts +0 -1
  145. package/dist/request.d.ts +0 -49
  146. package/dist/router.d.ts +0 -65
  147. package/dist/scheduler.d.ts +0 -1
  148. package/dist/services.d.ts +0 -81
  149. package/dist/ssg.d.ts +0 -3
  150. package/dist/stacks.d.ts +0 -54
  151. package/dist/storage.d.ts +0 -31
  152. package/dist/table-names.d.ts +0 -1
  153. package/dist/tables.d.ts +0 -34
  154. package/dist/team.d.ts +0 -8
  155. package/dist/ui.d.ts +0 -47
  156. package/dist/utils.d.ts +0 -27
  157. package/src/build.ts +0 -2
  158. package/src/inspect.ts +0 -10
  159. package/src/layout.ts +0 -8
  160. package/src/pwa.ts +0 -8
  161. package/src/ssg.ts +0 -3
@@ -0,0 +1,105 @@
1
+ import type { Buffer } from 'node:buffer';
2
+ import type { ReadableStream } from 'node:stream/web';
3
+ /**
4
+ * File stat entry information
5
+ */
6
+ export declare interface StatEntry {
7
+ path: string
8
+ type: 'file' | 'directory'
9
+ visibility: Visibility
10
+ size: number
11
+ lastModified: number
12
+ mimeType?: string
13
+ metadata?: Record<string, any>
14
+ }
15
+ /**
16
+ * Directory listing entry
17
+ */
18
+ export declare interface DirectoryEntry {
19
+ path: string
20
+ type: 'file' | 'directory'
21
+ }
22
+ /**
23
+ * Directory listing iterator
24
+ */
25
+ export declare interface DirectoryListing extends AsyncIterable<DirectoryEntry> {
26
+ [Symbol.asyncIterator](): AsyncIterator<DirectoryEntry>
27
+ }
28
+ /**
29
+ * Options for generating public URLs
30
+ */
31
+ export declare interface PublicUrlOptions {
32
+ domain?: string
33
+ }
34
+ /**
35
+ * Options for generating temporary URLs
36
+ */
37
+ export declare interface TemporaryUrlOptions {
38
+ expiresIn: number | Date
39
+ }
40
+ /**
41
+ * Checksum algorithm options
42
+ */
43
+ export declare interface ChecksumOptions {
44
+ algorithm?: 'md5' | 'sha1' | 'sha256'
45
+ }
46
+ /**
47
+ * MIME type detection options
48
+ */
49
+ export declare interface MimeTypeOptions {
50
+ useExtension?: boolean
51
+ }
52
+ export declare interface StorageOptions {
53
+ driver: 's3' | 'efs' | 'local' | 'bun' | 'memory'
54
+ root?: string
55
+ s3?: {
56
+ bucket: string
57
+ region?: string
58
+ prefix?: string
59
+ credentials?: {
60
+ accessKeyId: string
61
+ secretAccessKey: string
62
+ }
63
+ endpoint?: string
64
+ }
65
+ publicUrl?: {
66
+ domain?: string
67
+ }
68
+ defaultVisibility?: Visibility
69
+ }
70
+ export declare interface StorageDriver {
71
+ list: (path: string, options?: any) => DirectoryListing
72
+ changeVisibility: (path: string, visibility: Visibility) => Promise<void>
73
+ visibility: (path: string) => Promise<Visibility>
74
+ fileExists: (path: string) => Promise<boolean>
75
+ directoryExists: (path: string) => Promise<boolean>
76
+ publicUrl: (path: string, options: PublicUrlOptions) => Promise<string>
77
+ temporaryUrl: (path: string, options: TemporaryUrlOptions) => Promise<string>
78
+ checksum: (path: string, options: ChecksumOptions) => Promise<string>
79
+ mimeType: (path: string, options: MimeTypeOptions) => Promise<string>
80
+ lastModified: (path: string) => Promise<number>
81
+ fileSize: (path: string) => Promise<number>
82
+ read: (path: string) => Promise<FileContents>
83
+ readToString: (path: string) => Promise<string>
84
+ readToBuffer: (path: string) => Promise<Buffer>
85
+ readToUint8Array: (path: string) => Promise<Uint8Array>
86
+ deleteFile: (path: string) => Promise<void>
87
+ copyFile: (from: string, to: string) => Promise<void>
88
+ moveFile: (from: string, to: string) => Promise<void>
89
+ stat: (path: string) => Promise<StatEntry>
90
+ createDirectory: (path: string) => Promise<void>
91
+ write: (path: string, contents: FileContents) => Promise<void>
92
+ }
93
+ /**
94
+ * File contents can be a string, Buffer, Uint8Array, or ReadableStream
95
+ */
96
+ export type FileContents = string | Buffer | Uint8Array | ReadableStream;
97
+ /**
98
+ * Visibility options for files
99
+ */
100
+ export type Visibility = 'public' | 'private';
101
+ export type StorageConfig = Partial<StorageOptions>;
102
+ /**
103
+ * Filesystem configuration (Laravel-style alias)
104
+ */
105
+ 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
+ }
@@ -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>;
@@ -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,11 +1,11 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.70.23",
4
+ "version": "0.70.25",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
8
- "Chris Breuer <chris@stacksjs.org>"
8
+ "Chris Breuer <chris@stacksjs.com>"
9
9
  ],
10
10
  "license": "MIT",
11
11
  "funding": "https://github.com/sponsors/chrisbbreuer",
@@ -26,6 +26,7 @@
26
26
  ],
27
27
  "exports": {
28
28
  ".": {
29
+ "bun": "./src/index.ts",
29
30
  "types": "./dist/index.d.ts",
30
31
  "import": "./dist/index.js"
31
32
  },
@@ -43,35 +44,15 @@
43
44
  "typecheck": "bun tsc --noEmit",
44
45
  "prepublishOnly": "bun run build"
45
46
  },
47
+ "dependencies": {
48
+ "@stacksjs/bunpress": "^0.1.4",
49
+ "@stacksjs/ts-validation": "^0.4.10",
50
+ "bun-query-builder": "^0.1.18"
51
+ },
46
52
  "devDependencies": {
47
- "@mdit-vue/plugin-component": "^2.1.3",
48
- "@mdit-vue/plugin-frontmatter": "^2.1.3",
49
- "@mdit-vue/types": "^2.1.0",
50
- "@rollup/pluginutils": "^5.1.4",
51
- "@stacksjs/validation": "0.70.22",
52
- "@types/aws4": "^1.11.6",
53
- "@types/bun": "^1.2.8",
54
- "@types/crypto-js": "^4.2.2",
55
- "@types/fs-extra": "^11.0.4",
56
- "@types/markdown-it-link-attributes": "^3.0.5",
57
- "@types/minimatch": "^5.1.2",
58
- "@types/nprogress": "^0.2.3",
59
- "@vinejs/vine": "^3.0.1",
60
- "aws-cdk-lib": "^2.187.0",
61
- "cac": "^6.7.14",
62
- "markdown-it": "^14.1.0",
63
- "meilisearch": "^0.49.0",
64
- "neverthrow": "^8.2.0",
65
- "ora": "^8.2.0",
66
- "typescript": "^5.8.2",
67
- "unocss": "66.0.0",
68
- "unplugin-auto-import": "^19.1.2",
69
- "unplugin-vue-components": "^28.4.1",
70
- "vite": "^6.2.4",
71
- "vite-plugin-inspect": "^11.0.0",
72
- "vite-plugin-pwa": "^1.0.0",
73
- "vite-ssg": "^26.1.1",
74
- "vitepress": "1.6.3",
75
- "vue": "^3.5.13"
76
- }
53
+ "@stacksjs/validation": "0.70.23",
54
+ "@types/bun": "^1.3.11",
55
+ "typescript": "^5.9.3"
56
+ },
57
+ "sideEffects": false
77
58
  }
package/src/ai.ts CHANGED
@@ -1,15 +1,29 @@
1
1
  type AiModel =
2
+ // Amazon Titan
2
3
  | 'amazon.titan-embed-text-v1'
4
+ | 'amazon.titan-embed-text-v2:0'
3
5
  | 'amazon.titan-text-lite-v1'
4
6
  | 'amazon.titan-text-express-v1'
7
+ | 'amazon.titan-text-premier-v1:0'
5
8
  | 'amazon.titan-embed-image-v1'
6
9
  | 'amazon.titan-image-generator-v1'
7
- | 'anthropic.claude-v1'
8
- | 'anthropic.claude-v2'
9
- | 'anthropic.claude-v2:1'
10
- | 'anthropic.claude-instant-v1'
11
- | 'meta.llama2-13b-chat-v1'
12
- | 'meta.llama2-70b-chat-v1'
10
+ | 'amazon.titan-image-generator-v2:0'
11
+ // Anthropic Claude (current models via Bedrock)
12
+ | 'anthropic.claude-sonnet-4-20250514-v1:0'
13
+ | 'anthropic.claude-haiku-4-20250514-v1:0'
14
+ | 'anthropic.claude-3-5-sonnet-20241022-v2:0'
15
+ | 'anthropic.claude-3-5-haiku-20241022-v1:0'
16
+ | 'anthropic.claude-3-opus-20240229-v1:0'
17
+ | 'anthropic.claude-3-sonnet-20240229-v1:0'
18
+ | 'anthropic.claude-3-haiku-20240307-v1:0'
19
+ // Meta Llama 3
20
+ | 'meta.llama3-8b-instruct-v1:0'
21
+ | 'meta.llama3-70b-instruct-v1:0'
22
+ | 'meta.llama3-1-8b-instruct-v1:0'
23
+ | 'meta.llama3-1-70b-instruct-v1:0'
24
+ | 'meta.llama3-1-405b-instruct-v1:0'
25
+ // Allow custom model strings
26
+ | (string & {})
13
27
 
14
28
  /**
15
29
  * **AI Options**
package/src/analytics.ts CHANGED
@@ -6,14 +6,51 @@
6
6
  * have any questions, feel free to reach out via Discord or GitHub Discussions.
7
7
  */
8
8
  export interface AnalyticsOptions {
9
- driver: 'google-analytics' | 'fathom'
9
+ /** The analytics driver/provider to use */
10
+ driver: 'google-analytics' | 'fathom' | 'plausible' | 'self-hosted'
10
11
 
11
12
  drivers: {
13
+ /** Google Analytics configuration */
12
14
  googleAnalytics?: {
15
+ /** GA4 Measurement ID (e.g., G-XXXXXXXXXX) */
13
16
  trackingId: string
17
+ /** Enable debug mode */
18
+ debug?: boolean
14
19
  }
20
+ /** Fathom Analytics configuration (privacy-focused) */
15
21
  fathom?: {
22
+ /** Fathom site ID */
16
23
  siteId: string
24
+ /** Custom script URL */
25
+ scriptUrl?: string
26
+ /** Honor Do Not Track browser setting */
27
+ honorDnt?: boolean
28
+ /** Enable SPA mode for client-side routing */
29
+ spa?: boolean
30
+ }
31
+ /** Plausible Analytics configuration (privacy-focused, open source) */
32
+ plausible?: {
33
+ /** Your domain (e.g., example.com) */
34
+ domain: string
35
+ /** Custom script URL (for self-hosted Plausible) */
36
+ scriptUrl?: string
37
+ /** Track localhost during development */
38
+ trackLocalhost?: boolean
39
+ /** Enable hash-based routing */
40
+ hashMode?: boolean
41
+ }
42
+ /** Self-hosted analytics configuration (using Stacks Analytics / dynamodb-tooling) */
43
+ selfHosted?: {
44
+ /** Site ID for tracking */
45
+ siteId: string
46
+ /** API endpoint URL for collecting analytics (e.g., https://api.example.com/analytics) */
47
+ apiEndpoint: string
48
+ /** Honor Do Not Track browser setting */
49
+ honorDnt?: boolean
50
+ /** Track hash changes as page views */
51
+ trackHashChanges?: boolean
52
+ /** Track outbound link clicks */
53
+ trackOutboundLinks?: boolean
17
54
  }
18
55
  }
19
56
  }
package/src/app.ts CHANGED
@@ -83,6 +83,23 @@ export interface AppOptions {
83
83
  */
84
84
  maintenanceMode: boolean
85
85
 
86
+ /**
87
+ * **Coming Soon Mode**
88
+ *
89
+ * When enabled, public web requests can render a launch screen while
90
+ * optionally allowing preview access through a secret bypass.
91
+ *
92
+ * @default false
93
+ */
94
+ comingSoonMode?: boolean
95
+
96
+ /**
97
+ * **Coming Soon Secret**
98
+ *
99
+ * Optional preview token used to bypass coming soon mode.
100
+ */
101
+ comingSoonSecret?: string
102
+
86
103
  /**
87
104
  * **Encryption Key**
88
105
  *
@@ -146,6 +163,27 @@ export interface AppOptions {
146
163
  * @default false
147
164
  */
148
165
  docMode: boolean
166
+
167
+ /**
168
+ * **Primary Brand Color**
169
+ *
170
+ * The primary color used for branding in emails and UI components.
171
+ * Should be a valid CSS color value (hex, rgb, etc.)
172
+ *
173
+ * @default "#3b82f6"
174
+ * @example "#3b82f6"
175
+ */
176
+ primaryColor: string
177
+
178
+ /**
179
+ * **Support Email**
180
+ *
181
+ * The email address users should contact for support.
182
+ * Used in transactional emails and error messages.
183
+ *
184
+ * @example "support@example.com"
185
+ */
186
+ supportEmail: string
149
187
  }
150
188
 
151
189
  export type AppConfig = Partial<AppOptions>
package/src/attributes.ts CHANGED
@@ -1 +1,5 @@
1
- export * from '../../../types/attributes'
1
+ // Project-generated `Attributes` interface lives at
2
+ // `storage/framework/types/attributes.ts` (one big union of every model's
3
+ // fillable column). Re-export type-only so Bun's runtime resolver doesn't
4
+ // try to load the file from the shipped `@stacksjs/types` package.
5
+ export type * from '../../../types/attributes'
package/src/auth.ts ADDED
@@ -0,0 +1,122 @@
1
+ export interface AuthOptions {
2
+ /**
3
+ * The default authentication guard to use
4
+ */
5
+ default: string
6
+
7
+ /**
8
+ * The authentication guards available
9
+ */
10
+ guards: {
11
+ [key: string]: {
12
+ /**
13
+ * The authentication driver to use
14
+ */
15
+ driver: 'session' | 'token'
16
+
17
+ /**
18
+ * The authentication provider to use
19
+ */
20
+ provider: string
21
+ }
22
+ }
23
+
24
+ /**
25
+ * The authentication providers available
26
+ */
27
+ providers: {
28
+ [key: string]: {
29
+ /**
30
+ * The database driver to use
31
+ */
32
+ driver: 'database'
33
+
34
+ /**
35
+ * The database table to use
36
+ */
37
+ table: string
38
+ }
39
+ }
40
+
41
+ /**
42
+ * The username field used for authentication
43
+ */
44
+ username: string
45
+
46
+ /**
47
+ * The password field used for authentication
48
+ */
49
+ password: string
50
+
51
+ /**
52
+ * The access-token expiry time in milliseconds. Defaults to 1 hour —
53
+ * the matching refresh token below covers the longer-lived window.
54
+ */
55
+ tokenExpiry: number
56
+
57
+ /**
58
+ * The refresh-token expiry time in milliseconds. Defaults to 30 days.
59
+ * Refresh tokens are single-use and rotate on every refresh exchange.
60
+ */
61
+ refreshTokenExpiry?: number
62
+
63
+ /**
64
+ * The token rotation time in hours
65
+ */
66
+ tokenRotation: number
67
+
68
+ /**
69
+ * The token abilities that are granted by default
70
+ */
71
+ defaultAbilities: string[]
72
+
73
+ /**
74
+ * The token name used when creating new tokens
75
+ */
76
+ defaultTokenName: string
77
+
78
+ /**
79
+ * Password reset configuration
80
+ */
81
+ passwordReset: {
82
+ /**
83
+ * Token expiration time in minutes
84
+ * @default 60
85
+ */
86
+ expire: number
87
+
88
+ /**
89
+ * Throttle time in seconds between password reset requests
90
+ * @default 60
91
+ */
92
+ throttle: number
93
+ }
94
+ }
95
+
96
+ export type AuthConfig = Partial<AuthOptions>
97
+
98
+ export interface AuthInstance {
99
+ guard: string
100
+ provider: string
101
+ user?: any
102
+ token?: string
103
+ }
104
+
105
+ export type GuardType = 'session' | 'token'
106
+ export type ProviderType = 'database'
107
+
108
+ export interface AuthDriver {
109
+ attempt: (credentials: any) => Promise<boolean>
110
+ validate: (token: string) => Promise<boolean>
111
+ login: (credentials: any) => Promise<{ token: string } | null>
112
+ logout: () => Promise<void>
113
+ user: () => Promise<any>
114
+ token: () => string | null
115
+ }
116
+
117
+ export interface Authenticatable {
118
+ getAuthIdentifier: () => any
119
+ getAuthPassword: () => string
120
+ getRememberToken: () => string
121
+ setRememberToken: (token: string) => void
122
+ }
@@ -1 +1,8 @@
1
- export type { Options as AutoImportsOptions } from 'unplugin-auto-import/types'
1
+ // `unplugin-auto-import` isn't a runtime dependency of @stacksjs/types — we
2
+ // only re-publish its option shape so users get autocomplete in user-land
3
+ // configs. The local type intentionally mirrors the upstream `Options`
4
+ // surface as an open record; if/when this package adopts unplugin-auto-import
5
+ // as a real dependency, swap this for `import type { Options }` from there.
6
+ export interface AutoImportsOptions {
7
+ [key: string]: unknown
8
+ }