@sixb/server 0.1.0 → 0.1.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.
Files changed (171) hide show
  1. package/README.md +3 -3
  2. package/dist/auth/application-access.d.ts +2 -2
  3. package/dist/auth/application-access.d.ts.map +1 -1
  4. package/dist/auth/connector-callback-cookie.d.ts +12 -0
  5. package/dist/auth/connector-callback-cookie.d.ts.map +1 -0
  6. package/dist/auth/guard.d.ts +3 -3
  7. package/dist/auth/guard.d.ts.map +1 -1
  8. package/dist/auth/public-routes.d.ts.map +1 -1
  9. package/dist/auth/scope.d.ts +21 -27
  10. package/dist/auth/scope.d.ts.map +1 -1
  11. package/dist/auth/session-cookies.d.ts +2 -2
  12. package/dist/auth/session-cookies.d.ts.map +1 -1
  13. package/dist/connectors/http.d.ts +16 -0
  14. package/dist/connectors/http.d.ts.map +1 -0
  15. package/dist/files/content.d.ts +11 -0
  16. package/dist/files/content.d.ts.map +1 -1
  17. package/dist/index.js +4164 -3541
  18. package/dist/index.js.map +57 -52
  19. package/dist/openapi/tags.d.ts +11 -3
  20. package/dist/openapi/tags.d.ts.map +1 -1
  21. package/dist/registerRoutes.d.ts +6 -2
  22. package/dist/registerRoutes.d.ts.map +1 -1
  23. package/dist/routes/action-runs.d.ts +21 -31
  24. package/dist/routes/action-runs.d.ts.map +1 -1
  25. package/dist/routes/actions.d.ts +9 -8
  26. package/dist/routes/actions.d.ts.map +1 -1
  27. package/dist/routes/agent-api-gateway.d.ts +2 -2
  28. package/dist/routes/agent-api-gateway.d.ts.map +1 -1
  29. package/dist/routes/agents.d.ts +130 -131
  30. package/dist/routes/agents.d.ts.map +1 -1
  31. package/dist/routes/auth.d.ts +90 -90
  32. package/dist/routes/auth.d.ts.map +1 -1
  33. package/dist/routes/connector-connection-runs.d.ts +794 -0
  34. package/dist/routes/connector-connection-runs.d.ts.map +1 -0
  35. package/dist/routes/connector-connections.d.ts +219 -0
  36. package/dist/routes/connector-connections.d.ts.map +1 -0
  37. package/dist/routes/connectors.d.ts +10 -4
  38. package/dist/routes/connectors.d.ts.map +1 -1
  39. package/dist/routes/datasets.d.ts +15 -9
  40. package/dist/routes/datasets.d.ts.map +1 -1
  41. package/dist/routes/events.d.ts +8 -8
  42. package/dist/routes/events.d.ts.map +1 -1
  43. package/dist/routes/files.d.ts +11 -10
  44. package/dist/routes/files.d.ts.map +1 -1
  45. package/dist/routes/links.d.ts +2 -2
  46. package/dist/routes/links.d.ts.map +1 -1
  47. package/dist/routes/logs.d.ts +5 -5
  48. package/dist/routes/logs.d.ts.map +1 -1
  49. package/dist/routes/objects.d.ts +34 -34
  50. package/dist/routes/objects.d.ts.map +1 -1
  51. package/dist/routes/ontology.d.ts +62 -62
  52. package/dist/routes/ontology.d.ts.map +1 -1
  53. package/dist/routes/pipelines.d.ts +28 -34
  54. package/dist/routes/pipelines.d.ts.map +1 -1
  55. package/dist/routes/project.d.ts +2 -2
  56. package/dist/routes/project.d.ts.map +1 -1
  57. package/dist/routes/projections.d.ts +131 -83
  58. package/dist/routes/projections.d.ts.map +1 -1
  59. package/dist/routes/rules.d.ts +6 -6
  60. package/dist/routes/rules.d.ts.map +1 -1
  61. package/dist/routes/status.d.ts +2 -2
  62. package/dist/routes/status.d.ts.map +1 -1
  63. package/dist/routes/syncs.d.ts +27 -30
  64. package/dist/routes/syncs.d.ts.map +1 -1
  65. package/dist/routes/telemetry.d.ts +2 -2
  66. package/dist/routes/telemetry.d.ts.map +1 -1
  67. package/dist/routes/webhook-runs.d.ts +9 -9
  68. package/dist/routes/webhook-runs.d.ts.map +1 -1
  69. package/dist/routes/webhooks.d.ts +2 -2
  70. package/dist/routes/webhooks.d.ts.map +1 -1
  71. package/dist/routes/workflows.d.ts +132 -107
  72. package/dist/routes/workflows.d.ts.map +1 -1
  73. package/dist/routes/ws/agents.d.ts +11 -5
  74. package/dist/routes/ws/agents.d.ts.map +1 -1
  75. package/dist/routes/ws/events.d.ts +8 -8
  76. package/dist/routes/ws/events.d.ts.map +1 -1
  77. package/dist/routes/ws/log-subscription-hub.d.ts +6 -3
  78. package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -1
  79. package/dist/routes/ws/logs.d.ts +10 -10
  80. package/dist/routes/ws/logs.d.ts.map +1 -1
  81. package/dist/schemas/actions.d.ts +97 -202
  82. package/dist/schemas/actions.d.ts.map +1 -1
  83. package/dist/schemas/agents.d.ts +443 -440
  84. package/dist/schemas/agents.d.ts.map +1 -1
  85. package/dist/schemas/ai-usage.d.ts +34 -0
  86. package/dist/schemas/ai-usage.d.ts.map +1 -0
  87. package/dist/schemas/auth.d.ts +168 -168
  88. package/dist/schemas/common.d.ts +37 -0
  89. package/dist/schemas/common.d.ts.map +1 -1
  90. package/dist/schemas/connectors.d.ts +713 -2
  91. package/dist/schemas/connectors.d.ts.map +1 -1
  92. package/dist/schemas/datasets.d.ts +29 -23
  93. package/dist/schemas/datasets.d.ts.map +1 -1
  94. package/dist/schemas/event-payloads.d.ts +6 -6
  95. package/dist/schemas/events.d.ts +34 -34
  96. package/dist/schemas/logs.d.ts +22 -22
  97. package/dist/schemas/objects.d.ts +10 -10
  98. package/dist/schemas/ontology.d.ts +174 -174
  99. package/dist/schemas/pipelines.d.ts +131 -190
  100. package/dist/schemas/pipelines.d.ts.map +1 -1
  101. package/dist/schemas/projections.d.ts +918 -563
  102. package/dist/schemas/projections.d.ts.map +1 -1
  103. package/dist/schemas/rules.d.ts +6 -6
  104. package/dist/schemas/status.d.ts +2 -2
  105. package/dist/schemas/syncs.d.ts +88 -124
  106. package/dist/schemas/syncs.d.ts.map +1 -1
  107. package/dist/schemas/webhook-runs.d.ts +41 -41
  108. package/dist/schemas/webhook-runs.d.ts.map +1 -1
  109. package/dist/schemas/workflows.d.ts +792 -406
  110. package/dist/schemas/workflows.d.ts.map +1 -1
  111. package/dist/server.d.ts +6 -6
  112. package/dist/server.d.ts.map +1 -1
  113. package/dist/utils/http.d.ts +2 -0
  114. package/dist/utils/http.d.ts.map +1 -1
  115. package/dist/utils/ws.d.ts +4 -3
  116. package/dist/utils/ws.d.ts.map +1 -1
  117. package/package.json +8 -5
  118. package/src/auth/access-token-boundary.ts +4 -4
  119. package/src/auth/application-access.ts +8 -9
  120. package/src/auth/connector-callback-cookie.ts +95 -0
  121. package/src/auth/guard.ts +11 -11
  122. package/src/auth/public-routes.ts +13 -0
  123. package/src/auth/scope.ts +34 -30
  124. package/src/auth/session-cookies.ts +3 -3
  125. package/src/connectors/http.ts +110 -0
  126. package/src/files/content.ts +11 -0
  127. package/src/openapi/tags.ts +9 -1
  128. package/src/registerRoutes.ts +34 -23
  129. package/src/routes/action-runs.ts +49 -42
  130. package/src/routes/actions.ts +7 -13
  131. package/src/routes/agent-api-gateway.ts +87 -42
  132. package/src/routes/agents.ts +89 -200
  133. package/src/routes/auth.ts +87 -91
  134. package/src/routes/connector-connection-runs.ts +346 -0
  135. package/src/routes/connector-connections.ts +135 -0
  136. package/src/routes/connectors.ts +24 -12
  137. package/src/routes/datasets.ts +55 -54
  138. package/src/routes/events.ts +5 -5
  139. package/src/routes/files.ts +24 -31
  140. package/src/routes/links.ts +32 -35
  141. package/src/routes/logs.ts +6 -11
  142. package/src/routes/objects.ts +51 -114
  143. package/src/routes/ontology.ts +27 -38
  144. package/src/routes/pipelines.ts +28 -62
  145. package/src/routes/project.ts +3 -3
  146. package/src/routes/projections.ts +26 -38
  147. package/src/routes/rules.ts +11 -25
  148. package/src/routes/status.ts +5 -5
  149. package/src/routes/syncs.ts +19 -45
  150. package/src/routes/telemetry.ts +18 -29
  151. package/src/routes/webhook-runs.ts +5 -5
  152. package/src/routes/webhooks.ts +259 -341
  153. package/src/routes/workflows.ts +260 -259
  154. package/src/routes/ws/agents.ts +196 -66
  155. package/src/routes/ws/events.ts +11 -10
  156. package/src/routes/ws/log-subscription-hub.ts +6 -12
  157. package/src/routes/ws/logs.ts +13 -5
  158. package/src/schemas/actions.ts +58 -25
  159. package/src/schemas/agents.ts +19 -14
  160. package/src/schemas/ai-usage.ts +16 -0
  161. package/src/schemas/common.ts +24 -0
  162. package/src/schemas/connectors.ts +164 -0
  163. package/src/schemas/datasets.ts +3 -2
  164. package/src/schemas/pipelines.ts +24 -40
  165. package/src/schemas/projections.ts +17 -3
  166. package/src/schemas/syncs.ts +16 -10
  167. package/src/schemas/webhook-runs.ts +10 -5
  168. package/src/schemas/workflows.ts +42 -25
  169. package/src/server.ts +65 -26
  170. package/src/utils/http.ts +34 -6
  171. package/src/utils/ws.ts +10 -5
