@stacksjs/types 0.68.2 → 0.69.2
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 +4 -2
- package/dist/app.d.ts +4 -2
- package/dist/attributes.d.ts +1 -0
- package/dist/auto-imports.d.ts +1 -1
- package/dist/build.d.ts +2 -2
- package/dist/cache.d.ts +2 -1
- package/dist/chat.d.ts +1 -1
- package/dist/cli.d.ts +92 -48
- package/dist/cloud.d.ts +10 -5
- package/dist/components.d.ts +1 -1
- package/dist/cron-jobs.d.ts +48 -19
- package/dist/database.d.ts +4 -2
- package/dist/dns.d.ts +12 -7
- package/dist/docs.d.ts +5 -2
- package/dist/errors.d.ts +6 -3
- package/dist/events.d.ts +3 -1
- package/dist/git.d.ts +2 -1
- package/dist/hashing.d.ts +6 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/model-names.d.ts +1 -1
- package/dist/model.d.ts +98 -59
- package/dist/payments.d.ts +14 -9
- package/dist/queue.d.ts +8 -0
- package/dist/reactivity.d.ts +1 -1
- package/dist/request.d.ts +10 -4
- package/dist/response.d.ts +15 -0
- package/dist/router.d.ts +20 -10
- package/dist/saas.d.ts +1 -1
- package/dist/scheduler.d.ts +1 -1
- package/dist/search-engine.d.ts +87 -49
- package/dist/security.d.ts +4 -2
- package/dist/storage.d.ts +2 -1
- package/dist/table-names.d.ts +1 -0
- package/dist/team.d.ts +2 -1
- package/dist/ui.d.ts +12 -7
- package/dist/utils.d.ts +14 -7
- package/package.json +19 -21
- package/src/attributes.ts +1 -0
- package/src/cli.ts +22 -4
- package/src/cron-jobs.ts +124 -30
- package/src/docs.ts +1 -0
- package/src/events.ts +2 -0
- package/src/index.ts +3 -0
- package/src/model-names.ts +1 -1
- package/src/model.ts +62 -42
- package/src/queue.ts +9 -0
- package/src/request.ts +2 -0
- package/src/response.ts +16 -0
- package/src/saas.ts +1 -1
- package/src/search-engine.ts +104 -45
- package/src/table-names.ts +1 -0
- package/src/ui.ts +2 -2
package/dist/search-engine.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import type { MaybePromise } from '.';
|
|
2
2
|
|
|
3
|
-
export type {
|
|
4
|
-
declare 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
|
|
3
|
+
export type {
|
|
15
4
|
export declare interface SearchEngineOptions {
|
|
16
5
|
driver: 'opensearch'
|
|
17
6
|
|
|
@@ -23,6 +12,14 @@ export declare interface SearchEngineOptions {
|
|
|
23
12
|
auth: string
|
|
24
13
|
}
|
|
25
14
|
|
|
15
|
+
meilisearch?: {
|
|
16
|
+
host: string
|
|
17
|
+
protocol: number
|
|
18
|
+
port: number
|
|
19
|
+
auth: string
|
|
20
|
+
apiKey: string
|
|
21
|
+
}
|
|
22
|
+
|
|
26
23
|
filters?: {
|
|
27
24
|
[key: string]: string
|
|
28
25
|
}
|
|
@@ -30,59 +27,100 @@ export declare interface SearchEngineOptions {
|
|
|
30
27
|
perPage?: number
|
|
31
28
|
}
|
|
32
29
|
export declare type SearchEngineConfig = Partial<SearchEngineOptions>
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
|
|
31
|
+
export interface SearchEngineDriver {
|
|
32
|
+
client: () => MeiliSearch
|
|
33
|
+
|
|
34
|
+
search: (index: string, params: any) => Promise<SearchResponse<Record<string, any>>>
|
|
35
35
|
|
|
36
36
|
createIndex: (name: string, options?: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
37
|
-
getIndex: (name: string) =>
|
|
37
|
+
getIndex: (name: string) => Promise<Index<Record<string, any>>>
|
|
38
|
+
addDocument: (indexName: string, params: any) => Promise<EnqueuedTask>
|
|
39
|
+
updateDocuments: (indexName: string, params: DocumentOptions[]) => Promise<EnqueuedTask>
|
|
40
|
+
updateDocument: (indexName: string, params: DocumentOptions) => Promise<EnqueuedTask>
|
|
41
|
+
addDocuments: (indexName: string, params: any[]) => Promise<EnqueuedTask>
|
|
42
|
+
getDocument: (indexName: string, id: number, fields: any) => Promise<EnqueuedTask>
|
|
43
|
+
deleteDocument: (indexName: string, id: number) => Promise<EnqueuedTask>
|
|
44
|
+
deleteDocuments: (indexName: string, filters: string | string[]) => Promise<EnqueuedTask>
|
|
38
45
|
updateIndex: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
39
46
|
deleteIndex: (name: string) => MaybePromise<EnqueuedTask>
|
|
40
|
-
updateIndexSettings: (name: string, settings: SearchEngineOptions) => MaybePromise<EnqueuedTask>
|
|
41
47
|
listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>
|
|
42
48
|
listAllIndices: () => MaybePromise<IndexesResults<Index[]>>
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
index:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
50
|
+
getFilterableAttributes: (index: string) => Promise<string[]>
|
|
51
|
+
updateFilterableAttributes: (index: string, filterableAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
52
|
+
resetFilterableAttributes: (index: string) => Promise<EnqueuedTask>
|
|
53
|
+
|
|
54
|
+
updateSearchableAttributes: (index: string, searchableAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
55
|
+
resetSearchableAttributes: (index: string) => Promise<EnqueuedTask>
|
|
56
|
+
getSearchableAttributes: (index: string) => Promise<string[]>
|
|
57
|
+
|
|
58
|
+
updateSortableAttributes: (index: string, sortableAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
59
|
+
resetSortableAttributes: (index: string) => Promise<EnqueuedTask>
|
|
60
|
+
getSortableAttributes: (index: string) => Promise<string[]>
|
|
61
|
+
|
|
62
|
+
updateDisplayedAttributes: (index: string, displayedAttributes: string[] | null) => Promise<EnqueuedTask>
|
|
63
|
+
getDisplayedAttributes: (index: string) => Promise<string[]>
|
|
64
|
+
resetDisplayedAttributes: (index: string) => Promise<EnqueuedTask>
|
|
65
|
+
|
|
66
|
+
getSettings: (index: string) => Promise<Settings>
|
|
67
|
+
updateSettings: (index: string, settings: Settings) => Promise<EnqueuedTask>
|
|
68
|
+
resetSettings: (index: string) => Promise<EnqueuedTask>
|
|
69
|
+
å
|
|
70
|
+
getPagination: (index: string) => Promise<PaginationSettings>
|
|
71
|
+
updatePagination: (index: string, pagination: PaginationSettings) => Promise<EnqueuedTask>
|
|
72
|
+
resetPagination: (index: string) => Promise<EnqueuedTask>
|
|
73
|
+
|
|
74
|
+
getSynonyms: (index: string) => Promise<any>
|
|
75
|
+
updateSynonyms: (index: string, synonyms: Synonyms) => Promise<EnqueuedTask>
|
|
76
|
+
resetSynonyms: (index: string) => Promise<EnqueuedTask>
|
|
77
|
+
|
|
78
|
+
getRankingRules: (index: string) => Promise<string[]>
|
|
79
|
+
updateRankingRules: (index: string, rankingRules: string[] | null) => Promise<EnqueuedTask>
|
|
80
|
+
resetRankingRules: (index: string) => Promise<EnqueuedTask>
|
|
81
|
+
|
|
82
|
+
getDistinctAttribute: (index: string) => Promise<string | null>
|
|
83
|
+
updateDistinctAttribute: (index: string, distinctAttribute: string | null) => Promise<EnqueuedTask>
|
|
84
|
+
resetDistinctAttribute: (index: string) => Promise<EnqueuedTask>
|
|
85
|
+
|
|
86
|
+
getFaceting: (index: string) => Promise<Faceting>
|
|
87
|
+
updateFaceting: (index: string, faceting: Faceting) => Promise<EnqueuedTask>
|
|
88
|
+
resetFaceting: (index: string) => Promise<EnqueuedTask>
|
|
89
|
+
|
|
90
|
+
getTypoTolerance: (index: string) => Promise<TypoTolerance>
|
|
91
|
+
updateTypoTolerance: (index: string, typoTolerance: TypoTolerance | null) => Promise<EnqueuedTask>
|
|
92
|
+
resetTypoTolerance: (index: string) => Promise<EnqueuedTask>
|
|
93
|
+
|
|
94
|
+
getDictionary: (index: string) => Promise<Dictionary>
|
|
95
|
+
updateDictionary: (index: string, dictionary: Dictionary | null) => Promise<EnqueuedTask>
|
|
96
|
+
resetDictionary: (index: string) => Promise<EnqueuedTask>
|
|
97
|
+
|
|
75
98
|
}
|
|
76
|
-
|
|
99
|
+
|
|
100
|
+
export interface SearchEngineStorage {
|
|
77
101
|
index?: string
|
|
78
102
|
results?: SearchResponse
|
|
79
103
|
hits?: Hits
|
|
80
104
|
perPage: number
|
|
81
105
|
currentPage: number
|
|
82
106
|
}
|
|
83
|
-
|
|
107
|
+
|
|
108
|
+
export interface SearchOptions {
|
|
109
|
+
displayable: string[]
|
|
84
110
|
searchable: string[]
|
|
85
111
|
sortable: string[]
|
|
86
112
|
filterable: string[]
|
|
87
113
|
options?: SearchEngineOptions
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
EnqueuedTask,
|
|
117
|
+
Hits,
|
|
118
|
+
Index,
|
|
119
|
+
IndexesResults,
|
|
120
|
+
IndexOptions,
|
|
121
|
+
MeiliSearch,
|
|
122
|
+
MeilisearchOptions,
|
|
123
|
+
RecordOptions,
|
|
124
|
+
SearchParams,
|
|
125
|
+
SearchResponse,
|
|
88
126
|
}
|
package/dist/security.d.ts
CHANGED
|
@@ -12,9 +12,11 @@ export declare interface FirewallOptions {
|
|
|
12
12
|
useKnownBadInputsRuleSet: boolean
|
|
13
13
|
}
|
|
14
14
|
export declare type FirewallConfig = Partial<FirewallOptions>
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
export interface SecurityOptions {
|
|
16
17
|
driver: 'aws'
|
|
17
18
|
|
|
18
19
|
firewall: FirewallOptions
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
export type SecurityConfig = DeepPartial<SecurityOptions>
|
package/dist/storage.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export declare interface StorageOptions {
|
|
|
5
5
|
driver: 's3' | 'efs' | 'local'
|
|
6
6
|
}
|
|
7
7
|
export declare type StorageConfig = Partial<StorageOptions>
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
export interface StorageDriver {
|
|
9
10
|
list: (path: string, options?: any) => DirectoryListing
|
|
10
11
|
changeVisibility: (path: string, visibility: string) => Promise<void>
|
|
11
12
|
visibility: (path: string) => Promise<string>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TableNames = 'projects' | 'subscriber_emails' | 'personal_access_tokens' | 'team_users' | 'teams' | 'activities' | 'subscribers' | 'deployments' | 'releases' | 'team_users' | 'users' | 'posts' | 'failed_jobs' | 'products' | 'payment_methods' | 'transactions' | 'jobs' | 'subscriptions' | 'errors'
|
package/dist/team.d.ts
CHANGED
package/dist/ui.d.ts
CHANGED
|
@@ -2,20 +2,23 @@ import type { UserConfig } from '@unocss/core';
|
|
|
2
2
|
import type { UserShortcuts } from 'unocss';
|
|
3
3
|
|
|
4
4
|
export declare type Font = 'inter' | 'mona' | 'hubot'
|
|
5
|
-
export type Icon = 'heroicons'
|
|
6
|
-
export
|
|
5
|
+
export type Icon = 'heroicons' | 'hugeicons'
|
|
6
|
+
export type WebFontsProviders = 'google' | 'bunny' | 'fontshare'
|
|
7
7
|
export type Shortcuts = UserShortcuts
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
export interface FontInfo {
|
|
9
10
|
title: string
|
|
10
11
|
text: string
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
export interface WebFontMeta {
|
|
13
15
|
name: string
|
|
14
16
|
weights?: (string | number)[]
|
|
15
17
|
italic?: boolean
|
|
16
18
|
provider?: WebFontsProviders
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
export interface UiOptions {
|
|
19
22
|
shortcuts: Shortcuts
|
|
20
23
|
|
|
21
24
|
safelist: string
|
|
@@ -38,5 +41,7 @@ export declare interface UiOptions {
|
|
|
38
41
|
variants: UserConfig['variants']
|
|
39
42
|
layers: UserConfig['layers']
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
export
|
|
44
|
+
|
|
45
|
+
export type UiConfig = Partial<UiOptions>
|
|
46
|
+
|
|
47
|
+
export type ResetPreset = 'tailwind' | 'normalize' | 'sanitize' | 'eric-meyer' | 'antfu' | null
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
export declare type Nullable<T> = T | null | undefined
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
|
|
3
|
+
export type Fn<T = void> = () => T
|
|
4
|
+
|
|
5
|
+
export type Arrayable<T> = T | Array<T>
|
|
6
|
+
|
|
7
|
+
export type Constructor<T = void> = new (...args: any[]) => T
|
|
8
|
+
|
|
9
|
+
export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void
|
|
6
10
|
? I
|
|
7
11
|
: never
|
|
8
|
-
|
|
9
|
-
export
|
|
12
|
+
|
|
13
|
+
export type MergeInsertions<T> = T extends object ? { [K in keyof T]: MergeInsertions<T[K]> } : T
|
|
14
|
+
|
|
15
|
+
export type DeepMerge<F, S> = MergeInsertions<{
|
|
10
16
|
[K in keyof F | keyof S]: K extends keyof S & keyof F
|
|
11
17
|
? DeepMerge<F[K], S[K]>
|
|
12
18
|
: K extends keyof S
|
|
@@ -15,6 +21,7 @@ export declare type DeepMerge<F, S> = MergeInsertions<{
|
|
|
15
21
|
? F[K]
|
|
16
22
|
: never
|
|
17
23
|
}>
|
|
18
|
-
|
|
24
|
+
|
|
25
|
+
export type DeepPartial<T> = {
|
|
19
26
|
[P in keyof T]?: DeepPartial<T[P]>
|
|
20
27
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.69.2",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -43,37 +43,35 @@
|
|
|
43
43
|
"typecheck": "bun tsc --noEmit",
|
|
44
44
|
"prepublishOnly": "bun run build"
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"devDependencies": {
|
|
47
47
|
"@mdit-vue/plugin-component": "^2.1.3",
|
|
48
48
|
"@mdit-vue/plugin-frontmatter": "^2.1.3",
|
|
49
49
|
"@mdit-vue/types": "^2.1.0",
|
|
50
|
-
"@rollup/pluginutils": "^5.1.
|
|
51
|
-
"@stacksjs/validation": "0.
|
|
50
|
+
"@rollup/pluginutils": "^5.1.4",
|
|
51
|
+
"@stacksjs/validation": "0.69.2",
|
|
52
52
|
"@types/aws4": "^1.11.6",
|
|
53
|
-
"@types/bun": "^1.
|
|
53
|
+
"@types/bun": "^1.2.2",
|
|
54
54
|
"@types/crypto-js": "^4.2.2",
|
|
55
55
|
"@types/fs-extra": "^11.0.4",
|
|
56
56
|
"@types/markdown-it-link-attributes": "^3.0.5",
|
|
57
57
|
"@types/minimatch": "^5.1.2",
|
|
58
58
|
"@types/nprogress": "^0.2.3",
|
|
59
|
-
"@vinejs/vine": "^
|
|
59
|
+
"@vinejs/vine": "^3.0.0",
|
|
60
|
+
"aws-cdk-lib": "^2.179.0",
|
|
60
61
|
"cac": "^6.7.14",
|
|
61
62
|
"markdown-it": "^14.1.0",
|
|
62
|
-
"meilisearch": "^0.
|
|
63
|
+
"meilisearch": "^0.49.0",
|
|
63
64
|
"neverthrow": "^8.1.1",
|
|
64
|
-
"ora": "^8.
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"unplugin-
|
|
68
|
-
"
|
|
69
|
-
"vite
|
|
70
|
-
"vite-plugin-
|
|
71
|
-
"vite-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"devDependencies": {
|
|
76
|
-
"aws-cdk-lib": "^2.164.1",
|
|
77
|
-
"typescript": "^5.6.3"
|
|
65
|
+
"ora": "^8.2.0",
|
|
66
|
+
"typescript": "^5.7.3",
|
|
67
|
+
"unocss": "66.0.0",
|
|
68
|
+
"unplugin-auto-import": "^19.1.0",
|
|
69
|
+
"unplugin-vue-components": "^28.1.0",
|
|
70
|
+
"vite": "^6.1.0",
|
|
71
|
+
"vite-plugin-inspect": "^10.2.1",
|
|
72
|
+
"vite-plugin-pwa": "^0.21.1",
|
|
73
|
+
"vite-ssg": "^25.0.0",
|
|
74
|
+
"vitepress": "1.6.3",
|
|
75
|
+
"vue": "^3.5.13"
|
|
78
76
|
}
|
|
79
77
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../types/attributes'
|
package/src/cli.ts
CHANGED
|
@@ -363,7 +363,6 @@ export type DomainsOptions = CliOptions & {
|
|
|
363
363
|
|
|
364
364
|
export interface CleanOptions extends CliOptions {}
|
|
365
365
|
|
|
366
|
-
export interface SaasOptions extends CliOptions {}
|
|
367
366
|
export interface CloudCliOptions extends CliOptions {
|
|
368
367
|
ssh?: boolean
|
|
369
368
|
connect?: boolean
|
|
@@ -373,16 +372,24 @@ export interface CloudCliOptions extends CliOptions {
|
|
|
373
372
|
diff?: boolean
|
|
374
373
|
}
|
|
375
374
|
export interface CommitOptions extends CliOptions {}
|
|
376
|
-
export interface KeyOptions extends CliOptions {}
|
|
377
375
|
export interface FreshOptions extends CliOptions {
|
|
378
376
|
dryRun?: boolean
|
|
379
377
|
quiet?: boolean
|
|
380
378
|
}
|
|
379
|
+
|
|
380
|
+
export interface InspireOptions extends CliOptions {}
|
|
381
|
+
export interface InstallOptions extends CliOptions {}
|
|
382
|
+
|
|
383
|
+
export interface KeyOptions extends CliOptions {}
|
|
384
|
+
|
|
381
385
|
export interface MigrateOptions extends CliOptions {
|
|
382
386
|
diff?: boolean
|
|
383
387
|
}
|
|
384
|
-
|
|
385
|
-
export interface
|
|
388
|
+
|
|
389
|
+
export interface CliQueueOptions extends CliOptions {
|
|
390
|
+
queue?: string
|
|
391
|
+
}
|
|
392
|
+
|
|
386
393
|
export interface ReleaseOptions extends CliOptions {
|
|
387
394
|
dryRun?: boolean
|
|
388
395
|
}
|
|
@@ -394,6 +401,17 @@ export interface PrepublishOptions extends CliOptions {}
|
|
|
394
401
|
export interface PortsOptions extends CliOptions {
|
|
395
402
|
ports?: Partial<Ports>
|
|
396
403
|
}
|
|
404
|
+
|
|
405
|
+
export interface SaasOptions extends CliOptions {}
|
|
406
|
+
|
|
407
|
+
export interface SearchCommandOptions extends CliOptions {
|
|
408
|
+
model: string
|
|
409
|
+
settings: boolean
|
|
410
|
+
flush: boolean
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface ScheduleOptions extends CliOptions {}
|
|
414
|
+
|
|
397
415
|
export interface TinkerOptions extends CliOptions {}
|
|
398
416
|
export interface TypesOptions extends CliOptions {}
|
|
399
417
|
|
package/src/cron-jobs.ts
CHANGED
|
@@ -1,40 +1,15 @@
|
|
|
1
|
-
import type { IntRange } from '@stacksjs/
|
|
1
|
+
import type { IntRange } from '@stacksjs/cron'
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Cron Job Options.
|
|
5
|
-
*/
|
|
6
|
-
export interface JobOptions {
|
|
7
|
-
/**
|
|
8
|
-
* The name of the job.
|
|
9
|
-
*/
|
|
10
|
-
name?: string
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line ts/no-unsafe-function-type
|
|
13
|
-
handle?: string | Function
|
|
14
|
-
action?: string
|
|
15
|
-
description?: string
|
|
16
|
-
queue?: string
|
|
17
|
-
timezone?: string
|
|
18
|
-
/**
|
|
19
|
-
* Number of tries. Must be between 0 and 185.
|
|
20
|
-
*/
|
|
21
|
-
tries?: IntRange<0, 185>
|
|
22
|
-
backoff?: number | number[]
|
|
23
|
-
rate?: string | Every
|
|
24
|
-
enabled?: boolean
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type JobConfig = JobOptions
|
|
28
3
|
export type Job = JobOptions
|
|
29
4
|
export type Jobs = Job[]
|
|
30
5
|
export type CronJob = Job
|
|
31
6
|
export type CronJobs = Jobs
|
|
32
7
|
|
|
33
8
|
export enum Every {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
9
|
+
Second = '* * * * * *',
|
|
10
|
+
FiveSeconds = '*/5 * * * * *',
|
|
11
|
+
TenSeconds = '*/10 * * * * *',
|
|
12
|
+
ThirtySeconds = '*/30 * * * * *',
|
|
38
13
|
Minute = '* * * * *',
|
|
39
14
|
TwoMinutes = '*/2 * * * *',
|
|
40
15
|
FiveMinutes = '*/5 * * * *',
|
|
@@ -50,3 +25,122 @@ export enum Every {
|
|
|
50
25
|
Month = '0 0 1 * *',
|
|
51
26
|
Year = '0 0 1 1 *',
|
|
52
27
|
}
|
|
28
|
+
|
|
29
|
+
export type JobHandler = (data?: any) => Promise<any> | any
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Represents different backoff strategies for job retries
|
|
33
|
+
*/
|
|
34
|
+
type BackoffStrategy = 'fixed' | 'exponential' | 'linear' | 'random'
|
|
35
|
+
|
|
36
|
+
export interface JitterConfig {
|
|
37
|
+
/**
|
|
38
|
+
* Enable/disable jitter
|
|
39
|
+
*/
|
|
40
|
+
enabled: boolean
|
|
41
|
+
/**
|
|
42
|
+
* Maximum percentage of variation (0-1)
|
|
43
|
+
*/
|
|
44
|
+
factor?: number
|
|
45
|
+
/**
|
|
46
|
+
* Minimum delay in milliseconds
|
|
47
|
+
*/
|
|
48
|
+
minDelay?: number
|
|
49
|
+
/**
|
|
50
|
+
* Maximum delay in milliseconds
|
|
51
|
+
*/
|
|
52
|
+
maxDelay?: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface BackoffConfig {
|
|
56
|
+
/**
|
|
57
|
+
* The strategy to use for calculating delay between retries
|
|
58
|
+
*/
|
|
59
|
+
strategy: BackoffStrategy
|
|
60
|
+
/**
|
|
61
|
+
* Initial delay in milliseconds
|
|
62
|
+
*/
|
|
63
|
+
initialDelay: number
|
|
64
|
+
/**
|
|
65
|
+
* For exponential/linear backoff: the multiplier/increment to apply
|
|
66
|
+
*/
|
|
67
|
+
factor?: number
|
|
68
|
+
/**
|
|
69
|
+
* Maximum delay between retries in milliseconds
|
|
70
|
+
*/
|
|
71
|
+
maxDelay?: number
|
|
72
|
+
/**
|
|
73
|
+
* Jitter configuration to add randomness to delays
|
|
74
|
+
*/
|
|
75
|
+
jitter?: JitterConfig
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface JobOptions {
|
|
79
|
+
/**
|
|
80
|
+
* The name of the job
|
|
81
|
+
*/
|
|
82
|
+
name?: string
|
|
83
|
+
/**
|
|
84
|
+
* Job handler function or identifier string
|
|
85
|
+
*/
|
|
86
|
+
handle?: string | JobHandler
|
|
87
|
+
/**
|
|
88
|
+
* Action identifier
|
|
89
|
+
*/
|
|
90
|
+
action?: string
|
|
91
|
+
/**
|
|
92
|
+
* Job description
|
|
93
|
+
*/
|
|
94
|
+
description?: string
|
|
95
|
+
/**
|
|
96
|
+
* Queue name
|
|
97
|
+
*/
|
|
98
|
+
queue?: string
|
|
99
|
+
/**
|
|
100
|
+
* Timezone for scheduling
|
|
101
|
+
*/
|
|
102
|
+
timezone?: string
|
|
103
|
+
/**
|
|
104
|
+
* Number of retry attempts. Must be between 0 and 185
|
|
105
|
+
*/
|
|
106
|
+
tries?: IntRange<0, 185>
|
|
107
|
+
/**
|
|
108
|
+
* Simple backoff configuration using delay values
|
|
109
|
+
* Can be a single number for fixed delay,
|
|
110
|
+
* or an array of delays for custom retry delays
|
|
111
|
+
*/
|
|
112
|
+
backoff?: number | number[]
|
|
113
|
+
/**
|
|
114
|
+
* Advanced backoff configuration
|
|
115
|
+
*/
|
|
116
|
+
backoffConfig?: BackoffConfig
|
|
117
|
+
/**
|
|
118
|
+
* Rate limiting configuration
|
|
119
|
+
* Can be a string like "5/minute" or an Every object
|
|
120
|
+
*/
|
|
121
|
+
rate?: string | Every
|
|
122
|
+
/**
|
|
123
|
+
* Whether the job is enabled
|
|
124
|
+
*/
|
|
125
|
+
enabled?: boolean
|
|
126
|
+
/**
|
|
127
|
+
* Maximum execution time in milliseconds
|
|
128
|
+
*/
|
|
129
|
+
timeout?: number
|
|
130
|
+
/**
|
|
131
|
+
* Unique job key to prevent duplicates
|
|
132
|
+
*/
|
|
133
|
+
key?: string
|
|
134
|
+
/**
|
|
135
|
+
* Time-to-live in seconds for the job key
|
|
136
|
+
*/
|
|
137
|
+
ttl?: number
|
|
138
|
+
/**
|
|
139
|
+
* Whether to run the job immediately when added
|
|
140
|
+
*/
|
|
141
|
+
immediate?: boolean
|
|
142
|
+
/**
|
|
143
|
+
* Custom metadata for the job
|
|
144
|
+
*/
|
|
145
|
+
meta?: Record<string, any>
|
|
146
|
+
}
|
package/src/docs.ts
CHANGED
package/src/events.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './ai'
|
|
|
2
2
|
export * from './analytics'
|
|
3
3
|
export * from './api'
|
|
4
4
|
export * from './app'
|
|
5
|
+
export * from './attributes'
|
|
5
6
|
export * from './auto-imports'
|
|
6
7
|
export * from './binary'
|
|
7
8
|
export * from './build'
|
|
@@ -45,6 +46,7 @@ export * from './pwa'
|
|
|
45
46
|
export * from './queue'
|
|
46
47
|
export * from './reactivity'
|
|
47
48
|
export * from './request'
|
|
49
|
+
export * from './response'
|
|
48
50
|
export * from './router'
|
|
49
51
|
export * from './saas'
|
|
50
52
|
export * from './scheduler'
|
|
@@ -57,6 +59,7 @@ export * from './sms'
|
|
|
57
59
|
export * from './ssg'
|
|
58
60
|
export * from './stacks'
|
|
59
61
|
export * from './storage'
|
|
62
|
+
export * from './table-names'
|
|
60
63
|
export * from './tables'
|
|
61
64
|
export * from './team'
|
|
62
65
|
export * from './ui'
|
package/src/model-names.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'Subscription' | 'Error'
|
|
1
|
+
export type ModelNames = 'Project' | 'SubscriberEmail' | 'AccessToken' | 'Team' | 'Activity' | 'Subscriber' | 'Deployment' | 'Release' | 'User' | 'Post' | 'FailedJob' | 'Product' | 'PaymentMethod' | 'Transaction' | 'Job' | 'Subscription' | 'Error'
|