@databricks/appkit-ui 0.10.1 → 0.11.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 +7 -0
- package/dist/cli/commands/plugin/sync/sync.js +6 -3
- package/dist/cli/commands/plugin/sync/sync.js.map +1 -1
- package/dist/react/table/data-table.d.ts +2 -2
- package/dist/react/table/data-table.d.ts.map +1 -1
- package/dist/react/ui/calendar.d.ts +3 -3
- package/dist/react/ui/card.d.ts +8 -8
- package/dist/react/ui/carousel.d.ts +6 -6
- package/dist/react/ui/chart.d.ts +5 -5
- package/dist/react/ui/checkbox.d.ts +2 -2
- package/dist/react/ui/collapsible.d.ts +4 -4
- package/dist/react/ui/command.d.ts +10 -10
- package/dist/react/ui/context-menu.d.ts +16 -16
- package/dist/react/ui/dialog.d.ts +11 -11
- package/dist/react/ui/drawer.d.ts +11 -11
- package/dist/react/ui/dropdown-menu.d.ts +16 -16
- package/dist/react/ui/empty.d.ts +7 -7
- package/dist/react/ui/field.d.ts +11 -11
- package/dist/react/ui/form.d.ts +7 -7
- package/dist/react/ui/hover-card.d.ts +4 -4
- package/dist/schemas/plugin-manifest.schema.json +4 -0
- package/dist/schemas/template-plugins.schema.json +4 -0
- package/docs/docs/api/appkit/Class.AppKitError/index.html +3 -3
- package/docs/docs/api/appkit/Class.AuthenticationError/index.html +3 -3
- package/docs/docs/api/appkit/Class.ConfigurationError/index.html +3 -3
- package/docs/docs/api/appkit/Class.ConnectionError/index.html +3 -3
- package/docs/docs/api/appkit/Class.ExecutionError/index.html +3 -3
- package/docs/docs/api/appkit/Class.InitializationError/index.html +3 -3
- package/docs/docs/api/appkit/Class.Plugin/index.html +3 -3
- package/docs/docs/api/appkit/Class.ResourceRegistry/index.html +3 -3
- package/docs/docs/api/appkit/Class.ServerError/index.html +3 -3
- package/docs/docs/api/appkit/Class.TunnelError/index.html +3 -3
- package/docs/docs/api/appkit/Class.ValidationError/index.html +3 -3
- package/docs/docs/api/appkit/Enumeration.RequestedClaimsPermissionSet/index.html +3 -3
- package/docs/docs/api/appkit/Enumeration.ResourceType/index.html +3 -3
- package/docs/docs/api/appkit/Function.appKitTypesPlugin/index.html +3 -3
- package/docs/docs/api/appkit/Function.createApp/index.html +3 -3
- package/docs/docs/api/appkit/Function.createLakebasePool/index.html +3 -3
- package/docs/docs/api/appkit/Function.generateDatabaseCredential/index.html +3 -3
- package/docs/docs/api/appkit/Function.getExecutionContext/index.html +3 -3
- package/docs/docs/api/appkit/Function.getLakebaseOrmConfig/index.html +3 -3
- package/docs/docs/api/appkit/Function.getLakebasePgConfig/index.html +3 -3
- package/docs/docs/api/appkit/Function.getPluginManifest/index.html +3 -3
- package/docs/docs/api/appkit/Function.getResourceRequirements/index.html +3 -3
- package/docs/docs/api/appkit/Function.getUsernameWithApiLookup/index.html +3 -3
- package/docs/docs/api/appkit/Function.getWorkspaceClient/index.html +3 -3
- package/docs/docs/api/appkit/Function.isSQLTypeMarker/index.html +3 -3
- package/docs/docs/api/appkit/Interface.BasePluginConfig/index.html +3 -3
- package/docs/docs/api/appkit/Interface.CacheConfig/index.html +3 -3
- package/docs/docs/api/appkit/Interface.DatabaseCredential/index.html +3 -3
- package/docs/docs/api/appkit/Interface.GenerateDatabaseCredentialRequest/index.html +3 -3
- package/docs/docs/api/appkit/Interface.ITelemetry/index.html +3 -3
- package/docs/docs/api/appkit/Interface.LakebasePoolConfig/index.html +3 -3
- package/docs/docs/api/appkit/Interface.PluginManifest/index.html +3 -3
- package/docs/docs/api/appkit/Interface.RequestedClaims/index.html +3 -3
- package/docs/docs/api/appkit/Interface.RequestedResource/index.html +3 -3
- package/docs/docs/api/appkit/Interface.ResourceEntry/index.html +3 -3
- package/docs/docs/api/appkit/Interface.ResourceFieldEntry/index.html +3 -3
- package/docs/docs/api/appkit/Interface.ResourceRequirement/index.html +3 -3
- package/docs/docs/api/appkit/Interface.StreamExecutionSettings/index.html +3 -3
- package/docs/docs/api/appkit/Interface.TelemetryConfig/index.html +3 -3
- package/docs/docs/api/appkit/Interface.ValidationResult/index.html +3 -3
- package/docs/docs/api/appkit/TypeAlias.ConfigSchema/index.html +3 -3
- package/docs/docs/api/appkit/TypeAlias.IAppRouter/index.html +3 -3
- package/docs/docs/api/appkit/TypeAlias.ResourcePermission/index.html +3 -3
- package/docs/docs/api/appkit/TypeAlias.ToPlugin/index.html +3 -3
- package/docs/docs/api/appkit/Variable.sql/index.html +3 -3
- package/docs/docs/api/appkit/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/AreaChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/BarChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/DataTable/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/DonutChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/HeatmapChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/LineChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/PieChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/RadarChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/data/ScatterChart/index.html +3 -3
- package/docs/docs/api/appkit-ui/index.html +3 -3
- package/docs/docs/api/appkit-ui/styling/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Accordion/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Alert/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/AlertDialog/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/AspectRatio/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Avatar/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Badge/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Breadcrumb/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Button/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/ButtonGroup/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Calendar/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Card/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Carousel/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/ChartContainer/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Checkbox/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Collapsible/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Command/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/ContextMenu/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Dialog/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Drawer/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/DropdownMenu/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Empty/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Field/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/FormControl/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/HoverCard/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Input/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/InputGroup/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/InputOTP/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Item/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Kbd/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Label/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Menubar/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/NavigationMenu/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Pagination/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Popover/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Progress/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/RadioGroup/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/ResizableHandle/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/ScrollArea/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Select/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Separator/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Sheet/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Sidebar/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Skeleton/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Slider/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Spinner/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Switch/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Table/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Tabs/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Textarea/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Toaster/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Toggle/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/ToggleGroup/index.html +3 -3
- package/docs/docs/api/appkit-ui/ui/Tooltip/index.html +3 -3
- package/docs/docs/api/index.html +3 -3
- package/docs/docs/app-management/index.html +4 -4
- package/docs/docs/architecture/index.html +6 -6
- package/docs/docs/category/development/index.html +3 -3
- package/docs/docs/configuration/index.html +4 -4
- package/docs/docs/core-principles/index.html +3 -3
- package/docs/docs/development/ai-assisted-development/index.html +3 -3
- package/docs/docs/development/index.html +3 -3
- package/docs/docs/development/llm-guide/index.html +3 -3
- package/docs/docs/development/local-development/index.html +3 -3
- package/docs/docs/development/project-setup/index.html +4 -4
- package/docs/docs/development/remote-bridge/index.html +3 -3
- package/docs/docs/development/type-generation/index.html +4 -4
- package/docs/docs/index.html +3 -3
- package/docs/docs/plugins/analytics/index.html +53 -0
- package/docs/docs/plugins/analytics.md +66 -0
- package/docs/docs/plugins/caching/index.html +23 -0
- package/docs/docs/plugins/caching.md +33 -0
- package/docs/docs/plugins/custom-plugins/index.html +49 -0
- package/docs/docs/plugins/custom-plugins.md +161 -0
- package/docs/docs/plugins/execution-context/index.html +40 -0
- package/docs/docs/plugins/execution-context.md +45 -0
- package/docs/docs/plugins/index.html +6 -173
- package/docs/docs/plugins/lakebase/index.html +62 -0
- package/docs/docs/plugins/lakebase.md +179 -0
- package/docs/docs/plugins/plugin-management/index.html +44 -0
- package/docs/docs/plugins/plugin-management.md +88 -0
- package/docs/docs/plugins/server/index.html +45 -0
- package/docs/docs/plugins/server.md +78 -0
- package/docs/docs/plugins.md +0 -481
- package/llms.txt +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Execution context
|
|
2
|
+
|
|
3
|
+
AppKit manages Databricks authentication via two contexts:
|
|
4
|
+
|
|
5
|
+
* **ServiceContext** (singleton): Initialized at app startup with service principal credentials
|
|
6
|
+
* **ExecutionContext**: Determined at runtime - either service principal or user context
|
|
7
|
+
|
|
8
|
+
## Headers for user context[](#headers-for-user-context "Direct link to Headers for user context")
|
|
9
|
+
|
|
10
|
+
* `x-forwarded-user`: required in production; identifies the user
|
|
11
|
+
* `x-forwarded-access-token`: required for user token passthrough
|
|
12
|
+
|
|
13
|
+
## Using `asUser(req)` for user-scoped operations[](#using-asuserreq-for-user-scoped-operations "Direct link to using-asuserreq-for-user-scoped-operations")
|
|
14
|
+
|
|
15
|
+
The `asUser(req)` pattern allows plugins to execute operations using the requesting user's credentials:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// In a custom plugin route handler
|
|
19
|
+
router.post("/users/me/data", async (req, res) => {
|
|
20
|
+
// Execute as the user (uses their Databricks permissions)
|
|
21
|
+
const result = await this.asUser(req).query("SELECT ...");
|
|
22
|
+
res.json(result);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Service principal execution (default)
|
|
26
|
+
router.post("/system/data", async (req, res) => {
|
|
27
|
+
const result = await this.query("SELECT ...");
|
|
28
|
+
res.json(result);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Context helper functions[](#context-helper-functions "Direct link to Context helper functions")
|
|
34
|
+
|
|
35
|
+
Exported from `@databricks/appkit`:
|
|
36
|
+
|
|
37
|
+
* `getCurrentUserId()`: Returns user ID in user context, service user ID otherwise
|
|
38
|
+
* `getWorkspaceClient()`: Returns the appropriate WorkspaceClient for current context
|
|
39
|
+
* `getWarehouseId()`: `Promise<string>` (from `DATABRICKS_WAREHOUSE_ID` or auto-selected in dev)
|
|
40
|
+
* `getWorkspaceId()`: `Promise<string>` (from `DATABRICKS_WORKSPACE_ID` or fetched)
|
|
41
|
+
* `isInUserContext()`: Returns `true` if currently executing in user context
|
|
42
|
+
|
|
43
|
+
## Development mode behavior[](#development-mode-behavior "Direct link to Development mode behavior")
|
|
44
|
+
|
|
45
|
+
In local development (`NODE_ENV=development`), if `asUser(req)` is called without a user token, it logs a warning and falls back to the service principal.
|