@vfarcic/dot-ai
Version:
AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance
363 lines • 13 kB
TypeScript
/**
* Resource Endpoint Schemas
*
* Schemas for resource-related endpoints:
* - GET /api/v1/resources/kinds
* - GET /api/v1/resources/search
* - GET /api/v1/resources (list)
* - GET /api/v1/resource (single)
* - POST /api/v1/resources/sync
* - GET /api/v1/namespaces
*
* PRD #354: REST API Route Registry with Auto-Generated OpenAPI and Test Fixtures
* PRD #328: Resource endpoints for UI
*/
import { z } from 'zod';
/**
* Resource kind with count
*/
export declare const ResourceKindSchema: z.ZodObject<{
kind: z.ZodString;
apiVersion: z.ZodString;
count: z.ZodNumber;
apiGroup: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ResourceKind = z.infer<typeof ResourceKindSchema>;
/**
* Resource kinds response data
* GET /api/v1/resources/kinds
*/
export declare const ResourceKindsDataSchema: z.ZodObject<{
kinds: z.ZodArray<z.ZodObject<{
kind: z.ZodString;
apiVersion: z.ZodString;
count: z.ZodNumber;
apiGroup: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type ResourceKindsData = z.infer<typeof ResourceKindsDataSchema>;
export declare const ResourceKindsResponseSchema: z.ZodObject<{
success: z.ZodLiteral<true>;
data: z.ZodObject<{
kinds: z.ZodArray<z.ZodObject<{
kind: z.ZodString;
apiVersion: z.ZodString;
count: z.ZodNumber;
apiGroup: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
export type ResourceKindsResponse = z.infer<typeof ResourceKindsResponseSchema>;
/**
* Resource summary for list/search results
*/
export declare const ResourceSummarySchema: z.ZodObject<{
name: z.ZodString;
namespace: z.ZodOptional<z.ZodString>;
kind: z.ZodString;
apiVersion: z.ZodString;
apiGroup: z.ZodOptional<z.ZodString>;
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
createdAt: z.ZodOptional<z.ZodString>;
score: z.ZodOptional<z.ZodNumber>;
status: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
export type ResourceSummary = z.infer<typeof ResourceSummarySchema>;
/**
* Resource search response data
* GET /api/v1/resources/search
*/
export declare const ResourceSearchDataSchema: z.ZodObject<{
resources: z.ZodArray<z.ZodObject<{
name: z.ZodString;
namespace: z.ZodOptional<z.ZodString>;
kind: z.ZodString;
apiVersion: z.ZodString;
apiGroup: z.ZodOptional<z.ZodString>;
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
createdAt: z.ZodOptional<z.ZodString>;
score: z.ZodOptional<z.ZodNumber>;
status: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>>;
total: z.ZodNumber;
limit: z.ZodNumber;
offset: z.ZodNumber;
}, z.core.$strip>;
export type ResourceSearchData = z.infer<typeof ResourceSearchDataSchema>;
export declare const ResourceSearchResponseSchema: z.ZodObject<{
success: z.ZodLiteral<true>;
data: z.ZodObject<{
resources: z.ZodArray<z.ZodObject<{
name: z.ZodString;
namespace: z.ZodOptional<z.ZodString>;
kind: z.ZodString;
apiVersion: z.ZodString;
apiGroup: z.ZodOptional<z.ZodString>;
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
createdAt: z.ZodOptional<z.ZodString>;
score: z.ZodOptional<z.ZodNumber>;
status: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>>;
total: z.ZodNumber;
limit: z.ZodNumber;
offset: z.ZodNumber;
}, z.core.$strip>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
export type ResourceSearchResponse = z.infer<typeof ResourceSearchResponseSchema>;
/**
* Resource list response data
* GET /api/v1/resources
*/
export declare const ResourceListDataSchema: z.ZodObject<{
resources: z.ZodArray<z.ZodObject<{
name: z.ZodString;
namespace: z.ZodOptional<z.ZodString>;
kind: z.ZodString;
apiVersion: z.ZodString;
apiGroup: z.ZodOptional<z.ZodString>;
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
createdAt: z.ZodOptional<z.ZodString>;
score: z.ZodOptional<z.ZodNumber>;
status: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>>;
total: z.ZodNumber;
limit: z.ZodOptional<z.ZodNumber>;
offset: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type ResourceListData = z.infer<typeof ResourceListDataSchema>;
export declare const ResourceListResponseSchema: z.ZodObject<{
success: z.ZodLiteral<true>;
data: z.ZodObject<{
resources: z.ZodArray<z.ZodObject<{
name: z.ZodString;
namespace: z.ZodOptional<z.ZodString>;
kind: z.ZodString;
apiVersion: z.ZodString;
apiGroup: z.ZodOptional<z.ZodString>;
labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
createdAt: z.ZodOptional<z.ZodString>;
score: z.ZodOptional<z.ZodNumber>;
status: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>>;
total: z.ZodNumber;
limit: z.ZodOptional<z.ZodNumber>;
offset: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
export type ResourceListResponse = z.infer<typeof ResourceListResponseSchema>;
/**
* Single resource response data
* GET /api/v1/resource
*/
export declare const SingleResourceDataSchema: z.ZodObject<{
resource: z.ZodRecord<z.ZodString, z.ZodAny>;
}, z.core.$strip>;
export type SingleResourceData = z.infer<typeof SingleResourceDataSchema>;
export declare const SingleResourceResponseSchema: z.ZodObject<{
success: z.ZodLiteral<true>;
data: z.ZodObject<{
resource: z.ZodRecord<z.ZodString, z.ZodAny>;
}, z.core.$strip>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
export type SingleResourceResponse = z.infer<typeof SingleResourceResponseSchema>;
/**
* Namespaces response data
* GET /api/v1/namespaces
*/
export declare const NamespacesDataSchema: z.ZodObject<{
namespaces: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
export type NamespacesData = z.infer<typeof NamespacesDataSchema>;
export declare const NamespacesResponseSchema: z.ZodObject<{
success: z.ZodLiteral<true>;
data: z.ZodObject<{
namespaces: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
export type NamespacesResponse = z.infer<typeof NamespacesResponseSchema>;
/**
* Resource sync request body
* POST /api/v1/resources/sync
*/
export declare const ResourceSyncRequestSchema: z.ZodObject<{
upserts: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>;
deletes: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>;
isResync: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export type ResourceSyncRequest = z.infer<typeof ResourceSyncRequestSchema>;
/**
* Resource sync response data
*/
export declare const ResourceSyncDataSchema: z.ZodObject<{
upserted: z.ZodOptional<z.ZodNumber>;
deleted: z.ZodOptional<z.ZodNumber>;
healthy: z.ZodOptional<z.ZodBoolean>;
message: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
export type ResourceSyncData = z.infer<typeof ResourceSyncDataSchema>;
export declare const ResourceSyncResponseSchema: z.ZodObject<{
success: z.ZodLiteral<true>;
data: z.ZodObject<{
upserted: z.ZodOptional<z.ZodNumber>;
deleted: z.ZodOptional<z.ZodNumber>;
healthy: z.ZodOptional<z.ZodBoolean>;
message: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
}, z.core.$strip>;
export type ResourceSyncResponse = z.infer<typeof ResourceSyncResponseSchema>;
/**
* Resource endpoint error schemas
*/
export declare const ResourceNotFoundErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"NOT_FOUND">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const ResourceBadRequestErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodEnum<{
BAD_REQUEST: "BAD_REQUEST";
MISSING_PARAMETER: "MISSING_PARAMETER";
INVALID_PARAMETER: "INVALID_PARAMETER";
VALIDATION_ERROR: "VALIDATION_ERROR";
}>;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const ResourcePluginUnavailableErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"PLUGIN_UNAVAILABLE">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const ResourceKindsErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"RESOURCE_KINDS_ERROR">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const ResourceSearchErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"SEARCH_ERROR">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const ResourceListErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"LIST_RESOURCES_ERROR">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const SingleResourceErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"RESOURCE_ERROR">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const NamespacesErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"NAMESPACES_ERROR">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const ResourceSyncErrorSchema: z.ZodObject<{
success: z.ZodLiteral<false>;
meta: z.ZodOptional<z.ZodObject<{
timestamp: z.ZodString;
requestId: z.ZodOptional<z.ZodString>;
version: z.ZodString;
}, z.core.$strip>>;
error: z.ZodObject<{
code: z.ZodLiteral<"SYNC_ERROR">;
message: z.ZodString;
details: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
}, z.core.$strip>;
//# sourceMappingURL=resources.d.ts.map