@sixb/server 0.1.2 → 0.1.3
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/experience.d.ts +33 -0
- package/dist/auth/experience.d.ts.map +1 -0
- package/dist/auth/public-routes.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1891 -1337
- package/dist/index.js.map +17 -14
- package/dist/openapi/tags.d.ts +6 -2
- package/dist/openapi/tags.d.ts.map +1 -1
- package/dist/registerRoutes.d.ts.map +1 -1
- package/dist/routes/action-runs.d.ts +6 -6
- package/dist/routes/actions.d.ts +3 -3
- package/dist/routes/agents.d.ts +149 -77
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/ai-accounting.d.ts +31 -0
- package/dist/routes/ai-accounting.d.ts.map +1 -0
- package/dist/routes/auth.d.ts +110 -53
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/routes/connector-connection-runs.d.ts +56 -56
- package/dist/routes/connector-connections.d.ts +14 -14
- package/dist/routes/datasets.d.ts +12 -12
- package/dist/routes/events.d.ts +1 -1
- package/dist/routes/files.d.ts +8 -8
- package/dist/routes/links.d.ts +9 -9
- package/dist/routes/logs.d.ts +2 -2
- package/dist/routes/objects.d.ts +3 -3
- package/dist/routes/pipelines.d.ts +10 -10
- package/dist/routes/projections.d.ts +62 -50
- package/dist/routes/projections.d.ts.map +1 -1
- package/dist/routes/syncs.d.ts +6 -6
- package/dist/routes/telemetry.d.ts +7 -7
- package/dist/routes/webhook-runs.d.ts +2 -2
- package/dist/routes/workflows.d.ts +142 -57
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/routes/ws/logs.d.ts +10 -10
- package/dist/schemas/actions.d.ts +16 -16
- package/dist/schemas/agents.d.ts +459 -142
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/ai-accounting.d.ts +2393 -0
- package/dist/schemas/ai-accounting.d.ts.map +1 -0
- package/dist/schemas/auth.d.ts +96 -96
- package/dist/schemas/connectors.d.ts +24 -24
- package/dist/schemas/event-payloads.d.ts +6 -6
- package/dist/schemas/events.d.ts +6 -6
- package/dist/schemas/links.d.ts +2 -2
- package/dist/schemas/logs.d.ts +18 -18
- package/dist/schemas/pipelines.d.ts +20 -20
- package/dist/schemas/projections.d.ts +400 -288
- package/dist/schemas/projections.d.ts.map +1 -1
- package/dist/schemas/status.d.ts +2 -2
- package/dist/schemas/syncs.d.ts +10 -10
- package/dist/schemas/webhook-runs.d.ts +12 -12
- package/dist/schemas/workflows.d.ts +833 -162
- package/dist/schemas/workflows.d.ts.map +1 -1
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/auth/experience.ts +190 -0
- package/src/auth/public-routes.ts +7 -0
- package/src/index.ts +1 -0
- package/src/openapi/tags.ts +4 -0
- package/src/registerRoutes.ts +2 -0
- package/src/routes/agents.ts +1 -0
- package/src/routes/ai-accounting.ts +166 -0
- package/src/routes/auth.ts +188 -32
- package/src/routes/projections.ts +18 -4
- package/src/routes/workflows.ts +16 -0
- package/src/schemas/agents.ts +4 -9
- package/src/schemas/ai-accounting.ts +182 -0
- package/src/schemas/projections.ts +6 -0
- package/src/schemas/workflows.ts +8 -3
- package/src/server.ts +10 -0
package/src/server.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type SixbApiBrowserPolicy,
|
|
26
26
|
} from "./auth/browser-origin"
|
|
27
27
|
import { CSRF_TOKEN_RESPONSE_HEADER_NAME } from "./auth/csrf"
|
|
28
|
+
import type { SixbAuthExperienceOptions } from "./auth/experience"
|
|
28
29
|
import { ServerAuthGuard } from "./auth/guard"
|
|
29
30
|
import { consumeInternalRequestAuthState } from "./auth/scope"
|
|
30
31
|
import { SESSION_ACTIVITY_HEADER_NAME } from "./auth/session-activity"
|
|
@@ -49,6 +50,8 @@ export interface SixbServerOptions {
|
|
|
49
50
|
hostname?: string
|
|
50
51
|
quiet?: boolean
|
|
51
52
|
browser: SixbApiBrowserPolicy
|
|
53
|
+
/** Optional custom-app auth bundle mounted under the API's `/auth` routes. */
|
|
54
|
+
authExperience?: SixbAuthExperienceOptions
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
export function createSixbServer(options: SixbServerOptions): SixbServer {
|
|
@@ -63,6 +66,7 @@ export class SixbServer {
|
|
|
63
66
|
private readonly apiBrowserPolicy: ResolvedSixbApiBrowserPolicy
|
|
64
67
|
private readonly authContextResolver: ResolveRequestAuthContext
|
|
65
68
|
private readonly authRedirectContextResolver: ResolveAuthRedirectContext
|
|
69
|
+
private readonly authExperience?: SixbAuthExperienceOptions
|
|
66
70
|
private app: SixbApp | null = null
|
|
67
71
|
private bunServer: ReturnType<typeof Bun.serve> | null = null
|
|
68
72
|
private maintenance: OntologyMaintenanceHandle | null = null
|
|
@@ -77,6 +81,7 @@ export class SixbServer {
|
|
|
77
81
|
this.authRedirectContextResolver = createApiBrowserAuthRedirectContextResolver(
|
|
78
82
|
this.apiBrowserPolicy
|
|
79
83
|
)
|
|
84
|
+
this.authExperience = options.authExperience
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
getHost(): SixbHostView {
|
|
@@ -117,6 +122,10 @@ export class SixbServer {
|
|
|
117
122
|
return this.apiBrowserPolicy
|
|
118
123
|
}
|
|
119
124
|
|
|
125
|
+
getAuthExperience(): SixbAuthExperienceOptions | undefined {
|
|
126
|
+
return this.authExperience
|
|
127
|
+
}
|
|
128
|
+
|
|
120
129
|
async start(): Promise<void> {
|
|
121
130
|
if (this.app !== null || this.bunServer !== null || this.maintenance !== null) {
|
|
122
131
|
throw new Error("[SixbServer] Server is already running.")
|
|
@@ -304,6 +313,7 @@ export function createSixbApi(server: SixbServer) {
|
|
|
304
313
|
server.resolveAuthRedirectContext(request, input),
|
|
305
314
|
getInvitationDestinationOptions: (request) => server.getInvitationDestinationOptions(request),
|
|
306
315
|
resolveAuthRequestOrigin: (request) => server.resolveAuthRequestOrigin(request),
|
|
316
|
+
authExperience: server.getAuthExperience(),
|
|
307
317
|
resolveInvitationRedirectContext: (request, input) =>
|
|
308
318
|
server.resolveInvitationRedirectContext(request, input),
|
|
309
319
|
})
|