package/README.md CHANGED
@@ -15,10 +15,10 @@ bun add @sixb/server
15
15
  import { createSixb } from "@sixb/core"
16
16
  import { createSixbServer } from "@sixb/server"
17
17
 
18
- const sixb = await createSixb({ /* providers, ontology, ... */ })
18
+ const host = await createSixb({ /* providers, ontology, ... */ })
19
19
 
20
20
  const server = createSixbServer({
21
- sixb,
21
+ host,
22
22
  port: 3002,
23
23
  browser: {
24
24
  publicOrigin: "https://api.example.com",
@@ -102,7 +102,7 @@ import type { SixbServerOptions } from "@sixb/server"
102
102
 
103
103
  - **`createSixbServer(options)`** -- Entrypoint for starting the API/auth/ws/docs server.
104
104
  - **`SixbServer`** -- Manages the server lifecycle (`start`, `stop`).
105
- - **`SixbServerOptions`** -- Config: `sixb` and `browser` (required), `port` (default 3000), `host` (default `"0.0.0.0"`), `quiet`.
105
+ - **`SixbServerOptions`** -- Config: `host` and `browser` (required), `port` (default 3000), `hostname` (default `"0.0.0.0"`), `quiet`.
106
106
 
107
107
  ## OpenAPI
108
108
 
@@ -1,4 +1,4 @@
1
- import { type AuthSessionAudience, type OntologySource, type Sixb } from "@sixb/core";
1
+ import { type AuthSessionAudience, type SixbHostView } from "@sixb/core";
2
2
  import type { AuthenticatedRequestAuthSession } from "@sixb/core/internal/auth";
3
- export declare function sessionCanAccessApplication(sixb: Sixb<readonly OntologySource[]>, session: AuthenticatedRequestAuthSession, audience: AuthSessionAudience): boolean;
3
+ export declare function sessionCanAccessApplication(host: SixbHostView, session: AuthenticatedRequestAuthSession, audience: AuthSessionAudience): boolean;
4
4
  //# sourceMappingURL=application-access.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"application-access.d.ts","sourceRoot":"","sources":["../../src/auth/application-access.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,cAAc,EACnB,KAAK,IAAI,EACV,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAE/E,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC,EACrC,OAAO,EAAE,+BAA+B,EACxC,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAGT"}
1
+ {"version":3,"file":"application-access.d.ts","sourceRoot":"","sources":["../../src/auth/application-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAwB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9F,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAA;AAE/E,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,+BAA+B,EACxC,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAOT"}
@@ -0,0 +1,12 @@
1
+ export declare function createConnectorCallbackCookie(input: {
2
+ readonly request: Request;
3
+ readonly attemptId: string;
4
+ readonly secret: string;
5
+ readonly expiresAt: Date;
6
+ }): string;
7
+ export declare function readConnectorCallbackCookie(request: Request, state: string): {
8
+ readonly name: string;
9
+ readonly value: string | undefined;
10
+ };
11
+ export declare function clearConnectorCallbackCookie(request: Request, name: string): string;
12
+ //# sourceMappingURL=connector-callback-cookie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-callback-cookie.d.ts","sourceRoot":"","sources":["../../src/auth/connector-callback-cookie.ts"],"names":[],"mappings":"AAQA,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CACzB,GAAG,MAAM,CAST;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GACZ;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAG/D;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnF"}
@@ -1,8 +1,8 @@
1
- import type { OntologySource, Sixb } from "@sixb/core";
1
+ import type { SixbHostView } from "@sixb/core";
2
2
  import { type AuthenticatedRequestAuthSession } from "@sixb/core/internal/auth";
3
3
  import { type ResolveRequestAuthContext } from "./browser-origin";
4
4
  export interface ServerAuthGuardOptions {
5
- readonly sixb: Sixb<readonly OntologySource[]>;
5
+ readonly host: SixbHostView;
6
6
  readonly resolveAuthContext: ResolveRequestAuthContext;
7
7
  }
8
8
  /**
@@ -20,7 +20,7 @@ export type ServerAuthGuardDecision = {
20
20
  readonly session: AuthenticatedRequestAuthSession | null;
21
21
  };
22
22
  export declare class ServerAuthGuard {
23
- private readonly sixb;
23
+ private readonly host;
24
24
  private readonly resolveAuthContext;
25
25
  constructor(options: ServerAuthGuardOptions);
26
26
  isAuthEnabled(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/auth/guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,EACL,KAAK,+BAA+B,EAErC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAsB,KAAK,yBAAyB,EAAE,M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,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAkDvE"}
1
+ {"version":3,"file":"public-routes.d.ts","sourceRoot":"","sources":["../../src/auth/public-routes.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,CAAA;AAErE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;CAChC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAwB3D;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CA6DvE"}
@@ -1,39 +1,32 @@
1
- import type { AuthorizationContext, OntologySource, ScopedSixb } from "@sixb/core";
1
+ import type { OntologySource } from "@sixb/core";
2
+ import type { RequestExecutionAuthorization, Sixb } from "@sixb/core/internal/request-execution";
2
3
  import type { AgentRunRecord } from "@sixb/core/storage";
3
4
  /**
4
5
  * Per-request authorization state attached by the server's auth derive.
5
6
  *
6
- * Both fields are null when auth is disabled or the route is public — those
7
- * requests run against the privileged runtime, preserving authenticated-only
8
- * behavior for surfaces that are not grant-enforced yet.
9
- *
10
- * SECURITY — privileged is the silent default. The core runtime treats a
11
- * missing authorization context as fully privileged (workers, syncs, tests
12
- * need that). A scoped principal therefore gains no protection unless the route
13
- * actively routes through `scoped`. Concretely:
14
- *
15
- * - A grant-enforced handler MUST use `scoped` (falling back to the raw
16
- * `sixb` only when `scoped` is null). That now covers writes as well as
17
- * reads: object, link, and telemetry writes enforce `edit:object` and
18
- * `append:telemetry`. Using the raw `sixb` on a path an authenticated
19
- * principal can reach is a silent god-mode bypass — it will not fail to
20
- * compile or to run.
21
- * - Surfaces with no grant family yet (auth admin, raw storage) stay
22
- * authenticated-only by design and use the raw `sixb` deliberately, not by
23
- * omission. Add such a route consciously, and lock it down when its grant
24
- * family lands.
25
- *
26
- * This implicit default is a known V1 trade-off (kept for runtime ergonomics);
27
- * if it proves error-prone, make privileged access explicit at this boundary.
7
+ * Protected domain routes require `sixb`. It is present for authenticated and auth-disabled
8
+ * requests, and absent only for public routes that do not execute protected domain operations.
28
9
  */
29
10
  export interface RequestAuthState {
30
- readonly authz: AuthorizationContext | null;
31
- readonly scoped: ScopedSixb<readonly OntologySource[]> | null;
11
+ readonly sixb: Sixb<readonly OntologySource[]> | null;
32
12
  /** Present for requests proxied through the run-scoped agent API gateway. */
33
13
  readonly agentRun?: AgentRunRecord;
14
+ /** Identifies which kind of active agent execution owns a gateway request. */
15
+ readonly agentExecution?: {
16
+ readonly kind: "conversation";
17
+ readonly runId: string;
18
+ } | {
19
+ readonly kind: "workflow";
20
+ readonly nodeRunId: string;
21
+ };
22
+ }
23
+ export interface InternalRequestAuthState {
24
+ readonly authorization: RequestExecutionAuthorization;
25
+ readonly agentRun?: AgentRunRecord;
26
+ readonly agentExecution?: RequestAuthState["agentExecution"];
34
27
  }
35
- export declare function registerInternalRequestAuthState(request: Request, authState: RequestAuthState): void;
36
- export declare function consumeInternalRequestAuthState(request: Request): RequestAuthState | undefined;
28
+ export declare function registerInternalRequestAuthState(request: Request, authState: InternalRequestAuthState): void;
29
+ export declare function consumeInternalRequestAuthState(request: Request): InternalRequestAuthState | undefined;
37
30
  /**
38
31
  * Read the derived auth state from a route handler's context.
39
32
  *
@@ -42,4 +35,5 @@ export declare function consumeInternalRequestAuthState(request: Request): Reque
42
35
  * point until route registration carries the derived context type.
43
36
  */
44
37
  export declare function requestAuthState(context: unknown): RequestAuthState;
38
+ export declare function requireRequestSixb(context: unknown): Sixb<readonly OntologySource[]>;
45
39
  //# sourceMappingURL=scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/auth/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,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QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9D;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,aAAa,EAAE,6BAA6B,CAAA;IACrD,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAA;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAA;CAC7D;AAID,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,wBAAwB,GAClC,IAAI,CAEN;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,GACf,wBAAwB,GAAG,SAAS,CAMtC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAOnE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC,CAMpF"}
@@ -1,7 +1,7 @@
1
- import type { OntologySource, Sixb } from "@sixb/core";
1
+ import type { SixbHostView } from "@sixb/core";
2
2
  import { type AuthenticatedAuthSession } from "@sixb/core/internal/auth";
3
3
  export declare function createSessionRenewalCookieHeaders(input: {
4
- readonly sixb: Sixb<readonly OntologySource[]>;
4
+ readonly host: SixbHostView;
5
5
  readonly request: Request;
6
6
  readonly session: AuthenticatedAuthSession;
7
7
  readonly csrfToken?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"session-cookies.d.ts","sourceRoot":"","sources":["../../src/auth/session-cookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,EACL,KAAK,wBAAwB,EAK9B,MAAM,0BAA0B,CAAA;AAEjC,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC,CAAA;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,CA4BrF"}
1
+ {"version":3,"file":"session-cookies.d.ts","sourceRoot":"","sources":["../../src/auth/session-cookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EACL,KAAK,wBAAwB,EAK9B,MAAM,0BAA0B,CAAA;AAEjC,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,CA4BrF"}
@@ -0,0 +1,16 @@
1
+ import type { SixbHostView } from "@sixb/core";
2
+ import type { ConnectorConnectionRunView, ConnectorConnectionsRuntime, ConnectorConnectionView } from "@sixb/core/internal/connector-connections";
3
+ import type { z } from "zod";
4
+ import { type ConnectorConnectionRunSchema, type ConnectorConnectionSchema, type ConnectorHttpErrorCode } from "../schemas/connectors";
5
+ export declare function connectorRouteRuntime(host: SixbHostView, owner: object, connectorId: string): ConnectorConnectionsRuntime;
6
+ export declare function serializeConnectorConnection(connection: ConnectorConnectionView): z.infer<typeof ConnectorConnectionSchema>;
7
+ export declare function serializeConnectorConnectionRun(run: ConnectorConnectionRunView): z.infer<typeof ConnectorConnectionRunSchema>;
8
+ export declare function handleConnectorRouteError(error: unknown, set: {
9
+ status?: number | string;
10
+ }): {
11
+ error: string;
12
+ } | {
13
+ error: string;
14
+ code: ConnectorHttpErrorCode;
15
+ };
16
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/connectors/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,2CAA2C,CAAA;AAMlD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAA;AAG9B,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,2BAA2B,CAY7B;AAED,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,uBAAuB,GAClC,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAS3C;AAED,wBAAgB,+BAA+B,CAC7C,GAAG,EAAE,0BAA0B,GAC9B,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CA6C9C;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAMrE"}
@@ -31,6 +31,17 @@ export interface FileContentResponsesOptions {
31
31
  /** Add the 501 the route returns when its storage role is absent. */
32
32
  readonly optionalStorage?: boolean;
33
33
  }
34
+ export declare function handleFileContentQueryValidationError(context: {
35
+ readonly code: string | number;
36
+ readonly error: {
37
+ readonly type?: string;
38
+ };
39
+ readonly set: {
40
+ status?: number | string;
41
+ };
42
+ }): {
43
+ readonly error: string;
44
+ } | undefined;
34
45
  export declare function fileContentGetResponses(options?: FileContentResponsesOptions): {
35
46
  readonly 501?: {
36
47
  readonly description: "The storage role backing this content is not configured";
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/files/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,OAAO,EAAa,MAAM,YAAY,CAAA;AAIrF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,YAAY,CAAA;AAE5D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAA;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAA;CAC9C;AAED,MAAM,WAAW,kCAAkC,CAAC,MAAM,SAAS,gBAAgB;IACjF,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAA;IACvD,QAAQ,CAAC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