@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.
- package/dist/index.js +1 -1
- package/dist/src/ai.d.ts +37 -0
- package/dist/src/analytics.d.ts +36 -0
- package/dist/src/api.d.ts +26 -0
- package/dist/src/app.d.ts +28 -0
- package/dist/src/attributes.d.ts +1 -0
- package/dist/src/auth.d.ts +49 -0
- package/dist/src/auto-imports.d.ts +8 -0
- package/dist/{binary.d.ts → src/binary.d.ts} +4 -1
- package/dist/src/cache.d.ts +79 -0
- package/dist/{cdn.d.ts → src/cdn.d.ts} +1 -1
- package/dist/{chat.d.ts → src/chat.d.ts} +29 -48
- package/dist/src/cli.d.ts +308 -0
- package/dist/{cloud.d.ts → src/cloud.d.ts} +81 -26
- package/dist/{components.d.ts → src/components.d.ts} +1 -4
- package/dist/{configure.d.ts → src/configure.d.ts} +1 -1
- package/dist/{cron-jobs.d.ts → src/cron-jobs.d.ts} +33 -37
- package/dist/src/dashboard.d.ts +33 -0
- package/dist/{database.d.ts → src/database.d.ts} +20 -12
- package/dist/src/dependencies.d.ts +17 -0
- package/dist/src/deploy.d.ts +16 -0
- package/dist/{dns.d.ts → src/dns.d.ts} +59 -59
- package/dist/src/docs.d.ts +23 -0
- package/dist/src/email.d.ts +201 -0
- package/dist/src/env.d.ts +1 -0
- package/dist/{errors.d.ts → src/errors.d.ts} +17 -24
- package/dist/src/events.d.ts +31 -0
- package/dist/src/exit-code.d.ts +10 -0
- package/dist/{file-systems.d.ts → src/file-systems.d.ts} +10 -6
- package/dist/{git.d.ts → src/git.d.ts} +9 -6
- package/dist/src/hashing.d.ts +57 -0
- package/dist/src/helpers.d.ts +1 -0
- package/dist/src/i18n.d.ts +65 -0
- package/dist/src/index.d.ts +70 -0
- package/dist/{library.d.ts → src/library.d.ts} +31 -33
- package/dist/src/logging.d.ts +12 -0
- package/dist/{manifest.d.ts → src/manifest.d.ts} +4 -1
- package/dist/src/model-names.d.ts +1 -0
- package/dist/src/model.d.ts +251 -0
- package/dist/{notifications.d.ts → src/notifications.d.ts} +1 -26
- package/dist/src/oauth.d.ts +290 -0
- package/dist/{pages.d.ts → src/pages.d.ts} +1 -1
- package/dist/src/payments.d.ts +322 -0
- package/dist/src/phone.d.ts +52 -0
- package/dist/src/ports.d.ts +20 -0
- package/dist/src/promise.d.ts +1 -0
- package/dist/src/push.d.ts +108 -0
- package/dist/src/queue.d.ts +310 -0
- package/dist/src/reactivity.d.ts +1 -0
- package/dist/src/realtime.d.ts +443 -0
- package/dist/src/request.d.ts +154 -0
- package/dist/{response.d.ts → src/response.d.ts} +1 -1
- package/dist/src/router.d.ts +105 -0
- package/dist/{saas.d.ts → src/saas.d.ts} +2 -2
- package/dist/src/scheduler.d.ts +1 -0
- package/dist/{search-engine.d.ts → src/search-engine.d.ts} +41 -45
- package/dist/{security.d.ts → src/security.d.ts} +4 -8
- package/dist/{server.d.ts → src/server.d.ts} +1 -1
- package/dist/src/services.d.ts +140 -0
- package/dist/{settings-config.d.ts → src/settings-config.d.ts} +1 -1
- package/dist/src/sms.d.ts +144 -0
- package/dist/src/stack-extensions.d.ts +137 -0
- package/dist/src/stacks.d.ts +40 -0
- package/dist/src/storage.d.ts +105 -0
- package/dist/src/table-names.d.ts +1 -0
- package/dist/src/tables.d.ts +34 -0
- package/dist/src/team.d.ts +7 -0
- package/dist/src/ui.d.ts +55 -0
- package/dist/src/utils.d.ts +39 -0
- package/package.json +13 -32
- package/src/ai.ts +20 -6
- package/src/analytics.ts +38 -1
- package/src/app.ts +38 -0
- package/src/attributes.ts +5 -1
- package/src/auth.ts +122 -0
- package/src/auto-imports.ts +8 -1
- package/src/cache.ts +226 -69
- package/src/chat.ts +0 -20
- package/src/cli.ts +24 -9
- package/src/cloud.ts +40 -1
- package/src/components.ts +3 -5
- package/src/cron-jobs.ts +1 -1
- package/src/dashboard.ts +40 -0
- package/src/database.ts +18 -2
- package/src/dns.ts +1 -1
- package/src/docs.ts +3 -3
- package/src/email.ts +303 -13
- package/src/errors.ts +2 -3
- package/src/events.ts +10 -5
- package/src/git.ts +3 -3
- package/src/hashing.ts +15 -19
- package/src/i18n.ts +105 -3
- package/src/index.ts +9 -5
- package/src/library.ts +0 -5
- package/src/model-names.ts +1 -1
- package/src/model.ts +87 -10
- package/src/oauth.ts +488 -0
- package/src/payments.ts +370 -27
- package/src/phone.ts +62 -0
- package/src/push.ts +107 -0
- package/src/queue.ts +386 -28
- package/src/reactivity.ts +1 -1
- package/src/realtime.ts +584 -0
- package/src/request.ts +344 -22
- package/src/router.ts +62 -4
- package/src/search-engine.ts +13 -13
- package/src/services.ts +100 -5
- package/src/sms.ts +263 -3
- package/src/stack-extensions.ts +184 -0
- package/src/stacks.ts +34 -4
- package/src/storage.ts +140 -6
- package/src/table-names.ts +1 -1
- package/src/ui.ts +20 -12
- package/src/utils.ts +1 -1
- package/dist/ai.d.ts +0 -20
- package/dist/analytics.d.ts +0 -13
- package/dist/api.d.ts +0 -26
- package/dist/app.d.ts +0 -32
- package/dist/attributes.d.ts +0 -1
- package/dist/auto-imports.d.ts +0 -1
- package/dist/build.d.ts +0 -2
- package/dist/cache.d.ts +0 -49
- package/dist/cli.d.ts +0 -310
- package/dist/dependencies.d.ts +0 -16
- package/dist/deploy.d.ts +0 -10
- package/dist/docs.d.ts +0 -26
- package/dist/email.d.ts +0 -107
- package/dist/events.d.ts +0 -5
- package/dist/exit-code.d.ts +0 -5
- package/dist/hashing.d.ts +0 -36
- package/dist/helpers.d.ts +0 -1
- package/dist/i18n.d.ts +0 -11
- package/dist/index.d.ts +0 -65
- package/dist/inspect.d.ts +0 -3
- package/dist/logging.d.ts +0 -6
- package/dist/model-names.d.ts +0 -1
- package/dist/model.d.ts +0 -232
- package/dist/payments.d.ts +0 -94
- package/dist/ports.d.ts +0 -13
- package/dist/promise.d.ts +0 -1
- package/dist/push.d.ts +0 -35
- package/dist/pwa.d.ts +0 -3
- package/dist/queue.d.ts +0 -45
- package/dist/reactivity.d.ts +0 -1
- package/dist/request.d.ts +0 -49
- package/dist/router.d.ts +0 -65
- package/dist/scheduler.d.ts +0 -1
- package/dist/services.d.ts +0 -81
- package/dist/ssg.d.ts +0 -3
- package/dist/stacks.d.ts +0 -54
- package/dist/storage.d.ts +0 -31
- package/dist/table-names.d.ts +0 -1
- package/dist/tables.d.ts +0 -34
- package/dist/team.d.ts +0 -8
- package/dist/ui.d.ts +0 -47
- package/dist/utils.d.ts +0 -27
- package/src/build.ts +0 -2
- package/src/inspect.ts +0 -10
- package/src/layout.ts +0 -8
- package/src/pwa.ts +0 -8
- package/src/ssg.ts +0 -3
|
@@ -5,7 +5,7 @@ export declare interface SaasOption {
|
|
|
5
5
|
pricing: {
|
|
6
6
|
key: string
|
|
7
7
|
price: number
|
|
8
|
-
interval?: 'day' | 'month' | 'week' | 'year'
|
|
8
|
+
interval?: 'day' | 'month' | 'week' | 'year'
|
|
9
9
|
currency: string
|
|
10
10
|
}[]
|
|
11
11
|
metadata: {
|
|
@@ -29,4 +29,4 @@ export declare interface SaasOption {
|
|
|
29
29
|
images: string[]
|
|
30
30
|
}[]
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type SaasConfig = Partial<SaasOption>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Schedule } from '@stacksjs/scheduler';
|
|
@@ -1,38 +1,57 @@
|
|
|
1
|
+
import type { Dictionary, DocumentOptions, EnqueuedTask, Faceting, Hits, Index, IndexesResults, IndexOptions, MeiliSearch, Settings as MeilisearchOptions, PaginationSettings, DocumentOptions as RecordOptions, SearchParams, SearchResponse, Settings, Synonyms, TypoTolerance } from 'meilisearch';
|
|
1
2
|
import type { MaybePromise } from '.';
|
|
2
|
-
|
|
3
3
|
export type {
|
|
4
|
+
EnqueuedTask,
|
|
5
|
+
Hits,
|
|
6
|
+
Index,
|
|
7
|
+
IndexesResults,
|
|
8
|
+
IndexOptions,
|
|
9
|
+
MeiliSearch,
|
|
10
|
+
MeilisearchOptions,
|
|
11
|
+
RecordOptions,
|
|
12
|
+
SearchParams,
|
|
13
|
+
SearchResponse,
|
|
14
|
+
};
|
|
15
|
+
// type Search = any
|
|
16
|
+
// type Page = any
|
|
17
|
+
// type Pages = Page[]
|
|
18
|
+
// type Filter = any
|
|
19
|
+
// type Filters = Filter[]
|
|
20
|
+
// type Result = any
|
|
21
|
+
// type Results = Result[]
|
|
22
|
+
// type SearchFilter = any
|
|
23
|
+
// type SearchFilters = SearchFilter[]
|
|
24
|
+
// type Sorts = any
|
|
25
|
+
// type Sort = any
|
|
4
26
|
export declare interface SearchEngineOptions {
|
|
5
|
-
driver: 'opensearch'
|
|
6
|
-
|
|
7
|
-
|
|
27
|
+
driver: 'meilisearch' | 'algolia' | 'opensearch'
|
|
8
28
|
opensearch?: {
|
|
9
29
|
host: string
|
|
10
30
|
protocol: number
|
|
11
31
|
port: number
|
|
12
32
|
auth: string
|
|
13
33
|
}
|
|
14
|
-
|
|
15
34
|
meilisearch?: {
|
|
16
35
|
host: string
|
|
17
|
-
protocol
|
|
18
|
-
port
|
|
19
|
-
auth
|
|
36
|
+
protocol?: number
|
|
37
|
+
port?: number
|
|
38
|
+
auth?: string
|
|
20
39
|
apiKey: string
|
|
21
40
|
}
|
|
22
|
-
|
|
41
|
+
algolia?: {
|
|
42
|
+
appId: string
|
|
43
|
+
apiKey: string
|
|
44
|
+
searchOnlyApiKey?: string
|
|
45
|
+
}
|
|
23
46
|
filters?: {
|
|
24
47
|
[key: string]: string
|
|
25
48
|
}
|
|
26
|
-
|
|
27
49
|
perPage?: number
|
|
28
50
|
}
|
|
29
|
-
export declare
|
|
30
|
-
|
|
31
|
-
export interface SearchEngineDriver {
|
|
51
|
+
export declare interface SearchEngineDriver {
|
|
32
52
|
client: () => MeiliSearch
|
|
33
|
-
|
|
53
|
+
resetClient?: () => void
|
|
34
54
|
search: (index: string, params: any) => Promise<SearchResponse<Record<string, any>>>
|
|
35
|
-
|
|
36
55
|
createIndex: (name: string, options?: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
37
56
|
getIndex: (name: string) => Promise<Index<Record<string, any>>>
|
|
38
57
|
addDocument: (indexName: string, params: any) => Promise<EnqueuedTask>
|
|
@@ -45,82 +64,59 @@ export interface SearchEngineDriver {
|
|
|
45
64
|
updateIndex: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
46
65
|
deleteIndex: (name: string) => MaybePromise<EnqueuedTask>
|
|
47
66
|
listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>
|
|
48
|
-
listAllIndices: () => MaybePromise<IndexesResults<Index[]>>
|
|
49
|
-
|
|
67
|
+
listAllIndices: () => MaybePromise<IndexesResults<Index[]>>
|
|
50
68
|
getFilterableAttributes: (index: string) => Promise<string[]>
|
|
51
69
|
updateFilterableAttributes: (index: string, filterableAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
52
70
|
resetFilterableAttributes: (index: string) => Promise<EnqueuedTask>
|
|
53
|
-
|
|
54
71
|
updateSearchableAttributes: (index: string, searchableAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
55
72
|
resetSearchableAttributes: (index: string) => Promise<EnqueuedTask>
|
|
56
73
|
getSearchableAttributes: (index: string) => Promise<string[]>
|
|
57
|
-
|
|
58
74
|
updateSortableAttributes: (index: string, sortableAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
59
75
|
resetSortableAttributes: (index: string) => Promise<EnqueuedTask>
|
|
60
76
|
getSortableAttributes: (index: string) => Promise<string[]>
|
|
61
|
-
|
|
62
77
|
updateDisplayedAttributes: (index: string, displayedAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
63
78
|
getDisplayedAttributes: (index: string) => Promise<string[]>
|
|
64
79
|
resetDisplayedAttributes: (index: string) => Promise<EnqueuedTask>
|
|
65
|
-
|
|
66
80
|
getSettings: (index: string) => Promise<Settings>
|
|
67
81
|
updateSettings: (index: string, settings: Settings) => Promise<EnqueuedTask>
|
|
68
82
|
resetSettings: (index: string) => Promise<EnqueuedTask>
|
|
69
|
-
å
|
|
70
83
|
getPagination: (index: string) => Promise<PaginationSettings>
|
|
71
84
|
updatePagination: (index: string, pagination: PaginationSettings) => Promise<EnqueuedTask>
|
|
72
85
|
resetPagination: (index: string) => Promise<EnqueuedTask>
|
|
73
|
-
|
|
74
86
|
getSynonyms: (index: string) => Promise<any>
|
|
75
87
|
updateSynonyms: (index: string, synonyms: Synonyms) => Promise<EnqueuedTask>
|
|
76
88
|
resetSynonyms: (index: string) => Promise<EnqueuedTask>
|
|
77
|
-
|
|
78
89
|
getRankingRules: (index: string) => Promise<string[]>
|
|
79
90
|
updateRankingRules: (index: string, rankingRules: string[] | null) => Promise<EnqueuedTask>
|
|
80
91
|
resetRankingRules: (index: string) => Promise<EnqueuedTask>
|
|
81
|
-
|
|
82
92
|
getDistinctAttribute: (index: string) => Promise<string | null>
|
|
83
93
|
updateDistinctAttribute: (index: string, distinctAttribute: string | null) => Promise<EnqueuedTask>
|
|
84
94
|
resetDistinctAttribute: (index: string) => Promise<EnqueuedTask>
|
|
85
|
-
|
|
86
95
|
getFaceting: (index: string) => Promise<Faceting>
|
|
87
96
|
updateFaceting: (index: string, faceting: Faceting) => Promise<EnqueuedTask>
|
|
88
97
|
resetFaceting: (index: string) => Promise<EnqueuedTask>
|
|
89
|
-
|
|
90
98
|
getTypoTolerance: (index: string) => Promise<TypoTolerance>
|
|
91
99
|
updateTypoTolerance: (index: string, typoTolerance: TypoTolerance | null) => Promise<EnqueuedTask>
|
|
92
100
|
resetTypoTolerance: (index: string) => Promise<EnqueuedTask>
|
|
93
|
-
|
|
94
101
|
getDictionary: (index: string) => Promise<Dictionary>
|
|
95
102
|
updateDictionary: (index: string, dictionary: Dictionary | null) => Promise<EnqueuedTask>
|
|
96
103
|
resetDictionary: (index: string) => Promise<EnqueuedTask>
|
|
97
|
-
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
/**
|
|
106
|
+
* This interface is used to unify the persisting of data to localStorage
|
|
107
|
+
*/
|
|
108
|
+
export declare interface SearchEngineStorage {
|
|
101
109
|
index?: string
|
|
102
110
|
results?: SearchResponse
|
|
103
111
|
hits?: Hits
|
|
104
112
|
perPage: number
|
|
105
113
|
currentPage: number
|
|
106
114
|
}
|
|
107
|
-
|
|
108
|
-
export interface SearchOptions {
|
|
115
|
+
export declare interface SearchOptions {
|
|
109
116
|
displayable: string[]
|
|
110
117
|
searchable: string[]
|
|
111
118
|
sortable: string[]
|
|
112
119
|
filterable: string[]
|
|
113
120
|
options?: SearchEngineOptions
|
|
114
121
|
}
|
|
115
|
-
|
|
116
|
-
EnqueuedTask,
|
|
117
|
-
Hits,
|
|
118
|
-
Index,
|
|
119
|
-
IndexesResults,
|
|
120
|
-
IndexOptions,
|
|
121
|
-
MeiliSearch,
|
|
122
|
-
MeilisearchOptions,
|
|
123
|
-
RecordOptions,
|
|
124
|
-
SearchParams,
|
|
125
|
-
SearchResponse,
|
|
126
|
-
}
|
|
122
|
+
export type SearchEngineConfig = Partial<SearchEngineOptions>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { CountryCode } from './cloud';
|
|
2
2
|
import type { DeepPartial } from './utils';
|
|
3
|
-
|
|
4
3
|
export declare interface FirewallOptions {
|
|
5
|
-
enabled: boolean
|
|
4
|
+
enabled: boolean
|
|
6
5
|
countryCodes: CountryCode[]
|
|
7
6
|
ipAddresses: string[]
|
|
8
7
|
queryString: string[]
|
|
@@ -11,12 +10,9 @@ export declare interface FirewallOptions {
|
|
|
11
10
|
useIpReputationLists: boolean
|
|
12
11
|
useKnownBadInputsRuleSet: boolean
|
|
13
12
|
}
|
|
14
|
-
export declare
|
|
15
|
-
|
|
16
|
-
export interface SecurityOptions {
|
|
13
|
+
export declare interface SecurityOptions {
|
|
17
14
|
driver: 'aws'
|
|
18
|
-
|
|
19
15
|
firewall: FirewallOptions
|
|
20
16
|
}
|
|
21
|
-
|
|
22
|
-
export type SecurityConfig = DeepPartial<SecurityOptions
|
|
17
|
+
export type FirewallConfig = Partial<FirewallOptions>;
|
|
18
|
+
export type SecurityConfig = DeepPartial<SecurityOptions>;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export declare interface ServicesOptions {
|
|
2
|
+
algolia?: {
|
|
3
|
+
appId: string
|
|
4
|
+
apiKey: string
|
|
5
|
+
}
|
|
6
|
+
aws?: {
|
|
7
|
+
accountId: string
|
|
8
|
+
appId: string
|
|
9
|
+
apiKey: string
|
|
10
|
+
region: string
|
|
11
|
+
}
|
|
12
|
+
github?: {
|
|
13
|
+
clientId: string
|
|
14
|
+
clientSecret: string
|
|
15
|
+
redirectUrl: string
|
|
16
|
+
scopes?: string[]
|
|
17
|
+
}
|
|
18
|
+
google?: {
|
|
19
|
+
clientId: string
|
|
20
|
+
clientSecret: string
|
|
21
|
+
redirectUrl: string
|
|
22
|
+
scopes?: string[]
|
|
23
|
+
}
|
|
24
|
+
facebook?: {
|
|
25
|
+
clientId: string
|
|
26
|
+
clientSecret: string
|
|
27
|
+
redirectUrl: string
|
|
28
|
+
scopes?: string[]
|
|
29
|
+
}
|
|
30
|
+
twitter?: {
|
|
31
|
+
clientId: string
|
|
32
|
+
clientSecret: string
|
|
33
|
+
redirectUrl: string
|
|
34
|
+
scopes?: string[]
|
|
35
|
+
}
|
|
36
|
+
godaddy?: {
|
|
37
|
+
apiKey: string
|
|
38
|
+
apiSecret: string
|
|
39
|
+
}
|
|
40
|
+
hetzner: {
|
|
41
|
+
appId: string
|
|
42
|
+
apiKey: string
|
|
43
|
+
}
|
|
44
|
+
digitalOcean: {
|
|
45
|
+
appId: string
|
|
46
|
+
apiKey: string
|
|
47
|
+
}
|
|
48
|
+
mailgun?: {
|
|
49
|
+
apiKey?: string
|
|
50
|
+
domain?: string
|
|
51
|
+
endpoint?: string
|
|
52
|
+
maxRetries?: number
|
|
53
|
+
retryTimeout?: number
|
|
54
|
+
}
|
|
55
|
+
mailtrap?: {
|
|
56
|
+
token: string
|
|
57
|
+
host: string
|
|
58
|
+
inboxId?: string | number
|
|
59
|
+
maxRetries?: number
|
|
60
|
+
retryTimeout?: number
|
|
61
|
+
}
|
|
62
|
+
meilisearch?: {
|
|
63
|
+
appId: string
|
|
64
|
+
apiKey: string
|
|
65
|
+
}
|
|
66
|
+
sendgrid?: {
|
|
67
|
+
apiKey?: string
|
|
68
|
+
maxRetries?: number
|
|
69
|
+
retryTimeout?: number
|
|
70
|
+
}
|
|
71
|
+
ses?: {
|
|
72
|
+
region: string
|
|
73
|
+
credentials: {
|
|
74
|
+
accessKeyId?: string
|
|
75
|
+
secretAccessKey?: string
|
|
76
|
+
}
|
|
77
|
+
maxRetries?: number
|
|
78
|
+
retryTimeout?: number
|
|
79
|
+
}
|
|
80
|
+
smtp?: {
|
|
81
|
+
host: string
|
|
82
|
+
port: number
|
|
83
|
+
username?: string
|
|
84
|
+
password?: string
|
|
85
|
+
encryption?: 'tls' | 'ssl' | null
|
|
86
|
+
maxRetries?: number
|
|
87
|
+
retryTimeout?: number
|
|
88
|
+
}
|
|
89
|
+
slack?: {
|
|
90
|
+
appId?: string
|
|
91
|
+
clientId?: string
|
|
92
|
+
secretKey?: string
|
|
93
|
+
webhookUrl?: string
|
|
94
|
+
botToken?: string
|
|
95
|
+
maxRetries?: number
|
|
96
|
+
retryTimeout?: number
|
|
97
|
+
}
|
|
98
|
+
discord?: {
|
|
99
|
+
webhookUrl?: string
|
|
100
|
+
botToken?: string
|
|
101
|
+
maxRetries?: number
|
|
102
|
+
retryTimeout?: number
|
|
103
|
+
}
|
|
104
|
+
teams?: {
|
|
105
|
+
webhookUrl?: string
|
|
106
|
+
maxRetries?: number
|
|
107
|
+
retryTimeout?: number
|
|
108
|
+
}
|
|
109
|
+
expo?: {
|
|
110
|
+
accessToken?: string
|
|
111
|
+
}
|
|
112
|
+
fcm?: {
|
|
113
|
+
serverKey?: string
|
|
114
|
+
projectId?: string
|
|
115
|
+
clientEmail?: string
|
|
116
|
+
privateKey?: string
|
|
117
|
+
}
|
|
118
|
+
openai?: {
|
|
119
|
+
apiKey?: string
|
|
120
|
+
model?: string
|
|
121
|
+
embeddingModel?: string
|
|
122
|
+
baseUrl?: string
|
|
123
|
+
}
|
|
124
|
+
anthropic?: {
|
|
125
|
+
apiKey?: string
|
|
126
|
+
model?: string
|
|
127
|
+
maxTokens?: number
|
|
128
|
+
}
|
|
129
|
+
ollama?: {
|
|
130
|
+
host?: string
|
|
131
|
+
model?: string
|
|
132
|
+
embeddingModel?: string
|
|
133
|
+
}
|
|
134
|
+
stripe?: {
|
|
135
|
+
secretKey?: string
|
|
136
|
+
publicKey?: string
|
|
137
|
+
apiVersion?: string
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export type ServicesConfig = Partial<ServicesOptions>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export declare interface SmsMessage {
|
|
2
|
+
to: string | string[]
|
|
3
|
+
body: string
|
|
4
|
+
from?: string
|
|
5
|
+
mediaUrls?: string[]
|
|
6
|
+
statusCallback?: string
|
|
7
|
+
options?: Record<string, unknown>
|
|
8
|
+
}
|
|
9
|
+
export declare interface SmsSendResult {
|
|
10
|
+
success: boolean
|
|
11
|
+
messageId?: string
|
|
12
|
+
status?: SmsStatus
|
|
13
|
+
to: string
|
|
14
|
+
error?: string
|
|
15
|
+
provider: SmsProvider
|
|
16
|
+
segments?: number
|
|
17
|
+
price?: number
|
|
18
|
+
currency?: string
|
|
19
|
+
}
|
|
20
|
+
export declare interface SmsStatusUpdate {
|
|
21
|
+
messageId: string
|
|
22
|
+
to: string
|
|
23
|
+
status: SmsStatus
|
|
24
|
+
timestamp: Date
|
|
25
|
+
errorCode?: string
|
|
26
|
+
errorMessage?: string
|
|
27
|
+
}
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// Provider Configurations
|
|
30
|
+
// =============================================================================
|
|
31
|
+
export declare interface TwilioConfig {
|
|
32
|
+
accountSid: string
|
|
33
|
+
authToken: string
|
|
34
|
+
from?: string
|
|
35
|
+
messagingServiceSid?: string
|
|
36
|
+
statusCallback?: string
|
|
37
|
+
}
|
|
38
|
+
export declare interface VonageConfig {
|
|
39
|
+
apiKey: string
|
|
40
|
+
apiSecret: string
|
|
41
|
+
from?: string
|
|
42
|
+
applicationId?: string
|
|
43
|
+
privateKey?: string
|
|
44
|
+
}
|
|
45
|
+
export declare interface AwsSmsConfig {
|
|
46
|
+
region: string
|
|
47
|
+
accessKeyId?: string
|
|
48
|
+
secretAccessKey?: string
|
|
49
|
+
senderId?: string
|
|
50
|
+
originationNumber?: string
|
|
51
|
+
}
|
|
52
|
+
// =============================================================================
|
|
53
|
+
// SMS Options (Main Config)
|
|
54
|
+
// =============================================================================
|
|
55
|
+
export declare interface SmsTemplateConfig {
|
|
56
|
+
name: string
|
|
57
|
+
body: string
|
|
58
|
+
variables?: string[]
|
|
59
|
+
}
|
|
60
|
+
export declare interface SmsOptOutConfig {
|
|
61
|
+
enabled: boolean
|
|
62
|
+
keywords: string[]
|
|
63
|
+
}
|
|
64
|
+
export declare interface SmsTwoWayConfig {
|
|
65
|
+
enabled: boolean
|
|
66
|
+
webhookUrl?: string
|
|
67
|
+
snsTopicArn?: string
|
|
68
|
+
}
|
|
69
|
+
export declare interface SmsInboxConfig {
|
|
70
|
+
enabled: boolean
|
|
71
|
+
bucket: string
|
|
72
|
+
prefix?: string
|
|
73
|
+
retentionDays?: number
|
|
74
|
+
}
|
|
75
|
+
export declare interface SmsOptions {
|
|
76
|
+
enabled: boolean
|
|
77
|
+
provider: SmsProvider
|
|
78
|
+
from?: string
|
|
79
|
+
defaultCountryCode?: string
|
|
80
|
+
messageType?: 'TRANSACTIONAL' | 'PROMOTIONAL'
|
|
81
|
+
drivers: {
|
|
82
|
+
twilio?: TwilioConfig
|
|
83
|
+
vonage?: VonageConfig
|
|
84
|
+
pinpoint?: AwsSmsConfig
|
|
85
|
+
sns?: AwsSmsConfig
|
|
86
|
+
}
|
|
87
|
+
optOut?: SmsOptOutConfig
|
|
88
|
+
twoWay?: SmsTwoWayConfig
|
|
89
|
+
templates?: SmsTemplateConfig[]
|
|
90
|
+
inbox?: SmsInboxConfig
|
|
91
|
+
maxSpendPerMonth?: number
|
|
92
|
+
}
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// SMS Driver Interface
|
|
95
|
+
// =============================================================================
|
|
96
|
+
export declare interface SmsDriver {
|
|
97
|
+
send(message: SmsMessage): Promise<SmsSendResult>
|
|
98
|
+
sendBulk(messages: SmsMessage[]): Promise<SmsSendResult[]>
|
|
99
|
+
getStatus?(messageId: string): Promise<SmsStatusUpdate>
|
|
100
|
+
verify?(phoneNumber: string): Promise<{ valid: boolean, carrier?: string, type?: string }>
|
|
101
|
+
getBalance?(): Promise<{ balance: number, currency: string }>
|
|
102
|
+
}
|
|
103
|
+
// =============================================================================
|
|
104
|
+
// Verification Types (for 2FA/OTP)
|
|
105
|
+
// =============================================================================
|
|
106
|
+
export declare interface VerificationRequest {
|
|
107
|
+
to: string
|
|
108
|
+
channel?: 'sms' | 'call' | 'whatsapp'
|
|
109
|
+
codeLength?: number
|
|
110
|
+
locale?: string
|
|
111
|
+
customMessage?: string
|
|
112
|
+
}
|
|
113
|
+
export declare interface VerificationResult {
|
|
114
|
+
success: boolean
|
|
115
|
+
verificationId?: string
|
|
116
|
+
status: 'pending' | 'approved' | 'denied' | 'expired'
|
|
117
|
+
error?: string
|
|
118
|
+
}
|
|
119
|
+
export declare interface VerificationCheckRequest {
|
|
120
|
+
verificationId?: string
|
|
121
|
+
to: string
|
|
122
|
+
code: string
|
|
123
|
+
}
|
|
124
|
+
export declare interface SmsVerificationDriver {
|
|
125
|
+
startVerification(request: VerificationRequest): Promise<VerificationResult>
|
|
126
|
+
checkVerification(request: VerificationCheckRequest): Promise<VerificationResult>
|
|
127
|
+
cancelVerification?(verificationId: string): Promise<boolean>
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* SMS Service Configuration Types
|
|
131
|
+
* Supports Twilio, Vonage, and AWS providers
|
|
132
|
+
*/
|
|
133
|
+
// =============================================================================
|
|
134
|
+
// Core SMS Types
|
|
135
|
+
// =============================================================================
|
|
136
|
+
export type SmsProvider = 'twilio' | 'vonage' | 'pinpoint' | 'sns';
|
|
137
|
+
export type SmsStatus = | 'queued'
|
|
138
|
+
| 'sending'
|
|
139
|
+
| 'sent'
|
|
140
|
+
| 'delivered'
|
|
141
|
+
| 'failed'
|
|
142
|
+
| 'undelivered'
|
|
143
|
+
| 'unknown';
|
|
144
|
+
export type SmsConfig = Partial<SmsOptions>;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The central registry of known stack extensions.
|
|
3
|
+
*
|
|
4
|
+
* Third-party stack authors: submit a PR to add your stack here.
|
|
5
|
+
* Once merged, all Stacks users will get autocomplete for your stack name.
|
|
6
|
+
*/
|
|
7
|
+
export declare const stackExtensionRegistry: Record<string, StackRegistryEntry>;
|
|
8
|
+
// ─── Stack Extensions Registry ──────────────────────────────────────────────
|
|
9
|
+
//
|
|
10
|
+
// This is the central registry of known stack extensions. Third-party authors
|
|
11
|
+
// can submit a PR to add their stack here. Once merged, all Stacks users get
|
|
12
|
+
// autocomplete and type safety for the new stack name.
|
|
13
|
+
//
|
|
14
|
+
// To add your stack, add a new entry below following the pattern:
|
|
15
|
+
// 'your-stack-name': { package: '@your-org/your-stack', description: '...' },
|
|
16
|
+
//
|
|
17
|
+
// Requirements for PRs:
|
|
18
|
+
// - The package must be published to npm
|
|
19
|
+
// - The package.json must contain a valid `stacks` field with a `name`
|
|
20
|
+
// - The description should be concise (under 80 chars)
|
|
21
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
22
|
+
declare interface StackRegistryEntry {
|
|
23
|
+
package: string
|
|
24
|
+
description: string
|
|
25
|
+
github?: string
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Metadata for a stack extension, defined in the `stacks` field of a stack's package.json.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```json
|
|
32
|
+
* {
|
|
33
|
+
* "name": "@stacksjs/blog",
|
|
34
|
+
* "stacks": {
|
|
35
|
+
* "name": "blog",
|
|
36
|
+
* "description": "Blog functionality for Stacks",
|
|
37
|
+
* "directories": ["app", "config", "database", "resources"]
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare interface StackMeta {
|
|
43
|
+
name: KnownStackName
|
|
44
|
+
description?: string
|
|
45
|
+
version?: string
|
|
46
|
+
directories?: StackDirectory[]
|
|
47
|
+
hooks?: {
|
|
48
|
+
preInstall?: string
|
|
49
|
+
postInstall?: string
|
|
50
|
+
preUninstall?: string
|
|
51
|
+
postUninstall?: string
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Tracks a single installed stack in the lock file */
|
|
55
|
+
export declare interface StackManifestEntry {
|
|
56
|
+
packageName: string
|
|
57
|
+
name: string
|
|
58
|
+
version: string
|
|
59
|
+
installedAt: string
|
|
60
|
+
files: string[]
|
|
61
|
+
skipped: string[]
|
|
62
|
+
conflictStrategy: ConflictStrategy
|
|
63
|
+
}
|
|
64
|
+
/** The stacks.lock.json file format */
|
|
65
|
+
export declare interface StackLock {
|
|
66
|
+
version: 1
|
|
67
|
+
generatedAt: string
|
|
68
|
+
stacks: Record<string, StackManifestEntry>
|
|
69
|
+
}
|
|
70
|
+
export declare interface StackInstallOptions {
|
|
71
|
+
name: KnownStackName
|
|
72
|
+
conflict?: ConflictStrategy
|
|
73
|
+
force?: boolean
|
|
74
|
+
dryRun?: boolean
|
|
75
|
+
verbose?: boolean
|
|
76
|
+
}
|
|
77
|
+
export declare interface StackUninstallOptions {
|
|
78
|
+
name: KnownStackName
|
|
79
|
+
force?: boolean
|
|
80
|
+
verbose?: boolean
|
|
81
|
+
}
|
|
82
|
+
/** Display format for the `stack:list` command */
|
|
83
|
+
export declare interface StackListEntry {
|
|
84
|
+
name: string
|
|
85
|
+
packageName: string
|
|
86
|
+
version: string
|
|
87
|
+
description?: string
|
|
88
|
+
installed: boolean
|
|
89
|
+
installedAt?: string
|
|
90
|
+
fileCount?: number
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A stack extension entry in the registry (`config/stacks.ts`).
|
|
94
|
+
*
|
|
95
|
+
* Can be either:
|
|
96
|
+
* - A string (the stack name or package name)
|
|
97
|
+
* - A full object with name, URL, and GitHub repository
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* export default [
|
|
102
|
+
* 'blog', // shorthand — autocomplete from registry
|
|
103
|
+
* '@stacksjs/commerce', // scoped package shorthand
|
|
104
|
+
* { name: 'analytics', github: 'stacksjs/analytics-stack' },
|
|
105
|
+
* ] satisfies StackExtensionRegistry
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare interface StackExtensionEntry {
|
|
109
|
+
name: KnownStackName
|
|
110
|
+
url?: string
|
|
111
|
+
github?: string
|
|
112
|
+
package?: string
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Known top-level directories in a Stacks project that a stack extension can provide.
|
|
116
|
+
* Uses `(string & {})` to allow custom directories while still providing autocomplete.
|
|
117
|
+
*/
|
|
118
|
+
export type StackDirectory = | 'app'
|
|
119
|
+
| 'config'
|
|
120
|
+
| 'database'
|
|
121
|
+
| 'resources'
|
|
122
|
+
| 'routes'
|
|
123
|
+
| 'public'
|
|
124
|
+
| 'locales'
|
|
125
|
+
| 'docs'
|
|
126
|
+
| (string & {});
|
|
127
|
+
/**
|
|
128
|
+
* All known stack extension names, derived from the registry.
|
|
129
|
+
* Uses `(string & {})` to also accept any custom/unregistered stack name.
|
|
130
|
+
*/
|
|
131
|
+
export type KnownStackName = keyof typeof stackExtensionRegistry | (string & {});
|
|
132
|
+
export type ConflictStrategy = 'skip' | 'overwrite' | 'backup';
|
|
133
|
+
/**
|
|
134
|
+
* The registry type for `config/stacks.ts`.
|
|
135
|
+
* Accepts both string shorthands and full objects.
|
|
136
|
+
*/
|
|
137
|
+
export type StackExtensionRegistry = (KnownStackName | StackExtensionEntry)[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AiConfig, AnalyticsConfig, AppConfig, AuthConfig, BinaryConfig, CacheConfig, CloudConfig, DashboardConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, ErrorConfig, FilesystemsConfig, GitConfig, HashingConfig, LibraryConfig, LoggingConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, RealtimeConfig, SaasConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, Team, UiConfig } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* **Stacks Options**
|
|
4
|
+
*
|
|
5
|
+
* This configuration defines all of your Stacks options. Because Stacks is fully-typed,
|
|
6
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
7
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
8
|
+
*/
|
|
9
|
+
export declare interface StacksOptions {
|
|
10
|
+
ai: AiConfig
|
|
11
|
+
analytics: AnalyticsConfig
|
|
12
|
+
app: AppConfig
|
|
13
|
+
auth: AuthConfig
|
|
14
|
+
realtime: RealtimeConfig
|
|
15
|
+
cache: CacheConfig
|
|
16
|
+
cli: BinaryConfig
|
|
17
|
+
cloud: CloudConfig
|
|
18
|
+
dashboard: DashboardConfig
|
|
19
|
+
database: DatabaseConfig
|
|
20
|
+
dns: DnsConfig
|
|
21
|
+
docs: DocsConfig
|
|
22
|
+
email: EmailConfig
|
|
23
|
+
errors: ErrorConfig
|
|
24
|
+
git: GitConfig
|
|
25
|
+
hashing: HashingConfig
|
|
26
|
+
library: LibraryConfig
|
|
27
|
+
logging: LoggingConfig
|
|
28
|
+
notification: NotificationConfig
|
|
29
|
+
payment: PaymentConfig
|
|
30
|
+
ports: Ports
|
|
31
|
+
queue: QueueConfig
|
|
32
|
+
saas: SaasConfig
|
|
33
|
+
security: SecurityConfig
|
|
34
|
+
searchEngine: SearchEngineConfig
|
|
35
|
+
services: ServicesConfig
|
|
36
|
+
filesystems: FilesystemsConfig
|
|
37
|
+
team: Team
|
|
38
|
+
ui: UiConfig
|
|
39
|
+
}
|
|
40
|
+
export type StacksConfig = Partial<StacksOptions>;
|