@hestia-earth/data-validation 0.41.3 → 0.41.5

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.
@@ -1983,8 +1983,8 @@ var createErrorFormatter = ({ renderer: r, urls }) => {
1983
1983
  `If specifying fallow periods, you must also include the Product's equivalent Practice with a ${code("startDate")} and ${code("endDate")}.`,
1984
1984
  `Alternatively, do not set these ${code(schema.TermTermType.landCover)} practices, and they will be gap filled automatically from products.`
1985
1985
  ])}`,
1986
- "should match the site management node value": () => `The data you have uploaded in the Management node are not consistent with the data provided in the Cycles.
1987
- If the same ${code("term")} is used between the same ${code("startDate")} and ${code("endDate")}, they must have the same ${code("value")} in ${code("Management")} and in the Cycles.
1986
+ "should match the site management node value": ({ params }) => `The data you have uploaded in the Management node are not consistent with the data provided in the Cycles.
1987
+ The ${code("value")} of a ${code("Management")} node must be the total of every Practice using the same ${code("term")} between the same ${code("startDate")} and ${code("endDate")} \u2014 your Cycles add up to ${code(params == null ? void 0 : params.current)}, but the ${code("Management")} node has ${code(params == null ? void 0 : params.expected)}.
1988
1988
  Please check your upload and ensure that the data is consistent throughout.`,
1989
1989
  "saplings cannot be used as an input here": () => `To input ${code("Saplings")} into a plantation crop Cycle, you must use ${externalNodeLink({
1990
1990
  "@type": schema.NodeType.Term,
@@ -2026,6 +2026,19 @@ var createErrorFormatter = ({ renderer: r, urls }) => {
2026
2026
  If the ${code(
2027
2027
  schema.TermTermType.water
2028
2028
  )} inputs are correct, then the ${code(schema.TermTermType.waterRegime)} practices should be set as one of the "irrigated" terms.`,
2029
+ "should use irrigated water regime": ({ params }) => {
2030
+ var _a;
2031
+ return `This Cycle records ${((_a = params == null ? void 0 : params.termIds) == null ? void 0 : _a.length) ? `the irrigating ${glossaryTypeLink(
2032
+ schema.TermTermType.operation,
2033
+ pluralize("operation", params.termIds.length)
2034
+ )} ${listAsCodeWithAnd(params.termIds)}` : `an irrigating ${glossaryTypeLink(schema.TermTermType.operation, "operation")}`} but no irrigated ${glossaryTypeLink(schema.TermTermType.waterRegime, "waterRegime")} practice.
2035
+ The ${code(
2036
+ schema.TermTermType.waterRegime
2037
+ )} is what the models read to tell an irrigated Cycle from a rainfed one, so the two disagreeing changes the results.
2038
+ Either add the irrigated ${code(
2039
+ schema.TermTermType.waterRegime
2040
+ )} practice that applies, or record a non-irrigating operation if the Cycle was rainfed.`;
2041
+ },
2029
2042
  "management date must be before cycle start date": () => `The Site Management's dates must not overlap with any of the Cycles' dates.
2030
2043
  The Site Management must only be used to record historical information about years preceding your first Cycle.
2031
2044
  If you are trying to specify land management or practices that take place during the period covered by your Cycles, please do so directly in the Cycles, using the Product or Practice nodes.
@@ -1981,8 +1981,8 @@ var createErrorFormatter = ({ renderer: r, urls }) => {
1981
1981
  `If specifying fallow periods, you must also include the Product's equivalent Practice with a ${code("startDate")} and ${code("endDate")}.`,
1982
1982
  `Alternatively, do not set these ${code(TermTermType.landCover)} practices, and they will be gap filled automatically from products.`
1983
1983
  ])}`,
1984
- "should match the site management node value": () => `The data you have uploaded in the Management node are not consistent with the data provided in the Cycles.
1985
- If the same ${code("term")} is used between the same ${code("startDate")} and ${code("endDate")}, they must have the same ${code("value")} in ${code("Management")} and in the Cycles.
1984
+ "should match the site management node value": ({ params }) => `The data you have uploaded in the Management node are not consistent with the data provided in the Cycles.
1985
+ The ${code("value")} of a ${code("Management")} node must be the total of every Practice using the same ${code("term")} between the same ${code("startDate")} and ${code("endDate")} \u2014 your Cycles add up to ${code(params == null ? void 0 : params.current)}, but the ${code("Management")} node has ${code(params == null ? void 0 : params.expected)}.
1986
1986
  Please check your upload and ensure that the data is consistent throughout.`,
1987
1987
  "saplings cannot be used as an input here": () => `To input ${code("Saplings")} into a plantation crop Cycle, you must use ${externalNodeLink({
1988
1988
  "@type": NodeType.Term,
@@ -2024,6 +2024,19 @@ var createErrorFormatter = ({ renderer: r, urls }) => {
2024
2024
  If the ${code(
2025
2025
  TermTermType.water
2026
2026
  )} inputs are correct, then the ${code(TermTermType.waterRegime)} practices should be set as one of the "irrigated" terms.`,
2027
+ "should use irrigated water regime": ({ params }) => {
2028
+ var _a;
2029
+ return `This Cycle records ${((_a = params == null ? void 0 : params.termIds) == null ? void 0 : _a.length) ? `the irrigating ${glossaryTypeLink(
2030
+ TermTermType.operation,
2031
+ pluralize("operation", params.termIds.length)
2032
+ )} ${listAsCodeWithAnd(params.termIds)}` : `an irrigating ${glossaryTypeLink(TermTermType.operation, "operation")}`} but no irrigated ${glossaryTypeLink(TermTermType.waterRegime, "waterRegime")} practice.
2033
+ The ${code(
2034
+ TermTermType.waterRegime
2035
+ )} is what the models read to tell an irrigated Cycle from a rainfed one, so the two disagreeing changes the results.
2036
+ Either add the irrigated ${code(
2037
+ TermTermType.waterRegime
2038
+ )} practice that applies, or record a non-irrigating operation if the Cycle was rainfed.`;
2039
+ },
2027
2040
  "management date must be before cycle start date": () => `The Site Management's dates must not overlap with any of the Cycles' dates.
2028
2041
  The Site Management must only be used to record historical information about years preceding your first Cycle.
2029
2042
  If you are trying to specify land management or practices that take place during the period covered by your Cycles, please do so directly in the Cycles, using the Product or Practice nodes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/data-validation",
3
- "version": "0.41.3",
3
+ "version": "0.41.5",
4
4
  "description": "HESTIA Data Validation library",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -30,6 +30,13 @@
30
30
  "./*.js": "./*.js",
31
31
  "./*": "./*"
32
32
  },
33
+ "typesVersions": {
34
+ "*": {
35
+ "file-errors": [
36
+ "file-errors/public-api.d.ts"
37
+ ]
38
+ }
39
+ },
33
40
  "sideEffects": false,
34
41
  "files": [
35
42
  "index.js",