-
Notifications
You must be signed in to change notification settings - Fork 1
chore: plugin manifest definition #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MarioCadenas
wants to merge
3
commits into
main
Choose a base branch
from
plugin-manifest-definition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Enumeration: ResourceType | ||
|
|
||
| Supported Databricks resource types that plugins can depend on. | ||
|
|
||
| ## Enumeration Members | ||
|
|
||
| ### JOB | ||
|
|
||
| ```ts | ||
| JOB: "job"; | ||
| ``` | ||
|
|
||
| Databricks Job for scheduled or triggered workflows | ||
|
|
||
| *** | ||
|
|
||
| ### LAKEBASE | ||
|
|
||
| ```ts | ||
| LAKEBASE: "lakebase"; | ||
| ``` | ||
|
|
||
| Lakebase instance for persistent caching or data storage | ||
|
|
||
| *** | ||
|
|
||
| ### SECRET\_SCOPE | ||
|
|
||
| ```ts | ||
| SECRET_SCOPE: "secret-scope"; | ||
| ``` | ||
|
|
||
| Secret scope for secure credential storage | ||
|
|
||
| *** | ||
|
|
||
| ### SERVING\_ENDPOINT | ||
|
|
||
| ```ts | ||
| SERVING_ENDPOINT: "serving-endpoint"; | ||
| ``` | ||
|
|
||
| Model serving endpoint for ML inference | ||
|
|
||
| *** | ||
|
|
||
| ### SQL\_WAREHOUSE | ||
|
|
||
| ```ts | ||
| SQL_WAREHOUSE: "sql-warehouse"; | ||
| ``` | ||
|
|
||
| Databricks SQL Warehouse for query execution | ||
|
|
||
| *** | ||
|
|
||
| ### UNITY\_CATALOG | ||
|
|
||
| ```ts | ||
| UNITY_CATALOG: "unity-catalog"; | ||
| ``` | ||
|
|
||
| Unity Catalog for data governance and metadata | ||
|
|
||
| *** | ||
|
|
||
| ### VECTOR\_SEARCH\_INDEX | ||
|
|
||
| ```ts | ||
| VECTOR_SEARCH_INDEX: "vector-search-index"; | ||
| ``` | ||
|
|
||
| Vector search index for similarity search |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Function: getPluginManifest() | ||
|
|
||
| ```ts | ||
| function getPluginManifest(plugin: PluginConstructor): PluginManifest; | ||
| ``` | ||
|
|
||
| Loads and validates the manifest from a plugin constructor. | ||
|
|
||
| All plugins must have a static `manifest` property that declares their | ||
| metadata and resource requirements. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| | ------ | ------ | ------ | | ||
| | `plugin` | `PluginConstructor` | The plugin constructor class | | ||
|
|
||
| ## Returns | ||
|
|
||
| [`PluginManifest`](Interface.PluginManifest.md) | ||
|
|
||
| The validated plugin manifest | ||
|
|
||
| ## Throws | ||
|
|
||
| If the manifest is missing or invalid | ||
|
|
||
| ## Example | ||
|
|
||
| ```typescript | ||
| import { AnalyticsPlugin } from '@databricks/appkit'; | ||
| import { getPluginManifest } from './manifest-loader'; | ||
|
|
||
| const manifest = getPluginManifest(AnalyticsPlugin); | ||
| console.log('Required resources:', manifest.resources.required); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Function: getResourceRequirements() | ||
|
|
||
| ```ts | ||
| function getResourceRequirements(plugin: PluginConstructor): { | ||
| alias: string; | ||
| description: string; | ||
| env?: string; | ||
| permission: ResourcePermission; | ||
| required: boolean; | ||
| type: ResourceType; | ||
| }[]; | ||
| ``` | ||
|
|
||
| Gets the resource requirements from a plugin's manifest. | ||
|
|
||
| Combines required and optional resources into a single array with the | ||
| `required` flag set appropriately. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| | ------ | ------ | ------ | | ||
| | `plugin` | `PluginConstructor` | The plugin constructor class | | ||
|
|
||
| ## Returns | ||
|
|
||
| Combined array of required and optional resources | ||
|
|
||
| ## Throws | ||
|
|
||
| If the plugin manifest is missing or invalid | ||
|
|
||
| ## Example | ||
|
|
||
| ```typescript | ||
| const resources = getResourceRequirements(AnalyticsPlugin); | ||
| for (const resource of resources) { | ||
| console.log(`${resource.type}: ${resource.description} (required: ${resource.required})`); | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Interface: ConfigSchema | ||
|
|
||
| Configuration schema definition for plugin config. | ||
| Uses JSON Schema format for validation and documentation. | ||
|
|
||
| ## Indexable | ||
|
|
||
| ```ts | ||
| [key: string]: unknown | ||
| ``` | ||
|
|
||
| Allow additional JSON Schema properties | ||
|
|
||
| ## Properties | ||
|
|
||
| ### additionalProperties? | ||
|
|
||
| ```ts | ||
| optional additionalProperties: boolean; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### items? | ||
|
|
||
| ```ts | ||
| optional items: ConfigSchema; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### properties? | ||
|
|
||
| ```ts | ||
| optional properties: Record<string, ConfigSchemaProperty>; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### required? | ||
|
|
||
| ```ts | ||
| optional required: string[]; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### type | ||
|
|
||
| ```ts | ||
| type: "string" | "number" | "boolean" | "object" | "array"; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Interface: ConfigSchemaProperty | ||
|
|
||
| Individual property definition in a config schema. | ||
|
|
||
| ## Properties | ||
|
|
||
| ### default? | ||
|
|
||
| ```ts | ||
| optional default: unknown; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### description? | ||
|
|
||
| ```ts | ||
| optional description: string; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### enum? | ||
|
|
||
| ```ts | ||
| optional enum: unknown[]; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### items? | ||
|
|
||
| ```ts | ||
| optional items: ConfigSchemaProperty; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### maximum? | ||
|
|
||
| ```ts | ||
| optional maximum: number; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### maxLength? | ||
|
|
||
| ```ts | ||
| optional maxLength: number; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### minimum? | ||
|
|
||
| ```ts | ||
| optional minimum: number; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### minLength? | ||
|
|
||
| ```ts | ||
| optional minLength: number; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### properties? | ||
|
|
||
| ```ts | ||
| optional properties: Record<string, ConfigSchemaProperty>; | ||
| ``` | ||
|
|
||
| *** | ||
|
|
||
| ### type | ||
|
|
||
| ```ts | ||
| type: "string" | "number" | "boolean" | "object" | "array"; | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something went wrong with displaying an icon near to the enum in the docs - it falls-back to the "other" category, but it should use enum:
appkit/docs/src/css/custom.css
Lines 112 to 116 in 8dceeb4
appkit/docs/sidebars.ts
Lines 35 to 46 in b70ea1c
Could you please check? maybe it's just named "enumeration" or sth, and the fix will be easy. Thanks!