@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,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,70 @@
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 './components';
19
+ export * from './configure';
20
+ export * from './cron-jobs';
21
+ export * from './dashboard';
22
+ export * from './database';
23
+ export * from './dependencies';
24
+ export * from './deploy';
25
+ export * from './dns';
26
+ export * from './docs';
27
+ export * from './email';
28
+ export * from './env';
29
+ export * from './errors';
30
+ export * from './events';
31
+ export * from './exit-code';
32
+ export * from './file-systems';
33
+ export * from './git';
34
+ export * from './hashing';
35
+ export * from './helpers';
36
+ export * from './i18n';
37
+ export * from './library';
38
+ export * from './logging';
39
+ export * from './manifest';
40
+ export * from './model';
41
+ export * from './model-names';
42
+ export * from './notifications';
43
+ export * from './pages';
44
+ export * from './payments';
45
+ export * from './phone';
46
+ export * from './ports';
47
+ export * from './promise';
48
+ export * from './push';
49
+ export * from './queue';
50
+ export * from './reactivity';
51
+ export * from './realtime';
52
+ export * from './request';
53
+ export * from './response';
54
+ export * from './router';
55
+ export * from './saas';
56
+ export * from './scheduler';
57
+ export * from './search-engine';
58
+ export * from './security';
59
+ export * from './server';
60
+ export * from './services';
61
+ export * from './settings-config.ts';
62
+ export * from './sms';
63
+ export * from './stack-extensions';
64
+ export * from './stacks';
65
+ export * from './storage';
66
+ export * from './table-names';
67
+ export * from './tables';
68
+ export * from './team';
69
+ export * from './ui';
70
+ export * from './utils';
@@ -1,51 +1,47 @@
1
1
  import type { TagsOptions } from './components';
2
-
2
+ /**
3
+ * **Library Options**
4
+ *
5
+ * This configuration defines all of your library options. Because Stacks is fully-typed, you
6
+ * may 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
+ */
3
9
  export declare interface LibraryOptions {
4
10
  name: string
5
-
6
11
  owner: string | null
7
-
8
12
  packageRegistry: 'npm'
9
-
10
13
  repository: string
11
-
12
14
  license: LicenseType
13
-
14
15
  author: string
15
-
16
16
  contributors: string[]
17
-
18
17
  releaseable: boolean
19
-
20
18
  defaultLanguage: LanguageCode
21
-
22
- vueComponents: LibraryBuildOptions
23
-
24
19
  webComponents: LibraryBuildOptions
25
-
26
20
  functions: LibraryBuildOptions
27
21
  }
