@stacksjs/types 0.75.15 → 0.75.17
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/auth.d.ts +31 -0
- package/dist/hashing.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/logging.d.ts +21 -0
- package/dist/monitoring.d.ts +43 -0
- package/dist/oauth.d.ts +12 -0
- package/package.json +5 -5
package/dist/auth.d.ts
CHANGED
|
@@ -27,6 +27,36 @@ export declare interface BrowserSessionConfig {
|
|
|
27
27
|
withRefreshToken?: boolean
|
|
28
28
|
logoutRedirect?: string
|
|
29
29
|
}
|
|
30
|
+
export declare interface OAuthProviderScopeConfig {
|
|
31
|
+
description: string
|
|
32
|
+
resources?: readonly string[]
|
|
33
|
+
}
|
|
34
|
+
export declare interface OAuthProviderResourceConfig {
|
|
35
|
+
audience: string
|
|
36
|
+
description?: string
|
|
37
|
+
}
|
|
38
|
+
export declare interface OAuthProviderConfig {
|
|
39
|
+
enabled?: boolean
|
|
40
|
+
issuer?: string
|
|
41
|
+
endpoints?: {
|
|
42
|
+
authorization?: string
|
|
43
|
+
token?: string
|
|
44
|
+
revocation?: string
|
|
45
|
+
introspection?: string
|
|
46
|
+
}
|
|
47
|
+
scopes?: Record<string, OAuthProviderScopeConfig>
|
|
48
|
+
resources?: Record<string, OAuthProviderResourceConfig>
|
|
49
|
+
clientTypes?: readonly ('confidential' | 'public')[]
|
|
50
|
+
lifetimes?: {
|
|
51
|
+
authorizationCode?: number
|
|
52
|
+
accessToken?: number
|
|
53
|
+
refreshToken?: number
|
|
54
|
+
}
|
|
55
|
+
consent?: {
|
|
56
|
+
rememberFor?: number
|
|
57
|
+
view?: string
|
|
58
|
+
}
|
|
59
|
+
}
|
|
30
60
|
export declare interface AuthOptions {
|
|
31
61
|
enabled?: boolean
|
|
32
62
|
env?: string[]
|
|
@@ -49,6 +79,7 @@ export declare interface AuthOptions {
|
|
|
49
79
|
refreshTokenExpiry?: number
|
|
50
80
|
idleTimeout?: number
|
|
51
81
|
browserSession?: BrowserSessionConfig
|
|
82
|
+
oauthProvider?: OAuthProviderConfig
|
|
52
83
|
tokenRotation: number
|
|
53
84
|
defaultAbilities: string[]
|
|
54
85
|
defaultTokenName: string
|
package/dist/hashing.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{e}from"./chunk-e1djnd5t.js";function a(
|
|
2
|
+
import{e}from"./chunk-e1djnd5t.js";function a(n){return typeof n==="object"&&n!==null&&"id"in n&&"userId"in n&&"clientId"in n&&"scopes"in n}function d(n){return a(n)&&"abilities"in n}function p(n){return typeof n==="object"&&n!==null&&"id"in n&&"name"in n&&"secret"in n&&"redirect"in n}var i;((r)=>{r.Second="* * * * * *";r.FiveSeconds="*/5 * * * * *";r.TenSeconds="*/10 * * * * *";r.ThirtySeconds="*/30 * * * * *";r.Minute="* * * * *";r.TwoMinutes="*/2 * * * *";r.FiveMinutes="*/5 * * * *";r.TenMinutes="*/10 * * * *";r.FifteenMinutes="*/15 * * * *";r.ThirtyMinutes="*/30 * * * *";r.Hour="0 * * * *";r.HalfHour="0,30 * * * *";r.Day="0 0 * * *";r.Week="0 0 * * 0";r.Weekday="0 0 * * 1-5";r.Weekend="0 0 * * 0,6";r.Month="0 0 1 * *";r.Year="0 0 1 1 *"})(i||={});var s;((t)=>{t.Bluesky="bluesky";t.Discord="discord";t.Facebook="facebook";t.GitHub="github";t.Instagram="instagram";t.LinkedIn="linkedin";t.Mastodon="mastodon";t.Slack="slack";t.Twitter="twitter";t.YouTube="youtube"})(s||={});import{toString as l}from"@stacksjs/strings";function b(n){if(n===null)return"null";let o=l(n).slice(8,-1).toLowerCase();return typeof n==="object"||typeof n==="function"?o:typeof n}function y(n){return n}function x(n){return n}var T={development:{default:"sync",connections:{sync:{driver:"sync"}},failed:{driver:"database",table:"failed_jobs"}},production:{default:"redis",connections:{redis:{driver:"redis",prefix:"stacks:queue",concurrency:5,distributedLock:!0,metrics:{enabled:!0},defaultDeadLetterOptions:{enabled:!0,maxRetries:3}}},failed:{driver:"redis",prefix:"stacks:failed"},worker:{concurrency:5,shutdownTimeout:30000}},highPerformance:{default:"redis",connections:{redis:{driver:"redis",prefix:"stacks:queue",concurrency:20,distributedLock:!0,metrics:{enabled:!0,collectInterval:5000},horizontalScaling:{enabled:!0,maxWorkersPerInstance:20,jobsPerWorker:50},defaultDeadLetterOptions:{enabled:!0,maxRetries:5}}},failed:{driver:"redis",prefix:"stacks:failed"},worker:{concurrency:20,shutdownTimeout:60000}},database:{default:"database",connections:{database:{driver:"database",table:"jobs",queue:"default",retryAfter:90}},failed:{driver:"database",table:"failed_jobs"}}};var C={server:{development:{enabled:!0,mode:"server",debug:!0,server:{host:"localhost",port:6001,scheme:"ws",driver:"bun",rateLimit:{enabled:!1},healthCheck:{enabled:!0,path:"/health"}},channels:{public:!0,private:!0,presence:!0}},production:{enabled:!0,mode:"server",debug:!1,server:{host:"0.0.0.0",port:6001,scheme:"wss",driver:"bun",redis:{enabled:!0,prefix:"stacks:realtime:"},rateLimit:{enabled:!0,maxConnectionsPerIp:100,maxMessagesPerSecond:50,maxPayloadSize:65536},loadManagement:{maxConnections:1e4,backpressureThreshold:1000,messageQueueSize:1e4,gracefulShutdownTimeout:30000},autoScaling:{min:2,max:10,targetCPU:70},healthCheck:{enabled:!0,path:"/health",interval:30},metrics:{enabled:!0,port:9090,path:"/metrics"}},channels:{public:!0,private:!0,presence:!0}},highPerformance:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0,cluster:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:500,maxMessagesPerSecond:200,maxPayloadSize:131072},loadManagement:{maxConnections:1e5,backpressureThreshold:5000,messageQueueSize:50000,gracefulShutdownTimeout:60000},autoScaling:{min:4,max:50,targetCPU:60}}},chat:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:10,maxMessagesPerSecond:20},loadManagement:{maxConnections:50000}},channels:{public:!0,private:!0,presence:{enabled:!0,maxMembersPerChannel:500,memberInfoTtl:60}}},gaming:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0,cluster:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:50,maxMessagesPerSecond:100},loadManagement:{maxConnections:50000,backpressureThreshold:2000,messageQueueSize:20000},autoScaling:{min:2,max:20,targetCPU:50}},channels:{public:!0,private:!0,presence:!0}}},serverless:{development:{enabled:!0,mode:"serverless",debug:!0,serverless:{connectionTimeout:3600,idleTimeout:600,stageName:"dev",memorySize:256,timeout:30},channels:{public:!0,private:!0,presence:!0}},production:{enabled:!0,mode:"serverless",debug:!1,serverless:{connectionTimeout:3600,idleTimeout:600,stageName:"production",memorySize:512,timeout:30,provisionedConcurrency:2},channels:{public:!0,private:!0,presence:!0}},notifications:{enabled:!0,mode:"serverless",serverless:{connectionTimeout:7200,idleTimeout:1800,memorySize:256,timeout:15},channels:{public:!0,private:!0,presence:!1}}}};var M={calendar:{github:"stacksjs/calendar",package:"@stacksjs/calendar",description:"Calendar links, ICS generation, and an STX calendar component"},table:{github:"stacksjs/table",package:"@stacksjs/table",description:"Typed table drivers and an STX data table component"}};export{i as Every,e as ExitCode,T as QueuePresets,C as RealtimePresets,s as SocialLinkIcon,y as defineModel,x as defineModels,b as getTypeName,a as isAccessToken,p as isOAuthClient,d as isPersonalAccessToken,M as stackExtensionRegistry};
|
package/dist/logging.d.ts
CHANGED
|
@@ -54,6 +54,26 @@ export declare interface LogTransport {
|
|
|
54
54
|
log: (record: LogRecord) => void
|
|
55
55
|
flush?: () => Promise<void>
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* LogHQ delivery configured alongside the ordinary console and file logger.
|
|
59
|
+
*
|
|
60
|
+
* The ingest key selects the LogHQ project. `project` is also attached to each
|
|
61
|
+
* entry as searchable context, which is useful when one key receives logs from
|
|
62
|
+
* more than one Stacks process.
|
|
63
|
+
*/
|
|
64
|
+
export declare interface LogHqLoggingOptions {
|
|
65
|
+
key?: string
|
|
66
|
+
baseUrl?: string
|
|
67
|
+
project?: string
|
|
68
|
+
level?: LogLevel
|
|
69
|
+
enabled?: boolean
|
|
70
|
+
environments?: readonly string[]
|
|
71
|
+
batchSize?: number
|
|
72
|
+
flushInterval?: number
|
|
73
|
+
maxQueueSize?: number
|
|
74
|
+
timeout?: number
|
|
75
|
+
maxRetries?: number
|
|
76
|
+
}
|
|
57
77
|
/**
|
|
58
78
|
* **Logging Options**
|
|
59
79
|
*
|
|
@@ -67,6 +87,7 @@ export declare interface LoggingOptions {
|
|
|
67
87
|
level?: LogLevel
|
|
68
88
|
format?: 'json' | 'text'
|
|
69
89
|
writeToFile?: boolean
|
|
90
|
+
loghq?: LogHqLoggingOptions
|
|
70
91
|
transports?: LogTransport[]
|
|
71
92
|
}
|
|
72
93
|
/**
|
package/dist/monitoring.d.ts
CHANGED
|
@@ -5,8 +5,51 @@
|
|
|
5
5
|
* error-tracking views and actions). Stays inert at boot when `enabled`
|
|
6
6
|
* is `false`.
|
|
7
7
|
*/
|
|
8
|
+
export declare interface ErrorReportContext {
|
|
9
|
+
requestId?: string
|
|
10
|
+
url?: string
|
|
11
|
+
method?: string
|
|
12
|
+
userId?: string | number
|
|
13
|
+
ip?: string
|
|
14
|
+
userAgent?: string
|
|
15
|
+
status?: number
|
|
16
|
+
label?: string
|
|
17
|
+
[key: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
export declare interface ErrorReport {
|
|
20
|
+
error: Error
|
|
21
|
+
context?: ErrorReportContext
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A synchronous error-reporting destination.
|
|
25
|
+
*
|
|
26
|
+
* Network reporters buffer in `report()` and drain in `flush()`, so an error
|
|
27
|
+
* path never waits on another service or trades the original failure for a
|
|
28
|
+
* reporting failure.
|
|
29
|
+
*/
|
|
30
|
+
export declare interface ErrorReporter {
|
|
31
|
+
name: string
|
|
32
|
+
report: (event: ErrorReport) => void
|
|
33
|
+
flush?: () => Promise<void>
|
|
34
|
+
}
|
|
35
|
+
/** BugHQ delivery configured through `config/monitoring.ts`. */
|
|
36
|
+
export declare interface BugHqMonitoringOptions {
|
|
37
|
+
key?: string
|
|
38
|
+
dsn?: string
|
|
39
|
+
host?: string
|
|
40
|
+
project?: string
|
|
41
|
+
release?: string
|
|
42
|
+
enabled?: boolean
|
|
43
|
+
environments?: readonly string[]
|
|
44
|
+
sampleRate?: number
|
|
45
|
+
dedupeMs?: number
|
|
46
|
+
maxRetries?: number
|
|
47
|
+
flushTimeout?: number
|
|
48
|
+
}
|
|
8
49
|
export declare interface MonitoringOptions {
|
|
9
50
|
enabled?: boolean
|
|
10
51
|
env?: string[]
|
|
52
|
+
bughq?: BugHqMonitoringOptions
|
|
53
|
+
reporters?: ErrorReporter[]
|
|
11
54
|
}
|
|
12
55
|
export type MonitoringConfig = Partial<MonitoringOptions>;
|
package/dist/oauth.d.ts
CHANGED
|
@@ -17,7 +17,13 @@ export declare function isOAuthClient(value: unknown): value is OAuthClient;
|
|
|
17
17
|
export declare interface AccessToken {
|
|
18
18
|
readonly id: number
|
|
19
19
|
readonly userId: number
|
|
20
|
+
readonly subjectType?: string
|
|
21
|
+
readonly subjectId?: number
|
|
20
22
|
readonly clientId: number
|
|
23
|
+
readonly grantId?: string | null
|
|
24
|
+
readonly resources?: readonly string[]
|
|
25
|
+
readonly audiences?: readonly string[]
|
|
26
|
+
readonly workspaceId?: string | null
|
|
21
27
|
readonly name: string
|
|
22
28
|
readonly scopes: TokenScopes
|
|
23
29
|
readonly revoked: boolean
|
|
@@ -82,6 +88,10 @@ export declare interface OAuthAccessTokenRow {
|
|
|
82
88
|
id: number
|
|
83
89
|
user_id: number
|
|
84
90
|
oauth_client_id: number
|
|
91
|
+
oauth_grant_id?: string | null
|
|
92
|
+
resources?: string | null
|
|
93
|
+
audiences?: string | null
|
|
94
|
+
workspace_id?: string | null
|
|
85
95
|
token: string
|
|
86
96
|
name: string | null
|
|
87
97
|
scopes: string | null
|
|
@@ -97,6 +107,8 @@ export declare interface OAuthRefreshTokenRow {
|
|
|
97
107
|
id: number
|
|
98
108
|
access_token_id: number
|
|
99
109
|
token: string
|
|
110
|
+
family_id?: string | null
|
|
111
|
+
parent_id?: number | null
|
|
100
112
|
revoked: boolean | number
|
|
101
113
|
expires_at: string | null
|
|
102
114
|
created_at: string | null
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.75.
|
|
4
|
+
"version": "0.75.17",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@stacksjs/bunpress": "^0.2.8",
|
|
60
60
|
"@stacksjs/clapp": "^0.2.12",
|
|
61
|
-
"@stacksjs/events": "0.75.
|
|
62
|
-
"@stacksjs/strings": "0.75.
|
|
63
|
-
"@stacksjs/stx": "^0.2.
|
|
61
|
+
"@stacksjs/events": "0.75.17",
|
|
62
|
+
"@stacksjs/strings": "0.75.17",
|
|
63
|
+
"@stacksjs/stx": "^0.2.324",
|
|
64
64
|
"@stacksjs/ts-validation": "^0.5.6",
|
|
65
65
|
"bun-query-builder": "^0.3.0"
|
|
66
66
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@stacksjs/validation": "0.75.
|
|
76
|
+
"@stacksjs/validation": "0.75.17",
|
|
77
77
|
"better-dx": "^0.2.24",
|
|
78
78
|
"meilisearch": "^0.59.0"
|
|
79
79
|
},
|