@stacksjs/types 0.58.48 → 0.58.49
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.
- package/package.json +3 -2
- package/src/ai.ts +25 -0
- package/src/analytics.ts +21 -0
- package/src/api.ts +63 -0
- package/src/app.ts +172 -0
- package/src/auto-imports.ts +1 -0
- package/src/binary.ts +12 -0
- package/src/build.ts +2 -0
- package/src/cache.ts +98 -0
- package/src/cdn.ts +17 -0
- package/src/chat.ts +5 -0
- package/src/cli.ts +305 -0
- package/src/cloud.ts +85 -0
- package/src/components.ts +64 -0
- package/src/configure.ts +6 -0
- package/src/cron-jobs.ts +44 -0
- package/src/database.ts +45 -0
- package/src/dependencies.ts +69 -0
- package/src/deploy.ts +13 -0
- package/src/dns.ts +186 -0
- package/src/docs.ts +22 -0
- package/src/email.ts +16 -0
- package/src/env.ts +1 -0
- package/src/errors.ts +11 -0
- package/src/events.ts +30 -0
- package/src/exit-code.ts +10 -0
- package/src/file-systems.ts +70 -0
- package/src/git.ts +133 -0
- package/src/hashing.ts +131 -0
- package/src/helpers.ts +11 -0
- package/src/i18n.ts +19 -0
- package/src/index.ts +58 -0
- package/src/inspect.ts +10 -0
- package/src/layout.ts +8 -0
- package/src/library.ts +156 -0
- package/src/manifest.ts +9 -0
- package/src/model.ts +72 -0
- package/src/money.ts +3 -0
- package/src/native.ts +0 -0
- package/src/notifications.ts +147 -0
- package/src/pages.ts +10 -0
- package/src/payments.ts +65 -0
- package/src/promise.ts +1 -0
- package/src/push.ts +36 -0
- package/src/pwa.ts +8 -0
- package/src/queue.ts +36 -0
- package/src/reactivity.ts +1 -0
- package/src/router.ts +70 -0
- package/src/scheduler.ts +1 -0
- package/src/search-engine.ts +136 -0
- package/src/security.ts +23 -0
- package/src/services.ts +44 -0
- package/src/sms.ts +5 -0
- package/src/ssg.ts +3 -0
- package/src/stacks.ts +226 -0
- package/src/storage.ts +13 -0
- package/src/tables.ts +57 -0
- package/src/team.ts +8 -0
- package/src/ui.ts +197 -0
- package/src/utils.ts +47 -0
package/src/router.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface NitroEventHandler {
|
|
2
|
+
/**
|
|
3
|
+
* Path prefix or route
|
|
4
|
+
*
|
|
5
|
+
* If an empty string used, will be used as a middleware
|
|
6
|
+
*/
|
|
7
|
+
route?: string
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Specifies this is a middleware handler.
|
|
11
|
+
* Middleware are called on every route and should normally return nothing to pass to the next handlers
|
|
12
|
+
*/
|
|
13
|
+
middleware?: boolean
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Use lazy loading to import handler
|
|
17
|
+
*/
|
|
18
|
+
lazy?: boolean
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Path to event handler
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
handler: string
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Router method matcher
|
|
28
|
+
*/
|
|
29
|
+
method?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// need to refactor before, after, view to be a part of some other type
|
|
33
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'before' | 'after' | 'view'
|
|
34
|
+
|
|
35
|
+
export type RouteCallback = (params?: Record<string, any>) => any | string | object
|
|
36
|
+
|
|
37
|
+
export interface Route {
|
|
38
|
+
name: string
|
|
39
|
+
uri: string
|
|
40
|
+
url: string // used synonymously with uri
|
|
41
|
+
method: HttpMethod
|
|
42
|
+
pattern: RegExp
|
|
43
|
+
callback: RouteCallback
|
|
44
|
+
paramNames: string[]
|
|
45
|
+
middleware?: string | string[]
|
|
46
|
+
statusCode?: StatusCode
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface MiddlewareType {
|
|
50
|
+
name: string
|
|
51
|
+
priority: number
|
|
52
|
+
|
|
53
|
+
handle: Function
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500
|
|
57
|
+
export type RedirectCode = Extract<StatusCode, 301 | 302>
|
|
58
|
+
|
|
59
|
+
export type Middleware = () => void
|
|
60
|
+
|
|
61
|
+
export interface Middlewares {
|
|
62
|
+
logger: Middleware
|
|
63
|
+
auth: Middleware
|
|
64
|
+
[key: string]: Middleware
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface RouteGroupOptions {
|
|
68
|
+
prefix?: string
|
|
69
|
+
middleware?: Route['middleware']
|
|
70
|
+
}
|
package/src/scheduler.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Schedule, Scheduler } from '@stacksjs/scheduler'
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, DocumentOptions as RecordOptions, Settings as SearchEngineSettings, SearchParams, SearchResponse } from 'meilisearch'
|
|
2
|
+
import type { MaybePromise } from '.'
|
|
3
|
+
|
|
4
|
+
type Search = any
|
|
5
|
+
type Page = any
|
|
6
|
+
type Pages = Page[]
|
|
7
|
+
type Filter = any
|
|
8
|
+
type Filters = Filter[]
|
|
9
|
+
type Result = any
|
|
10
|
+
type Results = Result[]
|
|
11
|
+
type SearchFilter = any
|
|
12
|
+
type SearchFilters = SearchFilter[]
|
|
13
|
+
type Sorts = any
|
|
14
|
+
type Sort = any
|
|
15
|
+
|
|
16
|
+
export interface SearchEngineOptions {
|
|
17
|
+
/**
|
|
18
|
+
* **Search Engine Driver**
|
|
19
|
+
*
|
|
20
|
+
* The search engine to utilize.
|
|
21
|
+
*
|
|
22
|
+
* @default string 'meilisearch'
|
|
23
|
+
* @see https://stacksjs.org/docs/search-engine
|
|
24
|
+
*/
|
|
25
|
+
driver: 'meilisearch' | 'algolia' | 'opensearch'
|
|
26
|
+
|
|
27
|
+
meilisearch?: {
|
|
28
|
+
host: string
|
|
29
|
+
apiKey: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
openSearch?: {
|
|
33
|
+
host: string
|
|
34
|
+
protocol: number
|
|
35
|
+
port: number
|
|
36
|
+
auth: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
filters?: {
|
|
40
|
+
[key: string]: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The number of hits to be returned per page.
|
|
45
|
+
*
|
|
46
|
+
* @default number 20
|
|
47
|
+
*/
|
|
48
|
+
perPage?: number
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type SearchEngineConfig = Partial<SearchEngineOptions>
|
|
52
|
+
|
|
53
|
+
export interface SearchEngineDriver {
|
|
54
|
+
client: MeiliSearch
|
|
55
|
+
|
|
56
|
+
// Indexes
|
|
57
|
+
createIndex: (name: string, options?: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
58
|
+
getIndex: (name: string) => MaybePromise<Index>
|
|
59
|
+
updateIndex: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
60
|
+
deleteIndex: (name: string) => MaybePromise<EnqueuedTask>
|
|
61
|
+
updateIndexSettings: (name: string, settings: SearchEngineSettings) => MaybePromise<EnqueuedTask>
|
|
62
|
+
listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>
|
|
63
|
+
listAllIndices: () => MaybePromise<IndexesResults<Index[]>> // alternatives plural spelling
|
|
64
|
+
|
|
65
|
+
// Records (MeiliSearch uses the term "documents")
|
|
66
|
+
getRecord: (key: string) => MaybePromise<any>
|
|
67
|
+
getRecords: (key: string) => MaybePromise<RecordOptions>
|
|
68
|
+
createRecord: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>
|
|
69
|
+
createRecords: (records: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>
|
|
70
|
+
createOrReplaceRecord: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>
|
|
71
|
+
createOrUpdateRecord: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>
|
|
72
|
+
deleteRecord: (recordId: string | number, indexName: string) => MaybePromise<EnqueuedTask>
|
|
73
|
+
deleteAllRecords: (indexName: string) => MaybePromise<EnqueuedTask>
|
|
74
|
+
batchDeleteRecords: (recordIds: string[] | number[], indexName: string) => MaybePromise<EnqueuedTask>
|
|
75
|
+
|
|
76
|
+
// Search
|
|
77
|
+
search: (query: string, indexName: string, options: SearchParams) => MaybePromise<Search>
|
|
78
|
+
|
|
79
|
+
calculatePagination: Pages
|
|
80
|
+
currentPage: Page
|
|
81
|
+
filterName: string
|
|
82
|
+
filters: Filters
|
|
83
|
+
goToNextPage: () => Page
|
|
84
|
+
goToPage: (pageNumber: number) => Page
|
|
85
|
+
goToPrevPage: () => Page
|
|
86
|
+
hits: Hits
|
|
87
|
+
index: Index
|
|
88
|
+
lastPage: Page
|
|
89
|
+
perPage: number
|
|
90
|
+
query: string
|
|
91
|
+
results: Results // SearchResponse
|
|
92
|
+
searchFilters: SearchFilters
|
|
93
|
+
searchParams: SearchParams
|
|
94
|
+
setTotalHits: number
|
|
95
|
+
sort: Sort
|
|
96
|
+
sorts: Sorts
|
|
97
|
+
totalPages: number
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* This interface is used to unify the persisting of data to localStorage
|
|
102
|
+
*/
|
|
103
|
+
export interface SearchEngineStorage {
|
|
104
|
+
/**
|
|
105
|
+
* The search engine index name.
|
|
106
|
+
* i.e. the type of table, like `users`, `posts`, `products`, etc.
|
|
107
|
+
*/
|
|
108
|
+
index?: string
|
|
109
|
+
/**
|
|
110
|
+
* The search engine results object.
|
|
111
|
+
*/
|
|
112
|
+
results?: SearchResponse
|
|
113
|
+
/**
|
|
114
|
+
* The search engine hits object.
|
|
115
|
+
*/
|
|
116
|
+
hits?: Hits
|
|
117
|
+
/**
|
|
118
|
+
* The number of hits to be returned per page.
|
|
119
|
+
*
|
|
120
|
+
* @default number 20
|
|
121
|
+
*/
|
|
122
|
+
perPage: number
|
|
123
|
+
/**
|
|
124
|
+
* The current page number.
|
|
125
|
+
*
|
|
126
|
+
* @default number 1
|
|
127
|
+
*/
|
|
128
|
+
currentPage: number
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface MeiliSearchOptions {
|
|
132
|
+
apiKey: string
|
|
133
|
+
host: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, RecordOptions, SearchEngineSettings, SearchParams, SearchResponse }
|
package/src/security.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DeepPartial } from './utils'
|
|
2
|
+
import type { CountryCode } from './cloud'
|
|
3
|
+
|
|
4
|
+
export interface FirewallOptions {
|
|
5
|
+
enabled: boolean // default: true
|
|
6
|
+
countryCodes: CountryCode[]
|
|
7
|
+
ipAddresses: string[]
|
|
8
|
+
queryString: string[]
|
|
9
|
+
httpHeaders: string[]
|
|
10
|
+
// ipSets: string[]
|
|
11
|
+
rateLimitPerMinute: number
|
|
12
|
+
useIpReputationLists: boolean
|
|
13
|
+
useKnownBadInputsRuleSet: boolean
|
|
14
|
+
}
|
|
15
|
+
export type FirewallConfig = Partial<FirewallOptions>
|
|
16
|
+
|
|
17
|
+
export interface SecurityOptions {
|
|
18
|
+
driver: 'aws'
|
|
19
|
+
|
|
20
|
+
firewall: FirewallOptions
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type SecurityConfig = DeepPartial<SecurityOptions>
|
package/src/services.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ServicesOptions {
|
|
2
|
+
algolia?: {
|
|
3
|
+
appId: string
|
|
4
|
+
apiKey: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
godaddy?: {
|
|
8
|
+
apiKey: string
|
|
9
|
+
apiSecret: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
meilisearch?: {
|
|
13
|
+
appId: string
|
|
14
|
+
apiKey: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
stripe?: {
|
|
18
|
+
appId: string
|
|
19
|
+
apiKey: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
planetscale?: {
|
|
23
|
+
appId: string
|
|
24
|
+
apiKey: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
supabase?: {
|
|
28
|
+
appId: string
|
|
29
|
+
apiKey: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
aws?: {
|
|
33
|
+
accountId: string
|
|
34
|
+
appId: string
|
|
35
|
+
apiKey: string
|
|
36
|
+
region: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
novu?: {
|
|
40
|
+
key: string
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type ServicesConfig = Partial<ServicesOptions>
|
package/src/sms.ts
ADDED
package/src/ssg.ts
ADDED
package/src/stacks.ts
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AiConfig,
|
|
3
|
+
AnalyticsConfig,
|
|
4
|
+
AppConfig,
|
|
5
|
+
BinaryConfig,
|
|
6
|
+
CacheConfig,
|
|
7
|
+
CloudConfig,
|
|
8
|
+
DatabaseConfig,
|
|
9
|
+
DnsConfig,
|
|
10
|
+
DocsConfig,
|
|
11
|
+
EmailConfig,
|
|
12
|
+
GitConfig,
|
|
13
|
+
HashingConfig,
|
|
14
|
+
LibraryConfig,
|
|
15
|
+
NotificationConfig,
|
|
16
|
+
PaymentConfig,
|
|
17
|
+
QueueConfig,
|
|
18
|
+
SearchEngineConfig,
|
|
19
|
+
SecurityConfig,
|
|
20
|
+
ServicesConfig,
|
|
21
|
+
StorageConfig,
|
|
22
|
+
Team,
|
|
23
|
+
UiConfig,
|
|
24
|
+
} from '.'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* **Stacks Options**
|
|
28
|
+
*
|
|
29
|
+
* This configuration defines all of your Stacks options. Because Stacks is fully-typed,
|
|
30
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
31
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
32
|
+
*/
|
|
33
|
+
export interface StacksOptions {
|
|
34
|
+
ai: AiConfig
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* **Analytics Options**
|
|
38
|
+
*
|
|
39
|
+
* This configuration defines all of your Analytics options. Because Stacks is fully-typed, you
|
|
40
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
41
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
42
|
+
*/
|
|
43
|
+
analytics: AnalyticsConfig
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* **Application Options**
|
|
47
|
+
*
|
|
48
|
+
* This configuration defines all of your Application options. Because Stacks is fully-typed,
|
|
49
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
50
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
51
|
+
*/
|
|
52
|
+
app: AppConfig
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* **Binary Options**
|
|
56
|
+
*
|
|
57
|
+
* This configuration defines all of your Binary options. Because Stacks is fully-typed, you
|
|
58
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
59
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
60
|
+
*/
|
|
61
|
+
binary: BinaryConfig
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* **Cache Options**
|
|
65
|
+
*
|
|
66
|
+
* This configuration defines all of your Cache options. Because Stacks is fully-typed, you
|
|
67
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
68
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
69
|
+
*/
|
|
70
|
+
cache: CacheConfig
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* **Cloud Options**
|
|
74
|
+
*
|
|
75
|
+
* This configuration defines all of your Cloud options. Because Stacks is fully-typed, you
|
|
76
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
77
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
78
|
+
*/
|
|
79
|
+
cloud: CloudConfig
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* **Database Options**
|
|
83
|
+
*
|
|
84
|
+
* This configuration defines all of your Database options. Because Stacks is fully-typed, you
|
|
85
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
86
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
87
|
+
*/
|
|
88
|
+
database: DatabaseConfig
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* **DNS Options**
|
|
92
|
+
*
|
|
93
|
+
* This configuration defines all of your DNS options. Because Stacks is fully-typed, you
|
|
94
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
95
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
96
|
+
*/
|
|
97
|
+
dns: DnsConfig
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* **Docs Options**
|
|
101
|
+
*
|
|
102
|
+
* This configuration defines all of your Docs options. Because Stacks is fully-typed, you
|
|
103
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
104
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
105
|
+
*/
|
|
106
|
+
docs: DocsConfig
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* **Email Options**
|
|
110
|
+
*
|
|
111
|
+
* This configuration defines all of your Email options. Because Stacks is fully-typed, you
|
|
112
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
113
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
114
|
+
*/
|
|
115
|
+
email: EmailConfig
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* **Git Options**
|
|
119
|
+
*
|
|
120
|
+
* This configuration defines all of your Git options. Because Stacks is fully-typed, you
|
|
121
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
122
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
123
|
+
*/
|
|
124
|
+
git: GitConfig
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* **Hashing Options**
|
|
128
|
+
*
|
|
129
|
+
* This configuration defines all of your Hashing options. Because Stacks is fully-typed, you
|
|
130
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
131
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
132
|
+
*/
|
|
133
|
+
hashing: HashingConfig
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* **Library Options**
|
|
137
|
+
*
|
|
138
|
+
* This configuration defines all of your Library options. Because Stacks is fully-typed, you
|
|
139
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
140
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
141
|
+
*/
|
|
142
|
+
library: LibraryConfig
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* **Notification Options**
|
|
146
|
+
*
|
|
147
|
+
* This configuration defines all of your Notification options. Because Stacks is fully-typed,
|
|
148
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
149
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
150
|
+
*/
|
|
151
|
+
notification: NotificationConfig
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* **Payment Options**
|
|
155
|
+
*
|
|
156
|
+
* This configuration defines all of your Payment options. Because Stacks is fully-typed,
|
|
157
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
158
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
159
|
+
*/
|
|
160
|
+
payment: PaymentConfig
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* **Queue Options**
|
|
164
|
+
*
|
|
165
|
+
* This configuration defines all of your Queue options. Because Stacks is fully-typed,
|
|
166
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
167
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
168
|
+
*/
|
|
169
|
+
queue: QueueConfig
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* **Search Engine Options**
|
|
173
|
+
*
|
|
174
|
+
* This configuration defines all of your Search Engine options. Because Stacks is fully-typed,
|
|
175
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
176
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
177
|
+
*/
|
|
178
|
+
security: SecurityConfig
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* **Search Engine Options**
|
|
182
|
+
*
|
|
183
|
+
* This configuration defines all of your Search Engine options. Because Stacks is fully-typed,
|
|
184
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
185
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
186
|
+
*/
|
|
187
|
+
searchEngine: SearchEngineConfig
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* **Services Options**
|
|
191
|
+
*
|
|
192
|
+
* This configuration defines all of your Services options. Because Stacks is fully-typed,
|
|
193
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
194
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
195
|
+
*/
|
|
196
|
+
services: ServicesConfig
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* **Storage Options**
|
|
200
|
+
*
|
|
201
|
+
* This configuration defines all of your Storage options. Because Stacks is fully-typed,
|
|
202
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
203
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
204
|
+
*/
|
|
205
|
+
storage: StorageConfig
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* **Team Members**
|
|
209
|
+
*
|
|
210
|
+
* This configuration defines all of your Team members. Because Stacks is fully-typed, you
|
|
211
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
212
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
213
|
+
*/
|
|
214
|
+
team: Team
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* **UI Options**
|
|
218
|
+
*
|
|
219
|
+
* This configuration defines all of your UI options. Because Stacks is fully-typed, you
|
|
220
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
221
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
222
|
+
*/
|
|
223
|
+
ui: UiConfig
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export type StacksConfig = Partial<StacksOptions>
|
package/src/storage.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface StorageOptions {
|
|
2
|
+
/**
|
|
3
|
+
* **Storage Driver**
|
|
4
|
+
*
|
|
5
|
+
* The storage driver to utilize.
|
|
6
|
+
*
|
|
7
|
+
* @default string 's3'
|
|
8
|
+
* @see https://stacksjs.org/docs/storage
|
|
9
|
+
*/
|
|
10
|
+
driver: 's3' | 'efs' | 'local'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type StorageConfig = Partial<StorageOptions>
|
package/src/tables.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Hits, SearchResponse } from 'meilisearch'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* the TableStore interface is primarily used to unify the persisting of data to localStorage
|
|
5
|
+
*/
|
|
6
|
+
export interface TableStore {
|
|
7
|
+
/**
|
|
8
|
+
* The search engine index name.
|
|
9
|
+
* i.e. the type of table, like `users`, `posts`, `products`, etc.
|
|
10
|
+
*/
|
|
11
|
+
index: string
|
|
12
|
+
/**
|
|
13
|
+
* The search engine results object.
|
|
14
|
+
*/
|
|
15
|
+
results?: SearchResponse<Record<string, any>> // optional: the Meilisearch search response (defaults: {})
|
|
16
|
+
/**
|
|
17
|
+
* The search engine hits object.
|
|
18
|
+
*/
|
|
19
|
+
hits?: Hits
|
|
20
|
+
|
|
21
|
+
columns: string[] // used as table heads/column titles
|
|
22
|
+
source?: string // optional: the Meilisearch host name/address (defaults: http://127.0.0.1:7700)
|
|
23
|
+
password?: string // optional: the Meilisearch password (defaults: '')
|
|
24
|
+
searchable?: string | boolean // optional: determines whether the table displays the search bar (defaults: true)
|
|
25
|
+
query?: string // optional: the "query" (= search input) used to search the table (defaults: '')
|
|
26
|
+
sortable?: string | boolean // optional: determines whether the table displays the "table head"-sorts (defaults: true)
|
|
27
|
+
sort?: string // optional: the only active sort to be applied to the table (defaults: '')
|
|
28
|
+
sorts?: string | string[] // optional: the specific type of sorts to be applied to the table (defaults: [])
|
|
29
|
+
filterable?: string | boolean // optional: determines whether the table displays the filters component (defaults: true)
|
|
30
|
+
filters?: string | string[] // optional: the specific type of filters to be displayed/utilized in the table (defaults: [])
|
|
31
|
+
filterValue?: any[]// optional: the specific type of filters to be displayed/utilized in the table (defaults: [])
|
|
32
|
+
actionable?: string | boolean // optional: determines whether the table displays any "action items" (defaults: true)
|
|
33
|
+
actions?: string | string[] // optional: the specific type of actions to be displayed/utilized in the table (defaults: 'Edit, Delete')
|
|
34
|
+
perPage: number // optional: the number of rows (items) to be displayed per page (defaults: 10)
|
|
35
|
+
selectable?: string | boolean // optional: determines whether the table displays the checkboxes (defaults: true)
|
|
36
|
+
selectedRows?: number[] | string[] // optional: holds the selected rows (defaults: [])
|
|
37
|
+
selectedAll?: boolean // optional: determines whether all the rows are selected (defaults: false)
|
|
38
|
+
// stickyHeader?: string | boolean // optional: determines whether the table displays the sticky header (defaults: false)
|
|
39
|
+
// stickyFooter?: string | boolean // optional: determines whether the table displays the sticky footer (defaults: false)
|
|
40
|
+
goToNextPage: number
|
|
41
|
+
goToPage: number
|
|
42
|
+
goToPrevPage: number
|
|
43
|
+
lastPageNumber: number
|
|
44
|
+
searchFilters?: object
|
|
45
|
+
searchParams?: object
|
|
46
|
+
setTotalHits: number
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* The current page number
|
|
51
|
+
* @default 1
|
|
52
|
+
* @type {number}
|
|
53
|
+
* @memberof TableStore
|
|
54
|
+
* @example 1
|
|
55
|
+
*/
|
|
56
|
+
currentPage: number
|
|
57
|
+
}
|