UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

68 lines 3.61 kB
import type { BaseResponse } from '../../../core/base-client'; import { type NotificationCreateParams } from '../schemas'; import type { AgrSiteClient } from '../client'; type ExecuteRequest = AgrSiteClient['executeRequest']; /** * Creates the notifications resource methods * OpenAPI Path: /notifications → notifications.* * @description Create and manage system notifications for agricultural content and site events */ export declare function createNotificationsResource(executeRequest: ExecuteRequest): { /** * Create new notification * @description Creates a new system notification for agricultural events, alerts, or content updates * @fullPath api.agrSite.notifications.create * @service agr-site * @domain notification-management * @dataMethod notificationsData.create - returns only the created notification data without metadata * @discoverable true * @searchTerms ["notifications", "alerts", "system notifications", "agricultural alerts", "content notifications", "site alerts"] * @relatedEndpoints ["api.agrSite.settings.list", "api.agrSite.fyxerTranscript.create", "api.agrSite.openSearch.embedding.get"] * @commonPatterns ["Create notification", "Send alert", "System notification", "Agricultural event notification"] * @workflow ["notification-management", "alert-processing", "content-notifications", "agricultural-alerts"] * @prerequisites ["Valid authentication token", "Notification create permissions", "Valid notification data"] * @nextSteps ["Process notification delivery", "Track notification status"] * @businessRules ["Agricultural content notifications prioritized", "Rate limited for spam prevention", "Content filtered for relevance"] * @functionalArea "site-content-and-ai-processing" * @caching "No caching - immediate notification creation" * @performance "Fast notification creation with asynchronous delivery" * @param params Notification creation parameters including content, recipients, and metadata * @returns Promise<BaseResponse<unknown>> Complete response with created notification details and delivery status * @example * ```typescript * const notification = await client.notifications.create({ * title: 'Crop Update Alert', * message: 'New agricultural data available for your region', * type: 'agricultural_update', * priority: 'high', * metadata: { * region: 'midwest', * crop_type: 'corn', * season: 'spring_2024' * } * }); * * // Get just the notification data * const notificationData = await client.notificationsData.create({ * title: 'Weather Alert', * message: 'Severe weather warning for your farming area' * }); * ``` */ create: (params: NotificationCreateParams) => Promise<BaseResponse<unknown>>; }; /** * Creates the notificationsData resource methods (data-only versions) */ export declare function createNotificationsDataResource(notifications: ReturnType<typeof createNotificationsResource>): { /** * Create notification and return data without response metadata * @param params Notification creation parameters * @returns Promise<unknown> Created notification data directly */ create: (params: NotificationCreateParams) => Promise<unknown>; }; export type NotificationsResource = ReturnType<typeof createNotificationsResource>; export type NotificationsDataResource = ReturnType<typeof createNotificationsDataResource>; export {}; //# sourceMappingURL=notifications.d.ts.map