@databricks/appkit 0.14.1 → 0.16.0
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/NOTICE.md +1 -0
- package/dist/_virtual/_rolldown/runtime.js +2 -0
- package/dist/app/index.d.ts.map +1 -1
- package/dist/appkit/package.js +1 -1
- package/dist/cache/index.d.ts +1 -1
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cli/commands/plugin/add-resource/add-resource.js +10 -4
- package/dist/cli/commands/plugin/add-resource/add-resource.js.map +1 -1
- package/dist/cli/commands/plugin/create/scaffold.js +10 -16
- package/dist/cli/commands/plugin/create/scaffold.js.map +1 -1
- package/dist/cli/commands/plugin/list/list.js +44 -26
- package/dist/cli/commands/plugin/list/list.js.map +1 -1
- package/dist/cli/commands/plugin/manifest-resolve.js +57 -0
- package/dist/cli/commands/plugin/manifest-resolve.js.map +1 -0
- package/dist/cli/commands/plugin/sync/sync.js +121 -71
- package/dist/cli/commands/plugin/sync/sync.js.map +1 -1
- package/dist/cli/commands/plugin/trusted-js-manifest.js +28 -0
- package/dist/cli/commands/plugin/trusted-js-manifest.js.map +1 -0
- package/dist/cli/commands/plugin/validate/validate.js +32 -14
- package/dist/cli/commands/plugin/validate/validate.js.map +1 -1
- package/dist/connectors/genie/client.d.ts +4 -0
- package/dist/connectors/genie/index.d.ts +3 -0
- package/dist/connectors/genie/types.d.ts +1 -0
- package/dist/connectors/genie/types.d.ts.map +1 -1
- package/dist/connectors/lakebase/index.d.ts +2 -3
- package/dist/connectors/lakebase/index.d.ts.map +1 -1
- package/dist/connectors/lakebase/index.js.map +1 -1
- package/dist/connectors/lakebase-v1/client.js +1 -1
- package/dist/context/execution-context.d.ts +0 -1
- package/dist/context/execution-context.d.ts.map +1 -1
- package/dist/context/index.d.ts +3 -0
- package/dist/context/service-context.d.ts +1 -1
- package/dist/context/service-context.d.ts.map +1 -1
- package/dist/context/user-context.d.ts +1 -2
- package/dist/context/user-context.d.ts.map +1 -1
- package/dist/core/appkit.d.ts +2 -1
- package/dist/core/appkit.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/errors/authentication.d.ts +0 -1
- package/dist/errors/authentication.d.ts.map +1 -1
- package/dist/errors/base.d.ts.map +1 -1
- package/dist/errors/configuration.d.ts +0 -1
- package/dist/errors/configuration.d.ts.map +1 -1
- package/dist/errors/connection.d.ts +0 -1
- package/dist/errors/connection.d.ts.map +1 -1
- package/dist/errors/execution.d.ts +0 -1
- package/dist/errors/execution.d.ts.map +1 -1
- package/dist/errors/initialization.d.ts +0 -1
- package/dist/errors/initialization.d.ts.map +1 -1
- package/dist/errors/server.d.ts +0 -1
- package/dist/errors/server.d.ts.map +1 -1
- package/dist/errors/tunnel.d.ts +0 -1
- package/dist/errors/tunnel.d.ts.map +1 -1
- package/dist/errors/validation.d.ts +0 -1
- package/dist/errors/validation.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/plugin/dev-reader.d.ts +5 -4
- package/dist/plugin/dev-reader.d.ts.map +1 -1
- package/dist/plugin/index.d.ts +4 -0
- package/dist/plugin/plugin.d.ts +3 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/to-plugin.d.ts +1 -1
- package/dist/plugin/to-plugin.d.ts.map +1 -1
- package/dist/plugins/analytics/analytics.d.ts +5 -2
- package/dist/plugins/analytics/analytics.d.ts.map +1 -1
- package/dist/plugins/analytics/analytics.js +2 -2
- package/dist/plugins/analytics/analytics.js.map +1 -1
- package/dist/plugins/analytics/index.d.ts +2 -0
- package/dist/plugins/analytics/index.js +0 -1
- package/dist/plugins/analytics/manifest.js +30 -18
- package/dist/plugins/analytics/manifest.js.map +1 -1
- package/dist/plugins/analytics/types.d.ts +1 -0
- package/dist/plugins/analytics/types.d.ts.map +1 -1
- package/dist/plugins/genie/genie.d.ts +4 -1
- package/dist/plugins/genie/genie.d.ts.map +1 -1
- package/dist/plugins/genie/genie.js +2 -2
- package/dist/plugins/genie/genie.js.map +1 -1
- package/dist/plugins/genie/index.d.ts +4 -0
- package/dist/plugins/genie/index.js +0 -1
- package/dist/plugins/genie/manifest.js +37 -8
- package/dist/plugins/genie/manifest.js.map +1 -1
- package/dist/plugins/genie/types.d.ts +2 -0
- package/dist/plugins/genie/types.d.ts.map +1 -1
- package/dist/plugins/index.d.ts +13 -0
- package/dist/plugins/index.js +0 -4
- package/dist/plugins/lakebase/index.d.ts +2 -0
- package/dist/plugins/lakebase/index.js +0 -1
- package/dist/plugins/lakebase/lakebase.d.ts +14 -12
- package/dist/plugins/lakebase/lakebase.d.ts.map +1 -1
- package/dist/plugins/lakebase/lakebase.js +2 -2
- package/dist/plugins/lakebase/lakebase.js.map +1 -1
- package/dist/plugins/lakebase/manifest.js +14 -8
- package/dist/plugins/lakebase/manifest.js.map +1 -1
- package/dist/plugins/lakebase/types.d.ts +1 -1
- package/dist/plugins/lakebase/types.d.ts.map +1 -1
- package/dist/plugins/server/index.d.ts +7 -9
- package/dist/plugins/server/index.d.ts.map +1 -1
- package/dist/plugins/server/index.js +4 -7
- package/dist/plugins/server/index.js.map +1 -1
- package/dist/plugins/server/manifest.js +36 -18
- package/dist/plugins/server/manifest.js.map +1 -1
- package/dist/plugins/server/types.d.ts +2 -0
- package/dist/plugins/server/types.d.ts.map +1 -1
- package/dist/plugins/server/utils.js +30 -1
- package/dist/plugins/server/utils.js.map +1 -1
- package/dist/registry/index.d.ts +4 -0
- package/dist/registry/manifest-loader.d.ts +1 -1
- package/dist/registry/manifest-loader.d.ts.map +1 -1
- package/dist/registry/resource-registry.d.ts +1 -1
- package/dist/registry/resource-registry.d.ts.map +1 -1
- package/dist/registry/types.d.ts +1 -4
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.generated.d.ts +1 -1
- package/dist/registry/types.generated.d.ts.map +1 -1
- package/dist/registry/types.generated.js.map +1 -1
- package/dist/shared/src/cache.d.ts +1 -1
- package/dist/shared/src/cache.d.ts.map +1 -1
- package/dist/shared/src/execute.d.ts +1 -1
- package/dist/shared/src/execute.d.ts.map +1 -1
- package/dist/shared/src/genie.d.ts.map +1 -1
- package/dist/shared/src/index.d.ts +7 -0
- package/dist/shared/src/plugin.d.ts +2 -3
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/dist/shared/src/sql/helpers.d.ts +0 -1
- package/dist/shared/src/sql/helpers.d.ts.map +1 -1
- package/dist/shared/src/sql/types.d.ts.map +1 -1
- package/dist/shared/src/tunnel.d.ts +1 -1
- package/dist/shared/src/tunnel.d.ts.map +1 -1
- package/dist/stream/arrow-stream-processor.d.ts +1 -0
- package/dist/stream/buffers.d.ts +1 -0
- package/dist/stream/index.d.ts +3 -0
- package/dist/stream/stream-manager.d.ts +1 -0
- package/dist/stream/stream-manager.d.ts.map +1 -1
- package/dist/stream/types.d.ts +3 -0
- package/dist/telemetry/config.d.ts +1 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/instrumentations.d.ts +1 -0
- package/dist/telemetry/telemetry-manager.d.ts +4 -0
- package/dist/telemetry/telemetry-provider.d.ts +6 -0
- package/dist/telemetry/types.d.ts.map +1 -1
- package/dist/type-generator/cache.js +10 -12
- package/dist/type-generator/cache.js.map +1 -1
- package/dist/type-generator/index.js +2 -2
- package/dist/type-generator/index.js.map +1 -1
- package/dist/type-generator/query-registry.js +165 -52
- package/dist/type-generator/query-registry.js.map +1 -1
- package/dist/type-generator/spinner.js +5 -1
- package/dist/type-generator/spinner.js.map +1 -1
- package/dist/type-generator/vite-plugin.d.ts +0 -1
- package/dist/type-generator/vite-plugin.d.ts.map +1 -1
- package/dist/type-generator/vite-plugin.js +2 -2
- package/dist/type-generator/vite-plugin.js.map +1 -1
- package/docs/development/project-setup.md +1 -1
- package/docs/plugins/plugin-management.md +16 -2
- package/package.json +4 -1
- package/dist/plugins/analytics/manifest.json +0 -36
- package/dist/plugins/genie/manifest.json +0 -43
- package/dist/plugins/lakebase/manifest.json +0 -12
- package/dist/plugins/server/manifest.json +0 -36
- /package/dist/plugins/server/remote-tunnel/{denied.html → denied.html/denied.html} +0 -0
- /package/dist/plugins/server/remote-tunnel/{index.html → index.html/index.html} +0 -0
- /package/dist/plugins/server/remote-tunnel/{wait.html → wait.html/wait.html} +0 -0
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
//#region src/plugins/analytics/manifest.json
|
|
2
|
+
var manifest_default = {
|
|
3
|
+
$schema: "https://databricks.github.io/appkit/schemas/plugin-manifest.schema.json",
|
|
4
|
+
name: "analytics",
|
|
5
|
+
displayName: "Analytics Plugin",
|
|
6
|
+
description: "SQL query execution against Databricks SQL Warehouses",
|
|
7
|
+
resources: {
|
|
8
|
+
"required": [{
|
|
9
|
+
"type": "sql_warehouse",
|
|
10
|
+
"alias": "SQL Warehouse",
|
|
11
|
+
"resourceKey": "sql-warehouse",
|
|
12
|
+
"description": "SQL Warehouse for executing analytics queries",
|
|
13
|
+
"permission": "CAN_USE",
|
|
14
|
+
"fields": { "id": {
|
|
15
|
+
"env": "DATABRICKS_WAREHOUSE_ID",
|
|
16
|
+
"description": "SQL Warehouse ID"
|
|
17
|
+
} }
|
|
18
|
+
}],
|
|
19
|
+
"optional": []
|
|
20
|
+
},
|
|
21
|
+
config: { "schema": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": { "timeout": {
|
|
24
|
+
"type": "number",
|
|
25
|
+
"default": 3e4,
|
|
26
|
+
"description": "Query execution timeout in milliseconds"
|
|
27
|
+
} }
|
|
28
|
+
} }
|
|
29
|
+
};
|
|
18
30
|
|
|
19
31
|
//#endregion
|
|
20
|
-
export {
|
|
32
|
+
export { manifest_default as default };
|
|
21
33
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","names":[],"sources":["../../../src/plugins/analytics/manifest.
|
|
1
|
+
{"version":3,"file":"manifest.js","names":[],"sources":["../../../src/plugins/analytics/manifest.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/plugins/analytics/types.ts"],"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/plugins/analytics/types.ts"],"mappings":";;;;UAEiB,gBAAA,SAAyB,gBAAA;EACxC,OAAA;AAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { IAppRouter, ToPlugin } from "../../shared/src/plugin.js";
|
|
2
2
|
import { GenieStreamEvent } from "../../shared/src/genie.js";
|
|
3
|
+
import "../../shared/src/index.js";
|
|
3
4
|
import { Plugin } from "../../plugin/plugin.js";
|
|
5
|
+
import "../../plugin/index.js";
|
|
4
6
|
import { PluginManifest } from "../../registry/types.js";
|
|
7
|
+
import "../../registry/index.js";
|
|
5
8
|
import { GenieConversationHistoryResponse } from "../../connectors/genie/types.js";
|
|
6
9
|
import { IGenieConfig } from "./types.js";
|
|
7
10
|
import express from "express";
|
|
@@ -40,5 +43,5 @@ declare class GeniePlugin extends Plugin {
|
|
|
40
43
|
*/
|
|
41
44
|
declare const genie: ToPlugin<typeof GeniePlugin, IGenieConfig, "genie">;
|
|
42
45
|
//#endregion
|
|
43
|
-
export { genie };
|
|
46
|
+
export { GeniePlugin, genie };
|
|
44
47
|
//# sourceMappingURL=genie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie.d.ts","names":[],"sources":["../../../src/plugins/genie/genie.ts"],"
|
|
1
|
+
{"version":3,"file":"genie.d.ts","names":[],"sources":["../../../src/plugins/genie/genie.ts"],"mappings":";;;;;;;;;;;;cAmBa,WAAA,SAAoB,MAAA;EAC/B,IAAA;EAAA,OAEO,QAAA,EAAuB,cAAA;EAAA,iBAEb,WAAA;EAAA,UAEC,MAAA,EAAQ,YAAA;EAAA,iBAET,cAAA;cAEL,MAAA,EAAQ,YAAA;EAAA,QAYZ,aAAA;EAAA,QAKA,cAAA;EAIR,YAAA,CAAa,MAAA,EAAQ,UAAA;EAoBf,kBAAA,CACJ,GAAA,EAAK,OAAA,CAAQ,OAAA,EACb,GAAA,EAAK,OAAA,CAAQ,QAAA,GACZ,OAAA;EAsDG,sBAAA,CACJ,GAAA,EAAK,OAAA,CAAQ,OAAA,EACb,GAAA,EAAK,OAAA,CAAQ,QAAA,GACZ,OAAA;EA2CG,eAAA,CACJ,KAAA,UACA,cAAA,WACC,OAAA,CAAQ,gCAAA;EA9HU;;;;EAkJd,WAAA,CACL,KAAA,UACA,OAAA,UACA,cAAA,WACA,OAAA;IAAY,OAAA;EAAA,IACX,cAAA,CAAe,gBAAA;EAgBZ,QAAA,CAAA,GAAY,OAAA;EAIlB,OAAA,CAAA;iCAxBe,OAAA,UACE,cAAA,WACQ,OAAA;MACX,OAAA;IAAA,MACX,cAAA,CAAe,gBAAA;qCA3BH,cAAA,aAEZ,OAAA,CAAQ,gCAAA;EAAA;AAAA;;;;cAwDA,KAAA,EAAK,QAAA,QAAA,WAAA,EAAA,YAAA"}
|
|
@@ -8,7 +8,7 @@ import "../../logging/index.js";
|
|
|
8
8
|
import { GenieConnector } from "../../connectors/genie/client.js";
|
|
9
9
|
import "../../connectors/index.js";
|
|
10
10
|
import { genieStreamDefaults } from "./defaults.js";
|
|
11
|
-
import
|
|
11
|
+
import manifest_default from "./manifest.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
|
|
14
14
|
//#region src/plugins/genie/genie.ts
|
|
@@ -16,7 +16,7 @@ init_context();
|
|
|
16
16
|
const logger = createLogger("genie");
|
|
17
17
|
var GeniePlugin = class extends Plugin {
|
|
18
18
|
name = "genie";
|
|
19
|
-
static manifest =
|
|
19
|
+
static manifest = manifest_default;
|
|
20
20
|
static description = "AI/BI Genie space integration for natural language data queries";
|
|
21
21
|
genieConnector;
|
|
22
22
|
constructor(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie.js","names":[],"sources":["../../../src/plugins/genie/genie.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type express from \"express\";\nimport type { IAppRouter, StreamExecutionSettings } from \"shared\";\nimport { GenieConnector } from \"../../connectors\";\nimport { getWorkspaceClient } from \"../../context\";\nimport { createLogger } from \"../../logging\";\nimport { Plugin, toPlugin } from \"../../plugin\";\nimport {
|
|
1
|
+
{"version":3,"file":"genie.js","names":["manifest"],"sources":["../../../src/plugins/genie/genie.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type express from \"express\";\nimport type { IAppRouter, StreamExecutionSettings } from \"shared\";\nimport { GenieConnector } from \"../../connectors\";\nimport { getWorkspaceClient } from \"../../context\";\nimport { createLogger } from \"../../logging\";\nimport { Plugin, toPlugin } from \"../../plugin\";\nimport type { PluginManifest } from \"../../registry\";\nimport { genieStreamDefaults } from \"./defaults\";\nimport manifest from \"./manifest.json\";\nimport type {\n GenieConversationHistoryResponse,\n GenieSendMessageRequest,\n GenieStreamEvent,\n IGenieConfig,\n} from \"./types\";\n\nconst logger = createLogger(\"genie\");\n\nexport class GeniePlugin extends Plugin {\n name = \"genie\";\n\n static manifest = manifest as PluginManifest;\n\n protected static description =\n \"AI/BI Genie space integration for natural language data queries\";\n protected declare config: IGenieConfig;\n\n private readonly genieConnector: GenieConnector;\n\n constructor(config: IGenieConfig) {\n super(config);\n this.config = {\n ...config,\n spaces: config.spaces ?? this.defaultSpaces(),\n };\n this.genieConnector = new GenieConnector({\n timeout: this.config.timeout,\n maxMessages: 200,\n });\n }\n\n private defaultSpaces(): Record<string, string> {\n const spaceId = process.env.DATABRICKS_GENIE_SPACE_ID;\n return spaceId ? { default: spaceId } : {};\n }\n\n private resolveSpaceId(alias: string): string | null {\n return this.config.spaces?.[alias] ?? null;\n }\n\n injectRoutes(router: IAppRouter) {\n this.route(router, {\n name: \"sendMessage\",\n method: \"post\",\n path: \"/:alias/messages\",\n handler: async (req: express.Request, res: express.Response) => {\n await this.asUser(req)._handleSendMessage(req, res);\n },\n });\n\n this.route(router, {\n name: \"getConversation\",\n method: \"get\",\n path: \"/:alias/conversations/:conversationId\",\n handler: async (req: express.Request, res: express.Response) => {\n await this.asUser(req)._handleGetConversation(req, res);\n },\n });\n }\n\n async _handleSendMessage(\n req: express.Request,\n res: express.Response,\n ): Promise<void> {\n const { alias } = req.params;\n const spaceId = this.resolveSpaceId(alias);\n\n if (!spaceId) {\n res.status(404).json({ error: `Unknown space alias: ${alias}` });\n return;\n }\n\n const { content, conversationId } = req.body as GenieSendMessageRequest;\n\n if (!content) {\n res.status(400).json({ error: \"content is required\" });\n return;\n }\n\n logger.debug(\n \"Sending message to space %s (alias=%s, conversationId=%s)\",\n spaceId,\n alias,\n conversationId ?? \"new\",\n );\n\n const timeout = this.config.timeout ?? 120_000;\n const requestId = (req.query.requestId as string) || randomUUID();\n\n const streamSettings: StreamExecutionSettings = {\n ...genieStreamDefaults,\n default: {\n ...genieStreamDefaults.default,\n timeout,\n },\n stream: {\n ...genieStreamDefaults.stream,\n streamId: requestId,\n },\n };\n\n const workspaceClient = getWorkspaceClient();\n\n await this.executeStream<GenieStreamEvent>(\n res,\n () =>\n this.genieConnector.streamSendMessage(\n workspaceClient,\n spaceId,\n content,\n conversationId,\n { timeout },\n ),\n streamSettings,\n );\n }\n\n async _handleGetConversation(\n req: express.Request,\n res: express.Response,\n ): Promise<void> {\n const { alias, conversationId } = req.params;\n const spaceId = this.resolveSpaceId(alias);\n\n if (!spaceId) {\n res.status(404).json({ error: `Unknown space alias: ${alias}` });\n return;\n }\n\n const includeQueryResults = req.query.includeQueryResults !== \"false\";\n const requestId = (req.query.requestId as string) || randomUUID();\n\n logger.debug(\n \"Fetching conversation %s from space %s (alias=%s, includeQueryResults=%s)\",\n conversationId,\n spaceId,\n alias,\n includeQueryResults,\n );\n\n const streamSettings: StreamExecutionSettings = {\n ...genieStreamDefaults,\n stream: {\n ...genieStreamDefaults.stream,\n streamId: requestId,\n },\n };\n\n const workspaceClient = getWorkspaceClient();\n\n await this.executeStream<GenieStreamEvent>(\n res,\n () =>\n this.genieConnector.streamConversation(\n workspaceClient,\n spaceId,\n conversationId,\n { includeQueryResults },\n ),\n streamSettings,\n );\n }\n\n async getConversation(\n alias: string,\n conversationId: string,\n ): Promise<GenieConversationHistoryResponse> {\n const spaceId = this.resolveSpaceId(alias);\n\n if (!spaceId) {\n throw new Error(`Unknown space alias: ${alias}`);\n }\n\n const workspaceClient = getWorkspaceClient();\n\n return this.genieConnector.getConversation(\n workspaceClient,\n spaceId,\n conversationId,\n );\n }\n\n /**\n * Send a message and consume events as a stream (message_start, status,\n * message_result, query_result, error).\n */\n async *sendMessage(\n alias: string,\n content: string,\n conversationId?: string,\n options?: { timeout?: number },\n ): AsyncGenerator<GenieStreamEvent> {\n const spaceId = this.resolveSpaceId(alias);\n if (!spaceId) {\n throw new Error(`Unknown space alias: ${alias}`);\n }\n const workspaceClient = getWorkspaceClient();\n const timeout = options?.timeout ?? this.config.timeout ?? 120_000;\n yield* this.genieConnector.streamSendMessage(\n workspaceClient,\n spaceId,\n content,\n conversationId,\n { timeout },\n );\n }\n\n async shutdown(): Promise<void> {\n this.streamManager.abortAll();\n }\n\n exports() {\n return {\n sendMessage: this.sendMessage,\n getConversation: this.getConversation,\n };\n }\n}\n\n/**\n * @internal\n */\nexport const genie = toPlugin<typeof GeniePlugin, IGenieConfig, \"genie\">(\n GeniePlugin,\n \"genie\",\n);\n"],"mappings":";;;;;;;;;;;;;;cAImD;AAanD,MAAM,SAAS,aAAa,QAAQ;AAEpC,IAAa,cAAb,cAAiC,OAAO;CACtC,OAAO;CAEP,OAAO,WAAWA;CAElB,OAAiB,cACf;CAGF,AAAiB;CAEjB,YAAY,QAAsB;AAChC,QAAM,OAAO;AACb,OAAK,SAAS;GACZ,GAAG;GACH,QAAQ,OAAO,UAAU,KAAK,eAAe;GAC9C;AACD,OAAK,iBAAiB,IAAI,eAAe;GACvC,SAAS,KAAK,OAAO;GACrB,aAAa;GACd,CAAC;;CAGJ,AAAQ,gBAAwC;EAC9C,MAAM,UAAU,QAAQ,IAAI;AAC5B,SAAO,UAAU,EAAE,SAAS,SAAS,GAAG,EAAE;;CAG5C,AAAQ,eAAe,OAA8B;AACnD,SAAO,KAAK,OAAO,SAAS,UAAU;;CAGxC,aAAa,QAAoB;AAC/B,OAAK,MAAM,QAAQ;GACjB,MAAM;GACN,QAAQ;GACR,MAAM;GACN,SAAS,OAAO,KAAsB,QAA0B;AAC9D,UAAM,KAAK,OAAO,IAAI,CAAC,mBAAmB,KAAK,IAAI;;GAEtD,CAAC;AAEF,OAAK,MAAM,QAAQ;GACjB,MAAM;GACN,QAAQ;GACR,MAAM;GACN,SAAS,OAAO,KAAsB,QAA0B;AAC9D,UAAM,KAAK,OAAO,IAAI,CAAC,uBAAuB,KAAK,IAAI;;GAE1D,CAAC;;CAGJ,MAAM,mBACJ,KACA,KACe;EACf,MAAM,EAAE,UAAU,IAAI;EACtB,MAAM,UAAU,KAAK,eAAe,MAAM;AAE1C,MAAI,CAAC,SAAS;AACZ,OAAI,OAAO,IAAI,CAAC,KAAK,EAAE,OAAO,wBAAwB,SAAS,CAAC;AAChE;;EAGF,MAAM,EAAE,SAAS,mBAAmB,IAAI;AAExC,MAAI,CAAC,SAAS;AACZ,OAAI,OAAO,IAAI,CAAC,KAAK,EAAE,OAAO,uBAAuB,CAAC;AACtD;;AAGF,SAAO,MACL,6DACA,SACA,OACA,kBAAkB,MACnB;EAED,MAAM,UAAU,KAAK,OAAO,WAAW;EACvC,MAAM,YAAa,IAAI,MAAM,aAAwB,YAAY;EAEjE,MAAM,iBAA0C;GAC9C,GAAG;GACH,SAAS;IACP,GAAG,oBAAoB;IACvB;IACD;GACD,QAAQ;IACN,GAAG,oBAAoB;IACvB,UAAU;IACX;GACF;EAED,MAAM,kBAAkB,oBAAoB;AAE5C,QAAM,KAAK,cACT,WAEE,KAAK,eAAe,kBAClB,iBACA,SACA,SACA,gBACA,EAAE,SAAS,CACZ,EACH,eACD;;CAGH,MAAM,uBACJ,KACA,KACe;EACf,MAAM,EAAE,OAAO,mBAAmB,IAAI;EACtC,MAAM,UAAU,KAAK,eAAe,MAAM;AAE1C,MAAI,CAAC,SAAS;AACZ,OAAI,OAAO,IAAI,CAAC,KAAK,EAAE,OAAO,wBAAwB,SAAS,CAAC;AAChE;;EAGF,MAAM,sBAAsB,IAAI,MAAM,wBAAwB;EAC9D,MAAM,YAAa,IAAI,MAAM,aAAwB,YAAY;AAEjE,SAAO,MACL,6EACA,gBACA,SACA,OACA,oBACD;EAED,MAAM,iBAA0C;GAC9C,GAAG;GACH,QAAQ;IACN,GAAG,oBAAoB;IACvB,UAAU;IACX;GACF;EAED,MAAM,kBAAkB,oBAAoB;AAE5C,QAAM,KAAK,cACT,WAEE,KAAK,eAAe,mBAClB,iBACA,SACA,gBACA,EAAE,qBAAqB,CACxB,EACH,eACD;;CAGH,MAAM,gBACJ,OACA,gBAC2C;EAC3C,MAAM,UAAU,KAAK,eAAe,MAAM;AAE1C,MAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB,QAAQ;EAGlD,MAAM,kBAAkB,oBAAoB;AAE5C,SAAO,KAAK,eAAe,gBACzB,iBACA,SACA,eACD;;;;;;CAOH,OAAO,YACL,OACA,SACA,gBACA,SACkC;EAClC,MAAM,UAAU,KAAK,eAAe,MAAM;AAC1C,MAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB,QAAQ;EAElD,MAAM,kBAAkB,oBAAoB;EAC5C,MAAM,UAAU,SAAS,WAAW,KAAK,OAAO,WAAW;AAC3D,SAAO,KAAK,eAAe,kBACzB,iBACA,SACA,SACA,gBACA,EAAE,SAAS,CACZ;;CAGH,MAAM,WAA0B;AAC9B,OAAK,cAAc,UAAU;;CAG/B,UAAU;AACR,SAAO;GACL,aAAa,KAAK;GAClB,iBAAiB,KAAK;GACvB;;;;;;AAOL,MAAa,QAAQ,SACnB,aACA,QACD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GenieAttachmentResponse, GenieMessageResponse, GenieStreamEvent } from "../../shared/src/genie.js";
|
|
2
|
+
import { GenieConversationHistoryResponse } from "../../connectors/genie/types.js";
|
|
3
|
+
import { IGenieConfig } from "./types.js";
|
|
4
|
+
import { GeniePlugin, genie } from "./genie.js";
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/plugins/genie/manifest.json
|
|
2
|
+
var manifest_default = {
|
|
3
|
+
name: "genie",
|
|
4
|
+
displayName: "Genie Plugin",
|
|
5
|
+
description: "AI/BI Genie space integration for natural language data queries",
|
|
6
|
+
resources: {
|
|
7
|
+
"required": [{
|
|
8
|
+
"type": "genie_space",
|
|
9
|
+
"alias": "Genie Space",
|
|
10
|
+
"resourceKey": "genie-space",
|
|
11
|
+
"description": "Genie Space for AI-powered data queries. Space IDs configured via plugin config.",
|
|
12
|
+
"permission": "CAN_RUN",
|
|
13
|
+
"fields": { "id": {
|
|
14
|
+
"env": "DATABRICKS_GENIE_SPACE_ID",
|
|
15
|
+
"description": "Default Genie Space ID"
|
|
16
|
+
} }
|
|
17
|
+
}],
|
|
18
|
+
"optional": []
|
|
19
|
+
},
|
|
20
|
+
config: { "schema": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"spaces": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"description": "Map of alias names to Genie Space IDs",
|
|
26
|
+
"additionalProperties": { "type": "string" }
|
|
27
|
+
},
|
|
28
|
+
"timeout": {
|
|
29
|
+
"type": "number",
|
|
30
|
+
"default": 12e4,
|
|
31
|
+
"description": "Genie polling timeout in ms. Set to 0 for indefinite."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["spaces"]
|
|
35
|
+
} }
|
|
36
|
+
};
|
|
8
37
|
|
|
9
38
|
//#endregion
|
|
10
|
-
export {
|
|
39
|
+
export { manifest_default as default };
|
|
11
40
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","names":[],"sources":["../../../src/plugins/genie/manifest.
|
|
1
|
+
{"version":3,"file":"manifest.js","names":[],"sources":["../../../src/plugins/genie/manifest.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BasePluginConfig } from "../../shared/src/plugin.js";
|
|
2
2
|
import { GenieAttachmentResponse, GenieMessageResponse, GenieStreamEvent } from "../../shared/src/genie.js";
|
|
3
|
+
import "../../shared/src/index.js";
|
|
3
4
|
import { GenieConversationHistoryResponse } from "../../connectors/genie/types.js";
|
|
5
|
+
import "../../connectors/genie/index.js";
|
|
4
6
|
|
|
5
7
|
//#region src/plugins/genie/types.d.ts
|
|
6
8
|
interface IGenieConfig extends BasePluginConfig {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/plugins/genie/types.ts"],"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/plugins/genie/types.ts"],"mappings":";;;;;;;UAUiB,YAAA,SAAqB,gBAAA;;EAEpC,MAAA,GAAS,MAAA;;EAET,OAAA;AAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GenieAttachmentResponse, GenieMessageResponse, GenieStreamEvent } from "../shared/src/genie.js";
|
|
2
|
+
import { IAnalyticsConfig } from "./analytics/types.js";
|
|
3
|
+
import { AnalyticsPlugin, analytics } from "./analytics/analytics.js";
|
|
4
|
+
import "./analytics/index.js";
|
|
5
|
+
import { GenieConversationHistoryResponse } from "../connectors/genie/types.js";
|
|
6
|
+
import { IGenieConfig } from "./genie/types.js";
|
|
7
|
+
import { GeniePlugin, genie } from "./genie/genie.js";
|
|
8
|
+
import "./genie/index.js";
|
|
9
|
+
import { ILakebaseConfig } from "./lakebase/types.js";
|
|
10
|
+
import { LakebasePlugin, lakebase } from "./lakebase/lakebase.js";
|
|
11
|
+
import "./lakebase/index.js";
|
|
12
|
+
import { ServerConfig } from "./server/types.js";
|
|
13
|
+
import { ServerPlugin, server } from "./server/index.js";
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { analyticsManifest } from "./analytics/manifest.js";
|
|
2
1
|
import { AnalyticsPlugin, analytics } from "./analytics/analytics.js";
|
|
3
2
|
import "./analytics/index.js";
|
|
4
|
-
import { genieManifest } from "./genie/manifest.js";
|
|
5
3
|
import { GeniePlugin, genie } from "./genie/genie.js";
|
|
6
4
|
import "./genie/index.js";
|
|
7
|
-
import { lakebaseManifest } from "./lakebase/manifest.js";
|
|
8
5
|
import { LakebasePlugin, lakebase } from "./lakebase/lakebase.js";
|
|
9
6
|
import "./lakebase/index.js";
|
|
10
|
-
import { serverManifest } from "./server/manifest.js";
|
|
11
7
|
import { ServerPlugin, server } from "./server/index.js";
|
|
12
8
|
|
|
13
9
|
export { };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ToPlugin } from "../../shared/src/plugin.js";
|
|
2
|
+
import "../../shared/src/index.js";
|
|
2
3
|
import { Plugin } from "../../plugin/plugin.js";
|
|
4
|
+
import "../../plugin/index.js";
|
|
3
5
|
import { PluginManifest } from "../../registry/types.js";
|
|
6
|
+
import "../../registry/index.js";
|
|
4
7
|
import { ILakebaseConfig } from "./types.js";
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
+
import * as pg from "pg";
|
|
9
|
+
import { Pool, QueryResult, QueryResultRow } from "pg";
|
|
10
|
+
import * as stream from "stream";
|
|
8
11
|
|
|
9
12
|
//#region src/plugins/lakebase/lakebase.d.ts
|
|
10
|
-
|
|
11
13
|
/**
|
|
12
14
|
* AppKit plugin for Databricks Lakebase Autoscaling.
|
|
13
15
|
*
|
|
@@ -55,7 +57,7 @@ declare class LakebasePlugin extends Plugin {
|
|
|
55
57
|
* );
|
|
56
58
|
* ```
|
|
57
59
|
*/
|
|
58
|
-
query<T extends
|
|
60
|
+
query<T extends QueryResultRow = any>(text: string, values?: unknown[]): Promise<QueryResult<T>>;
|
|
59
61
|
/**
|
|
60
62
|
* Gracefully drains and closes the connection pool.
|
|
61
63
|
* Called automatically by AppKit during shutdown.
|
|
@@ -70,8 +72,8 @@ declare class LakebasePlugin extends Plugin {
|
|
|
70
72
|
* - `getPgConfig()` — Returns a `pg.PoolConfig` object for manual pool construction
|
|
71
73
|
*/
|
|
72
74
|
exports(): {
|
|
73
|
-
pool:
|
|
74
|
-
query: <T extends
|
|
75
|
+
pool: Pool;
|
|
76
|
+
query: <T extends QueryResultRow = any>(text: string, values?: unknown[]) => Promise<QueryResult<T>>;
|
|
75
77
|
getOrmConfig: () => {
|
|
76
78
|
username: string | undefined;
|
|
77
79
|
password: string | (() => string) | (() => Promise<string>) | undefined;
|
|
@@ -86,13 +88,13 @@ declare class LakebasePlugin extends Plugin {
|
|
|
86
88
|
allowExitOnIdle?: boolean | undefined;
|
|
87
89
|
maxUses?: number | undefined;
|
|
88
90
|
maxLifetimeSeconds?: number | undefined;
|
|
89
|
-
Client?: (new () =>
|
|
91
|
+
Client?: (new () => pg.ClientBase) | undefined;
|
|
90
92
|
database?: string | undefined;
|
|
91
93
|
port?: number | undefined;
|
|
92
94
|
host?: string | undefined;
|
|
93
95
|
connectionString?: string | undefined;
|
|
94
96
|
keepAlive?: boolean | undefined;
|
|
95
|
-
stream?: () =>
|
|
97
|
+
stream?: () => stream.Duplex | undefined;
|
|
96
98
|
statement_timeout?: false | number | undefined;
|
|
97
99
|
query_timeout?: number | undefined;
|
|
98
100
|
lock_timeout?: number | undefined;
|
|
@@ -101,11 +103,11 @@ declare class LakebasePlugin extends Plugin {
|
|
|
101
103
|
application_name?: string | undefined;
|
|
102
104
|
fallback_application_name?: string | undefined;
|
|
103
105
|
connectionTimeoutMillis?: number | undefined;
|
|
104
|
-
types?:
|
|
106
|
+
types?: pg.CustomTypesConfig | undefined;
|
|
105
107
|
options?: string | undefined;
|
|
106
108
|
client_encoding?: string | undefined;
|
|
107
109
|
};
|
|
108
|
-
getPgConfig: () =>
|
|
110
|
+
getPgConfig: () => pg.PoolConfig;
|
|
109
111
|
};
|
|
110
112
|
}
|
|
111
113
|
/**
|
|
@@ -113,5 +115,5 @@ declare class LakebasePlugin extends Plugin {
|
|
|
113
115
|
*/
|
|
114
116
|
declare const lakebase: ToPlugin<typeof LakebasePlugin, ILakebaseConfig, "lakebase">;
|
|
115
117
|
//#endregion
|
|
116
|
-
export { lakebase };
|
|
118
|
+
export { LakebasePlugin, lakebase };
|
|
117
119
|
//# sourceMappingURL=lakebase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lakebase.d.ts","names":[],"sources":["../../../src/plugins/lakebase/lakebase.ts"],"
|
|
1
|
+
{"version":3,"file":"lakebase.d.ts","names":[],"sources":["../../../src/plugins/lakebase/lakebase.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA;;;;;;;;;cAAa,cAAA,SAAuB,MAAA;EAClC,IAAA;;SAGO,QAAA,EAAuB,cAAA;EAAA,UAEZ,MAAA,EAAQ,eAAA;EAAA,QAClB,IAAA;cAEI,MAAA,EAAQ,eAAA;;;;;;;;EAYd,KAAA,CAAA,GAAK,OAAA;EArB6B;;;;;;;;;;;;;;;EA2ClC,KAAA,WAAgB,cAAA,OAAA,CACpB,IAAA,UACA,MAAA,eACC,OAAA,CAAQ,WAAA,CAAY,CAAA;EAFrB;;;;EAWF,qBAAA,CAAA;EAAA;;;;;;;;EAmBA,OAAA,CAAA;;sBA/BsB,cAAA,QAAc,IAAA,UACtB,MAAA,iBAEX,OAAA,CAAQ,WAAA,CAAY,CAAA;;;;;;;;;;iBAtBY,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgExB,QAAA,EAAQ,QAAA,QAAA,cAAA,EAAA,eAAA"}
|
|
@@ -3,7 +3,7 @@ import { createLakebasePool, getLakebaseOrmConfig, getLakebasePgConfig, getUsern
|
|
|
3
3
|
import { Plugin } from "../../plugin/plugin.js";
|
|
4
4
|
import { toPlugin } from "../../plugin/to-plugin.js";
|
|
5
5
|
import "../../plugin/index.js";
|
|
6
|
-
import
|
|
6
|
+
import manifest_default from "./manifest.js";
|
|
7
7
|
|
|
8
8
|
//#region src/plugins/lakebase/lakebase.ts
|
|
9
9
|
const logger = createLogger("lakebase");
|
|
@@ -27,7 +27,7 @@ const logger = createLogger("lakebase");
|
|
|
27
27
|
var LakebasePlugin = class extends Plugin {
|
|
28
28
|
name = "lakebase";
|
|
29
29
|
/** Plugin manifest declaring metadata and resource requirements */
|
|
30
|
-
static manifest =
|
|
30
|
+
static manifest = manifest_default;
|
|
31
31
|
pool = null;
|
|
32
32
|
constructor(config) {
|
|
33
33
|
super(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lakebase.js","names":[],"sources":["../../../src/plugins/lakebase/lakebase.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"lakebase.js","names":["manifest"],"sources":["../../../src/plugins/lakebase/lakebase.ts"],"sourcesContent":["import type { Pool, QueryResult, QueryResultRow } from \"pg\";\nimport {\n createLakebasePool,\n getLakebaseOrmConfig,\n getLakebasePgConfig,\n getUsernameWithApiLookup,\n} from \"../../connectors/lakebase\";\nimport { createLogger } from \"../../logging/logger\";\nimport { Plugin, toPlugin } from \"../../plugin\";\nimport type { PluginManifest } from \"../../registry\";\nimport manifest from \"./manifest.json\";\nimport type { ILakebaseConfig } from \"./types\";\n\nconst logger = createLogger(\"lakebase\");\n\n/**\n * AppKit plugin for Databricks Lakebase Autoscaling.\n *\n * Wraps `@databricks/lakebase` to provide a standard `pg.Pool` with automatic\n * OAuth token refresh, integrated with AppKit's logger and OpenTelemetry setup.\n *\n * @example\n * ```ts\n * import { createApp, lakebase, server } from \"@databricks/appkit\";\n *\n * const AppKit = await createApp({\n * plugins: [server(), lakebase()],\n * });\n *\n * const result = await AppKit.lakebase.query(\"SELECT * FROM users WHERE id = $1\", [userId]);\n * ```\n */\nexport class LakebasePlugin extends Plugin {\n name = \"lakebase\";\n\n /** Plugin manifest declaring metadata and resource requirements */\n static manifest = manifest as PluginManifest;\n\n protected declare config: ILakebaseConfig;\n private pool: Pool | null = null;\n\n constructor(config: ILakebaseConfig) {\n super(config);\n this.config = config;\n }\n\n /**\n * Initializes the Lakebase connection pool.\n * Called automatically by AppKit during the plugin setup phase.\n *\n * Resolves the PostgreSQL username via {@link getUsernameWithApiLookup},\n * which tries config, env vars, and finally the Databricks workspace API.\n */\n async setup() {\n const poolConfig = this.config.pool;\n const user = await getUsernameWithApiLookup(poolConfig);\n this.pool = createLakebasePool({ ...poolConfig, user });\n logger.info(\"Lakebase pool initialized\");\n }\n\n /**\n * Executes a parameterized SQL query against the Lakebase pool.\n *\n * @param text - SQL query string, using `$1`, `$2`, ... placeholders\n * @param values - Parameter values corresponding to placeholders\n * @returns Query result with typed rows\n *\n * @example\n * ```ts\n * const result = await AppKit.lakebase.query<{ id: number; name: string }>(\n * \"SELECT id, name FROM users WHERE active = $1\",\n * [true],\n * );\n * ```\n */\n async query<T extends QueryResultRow = any>(\n text: string,\n values?: unknown[],\n ): Promise<QueryResult<T>> {\n // biome-ignore lint/style/noNonNullAssertion: pool is guaranteed non-null after setup(), which AppKit always awaits before exposing the plugin API\n return this.pool!.query<T>(text, values);\n }\n\n /**\n * Gracefully drains and closes the connection pool.\n * Called automatically by AppKit during shutdown.\n */\n abortActiveOperations(): void {\n super.abortActiveOperations();\n if (this.pool) {\n logger.info(\"Closing Lakebase pool\");\n this.pool.end().catch((err) => {\n logger.error(\"Error closing Lakebase pool: %O\", err);\n });\n this.pool = null;\n }\n }\n\n /**\n * Returns the plugin's public API, accessible via `AppKit.lakebase`.\n *\n * - `pool` — The raw `pg.Pool` instance, for use with ORMs or advanced scenarios\n * - `query` — Convenience method for executing parameterized SQL queries\n * - `getOrmConfig()` — Returns a config object compatible with Drizzle, TypeORM, Sequelize, etc.\n * - `getPgConfig()` — Returns a `pg.PoolConfig` object for manual pool construction\n */\n exports() {\n return {\n // biome-ignore lint/style/noNonNullAssertion: pool is guaranteed non-null after setup(), which AppKit always awaits before exposing the plugin API\n pool: this.pool!,\n query: this.query.bind(this),\n getOrmConfig: () => getLakebaseOrmConfig(this.config.pool),\n getPgConfig: () => getLakebasePgConfig(this.config.pool),\n };\n }\n}\n\n/**\n * @internal\n */\nexport const lakebase = toPlugin<\n typeof LakebasePlugin,\n ILakebaseConfig,\n \"lakebase\"\n>(LakebasePlugin, \"lakebase\");\n"],"mappings":";;;;;;;;AAaA,MAAM,SAAS,aAAa,WAAW;;;;;;;;;;;;;;;;;;AAmBvC,IAAa,iBAAb,cAAoC,OAAO;CACzC,OAAO;;CAGP,OAAO,WAAWA;CAGlB,AAAQ,OAAoB;CAE5B,YAAY,QAAyB;AACnC,QAAM,OAAO;AACb,OAAK,SAAS;;;;;;;;;CAUhB,MAAM,QAAQ;EACZ,MAAM,aAAa,KAAK,OAAO;EAC/B,MAAM,OAAO,MAAM,yBAAyB,WAAW;AACvD,OAAK,OAAO,mBAAmB;GAAE,GAAG;GAAY;GAAM,CAAC;AACvD,SAAO,KAAK,4BAA4B;;;;;;;;;;;;;;;;;CAkB1C,MAAM,MACJ,MACA,QACyB;AAEzB,SAAO,KAAK,KAAM,MAAS,MAAM,OAAO;;;;;;CAO1C,wBAA8B;AAC5B,QAAM,uBAAuB;AAC7B,MAAI,KAAK,MAAM;AACb,UAAO,KAAK,wBAAwB;AACpC,QAAK,KAAK,KAAK,CAAC,OAAO,QAAQ;AAC7B,WAAO,MAAM,mCAAmC,IAAI;KACpD;AACF,QAAK,OAAO;;;;;;;;;;;CAYhB,UAAU;AACR,SAAO;GAEL,MAAM,KAAK;GACX,OAAO,KAAK,MAAM,KAAK,KAAK;GAC5B,oBAAoB,qBAAqB,KAAK,OAAO,KAAK;GAC1D,mBAAmB,oBAAoB,KAAK,OAAO,KAAK;GACzD;;;;;;AAOL,MAAa,WAAW,SAItB,gBAAgB,WAAW"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
//#region src/plugins/lakebase/manifest.json
|
|
2
|
+
var manifest_default = {
|
|
3
|
+
$schema: "https://databricks.github.io/appkit/schemas/plugin-manifest.schema.json",
|
|
4
|
+
name: "lakebase",
|
|
5
|
+
displayName: "Lakebase",
|
|
6
|
+
description: "SQL query execution against Databricks Lakebase Autoscaling",
|
|
7
|
+
onSetupMessage: "Configure environment variables before running or deploying the app.\nSee: https://databricks.github.io/appkit/docs/plugins/lakebase",
|
|
8
|
+
hidden: false,
|
|
9
|
+
resources: {
|
|
10
|
+
"required": [],
|
|
11
|
+
"optional": []
|
|
12
|
+
}
|
|
13
|
+
};
|
|
8
14
|
|
|
9
15
|
//#endregion
|
|
10
|
-
export {
|
|
16
|
+
export { manifest_default as default };
|
|
11
17
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","names":[],"sources":["../../../src/plugins/lakebase/manifest.
|
|
1
|
+
{"version":3,"file":"manifest.js","names":[],"sources":["../../../src/plugins/lakebase/manifest.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BasePluginConfig } from "../../shared/src/plugin.js";
|
|
2
|
+
import "../../shared/src/index.js";
|
|
2
3
|
import { LakebasePoolConfig } from "../../connectors/lakebase/index.js";
|
|
3
4
|
|
|
4
5
|
//#region src/plugins/lakebase/types.d.ts
|
|
5
|
-
|
|
6
6
|
/**
|
|
7
7
|
* Configuration for the Lakebase plugin.
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/plugins/lakebase/types.ts"],"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/plugins/lakebase/types.ts"],"mappings":";;;;;;;;AAWA;;;;;UAAiB,eAAA,SAAwB,gBAAA;EAAgB;;;;;;EAOvD,IAAA,GAAO,OAAA,CAAQ,kBAAA;AAAA"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { PluginPhase, TelemetryOptions, ToPlugin } from "../../shared/src/plugin.js";
|
|
2
|
+
import "../../shared/src/index.js";
|
|
2
3
|
import { Plugin } from "../../plugin/plugin.js";
|
|
4
|
+
import "../../plugin/index.js";
|
|
3
5
|
import { PluginManifest } from "../../registry/types.js";
|
|
6
|
+
import "../../registry/index.js";
|
|
4
7
|
import { ServerConfig } from "./types.js";
|
|
5
8
|
import express from "express";
|
|
6
9
|
import { Server } from "node:http";
|
|
7
10
|
|
|
8
11
|
//#region src/plugins/server/index.d.ts
|
|
9
|
-
|
|
10
12
|
/**
|
|
11
13
|
* Server plugin for the AppKit.
|
|
12
14
|
*
|
|
@@ -100,13 +102,9 @@ declare class ServerPlugin extends Plugin {
|
|
|
100
102
|
* Exposes server management methods.
|
|
101
103
|
*/
|
|
102
104
|
exports(): {
|
|
103
|
-
/** Start the server */
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
extend(fn: (app: express.Application) => void): /*elided*/any;
|
|
107
|
-
/** Get the underlying HTTP server instance */
|
|
108
|
-
getServer: () => Server;
|
|
109
|
-
/** Get the server configuration */
|
|
105
|
+
/** Start the server */start: () => Promise<express.Application>; /** Extend the server with custom routes or middleware */
|
|
106
|
+
extend(fn: (app: express.Application) => void): /*elided*/any; /** Get the underlying HTTP server instance */
|
|
107
|
+
getServer: () => Server; /** Get the server configuration */
|
|
110
108
|
getConfig: () => {
|
|
111
109
|
[key: string]: unknown;
|
|
112
110
|
port?: number;
|
|
@@ -123,5 +121,5 @@ declare class ServerPlugin extends Plugin {
|
|
|
123
121
|
*/
|
|
124
122
|
declare const server: ToPlugin<typeof ServerPlugin, ServerConfig, "server">;
|
|
125
123
|
//#endregion
|
|
126
|
-
export { server };
|
|
124
|
+
export { ServerPlugin, server };
|
|
127
125
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugins/server/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugins/server/index.ts"],"mappings":";;;;;;;;;;;;;;;;AAoCA;;;;;;;;;cAAa,YAAA,SAAqB,MAAA;EAAA,OAClB,cAAA;;;;;EA+SO;EAAA,OAxSd,QAAA,EAAuB,cAAA;EAEvB,IAAA;EAAA,QACC,iBAAA;EAAA,QACA,MAAA;EAAA,QACA,aAAA;EAAA,QACA,sBAAA;EAAA,UACU,MAAA,EAAQ,YAAA;EAAA,QAClB,gBAAA;EAAA,OACD,KAAA,EAAO,WAAA;cAEF,MAAA,EAAQ,YAAA;EAXb;EAwBD,KAAA,CAAA,GAAK,OAAA;EAtBJ;EA6BP,SAAA,CAAA;IAAA;;;;;;gBAPW,gBAAA;EAAA;;EAcX,eAAA,CAAA;EA3BY;;;;;;;;EAuCN,KAAA,CAAA,GAAS,OAAA,CAAQ,OAAA,CAAQ,WAAA;;;;;;;;;EA8C/B,SAAA,CAAA,GAAa,MAAA;EAAA;;;;;;;EAmBb,MAAA,CAAO,EAAA,GAAK,GAAA,EAAK,OAAA,CAAQ,WAAA;EAqFV;;;;;;EAAA,QAtED,YAAA;EAhFiB;;;;;;EAAA,QAmHjB,aAAA;EAAA,eAmCC,cAAA;EAAA,QAaP,cAAA;EAAA,QA4BM,iBAAA;;;;;EAiDd,OAAA,CAAA;wCAhPe,OAAA,CAAQ,OAAA,CAAQ,WAAA;gBAsPf,GAAA,EAAK,OAAA,CAAQ,WAAA,2BAiBlB;qBAzNE,MAAA,EA4Nd;;;;;;;;kBA5NwB,gBAAA;IAAA;EAAA;AAAA;;;;cAyNZ,MAAA,EAAM,QAAA,QAAA,YAAA,EAAA,YAAA"}
|
|
@@ -6,9 +6,9 @@ import "../../telemetry/index.js";
|
|
|
6
6
|
import { Plugin } from "../../plugin/plugin.js";
|
|
7
7
|
import { toPlugin } from "../../plugin/to-plugin.js";
|
|
8
8
|
import "../../plugin/index.js";
|
|
9
|
-
import
|
|
9
|
+
import manifest_default from "./manifest.js";
|
|
10
10
|
import { RemoteTunnelController } from "./remote-tunnel/remote-tunnel-controller.js";
|
|
11
|
-
import { getRoutes } from "./utils.js";
|
|
11
|
+
import { getRoutes, printRoutes } from "./utils.js";
|
|
12
12
|
import { StaticServer } from "./static-server.js";
|
|
13
13
|
import { ViteDevServer } from "./vite-dev-server.js";
|
|
14
14
|
import path from "node:path";
|
|
@@ -41,7 +41,7 @@ var ServerPlugin = class ServerPlugin extends Plugin {
|
|
|
41
41
|
port: Number(process.env.DATABRICKS_APP_PORT) || 8e3
|
|
42
42
|
};
|
|
43
43
|
/** Plugin manifest declaring metadata and resource requirements */
|
|
44
|
-
static manifest =
|
|
44
|
+
static manifest = manifest_default;
|
|
45
45
|
name = "server";
|
|
46
46
|
serverApplication;
|
|
47
47
|
server;
|
|
@@ -90,10 +90,7 @@ var ServerPlugin = class ServerPlugin extends Plugin {
|
|
|
90
90
|
this.remoteTunnelController.setServer(server);
|
|
91
91
|
process.on("SIGTERM", () => this._gracefulShutdown());
|
|
92
92
|
process.on("SIGINT", () => this._gracefulShutdown());
|
|
93
|
-
if (process.env.NODE_ENV === "development")
|
|
94
|
-
const allRoutes = getRoutes(this.serverApplication._router.stack);
|
|
95
|
-
console.dir(allRoutes, { depth: null });
|
|
96
|
-
}
|
|
93
|
+
if (process.env.NODE_ENV === "development") printRoutes(getRoutes(this.serverApplication._router.stack));
|
|
97
94
|
return this.serverApplication;
|
|
98
95
|
}
|
|
99
96
|
/**
|