postToolsPluginsBuildWithHttpInfo method
Builds and stores one plugin for the caller's org.
Builds and stores one plugin for the caller's org. The 201 carries the bundle's size, whether a model wrote the source, and the plugin as stored. Post source to build TypeScript as-is, or spec — an OpenAPI document or plain prose describing the endpoints — to have one generated; the generated source comes back in the answer, so a caller reads what will run before it runs. Exactly one of the two, and name must be one lowercase path segment; both or neither is 400. COMPILING IS THE GATE. The source goes through the same pipeline the committed connectors do — esbuild to one CommonJS program, then compiled in the goja runtime that will actually execute it — and anything that fails is rejected and NEVER stored. So a plugin in the store is one this deployment has already loaded once, not one a model claimed was fine. A failed build answers 422 carrying the diagnostics a caller needs to fix it: the bundler's error (detail), the source that failed, and whether the model wrote it. CREDENTIALS ARE NOT PART OF A PLUGIN. A plugin names the connectors provider it needs and reads that credential from ctx.auth at run time, under KMS custody. Source that carries something key-shaped is REFUSED rather than silently persisted — a scrubbed key looks like it worked.
Note: This method returns the HTTP Response.
Parameters:
- BuildRequest buildRequest (required):
Implementation
Future<Response> postToolsPluginsBuildWithHttpInfo(BuildRequest buildRequest,) async {
// ignore: prefer_const_declarations
final path = r'/v1/tools/plugins/build';
// ignore: prefer_final_locals
Object? postBody = buildRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}