@burdenoff/microfe-healthybowl 2026.810.2 → 2026.810.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/hooks/useDiseaseWarning.js +1 -1
- package/dist/healthybowl/hooks/useDiseaseWarning.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlData.js +518 -489
- package/dist/healthybowl/hooks/useHealthyBowlData.js.map +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlSustainability.js +1 -1
- package/dist/healthybowl/hooks/useHealthyBowlSustainability.js.map +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js +1 -1
- package/dist/healthybowl/hooks/useWeatherIntelligence.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +219 -302
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +450 -399
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +552 -496
- package/dist/healthybowl/pages/network/MentorsPage.js.map +1 -1
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +129 -107
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js.map +1 -1
- package/dist/healthybowl/pages/sustainability/GenerateCreditWizardPage.js +294 -187
- package/dist/healthybowl/pages/sustainability/GenerateCreditWizardPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js +7 -1
- package/dist/healthybowl/pages/weather/WeatherAlertHistoryPage.js.map +1 -1
- package/dist/healthybowl/pages/weather/WeatherAlertRulesPage.js +445 -291
- package/dist/healthybowl/pages/weather/WeatherAlertRulesPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { useCallback as t } from "react";
|
|
|
3
3
|
import { gql as n } from "@apollo/client";
|
|
4
4
|
import { useMutation as r, useQuery as i } from "@apollo/client/react";
|
|
5
5
|
//#region src/healthybowl/hooks/useDiseaseWarning.ts
|
|
6
|
-
var a = "\n id\n name\n alertType\n metric\n operator\n threshold\n unit\n appliesToCrops\n evaluateUsing\n notifyInApp\n advisoryMessage\n status\n workflowKey\n lastRunId\n lastEvaluatedAt\n lastTriggeredAt\n lastOutcome\n", o = n`
|
|
6
|
+
var a = "\n id\n name\n alertType\n metric\n operator\n threshold\n unit\n logicalOperator\n conditions {\n \n id\n ruleId\n metric\n operator\n threshold\n thresholdMax\n unit\n durationHours\n consecutiveDays\n sortOrder\n\n }\n appliesToCrops\n evaluateUsing\n notifyInApp\n advisoryMessage\n status\n workflowKey\n lastRunId\n lastEvaluatedAt\n lastTriggeredAt\n lastOutcome\n", o = n`
|
|
7
7
|
query HealthyBowlDiseaseWarningRules($context: ContextInput!) {
|
|
8
8
|
healthyBowlDiseaseWarningRules(context: $context) {
|
|
9
9
|
${a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDiseaseWarning.js","names":[],"sources":["../../../src/healthybowl/hooks/useDiseaseWarning.ts"],"sourcesContent":["/**\n * Disease Early-Warning data hook — FluidGrids-backed weather alert rules\n * (roadmap #20, DEWS).\n *\n * Mirrors the raw-gql pattern used by `useIrrigationAutomation` (and Suppliers /\n * Nursery): the offline codegen doesn't type the DiseaseWarningRule operations,\n * so these are hand-written `gql` documents executed directly against the live\n * gateway. Every op carries the workspace `context`.\n * @module healthybowl\n */\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\n\n/** A FluidGrids-backed early-warning alert rule (frost / storm / heat / disease). */\nexport interface DiseaseWarningRule {\n id: string;\n /** Human-readable rule name. */\n name: string;\n /** Alert category: FROST | STORM | HEAT | DISEASE. */\n alertType: string;\n /**
|
|
1
|
+
{"version":3,"file":"useDiseaseWarning.js","names":[],"sources":["../../../src/healthybowl/hooks/useDiseaseWarning.ts"],"sourcesContent":["/**\n * Disease Early-Warning data hook — FluidGrids-backed weather alert rules\n * (roadmap #20, DEWS).\n *\n * Mirrors the raw-gql pattern used by `useIrrigationAutomation` (and Suppliers /\n * Nursery): the offline codegen doesn't type the DiseaseWarningRule operations,\n * so these are hand-written `gql` documents executed directly against the live\n * gateway. Every op carries the workspace `context`.\n * @module healthybowl\n */\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\n\n/** A single metric + threshold + duration condition within a rule. */\nexport interface DiseaseWarningRuleCondition {\n id?: string | null;\n metric: string;\n operator: 'above' | 'below' | 'between';\n threshold: number;\n thresholdMax?: number | null;\n unit?: string | null;\n durationHours?: number | null;\n consecutiveDays?: number | null;\n sortOrder?: number | null;\n}\n\n/** A FluidGrids-backed early-warning alert rule (frost / storm / heat / disease). */\nexport interface DiseaseWarningRule {\n id: string;\n /** Human-readable rule name. */\n name: string;\n /** Alert category: FROST | STORM | HEAT | DISEASE. */\n alertType: string;\n /** Legacy single-condition metric (kept for backward compatibility). */\n metric: string;\n /** Legacy single-condition operator (kept for backward compatibility). */\n operator: string;\n /** Legacy single-condition threshold (kept for backward compatibility). */\n threshold: number;\n /** Legacy single-condition unit (kept for backward compatibility). */\n unit?: string | null;\n /** How multiple conditions are combined: AND | OR. */\n logicalOperator: string;\n /** Metric/threshold conditions that make up this rule. */\n conditions: DiseaseWarningRuleCondition[];\n /** Crop names the rule applies to (empty = all crops). */\n appliesToCrops?: string[] | null;\n /** Data source the rule evaluates against: forecast | live. */\n evaluateUsing?: string | null;\n /** When true, fires an in-app notification when the rule triggers. */\n notifyInApp?: boolean | null;\n /** Optional advisory message surfaced to the farmer on trigger. */\n advisoryMessage?: string | null;\n /** Lifecycle status: active / paused. */\n status: string;\n /** FluidGrids workflow key; null until the workflow is provisioned. */\n workflowKey?: string | null;\n /** WorkflowRun id of the most recent run, if any. */\n lastRunId?: string | null;\n /** ISO-8601 timestamp of the last evaluation, if any. */\n lastEvaluatedAt?: string | null;\n /** ISO-8601 timestamp of the last time the rule actually triggered. */\n lastTriggeredAt?: string | null;\n /** Outcome summary of the last evaluation (e.g. triggered / clear). */\n lastOutcome?: string | null;\n}\n\n/** Editable fields for a single condition on create/update. */\nexport interface DiseaseWarningRuleConditionInput {\n id?: string | null;\n metric: string;\n operator: 'above' | 'below' | 'between';\n threshold: number;\n thresholdMax?: number | null;\n unit?: string | null;\n durationHours?: number | null;\n consecutiveDays?: number | null;\n sortOrder?: number | null;\n}\n\n/** Editable fields for rule create (context is attached from the hook). */\nexport interface CreateDiseaseWarningRuleInput {\n name: string;\n alertType: string;\n logicalOperator: 'AND' | 'OR';\n conditions: DiseaseWarningRuleConditionInput[];\n unit?: string | null;\n appliesToCrops?: string[] | null;\n evaluateUsing?: string | null;\n notifyInApp?: boolean | null;\n advisoryMessage?: string | null;\n status?: string | null;\n}\n\n/** Editable fields for rule update (context is attached from the hook). */\nexport interface UpdateDiseaseWarningRuleInput {\n name?: string | null;\n alertType?: string | null;\n logicalOperator: 'AND' | 'OR';\n conditions: DiseaseWarningRuleConditionInput[];\n unit?: string | null;\n appliesToCrops?: string[] | null;\n evaluateUsing?: string | null;\n notifyInApp?: boolean | null;\n advisoryMessage?: string | null;\n status?: string | null;\n}\n\nconst DISEASE_WARNING_RULE_CONDITION_FIELDS = `\n id\n ruleId\n metric\n operator\n threshold\n thresholdMax\n unit\n durationHours\n consecutiveDays\n sortOrder\n`;\n\nconst DISEASE_WARNING_RULE_FIELDS = `\n id\n name\n alertType\n metric\n operator\n threshold\n unit\n logicalOperator\n conditions {\n ${DISEASE_WARNING_RULE_CONDITION_FIELDS}\n }\n appliesToCrops\n evaluateUsing\n notifyInApp\n advisoryMessage\n status\n workflowKey\n lastRunId\n lastEvaluatedAt\n lastTriggeredAt\n lastOutcome\n`;\n\nconst DISEASE_WARNING_RULES_QUERY = gql`\n query HealthyBowlDiseaseWarningRules($context: ContextInput!) {\n healthyBowlDiseaseWarningRules(context: $context) {\n ${DISEASE_WARNING_RULE_FIELDS}\n }\n }\n`;\n\nconst CREATE_DISEASE_WARNING_RULE = gql`\n mutation CreateHealthyBowlDiseaseWarningRule($input: CreateHealthyBowlDiseaseWarningRuleInput!) {\n createHealthyBowlDiseaseWarningRule(input: $input) {\n ${DISEASE_WARNING_RULE_FIELDS}\n }\n }\n`;\n\nconst UPDATE_DISEASE_WARNING_RULE = gql`\n mutation UpdateHealthyBowlDiseaseWarningRule($input: UpdateHealthyBowlDiseaseWarningRuleInput!) {\n updateHealthyBowlDiseaseWarningRule(input: $input) {\n ${DISEASE_WARNING_RULE_FIELDS}\n }\n }\n`;\n\nconst DELETE_DISEASE_WARNING_RULE = gql`\n mutation DeleteHealthyBowlDiseaseWarningRule($id: ID!, $context: ContextInput!) {\n deleteHealthyBowlDiseaseWarningRule(id: $id, context: $context)\n }\n`;\n\nconst RUN_DISEASE_WARNING_RULE = gql`\n mutation RunHealthyBowlDiseaseWarningRule($id: ID!, $context: ContextInput!) {\n runHealthyBowlDiseaseWarningRule(id: $id, context: $context)\n }\n`;\n\ninterface DiseaseWarningRulesQueryData {\n healthyBowlDiseaseWarningRules: DiseaseWarningRule[];\n}\ninterface RunRuleMutationData {\n runHealthyBowlDiseaseWarningRule: string | null;\n}\n\n/**\n * Loads disease early-warning alert rules for the active workspace and exposes\n * rule CRUD (incl. pause/resume via `status`) plus a `runRule` trigger.\n * Mutations refetch the list so the caller's view stays in sync.\n */\nexport function useDiseaseWarning() {\n const { workspaceId } = useHealthyBowl();\n const context = { workspaceId };\n\n const { data, loading, error, refetch } = useQuery<DiseaseWarningRulesQueryData>(DISEASE_WARNING_RULES_QUERY, {\n variables: { context },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n notifyOnNetworkStatusChange: true,\n });\n\n const [createRuleMutation] = useMutation(CREATE_DISEASE_WARNING_RULE);\n const [updateRuleMutation] = useMutation(UPDATE_DISEASE_WARNING_RULE);\n const [deleteRuleMutation] = useMutation(DELETE_DISEASE_WARNING_RULE);\n const [runRuleMutation] = useMutation<RunRuleMutationData>(RUN_DISEASE_WARNING_RULE);\n\n const createRule = useCallback(\n async (input: CreateDiseaseWarningRuleInput) => {\n await createRuleMutation({ variables: { input: { ...input, context } } });\n await refetch();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [createRuleMutation, refetch, workspaceId]\n );\n\n const updateRule = useCallback(\n async (id: string, input: UpdateDiseaseWarningRuleInput) => {\n await updateRuleMutation({ variables: { input: { id, ...input, context } } });\n await refetch();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [updateRuleMutation, refetch, workspaceId]\n );\n\n const deleteRule = useCallback(\n async (id: string) => {\n await deleteRuleMutation({ variables: { id, context } });\n await refetch();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [deleteRuleMutation, refetch, workspaceId]\n );\n\n const runRule = useCallback(\n async (id: string): Promise<string | null> => {\n const result = await runRuleMutation({ variables: { id, context } });\n await refetch();\n return result.data?.runHealthyBowlDiseaseWarningRule ?? null;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [runRuleMutation, refetch, workspaceId]\n );\n\n return {\n rules: data?.healthyBowlDiseaseWarningRules ?? [],\n loading,\n error: error ?? null,\n refetch,\n createRule,\n updateRule,\n deleteRule,\n runRule,\n };\n}\n"],"mappings":";;;;;AA2HA,IAAM,IAA8B,wZAwB9B,IAA8B,CAAG;;;QAG/B,EAA4B;;;GAK9B,IAA8B,CAAG;;;QAG/B,EAA4B;;;GAK9B,IAA8B,CAAG;;;QAG/B,EAA4B;;;GAK9B,IAA8B,CAAG;;;;GAMjC,IAA2B,CAAG;;;;;AAkBpC,SAAgB,IAAoB;CAClC,IAAM,EAAE,mBAAgB,GAAgB,EAClC,IAAU,EAAE,gBAAa,EAEzB,EAAE,SAAM,YAAS,UAAO,eAAY,EAAuC,GAA6B;EAC5G,WAAW,EAAE,YAAS;EACtB,MAAM,CAAC;EACP,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