@stacksjs/types 0.58.72 → 0.59.1
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/ai.d.ts +15 -0
- package/dist/analytics.d.ts +19 -0
- package/dist/api.d.ts +59 -0
- package/dist/app.d.ts +135 -0
- package/dist/auto-imports.d.ts +1 -0
- package/dist/binary.d.ts +11 -0
- package/dist/build.d.ts +2 -0
- package/dist/cache.d.ts +88 -0
- package/dist/cdn.d.ts +16 -0
- package/dist/chat.d.ts +4 -0
- package/dist/cli.d.ts +278 -0
- package/dist/cloud.d.ts +69 -0
- package/dist/components.d.ts +60 -0
- package/dist/configure.d.ts +12 -0
- package/dist/cron-jobs.d.ts +43 -0
- package/dist/database.d.ts +37 -0
- package/dist/dependencies.d.ts +62 -0
- package/dist/deploy.d.ts +12 -0
- package/dist/dns.d.ts +175 -0
- package/dist/docs.d.ts +22 -0
- package/dist/email.d.ts +14 -0
- package/dist/env.d.ts +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/events.d.ts +30 -0
- package/dist/exit-code.d.ts +10 -0
- package/dist/file-systems.d.ts +60 -0
- package/dist/git.d.ts +129 -0
- package/dist/hashing.d.ts +109 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/i18n.d.ts +19 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +14 -1791
- package/dist/inspect.d.ts +9 -0
- package/dist/library.d.ts +134 -0
- package/dist/logger.d.ts +49 -0
- package/dist/manifest.d.ts +9 -0
- package/dist/model.d.ts +70 -0
- package/dist/money.d.ts +2 -0
- package/dist/notifications.d.ts +117 -0
- package/dist/pages.d.ts +10 -0
- package/dist/payments.d.ts +60 -0
- package/dist/ports.d.ts +19 -0
- package/dist/promise.d.ts +1 -0
- package/dist/push.d.ts +35 -0
- package/dist/pwa.d.ts +7 -0
- package/dist/queue.d.ts +36 -0
- package/dist/reactivity.d.ts +1 -0
- package/dist/router.d.ts +78 -0
- package/dist/scheduler.d.ts +1 -0
- package/dist/search-engine.d.ts +118 -0
- package/dist/security.d.ts +18 -0
- package/dist/services.d.ts +33 -0
- package/dist/sms.d.ts +1 -0
- package/dist/ssg.d.ts +2 -0
- package/dist/stacks.d.ts +196 -0
- package/dist/storage.d.ts +12 -0
- package/dist/tables.d.ts +52 -0
- package/dist/team.d.ts +8 -0
- package/dist/ui.d.ts +165 -0
- package/dist/utils.d.ts +33 -0
- package/package.json +9 -10
- package/src/app.ts +0 -21
- package/src/chat.ts +1 -2
- package/src/cli.ts +21 -3
- package/src/cloud.ts +2 -0
- package/src/email.ts +5 -2
- package/src/index.ts +1 -1
- package/src/model.ts +19 -9
- package/src/ports.ts +19 -0
- package/src/router.ts +24 -4
- package/src/scheduler.ts +1 -1
- package/src/services.ts +0 -4
- package/src/sms.ts +3 -3
- package/src/stacks.ts +10 -0
- package/src/request.ts +0 -3
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Action } from '@stacksjs/actions';
|
|
2
|
+
import type { ActionPath } from '~/storage/framework/types/actions';
|
|
3
|
+
export interface NitroEventHandler {
|
|
4
|
+
/**
|
|
5
|
+
* Path prefix or route
|
|
6
|
+
*
|
|
7
|
+
* If an empty string used, will be used as a middleware
|
|
8
|
+
*/
|
|
9
|
+
route?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Specifies this is a middleware handler.
|
|
12
|
+
* Middleware are called on every route and should normally return nothing to pass to the next handlers
|
|
13
|
+
*/
|
|
14
|
+
middleware?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Use lazy loading to import handler
|
|
17
|
+
*/
|
|
18
|
+
lazy?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Path to event handler
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
handler: string;
|
|
24
|
+
/**
|
|
25
|
+
* Router method matcher
|
|
26
|
+
*/
|
|
27
|
+
method?: string;
|
|
28
|
+
}
|
|
29
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'before' | 'after' | 'view';
|
|
30
|
+
export type RouteCallback = (params?: Record<string, any>) => any | string | object;
|
|
31
|
+
export interface Route {
|
|
32
|
+
name: string;
|
|
33
|
+
uri: string;
|
|
34
|
+
url: string;
|
|
35
|
+
method: HttpMethod;
|
|
36
|
+
pattern: RegExp;
|
|
37
|
+
callback: RouteCallback | ActionPath | Action | Promise<any>;
|
|
38
|
+
paramNames: string[];
|
|
39
|
+
middleware?: string | string[];
|
|
40
|
+
statusCode?: StatusCode;
|
|
41
|
+
}
|
|
42
|
+
export interface MiddlewareOptions {
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
priority: number;
|
|
46
|
+
handle: Function;
|
|
47
|
+
}
|
|
48
|
+
export type StatusCode = 200 | 201 | 202 | 204 | 301 | 302 | 304 | 400 | 401 | 403 | 404 | 500;
|
|
49
|
+
export type RedirectCode = Extract<StatusCode, 301 | 302>;
|
|
50
|
+
export type MiddlewareFn = () => void;
|
|
51
|
+
export interface Middlewares {
|
|
52
|
+
logger: MiddlewareFn;
|
|
53
|
+
auth: MiddlewareFn;
|
|
54
|
+
[key: string]: MiddlewareFn;
|
|
55
|
+
}
|
|
56
|
+
export interface RouteGroupOptions {
|
|
57
|
+
prefix?: string;
|
|
58
|
+
middleware?: Route['middleware'];
|
|
59
|
+
}
|
|
60
|
+
type Prefix = string;
|
|
61
|
+
export interface RouterInterface {
|
|
62
|
+
get: (url: Route['url'], callback: Route['callback']) => Promise<this>;
|
|
63
|
+
post: (url: Route['url'], callback: Route['callback']) => this;
|
|
64
|
+
view: (url: Route['url'], callback: Route['callback']) => this;
|
|
65
|
+
redirect: (url: Route['url'], callback: Route['callback'], status?: RedirectCode) => this;
|
|
66
|
+
delete: (url: Route['url'], callback: Route['callback']) => this;
|
|
67
|
+
patch: (url: Route['url'], callback: Route['callback']) => this;
|
|
68
|
+
put: (url: Route['url'], callback: Route['callback']) => this;
|
|
69
|
+
email: (url: Route['url']) => Promise<this>;
|
|
70
|
+
health: () => Promise<this>;
|
|
71
|
+
job: (url: Route['url']) => Promise<this>;
|
|
72
|
+
action: (url: Route['url']) => Promise<this>;
|
|
73
|
+
group: (options: Prefix | RouteGroupOptions, callback: () => void) => this;
|
|
74
|
+
name: (name: string) => this;
|
|
75
|
+
middleware: (middleware: Route['middleware']) => this;
|
|
76
|
+
getRoutes: () => Promise<Route[]>;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Schedule } from '@stacksjs/scheduler';
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
type Search = any;
|
|
4
|
+
type Page = any;
|
|
5
|
+
type Pages = Page[];
|
|
6
|
+
type Filter = any;
|
|
7
|
+
type Filters = Filter[];
|
|
8
|
+
type Result = any;
|
|
9
|
+
type Results = Result[];
|
|
10
|
+
type SearchFilter = any;
|
|
11
|
+
type SearchFilters = SearchFilter[];
|
|
12
|
+
type Sorts = any;
|
|
13
|
+
type Sort = any;
|
|
14
|
+
export interface SearchEngineOptions {
|
|
15
|
+
/**
|
|
16
|
+
* **Search Engine Driver**
|
|
17
|
+
*
|
|
18
|
+
* The search engine to utilize.
|
|
19
|
+
*
|
|
20
|
+
* @default string 'meilisearch'
|
|
21
|
+
* @see https://stacksjs.org/docs/search-engine
|
|
22
|
+
*/
|
|
23
|
+
driver: 'meilisearch' | 'algolia' | 'opensearch';
|
|
24
|
+
meilisearch?: {
|
|
25
|
+
host: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
};
|
|
28
|
+
openSearch?: {
|
|
29
|
+
host: string;
|
|
30
|
+
protocol: number;
|
|
31
|
+
port: number;
|
|
32
|
+
auth: string;
|
|
33
|
+
};
|
|
34
|
+
filters?: {
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The number of hits to be returned per page.
|
|
39
|
+
*
|
|
40
|
+
* @default number 20
|
|
41
|
+
*/
|
|
42
|
+
perPage?: number;
|
|
43
|
+
}
|
|
44
|
+
export type SearchEngineConfig = Partial<SearchEngineOptions>;
|
|
45
|
+
export interface SearchEngineDriver {
|
|
46
|
+
client: MeiliSearch;
|
|
47
|
+
createIndex: (name: string, options?: IndexOptions) => MaybePromise<EnqueuedTask>;
|
|
48
|
+
getIndex: (name: string) => MaybePromise<Index>;
|
|
49
|
+
updateIndex: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>;
|
|
50
|
+
deleteIndex: (name: string) => MaybePromise<EnqueuedTask>;
|
|
51
|
+
updateIndexSettings: (name: string, settings: SearchEngineSettings) => MaybePromise<EnqueuedTask>;
|
|
52
|
+
listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>;
|
|
53
|
+
listAllIndices: () => MaybePromise<IndexesResults<Index[]>>;
|
|
54
|
+
getRecord: (key: string) => MaybePromise<any>;
|
|
55
|
+
getRecords: (key: string) => MaybePromise<RecordOptions>;
|
|
56
|
+
createRecord: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
|
|
57
|
+
createRecords: (records: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
|
|
58
|
+
createOrReplaceRecord: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
|
|
59
|
+
createOrUpdateRecord: (record: any, indexName: string, options: RecordOptions) => MaybePromise<EnqueuedTask>;
|
|
60
|
+
deleteRecord: (recordId: string | number, indexName: string) => MaybePromise<EnqueuedTask>;
|
|
61
|
+
deleteAllRecords: (indexName: string) => MaybePromise<EnqueuedTask>;
|
|
62
|
+
batchDeleteRecords: (recordIds: string[] | number[], indexName: string) => MaybePromise<EnqueuedTask>;
|
|
63
|
+
search: (query: string, indexName: string, options: SearchParams) => MaybePromise<Search>;
|
|
64
|
+
calculatePagination: Pages;
|
|
65
|
+
currentPage: Page;
|
|
66
|
+
filterName: string;
|
|
67
|
+
filters: Filters;
|
|
68
|
+
goToNextPage: () => Page;
|
|
69
|
+
goToPage: (pageNumber: number) => Page;
|
|
70
|
+
goToPrevPage: () => Page;
|
|
71
|
+
hits: Hits;
|
|
72
|
+
index: Index;
|
|
73
|
+
lastPage: Page;
|
|
74
|
+
perPage: number;
|
|
75
|
+
query: string;
|
|
76
|
+
results: Results;
|
|
77
|
+
searchFilters: SearchFilters;
|
|
78
|
+
searchParams: SearchParams;
|
|
79
|
+
setTotalHits: number;
|
|
80
|
+
sort: Sort;
|
|
81
|
+
sorts: Sorts;
|
|
82
|
+
totalPages: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* This interface is used to unify the persisting of data to localStorage
|
|
86
|
+
*/
|
|
87
|
+
export interface SearchEngineStorage {
|
|
88
|
+
/**
|
|
89
|
+
* The search engine index name.
|
|
90
|
+
* i.e. the type of table, like `users`, `posts`, `products`, etc.
|
|
91
|
+
*/
|
|
92
|
+
index?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The search engine results object.
|
|
95
|
+
*/
|
|
96
|
+
results?: SearchResponse;
|
|
97
|
+
/**
|
|
98
|
+
* The search engine hits object.
|
|
99
|
+
*/
|
|
100
|
+
hits?: Hits;
|
|
101
|
+
/**
|
|
102
|
+
* The number of hits to be returned per page.
|
|
103
|
+
*
|
|
104
|
+
* @default number 20
|
|
105
|
+
*/
|
|
106
|
+
perPage: number;
|
|
107
|
+
/**
|
|
108
|
+
* The current page number.
|
|
109
|
+
*
|
|
110
|
+
* @default number 1
|
|
111
|
+
*/
|
|
112
|
+
currentPage: number;
|
|
113
|
+
}
|
|
114
|
+
export interface MeiliSearchOptions {
|
|
115
|
+
apiKey: string;
|
|
116
|
+
host: string;
|
|
117
|
+
}
|
|
118
|
+
export type { EnqueuedTask, Hits, Index, IndexOptions, IndexesResults, MeiliSearch, RecordOptions, SearchEngineSettings, SearchParams, SearchResponse };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DeepPartial } from './utils';
|
|
2
|
+
import type { CountryCode } from './cloud';
|
|
3
|
+
export interface FirewallOptions {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
countryCodes: CountryCode[];
|
|
6
|
+
ipAddresses: string[];
|
|
7
|
+
queryString: string[];
|
|
8
|
+
httpHeaders: string[];
|
|
9
|
+
rateLimitPerMinute: number;
|
|
10
|
+
useIpReputationLists: boolean;
|
|
11
|
+
useKnownBadInputsRuleSet: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type FirewallConfig = Partial<FirewallOptions>;
|
|
14
|
+
export interface SecurityOptions {
|
|
15
|
+
driver: 'aws';
|
|
16
|
+
firewall: FirewallOptions;
|
|
17
|
+
}
|
|
18
|
+
export type SecurityConfig = DeepPartial<SecurityOptions>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface ServicesOptions {
|
|
2
|
+
algolia?: {
|
|
3
|
+
appId: string;
|
|
4
|
+
apiKey: string;
|
|
5
|
+
};
|
|
6
|
+
godaddy?: {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
apiSecret: string;
|
|
9
|
+
};
|
|
10
|
+
meilisearch?: {
|
|
11
|
+
appId: string;
|
|
12
|
+
apiKey: string;
|
|
13
|
+
};
|
|
14
|
+
stripe?: {
|
|
15
|
+
appId: string;
|
|
16
|
+
apiKey: string;
|
|
17
|
+
};
|
|
18
|
+
planetscale?: {
|
|
19
|
+
appId: string;
|
|
20
|
+
apiKey: string;
|
|
21
|
+
};
|
|
22
|
+
supabase?: {
|
|
23
|
+
appId: string;
|
|
24
|
+
apiKey: string;
|
|
25
|
+
};
|
|
26
|
+
aws?: {
|
|
27
|
+
accountId: string;
|
|
28
|
+
appId: string;
|
|
29
|
+
apiKey: string;
|
|
30
|
+
region: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export type ServicesConfig = Partial<ServicesOptions>;
|
package/dist/sms.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/ssg.d.ts
ADDED
package/dist/stacks.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { AiConfig, AnalyticsConfig, AppConfig, BinaryConfig, CacheConfig, CloudConfig, DatabaseConfig, DnsConfig, DocsConfig, EmailConfig, GitConfig, HashingConfig, LibraryConfig, LoggerConfig, NotificationConfig, PaymentConfig, Ports, QueueConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, StorageConfig, 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 interface StacksOptions {
|
|
10
|
+
ai: AiConfig;
|
|
11
|
+
/**
|
|
12
|
+
* **Analytics Options**
|
|
13
|
+
*
|
|
14
|
+
* This configuration defines all of your Analytics options. Because Stacks is fully-typed, you
|
|
15
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
16
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
17
|
+
*/
|
|
18
|
+
analytics: AnalyticsConfig;
|
|
19
|
+
/**
|
|
20
|
+
* **Application Options**
|
|
21
|
+
*
|
|
22
|
+
* This configuration defines all of your Application options. Because Stacks is fully-typed,
|
|
23
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
24
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
25
|
+
*/
|
|
26
|
+
app: AppConfig;
|
|
27
|
+
/**
|
|
28
|
+
* **Cache Options**
|
|
29
|
+
*
|
|
30
|
+
* This configuration defines all of your Cache options. Because Stacks is fully-typed, you
|
|
31
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
32
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
33
|
+
*/
|
|
34
|
+
cache: CacheConfig;
|
|
35
|
+
/**
|
|
36
|
+
* **CLI / Binary Options**
|
|
37
|
+
*
|
|
38
|
+
* This configuration defines all of your Binary options. Because Stacks is fully-typed, you
|
|
39
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
40
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
41
|
+
*/
|
|
42
|
+
cli: BinaryConfig;
|
|
43
|
+
/**
|
|
44
|
+
* **Cloud Options**
|
|
45
|
+
*
|
|
46
|
+
* This configuration defines all of your Cloud options. Because Stacks is fully-typed, you
|
|
47
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
48
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
49
|
+
*/
|
|
50
|
+
cloud: CloudConfig;
|
|
51
|
+
/**
|
|
52
|
+
* **Database Options**
|
|
53
|
+
*
|
|
54
|
+
* This configuration defines all of your Database options. Because Stacks is fully-typed, you
|
|
55
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
56
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
57
|
+
*/
|
|
58
|
+
database: DatabaseConfig;
|
|
59
|
+
/**
|
|
60
|
+
* **DNS Options**
|
|
61
|
+
*
|
|
62
|
+
* This configuration defines all of your DNS options. Because Stacks is fully-typed, you
|
|
63
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
64
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
65
|
+
*/
|
|
66
|
+
dns: DnsConfig;
|
|
67
|
+
/**
|
|
68
|
+
* **Docs Options**
|
|
69
|
+
*
|
|
70
|
+
* This configuration defines all of your Docs options. Because Stacks is fully-typed, you
|
|
71
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
72
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
73
|
+
*/
|
|
74
|
+
docs: DocsConfig;
|
|
75
|
+
/**
|
|
76
|
+
* **Email Options**
|
|
77
|
+
*
|
|
78
|
+
* This configuration defines all of your Email options. Because Stacks is fully-typed, you
|
|
79
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
80
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
81
|
+
*/
|
|
82
|
+
email: EmailConfig;
|
|
83
|
+
/**
|
|
84
|
+
* **Git Options**
|
|
85
|
+
*
|
|
86
|
+
* This configuration defines all of your Git options. Because Stacks is fully-typed, you
|
|
87
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
88
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
89
|
+
*/
|
|
90
|
+
git: GitConfig;
|
|
91
|
+
/**
|
|
92
|
+
* **Hashing Options**
|
|
93
|
+
*
|
|
94
|
+
* This configuration defines all of your Hashing options. Because Stacks is fully-typed, you
|
|
95
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
96
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
97
|
+
*/
|
|
98
|
+
hashing: HashingConfig;
|
|
99
|
+
/**
|
|
100
|
+
* **Library Options**
|
|
101
|
+
*
|
|
102
|
+
* This configuration defines all of your Library 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
|
+
library: LibraryConfig;
|
|
107
|
+
/**
|
|
108
|
+
* **Logger Options**
|
|
109
|
+
*
|
|
110
|
+
* This configuration defines all of your Logger options. Because Stacks is fully-typed, you
|
|
111
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
112
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
113
|
+
*/
|
|
114
|
+
logger: LoggerConfig;
|
|
115
|
+
/**
|
|
116
|
+
* **Notification Options**
|
|
117
|
+
*
|
|
118
|
+
* This configuration defines all of your Notification options. Because Stacks is fully-typed,
|
|
119
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
120
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
121
|
+
*/
|
|
122
|
+
notification: NotificationConfig;
|
|
123
|
+
/**
|
|
124
|
+
* **Payment Options**
|
|
125
|
+
*
|
|
126
|
+
* This configuration defines all of your Payment options. Because Stacks is fully-typed,
|
|
127
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
128
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
129
|
+
*/
|
|
130
|
+
payment: PaymentConfig;
|
|
131
|
+
/**
|
|
132
|
+
* **Ports**
|
|
133
|
+
*
|
|
134
|
+
* This configuration defines all of your Ports options. Because Stacks is fully-typed, you
|
|
135
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
136
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
137
|
+
*/
|
|
138
|
+
ports: Ports;
|
|
139
|
+
/**
|
|
140
|
+
* **Queue Options**
|
|
141
|
+
*
|
|
142
|
+
* This configuration defines all of your Queue options. Because Stacks is fully-typed,
|
|
143
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
144
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
145
|
+
*/
|
|
146
|
+
queue: QueueConfig;
|
|
147
|
+
/**
|
|
148
|
+
* **Search Engine Options**
|
|
149
|
+
*
|
|
150
|
+
* This configuration defines all of your Search Engine options. Because Stacks is fully-typed,
|
|
151
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
152
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
153
|
+
*/
|
|
154
|
+
security: SecurityConfig;
|
|
155
|
+
/**
|
|
156
|
+
* **Search Engine Options**
|
|
157
|
+
*
|
|
158
|
+
* This configuration defines all of your Search Engine options. Because Stacks is fully-typed,
|
|
159
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
160
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
161
|
+
*/
|
|
162
|
+
searchEngine: SearchEngineConfig;
|
|
163
|
+
/**
|
|
164
|
+
* **Services Options**
|
|
165
|
+
*
|
|
166
|
+
* This configuration defines all of your Services options. Because Stacks is fully-typed,
|
|
167
|
+
* you may hover any of the options below and the definitions will be provided. In case
|
|
168
|
+
* you have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
169
|
+
*/
|
|
170
|
+
services: ServicesConfig;
|
|
171
|
+
/**
|
|
172
|
+
* **Storage Options**
|
|
173
|
+
*
|
|
174
|
+
* This configuration defines all of your Storage 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
|
+
storage: StorageConfig;
|
|
179
|
+
/**
|
|
180
|
+
* **Team Members**
|
|
181
|
+
*
|
|
182
|
+
* This configuration defines all of your Team members. Because Stacks is fully-typed, you
|
|
183
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
184
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
185
|
+
*/
|
|
186
|
+
team: Team;
|
|
187
|
+
/**
|
|
188
|
+
* **UI Options**
|
|
189
|
+
*
|
|
190
|
+
* This configuration defines all of your UI options. Because Stacks is fully-typed, you
|
|
191
|
+
* may hover any of the options below and the definitions will be provided. In case you
|
|
192
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
193
|
+
*/
|
|
194
|
+
ui: UiConfig;
|
|
195
|
+
}
|
|
196
|
+
export type StacksConfig = Partial<StacksOptions>;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export type StorageConfig = Partial<StorageOptions>;
|
package/dist/tables.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Hits, SearchResponse } from 'meilisearch';
|
|
2
|
+
/**
|
|
3
|
+
* the TableStore interface is primarily used to unify the persisting of data to localStorage
|
|
4
|
+
*/
|
|
5
|
+
export interface TableStore {
|
|
6
|
+
/**
|
|
7
|
+
* The search engine index name.
|
|
8
|
+
* i.e. the type of table, like `users`, `posts`, `products`, etc.
|
|
9
|
+
*/
|
|
10
|
+
index: string;
|
|
11
|
+
/**
|
|
12
|
+
* The search engine results object.
|
|
13
|
+
*/
|
|
14
|
+
results?: SearchResponse<Record<string, any>>;
|
|
15
|
+
/**
|
|
16
|
+
* The search engine hits object.
|
|
17
|
+
*/
|
|
18
|
+
hits?: Hits;
|
|
19
|
+
columns: string[];
|
|
20
|
+
source?: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
searchable?: string | boolean;
|
|
23
|
+
query?: string;
|
|
24
|
+
sortable?: string | boolean;
|
|
25
|
+
sort?: string;
|
|
26
|
+
sorts?: string | string[];
|
|
27
|
+
filterable?: string | boolean;
|
|
28
|
+
filters?: string | string[];
|
|
29
|
+
filterValue?: any[];
|
|
30
|
+
actionable?: string | boolean;
|
|
31
|
+
actions?: string | string[];
|
|
32
|
+
perPage: number;
|
|
33
|
+
selectable?: string | boolean;
|
|
34
|
+
selectedRows?: number[] | string[];
|
|
35
|
+
selectedAll?: boolean;
|
|
36
|
+
goToNextPage: number;
|
|
37
|
+
goToPage: number;
|
|
38
|
+
goToPrevPage: number;
|
|
39
|
+
lastPageNumber: number;
|
|
40
|
+
searchFilters?: object;
|
|
41
|
+
searchParams?: object;
|
|
42
|
+
setTotalHits: number;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* The current page number
|
|
46
|
+
* @default 1
|
|
47
|
+
* @type {number}
|
|
48
|
+
* @memberof TableStore
|
|
49
|
+
* @example 1
|
|
50
|
+
*/
|
|
51
|
+
currentPage: number;
|
|
52
|
+
}
|
package/dist/team.d.ts
ADDED
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { UserShortcuts } from 'unocss';
|
|
2
|
+
import type { UserConfig } from '@unocss/core';
|
|
3
|
+
export type Font = 'inter' | 'mona' | 'hubot';
|
|
4
|
+
export type Icon = 'heroicons';
|
|
5
|
+
export type WebFontsProviders = 'google' | 'bunny' | 'fontshare';
|
|
6
|
+
export type Shortcuts = UserShortcuts;
|
|
7
|
+
export interface FontInfo {
|
|
8
|
+
title: string;
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WebFontMeta {
|
|
12
|
+
name: string;
|
|
13
|
+
weights?: (string | number)[];
|
|
14
|
+
italic?: boolean;
|
|
15
|
+
provider?: WebFontsProviders;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* **UI Engine Options**
|
|
19
|
+
*
|
|
20
|
+
* This type defines all of your UI Engine options. Because Stacks is fully-typed, you may
|
|
21
|
+
* hover any of the options below and the definitions will be provided. In case you
|
|
22
|
+
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
23
|
+
*/
|
|
24
|
+
export interface UiOptions {
|
|
25
|
+
/**
|
|
26
|
+
* **Shortcuts**
|
|
27
|
+
*
|
|
28
|
+
* Shortcuts provide you with the ability to combine
|
|
29
|
+
* utility names for reusability purposes.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```
|
|
33
|
+
* config: {
|
|
34
|
+
* shortcuts: {
|
|
35
|
+
* 'btn': 'px-4 py-2 rounded text-white bg-blue-500',
|
|
36
|
+
* 'btn-lg': 'btn px-6 py-3',
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
shortcuts: Shortcuts;
|
|
42
|
+
/**
|
|
43
|
+
* **Safelist**
|
|
44
|
+
*
|
|
45
|
+
* Use the `safelist` option to ensure the generation of
|
|
46
|
+
* those utility classes. This is useful when certain
|
|
47
|
+
* class names don’t exist in your content files.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* safelist: [
|
|
52
|
+
* 'btn',
|
|
53
|
+
* 'btn-lg',
|
|
54
|
+
* 'btn-blue',
|
|
55
|
+
* 'btn-blue-500',
|
|
56
|
+
* ]
|
|
57
|
+
*/
|
|
58
|
+
safelist: string;
|
|
59
|
+
/**
|
|
60
|
+
* **Trigger String**
|
|
61
|
+
*
|
|
62
|
+
* The "trigger string" defines the class name markup
|
|
63
|
+
* you want to add into your components.
|
|
64
|
+
*
|
|
65
|
+
* @default ':stx:'
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* trigger: ':stx:'
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
trigger?: string;
|
|
73
|
+
/**
|
|
74
|
+
* **Class Prefix**
|
|
75
|
+
*
|
|
76
|
+
* The prefix for the compiled class name. When transforming
|
|
77
|
+
* all utility classes into a single class, this prefix
|
|
78
|
+
* will be added to the generated CSS class name.
|
|
79
|
+
*
|
|
80
|
+
* @default 'stx-'
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* prefix: 'stx-'
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
classPrefix?: string;
|
|
88
|
+
/**
|
|
89
|
+
* **Hash Function**
|
|
90
|
+
*
|
|
91
|
+
* The hash function used to generate the class name.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* hash: (str: string) => {
|
|
96
|
+
* return str
|
|
97
|
+
* .split('')
|
|
98
|
+
* .reduce((a, b) => {
|
|
99
|
+
* a = ((a << 5) - a) + b.charCodeAt(0)
|
|
100
|
+
* return a & a
|
|
101
|
+
* }, 0)
|
|
102
|
+
* .toString(36)
|
|
103
|
+
* }
|
|
104
|
+
*/
|
|
105
|
+
hashFn?: (str: string) => string;
|
|
106
|
+
/**
|
|
107
|
+
* **CSS Resets—Preset**
|
|
108
|
+
*
|
|
109
|
+
* Define a standard of reset CSS stylesheets. By default, the Tailwind
|
|
110
|
+
* reset styles are utilized. You may set this value to `null`
|
|
111
|
+
* if you prefer not applying any default stylesheets.
|
|
112
|
+
*
|
|
113
|
+
* @url https://www.npmjs.com/package/@unocss/reset
|
|
114
|
+
* @todo preset needs to be added via a Vite plugin on development & build
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* reset: 'tailwind'
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
reset?: ResetPreset;
|
|
121
|
+
/**
|
|
122
|
+
* **Fonts**
|
|
123
|
+
*
|
|
124
|
+
* Define the fonts you want to use. By default, Stacks provides support
|
|
125
|
+
* for several local font providers. You may set this value to
|
|
126
|
+
* `null` if you prefer not utilize any local fonts.
|
|
127
|
+
*
|
|
128
|
+
* @see https://stacksjs.org/docs/fonts
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
fonts?: any;
|
|
132
|
+
useWebFonts?: boolean | WebFontsProviders;
|
|
133
|
+
/**
|
|
134
|
+
* **Icon Sets**
|
|
135
|
+
*
|
|
136
|
+
* This value defines the icon sets you want to use. When using icons, they
|
|
137
|
+
* are displayed utilizing a technique called "icons in pure css."
|
|
138
|
+
* Learn more here https://antfu.me/posts/icons-in-pure-css.
|
|
139
|
+
*
|
|
140
|
+
* @see https://stacks.ow3.org/config/icons — list of available icon sets
|
|
141
|
+
* @todo implement this into Vite build flow
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* icons: ['heroicons']
|
|
145
|
+
* ```
|
|
146
|
+
* @example
|
|
147
|
+
* ```html
|
|
148
|
+
* <i class="i-heroicons-outline-book-open w-8 h-8 text-gray-500" aria-hidden="true" />
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
icons: Icon | Icon[];
|
|
152
|
+
theme: UserConfig['theme'];
|
|
153
|
+
variants: UserConfig['variants'];
|
|
154
|
+
layers: UserConfig['layers'];
|
|
155
|
+
}
|
|
156
|
+
export type UiConfig = Partial<UiOptions>;
|
|
157
|
+
/**
|
|
158
|
+
* **Style Reset — Preset**
|
|
159
|
+
*
|
|
160
|
+
* This value sets the "reset preset." A preset defines certain
|
|
161
|
+
* CSS defaults to be applied.
|
|
162
|
+
*
|
|
163
|
+
* @default "tailwind"
|
|
164
|
+
*/
|
|
165
|
+
export type ResetPreset = 'tailwind' | 'normalize' | 'sanitize' | 'eric-meyer' | 'antfu' | null;
|