import { WorkspaceScopedResource, extractData } from './base.js';
/**
 * Workspace data queries — register, list, update, and invoke Lakebase-backed
 * workspace query tools.
 */
export class WorkspaceDataQueriesResource extends WorkspaceScopedResource {
    async list() {
        return extractData(await this.client.GET('/v1/{workspace_id}/data_queries', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    async create(body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/data_queries', {
            params: { path: { workspace_id: this.workspaceId } },
            body,
        }));
    }
    async get(queryId) {
        return extractData(await this.client.GET('/v1/{workspace_id}/data_queries/{query_id}', {
            params: { path: { workspace_id: this.workspaceId, query_id: queryId } },
        }));
    }
    async update(queryId, body) {
        return extractData(await this.client.PATCH('/v1/{workspace_id}/data_queries/{query_id}', {
            params: { path: { workspace_id: this.workspaceId, query_id: queryId } },
            body,
        }));
    }
    async delete(queryId) {
        await this.client.DELETE('/v1/{workspace_id}/data_queries/{query_id}', {
            params: { path: { workspace_id: this.workspaceId, query_id: queryId } },
        });
    }
    async invoke(queryId, body = {}) {
        return extractData(await this.client.POST('/v1/{workspace_id}/data_queries/{query_id}/invoke', {
            params: { path: { workspace_id: this.workspaceId, query_id: queryId } },
            body,
        }));
    }
}
//# sourceMappingURL=workspace-data-queries.js.map