Skip to content

Commit 8339083

Browse files
author
busbar-bot
committed
release: v0.3.0 — regenerate against busbar v1.5.1 spec
1 parent 6c17bd6 commit 8339083

5 files changed

Lines changed: 230 additions & 6 deletions

File tree

openapi.json

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,22 @@
11961196
],
11971197
"type": "object"
11981198
},
1199+
"InspectPluginReq": {
1200+
"description": "`POST /api/v1/admin/plugins/inspect` request body. SAME shape as [`InstallPluginReq`] (question\n#7 — \"same request body shape as `POST /plugins`\") — `file` is accepted for shape parity with\nthe install flow a UI composes around the same upload, but is otherwise UNUSED here: inspect\nnever writes anything to disk, so there is no filename to bind an install would need.",
1201+
"properties": {
1202+
"file": {
1203+
"type": "string"
1204+
},
1205+
"tarball_b64": {
1206+
"type": "string"
1207+
}
1208+
},
1209+
"required": [
1210+
"file",
1211+
"tarball_b64"
1212+
],
1213+
"type": "object"
1214+
},
11991215
"InstallPluginReq": {
12001216
"description": "The `POST /api/v1/admin/plugins` request body: install a SIGNED plugin tarball. The tarball\nbytes ride as base64 (`tarball_b64`) — a plugin artifact is opaque binary, so base64 keeps it a\nclean JSON field. The engine RE-VERIFIES the contained signed manifest server-side against the\nrunning `plugins.*` trust posture (the client is never trusted). `file` is the bare `.tar.gz`\nfilename to store it under (storage only — identity comes from the signed manifest inside).",
12011217
"properties": {
@@ -1821,9 +1837,23 @@
18211837
"PluginSchemaView": {
18221838
"description": "`GET /plugins/{name}/schema` — the generalized, all-kinds sibling of [`HookSchemaView`]\n(plugin-settings-schema-SPEC.md). Carries `trust`/`source`/`schema_error` on top of\n`{name, schema}` so busbar-ui never has to infer trust state or the describe/manifest\nprecedence rule from context — the server always picks exactly one source and reports which.",
18231839
"properties": {
1840+
"kind": {
1841+
"description": "The plugin's `kind` (`hook` | `secret` | …) from its manifest. Both `GET /plugins/{file}/schema`\nand `POST /plugins/inspect` emit it (`null` only when the plugin cannot be resolved to a\nmanifest). Declared so codegen'd clients keep it.",
1842+
"type": [
1843+
"string",
1844+
"null"
1845+
]
1846+
},
18241847
"name": {
18251848
"type": "string"
18261849
},
1850+
"restart_required_default": {
1851+
"description": "The kind-derived restart-scoping default (`busbar_plugin_sign::kind_restart_default`), so\nbusbar-ui need not hardcode the kind→default table. Emitted by both schema endpoints (`null`\nonly when the plugin has no resolvable manifest/kind). Declared so codegen'd clients keep it.",
1852+
"type": [
1853+
"boolean",
1854+
"null"
1855+
]
1856+
},
18271857
"schema": {
18281858
"description": "The plugin's settings JSON Schema verbatim, or `null` — either because the manifest never\nset `settings_schema`, or (distinctly, see `schema_error`) because it did but the value\nfailed to parse."
18291859
},
@@ -1841,6 +1871,13 @@
18411871
"trust": {
18421872
"description": "`\"trusted\" | \"unverified\" | \"rejected\"` — the same vocabulary the plugin catalog already\nuses (never `\"verified\"`; question #8, round-4 correction).",
18431873
"type": "string"
1874+
},
1875+
"version": {
1876+
"description": "The plugin's semantic version from its manifest. Present on `POST /plugins/inspect` (which\npreviews an on-disk candidate's manifest); `null`/absent on `GET /plugins/{file}/schema`, which\ndoes not surface the version. Declared here so a codegen'd client keeps the field the inspect\nhandler always sends, rather than silently dropping it.",
1877+
"type": [
1878+
"string",
1879+
"null"
1880+
]
18441881
}
18451882
},
18461883
"required": [
@@ -2490,7 +2527,7 @@
24902527
"info": {
24912528
"description": "The frozen, additive-only /api/v1/admin surface. Errors use the stable envelope {\"error\":{\"code\",\"message\"}}; tooling branches on `code`.",
24922529
"title": "Busbar Admin API",
2493-
"version": "1.5.0"
2530+
"version": "1.5.1"
24942531
},
24952532
"openapi": "3.1.0",
24962533
"paths": {
@@ -6711,6 +6748,93 @@
67116748
"x-busbar-required-scope": "full"
67126749
}
67136750
},
6751+
"/api/v1/admin/plugins/inspect": {
6752+
"post": {
6753+
"operationId": "PostPluginsInspect",
6754+
"requestBody": {
6755+
"content": {
6756+
"application/json": {
6757+
"schema": {
6758+
"$ref": "#/components/schemas/InspectPluginReq"
6759+
}
6760+
}
6761+
},
6762+
"required": true
6763+
},
6764+
"responses": {
6765+
"200": {
6766+
"content": {
6767+
"application/json": {
6768+
"schema": {
6769+
"$ref": "#/components/schemas/PluginSchemaView"
6770+
}
6771+
}
6772+
},
6773+
"description": "`{name, version, kind, schema, schema_error, trust, source, restart_required_default}` — the same shape `GET /plugins/{file}/schema` carries, plus `name`/`version`/`kind`; an untrusted/rejected candidate is reported (`trust`), never refused"
6774+
},
6775+
"400": {
6776+
"content": {
6777+
"application/json": {
6778+
"schema": {
6779+
"$ref": "#/components/schemas/Error"
6780+
}
6781+
}
6782+
},
6783+
"description": "`invalid_request`: malformed body / unknown field"
6784+
},
6785+
"401": {
6786+
"content": {
6787+
"application/json": {
6788+
"schema": {
6789+
"$ref": "#/components/schemas/Error"
6790+
}
6791+
}
6792+
},
6793+
"description": "Missing/invalid admin credential (error code `unauthorized`)"
6794+
},
6795+
"403": {
6796+
"content": {
6797+
"application/json": {
6798+
"schema": {
6799+
"$ref": "#/components/schemas/Error"
6800+
}
6801+
}
6802+
},
6803+
"description": "Authenticated but under-scoped: requires `read-only` (error code `forbidden`)"
6804+
},
6805+
"429": {
6806+
"content": {
6807+
"application/json": {
6808+
"schema": {
6809+
"$ref": "#/components/schemas/Error"
6810+
}
6811+
}
6812+
},
6813+
"description": "Per-principal mutation budget exhausted (error code `rate_limited`; `Retry-After` header)"
6814+
},
6815+
"500": {
6816+
"content": {
6817+
"application/json": {
6818+
"schema": {
6819+
"$ref": "#/components/schemas/Error"
6820+
}
6821+
}
6822+
},
6823+
"description": "Internal failure (error code `internal`); the detail is logged server-side, never returned"
6824+
}
6825+
},
6826+
"security": [
6827+
{
6828+
"adminToken": []
6829+
},
6830+
{
6831+
"bearerAuth": []
6832+
}
6833+
],
6834+
"summary": "Stateless read-only preview of a candidate plugin tarball — verify its signature, parse its manifest, and report its settings schema WITHOUT installing anything",
6835+
"x-busbar-required-scope": "read-only"
6836+
}
6837+
},
67146838
"/api/v1/admin/plugins/reload": {
67156839
"post": {
67166840
"operationId": "PostPluginsReload",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@busbar/busbar-admin",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "TypeScript SDK for the Busbar admin API (generated from the typed OpenAPI 3.1 schema).",
55
"license": "Apache-2.0",
66
"repository": {
@@ -11,7 +11,12 @@
1111
"type": "module",
1212
"main": "./src/index.ts",
1313
"types": "./src/index.ts",
14-
"files": ["src", "openapi.json", "README.md", "LICENSE"],
14+
"files": [
15+
"src",
16+
"openapi.json",
17+
"README.md",
18+
"LICENSE"
19+
],
1520
"publishConfig": {
1621
"access": "public"
1722
},

src/sdk.gen.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

33
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
4-
import type { GetAdminAuthData, GetAdminAuthResponse, GetAdminAuthError, PutAdminAuthData, PutAdminAuthResponse, PutAdminAuthError, GetAuditData, GetAuditResponse, GetAuditError, GetAuthData, GetAuthResponse, GetAuthError, PostAuthCacheFlushData, PostAuthCacheFlushResponse, PostAuthCacheFlushError, GetConfigData, GetConfigResponse, GetConfigError, PostConfigApplyData, PostConfigApplyResponse, PostConfigApplyError, GetConfigDiffData, GetConfigDiffResponse, GetConfigDiffError, PostConfigReloadData, PostConfigReloadResponse, PostConfigReloadError, PostConfigRollbackData, PostConfigRollbackResponse, PostConfigRollbackError, GetConfigSettingsData, GetConfigSettingsResponse, GetConfigSettingsError, PutConfigSettingsData, PutConfigSettingsResponse, PutConfigSettingsError, PostConfigValidateData, PostConfigValidateResponse, PostConfigValidateError, GetConfigVersionsData, GetConfigVersionsResponse, GetConfigVersionsError, GetConfigVersionsVData, GetConfigVersionsVResponse, GetConfigVersionsVError, GetGroupsData, GetGroupsResponse, GetGroupsError, PostGroupsData, PostGroupsResponse, PostGroupsError, DeleteGroupsNameData, DeleteGroupsNameResponse, DeleteGroupsNameError, GetGroupsNameData, GetGroupsNameResponse, GetGroupsNameError, PatchGroupsNameData, PatchGroupsNameResponse, PatchGroupsNameError, PutGroupsNameData, PutGroupsNameResponse, PutGroupsNameError, GetGroupsNameUsageData, GetGroupsNameUsageResponse, GetGroupsNameUsageError, GetHooksData, GetHooksResponse, GetHooksError, PostHooksData, PostHooksResponse, PostHooksError, DeleteHooksNameData, DeleteHooksNameResponse, DeleteHooksNameError, GetHooksNameData, GetHooksNameResponse, GetHooksNameError, PutHooksNameData, PutHooksNameResponse, PutHooksNameError, GetHooksNameHealthData, GetHooksNameHealthResponse, GetHooksNameHealthError, GetHooksNameSchemaData, GetHooksNameSchemaResponse, GetHooksNameSchemaError, PatchHooksNameSettingsData, PatchHooksNameSettingsResponse, PatchHooksNameSettingsError, GetHooksNameStatusData, GetHooksNameStatusResponse, GetHooksNameStatusError, GetInfoData, GetInfoResponse, GetInfoError, GetKeysData, GetKeysResponse, GetKeysError, PostKeysData, PostKeysResponse, PostKeysError, DeleteKeysIdData, DeleteKeysIdResponse, DeleteKeysIdError, GetKeysIdData, GetKeysIdResponse, GetKeysIdError, PatchKeysIdData, PatchKeysIdResponse, PatchKeysIdError, PostKeysIdRevokeData, PostKeysIdRevokeResponse, PostKeysIdRevokeError, PostKeysIdRotateData, PostKeysIdRotateResponse, PostKeysIdRotateError, GetKeysIdUsageData, GetKeysIdUsageResponse, GetKeysIdUsageError, GetModelsData, GetModelsResponse, GetModelsError, GetOpenapiJsonData, GetOpenapiJsonResponse, GetOpenapiJsonError, DeleteOverlaySectionData, DeleteOverlaySectionResponse, DeleteOverlaySectionError, GetPluginsData, GetPluginsResponse, GetPluginsError, PostPluginsData, PostPluginsResponse, PostPluginsError, PostPluginsReloadData, PostPluginsReloadResponse, PostPluginsReloadError, PostPluginsRollbackData, PostPluginsRollbackResponse, PostPluginsRollbackError, DeletePluginsFileData, DeletePluginsFileResponse, DeletePluginsFileError, GetPluginsFileSchemaData, GetPluginsFileSchemaResponse, GetPluginsFileSchemaError, GetPoolsData, GetPoolsResponse, GetPoolsError, GetPoolsNameData, GetPoolsNameResponse, GetPoolsNameError, GetProvidersData, GetProvidersResponse, GetProvidersError, PostRestartData, PostRestartResponse, PostRestartError, PostSigningKeyRotateData, PostSigningKeyRotateResponse, PostSigningKeyRotateError, GetUsageData, GetUsageResponse, GetUsageError } from './types.gen';
4+
import type { GetAdminAuthData, GetAdminAuthResponse, GetAdminAuthError, PutAdminAuthData, PutAdminAuthResponse, PutAdminAuthError, GetAuditData, GetAuditResponse, GetAuditError, GetAuthData, GetAuthResponse, GetAuthError, PostAuthCacheFlushData, PostAuthCacheFlushResponse, PostAuthCacheFlushError, GetConfigData, GetConfigResponse, GetConfigError, PostConfigApplyData, PostConfigApplyResponse, PostConfigApplyError, GetConfigDiffData, GetConfigDiffResponse, GetConfigDiffError, PostConfigReloadData, PostConfigReloadResponse, PostConfigReloadError, PostConfigRollbackData, PostConfigRollbackResponse, PostConfigRollbackError, GetConfigSettingsData, GetConfigSettingsResponse, GetConfigSettingsError, PutConfigSettingsData, PutConfigSettingsResponse, PutConfigSettingsError, PostConfigValidateData, PostConfigValidateResponse, PostConfigValidateError, GetConfigVersionsData, GetConfigVersionsResponse, GetConfigVersionsError, GetConfigVersionsVData, GetConfigVersionsVResponse, GetConfigVersionsVError, GetGroupsData, GetGroupsResponse, GetGroupsError, PostGroupsData, PostGroupsResponse, PostGroupsError, DeleteGroupsNameData, DeleteGroupsNameResponse, DeleteGroupsNameError, GetGroupsNameData, GetGroupsNameResponse, GetGroupsNameError, PatchGroupsNameData, PatchGroupsNameResponse, PatchGroupsNameError, PutGroupsNameData, PutGroupsNameResponse, PutGroupsNameError, GetGroupsNameUsageData, GetGroupsNameUsageResponse, GetGroupsNameUsageError, GetHooksData, GetHooksResponse, GetHooksError, PostHooksData, PostHooksResponse, PostHooksError, DeleteHooksNameData, DeleteHooksNameResponse, DeleteHooksNameError, GetHooksNameData, GetHooksNameResponse, GetHooksNameError, PutHooksNameData, PutHooksNameResponse, PutHooksNameError, GetHooksNameHealthData, GetHooksNameHealthResponse, GetHooksNameHealthError, GetHooksNameSchemaData, GetHooksNameSchemaResponse, GetHooksNameSchemaError, PatchHooksNameSettingsData, PatchHooksNameSettingsResponse, PatchHooksNameSettingsError, GetHooksNameStatusData, GetHooksNameStatusResponse, GetHooksNameStatusError, GetInfoData, GetInfoResponse, GetInfoError, GetKeysData, GetKeysResponse, GetKeysError, PostKeysData, PostKeysResponse, PostKeysError, DeleteKeysIdData, DeleteKeysIdResponse, DeleteKeysIdError, GetKeysIdData, GetKeysIdResponse, GetKeysIdError, PatchKeysIdData, PatchKeysIdResponse, PatchKeysIdError, PostKeysIdRevokeData, PostKeysIdRevokeResponse, PostKeysIdRevokeError, PostKeysIdRotateData, PostKeysIdRotateResponse, PostKeysIdRotateError, GetKeysIdUsageData, GetKeysIdUsageResponse, GetKeysIdUsageError, GetModelsData, GetModelsResponse, GetModelsError, GetOpenapiJsonData, GetOpenapiJsonResponse, GetOpenapiJsonError, DeleteOverlaySectionData, DeleteOverlaySectionResponse, DeleteOverlaySectionError, GetPluginsData, GetPluginsResponse, GetPluginsError, PostPluginsData, PostPluginsResponse, PostPluginsError, PostPluginsInspectData, PostPluginsInspectResponse, PostPluginsInspectError, PostPluginsReloadData, PostPluginsReloadResponse, PostPluginsReloadError, PostPluginsRollbackData, PostPluginsRollbackResponse, PostPluginsRollbackError, DeletePluginsFileData, DeletePluginsFileResponse, DeletePluginsFileError, GetPluginsFileSchemaData, GetPluginsFileSchemaResponse, GetPluginsFileSchemaError, GetPoolsData, GetPoolsResponse, GetPoolsError, GetPoolsNameData, GetPoolsNameResponse, GetPoolsNameError, GetProvidersData, GetProvidersResponse, GetProvidersError, PostRestartData, PostRestartResponse, PostRestartError, PostSigningKeyRotateData, PostSigningKeyRotateResponse, PostSigningKeyRotateError, GetUsageData, GetUsageResponse, GetUsageError } from './types.gen';
55
import { client as _heyApiClient } from './client.gen';
66

77
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
@@ -978,6 +978,30 @@ export const postPlugins = <ThrowOnError extends boolean = false>(options: Optio
978978
});
979979
};
980980

981+
/**
982+
* Stateless read-only preview of a candidate plugin tarball — verify its signature, parse its manifest, and report its settings schema WITHOUT installing anything
983+
*/
984+
export const postPluginsInspect = <ThrowOnError extends boolean = false>(options: Options<PostPluginsInspectData, ThrowOnError>) => {
985+
return (options.client ?? _heyApiClient).post<PostPluginsInspectResponse, PostPluginsInspectError, ThrowOnError>({
986+
security: [
987+
{
988+
name: 'x-admin-token',
989+
type: 'apiKey'
990+
},
991+
{
992+
scheme: 'bearer',
993+
type: 'http'
994+
}
995+
],
996+
url: '/api/v1/admin/plugins/inspect',
997+
...options,
998+
headers: {
999+
'Content-Type': 'application/json',
1000+
...options?.headers
1001+
}
1002+
});
1003+
};
1004+
9811005
/**
9821006
* Re-scan the plugins directory and report the reconciled dynamic-library inventory (the sibling of config/reload). A store change takes effect on the next store (re)load
9831007
*/

0 commit comments

Comments
 (0)