@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
635 lines • 39.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AgrSiteClient = void 0;
const zod_1 = require("zod");
const base_client_1 = require("../../core/base-client");
const schemas_1 = require("../../core/schemas");
// Create flexible response schemas using the STANDARD 8-field response format
// All APIs must use this format - no response validation per OpenAPI spec requirements
const UnknownResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.unknown());
const UnknownArrayResponseSchema = (0, schemas_1.BaseResponseSchema)(zod_1.z.array(zod_1.z.unknown()));
const schemas_2 = require("./schemas");
/**
* AGR-Site API Client
* @description Client for interacting with AGR-Site (Augur Site) microservice API endpoints for site content management, AI transcription processing, and search embedding functionality
* @fullPath api.agrSite
* @service agr-site
* @domain site-content-management
* @discoverable true
* @searchTerms ["agr-site", "augur site", "site content", "settings management", "fyxer transcripts", "AI transcription", "opensearch embedding", "content management", "site data"]
* @relatedEndpoints ["api.agrSite.settings", "api.agrSite.fyxerTranscripts", "api.agrSite.openSearch", "api.agrSite.health"]
* @commonPatterns ["Site content management", "AI transcript processing", "Search embedding integration", "Site settings configuration"]
* @workflow ["content-creation", "transcript-processing", "search-optimization", "site-data-management"]
* @functionalArea "site-content-and-ai-processing"
* @businessRules ["Requires valid site authentication", "Transcript processing for business content", "Settings changes affect site-wide behavior"]
* @performance "Supports pagination for large datasets, embedding operations may have latency"
* @example
* ```typescript
* import { HTTPClient } from '@augur/api-client/core';
* import { AgrSiteClient } from '@augur/api-client/services/agr-site';
*
* const http = new HTTPClient('agr-site', { siteId: 'your-site-id', bearerToken: 'your-token' });
* const agrSite = new AgrSiteClient(http);
*
* // Manage site settings
* const settings = await agrSite.settings.list();
* const settingsData = await agrSite.settings.listData();
*
* // Process AI transcripts
* const transcript = await agrSite.fyxerTranscripts.create({
* title: 'Business Meeting Notes',
* content: 'Discussion about project roadmap and priorities...',
* metadata: { tags: ['business', 'planning'] }
* });
*
* // Generate search embeddings
* const embedding = await agrSite.openSearch.getEmbedding({
* text: 'Business strategy discussion for Q1 planning'
* });
* ```
*/
class AgrSiteClient extends base_client_1.BaseServiceClient {
// Ensure schemas are referenced to avoid unused import warnings
get schemaRefs() {
return this._schemaRefs;
}
/**
* Create a new AgrSiteClient instance
* @param http Configured HTTPClient instance with authentication
* @param baseUrl Base URL for the AGR-Site API (default: https://agr-site.augur-api.com)
*/
constructor(http, baseUrl = 'https://agr-site.augur-api.com') {
super('agr-site', http, baseUrl);
// Schema references for 100% coverage - ensuring all exports are imported
this._schemaRefs = {
SettingSchema: schemas_2.SettingSchema,
FyxerTranscriptSchema: schemas_2.FyxerTranscriptSchema,
OpenSearchEmbeddingSchema: schemas_2.OpenSearchEmbeddingSchema,
MetaFilesDataSchema: schemas_2.MetaFilesDataSchema,
};
/**
* Settings Management Operations
* @description Comprehensive settings configuration management for site content and behavior
*/
this.settings = {
/**
* List all configuration settings with optional filtering and pagination
* @description Retrieves all site configuration settings with support for filtering and pagination
* @fullPath api.agrSite.settings.list
* @service agr-site
* @domain site-content-management
* @dataMethod listData - returns only the settings array without metadata
* @discoverable true
* @searchTerms ["settings", "configuration", "site config", "preferences", "site settings", "content settings"]
* @relatedEndpoints ["api.agrSite.settings.get", "api.agrSite.settings.create", "api.agrSite.settings.update", "api.agrSite.settings.delete"]
* @commonPatterns ["Get all settings", "List site configuration", "Retrieve preferences", "Configuration management"]
* @workflow ["settings-management", "site-configuration", "site-setup"]
* @prerequisites ["Valid authentication token", "Settings read permissions"]
* @nextSteps ["api.agrSite.settings.get for details", "api.agrSite.settings.update for modifications"]
* @businessRules ["Returns only settings accessible to current user", "Respects site-level permissions", "Pagination recommended for large config sets"]
* @functionalArea "site-content-and-ai-processing"
* @caching "Cache for 10 minutes, invalidate on settings changes"
* @performance "Supports pagination, use filters for large configuration sets"
* @param params Optional filtering and pagination parameters
* @returns Promise<BaseResponse<unknown[]>> Complete response with settings array and metadata
* @example
* ```typescript
* // Get all settings
* const response = await client.settings.list();
* console.log(response.data); // Settings array
*
* // Get just the data
* const settings = await client.settings.listData();
*
* // Filter settings
* const filtered = await client.settings.list({ category: 'agricultural' });
* ```
*/
list: this.createListMethod('/settings', schemas_2.SettingListParamsSchema, UnknownArrayResponseSchema),
/**
* Get configuration setting details by ID
* @description Retrieves detailed information for a specific configuration setting
* @fullPath api.agrSite.settings.get
* @service agr-site
* @domain site-content-management
* @dataMethod getData - returns only the setting data without metadata
* @discoverable true
* @searchTerms ["setting detail", "configuration detail", "get setting", "retrieve config", "setting info"]
* @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.settings.update", "api.agrSite.settings.delete"]
* @commonPatterns ["Get setting details", "Retrieve configuration", "View setting info"]
* @workflow ["settings-management", "configuration-review"]
* @prerequisites ["Valid authentication token", "Setting read permissions", "Valid setting ID"]
* @nextSteps ["api.agrSite.settings.update to modify", "api.agrSite.settings.delete to remove"]
* @businessRules ["Returns 404 if setting not found", "Respects setting-level permissions"]
* @functionalArea "site-content-and-ai-processing"
* @caching "Cache for 15 minutes, invalidate on setting updates"
* @performance "Direct ID lookup, very fast response"
* @param settingsUid Unique identifier for the setting
* @returns Promise<BaseResponse<unknown>> Complete response with setting details
* @example
* ```typescript
* const setting = await client.settings.get(123);
* const settingData = await client.settings.getData(123);
* ```
*/
get: this.createGetMethod('/settings/{settingsUid}', UnknownResponseSchema),
/**
* Create new configuration setting
* @description Creates a new site configuration setting with specified parameters
* @fullPath api.agrSite.settings.create
* @service agr-site
* @domain site-content-management
* @dataMethod createData - returns only the created setting data without metadata
* @discoverable true
* @searchTerms ["create setting", "new configuration", "add setting", "setting creation", "config setup"]
* @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.settings.get", "api.agrSite.settings.update"]
* @commonPatterns ["Create new setting", "Add configuration", "Setup new preference"]
* @workflow ["settings-management", "site-configuration", "site-setup"]
* @prerequisites ["Valid authentication token", "Settings create permissions", "Valid setting data"]
* @nextSteps ["api.agrSite.settings.get to verify", "api.agrSite.settings.update for modifications"]
* @businessRules ["Setting names must be unique", "Validates setting format", "Creates audit trail"]
* @functionalArea "site-content-and-ai-processing"
* @performance "Synchronous creation with immediate availability"
* @param params Setting creation parameters including name, value, and metadata
* @returns Promise<BaseResponse<unknown>> Complete response with created setting details
* @example
* ```typescript
* const newSetting = await client.settings.create({
* name: 'crop_rotation_interval',
* value: '3',
* category: 'agricultural',
* description: 'Default crop rotation interval in years'
* });
* ```
*/
create: this.createCreateMethod('/settings', schemas_2.SettingCreateParamsSchema, UnknownResponseSchema),
/**
* Update existing configuration setting
* @description Updates an existing site configuration setting with new values
* @fullPath api.agrSite.settings.update
* @service agr-site
* @domain site-content-management
* @dataMethod updateData - returns only the updated setting data without metadata
* @discoverable true
* @searchTerms ["update setting", "modify configuration", "change setting", "edit config", "setting update"]
* @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.settings.get", "api.agrSite.settings.delete"]
* @commonPatterns ["Update setting value", "Modify configuration", "Change preferences"]
* @workflow ["settings-management", "configuration-maintenance"]
* @prerequisites ["Valid authentication token", "Settings update permissions", "Existing setting ID"]
* @nextSteps ["api.agrSite.settings.get to verify changes", "Cache invalidation may be required"]
* @businessRules ["Validates new values", "Maintains setting history", "Updates audit trail"]
* @functionalArea "site-content-and-ai-processing"
* @performance "Synchronous update with immediate effect"
* @param settingsUid Unique identifier for the setting to update
* @param params Updated setting parameters
* @returns Promise<BaseResponse<unknown>> Complete response with updated setting details
* @example
* ```typescript
* const updated = await client.settings.update(123, {
* value: '5',
* description: 'Updated crop rotation interval'
* });
* ```
*/
update: this.createUpdateMethod('/settings/{settingsUid}', schemas_2.SettingUpdateParamsSchema, UnknownResponseSchema),
/**
* Delete configuration setting
* @description Removes a configuration setting from the system
* @fullPath api.agrSite.settings.delete
* @service agr-site
* @domain site-content-management
* @dataMethod deleteData - returns only the deletion result without metadata
* @discoverable true
* @searchTerms ["delete setting", "remove configuration", "delete config", "remove setting"]
* @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.settings.get", "api.agrSite.settings.create"]
* @commonPatterns ["Delete setting", "Remove configuration", "Clean up settings"]
* @workflow ["settings-management", "configuration-cleanup"]
* @prerequisites ["Valid authentication token", "Settings delete permissions", "Existing setting ID"]
* @nextSteps ["Cache invalidation", "Verify setting removal with list operation"]
* @businessRules ["Cannot delete system-critical settings", "Creates deletion audit log", "Irreversible operation"]
* @functionalArea "site-content-and-ai-processing"
* @performance "Immediate deletion with cascading cleanup"
* @param settingsUid Unique identifier for the setting to delete
* @returns Promise<BaseResponse<unknown>> Complete response confirming deletion
* @example
* ```typescript
* const result = await client.settings.delete(123);
* ```
*/
delete: this.createDeleteMethod('/settings/{settingsUid}', UnknownResponseSchema),
// Data-only methods for direct access
/**
* Get settings data without response metadata
* @param params Optional filtering and pagination parameters
* @returns Promise<unknown[]> Settings array directly
*/
listData: async (params) => {
const response = await this.settings.list(params);
return response.data;
},
/**
* Get setting data without response metadata
* @param settingsUid Unique identifier for the setting
* @returns Promise<unknown> Setting data directly
*/
getData: async (settingsUid) => {
const response = await this.settings.get(settingsUid);
return response.data;
},
/**
* Create setting and return data without response metadata
* @param params Setting creation parameters
* @returns Promise<unknown> Created setting data directly
*/
createData: async (params) => {
const response = await this.settings.create(params);
return response.data;
},
/**
* Update setting and return data without response metadata
* @param settingsUid Unique identifier for the setting to update
* @param params Updated setting parameters
* @returns Promise<unknown> Updated setting data directly
*/
updateData: async (settingsUid, params) => {
const response = await this.settings.update(settingsUid, params);
return response.data;
},
/**
* Delete setting and return result without response metadata
* @param settingsUid Unique identifier for the setting to delete
* @returns Promise<unknown> Deletion result directly
*/
deleteData: async (settingsUid) => {
const response = await this.settings.delete(settingsUid);
return response.data;
},
};
/**
* Fyxer Transcript Management Operations
* @description AI-powered transcript processing and management for agricultural content and meeting documentation
*/
this.fyxerTranscripts = {
/**
* List all AI transcripts with optional filtering and pagination
* @description Retrieves all Fyxer AI transcripts with support for filtering by content type, date, and agricultural topics
* @fullPath api.agrSite.fyxerTranscripts.list
* @service agr-site
* @domain site-content-management
* @dataMethod listData - returns only the transcripts array without metadata
* @discoverable true
* @searchTerms ["transcripts", "AI transcripts", "fyxer", "meeting notes", "agricultural transcription", "audio processing", "speech to text"]
* @relatedEndpoints ["api.agrSite.fyxerTranscripts.get", "api.agrSite.fyxerTranscripts.create", "api.agrSite.fyxerTranscripts.update", "api.agrSite.fyxerTranscripts.delete", "api.agrSite.openSearch.getEmbedding"]
* @commonPatterns ["Get all transcripts", "List meeting notes", "Retrieve AI processed content", "Agricultural transcript management"]
* @workflow ["transcript-processing", "content-management", "agricultural-documentation", "ai-processing"]
* @prerequisites ["Valid authentication token", "Transcript read permissions"]
* @nextSteps ["api.agrSite.fyxerTranscripts.get for details", "api.agrSite.openSearch.getEmbedding for search optimization"]
* @businessRules ["Returns only transcripts accessible to current user", "Content filtered by agricultural relevance", "Pagination required for large datasets"]
* @functionalArea "site-content-and-ai-processing"
* @caching "Cache for 5 minutes, invalidate on transcript changes"
* @performance "Supports pagination, use date filters for large transcript collections"
* @param params Optional filtering and pagination parameters
* @returns Promise<BaseResponse<unknown[]>> Complete response with transcripts array and metadata
* @example
* ```typescript
* // Get all transcripts
* const response = await client.fyxerTranscripts.list();
* console.log(response.data); // Transcripts array
*
* // Get just the data
* const transcripts = await client.fyxerTranscripts.listData();
*
* // Filter by date range
* const recent = await client.fyxerTranscripts.list({
* startDate: '2024-01-01',
* endDate: '2024-12-31'
* });
* ```
*/
list: this.createListMethod('/fyxer-transcript', schemas_2.FyxerTranscriptListParamsSchema, UnknownArrayResponseSchema),
/**
* Get AI transcript details by ID
* @description Retrieves detailed information for a specific Fyxer AI transcript including processed content and metadata
* @fullPath api.agrSite.fyxerTranscripts.get
* @service agr-site
* @domain site-content-management
* @dataMethod getData - returns only the transcript data without metadata
* @discoverable true
* @searchTerms ["transcript detail", "AI transcript detail", "fyxer detail", "meeting detail", "transcript content"]
* @relatedEndpoints ["api.agrSite.fyxerTranscripts.list", "api.agrSite.fyxerTranscripts.update", "api.agrSite.fyxerTranscripts.delete", "api.agrSite.openSearch.getEmbedding"]
* @commonPatterns ["Get transcript details", "Retrieve AI processed content", "View meeting notes", "Access transcript data"]
* @workflow ["transcript-processing", "content-review", "agricultural-documentation"]
* @prerequisites ["Valid authentication token", "Transcript read permissions", "Valid transcript ID"]
* @nextSteps ["api.agrSite.fyxerTranscripts.update to modify", "api.agrSite.openSearch.getEmbedding for search indexing"]
* @businessRules ["Returns 404 if transcript not found", "Content may be sanitized for agricultural context", "Respects transcript-level permissions"]
* @functionalArea "site-content-and-ai-processing"
* @caching "Cache for 20 minutes, invalidate on transcript updates"
* @performance "Direct ID lookup with content processing, moderate response time"
* @param fyxerTranscriptHdrUid Unique identifier for the transcript
* @returns Promise<BaseResponse<unknown>> Complete response with transcript details and processed content
* @example
* ```typescript
* const transcript = await client.fyxerTranscripts.get(456);
* const transcriptData = await client.fyxerTranscripts.getData(456);
* ```
*/
get: this.createGetMethod('/fyxer-transcript/{fyxerTranscriptHdrUid}', UnknownResponseSchema),
/**
* Create new AI transcript
* @description Creates a new Fyxer AI transcript with audio processing and agricultural content analysis
* @fullPath api.agrSite.fyxerTranscripts.create
* @service agr-site
* @domain site-content-management
* @dataMethod createData - returns only the created transcript data without metadata
* @discoverable true
* @searchTerms ["create transcript", "new AI transcript", "fyxer creation", "audio processing", "speech to text", "agricultural transcript"]
* @relatedEndpoints ["api.agrSite.fyxerTranscripts.list", "api.agrSite.fyxerTranscripts.get", "api.agrSite.fyxerTranscripts.update", "api.agrSite.openSearch.getEmbedding"]
* @commonPatterns ["Process audio to transcript", "Create meeting notes", "Generate AI transcript", "Agricultural content processing"]
* @workflow ["transcript-processing", "content-creation", "ai-processing", "agricultural-documentation"]
* @prerequisites ["Valid authentication token", "Transcript create permissions", "Valid audio/text data", "Agricultural content validation"]
* @nextSteps ["api.agrSite.fyxerTranscripts.get to verify", "api.agrSite.openSearch.getEmbedding for search optimization"]
* @businessRules ["AI processes content for agricultural relevance", "Creates searchable content index", "Validates audio format and quality"]
* @functionalArea "site-content-and-ai-processing"
* @performance "Asynchronous AI processing, may take 30-60 seconds for large files"
* @param params Transcript creation parameters including audio data, title, and metadata
* @returns Promise<BaseResponse<unknown>> Complete response with created transcript details and processing status
* @example
* ```typescript
* const newTranscript = await client.fyxerTranscripts.create({
* title: 'Farm Planning Meeting - Q1 2024',
* audioUrl: 'https://example.com/meeting-audio.mp3',
* metadata: {
* participants: ['John Doe', 'Jane Smith'],
* topics: ['crop rotation', 'irrigation planning'],
* meetingDate: '2024-01-15'
* }
* });
* ```
*/
create: this.createCreateMethod('/fyxer-transcript', schemas_2.FyxerTranscriptCreateParamsSchema, UnknownResponseSchema),
/**
* Update existing AI transcript
* @description Updates an existing Fyxer AI transcript with new content, metadata, or processing parameters
* @fullPath api.agrSite.fyxerTranscripts.update
* @service agr-site
* @domain site-content-management
* @dataMethod updateData - returns only the updated transcript data without metadata
* @discoverable true
* @searchTerms ["update transcript", "modify AI transcript", "edit fyxer", "transcript update", "content modification"]
* @relatedEndpoints ["api.agrSite.fyxerTranscripts.list", "api.agrSite.fyxerTranscripts.get", "api.agrSite.fyxerTranscripts.delete", "api.agrSite.openSearch.getEmbedding"]
* @commonPatterns ["Update transcript content", "Modify meeting notes", "Edit AI processed content", "Refine agricultural transcript"]
* @workflow ["transcript-processing", "content-maintenance", "agricultural-documentation"]
* @prerequisites ["Valid authentication token", "Transcript update permissions", "Existing transcript ID", "Valid update data"]
* @nextSteps ["api.agrSite.fyxerTranscripts.get to verify changes", "api.agrSite.openSearch.getEmbedding to reindex"]
* @businessRules ["Maintains processing history", "Re-analyzes content for agricultural relevance", "Updates search index automatically"]
* @functionalArea "site-content-and-ai-processing"
* @performance "May trigger AI reprocessing, moderate response time"
* @param fyxerTranscriptHdrUid Unique identifier for the transcript to update
* @param params Updated transcript parameters
* @returns Promise<BaseResponse<unknown>> Complete response with updated transcript details
* @example
* ```typescript
* const updated = await client.fyxerTranscripts.update(456, {
* title: 'Updated Farm Planning Meeting - Q1 2024',
* metadata: {
* status: 'reviewed',
* tags: ['approved', 'implemented']
* }
* });
* ```
*/
update: this.createUpdateMethod('/fyxer-transcript/{fyxerTranscriptHdrUid}', schemas_2.FyxerTranscriptUpdateParamsSchema, UnknownResponseSchema),
/**
* Delete AI transcript
* @description Removes a Fyxer AI transcript and all associated processed content from the system
* @fullPath api.agrSite.fyxerTranscripts.delete
* @service agr-site
* @domain site-content-management
* @dataMethod deleteData - returns only the deletion result without metadata
* @discoverable true
* @searchTerms ["delete transcript", "remove AI transcript", "delete fyxer", "remove transcript", "transcript cleanup"]
* @relatedEndpoints ["api.agrSite.fyxerTranscripts.list", "api.agrSite.fyxerTranscripts.get", "api.agrSite.fyxerTranscripts.create"]
* @commonPatterns ["Delete transcript", "Remove meeting notes", "Clean up AI content", "Purge transcript data"]
* @workflow ["transcript-processing", "content-cleanup", "data-management"]
* @prerequisites ["Valid authentication token", "Transcript delete permissions", "Existing transcript ID"]
* @nextSteps ["Search index cleanup", "Verify transcript removal with list operation"]
* @businessRules ["Removes all associated files and embeddings", "Creates deletion audit log", "Irreversible operation"]
* @functionalArea "site-content-and-ai-processing"
* @performance "Cascading deletion with search index cleanup, may take several seconds"
* @param fyxerTranscriptHdrUid Unique identifier for the transcript to delete
* @returns Promise<BaseResponse<unknown>> Complete response confirming deletion and cleanup status
* @example
* ```typescript
* const result = await client.fyxerTranscripts.delete(456);
* ```
*/
delete: this.createDeleteMethod('/fyxer-transcript/{fyxerTranscriptHdrUid}', UnknownResponseSchema),
// Data-only methods for direct access
/**
* Get transcripts data without response metadata
* @param params Optional filtering and pagination parameters
* @returns Promise<unknown[]> Transcripts array directly
*/
listData: async (params) => {
const response = await this.fyxerTranscripts.list(params);
return response.data;
},
/**
* Get transcript data without response metadata
* @param fyxerTranscriptHdrUid Unique identifier for the transcript
* @returns Promise<unknown> Transcript data directly
*/
getData: async (fyxerTranscriptHdrUid) => {
const response = await this.fyxerTranscripts.get(fyxerTranscriptHdrUid);
return response.data;
},
/**
* Create transcript and return data without response metadata
* @param params Transcript creation parameters
* @returns Promise<unknown> Created transcript data directly
*/
createData: async (params) => {
const response = await this.fyxerTranscripts.create(params);
return response.data;
},
/**
* Update transcript and return data without response metadata
* @param fyxerTranscriptHdrUid Unique identifier for the transcript to update
* @param params Updated transcript parameters
* @returns Promise<unknown> Updated transcript data directly
*/
updateData: async (fyxerTranscriptHdrUid, params) => {
const response = await this.fyxerTranscripts.update(fyxerTranscriptHdrUid, params);
return response.data;
},
/**
* Delete transcript and return result without response metadata
* @param fyxerTranscriptHdrUid Unique identifier for the transcript to delete
* @returns Promise<unknown> Deletion result directly
*/
deleteData: async (fyxerTranscriptHdrUid) => {
const response = await this.fyxerTranscripts.delete(fyxerTranscriptHdrUid);
return response.data;
},
};
/**
* OpenSearch Integration Operations
* @description Advanced search embedding and indexing functionality for agricultural content discovery
*/
this.openSearch = {
/**
* Generate text embedding for search optimization
* @description Creates vector embeddings for agricultural content to enable semantic search and content discovery
* @fullPath api.agrSite.openSearch.getEmbedding
* @service agr-site
* @domain search-optimization
* @dataMethod getEmbeddingData - returns only the embedding data without metadata
* @discoverable true
* @searchTerms ["embedding", "vector search", "semantic search", "text embedding", "opensearch", "search optimization", "content indexing"]
* @relatedEndpoints ["api.agrSite.fyxerTranscripts.create", "api.agrSite.fyxerTranscripts.update", "api.agrSite.settings.list"]
* @commonPatterns ["Generate content embeddings", "Optimize search index", "Create semantic vectors", "Agricultural content analysis"]
* @workflow ["search-optimization", "content-indexing", "ai-processing", "agricultural-content-analysis"]
* @prerequisites ["Valid authentication token", "Search integration permissions", "Valid text content"]
* @nextSteps ["Index embeddings in search system", "Use embeddings for content discovery"]
* @businessRules ["Optimizes embeddings for agricultural content", "Rate limited for large-scale operations", "Content filtered for relevance"]
* @functionalArea "site-content-and-ai-processing"
* @caching "Embeddings cached for 24 hours, invalidate on content changes"
* @performance "AI processing may take 2-5 seconds depending on content length"
* @param params Text content and embedding configuration parameters
* @returns Promise<BaseResponse<unknown>> Complete response with generated embedding vectors and metadata
* @example
* ```typescript
* const embedding = await client.openSearch.getEmbedding({
* text: 'Sustainable farming practices for crop rotation and soil health',
* model: 'agricultural-optimized',
* dimensions: 384
* });
*
* // Get just the embedding data
* const embeddingData = await client.openSearch.getEmbeddingData({
* text: 'Organic farming techniques for sustainable agriculture'
* });
* ```
*/
getEmbedding: async (params) => {
return this.executeRequest({
method: 'GET',
path: '/open-search/embedding',
paramsSchema: schemas_2.OpenSearchEmbeddingParamsSchema,
responseSchema: UnknownResponseSchema,
}, params);
},
/**
* Get embedding data without response metadata
* @param params Text content and embedding configuration parameters
* @returns Promise<unknown> Embedding data directly
*/
getEmbeddingData: async (params) => {
const response = await this.openSearch.getEmbedding(params);
return response.data;
},
};
/**
* Meta Files Operations
* @description Site metadata and SEO file management for agricultural content discovery
*/
this.metaFiles = {
/**
* Get robots.txt configuration for search engine crawling
* @description Retrieves the robots.txt file configuration for controlling search engine access to agricultural content
* @fullPath api.agrSite.metaFiles.getRobots
* @service agr-site
* @domain seo-management
* @dataMethod getRobotsData - returns only the robots.txt content without metadata
* @discoverable true
* @searchTerms ["robots.txt", "SEO", "search engine optimization", "crawler configuration", "site meta", "web crawling"]
* @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.fyxerTranscripts.list"]
* @commonPatterns ["Get SEO configuration", "Retrieve crawler rules", "Access robots.txt", "Site metadata management"]
* @workflow ["seo-management", "site-configuration", "search-optimization"]
* @prerequisites ["Valid authentication token", "Meta files access permissions"]
* @nextSteps ["Configure SEO settings", "Update crawler permissions"]
* @businessRules ["Controls agricultural content visibility", "Respects SEO best practices", "Configurable per site"]
* @functionalArea "site-content-and-ai-processing"
* @caching "Cache for 1 hour, invalidate on SEO configuration changes"
* @performance "Static file retrieval, very fast response"
* @returns Promise<BaseResponse<unknown>> Complete response with robots.txt content and configuration
* @example
* ```typescript
* const robotsConfig = await client.metaFiles.getRobots();
* const robotsData = await client.metaFiles.getRobotsData();
* ```
*/
getRobots: async () => {
return this.executeRequest({
method: 'GET',
path: '/meta-files/robots',
responseSchema: UnknownResponseSchema,
}, undefined);
},
/**
* Get robots.txt data without response metadata
* @returns Promise<unknown> Robots.txt content directly
*/
getRobotsData: async () => {
const response = await this.metaFiles.getRobots();
return response.data;
},
};
/**
* Health monitoring endpoint
* @description Service health check endpoint that validates AGR-Site API availability and operational status
* @fullPath api.agrSite.health.check
* @service agr-site
* @domain service-monitoring
* @dataMethod getHealthCheckData - returns only the health status data without metadata
* @discoverable true
* @searchTerms ["health check", "service status", "API health", "monitoring", "uptime", "service availability"]
* @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.fyxerTranscripts.list", "api.agrSite.openSearch.getEmbedding"]
* @commonPatterns ["Check service health", "Monitor API status", "Validate service availability", "Health monitoring"]
* @workflow ["service-monitoring", "health-checks", "system-diagnostics"]
* @prerequisites ["Network connectivity to AGR-Site service"]
* @nextSteps ["Service-specific operations if healthy", "Error handling if unhealthy"]
* @businessRules ["No authentication required", "Returns standardized health status", "Includes dependency checks"]
* @functionalArea "service-monitoring"
* @caching "No caching for real-time health status"
* @performance "Fast response for monitoring systems, typically <100ms"
* @returns Promise<BaseResponse<unknown>> Complete response with health status and service diagnostics
* @example
* ```typescript
* const health = await client.getHealthCheck();
* const healthData = await client.getHealthCheckData();
*
* if (health.success) {
* console.log('AGR-Site service is healthy');
* }
* ```
*/
this.getHealthCheck = this.createHealthCheckMethod(schemas_2.HealthCheckResponseSchema);
/**
* Get health check data without response metadata
* @returns Promise<unknown> Health status data directly
*/
this.getHealthCheckData = async () => {
const response = await this.getHealthCheck();
return response.data;
};
/**
* Health Data Operations
* @description Direct access to health check data without response metadata
*/
this.healthData = {
/**
* Get health check data without response metadata
* @returns Promise<unknown> Health status data directly
*/
check: async () => {
const response = await this.getHealthCheck();
return response.data;
},
};
// Reference schemas to ensure 100% import coverage
void this.schemaRefs;
}
}
exports.AgrSiteClient = AgrSiteClient;
//# sourceMappingURL=client.js.map