28
-
29
- export type LibraryConfig = Partial<LibraryOptions>
30
-
31
- export interface LibraryBuildOptions {
22
+ /**
23
+ * The list of available options to build your library.
24
+ */
25
+ export declare interface LibraryBuildOptions {
32
26
  name: string
33
-
34
27
  description: string
35
-
36
28
  keywords: string[]
37
-
38
29
  shouldGenerateSourcemap?: boolean
39
-
40
- files?: string[]
41
-
30
+ files?: string[]
42
31
  tags?: TagsOptions
43
32
  }
44
-
45
- export type StackName = string
46
-
47
- export type LicenseType =
48
- | 'CC-BY-NC-ND-2.0'
33
+ export type LibraryConfig = Partial<LibraryOptions>;
34
+ /**
35
+ * The name of your "Stack" which generally is your library name
36
+ * or a concatenation of your organization & library name.
37
+ */
38
+ export type StackName = string;
39
+ /**
40
+ * The list of accepted SPDX licenses.
41
+ * When developing OS packages, you may want to utilize an OSI approved license.
42
+ * @see https://opensource.org/licenses
43
+ */
44
+ export type LicenseType = | 'CC-BY-NC-ND-2.0'
49
45
  | 'SGI-B-2.0'
50
46
  | 'LPPL-1.3c'
51
47
  | 'NIST-PD-fallback'
@@ -533,10 +529,12 @@ export type LicenseType =
533
529
  | 'Artistic-1.0-Perl'
534
530
  | 'BSD-2-Clause-Views'
535
531
  | 'Interbase-1.0'
536
- | 'NPOSL-3.0'
537
-
538
- export type LanguageCode =
539
- | 'aa'
532
+ | 'NPOSL-3.0';
533
+ /**
534
+ * The list of accepted language codes.
535
+ * @see https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code
536
+ */
537
+ export type LanguageCode = | 'aa'
540
538
  | 'ab'
541
539
  | 'af'
542
540
  | 'ak'
@@ -798,4 +796,4 @@ export type LanguageCode =
798
796
  | 'zh-classical'
799
797
  | 'zh-min-nan'
800
798
  | 'zh-yue'
801
- | 'zu'
799
+ | 'zu';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * **Logging Options**
3
+ *
4
+ * This configuration defines all of your logging options. Because Stacks is fully-typed, you
5
+ * may 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 LoggingOptions {
9
+ logsPath: string
10
+ deploymentsPath: string
11
+ }
12
+ export type LoggingConfig = Partial<LoggingOptions>;
@@ -1,6 +1,9 @@
1
+ /**
2
+ * The npm package manifest (package.json)
3
+ */
1
4
  export declare interface Manifest {
2
5
  name: string
3
6
  version: string
4
7
  description: string
5
8
  [key: string]: unknown
6
- }
9
+ }
@@ -0,0 +1 @@
1
+ export type ModelNames = 'Tag' | 'PaymentProduct' | 'FailedJob' | 'SocialPost' | 'PaymentMethod' | 'Campaign' | 'PaymentTransaction' | 'Request' | 'Activity' | 'EmailList' | 'Notification' | 'Job' | 'Log' | 'Subscription' | 'Error' | 'Comment' | 'User' | 'Websocket' | 'Page' | 'Author' | 'Post' | 'PrintDevice' | 'Category' | 'Payment' | 'Driver' | 'WaitlistProduct' | 'DigitalDelivery' | 'Manufacturer' | 'OrderItem' | 'ShippingZone' | 'Customer' | 'Product' | 'Receipt' | 'ProductVariant' | 'LicenseKey' | 'WaitlistRestaurant' | 'Review' | 'ProductUnit' | 'GiftCard' | 'Order' | 'Coupon' | 'TaxRate' | 'Transaction' | 'LoyaltyPoint' | 'LoyaltyReward' | 'ShippingMethod' | 'ShippingRate' | 'Cart' | 'DeliveryRoute' | 'CartItem';
@@ -0,0 +1,251 @@
1
+ import type { DeepPartial } from '.';
2
+ import type { Faker } from '@stacksjs/faker';
3
+ import type { ModelNames, TableNames } from '@stacksjs/types';
4
+ import type { SearchOptions } from './search-engine';
5
+ import type { ValidationType } from '@stacksjs/ts-validation';
6
+ /**
7
+ * Helper to define a model with proper type inference.
8
+ * Compatible with bun-query-builder's defineModel pattern.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * export default defineModel({
13
+ * name: 'User',
14
+ * table: 'users',
15
+ * primaryKey: 'id',
16
+ * attributes: {
17
+ * name: { validation: { rule: schema.string() } },
18
+ * email: { validation: { rule: schema.string().email() }, unique: true },
19
+ * },
20
+ * traits: {
21
+ * useTimestamps: true,
22
+ * useApi: true,
23
+ * },
24
+ * })
25
+ * ```
26
+ */
27
+ export declare function defineModel<const T extends Model>(model: T): T;
28
+ /**
29
+ * Helper to define multiple models with proper type inference.
30
+ * Useful for building a typed database schema.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const models = defineModels({ User, Post, Comment })
35
+ * ```
36
+ */
37
+ export declare function defineModels<const T extends Record<string, Model>>(models: T): T;
38
+ export declare interface BaseRelation {
39
+ foreignKey?: string
40
+ relationName?: string
41
+ }
42
+ export declare interface Relation<T = string> extends BaseRelation {
43
+ model: T
44
+ }
45
+ export declare interface HasOne<T = string> extends Array<Relation<T>> {}
46
+ export declare interface MorphTo {
47
+ name: string
48
+ }
49
+ export declare interface MorphOne<T = string> extends BaseRelation {
50
+ model: T
51
+ morphName?: string
52
+ type?: string
53
+ id?: string
54
+ }
55
+ export declare interface MorphMany<T = string> extends MorphOne<T> {}
56
+ export declare interface HasMany<T = string> extends Array<Relation<T>> {}
57
+ export declare interface BelongsTo<T = string> extends Array<Relation<T>> {}
58
+ export declare interface BelongsToMany<T = string> extends Array<BaseBelongsToMany<T> | T> {}
59
+ export declare interface HasOneThrough<T = string> extends Array<BaseHasOneThrough<T> | T> {}
60
+ export declare interface BaseBelongsToMany<T = string> {
61
+ model: T
62
+ firstForeignKey?: string
63
+ secondForeignKey?: string
64
+ pivotTable?: string
65
+ }
66
+ export declare interface BaseHasOneThrough<T = string> {
67
+ model: T
68
+ through: T
69
+ foreignKey?: string
70
+ throughForeignKey?: string
71
+ relationName?: string
72
+ }
73
+ export declare interface BaseHasManyThrough<T = string> {
74
+ model: T
75
+ through: T
76
+ foreignKey?: string
77
+ throughForeignKey?: string
78
+ relationName?: string
79
+ }
80
+ export declare interface HasManyThrough<T = string> extends Array<BaseHasManyThrough<T> | T> {}
81
+ export declare interface MorphToMany<T = string> extends Array<T> {}
82
+ export declare interface MorphedByMany<T = string> extends Array<T> {}
83
+ export declare interface FieldArrayElement {
84
+ entity: string
85
+ charValue?: string | null
86
+ }
87
+ export declare interface ModelElement {
88
+ field: string
89
+ default: string | number | boolean | Date | undefined | null
90
+ unique: boolean
91
+ fillable: boolean
92
+ hidden: boolean
93
+ required: boolean
94
+ fieldArray: FieldArrayElement | null
95
+ }
96
+ export declare interface UserAuthOptions {
97
+ useTwoFactor?: boolean
98
+ usePasskey?: boolean
99
+ }
100
+ export declare interface LikeableOptions {
101
+ table?: string
102
+ foreignKey?: string
103
+ }
104
+ export declare interface SeedOptions {
105
+ count: number
106
+ }
107
+ declare interface ActivityLogOption {
108
+ exclude: LogAttribute[]
109
+ include: LogAttribute[]
110
+ logOnly: LogAttribute[]
111
+ }
112
+ export declare interface Relations {
113
+ hasOne: HasOne<ModelNames> | ModelNames[]
114
+ hasMany: HasMany<ModelNames> | ModelNames[]
115
+ belongsTo: BelongsTo<ModelNames> | ModelNames[]
116
+ belongsToMany: BelongsToMany<ModelNames> | ModelNames[]
117
+ }
118
+ export declare interface ApiSettings {
119
+ uri: string
120
+ middleware: string[]
121
+ routes:
122
+ | {
123
+ [key in ApiRoutes]: Action
124
+ }
125
+ | string[]
126
+ openApi: boolean
127
+ }
128
+ export declare interface TimestampOptions {
129
+ createdAt?: string
130
+ updatedAt?: string
131
+ deletedAt?: string
132
+ }
133
+ declare interface ValidatorMessage {
134
+ [key: string]: string
135
+ }
136
+ export declare interface SoftDeleteOptions {
137
+ deletedAt?: string
138
+ }
139
+ declare interface Base {}
140
+ /**
141
+ * Model.
142
+ */
143
+ export declare interface ModelOptions extends Base {
144
+ name: string
145
+ description?: string
146
+ table?: string
147
+ primaryKey?: string
148
+ autoIncrement?: boolean
149
+ indexes?: CompositeIndex[]
150
+ dashboard?: {
151
+ highlight?: boolean | number
152
+ }
153
+ traits?: {
154
+ useUuid?: boolean
155
+ useTimestamps?: boolean | TimestampOptions
156
+ timestampable?: boolean | TimestampOptions
157
+ useSoftDeletes?: boolean | SoftDeleteOptions
158
+ softDeletable?: boolean | SoftDeleteOptions
159
+ categorizable?: boolean
160
+ taggable?: boolean
161
+ commentables?: boolean
162
+ useAuth?: boolean | UserAuthOptions
163
+ authenticatable?: boolean | UserAuthOptions
164
+ useSeeder?: boolean | SeedOptions
165
+ seedable?: boolean | SeedOptions
166
+ useSearch?: boolean | SearchOptions
167
+ useSocials?: SocialOptions
168
+ searchable?: boolean | SearchOptions
169
+ useApi?: ApiOptions | boolean
170
+ observe?: string[] | boolean
171
+ billable?: boolean
172
+ useActivityLog?: boolean | ActivityLogOption
173
+ likeable?: boolean | LikeableOptions
174
+ }
175
+ attributes?: AttributesElements
176
+ hasOne?: HasOne<ModelNames> | ModelNames[]
177
+ hasMany?: HasMany<ModelNames> | ModelNames[]
178
+ belongsTo?: BelongsTo<ModelNames> | ModelNames[]
179
+ belongsToMany?: BelongsToMany<ModelNames> | ModelNames[]
180
+ hasOneThrough?: HasOneThrough<ModelNames> | ModelNames[]
181
+ hasManyThrough?: HasManyThrough<ModelNames> | ModelNames[]
182
+ morphOne?: MorphOne<ModelNames> | ModelNames
183
+ morphMany?: MorphMany<ModelNames>[] | ModelNames[]
184
+ morphTo?: MorphTo
185
+ morphToMany?: MorphToMany<ModelNames> | ModelNames[]
186
+ morphedByMany?: MorphedByMany<ModelNames> | ModelNames[]
187
+ scopes?: {
188
+ [key: string]: (value: any) => any
189
+ }
190
+ get?: {
191
+ [key: string]: (value: any) => any
192
+ }
193
+ set?: {
194
+ [key: string]: (value: any) => any
195
+ }
196
+ }
197
+ export declare interface Attribute {
198
+ default?: string | number | boolean | Date
199
+ unique?: boolean
200
+ order?: number
201
+ hidden?: boolean
202
+ fillable?: boolean
203
+ guarded?: boolean
204
+ factory?: (faker: Faker) => any
205
+ validation: {
206
+ rule: ValidationType
207
+ message?: ValidatorMessage
208
+ }
209
+ }
210
+ export declare interface CompositeIndex {
211
+ name: string
212
+ columns: string[]
213
+ }
214
+ export declare interface AttributesElements {
215
+ [key: string]: Attribute
216
+ }
217
+ export declare interface RelationConfig {
218
+ relationship: string
219
+ model: string
220
+ table: TableNames
221
+ relationModel?: string
222
+ relationTable?: string
223
+ foreignKey: string
224
+ modelKey: string
225
+ pivotKey?: string
226
+ pivotForeign?: string
227
+ relationName?: string
228
+ throughModel?: string
229
+ throughForeignKey?: string
230
+ pivotTable: TableNames
231
+ }
232
+ /**
233
+ * Model definition type - compatible with bun-query-builder
234
+ *
235
+ * Models can be defined in app/Models/ (userland; overrides defaults by name)
236
+ * or storage/framework/defaults/app/Models/ (framework defaults), and are used
237
+ * to generate the ORM classes, migrations, and API routes.
238
+ */
239
+ export type Model = Partial<ModelOptions>;
240
+ declare type ActionPath = string;
241
+ declare type ActionName = string;
242
+ declare type Action = ActionPath | ActionName | undefined;
243
+ export type ApiRoutes = 'index' | 'show' | 'store' | 'update' | 'destroy';
244
+ export type SocialProviders = 'google' | 'github' | 'twitter' | 'facebook';
245
+ declare type LogAttribute = string;
246
+ export type SocialOptions = SocialProviders[];
247
+ declare type ApiOptions = DeepPartial<ApiSettings>;
248
+ /**
249
+ * Type alias for a collection of models
250
+ */
251
+ export type ModelRecord = Record<string, Model>;
@@ -1,6 +1,5 @@
1
1
  export declare interface NotificationOptions {
2
2
  default: 'email' | 'sms' | 'chat' | string
3
-
4
3
  email: {
5
4
  default:
6
5
  | 'emailjs'
@@ -13,12 +12,10 @@ export declare interface NotificationOptions {
13
12
  | 'sendgrid'
14
13
  | 'ses'
15
14
  | string
16
-
17
15
  from: {
18
16
  name: string
19
17
  address: string
20
18
  }
21
-
22
19
  drivers: {
23
20
  smtp: {
24
21
  host: string
@@ -29,12 +26,10 @@ export declare interface NotificationOptions {
29
26
  pass: string
30
27
  }
31
28
  }
32
-
33
29
  sendgrid: {
34
30
  key: string
35
31
  senderName: string
36
32
  }
37
-
38
33
  emailjs: {
39
34
  host: string
40
35
  user: string
@@ -42,26 +37,21 @@ export declare interface NotificationOptions {
42
37
  port: number
43
38
  secure: boolean
44
39
  }
45
-
46
40
  mailgun: {
47
41
  key: string
48
42
  domain: string
49
43
  username: string
50
44
  }
51
-
52
45
  mailjet: {
53
46
  key: string
54
47
  secret: string
55
48
  }
56
-
57
49
  mandrill: {
58
50
  key: string
59
51
  }
60
-
61
52
  netcore: {
62
53
  key: string
63
54
  }
64
-
65
55
  nodemailer: {
66
56
  host: string
67
57
  user: string
@@ -69,11 +59,9 @@ export declare interface NotificationOptions {
69
59
  port: number
70
60
  secure: boolean
71
61
  }
72
-
73
62
  postmark: {
74
63
  key: string
75
64
  }
76
-
77
65
  ses: {
78
66
  region: string
79
67
  key: string
@@ -81,71 +69,58 @@ export declare interface NotificationOptions {
81
69
  }
82
70
  }
83
71
  }
84
-
85
72
  sms: {
86
73
  default: 'twilio' | 'nexmo' | 'gupshup' | 'plivo' | 'sms77' | 'sns' | 'telnyx' | 'termii' | string
87
74
  from: string
88
-
89
75
  drivers: {
90
76
  twilio: {
91
77
  sid: string
92
78
  authToken: string
93
79
  }
94
-
95
80
  nexmo: {
96
81
  key: string
97
82
  secret: string
98
83
  }
99
-
100
84
  gupshup: {
101
85
  user: string
102
86
  password: string
103
87
  }
104
-
105
88
  plivo: {
106
89
  sid: string
107
90
  authToken: string
108
91
  }
109
-
110
92
  sms77: {
111
93
  key: string
112
94
  }
113
-
114
95
  sns: {
115
96
  region: string
116
97
  key: string
117
98
  secret: string
118
99
  }
119
-
120
100
  telnyx: {
121
101
  key: string
122
102
  messageProfileId: string
123
103
  }
124
-
125
104
  termii: {
126
105
  key: string
127
106
  }
128
107
  }
129
108
  }
130
-
131
109
  chat: {
132
110
  default: 'slack' | 'msTeams' | 'discord' | string
133
111
  from: string
134
-
135
112
  drivers: {
136
113
  slack?: {
137
114
  appId: string
138
115
  clientId: string
139
116
  secret: string
140
117
  }
141
-
142
118
  msTeams?: {
143
119
  appId: string
144
120
  clientId: string
145
121
  secret: string
146
122
  }
147
-
148
123
  }
149
124
  }
150
125
  }
151
- export declare type NotificationConfig = Partial<NotificationOptions>
126
+ export type NotificationConfig = Partial<NotificationOptions>;