@databricks/appkit 0.17.0 → 0.19.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/CLAUDE.md +9 -1
- package/dist/appkit/package.js +1 -1
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +2 -2
- package/dist/cache/index.js.map +1 -1
- package/dist/cli/commands/plugin/create/scaffold.js +2 -8
- package/dist/cli/commands/plugin/create/scaffold.js.map +1 -1
- package/dist/connectors/files/client.js +223 -0
- package/dist/connectors/files/client.js.map +1 -0
- package/dist/connectors/files/defaults.js +131 -0
- package/dist/connectors/files/defaults.js.map +1 -0
- package/dist/connectors/files/index.js +4 -0
- package/dist/connectors/genie/client.js.map +1 -1
- package/dist/connectors/genie/types.d.ts +1 -1
- package/dist/connectors/genie/types.d.ts.map +1 -1
- package/dist/connectors/index.js +3 -0
- package/dist/context/execution-context.js +7 -1
- package/dist/context/execution-context.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/core/appkit.d.ts.map +1 -1
- package/dist/core/appkit.js +24 -4
- package/dist/core/appkit.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin/plugin.d.ts +24 -5
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +43 -10
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/plugin/to-plugin.d.ts +5 -2
- package/dist/plugin/to-plugin.d.ts.map +1 -1
- package/dist/plugin/to-plugin.js +5 -2
- package/dist/plugin/to-plugin.js.map +1 -1
- package/dist/plugins/analytics/analytics.d.ts +1 -2
- package/dist/plugins/analytics/analytics.d.ts.map +1 -1
- package/dist/plugins/analytics/analytics.js +1 -2
- package/dist/plugins/analytics/analytics.js.map +1 -1
- package/dist/plugins/files/defaults.d.ts +1 -0
- package/dist/plugins/files/defaults.js +56 -0
- package/dist/plugins/files/defaults.js.map +1 -0
- package/dist/plugins/files/helpers.js +30 -0
- package/dist/plugins/files/helpers.js.map +1 -0
- package/dist/plugins/files/index.d.ts +3 -0
- package/dist/plugins/files/index.js +5 -0
- package/dist/plugins/files/manifest.js +40 -0
- package/dist/plugins/files/manifest.js.map +1 -0
- package/dist/plugins/files/plugin.d.ts +105 -0
- package/dist/plugins/files/plugin.d.ts.map +1 -0
- package/dist/plugins/files/plugin.js +714 -0
- package/dist/plugins/files/plugin.js.map +1 -0
- package/dist/plugins/files/types.d.ts +105 -0
- package/dist/plugins/files/types.d.ts.map +1 -0
- package/dist/plugins/genie/genie.d.ts +1 -2
- package/dist/plugins/genie/genie.d.ts.map +1 -1
- package/dist/plugins/genie/genie.js +1 -2
- package/dist/plugins/genie/genie.js.map +1 -1
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/lakebase/lakebase.d.ts +1 -2
- package/dist/plugins/lakebase/lakebase.d.ts.map +1 -1
- package/dist/plugins/lakebase/lakebase.js +1 -2
- package/dist/plugins/lakebase/lakebase.js.map +1 -1
- package/dist/plugins/server/index.d.ts +2 -2
- package/dist/plugins/server/index.d.ts.map +1 -1
- package/dist/plugins/server/index.js +9 -4
- package/dist/plugins/server/index.js.map +1 -1
- package/dist/registry/manifest-loader.js +1 -1
- package/dist/registry/manifest-loader.js.map +1 -1
- package/dist/registry/types.d.ts +3 -3
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js.map +1 -1
- package/dist/shared/src/genie.d.ts +16 -2
- package/dist/shared/src/genie.d.ts.map +1 -1
- package/dist/shared/src/index.d.ts +1 -1
- package/dist/shared/src/plugin.d.ts +12 -4
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/docs/api/appkit/Class.Plugin.md +60 -12
- package/docs/api/appkit/Class.ResourceRegistry.md +3 -3
- package/docs/api/appkit/Function.createApp.md +3 -3
- package/docs/api/appkit/Interface.PluginManifest.md +9 -3
- package/docs/api/appkit/TypeAlias.PluginData.md +45 -0
- package/docs/api/appkit/TypeAlias.ToPlugin.md +1 -1
- package/docs/api/appkit-ui/files/DirectoryList.md +36 -0
- package/docs/api/appkit-ui/files/FileBreadcrumb.md +27 -0
- package/docs/api/appkit-ui/files/FileEntry.md +27 -0
- package/docs/api/appkit-ui/files/FilePreviewPanel.md +32 -0
- package/docs/api/appkit-ui/files/NewFolderInput.md +30 -0
- package/docs/api/appkit-ui/genie/GenieQueryVisualization.md +29 -0
- package/docs/api/appkit.md +1 -0
- package/docs/configuration.md +15 -0
- package/docs/plugins/custom-plugins.md +4 -13
- package/docs/plugins/files.md +350 -0
- package/docs/plugins.md +2 -1
- package/llms.txt +9 -1
- package/package.json +1 -1
- package/dist/plugins/server/remote-tunnel/denied.html/denied.html +0 -68
- package/dist/plugins/server/remote-tunnel/index.html/index.html +0 -165
- package/dist/plugins/server/remote-tunnel/wait.html/wait.html +0 -158
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/registry/types.ts"],"mappings":";;;;;;;;UA0DiB,kBAAA;EA+BD;EA7Bd,GAAA;EAWM;EATN,WAAA;AAAA;;;;;UAOe,mBAAA;EAoBQ;EAlBvB,IAAA,EAAM,YAAA;EAqBE;EAlBR,KAAA;EAyBe;EAtBf,WAAA;;EAGA,WAAA;EAkCmC;EA/BnC,UAAA,EAAY,kBAAA;EAgByB;;;;EAVrC,MAAA,EAAQ,MAAA,SAAe,kBAAA;EAevB;EAZA,QAAA;AAAA;;;;;UAOe,aAAA,SAAsB,mBAAA;EAqBtB;EAnBf,MAAA;;EAGA,QAAA;EAkBA;EAfA,MAAA,GAAS,MAAA;EAkBA;;;;;EAXT,iBAAA,GAAoB,MAAA,SAAe,kBAAA;AAAA;;;;UAMpB,gBAAA;EAyBc;EAvB7B,KAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/registry/types.ts"],"mappings":";;;;;;;;UA0DiB,kBAAA;EA+BD;EA7Bd,GAAA;EAWM;EATN,WAAA;AAAA;;;;;UAOe,mBAAA;EAoBQ;EAlBvB,IAAA,EAAM,YAAA;EAqBE;EAlBR,KAAA;EAyBe;EAtBf,WAAA;;EAGA,WAAA;EAkCmC;EA/BnC,UAAA,EAAY,kBAAA;EAgByB;;;;EAVrC,MAAA,EAAQ,MAAA,SAAe,kBAAA;EAevB;EAZA,QAAA;AAAA;;;;;UAOe,aAAA,SAAsB,mBAAA;EAqBtB;EAnBf,MAAA;;EAGA,QAAA;EAkBA;EAfA,MAAA,GAAS,MAAA;EAkBA;;;;;EAXT,iBAAA,GAAoB,MAAA,SAAe,kBAAA;AAAA;;;;UAMpB,gBAAA;EAyBc;EAvB7B,KAAA;EAyBM;EAtBN,OAAA,EAAS,aAAA;EAmCG;EAhCZ,GAAA,EAAK,aAAA;AAAA;;;;;;;KAWK,YAAA,GAAe,WAAA;;;;;UAMV,cAAA;EAkBH;EAhBZ,IAAA,EAAM,KAAA;EAuBN;EApBA,WAAA;EAqBU;EAlBV,WAAA;EA6BA;;;EAxBA,SAAA;IA4BA,kEA1BE,QAAA,EAAU,IAAA,CAAK,mBAAA,iBA0BV;IAvBL,QAAA,EAAU,IAAA,CAAK,mBAAA;EAAA;;;;;EAOjB,MAAA;IACE,MAAA,EAAQ,YAAA;EAAA;;;;EAMV,MAAA;;;;EAKA,MAAA;EACA,OAAA;EACA,UAAA;EACA,QAAA;EACA,OAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/registry/types.ts"],"sourcesContent":["/**\n * Resource Registry Type System\n *\n * This module defines the type system for the AppKit Resource Registry,\n * which enables plugins to declare their Databricks resource requirements\n * in a machine-readable format.\n *\n * Resource types and permissions are generated from plugin-manifest.schema.json\n * (see types.generated.ts). Hand-written interfaces below define the registry API.\n */\n\n// Re-export generated registry types (enum + const must be value exports for runtime)\nimport {\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n type ResourcePermission,\n ResourceType,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n} from \"./types.generated\";\n\nexport {\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n ResourceType,\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n type ResourcePermission,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n};\n\n// ============================================================================\n// Hand-written interfaces (not in JSON schema)\n// ============================================================================\n\n/**\n * Defines a single field for a resource. Each field has its own environment variable and optional description.\n * Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance_name, database_name or scope, key).\n */\nexport interface ResourceFieldEntry {\n /** Environment variable name for this field */\n env: string;\n /** Human-readable description for this field */\n description?: string;\n}\n\n/**\n * Declares a resource requirement for a plugin.\n * Can be defined statically in a manifest or dynamically via getResourceRequirements().\n */\nexport interface ResourceRequirement {\n /** Type of Databricks resource required */\n type: ResourceType;\n\n /** Unique alias for this resource within the plugin (e.g., 'warehouse', 'secrets'). Used for UI/display. */\n alias: string;\n\n /** Stable key for machine use (env naming, composite keys, app.yaml). Required. */\n resourceKey: string;\n\n /** Human-readable description of why this resource is needed */\n description: string;\n\n /** Required permission level for the resource */\n permission: ResourcePermission;\n\n /**\n * Map of field name to env and optional description.\n * Single-value types use one key (e.g. id); multi-value (database, secret) use multiple keys.\n */\n fields: Record<string, ResourceFieldEntry>;\n\n /** Whether this resource is required (true) or optional (false) */\n required: boolean;\n}\n\n/**\n * Internal representation of a resource in the registry.\n * Extends ResourceRequirement with resolution state and plugin ownership.\n */\nexport interface ResourceEntry extends ResourceRequirement {\n /** Plugin(s) that require this resource (comma-separated if multiple) */\n plugin: string;\n\n /** Whether the resource has been resolved (all field env vars set) */\n resolved: boolean;\n\n /** Resolved value per field name. Populated by validate() when all field env vars are set. */\n values?: Record<string, string>;\n\n /**\n * Per-plugin permission tracking.\n * Maps plugin name to the permission it originally requested.\n * Populated when multiple plugins share the same resource.\n */\n permissionSources?: Record<string, ResourcePermission>;\n}\n\n/**\n * Result of validating all registered resources against the environment.\n */\nexport interface ValidationResult {\n /** Whether all required resources are available */\n valid: boolean;\n\n /** List of missing required resources */\n missing: ResourceEntry[];\n\n /** Complete list of all registered resources (required and optional) */\n all: ResourceEntry[];\n}\n\nimport type { JSONSchema7 } from \"json-schema\";\n\n/**\n * Configuration schema definition for plugin config.\n * Re-exported from the standard JSON Schema Draft 7 types.\n *\n * @see {@link https://json-schema.org/draft-07/json-schema-release-notes | JSON Schema Draft 7}\n */\nexport type ConfigSchema = JSONSchema7;\n\n/**\n * Plugin manifest that declares metadata and resource requirements.\n * Attached to plugin classes as a static property.\n */\nexport interface PluginManifest {\n /** Plugin identifier
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/registry/types.ts"],"sourcesContent":["/**\n * Resource Registry Type System\n *\n * This module defines the type system for the AppKit Resource Registry,\n * which enables plugins to declare their Databricks resource requirements\n * in a machine-readable format.\n *\n * Resource types and permissions are generated from plugin-manifest.schema.json\n * (see types.generated.ts). Hand-written interfaces below define the registry API.\n */\n\n// Re-export generated registry types (enum + const must be value exports for runtime)\nimport {\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n type ResourcePermission,\n ResourceType,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n} from \"./types.generated\";\n\nexport {\n PERMISSION_HIERARCHY_BY_TYPE,\n PERMISSIONS_BY_TYPE,\n ResourceType,\n type AppPermission,\n type DatabasePermission,\n type ExperimentPermission,\n type GenieSpacePermission,\n type JobPermission,\n type ResourcePermission,\n type SecretPermission,\n type ServingEndpointPermission,\n type SqlWarehousePermission,\n type UcConnectionPermission,\n type UcFunctionPermission,\n type VectorSearchIndexPermission,\n type VolumePermission,\n};\n\n// ============================================================================\n// Hand-written interfaces (not in JSON schema)\n// ============================================================================\n\n/**\n * Defines a single field for a resource. Each field has its own environment variable and optional description.\n * Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance_name, database_name or scope, key).\n */\nexport interface ResourceFieldEntry {\n /** Environment variable name for this field */\n env: string;\n /** Human-readable description for this field */\n description?: string;\n}\n\n/**\n * Declares a resource requirement for a plugin.\n * Can be defined statically in a manifest or dynamically via getResourceRequirements().\n */\nexport interface ResourceRequirement {\n /** Type of Databricks resource required */\n type: ResourceType;\n\n /** Unique alias for this resource within the plugin (e.g., 'warehouse', 'secrets'). Used for UI/display. */\n alias: string;\n\n /** Stable key for machine use (env naming, composite keys, app.yaml). Required. */\n resourceKey: string;\n\n /** Human-readable description of why this resource is needed */\n description: string;\n\n /** Required permission level for the resource */\n permission: ResourcePermission;\n\n /**\n * Map of field name to env and optional description.\n * Single-value types use one key (e.g. id); multi-value (database, secret) use multiple keys.\n */\n fields: Record<string, ResourceFieldEntry>;\n\n /** Whether this resource is required (true) or optional (false) */\n required: boolean;\n}\n\n/**\n * Internal representation of a resource in the registry.\n * Extends ResourceRequirement with resolution state and plugin ownership.\n */\nexport interface ResourceEntry extends ResourceRequirement {\n /** Plugin(s) that require this resource (comma-separated if multiple) */\n plugin: string;\n\n /** Whether the resource has been resolved (all field env vars set) */\n resolved: boolean;\n\n /** Resolved value per field name. Populated by validate() when all field env vars are set. */\n values?: Record<string, string>;\n\n /**\n * Per-plugin permission tracking.\n * Maps plugin name to the permission it originally requested.\n * Populated when multiple plugins share the same resource.\n */\n permissionSources?: Record<string, ResourcePermission>;\n}\n\n/**\n * Result of validating all registered resources against the environment.\n */\nexport interface ValidationResult {\n /** Whether all required resources are available */\n valid: boolean;\n\n /** List of missing required resources */\n missing: ResourceEntry[];\n\n /** Complete list of all registered resources (required and optional) */\n all: ResourceEntry[];\n}\n\nimport type { JSONSchema7 } from \"json-schema\";\n\n/**\n * Configuration schema definition for plugin config.\n * Re-exported from the standard JSON Schema Draft 7 types.\n *\n * @see {@link https://json-schema.org/draft-07/json-schema-release-notes | JSON Schema Draft 7}\n */\nexport type ConfigSchema = JSONSchema7;\n\n/**\n * Plugin manifest that declares metadata and resource requirements.\n * Attached to plugin classes as a static property.\n */\nexport interface PluginManifest<TName extends string = string> {\n /** Plugin identifier — the single source of truth for the plugin's name */\n name: TName;\n\n /** Human-readable display name for UI/CLI */\n displayName: string;\n\n /** Brief description of what the plugin does */\n description: string;\n\n /**\n * Resource requirements declaration\n */\n resources: {\n /** Resources that must be available for the plugin to function */\n required: Omit<ResourceRequirement, \"required\">[];\n\n /** Resources that enhance functionality but are not mandatory */\n optional: Omit<ResourceRequirement, \"required\">[];\n };\n\n /**\n * Configuration schema for the plugin.\n * Defines the shape and validation rules for plugin config.\n */\n config?: {\n schema: ConfigSchema;\n };\n\n /**\n * When true, excluded from the template plugins manifest during sync.\n */\n hidden?: boolean;\n\n /**\n * Optional metadata for community plugins\n */\n author?: string;\n version?: string;\n repository?: string;\n keywords?: string[];\n license?: string;\n}\n"],"mappings":""}
|
|
@@ -15,7 +15,7 @@ type GenieStreamEvent = {
|
|
|
15
15
|
type: "query_result";
|
|
16
16
|
attachmentId: string;
|
|
17
17
|
statementId: string;
|
|
18
|
-
data:
|
|
18
|
+
data: GenieStatementResponse;
|
|
19
19
|
} | {
|
|
20
20
|
type: "error";
|
|
21
21
|
error: string;
|
|
@@ -26,6 +26,20 @@ type GenieStreamEvent = {
|
|
|
26
26
|
nextPageToken: string | null; /** Total messages returned in this initial load */
|
|
27
27
|
loadedCount: number;
|
|
28
28
|
};
|
|
29
|
+
/** Shape of the Databricks SQL statement_response returned by Genie queries */
|
|
30
|
+
interface GenieStatementResponse {
|
|
31
|
+
manifest: {
|
|
32
|
+
schema: {
|
|
33
|
+
columns: Array<{
|
|
34
|
+
name: string;
|
|
35
|
+
type_name: string;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
result: {
|
|
40
|
+
data_array: (string | null)[][];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
29
43
|
/** Cleaned response — subset of SDK GenieMessage */
|
|
30
44
|
interface GenieMessageResponse {
|
|
31
45
|
messageId: string;
|
|
@@ -50,5 +64,5 @@ interface GenieAttachmentResponse {
|
|
|
50
64
|
suggestedQuestions?: string[];
|
|
51
65
|
}
|
|
52
66
|
//#endregion
|
|
53
|
-
export { GenieAttachmentResponse, GenieMessageResponse, GenieStreamEvent };
|
|
67
|
+
export { GenieAttachmentResponse, GenieMessageResponse, GenieStatementResponse, GenieStreamEvent };
|
|
54
68
|
//# sourceMappingURL=genie.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genie.d.ts","names":[],"sources":["../../../../shared/src/genie.ts"],"mappings":";;KACY,gBAAA;EAEN,IAAA;EACA,cAAA;EACA,SAAA;EACA,OAAA;AAAA;EAEA,IAAA;EAAgB,MAAA;AAAA;EAChB,IAAA;EAAwB,OAAA,EAAS,oBAAA;AAAA;EAEjC,IAAA;EACA,YAAA;EACA,WAAA;EACA,IAAA;AAAA;
|
|
1
|
+
{"version":3,"file":"genie.d.ts","names":[],"sources":["../../../../shared/src/genie.ts"],"mappings":";;KACY,gBAAA;EAEN,IAAA;EACA,cAAA;EACA,SAAA;EACA,OAAA;AAAA;EAEA,IAAA;EAAgB,MAAA;AAAA;EAChB,IAAA;EAAwB,OAAA,EAAS,oBAAA;AAAA;EAEjC,IAAA;EACA,YAAA;EACA,WAAA;EACA,IAAA,EAAM,sBAAA;AAAA;EAEN,IAAA;EAAe,KAAA;AAAA;EAEf,IAAA;EACA,cAAA;EACA,OAAA,UAEA;EAAA,aAAA,iBAEW;EAAX,WAAA;AAAA;;UAIW,sBAAA;EACf,QAAA;IACE,MAAA;MACE,OAAA,EAAS,KAAA;QAAQ,IAAA;QAAc,SAAA;MAAA;IAAA;EAAA;EAGnC,MAAA;IACE,UAAA;EAAA;AAAA;;UAKa,oBAAA;EACf,SAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA,GAAc,uBAAA;EACd,KAAA;AAAA;AAAA,UAGe,uBAAA;EACf,YAAA;EACA,KAAA;IACE,KAAA;IACA,WAAA;IACA,KAAA;IACA,WAAA;EAAA;EAEF,IAAA;IAAS,OAAA;EAAA;EACT,kBAAA;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BasePlugin, BasePluginConfig, HttpMethod, IAppRequest, IAppResponse, IAppRouter, PluginConstructor, PluginData, PluginEndpointMap, PluginExports, PluginManifest, PluginMap, PluginPhase, ResourceFieldEntry, ResourceRequirement, RouteConfig, TelemetryOptions, ToPlugin, WithAsUser } from "./plugin.js";
|
|
2
2
|
import { CacheConfig, CacheEntry, CacheStorage } from "./cache.js";
|
|
3
3
|
import { PluginExecuteConfig, PluginExecutionSettings, RetryConfig, StreamConfig, StreamExecuteHandler, StreamExecutionSettings, TelemetryConfig } from "./execute.js";
|
|
4
|
-
import { GenieAttachmentResponse, GenieMessageResponse, GenieStreamEvent } from "./genie.js";
|
|
4
|
+
import { GenieAttachmentResponse, GenieMessageResponse, GenieStatementResponse, GenieStreamEvent } from "./genie.js";
|
|
5
5
|
import { SQLBinaryMarker, SQLBooleanMarker, SQLDateMarker, SQLNumberMarker, SQLStringMarker, SQLTimestampMarker, SQLTypeMarker } from "./sql/types.js";
|
|
6
6
|
import { isSQLTypeMarker, sql } from "./sql/helpers.js";
|
|
7
7
|
import { PendingFetch, PendingFileRead, TunnelConnection } from "./tunnel.js";
|
|
@@ -9,6 +9,7 @@ interface BasePlugin {
|
|
|
9
9
|
setup(): Promise<void>;
|
|
10
10
|
injectRoutes(router: express.Router): void;
|
|
11
11
|
getEndpoints(): PluginEndpointMap;
|
|
12
|
+
getSkipBodyParsingPaths?(): ReadonlySet<string>;
|
|
12
13
|
exports?(): unknown;
|
|
13
14
|
}
|
|
14
15
|
/** Base configuration interface for AppKit plugins */
|
|
@@ -46,8 +47,8 @@ type PluginConstructor<C = BasePluginConfig, I extends BasePlugin = BasePlugin>
|
|
|
46
47
|
* Manifest declaration for plugins (imported from registry types).
|
|
47
48
|
* Re-exported here to avoid circular dependencies.
|
|
48
49
|
*/
|
|
49
|
-
interface PluginManifest {
|
|
50
|
-
name:
|
|
50
|
+
interface PluginManifest<TName extends string = string> {
|
|
51
|
+
name: TName;
|
|
51
52
|
displayName: string;
|
|
52
53
|
description: string;
|
|
53
54
|
resources: {
|
|
@@ -104,8 +105,11 @@ type PluginExports<T extends BasePlugin> = T["exports"] extends (() => infer R)
|
|
|
104
105
|
/**
|
|
105
106
|
* Wraps an SDK with the `asUser` method that AppKit automatically adds.
|
|
106
107
|
* When `asUser(req)` is called, it returns the same SDK but scoped to the user's credentials.
|
|
108
|
+
*
|
|
109
|
+
* When the SDK is a function (callable export), it is returned as-is since
|
|
110
|
+
* the plugin manages its own `asUser` pattern per-call.
|
|
107
111
|
*/
|
|
108
|
-
type WithAsUser<SDK> = SDK & {
|
|
112
|
+
type WithAsUser<SDK> = SDK extends ((...args: any[]) => any) ? SDK : SDK & {
|
|
109
113
|
/**
|
|
110
114
|
* Execute operations using the user's identity from the request.
|
|
111
115
|
* Returns a user-scoped SDK where all methods execute with the
|
|
@@ -117,6 +121,9 @@ type WithAsUser<SDK> = SDK & {
|
|
|
117
121
|
* Maps plugin names to their exported types (with asUser automatically added).
|
|
118
122
|
* Each plugin exposes its public API via the exports() method,
|
|
119
123
|
* and AppKit wraps it with asUser() for user-scoped execution.
|
|
124
|
+
*
|
|
125
|
+
* Callable exports (functions) are passed through without wrapping,
|
|
126
|
+
* as they manage their own `asUser` pattern (e.g. files plugin).
|
|
120
127
|
*/
|
|
121
128
|
type PluginMap<U extends readonly PluginData<PluginConstructor, unknown, string>[]> = { [P in U[number] as P["name"]]: WithAsUser<PluginExports<InstanceType<P["plugin"]>>> };
|
|
122
129
|
type PluginData<T, U, N> = {
|
|
@@ -134,7 +141,8 @@ type RouteConfig = {
|
|
|
134
141
|
/** Unique name for this endpoint (used for frontend access) */name: string;
|
|
135
142
|
method: HttpMethod;
|
|
136
143
|
path: string;
|
|
137
|
-
handler: (req: IAppRequest, res: IAppResponse) => Promise<void>;
|
|
144
|
+
handler: (req: IAppRequest, res: IAppResponse) => Promise<void>; /** When true, the server will skip JSON body parsing for this route (e.g. file uploads). */
|
|
145
|
+
skipBodyParsing?: boolean;
|
|
138
146
|
};
|
|
139
147
|
/** Map of endpoint names to their full paths for a plugin */
|
|
140
148
|
type PluginEndpointMap = Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","names":[],"sources":["../../../../shared/src/plugin.ts"],"mappings":";;;;;UAIiB,UAAA;EACf,IAAA;EAEA,qBAAA;EAEA,KAAA,IAAS,OAAA;EAET,YAAA,CAAa,MAAA,EAAQ,OAAA,CAAQ,MAAA;EAE7B,YAAA,IAAgB,iBAAA;EAEhB,OAAA;AAAA;;UAIe,gBAAA;EACf,IAAA;EACA,IAAA;EAAA,CAEC,GAAA;EAMD,SAAA,GAAY,gBAAA;AAAA;AAAA,KAGF,gBAAA;EAGN,MAAA;EACA,OAAA;EACA,IAAA;AAAA;AAAA,KAQM,WAAA;;;;;KAMA,iBAAA,KACN,gBAAA,YACM,UAAA,GAAa,UAAA,UAEvB,MAAA,EAAQ,CAAA,KACL,CAAA;EACH,cAAA,GAAiB,MAAA;EACjB,KAAA,GAAQ,WAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","names":[],"sources":["../../../../shared/src/plugin.ts"],"mappings":";;;;;UAIiB,UAAA;EACf,IAAA;EAEA,qBAAA;EAEA,KAAA,IAAS,OAAA;EAET,YAAA,CAAa,MAAA,EAAQ,OAAA,CAAQ,MAAA;EAE7B,YAAA,IAAgB,iBAAA;EAEhB,uBAAA,KAA4B,WAAA;EAE5B,OAAA;AAAA;;UAIe,gBAAA;EACf,IAAA;EACA,IAAA;EAAA,CAEC,GAAA;EAMD,SAAA,GAAY,gBAAA;AAAA;AAAA,KAGF,gBAAA;EAGN,MAAA;EACA,OAAA;EACA,IAAA;AAAA;AAAA,KAQM,WAAA;;;;;KAMA,iBAAA,KACN,gBAAA,YACM,UAAA,GAAa,UAAA,UAEvB,MAAA,EAAQ,CAAA,KACL,CAAA;EACH,cAAA,GAAiB,MAAA;EACjB,KAAA,GAAQ,WAAA;EA7BI;;;AAGd;EA+BE,QAAA,EAAU,cAAA;;;;;EAKV,uBAAA,EAAyB,MAAA,EAAQ,CAAA,GAAI,mBAAA;AAAA;;AAvBvC;;;UA8BiB,cAAA;EACf,IAAA,EAAM,KAAA;EACN,WAAA;EACA,WAAA;EACA,SAAA;IACE,QAAA,EAAU,IAAA,CAAK,mBAAA;IACf,QAAA,EAAU,IAAA,CAAK,mBAAA;EAAA;EAEjB,MAAA;IACE,MAAA,EAAQ,WAAA;EAAA;EAEV,cAAA;EACA,MAAA;EACA,MAAA;EACA,OAAA;EACA,UAAA;EACA,QAAA;EACA,OAAA;AAAA;;;;;;;UASe,kBAAA;EA5CE;EA8CjB,GAAA;EA7CQ;EA+CR,WAAA;AAAA;;;;;UAOe,mBAAA;EACf,IAAA;EACA,KAAA;EAvC6B;EAyC7B,WAAA;EACA,WAAA;EACA,UAAA;EAtCY;;;;EA2CZ,MAAA,EAAQ,MAAA,SAAe,kBAAA;EACvB,QAAA;AAAA;;;;;;KAoCU,aAAA,WAAwB,UAAA,IAClC,CAAA,sCAAqC,CAAA,GAAI,MAAA;AA5D3C;;;;;AAWA;;AAXA,KAqEY,UAAA,QAAkB,GAAA,cAAgB,IAAA,mBAC1C,GAAA,GACA,GAAA;EAjDY;;;;;EAuDV,MAAA,GAAS,GAAA,EAAK,WAAA,KAAgB,GAAA;AAAA;;;;;;AAlBpC;;;KA6BY,SAAA,oBACS,UAAA,CAAW,iBAAA,gCAExB,CAAA,YAAa,CAAA,WAAY,UAAA,CAC7B,aAAA,CAAc,YAAA,CAAa,CAAA;AAAA,KAInB,UAAA;EAAwB,MAAA,EAAQ,CAAA;EAAG,MAAA,EAAQ,CAAA;EAAG,IAAA,EAAM,CAAA;AAAA;AAAA,KACpD,QAAA,4BACV,MAAA,GAAS,CAAA,KACN,UAAA,CAAW,CAAA,EAAG,CAAA,EAAG,CAAA;;KAGV,UAAA,GAAa,OAAA,CAAQ,MAAA;AAAA,KACrB,YAAA,GAAe,OAAA,CAAQ,QAAA;AAAA,KACvB,WAAA,GAAc,OAAA,CAAQ,OAAA;AAAA,KAEtB,UAAA;AAAA,KAEA,WAAA;EAvCU,+DAyCpB,IAAA;EACA,MAAA,EAAQ,UAAA;EACR,IAAA;EACA,OAAA,GAAU,GAAA,EAAK,WAAA,EAAa,GAAA,EAAK,YAAA,KAAiB,OAAA,QApChB;EAsClC,eAAA;AAAA;;KAIU,iBAAA,GAAoB,MAAA"}
|
|
@@ -32,7 +32,6 @@ const myManifest: PluginManifest = {
|
|
|
32
32
|
|
|
33
33
|
class MyPlugin extends Plugin<MyConfig> {
|
|
34
34
|
static manifest = myManifest;
|
|
35
|
-
name = 'myPlugin';
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
```
|
|
@@ -56,8 +55,7 @@ const myManifest: PluginManifest = {
|
|
|
56
55
|
};
|
|
57
56
|
|
|
58
57
|
class MyPlugin extends Plugin<MyConfig> {
|
|
59
|
-
static manifest = myManifest
|
|
60
|
-
name = 'myPlugin';
|
|
58
|
+
static manifest = myManifest<"myPlugin">;
|
|
61
59
|
|
|
62
60
|
// Runtime method: converts optional resources to required based on config
|
|
63
61
|
static getResourceRequirements(config: MyConfig) {
|
|
@@ -253,7 +251,7 @@ A proxied plugin instance that executes as the user
|
|
|
253
251
|
|
|
254
252
|
#### Throws[](#throws "Direct link to Throws")
|
|
255
253
|
|
|
256
|
-
|
|
254
|
+
AuthenticationError if user token is not available in request headers (production only). In development mode (`NODE_ENV=development`), falls back to the service principal instead of throwing.
|
|
257
255
|
|
|
258
256
|
***
|
|
259
257
|
|
|
@@ -267,6 +265,10 @@ userKey?: string): Promise<T | undefined>;
|
|
|
267
265
|
|
|
268
266
|
```
|
|
269
267
|
|
|
268
|
+
Execute a function with the plugin's interceptor chain.
|
|
269
|
+
|
|
270
|
+
All errors are caught and `undefined` is returned (production-safe). Route handlers should check for `undefined` and respond with an appropriate error status.
|
|
271
|
+
|
|
270
272
|
#### Type Parameters[](#type-parameters-1 "Direct link to Type Parameters")
|
|
271
273
|
|
|
272
274
|
| Type Parameter |
|
|
@@ -338,7 +340,6 @@ The returned object becomes the plugin's public API on the AppKit instance (e.g.
|
|
|
338
340
|
|
|
339
341
|
```ts
|
|
340
342
|
class MyPlugin extends Plugin {
|
|
341
|
-
name = "myPlugin";
|
|
342
343
|
private getData() { return []; }
|
|
343
344
|
|
|
344
345
|
exports() {
|
|
@@ -381,6 +382,26 @@ BasePlugin.getEndpoints
|
|
|
381
382
|
|
|
382
383
|
***
|
|
383
384
|
|
|
385
|
+
### getSkipBodyParsingPaths()[](#getskipbodyparsingpaths "Direct link to getSkipBodyParsingPaths()")
|
|
386
|
+
|
|
387
|
+
```ts
|
|
388
|
+
getSkipBodyParsingPaths(): ReadonlySet<string>;
|
|
389
|
+
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
#### Returns[](#returns-7 "Direct link to Returns")
|
|
393
|
+
|
|
394
|
+
`ReadonlySet`<`string`>
|
|
395
|
+
|
|
396
|
+
#### Implementation of[](#implementation-of-4 "Direct link to Implementation of")
|
|
397
|
+
|
|
398
|
+
```ts
|
|
399
|
+
BasePlugin.getSkipBodyParsingPaths
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
***
|
|
404
|
+
|
|
384
405
|
### injectRoutes()[](#injectroutes "Direct link to injectRoutes()")
|
|
385
406
|
|
|
386
407
|
```ts
|
|
@@ -394,11 +415,11 @@ injectRoutes(_: Router): void;
|
|
|
394
415
|
| --------- | -------- |
|
|
395
416
|
| `_` | `Router` |
|
|
396
417
|
|
|
397
|
-
#### Returns[](#returns-
|
|
418
|
+
#### Returns[](#returns-8 "Direct link to Returns")
|
|
398
419
|
|
|
399
420
|
`void`
|
|
400
421
|
|
|
401
|
-
#### Implementation of[](#implementation-of-
|
|
422
|
+
#### Implementation of[](#implementation-of-5 "Direct link to Implementation of")
|
|
402
423
|
|
|
403
424
|
```ts
|
|
404
425
|
BasePlugin.injectRoutes
|
|
@@ -421,12 +442,39 @@ protected registerEndpoint(name: string, path: string): void;
|
|
|
421
442
|
| `name` | `string` |
|
|
422
443
|
| `path` | `string` |
|
|
423
444
|
|
|
424
|
-
#### Returns[](#returns-
|
|
445
|
+
#### Returns[](#returns-9 "Direct link to Returns")
|
|
425
446
|
|
|
426
447
|
`void`
|
|
427
448
|
|
|
428
449
|
***
|
|
429
450
|
|
|
451
|
+
### resolveUserId()[](#resolveuserid "Direct link to resolveUserId()")
|
|
452
|
+
|
|
453
|
+
```ts
|
|
454
|
+
protected resolveUserId(req: Request): string;
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Resolve the effective user ID from a request.
|
|
459
|
+
|
|
460
|
+
Returns the `x-forwarded-user` header when present. In development mode (`NODE_ENV=development`) falls back to the current context user ID so that callers outside an active `runInUserContext` scope still get a consistent value.
|
|
461
|
+
|
|
462
|
+
#### Parameters[](#parameters-6 "Direct link to Parameters")
|
|
463
|
+
|
|
464
|
+
| Parameter | Type |
|
|
465
|
+
| --------- | --------- |
|
|
466
|
+
| `req` | `Request` |
|
|
467
|
+
|
|
468
|
+
#### Returns[](#returns-10 "Direct link to Returns")
|
|
469
|
+
|
|
470
|
+
`string`
|
|
471
|
+
|
|
472
|
+
#### Throws[](#throws-1 "Direct link to Throws")
|
|
473
|
+
|
|
474
|
+
AuthenticationError in production when no user header is present.
|
|
475
|
+
|
|
476
|
+
***
|
|
477
|
+
|
|
430
478
|
### route()[](#route "Direct link to route()")
|
|
431
479
|
|
|
432
480
|
```ts
|
|
@@ -440,14 +488,14 @@ protected route<_TResponse>(router: Router, config: RouteConfig): void;
|
|
|
440
488
|
| -------------- |
|
|
441
489
|
| `_TResponse` |
|
|
442
490
|
|
|
443
|
-
#### Parameters[](#parameters-
|
|
491
|
+
#### Parameters[](#parameters-7 "Direct link to Parameters")
|
|
444
492
|
|
|
445
493
|
| Parameter | Type |
|
|
446
494
|
| --------- | ------------- |
|
|
447
495
|
| `router` | `Router` |
|
|
448
496
|
| `config` | `RouteConfig` |
|
|
449
497
|
|
|
450
|
-
#### Returns[](#returns-
|
|
498
|
+
#### Returns[](#returns-11 "Direct link to Returns")
|
|
451
499
|
|
|
452
500
|
`void`
|
|
453
501
|
|
|
@@ -460,11 +508,11 @@ setup(): Promise<void>;
|
|
|
460
508
|
|
|
461
509
|
```
|
|
462
510
|
|
|
463
|
-
#### Returns[](#returns-
|
|
511
|
+
#### Returns[](#returns-12 "Direct link to Returns")
|
|
464
512
|
|
|
465
513
|
`Promise`<`void`>
|
|
466
514
|
|
|
467
|
-
#### Implementation of[](#implementation-of-
|
|
515
|
+
#### Implementation of[](#implementation-of-6 "Direct link to Implementation of")
|
|
468
516
|
|
|
469
517
|
```ts
|
|
470
518
|
BasePlugin.setup
|
|
@@ -43,9 +43,9 @@ Collects and registers resource requirements from an array of plugins. For each
|
|
|
43
43
|
|
|
44
44
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
45
45
|
|
|
46
|
-
| Parameter | Type
|
|
47
|
-
| ------------ |
|
|
48
|
-
| `rawPlugins` | `PluginData
|
|
46
|
+
| Parameter | Type | Description |
|
|
47
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
|
|
48
|
+
| `rawPlugins` | [`PluginData`](./docs/api/appkit/TypeAlias.PluginData.md)<`PluginConstructor`, `unknown`, `string`>\[] | Array of plugin data entries from createApp configuration |
|
|
49
49
|
|
|
50
50
|
#### Returns[](#returns-2 "Direct link to Returns")
|
|
51
51
|
|
|
@@ -16,9 +16,9 @@ Initializes telemetry, cache, and service context, then registers plugins in pha
|
|
|
16
16
|
|
|
17
17
|
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
18
18
|
|
|
19
|
-
| Type Parameter
|
|
20
|
-
|
|
|
21
|
-
| `T` *extends* `PluginData
|
|
19
|
+
| Type Parameter |
|
|
20
|
+
| -------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `T` *extends* [`PluginData`](./docs/api/appkit/TypeAlias.PluginData.md)<`PluginConstructor`, `unknown`, `string`>\[] |
|
|
22
22
|
|
|
23
23
|
## Parameters[](#parameters "Direct link to Parameters")
|
|
24
24
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
# Interface: PluginManifest
|
|
1
|
+
# Interface: PluginManifest\<TName>
|
|
2
2
|
|
|
3
3
|
Plugin manifest that declares metadata and resource requirements. Attached to plugin classes as a static property.
|
|
4
4
|
|
|
5
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
6
|
+
|
|
7
|
+
| Type Parameter | Default type |
|
|
8
|
+
| -------------------------- | ------------ |
|
|
9
|
+
| `TName` *extends* `string` | `string` |
|
|
10
|
+
|
|
5
11
|
## Properties[](#properties "Direct link to Properties")
|
|
6
12
|
|
|
7
13
|
### author?[](#author "Direct link to author?")
|
|
@@ -89,11 +95,11 @@ optional license: string;
|
|
|
89
95
|
### name[](#name "Direct link to name")
|
|
90
96
|
|
|
91
97
|
```ts
|
|
92
|
-
name:
|
|
98
|
+
name: TName;
|
|
93
99
|
|
|
94
100
|
```
|
|
95
101
|
|
|
96
|
-
Plugin identifier
|
|
102
|
+
Plugin identifier — the single source of truth for the plugin's name
|
|
97
103
|
|
|
98
104
|
***
|
|
99
105
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Type Alias: PluginData\<T, U, N>
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
type PluginData<T, U, N> = {
|
|
5
|
+
config: U;
|
|
6
|
+
name: N;
|
|
7
|
+
plugin: T;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
13
|
+
|
|
14
|
+
| Type Parameter |
|
|
15
|
+
| -------------- |
|
|
16
|
+
| `T` |
|
|
17
|
+
| `U` |
|
|
18
|
+
| `N` |
|
|
19
|
+
|
|
20
|
+
## Properties[](#properties "Direct link to Properties")
|
|
21
|
+
|
|
22
|
+
### config[](#config "Direct link to config")
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
config: U;
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### name[](#name "Direct link to name")
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
name: N;
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
***
|
|
39
|
+
|
|
40
|
+
### plugin[](#plugin "Direct link to plugin")
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
plugin: T;
|
|
44
|
+
|
|
45
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# DirectoryList
|
|
2
|
+
|
|
3
|
+
Card-wrapped directory listing with loading, error, and empty states
|
|
4
|
+
|
|
5
|
+
## DirectoryList[](#directorylist-1 "Direct link to DirectoryList")
|
|
6
|
+
|
|
7
|
+
Card-wrapped directory listing with loading, error, and empty states
|
|
8
|
+
|
|
9
|
+
**Source:** [`packages/appkit-ui/src/react/file-browser/directory-list.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/file-browser/directory-list.tsx)
|
|
10
|
+
|
|
11
|
+
### Props[](#props "Direct link to Props")
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| -------------------- | ------------------------------------------------------------------------------------------------ | -------- | ------- | ---------------------------------------------------------------------------------- |
|
|
15
|
+
| `entries` | `DirectoryEntry[]` | ✓ | - | Directory entries to display |
|
|
16
|
+
| `loading` | `boolean` | | - | Whether the directory is currently loading |
|
|
17
|
+
| `error` | `string \| null` | | - | Error message to display |
|
|
18
|
+
| `onEntryClick` | `(entry: DirectoryEntry) => void` | ✓ | - | Called when an entry is clicked |
|
|
19
|
+
| `onNavigateToParent` | `(() => void)` | | - | Called when the back/parent button is clicked |
|
|
20
|
+
| `onRetry` | `(() => void)` | | - | Called when the retry button is clicked |
|
|
21
|
+
| `isAtRoot` | `boolean` | | - | Whether the user is at the root directory (hides back button) |
|
|
22
|
+
| `selectedPath` | `string \| null` | | - | Currently selected file path for highlighting |
|
|
23
|
+
| `resolveEntryPath` | `(entry: DirectoryEntry) => string` | ✓ | - | Resolves a DirectoryEntry to its full path |
|
|
24
|
+
| `headerContent` | `ReactNode` | | - | Content rendered between the back button and the entry list (e.g., NewFolderInput) |
|
|
25
|
+
| `hasCurrentPath` | `boolean` | | - | Whether a current path is set (affects empty state message) |
|
|
26
|
+
| `formatSize` | `((bytes: number) => string)` | | - | Custom file size formatter |
|
|
27
|
+
| `labels` | `Pick<FileBrowserLabels, "backToParent" \| "emptyDirectory" \| "noVolumeConfigured" \| "retry">` | | - | Customizable labels |
|
|
28
|
+
|
|
29
|
+
### Usage[](#usage "Direct link to Usage")
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { DirectoryList } from '@databricks/appkit-ui';
|
|
33
|
+
|
|
34
|
+
<DirectoryList /* props */ />
|
|
35
|
+
|
|
36
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# FileBreadcrumb
|
|
2
|
+
|
|
3
|
+
Path-aware breadcrumb navigation built on top of Breadcrumb primitives
|
|
4
|
+
|
|
5
|
+
## FileBreadcrumb[](#filebreadcrumb-1 "Direct link to FileBreadcrumb")
|
|
6
|
+
|
|
7
|
+
Path-aware breadcrumb navigation built on top of Breadcrumb primitives
|
|
8
|
+
|
|
9
|
+
**Source:** [`packages/appkit-ui/src/react/file-browser/file-breadcrumb.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/file-browser/file-breadcrumb.tsx)
|
|
10
|
+
|
|
11
|
+
### Props[](#props "Direct link to Props")
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --------------------- | ------------------------- | -------- | ------- | -------------------------------------------------------------------- |
|
|
15
|
+
| `rootLabel` | `string` | ✓ | - | Label for the root breadcrumb item |
|
|
16
|
+
| `segments` | `string[]` | ✓ | - | Path segments after the root |
|
|
17
|
+
| `onNavigateToRoot` | `() => void` | ✓ | - | Called when the root breadcrumb is clicked |
|
|
18
|
+
| `onNavigateToSegment` | `(index: number) => void` | ✓ | - | Called when a segment breadcrumb is clicked (receives segment index) |
|
|
19
|
+
|
|
20
|
+
### Usage[](#usage "Direct link to Usage")
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { FileBreadcrumb } from '@databricks/appkit-ui';
|
|
24
|
+
|
|
25
|
+
<FileBreadcrumb /* props */ />
|
|
26
|
+
|
|
27
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# FileEntry
|
|
2
|
+
|
|
3
|
+
Single file or directory row with icon, name, size, and selection state
|
|
4
|
+
|
|
5
|
+
## FileEntry[](#fileentry-1 "Direct link to FileEntry")
|
|
6
|
+
|
|
7
|
+
Single file or directory row with icon, name, size, and selection state
|
|
8
|
+
|
|
9
|
+
**Source:** [`packages/appkit-ui/src/react/file-browser/file-entry.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/file-browser/file-entry.tsx)
|
|
10
|
+
|
|
11
|
+
### Props[](#props "Direct link to Props")
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| ------------ | ----------------------------- | -------- | ------- | ------------------------------------------------------- |
|
|
15
|
+
| `entry` | `DirectoryEntry` | ✓ | - | The directory entry to render |
|
|
16
|
+
| `entryPath` | `string` | ✓ | - | Resolved full path for this entry |
|
|
17
|
+
| `isSelected` | `boolean` | | - | Whether this entry is currently selected |
|
|
18
|
+
| `formatSize` | `((bytes: number) => string)` | | - | Custom file size formatter (defaults to formatFileSize) |
|
|
19
|
+
|
|
20
|
+
### Usage[](#usage "Direct link to Usage")
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { FileEntry } from '@databricks/appkit-ui';
|
|
24
|
+
|
|
25
|
+
<FileEntry /* props */ />
|
|
26
|
+
|
|
27
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# FilePreviewPanel
|
|
2
|
+
|
|
3
|
+
Preview panel displaying file metadata, image/text preview, and download/delete actions
|
|
4
|
+
|
|
5
|
+
## FilePreviewPanel[](#filepreviewpanel-1 "Direct link to FilePreviewPanel")
|
|
6
|
+
|
|
7
|
+
Preview panel displaying file metadata, image/text preview, and download/delete actions
|
|
8
|
+
|
|
9
|
+
**Source:** [`packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx)
|
|
10
|
+
|
|
11
|
+
### Props[](#props "Direct link to Props")
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ------- | ------------------------------------------------------------------------- |
|
|
15
|
+
| `selectedFile` | `string \| null` | ✓ | - | Full path of the selected file (null when nothing is selected) |
|
|
16
|
+
| `preview` | `FilePreview \| null` | ✓ | - | Preview data for the selected file |
|
|
17
|
+
| `previewLoading` | `boolean` | | - | Whether the preview is loading |
|
|
18
|
+
| `onDownload` | `((filePath: string) => void)` | | - | Called when the download button is clicked |
|
|
19
|
+
| `onDelete` | `((filePath: string) => void)` | | - | Called when the delete button is clicked |
|
|
20
|
+
| `deleting` | `boolean` | | - | Whether a delete operation is in progress |
|
|
21
|
+
| `imagePreviewSrc` | `string \| ((filePath: string) => string)` | | - | Image preview source — string URL or function that receives the file path |
|
|
22
|
+
| `formatSize` | `((bytes: number) => string)` | | - | Custom file size formatter (defaults to formatFileSize) |
|
|
23
|
+
| `labels` | `Pick<FileBrowserLabels, "type" \| "download" \| "size" \| "selectFilePrompt" \| "previewNotAvailable" \| "previewFailed" \| "modified" \| "unknown">` | | - | Customizable labels |
|
|
24
|
+
|
|
25
|
+
### Usage[](#usage "Direct link to Usage")
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { FilePreviewPanel } from '@databricks/appkit-ui';
|
|
29
|
+
|
|
30
|
+
<FilePreviewPanel /* props */ />
|
|
31
|
+
|
|
32
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# NewFolderInput
|
|
2
|
+
|
|
3
|
+
Inline folder-name input with create/cancel actions
|
|
4
|
+
|
|
5
|
+
## NewFolderInput[](#newfolderinput-1 "Direct link to NewFolderInput")
|
|
6
|
+
|
|
7
|
+
Inline folder-name input with create/cancel actions
|
|
8
|
+
|
|
9
|
+
**Source:** [`packages/appkit-ui/src/react/file-browser/new-folder-input.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/file-browser/new-folder-input.tsx)
|
|
10
|
+
|
|
11
|
+
### Props[](#props "Direct link to Props")
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| ----------- | -------------------------------------------------------------- | -------- | ------- | -------------------------------------- |
|
|
15
|
+
| `value` | `string` | ✓ | - | Current folder name value |
|
|
16
|
+
| `onChange` | `(value: string) => void` | ✓ | - | Called when folder name changes |
|
|
17
|
+
| `onCreate` | `() => void` | ✓ | - | Called when the user confirms creation |
|
|
18
|
+
| `onCancel` | `() => void` | ✓ | - | Called when the user cancels |
|
|
19
|
+
| `creating` | `boolean` | | - | Whether folder creation is in progress |
|
|
20
|
+
| `autoFocus` | `boolean` | | `true` | Auto-focus the input on mount |
|
|
21
|
+
| `labels` | `Pick<FileBrowserLabels, "create" \| "folderNamePlaceholder">` | | - | Customizable labels |
|
|
22
|
+
|
|
23
|
+
### Usage[](#usage "Direct link to Usage")
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { NewFolderInput } from '@databricks/appkit-ui';
|
|
27
|
+
|
|
28
|
+
<NewFolderInput /* props */ />
|
|
29
|
+
|
|
30
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# GenieQueryVisualization
|
|
2
|
+
|
|
3
|
+
Renders a chart + data table for a Genie query result.
|
|
4
|
+
|
|
5
|
+
## GenieQueryVisualization[](#geniequeryvisualization-1 "Direct link to GenieQueryVisualization")
|
|
6
|
+
|
|
7
|
+
Renders a chart + data table for a Genie query result.
|
|
8
|
+
|
|
9
|
+
* When a chart type can be inferred: shows Tabs with "Chart" (default) and "Table"
|
|
10
|
+
* When no chart fits: shows only the data table
|
|
11
|
+
* When data is empty/malformed: renders nothing
|
|
12
|
+
|
|
13
|
+
**Source:** [`packages/appkit-ui/src/react/genie/genie-query-visualization.tsx`](https://github.com/databricks/appkit/blob/main/packages/appkit-ui/src/react/genie/genie-query-visualization.tsx)
|
|
14
|
+
|
|
15
|
+
### Props[](#props "Direct link to Props")
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Required | Default | Description |
|
|
18
|
+
| ----------- | ------------------------ | -------- | ------- | ------------------------------------------ |
|
|
19
|
+
| `data` | `GenieStatementResponse` | ✓ | - | Raw statement\_response from the Genie API |
|
|
20
|
+
| `className` | `string` | | - | Additional CSS classes |
|
|
21
|
+
|
|
22
|
+
### Usage[](#usage "Direct link to Usage")
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { GenieQueryVisualization } from '@databricks/appkit-ui';
|
|
26
|
+
|
|
27
|
+
<GenieQueryVisualization /* props */ />
|
|
28
|
+
|
|
29
|
+
```
|
package/docs/api/appkit.md
CHANGED
|
@@ -51,6 +51,7 @@ Core library for building Databricks applications with type-safe SQL queries, pl
|
|
|
51
51
|
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
52
52
|
| [ConfigSchema](./docs/api/appkit/TypeAlias.ConfigSchema.md) | Configuration schema definition for plugin config. Re-exported from the standard JSON Schema Draft 7 types. |
|
|
53
53
|
| [IAppRouter](./docs/api/appkit/TypeAlias.IAppRouter.md) | Express router type for plugin route registration |
|
|
54
|
+
| [PluginData](./docs/api/appkit/TypeAlias.PluginData.md) | - |
|
|
54
55
|
| [ResourcePermission](./docs/api/appkit/TypeAlias.ResourcePermission.md) | Union of all possible permission levels across all resource types. |
|
|
55
56
|
| [ToPlugin](./docs/api/appkit/TypeAlias.ToPlugin.md) | - |
|
|
56
57
|
|