@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,31 @@
1
+ export type * from '../../../types/events';
2
+ /**
3
+ * **Events**
4
+ *
5
+ * This configuration defines all of your events. Because Stacks is fully-typed, you may
6
+ * hover any of the options below and the definitions will be provided. In case you
7
+ * have any questions, feel free to reach out via Discord or GitHub Discussions.
8
+ *
9
+ * @example To fire an event, you may use any of the following approaches:
10
+ * ```ts
11
+ * dispatch('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
12
+ *
13
+ * // alternatively, you may use the following:
14
+ * useEvent('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
15
+ * events.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
16
+ * useEvents.emit('user:registered', { name: 'Chris', email: 'chris@stacksjs.com' })
17
+ * ```
18
+ *
19
+ * @example To capture an event, you may use any of the following approaches:
20
+ * ```ts
21
+ * listen('user:registered', (user) => sendWelcomeEmail(user))
22
+ *
23
+ * // alternatively, you may use the following:
24
+ * useListen('user:registered', (user) => sendWelcomeEmail(user))
25
+ * events.on('user:registered', (user) => sendWelcomeEmail(user))
26
+ * useEvents.on('user:registered', (user) => sendWelcomeEmail(user))
27
+ * ```
28
+ */
29
+ export declare interface Events {
30
+ [key: string]: string[]
31
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * CLI exit codes.
3
+ *
4
+ * @see https://nodejs.org/api/process.html#process_exit_codes
5
+ */
6
+ export declare enum ExitCode {
7
+ Success = 0,
8
+ FatalError = 1,
9
+ InvalidArgument = 9,
10
+ }
@@ -0,0 +1,17 @@
1
+ export declare interface FeatureFlagMemoryDriverConfig {
2
+ cloneValues?: boolean
3
+ }
4
+ export declare interface FeatureFlagDatabaseDriverConfig {
5
+ table?: string
6
+ autoCreate?: boolean
7
+ }
8
+ /** Configuration for the user-facing feature flag service. */
9
+ export declare interface FeatureFlagsConfig {
10
+ default: FeatureFlagDriverName
11
+ missing?: 'false' | 'throw'
12
+ drivers?: {
13
+ memory?: FeatureFlagMemoryDriverConfig
14
+ database?: FeatureFlagDatabaseDriverConfig
15
+ }
16
+ }
17
+ export type FeatureFlagDriverName = 'memory' | 'database';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Describes a plain-text file.
3
+ */
4
+ export declare interface TextFile {
5
+ path: string
6
+ data: string
7
+ }
8
+ /**
9
+ * Describes a JSON file.
10
+ */
11
+ export declare interface JsonFile {
12
+ path: string
13
+ data: unknown
14
+ indent: string
15
+ newline: string | undefined
16
+ }
17
+ /**
18
+ * Describes a package.json file.
19
+ */
20
+ export declare interface PackageJson {
21
+ engines: {
22
+ node: string
23
+ pnpm: string
24
+ }
25
+ version: string
26
+ packageManager: string
27
+ }
28
+ export declare interface FileSystemOptions {
29
+ default: string
30
+ disks: {
31
+ local: {
32
+ driver: 'local'
33
+ root: string
34
+ }
35
+ public: {
36
+ driver: 'public'
37
+ root: string
38
+ visibility?: 'public'
39
+ }
40
+ private: {
41
+ driver: 'private'
42
+ root: string
43
+ visibility?: 'private'
44
+ }
45
+ efs: {
46
+ driver: 'local'
47
+ root: string
48
+ }
49
+ s3: {
50
+ driver: 's3'
51
+ root: string
52
+ }
53
+ [key: string]: {
54
+ driver: string
55
+ root: string
56
+ visibility?: 'public' | 'private'
57
+ }
58
+ }
59
+ }
60
+ export type FileSystemConfig = Partial<FileSystemOptions>;
package/dist/git.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ /**
2
+ * **Git Options**
3
+ *
4
+ * This configuration defines all of your git options. Because Stacks is fully-typed, you may
5
+ * hover any of the options below and the definitions will be provided. In case you
6
+ * have any questions, feel free to reach out via Discord or GitHub Discussions.
7
+ */
8
+ export declare interface GitOptions {
9
+ hooks: GitHooks
10
+ scopes: string[]
11
+ types: {
12
+ value: string
13
+ name: string
14
+ emoji: string
15
+ }[]
16
+ messages: {
17
+ type: string
18
+ scope: string
19
+ customScope: string
20
+ subject: string
21
+ body: string
22
+ breaking: string
23
+ footerPrefixesSelect: string
24
+ customFooterPrefixes: string
25
+ footer: string
26
+ confirmCommit: string
27
+ }
28
+ }
29
+ declare interface Hooks {
30
+ 'applypatch-msg'?: string
31
+ 'pre-applypatch'?: string
32
+ 'post-applypatch'?: string
33
+ 'pre-commit'?: string
34
+ 'pre-merge-commit'?: string
35
+ 'prepare-commit-msg'?: string
36
+ 'commit-msg'?: string
37
+ 'post-commit'?: string
38
+ 'pre-rebase'?: string
39
+ 'post-checkout'?: string
40
+ 'post-merge'?: string
41
+ 'pre-push'?: string
42
+ 'pre-receive'?: string
43
+ 'update'?: string
44
+ 'proc-receive'?: string
45
+ 'post-receive'?: string
46
+ 'post-update'?: string
47
+ 'reference-transaction'?: string
48
+ 'push-to-checkout'?: string
49
+ 'pre-auto-gc'?: string
50
+ 'post-rewrite'?: string
51
+ 'sendemail-validate'?: string
52
+ 'fsmonitor-watchman'?: string
53
+ 'p4-changelist'?: string
54
+ 'p4-prepare-changelist'?: string
55
+ 'p4-post-changelist'?: string
56
+ 'p4-pre-submit'?: string
57
+ 'post-index-change'?: string
58
+ }
59
+ export declare interface GitHooks extends Hooks {}
60
+ export type GitConfig = Partial<GitOptions>;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The Stacks runtime provides secure Bcrypt & Argon2 hashing for storing user passwords.
3
+ * If you are using one of the Laravel application starter kits, Bcrypt will be used for
4
+ * registration and authentication by default.
5
+ *
6
+ * Bcrypt is a great choice for hashing passwords because its "work factor" is adjustable, which
7
+ * means that the time it takes to generate a hash can be increased as hardware power increases.
8
+ * When hashing passwords, slow is good. The longer an algorithm takes to hash a password, the
9
+ * longer it takes malicious users to generate "rainbow tables" of all possible string hash
10
+ * values that may be used in brute force attacks against applications.
11
+ *
12
+ * @see https://stacksjs.com/docs/hashing
13
+ */
14
+ export declare interface HashingOptions {
15
+ driver: 'argon2' | 'argon2id' | 'argon2i' | 'argon2d' | 'bcrypt'
16
+ bcrypt?: BcryptOptions
17
+ argon2?: ArgonOptions
18
+ }
19
+ /**
20
+ * **Bcrypt Options**
21
+ *
22
+ * Here you may specify the configuration options that should be used when
23
+ * passwords are hashed using the Bcrypt algorithm. This will allow you
24
+ * to control the amount of time it takes to hash the given password.
25
+ *
26
+ * @see https://stacksjs.com/docs/hashing
27
+ */
28
+ export declare interface BcryptOptions {
29
+ rounds: number
30
+ }
31
+ /**
32
+ * **Argon Options**
33
+ *
34
+ * Here you may specify the configuration options that should be used when
35
+ * passwords are hashed using the Argon algorithm. These will allow you
36
+ * to control the amount of time it takes to hash the given password.
37
+ *
38
+ * @see https://stacksjs.com/docs/hashing
39
+ */
40
+ export declare interface ArgonOptions {
41
+ memory?: number
42
+ time?: number
43
+ }
44
+ export type HashingConfig = Partial<HashingOptions>;
45
+ export type HashAlgorithm = | 'md4'
46
+ | 'md5'
47
+ | 'sha1'
48
+ | 'sha256'
49
+ | 'sha384'
50
+ | 'sha512'
51
+ | 'ripemd128'
52
+ | 'ripemd160'
53
+ | 'tiger128'
54
+ | 'tiger160'
55
+ | 'tiger192'
56
+ | 'crc32'
57
+ | 'crc32b';
@@ -0,0 +1 @@
1
+ export declare function getTypeName(v: any): string;
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Vite plugin options for Vue I18n
3
+ */
4
+ declare interface VitePluginVueI18nOptions {
5
+ forceStringify?: boolean
6
+ runtimeOnly?: boolean
7
+ compositionOnly?: boolean
8
+ fullInstall?: boolean
9
+ include?: string | string[]
10
+ defaultSFCLang?: 'json' | 'json5' | 'yml' | 'yaml'
11
+ globalSFCScope?: boolean
12
+ useVueI18nImportName?: boolean
13
+ }
14
+ /**
15
+ * **Internationalization Options**
16
+ *
17
+ * Configuration for the i18n system.
18
+ */
19
+ export declare interface I18nOptions {
20
+ locale: string
21
+ fallbackLocale: string
22
+ availableLocales?: string[]
23
+ langDir?: string
24
+ messages?: Translations
25
+ warnMissing?: boolean
26
+ keySeparator?: string
27
+ pluralSeparator?: string
28
+ dateTimeFormats?: DateTimeFormats
29
+ numberFormats?: NumberFormats
30
+ vite?: VitePluginVueI18nOptions
31
+ }
32
+ /**
33
+ * Translation messages - can be nested objects or strings
34
+ */
35
+ export type TranslationMessages = {
36
+ [key: string]: string | TranslationMessages
37
+ }
38
+ /**
39
+ * All translations keyed by locale
40
+ */
41
+ export type Translations = {
42
+ [locale: string]: TranslationMessages
43
+ }
44
+ /**
45
+ * Date/time format configurations per locale
46
+ */
47
+ export type DateTimeFormats = {
48
+ [locale: string]: {
49
+ [formatName: string]: Intl.DateTimeFormatOptions
50
+ }
51
+ }
52
+ /**
53
+ * Number format configurations per locale
54
+ */
55
+ export type NumberFormats = {
56
+ [locale: string]: {
57
+ [formatName: string]: Intl.NumberFormatOptions
58
+ }
59
+ }
60
+ export type I18nConfig = Partial<I18nOptions>;
61
+ /**
62
+ * Legacy alias
63
+ * @deprecated Use I18nOptions instead
64
+ */
65
+ export type i18nOptions = VitePluginVueI18nOptions;
@@ -0,0 +1,80 @@
1
+ export * from './ai';
2
+ export * from './analytics';
3
+ export * from './api';
4
+ export * from './app';
5
+ export * from './attributes';
6
+ export * from './auth';
7
+ export * from './oauth';
8
+ export * from './auto-imports';
9
+ export * from './binary';
10
+ // `./build` removed — exposed `vite` / `vite-ssg` types we no longer use
11
+ // (Stacks builds with Bun). The same applies to `./inspect`, `./pwa`,
12
+ // `./ssg`, and `./layout` which all wrapped vite-* plugins.
13
+ export * from './cache';
14
+ export * from './cdn';
15
+ export * from './chat';
16
+ export * from './cli';
17
+ export * from './cloud';
18
+ export * from './cms';
19
+ export * from './commerce';
20
+ export * from './components';
21
+ export * from './configure';
22
+ export * from './cors';
23
+ export * from './cron-jobs';
24
+ export * from './dashboard';
25
+ // Module-augments bun-query-builder's BrowserModelDefinition with the
26
+ // stacks `dashboard` slot. Importing this file (transitively via the
27
+ // barrel) is what makes `defineModel({ dashboard: {...} })` typecheck.
28
+ export * from './model-dashboard-augmentation';
29
+ export * from './database';
30
+ export * from './dependencies';
31
+ export * from './deploy';
32
+ export * from './dns';
33
+ export * from './docs';
34
+ export * from './email';
35
+ export * from './env';
36
+ export * from './errors';
37
+ export * from './events';
38
+ export * from './exit-code';
39
+ export * from './file-systems';
40
+ export * from './feature-flags';
41
+ export * from './git';
42
+ export * from './hashing';
43
+ export * from './helpers';
44
+ export * from './i18n';
45
+ export * from './library';
46
+ export * from './logging';
47
+ export * from './manifest';
48
+ export * from './marketing';
49
+ export * from './model';
50
+ export * from './model-names';
51
+ export * from './monitoring';
52
+ export * from './notifications';
53
+ export * from './pages';
54
+ export * from './payments';
55
+ export * from './phone';
56
+ export * from './ports';
57
+ export * from './promise';
58
+ export * from './push';
59
+ export * from './queue';
60
+ export * from './reactivity';
61
+ export * from './realtime';
62
+ export * from './request';
63
+ export * from './response';
64
+ export * from './router';
65
+ export * from './saas';
66
+ export * from './scheduler';
67
+ export * from './search-engine';
68
+ export * from './security';
69
+ export * from './server';
70
+ export * from './services';
71
+ export * from './settings-config';
72
+ export * from './sms';
73
+ export * from './stack-extensions';
74
+ export * from './stacks';
75
+ export * from './storage';
76
+ export * from './table-names';
77
+ export * from './tables';
78
+ export * from './team';
79
+ export * from './ui';
80
+ export * from './utils';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ function x(p){return typeof p==="object"&&p!==null&&"id"in p&&"userId"in p&&"clientId"in p&&"scopes"in p}function H(p){return x(p)&&"abilities"in p}function N(p){return typeof p==="object"&&p!==null&&"id"in p&&"name"in p&&"secret"in p&&"redirect"in p}var F;((D)=>{D.Second="* * * * * *";D.FiveSeconds="*/5 * * * * *";D.TenSeconds="*/10 * * * * *";D.ThirtySeconds="*/30 * * * * *";D.Minute="* * * * *";D.TwoMinutes="*/2 * * * *";D.FiveMinutes="*/5 * * * *";D.TenMinutes="*/10 * * * *";D.FifteenMinutes="*/15 * * * *";D.ThirtyMinutes="*/30 * * * *";D.Hour="0 * * * *";D.HalfHour="0,30 * * * *";D.Day="0 0 * * *";D.Week="0 0 * * 0";D.Weekday="0 0 * * 1-5";D.Weekend="0 0 * * 0,6";D.Month="0 0 1 * *";D.Year="0 0 1 1 *"})(F||={});var U;((B)=>{B.Bluesky="bluesky";B.Discord="discord";B.Facebook="facebook";B.GitHub="github";B.Instagram="instagram";B.LinkedIn="linkedin";B.Mastodon="mastodon";B.Slack="slack";B.Twitter="twitter";B.YouTube="youtube"})(U||={});var _;((O)=>{O[O.Success=0]="Success";O[O.FatalError=1]="FatalError";O[O.InvalidArgument=9]="InvalidArgument"})(_||={});import{toString as G}from"@stacksjs/strings";function K(p){if(p===null)return"null";let P=G(p).slice(8,-1).toLowerCase();return typeof p==="object"||typeof p==="function"?P:typeof p}function Q(p){return p}function R(p){return p}var W={development:{default:"sync",connections:{sync:{driver:"sync"}},failed:{driver:"database",table:"failed_jobs"}},production:{default:"redis",connections:{redis:{driver:"redis",prefix:"stacks:queue",concurrency:5,distributedLock:!0,metrics:{enabled:!0},defaultDeadLetterOptions:{enabled:!0,maxRetries:3}}},failed:{driver:"redis",prefix:"stacks:failed"},worker:{concurrency:5,shutdownTimeout:30000}},highPerformance:{default:"redis",connections:{redis:{driver:"redis",prefix:"stacks:queue",concurrency:20,distributedLock:!0,metrics:{enabled:!0,collectInterval:5000},horizontalScaling:{enabled:!0,maxWorkersPerInstance:20,jobsPerWorker:50},defaultDeadLetterOptions:{enabled:!0,maxRetries:5}}},failed:{driver:"redis",prefix:"stacks:failed"},worker:{concurrency:20,shutdownTimeout:60000}},database:{default:"database",connections:{database:{driver:"database",table:"jobs",queue:"default",retryAfter:90}},failed:{driver:"database",table:"failed_jobs"}}};var Z={server:{development:{enabled:!0,mode:"server",debug:!0,server:{host:"localhost",port:6001,scheme:"ws",driver:"bun",rateLimit:{enabled:!1},healthCheck:{enabled:!0,path:"/health"}},channels:{public:!0,private:!0,presence:!0}},production:{enabled:!0,mode:"server",debug:!1,server:{host:"0.0.0.0",port:6001,scheme:"wss",driver:"bun",redis:{enabled:!0,prefix:"stacks:realtime:"},rateLimit:{enabled:!0,maxConnectionsPerIp:100,maxMessagesPerSecond:50,maxPayloadSize:65536},loadManagement:{maxConnections:1e4,backpressureThreshold:1000,messageQueueSize:1e4,gracefulShutdownTimeout:30000},autoScaling:{min:2,max:10,targetCPU:70},healthCheck:{enabled:!0,path:"/health",interval:30},metrics:{enabled:!0,port:9090,path:"/metrics"}},channels:{public:!0,private:!0,presence:!0}},highPerformance:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0,cluster:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:500,maxMessagesPerSecond:200,maxPayloadSize:131072},loadManagement:{maxConnections:1e5,backpressureThreshold:5000,messageQueueSize:50000,gracefulShutdownTimeout:60000},autoScaling:{min:4,max:50,targetCPU:60}}},chat:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:10,maxMessagesPerSecond:20},loadManagement:{maxConnections:50000}},channels:{public:!0,private:!0,presence:{enabled:!0,maxMembersPerChannel:500,memberInfoTtl:60}}},gaming:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0,cluster:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:50,maxMessagesPerSecond:100},loadManagement:{maxConnections:50000,backpressureThreshold:2000,messageQueueSize:20000},autoScaling:{min:2,max:20,targetCPU:50}},channels:{public:!0,private:!0,presence:!0}}},serverless:{development:{enabled:!0,mode:"serverless",debug:!0,serverless:{connectionTimeout:3600,idleTimeout:600,stageName:"dev",memorySize:256,timeout:30},channels:{public:!0,private:!0,presence:!0}},production:{enabled:!0,mode:"serverless",debug:!1,serverless:{connectionTimeout:3600,idleTimeout:600,stageName:"production",memorySize:512,timeout:30,provisionedConcurrency:2},channels:{public:!0,private:!0,presence:!0}},notifications:{enabled:!0,mode:"serverless",serverless:{connectionTimeout:7200,idleTimeout:1800,memorySize:256,timeout:15},channels:{public:!0,private:!0,presence:!1}}}};var f={};export{f as stackExtensionRegistry,H as isPersonalAccessToken,N as isOAuthClient,x as isAccessToken,K as getTypeName,R as defineModels,Q as defineModel,U as SocialLinkIcon,Z as RealtimePresets,W as QueuePresets,_ as ExitCode,F as Every};