Skip to content

The platform for continuously improving AI agents.

11.5 KB
Raw Blame
/* tslint:disable */
/* eslint-disable */
/**
 * Overbae API
 * Backend API for the Overclaw / Overmind platform.
 *
 * The version of the OpenAPI document: 2.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import * as runtime from '../runtime';
import type {
  ContextCaptureRequest,
  ContextPage,
  ContextSnapshot,
  ContextSummary,
} from '../models/index';
import {
    ContextCaptureRequestFromJSON,
    ContextCaptureRequestToJSON,
    ContextPageFromJSON,
    ContextPageToJSON,
    ContextSnapshotFromJSON,
    ContextSnapshotToJSON,
    ContextSummaryFromJSON,
    ContextSummaryToJSON,
} from '../models/index';

export interface ContextGraphsCaptureCreateRequest {
    id: string;
    contextCaptureRequest: ContextCaptureRequest;
}

export interface ContextGraphsNodesRetrieveRequest {
    id: string;
    kind?: string;
    limit?: number;
    offset?: number;
    purpose?: ContextGraphsNodesRetrievePurposeEnum;
    query?: string;
    roots?: Array<string>;
}

export interface ContextGraphsRefreshCreateRequest {
    id: string;
}

export interface ContextGraphsRetrieveRequest {
    id: string;
}

/**
 *
 */
export class ContextGraphsApi extends runtime.BaseAPI {

    /**
     */
    async contextGraphsCaptureCreateRaw(requestParameters: ContextGraphsCaptureCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContextSnapshot>> {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError(
                'id',
                'Required parameter "id" was null or undefined when calling contextGraphsCaptureCreate().'
            );
        }

        if (requestParameters['contextCaptureRequest'] == null) {
            throw new runtime.RequiredError(
                'contextCaptureRequest',
                'Required parameter "contextCaptureRequest" was null or undefined when calling contextGraphsCaptureCreate().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("ClerkBearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        if (this.configuration && this.configuration.apiKey) {
            headerParameters["X-Api-Key"] = await this.configuration.apiKey("X-Api-Key"); // ApiKeyAuth authentication
        }

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/context-graphs/{id}/capture/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));

        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ContextCaptureRequestToJSON(requestParameters['contextCaptureRequest']),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ContextSnapshotFromJSON(jsonValue));
    }

    /**
     */
    async contextGraphsCaptureCreate(requestParameters: ContextGraphsCaptureCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContextSnapshot> {
        const response = await this.contextGraphsCaptureCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async contextGraphsNodesRetrieveRaw(requestParameters: ContextGraphsNodesRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContextPage>> {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError(
                'id',
                'Required parameter "id" was null or undefined when calling contextGraphsNodesRetrieve().'
            );
        }

        const queryParameters: any = {};

        if (requestParameters['kind'] != null) {
            queryParameters['kind'] = requestParameters['kind'];
        }

        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }

        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }

        if (requestParameters['purpose'] != null) {
            queryParameters['purpose'] = requestParameters['purpose'];
        }

        if (requestParameters['query'] != null) {
            queryParameters['query'] = requestParameters['query'];
        }

        if (requestParameters['roots'] != null) {
            queryParameters['roots'] = requestParameters['roots'];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("ClerkBearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        if (this.configuration && this.configuration.apiKey) {
            headerParameters["X-Api-Key"] = await this.configuration.apiKey("X-Api-Key"); // ApiKeyAuth authentication
        }

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/context-graphs/{id}/nodes/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ContextPageFromJSON(jsonValue));
    }

    /**
     */
    async contextGraphsNodesRetrieve(requestParameters: ContextGraphsNodesRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContextPage> {
        const response = await this.contextGraphsNodesRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async contextGraphsRefreshCreateRaw(requestParameters: ContextGraphsRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContextSummary>> {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError(
                'id',
                'Required parameter "id" was null or undefined when calling contextGraphsRefreshCreate().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("ClerkBearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        if (this.configuration && this.configuration.apiKey) {
            headerParameters["X-Api-Key"] = await this.configuration.apiKey("X-Api-Key"); // ApiKeyAuth authentication
        }

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/context-graphs/{id}/refresh/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));

        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ContextSummaryFromJSON(jsonValue));
    }

    /**
     */
    async contextGraphsRefreshCreate(requestParameters: ContextGraphsRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContextSummary> {
        const response = await this.contextGraphsRefreshCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async contextGraphsRetrieveRaw(requestParameters: ContextGraphsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContextSummary>> {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError(
                'id',
                'Required parameter "id" was null or undefined when calling contextGraphsRetrieve().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("ClerkBearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        if (this.configuration && this.configuration.apiKey) {
            headerParameters["X-Api-Key"] = await this.configuration.apiKey("X-Api-Key"); // ApiKeyAuth authentication
        }

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerAuth", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/context-graphs/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ContextSummaryFromJSON(jsonValue));
    }

    /**
     */
    async contextGraphsRetrieve(requestParameters: ContextGraphsRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContextSummary> {
        const response = await this.contextGraphsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

}

/**
 * @export
 */
export const ContextGraphsNodesRetrievePurposeEnum = {
    inspection: 'inspection',
    training: 'training',
    workshop: 'workshop'
} as const;
export type ContextGraphsNodesRetrievePurposeEnum = typeof ContextGraphsNodesRetrievePurposeEnum[keyof typeof ContextGraphsNodesRetrievePurposeEnum];