@openforis/arena-core 3.2.1 → 3.2.3

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.
Files changed (164) hide show
  1. package/dist/app/appInfo.d.ts +5 -1
  2. package/dist/app/appInfo.js.map +1 -1
  3. package/dist/app/appInfos.d.ts +19 -0
  4. package/dist/app/appInfos.js +27 -0
  5. package/dist/app/appInfos.js.map +1 -0
  6. package/dist/app/index.d.ts +2 -1
  7. package/dist/app/index.js +3 -0
  8. package/dist/app/index.js.map +1 -1
  9. package/dist/esm/app/appInfo.js.map +1 -1
  10. package/dist/esm/app/appInfos.js +24 -0
  11. package/dist/esm/app/appInfos.js.map +1 -0
  12. package/dist/esm/app/index.js +1 -1
  13. package/dist/esm/app/index.js.map +1 -1
  14. package/dist/esm/expression/context.js.map +1 -1
  15. package/dist/esm/expression/javascript/evaluator.js +3 -16
  16. package/dist/esm/expression/javascript/evaluator.js.map +1 -1
  17. package/dist/esm/expression/javascript/parser/expressionNodesFinder.js +68 -0
  18. package/dist/esm/expression/javascript/parser/expressionNodesFinder.js.map +1 -0
  19. package/dist/esm/geo/points/transform.js +3 -10
  20. package/dist/esm/geo/points/transform.js.map +1 -1
  21. package/dist/esm/index.js +1 -0
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/node/index.js.map +1 -1
  24. package/dist/esm/node/nodeValueFormatter.js +1 -0
  25. package/dist/esm/node/nodeValueFormatter.js.map +1 -1
  26. package/dist/esm/node/nodes.js +14 -12
  27. package/dist/esm/node/nodes.js.map +1 -1
  28. package/dist/esm/nodeDef/types/entity.js.map +1 -1
  29. package/dist/esm/nodeDefExpressionEvaluator/context.js.map +1 -1
  30. package/dist/esm/nodeDefExpressionEvaluator/evaluator.js +19 -1
  31. package/dist/esm/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  32. package/dist/esm/nodeDefExpressionEvaluator/functions.js +53 -0
  33. package/dist/esm/nodeDefExpressionEvaluator/functions.js.map +1 -1
  34. package/dist/esm/record/_records/recordGetters.js +18 -0
  35. package/dist/esm/record/_records/recordGetters.js.map +1 -1
  36. package/dist/esm/record/record.js.map +1 -1
  37. package/dist/esm/record/recordExpressionEvaluator/functions.js +14 -0
  38. package/dist/esm/record/recordExpressionEvaluator/functions.js.map +1 -1
  39. package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js +9 -1
  40. package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  41. package/dist/esm/record/recordNodesUpdater/recordExpressionEvaluationContext.js +1 -0
  42. package/dist/esm/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
  43. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +5 -3
  44. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  45. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js +6 -4
  46. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  47. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +2 -2
  48. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  49. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +11 -3
  50. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  51. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +46 -21
  52. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  53. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +14 -6
  54. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  55. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js +5 -5
  56. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
  57. package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js +22 -1
  58. package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  59. package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js +111 -8
  60. package/dist/esm/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  61. package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js +10 -0
  62. package/dist/esm/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  63. package/dist/esm/record/recordUpdater.js +62 -9
  64. package/dist/esm/record/recordUpdater.js.map +1 -1
  65. package/dist/esm/record/records.js +3 -1
  66. package/dist/esm/record/records.js.map +1 -1
  67. package/dist/esm/survey/survey.js +2 -0
  68. package/dist/esm/survey/survey.js.map +1 -1
  69. package/dist/esm/survey/surveys/dependencies.js +67 -32
  70. package/dist/esm/survey/surveys/dependencies.js.map +1 -1
  71. package/dist/esm/survey/surveys/index.js +2 -1
  72. package/dist/esm/survey/surveys/index.js.map +1 -1
  73. package/dist/esm/utils/_objects/isEqual.js +2 -0
  74. package/dist/esm/utils/_objects/isEqual.js.map +1 -1
  75. package/dist/esm/utils/lruCache.js +50 -0
  76. package/dist/esm/utils/lruCache.js.map +1 -0
  77. package/dist/expression/context.d.ts +5 -0
  78. package/dist/expression/context.js.map +1 -1
  79. package/dist/expression/javascript/evaluator.js +3 -16
  80. package/dist/expression/javascript/evaluator.js.map +1 -1
  81. package/dist/expression/javascript/parser/expressionNodesFinder.d.ts +13 -0
  82. package/dist/expression/javascript/parser/expressionNodesFinder.js +73 -0
  83. package/dist/expression/javascript/parser/expressionNodesFinder.js.map +1 -0
  84. package/dist/geo/points/transform.js +3 -10
  85. package/dist/geo/points/transform.js.map +1 -1
  86. package/dist/index.d.ts +3 -2
  87. package/dist/index.js +5 -3
  88. package/dist/index.js.map +1 -1
  89. package/dist/node/index.d.ts +1 -0
  90. package/dist/node/index.js.map +1 -1
  91. package/dist/node/nodeValueFormatter.d.ts +1 -1
  92. package/dist/node/nodeValueFormatter.js +1 -0
  93. package/dist/node/nodeValueFormatter.js.map +1 -1
  94. package/dist/node/nodes.d.ts +18 -5
  95. package/dist/node/nodes.js +14 -12
  96. package/dist/node/nodes.js.map +1 -1
  97. package/dist/nodeDef/types/entity.d.ts +1 -1
  98. package/dist/nodeDef/types/entity.js.map +1 -1
  99. package/dist/nodeDefExpressionEvaluator/context.d.ts +4 -0
  100. package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
  101. package/dist/nodeDefExpressionEvaluator/evaluator.d.ts +9 -1
  102. package/dist/nodeDefExpressionEvaluator/evaluator.js +19 -1
  103. package/dist/nodeDefExpressionEvaluator/evaluator.js.map +1 -1
  104. package/dist/nodeDefExpressionEvaluator/functions.js +53 -0
  105. package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
  106. package/dist/record/_records/recordGetters.d.ts +10 -0
  107. package/dist/record/_records/recordGetters.js +21 -1
  108. package/dist/record/_records/recordGetters.js.map +1 -1
  109. package/dist/record/record.d.ts +1 -1
  110. package/dist/record/record.js.map +1 -1
  111. package/dist/record/recordExpressionEvaluator/functions.js +14 -0
  112. package/dist/record/recordExpressionEvaluator/functions.js.map +1 -1
  113. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.d.ts +8 -0
  114. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js +9 -1
  115. package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
  116. package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.d.ts +6 -0
  117. package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js +1 -0
  118. package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
  119. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js +5 -3
  120. package/dist/record/recordNodesUpdater/recordNodeDependentsApplicableUpdater.js.map +1 -1
  121. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.d.ts +2 -3
  122. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js +5 -3
  123. package/dist/record/recordNodesUpdater/recordNodeDependentsBooleanUpdater.js.map +1 -1
  124. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js +2 -2
  125. package/dist/record/recordNodesUpdater/recordNodeDependentsCodeAttributesUpdater.js.map +1 -1
  126. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js +11 -3
  127. package/dist/record/recordNodesUpdater/recordNodeDependentsCountUpdater.js.map +1 -1
  128. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js +45 -20
  129. package/dist/record/recordNodesUpdater/recordNodeDependentsDefaultValuesUpdater.js.map +1 -1
  130. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js +14 -6
  131. package/dist/record/recordNodesUpdater/recordNodeDependentsFileNamesEvaluator.js.map +1 -1
  132. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js +4 -4
  133. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
  134. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.d.ts +19 -0
  135. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js +24 -1
  136. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  137. package/dist/record/recordNodesUpdater/recordNodesUpdater.d.ts +8 -1
  138. package/dist/record/recordNodesUpdater/recordNodesUpdater.js +107 -4
  139. package/dist/record/recordNodesUpdater/recordNodesUpdater.js.map +1 -1
  140. package/dist/record/recordNodesUpdater/recordUpdateResult.d.ts +5 -0
  141. package/dist/record/recordNodesUpdater/recordUpdateResult.js +10 -0
  142. package/dist/record/recordNodesUpdater/recordUpdateResult.js.map +1 -1
  143. package/dist/record/recordUpdater.d.ts +11 -3
  144. package/dist/record/recordUpdater.js +61 -8
  145. package/dist/record/recordUpdater.js.map +1 -1
  146. package/dist/record/records.d.ts +3 -1
  147. package/dist/record/records.js +2 -0
  148. package/dist/record/records.js.map +1 -1
  149. package/dist/survey/survey.d.ts +3 -1
  150. package/dist/survey/survey.js +2 -0
  151. package/dist/survey/survey.js.map +1 -1
  152. package/dist/survey/surveys/dependencies.d.ts +10 -0
  153. package/dist/survey/surveys/dependencies.js +69 -33
  154. package/dist/survey/surveys/dependencies.js.map +1 -1
  155. package/dist/survey/surveys/index.d.ts +2 -1
  156. package/dist/survey/surveys/index.js +1 -0
  157. package/dist/survey/surveys/index.js.map +1 -1
  158. package/dist/utils/_objects/isEqual.d.ts +3 -1
  159. package/dist/utils/_objects/isEqual.js +2 -0
  160. package/dist/utils/_objects/isEqual.js.map +1 -1
  161. package/dist/utils/lruCache.d.ts +18 -0
  162. package/dist/utils/lruCache.js +54 -0
  163. package/dist/utils/lruCache.js.map +1 -0
  164. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expressionNodesFinder.js","sourceRoot":"","sources":["../../../../src/expression/javascript/parser/expressionNodesFinder.ts"],"names":[],"mappings":";;;AAAA,qCAAuE;AACvE,sDAAkD;AAClD,qCAAqD;AAErD,MAAM,MAAM,GAAG,IAAI,mCAA0B,EAAE,CAAA;AAE/C;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC,KAAc,EAAE,OAAyD,EAAQ,EAAE;IAChG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9C,OAAM;IACR,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAM;IAE/C,MAAM,cAAc,GAAG,KAA+B,CAAA;IACtD,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,cAAc,CAAC,CAAA;IACzB,CAAC;IACD,KAAK,MAAM,KA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;YAC7C,IAAI,cAAc,CAAC,IAAI,KAAK,yBAAkB,CAAC,IAAI;gBAAE,MAAM,GAAG,IAAI,CAAA;QACpE,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AATY,QAAA,kBAAkB,GAAlB,kBAAkB,CAS9B","sourcesContent":["import { ArenaAnyExpressionNode, ExpressionNodeType } from '../../node'\nimport { LRUCache } from '../../../utils/lruCache'\nimport { JavascriptExpressionParser } from './parser'\n\nconst parser = new JavascriptExpressionParser()\n\n/**\n * Visits the specified expression node and all its descendants (arguments, operands, compound bodies...).\n */\nconst visit = (value: unknown, visitor: (expressionNode: ArenaAnyExpressionNode) => void): void => {\n if (Array.isArray(value)) {\n for (const item of value) visit(item, visitor)\n return\n }\n if (!value || typeof value !== 'object') return\n\n const expressionNode = value as ArenaAnyExpressionNode\n if (expressionNode.type) {\n visitor(expressionNode)\n }\n for (const child of Object.values(expressionNode)) {\n visit(child, visitor)\n }\n}\n\nconst visitExpression = (expression: string, visitor: (expressionNode: ArenaAnyExpressionNode) => void): void => {\n try {\n visit(parser.parse(expression), visitor)\n } catch {\n // invalid expression (reported by the expression validator)\n }\n}\n\n/**\n * Finds the names of the functions called in the specified expression (e.g. \"now\" in \"now() > date_attr\").\n * Returns an empty set if the expression is empty or cannot be parsed.\n * @param expression - The expression to search in.\n * @returns The names of the called functions.\n */\nexport const findFunctionCallNames = (expression: string | undefined | null): Set<string> => {\n const names = new Set<string>()\n if (!expression) return names\n visitExpression(expression, (expressionNode) => {\n if (\n expressionNode.type === ExpressionNodeType.Call &&\n expressionNode.callee.type === ExpressionNodeType.Identifier\n ) {\n names.add(expressionNode.callee.name)\n }\n })\n return names\n}\n\nconst usesThisCache = new LRUCache<string, boolean>(1000)\n\n/**\n * Returns true if the specified expression uses the \"this\" keyword (results are cached by expression, up to 1000).\n * @param expression - The expression to search in.\n * @returns True if \"this\" is used in the expression.\n */\nexport const expressionUsesThis = (expression: string | undefined | null): boolean => {\n if (!expression) return false\n return usesThisCache.getOrCompute(expression, () => {\n let result = false\n visitExpression(expression, (expressionNode) => {\n if (expressionNode.type === ExpressionNodeType.This) result = true\n })\n return result\n })\n}\n"]}
@@ -6,21 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.transform = exports.transformOrThrow = void 0;
7
7
  const proj4_1 = __importDefault(require("proj4"));
8
8
  const error_1 = require("../../error");
9
+ const lruCache_1 = require("../../utils/lruCache");
9
10
  const srs_1 = require("../../srs");
10
11
  const pointFactory_1 = require("../pointFactory");
11
12
  const isFilled_1 = require("./isFilled");
12
13
  const getSrs_1 = require("./getSrs");
13
14
  // proj4 parses both WKT strings every time it is called with them: cache the converters by WKT pair
14
- const convertersCache = new Map();
15
- const getConverter = (wktFrom, wktTo) => {
16
- const key = `${wktFrom}\n${wktTo}`;
17
- let converter = convertersCache.get(key);
18
- if (!converter) {
19
- converter = (0, proj4_1.default)(wktFrom, wktTo);
20
- convertersCache.set(key, converter);
21
- }
22
- return converter;
23
- };
15
+ const convertersCache = new lruCache_1.LRUCache(100);
16
+ const getConverter = (wktFrom, wktTo) => convertersCache.getOrCompute(`${wktFrom}\n${wktTo}`, () => (0, proj4_1.default)(wktFrom, wktTo));
24
17
  /**
25
18
  * Transforms the specified point from one SRS into another, throwing a SystemError with the reason when it cannot.
26
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/geo/points/transform.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAE7C,uCAA0D;AAC1D,mCAA4D;AAE5D,kDAA8C;AAC9C,yCAAqC;AACrC,qCAAiC;AAEjC,oGAAoG;AACpG,MAAM,eAAe,GAAG,IAAI,GAAG,EAAqB,CAAA;AAEpD,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAa,EAAE;IACjE,MAAM,GAAG,GAAG,GAAG,OAAO,KAAK,KAAK,EAAE,CAAA;IAClC,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I,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAExF,OAAO,2BAAY,CAAC,cAAc,iCAAM,KAAK,KAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAG,CAAA;IACnF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,mBAAW,CACnB,uBAAe,CAAC,GAAG,CAAC,eAAe,EACnC,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAC1C,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;IACH,CAAC;AACH,CAAC,CAAA;AA/BY,QAAA,gBAAgB,GAAhB,gBAAgB,CA+B5B;AAED;;;;;;;;GAQG;AACI,MAAM,SAAS,GAAG,CACvB,KAAoC,EACpC,SAAiB,EACjB,QAAQ,GAAkB,uBAAiB,EACxB,EAAE;IACrB,IAAI,CAAC;QACH,OAAO,IAAA,QAAA,gBAAgB,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;IACrD,CAAC;eAAO,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,SAAS,GAAT,SAAS,CAUrB","sourcesContent":["import proj4, { type Converter } from 'proj4'\n\nimport { SystemError, SystemErrorKeys } from '../../error'\nimport { DEFAULT_SRS_INDEX, ArenaSRSIndex } from '../../srs'\nimport { ArenaPoint } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { isFilled } from './isFilled'\nimport { getSrs } from './getSrs'\n\n// proj4 parses both WKT strings every time it is called with them: cache the converters by WKT pair\nconst convertersCache = new Map<string, Converter>()\n\nconst getConverter = (wktFrom: string, wktTo: string): Converter => {\n const key = `${wktFrom}\\n${wktTo}`\n let converter = convertersCache.get(key)\n if (!converter) {\n converter = proj4(wktFrom, wktTo)\n convertersCache.set(key, converter)\n }\n return converter\n}\n\n/**\n * Transforms the specified point from one SRS into another, throwing a SystemError with the reason when it cannot.\n *\n * @param point - The point to transform.\n * @param srsCodeTo - The SRS code to transform the point into.\n * @param srsIndex - SRSs indexed by SRS code.\n * @returns The transformed point (the point itself if it is already in the target SRS).\n * @throws {SystemError} `geo.pointNotFilled`, `geo.srsNotFound` (with the `code` param) or `geo.transformFailed`.\n */\nexport const transformOrThrow = (\n point: ArenaPoint | null | undefined,\n srsCodeTo: string,\n srsIndex: ArenaSRSIndex = DEFAULT_SRS_INDEX\n): ArenaPoint => {\n if (!isFilled(point)) throw new SystemError(SystemErrorKeys.geo.pointNotFilled)\n\n const { srs: srsCodeFrom } = point\n\n if (srsCodeFrom === srsCodeTo) {\n // projection is not needed\n return point\n }\n const srsFrom = getSrs({ code: srsCodeFrom, srsIndex })\n if (!srsFrom) throw new SystemError(SystemErrorKeys.geo.srsNotFound, { code: srsCodeFrom })\n\n const srsTo = getSrs({ code: srsCodeTo, srsIndex })\n if (!srsTo) throw new SystemError(SystemErrorKeys.geo.srsNotFound, { code: srsCodeTo })\n\n try {\n const { x, y } = point\n const [long, lat] = getConverter(srsFrom.wkt, srsTo.wkt).forward([Number(x), Number(y)])\n\n return PointFactory.createInstance({ ...point, srs: srsCodeTo, x: long, y: lat })\n } catch (error) {\n throw new SystemError(\n SystemErrorKeys.geo.transformFailed,\n { srsFrom: srsCodeFrom, srsTo: srsCodeTo },\n { cause: error }\n )\n }\n}\n\n/**\n * Transforms the specified point from one SRS into another.\n * Use `transformOrThrow` to know why a point cannot be transformed.\n *\n * @param point - The point to transform.\n * @param srsCodeTo - The SRS code to transform the point into.\n * @param srsIndex - SRSs indexed by SRS code.\n * @returns The transformed point, or null if the point is not filled, an SRS is unknown or the transformation fails.\n */\nexport const transform = (\n point: ArenaPoint | null | undefined,\n srsCodeTo: string,\n srsIndex: ArenaSRSIndex = DEFAULT_SRS_INDEX\n): ArenaPoint | null => {\n try {\n return transformOrThrow(point, srsCodeTo, srsIndex)\n } catch {\n return null\n }\n}\n"]}
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/geo/points/transform.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAE7C,uCAA0D;AAC1D,mDAA+C;AAC/C,mCAA4D;AAE5D,kDAA8C;AAC9C,yCAAqC;AACrC,qCAAiC;AAEjC,oGAAoG;AACpG,MAAM,eAAe,GAAG,IAAI,mBAAQ,CAAoB,GAAG,CAAC,CAAA;AAE5D,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAa,EAAE,CACjE,eAAe,CAAC,YAAY,CAAC,GAAG,OAAO,KAAK,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,IAAA,eAAK,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;AAEnF;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,CAC9B,KAAoC,EACpC,SAAiB,EACjB,QAAQ,GAAkB,uBAAiB,EAC/B,EAAE;IACd,IAAI,CAAC,IAAA,mBAAQ,EAAC,KAAK,CAAC;QAAE,MAAM,IAAI,mBAAW,CAAC,uBAAe,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IAE/E,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAElC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,2BAA2B;QAC3B,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,eAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAA;IACvD,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,mBAAW,CAAC,uBAAe,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;IAE3F,MAAM,KA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rB","sourcesContent":["import proj4, { type Converter } from 'proj4'\n\nimport { SystemError, SystemErrorKeys } from '../../error'\nimport { LRUCache } from '../../utils/lruCache'\nimport { DEFAULT_SRS_INDEX, ArenaSRSIndex } from '../../srs'\nimport { ArenaPoint } from '../point'\nimport { PointFactory } from '../pointFactory'\nimport { isFilled } from './isFilled'\nimport { getSrs } from './getSrs'\n\n// proj4 parses both WKT strings every time it is called with them: cache the converters by WKT pair\nconst convertersCache = new LRUCache<string, Converter>(100)\n\nconst getConverter = (wktFrom: string, wktTo: string): Converter =>\n convertersCache.getOrCompute(`${wktFrom}\\n${wktTo}`, () => proj4(wktFrom, wktTo))\n\n/**\n * Transforms the specified point from one SRS into another, throwing a SystemError with the reason when it cannot.\n *\n * @param point - The point to transform.\n * @param srsCodeTo - The SRS code to transform the point into.\n * @param srsIndex - SRSs indexed by SRS code.\n * @returns The transformed point (the point itself if it is already in the target SRS).\n * @throws {SystemError} `geo.pointNotFilled`, `geo.srsNotFound` (with the `code` param) or `geo.transformFailed`.\n */\nexport const transformOrThrow = (\n point: ArenaPoint | null | undefined,\n srsCodeTo: string,\n srsIndex: ArenaSRSIndex = DEFAULT_SRS_INDEX\n): ArenaPoint => {\n if (!isFilled(point)) throw new SystemError(SystemErrorKeys.geo.pointNotFilled)\n\n const { srs: srsCodeFrom } = point\n\n if (srsCodeFrom === srsCodeTo) {\n // projection is not needed\n return point\n }\n const srsFrom = getSrs({ code: srsCodeFrom, srsIndex })\n if (!srsFrom) throw new SystemError(SystemErrorKeys.geo.srsNotFound, { code: srsCodeFrom })\n\n const srsTo = getSrs({ code: srsCodeTo, srsIndex })\n if (!srsTo) throw new SystemError(SystemErrorKeys.geo.srsNotFound, { code: srsCodeTo })\n\n try {\n const { x, y } = point\n const [long, lat] = getConverter(srsFrom.wkt, srsTo.wkt).forward([Number(x), Number(y)])\n\n return PointFactory.createInstance({ ...point, srs: srsCodeTo, x: long, y: lat })\n } catch (error) {\n throw new SystemError(\n SystemErrorKeys.geo.transformFailed,\n { srsFrom: srsCodeFrom, srsTo: srsCodeTo },\n { cause: error }\n )\n }\n}\n\n/**\n * Transforms the specified point from one SRS into another.\n * Use `transformOrThrow` to know why a point cannot be transformed.\n *\n * @param point - The point to transform.\n * @param srsCodeTo - The SRS code to transform the point into.\n * @param srsIndex - SRSs indexed by SRS code.\n * @returns The transformed point, or null if the point is not filled, an SRS is unknown or the transformation fails.\n */\nexport const transform = (\n point: ArenaPoint | null | undefined,\n srsCodeTo: string,\n srsIndex: ArenaSRSIndex = DEFAULT_SRS_INDEX\n): ArenaPoint | null => {\n try {\n return transformOrThrow(point, srsCodeTo, srsIndex)\n } catch {\n return null\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export type { ArenaAppInfo } from './app';
1
+ export type { ArenaAppInfo, ArenaAppPlatform } from './app';
2
+ export { AppInfos } from './app';
2
3
  export { Authorizer, AuthGroupName, createDefaultAuthGroups, UserStatus, Permission, UserTitle, UserFactory, Users, } from './auth';
3
4
  export type { ArenaAuthGroup, ArenaUser, ArenaUserAuthGroup, ArenaUserAuthGroupProps, ArenaAuthToken, ArenaUserAuthTokenPayload, ArenaUserAuthTokenService, ArenaUserPrefs, ArenaUserPrefSurveys, ArenaUserProps, ArenaUserAuthRefreshToken, ArenaUserAuthRefreshTokenProps, ArenaUserAuthRefreshTokenPayload, ArenaUserService, ArenaUserTokenPayload, ArenaDownloadAuthTokenPayload, ArenaUserGroup, ArenaUserGroupProps, ArenaUserGroupQualifier, ArenaUserInvitation, } from './auth';
4
5
  export { CategoryFactory, CategoryItemFactory, CategoryLevelFactory } from './category';
@@ -27,7 +28,7 @@ export type { ArenaLogger } from './logger';
27
28
  export type { ArenaMessage } from './message';
28
29
  export { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message';
29
30
  export { RecordNodeFactory, RecordNodeKeys, RecordNodeMetaKeys, RecordNodes, RecordNodeValueFormatter, RecordNodeValues, } from './node';
30
- export type { ArenaRecordNode, ArenaRecordNodeMeta, ArenaRecordNodePointer, ArenaRecordNodeRefData, ArenaRecordNodesMap, ArenaRecordNodeValue, ArenaRecordNodeValueCode, ArenaRecordNodeValueCoordinate, ArenaRecordNodeValueFile, ArenaRecordNodeValueGeo, ArenaRecordNodeValueTaxon, } from './node';
31
+ export type { ArenaRecordNode, ArenaRecordNodeMeta, ArenaRecordNodePointer, ArenaRecordNodeRefData, ArenaRecordNodesMap, ArenaRecordNodeUpdateOptions, ArenaRecordNodeValue, ArenaRecordNodeValueCode, ArenaRecordNodeValueCoordinate, ArenaRecordNodeValueFile, ArenaRecordNodeValueGeo, ArenaRecordNodeValueTaxon, } from './node';
31
32
  export { NodeDefCountType, NodeDefExpressionFactory, NodeDefType, NodeDefFactory, NodeDefs, NodeDefEntityRenderType, NodeDefFileType, NodeDefTextInputType, NodeDefTextRenderType, FormHeaderColor, } from './nodeDef';
32
33
  export { NodeDefExpressionEvaluator, NodeDefExpressionValidator } from './nodeDefExpressionEvaluator';
33
34
  export type { ArenaAreaOfInterestProvider, ArenaCategoryItemProvider, ArenaTaxonProvider, } from './nodeDefExpressionEvaluator';
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Messages = exports.MessageTargetUserType = exports.MessageStatus = exports.MessagePropsKey = exports.MessageNotificationType = exports.LanguagesISO639part2 = exports.Languages = exports.LanguageCode = exports.JobStatus = exports.JobEventType = exports.JobBase = exports.Points = exports.PointFactory = exports.ExtraPropsDataGenerator = exports.ExtraPropDataType = exports.JavascriptExpressionParser = exports.JavascriptExpressionEvaluator = exports.ExpressionVariable = exports.ExpressionNodeEvaluator = exports.ExpressionNodeType = exports.SystemErrorKeys = exports.SystemError = exports.DataQuerySummaries = exports.DataQueryMode = exports.UniqueFileNamesGenerator = exports.ArenaExportType = exports.ArenaExportInfoFactory = exports.ArenaExportFile = exports.FlatDataExportColumnDataType = exports.FlatDataExportModel = exports.FlatDataFiles = exports.FlatDataExportOption = exports.FlatDataExportDefaultOptions = exports.TraverseMethod = exports.ChainNodeDefFactory = exports.ChainStatusExec = exports.ChainFactory = exports.CategoryItems = exports.Categories = exports.CategoryLevelFactory = exports.CategoryItemFactory = exports.CategoryFactory = exports.Users = exports.UserFactory = exports.UserTitle = exports.Permission = exports.UserStatus = exports.createDefaultAuthGroups = exports.AuthGroupName = exports.Authorizer = void 0;
4
- exports.SurveyFileType = exports.SurveyFileFactory = exports.SurveyFactory = exports.SurveyDependencyType = exports.SurveyDocPlace = exports.SurveyDocImageFactory = exports.SurveyDocImages = exports.NodeDefsFixer = exports.SRSFactory = exports.DEFAULT_SRS_INDEX = exports.DEFAULT_SRS = exports.ServiceType = exports.ServiceRegistry = exports.RecordValidations = exports.RecordValidator = exports.RecordUpdateResult = exports.RecordUpdater = exports.RecordPrettyPrinter = exports.RecordNodesUpdater = exports.RecordExpressionEvaluator = exports.RecordStepsList = exports.RecordSteps = exports.RecordStepNames = exports.RecordStepEntryCode = exports.RecordStepCleansingCode = exports.RecordStepAnalysisCode = exports.RECORD_STEP_DEFAULT = exports.Records = exports.RecordFixer = exports.RecordFactory = exports.RecordCloner = exports.RecordNodePointers = exports.NodeDefExpressionValidator = exports.NodeDefExpressionEvaluator = exports.FormHeaderColor = exports.NodeDefTextRenderType = exports.NodeDefTextInputType = exports.NodeDefFileType = exports.NodeDefEntityRenderType = exports.NodeDefs = exports.NodeDefFactory = exports.NodeDefType = exports.NodeDefExpressionFactory = exports.NodeDefCountType = exports.RecordNodeValues = exports.RecordNodeValueFormatter = exports.RecordNodes = exports.RecordNodeMetaKeys = exports.RecordNodeKeys = exports.RecordNodeFactory = void 0;
5
- exports.ValidatorErrorKeys = exports.Validator = exports.ValidationSeverity = exports.Validations = exports.ValidationResults = exports.ValidationResultFactory = exports.ValidationFactory = exports.FieldValidators = exports.Versions = exports.UUIDs = exports.UnitOfTime = exports.Strings = exports.RetryProcessor = exports.Queue = exports.Promises = exports.Objects = exports.Numbers = exports.FileProcessor = exports.FileNames = exports.Dates = exports.DateFormats = exports.Arrays = exports.RecordNodeBuilders = exports.RecordBuilder = exports.SurveyObjectBuilders = exports.SurveyBuilder = exports.VernacularNameFactory = exports.TaxonGenerator = exports.TaxonFactory = exports.TaxonomyFactory = exports.Taxonomies = exports.Taxa = exports.defaultCycle = exports.surveySecurityDefaults = exports.surveyDocImagePropKeys = exports.Surveys = exports.SurveySecurityProp = exports.SurveyRefDataFactory = void 0;
3
+ exports.MessageTargetUserType = exports.MessageStatus = exports.MessagePropsKey = exports.MessageNotificationType = exports.LanguagesISO639part2 = exports.Languages = exports.LanguageCode = exports.JobStatus = exports.JobEventType = exports.JobBase = exports.Points = exports.PointFactory = exports.ExtraPropsDataGenerator = exports.ExtraPropDataType = exports.JavascriptExpressionParser = exports.JavascriptExpressionEvaluator = exports.ExpressionVariable = exports.ExpressionNodeEvaluator = exports.ExpressionNodeType = exports.SystemErrorKeys = exports.SystemError = exports.DataQuerySummaries = exports.DataQueryMode = exports.UniqueFileNamesGenerator = exports.ArenaExportType = exports.ArenaExportInfoFactory = exports.ArenaExportFile = exports.FlatDataExportColumnDataType = exports.FlatDataExportModel = exports.FlatDataFiles = exports.FlatDataExportOption = exports.FlatDataExportDefaultOptions = exports.TraverseMethod = exports.ChainNodeDefFactory = exports.ChainStatusExec = exports.ChainFactory = exports.CategoryItems = exports.Categories = exports.CategoryLevelFactory = exports.CategoryItemFactory = exports.CategoryFactory = exports.Users = exports.UserFactory = exports.UserTitle = exports.Permission = exports.UserStatus = exports.createDefaultAuthGroups = exports.AuthGroupName = exports.Authorizer = exports.AppInfos = void 0;
4
+ exports.SurveyFileFactory = exports.SurveyFactory = exports.SurveyDependencyType = exports.SurveyDocPlace = exports.SurveyDocImageFactory = exports.SurveyDocImages = exports.NodeDefsFixer = exports.SRSFactory = exports.DEFAULT_SRS_INDEX = exports.DEFAULT_SRS = exports.ServiceType = exports.ServiceRegistry = exports.RecordValidations = exports.RecordValidator = exports.RecordUpdateResult = exports.RecordUpdater = exports.RecordPrettyPrinter = exports.RecordNodesUpdater = exports.RecordExpressionEvaluator = exports.RecordStepsList = exports.RecordSteps = exports.RecordStepNames = exports.RecordStepEntryCode = exports.RecordStepCleansingCode = exports.RecordStepAnalysisCode = exports.RECORD_STEP_DEFAULT = exports.Records = exports.RecordFixer = exports.RecordFactory = exports.RecordCloner = exports.RecordNodePointers = exports.NodeDefExpressionValidator = exports.NodeDefExpressionEvaluator = exports.FormHeaderColor = exports.NodeDefTextRenderType = exports.NodeDefTextInputType = exports.NodeDefFileType = exports.NodeDefEntityRenderType = exports.NodeDefs = exports.NodeDefFactory = exports.NodeDefType = exports.NodeDefExpressionFactory = exports.NodeDefCountType = exports.RecordNodeValues = exports.RecordNodeValueFormatter = exports.RecordNodes = exports.RecordNodeMetaKeys = exports.RecordNodeKeys = exports.RecordNodeFactory = exports.Messages = void 0;
5
+ exports.ValidatorErrorKeys = exports.Validator = exports.ValidationSeverity = exports.Validations = exports.ValidationResults = exports.ValidationResultFactory = exports.ValidationFactory = exports.FieldValidators = exports.Versions = exports.UUIDs = exports.UnitOfTime = exports.Strings = exports.RetryProcessor = exports.Queue = exports.Promises = exports.Objects = exports.Numbers = exports.FileProcessor = exports.FileNames = exports.Dates = exports.DateFormats = exports.Arrays = exports.RecordNodeBuilders = exports.RecordBuilder = exports.SurveyObjectBuilders = exports.SurveyBuilder = exports.VernacularNameFactory = exports.TaxonGenerator = exports.TaxonFactory = exports.TaxonomyFactory = exports.Taxonomies = exports.Taxa = exports.defaultCycle = exports.surveySecurityDefaults = exports.surveyDocImagePropKeys = exports.Surveys = exports.SurveySecurityProp = exports.SurveyRefDataFactory = exports.SurveyFileType = void 0;
6
+ var app_1 = require("./app");
7
+ Object.defineProperty(exports, "AppInfos", { enumerable: true, get: function () { return app_1.AppInfos; } });
6
8
  var auth_1 = require("./auth");
7
9
  Object.defineProperty(exports, "Authorizer", { enumerable: true, get: function () { return auth_1.Authorizer; } });
8
10
  Object.defineProperty(exports, "AuthGroupName", { enumerable: true, get: function () { return auth_1.AuthGroupName; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAEA,+BASe;AARb,kGAAA,UAAU,OAAA;AACV,qGAAA,aAAa,OAAA;AACb,+GAAA,uBAAuB,OAAA;AACvB,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,mGAAA,WAAW,OAAA;AACX,6FAAA,KAAK,OAAA;AAyBP,uCAAuF;AAA9E,2GAAA,eAAe,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAUnE,uCAAsD;AAA7C,sGAAA,UAAU,OAAA;AAAE,yGAAA,aAAa,OAAA;AAElC,iCAA4E;AAAnE,qGAAA,YAAY,OAAA;AAAE,wGAAA,eAAe,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAU3D,mCAAyC;AAAhC,wGAAA,cAAc,OAAA;AAIvB,2CAUqB;AATnB,0HAAA,4BAA4B,OAAA;AAC5B,kHAAA,oBAAoB,OAAA;AACpB,2GAAA,aAAa,OAAA;AACb,iHAAA,mBAAmB,OAAA;AACnB,0HAAA,4BAA4B,OAAA;AAC5B,6GAAA,eAAe,OAAA;AACf,oHAAA,sBAAsB,OAAA;AACtB,6GAAA,eAAe,OAAA;AACf,sHAAA,wBAAwB,OAAA;AAG1B,yCAA+D;AAAtD,0GAAA,aAAa,OAAA;AAAE,+GAAA,kBAAkB,OAAA;AAG1C,iCAAsD;AAA7C,oGAAA,WAAW,OAAA;AAAE,wGAAA,eAAe,OAAA;AAErC,2CAMqB;AALnB,gHAAA,kBAAkB,OAAA;AAClB,qHAAA,uBAAuB,OAAA;AACvB,gHAAA,kBAAkB,OAAA;AAClB,2HAAA,6BAA6B,OAAA;AAC7B,wHAAA,0BAA0B,OAAA;AAu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SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,iGAAA,QAAQ,OAAA;AACR,8FAAA,KAAK,OAAA;AACL,uGAAA,cAAc,OAAA;AACd,gGAAA,OAAO,OAAA;AACP,mGAAA,UAAU,OAAA;AACV,8FAAA,KAAK,OAAA;AACL,iGAAA,QAAQ,OAAA;AAWV,2CASqB;AARnB,6GAAA,eAAe,OAAA;AACf,+GAAA,iBAAiB,OAAA;AACjB,qHAAA,uBAAuB,OAAA;AACvB,+GAAA,iBAAiB,OAAA;AACjB,yGAAA,WAAW,OAAA;AACX,gHAAA,kBAAkB,OAAA;AAClB,uGAAA,SAAS,OAAA;AACT,gHAAA,kBAAkB,OAAA","sourcesContent":["export type { ArenaAppInfo } from './app'\n\nexport {\n Authorizer,\n AuthGroupName,\n createDefaultAuthGroups,\n UserStatus,\n Permission,\n UserTitle,\n UserFactory,\n Users,\n} from './auth'\nexport type {\n ArenaAuthGroup,\n ArenaUser,\n ArenaUserAuthGroup,\n ArenaUserAuthGroupProps,\n ArenaAuthToken,\n ArenaUserAuthTokenPayload,\n ArenaUserAuthTokenService,\n ArenaUserPrefs,\n ArenaUserPrefSurveys,\n ArenaUserProps,\n ArenaUserAuthRefreshToken,\n ArenaUserAuthRefreshTokenProps,\n ArenaUserAuthRefreshTokenPayload,\n ArenaUserService,\n ArenaUserTokenPayload,\n ArenaDownloadAuthTokenPayload,\n ArenaUserGroup,\n ArenaUserGroupProps,\n ArenaUserGroupQualifier,\n ArenaUserInvitation,\n} from './auth'\n\nexport { CategoryFactory, CategoryItemFactory, CategoryLevelFactory } from './category'\nexport type {\n ArenaCategoryItemProps,\n ArenaCategory,\n ArenaCategoryItem,\n ArenaCategoryLevel,\n ArenaCategoryLevelProps,\n ArenaCategoryProps,\n} from './category'\n\nexport { Categories, CategoryItems } from './category'\n\nexport { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain'\nexport type {\n ArenaChain,\n ArenaChainProps,\n ArenaChainNodeDef,\n ArenaChainNodeDefProps,\n ArenaChainNodeDefAggregate,\n ArenaChainNodeDefAggregateProps,\n} from './chain'\n\nexport { TraverseMethod } from './common'\nexport type { ArenaObject, ArenaService, ArenaDictionary, ArenaFactory, ArenaI18n } from './common'\n\nexport type { ArenaFlatDataExportOptions, ArenaExportInfoFactoryParams, ArenaExportInfo } from './dataExport'\nexport {\n FlatDataExportDefaultOptions,\n FlatDataExportOption,\n FlatDataFiles,\n FlatDataExportModel,\n FlatDataExportColumnDataType,\n ArenaExportFile,\n ArenaExportInfoFactory,\n ArenaExportType,\n UniqueFileNamesGenerator,\n} from './dataExport'\n\nexport { DataQueryMode, DataQuerySummaries } from './dataQuery'\nexport type { ArenaDataQuery, ArenaDataQuerySummary, ArenaDataQuerySummaryProps } from './dataQuery'\n\nexport { SystemError, SystemErrorKeys } from './error'\n\nexport {\n ExpressionNodeType,\n ExpressionNodeEvaluator,\n ExpressionVariable,\n JavascriptExpressionEvaluator,\n JavascriptExpressionParser,\n} from './expression'\nexport type {\n ArenaArrayExpression,\n ArenaBinaryExpression,\n ArenaCallExpression,\n ArenaCompoundExpression,\n ArenaConditionalExpression,\n ArenaExpressionContext,\n ArenaExpressionEvaluator,\n ArenaExpressionFunction,\n ArenaExpressionFunctions,\n ArenaAnyExpressionNode,\n ArenaExpressionNode,\n ArenaExpressionNodeEvaluatorConstructor,\n ArenaMemberExpression,\n ArenaIdentifierExpression,\n ArenaLiteralExpression,\n ArenaSequenceExpression,\n ArenaThisExpression,\n ArenaUnaryExpression,\n} from './expression'\n\nexport { ExtraPropDataType, ExtraPropsDataGenerator } from './extraProp'\nexport type { ArenaExtraPropDef, ArenaExtraPropDefs } from './extraProp'\n\nexport { PointFactory, Points } from './geo'\nexport type {\n ArenaAreaOfInterest,\n ArenaAreaOfInterestDescriptor,\n ArenaGeoPolygonFeature,\n ArenaGeoTrackFeature,\n ArenaGeoTrackFeatureProperties,\n ArenaPoint,\n} from './geo'\n\nexport { JobBase, JobEventType, JobStatus } from './job'\nexport type { ArenaJob, ArenaJobContext, ArenaJobEvent, ArenaJobSerialized, ArenaJobTxClient } from './job'\n\nexport { LanguageCode, Languages, LanguagesISO639part2 } from './language'\nexport type { ArenaLabels } from './language'\n\nexport type { ArenaLogger } from './logger'\n\nexport type { ArenaMessage } from './message'\nexport { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message'\n\nexport {\n RecordNodeFactory,\n RecordNodeKeys,\n RecordNodeMetaKeys,\n RecordNodes,\n RecordNodeValueFormatter,\n RecordNodeValues,\n} from './node'\nexport type {\n ArenaRecordNode,\n ArenaRecordNodeMeta,\n ArenaRecordNodePointer,\n ArenaRecordNodeRefData,\n ArenaRecordNodesMap,\n ArenaRecordNodeValue,\n ArenaRecordNodeValueCode,\n ArenaRecordNodeValueCoordinate,\n ArenaRecordNodeValueFile,\n ArenaRecordNodeValueGeo,\n ArenaRecordNodeValueTaxon,\n} from './node'\n\nexport {\n NodeDefCountType,\n NodeDefExpressionFactory,\n NodeDefType,\n NodeDefFactory,\n NodeDefs,\n NodeDefEntityRenderType,\n NodeDefFileType,\n NodeDefTextInputType,\n NodeDefTextRenderType,\n FormHeaderColor,\n} from './nodeDef'\n\nexport { NodeDefExpressionEvaluator, NodeDefExpressionValidator } from './nodeDefExpressionEvaluator'\nexport type {\n ArenaAreaOfInterestProvider,\n ArenaCategoryItemProvider,\n ArenaTaxonProvider,\n} from './nodeDefExpressionEvaluator'\n\nexport type {\n ArenaNodeDef,\n ArenaAnyNodeDef,\n ArenaNodeDefLayout,\n ArenaNodeDefMeta,\n ArenaNodeDefProps,\n ArenaNodeDefPropsWithLayout,\n ArenaNodeDefBoolean,\n ArenaNodeDefBooleanProps,\n ArenaNodeDefCode,\n ArenaNodeDefCodeLayout,\n ArenaNodeDefCodeProps,\n ArenaCoordinateAdditionalField,\n ArenaNodeDefCoordinate,\n ArenaNodeDefCoordinateProps,\n ArenaNodeDefDate,\n ArenaNodeDefDecimal,\n ArenaNodeDefDecimalProps,\n ArenaNodeDefEntity,\n ArenaNodeDefEntityChildPosition,\n ArenaNodeDefEntityLayout,\n ArenaNodeDefEntityLayoutChildItem,\n ArenaNodeDefEntityProps,\n ArenaNodeDefPrintOrientation,\n ArenaNodeDefFile,\n ArenaNodeDefFileProps,\n ArenaNodeDefGeo,\n ArenaNodeDefGeoProps,\n ArenaNodeDefFormHeader,\n ArenaNodeDefFormHeaderProps,\n ArenaNodeDefInteger,\n ArenaNodeDefPropsAdvanced,\n ArenaNodeDefTaxon,\n ArenaNodeDefTaxonProps,\n ArenaNodeDefText,\n ArenaNodeDefTextProps,\n ArenaNodeDefTextLayout,\n ArenaNodeDefTime,\n ArenaNodeDefTimeProps,\n ArenaNodeDefCountExpression,\n ArenaNodeDefExpression,\n ArenaNodeDefExpressionFactoryParams,\n ArenaNodeDefMap,\n ArenaNodeDefValidations,\n} from './nodeDef'\n\nexport {\n RecordNodePointers,\n RecordCloner,\n RecordFactory,\n RecordFixer,\n Records,\n RECORD_STEP_DEFAULT,\n RecordStepAnalysisCode,\n RecordStepCleansingCode,\n RecordStepEntryCode,\n RecordStepNames,\n RecordSteps,\n RecordStepsList,\n RecordExpressionEvaluator,\n RecordNodesUpdater,\n RecordPrettyPrinter,\n RecordUpdater,\n RecordUpdateResult,\n RecordValidator,\n RecordValidations,\n} from './record'\nexport type {\n ArenaAttributeValidatorParams,\n ArenaAttributesValidatorParams,\n ArenaRecordNodeCreateParams,\n ArenaRecordNodesUpdateParams,\n ArenaRecord,\n ArenaRecordExpressionContext,\n ArenaRecordExpressionEvaluationContext,\n ArenaRecordService,\n ArenaRecordStep,\n ArenaRecordSummary,\n ArenaRecordUpdateOptions,\n ArenaRecordValidatorParams,\n ArenaSortedAttributesValidatorParams,\n} from './record'\n\nexport { ServiceRegistry, ServiceType } from './registry'\nexport type { ArenaServiceTypeMap } from './registry'\n\nexport { DEFAULT_SRS, DEFAULT_SRS_INDEX, SRSFactory } from './srs'\nexport type { ArenaSRS, ArenaSRSIndex } from './srs'\n\nexport {\n NodeDefsFixer,\n SurveyDocImages,\n SurveyDocImageFactory,\n SurveyDocPlace,\n SurveyDependencyType,\n SurveyFactory,\n SurveyFileFactory,\n SurveyFileType,\n SurveyRefDataFactory,\n SurveySecurityProp,\n Surveys,\n surveyDocImagePropKeys,\n surveySecurityDefaults,\n defaultCycle,\n} from './survey'\nexport type {\n ArenaSurvey,\n ArenaSurveyCycle,\n ArenaSurveyDependency,\n ArenaSurveyDependencyGraph,\n ArenaSurveyDocImage,\n ArenaSurveyDocImageFactoryParams,\n ArenaSurveyDocImageProps,\n ArenaSurveyFile,\n ArenaSurveyFileFactoryParams,\n ArenaSurveyFileProps,\n ArenaSurveyNodeDefsIndex,\n ArenaSurveyProps,\n ArenaSurveyRefData,\n ArenaSurveySecurity,\n ArenaSurveyService,\n ArenaSurveyOrSummary,\n ArenaSurveySummary,\n} from './survey'\n\nexport { Taxa, Taxonomies, TaxonomyFactory, TaxonFactory, TaxonGenerator, VernacularNameFactory } from './taxonomy'\nexport type {\n ArenaVernacularNameParams,\n ArenaTaxonomyFactoryParams,\n ArenaTaxonFactoryParams,\n ArenaTaxonomy,\n ArenaVernacularNameProps,\n ArenaVernacularName,\n ArenaTaxonProps,\n ArenaTaxon,\n ArenaTaxonomyProps,\n} from './taxonomy'\n\nexport { SurveyBuilder, SurveyObjectBuilders } from './tests/builder/surveyBuilder'\nexport { RecordBuilder, RecordNodeBuilders } from './tests/builder/recordBuilder'\n\nexport {\n Arrays,\n DateFormats,\n Dates,\n FileNames,\n FileProcessor,\n Numbers,\n Objects,\n Promises,\n Queue,\n RetryProcessor,\n Strings,\n UnitOfTime,\n UUIDs,\n Versions,\n} from './utils'\n\nexport type {\n ArenaFileProcessorChunk,\n ArenaFileProcessorConstructorArgs,\n ArenaFileProcessorUriChunk,\n ArenaMutationOptions,\n ArenaParsedVersion,\n} from './utils'\n\nexport {\n FieldValidators,\n ValidationFactory,\n ValidationResultFactory,\n ValidationResults,\n Validations,\n ValidationSeverity,\n Validator,\n ValidatorErrorKeys,\n} from './validation'\nexport type {\n ArenaDissocFieldValidationOptions,\n ArenaFieldValidator,\n ArenaValidation,\n ArenaValidationFields,\n ArenaValidationResult,\n ArenaValidationCounts,\n} from './validation'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AACA,6BAAgC;AAAvB,+FAAA,QAAQ,OAAA;AAEjB,+BASe;AARb,kGAAA,UAAU,OAAA;AACV,qGAAA,aAAa,OAAA;AACb,+GAAA,uBAAuB,OAAA;AACvB,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,mGAAA,WAAW,OAAA;AACX,6FAAA,KAAK,OAAA;AAyBP,uCAAuF;AAA9E,2GAAA,eAAe,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAUnE,uCAAsD;AAA7C,sGAAA,UAAU,OAAA;AAAE,yGAAA,aAAa,OAAA;AAElC,iCAA4E;AAAnE,qGAAA,YAAY,OAAA;AAAE,wGAAA,eAAe,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAU3D,mCAAyC;AAAhC,wGAAA,cAAc,OAAA;AAIvB,2CAUqB;AATnB,0HAAA,4BAA4B,OAAA;AAC5B,kHAAA,oBAAoB,OAAA;AACpB,2GAAA,aAAa,OAAA;AACb,iHAAA,mBAAmB,OAAA;AACnB,0HAAA,4BAA4B,OAAA;AAC5B,6GAAA,eAAe,OAAA;AACf,oHAAA,sBAAsB,OAAA;AACtB,6GAAA,eAAe,OAAA;AACf,sHAAA,wBAAwB,OAAA;AAG1B,yCAA+D;AAAtD,0GAAA,aAAa,OAAA;AAAE,+GAAA,kBAAkB,OAAA;AAG1C,iCAAsD;AAA7C,oGAAA,WAAW,OAAA;AAAE,wGAAA,eAAe,OAAA;AAErC,2CAMqB;AALnB,g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a,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AAE1C,iCAegB;AAdd,+FAAA,MAAM,OAAA;AACN,oGAAA,WAAW,OAAA;AACX,8FAAA,KAAK,OAAA;AACL,kGAAA,SAAS,OAAA;AACT,sGAAA,aAAa,OAAA;AACb,gGAAA,OAAO,OAAA;AACP,gGAAA,OAAO,OAAA;AACP,iGAAA,QAAQ,OAAA;AACR,8FAAA,KAAK,OAAA;AACL,uGAAA,cAAc,OAAA;AACd,gGAAA,OAAO,OAAA;AACP,mGAAA,UAAU,OAAA;AACV,8FAAA,KAAK,OAAA;AACL,iGAAA,QAAQ,OAAA;AAWV,2CASqB;AARnB,6GAAA,eAAe,OAAA;AACf,+GAAA,iBAAiB,OAAA;AACjB,qHAAA,uBAAuB,OAAA;AACvB,+GAAA,iBAAiB,OAAA;AACjB,yGAAA,WAAW,OAAA;AACX,gHAAA,kBAAkB,OAAA;AAClB,uGAAA,SAAS,OAAA;AACT,gHAAA,kBAAkB,OAAA","sourcesContent":["export type { ArenaAppInfo, ArenaAppPlatform } from './app'\nexport { AppInfos } from './app'\n\nexport {\n Authorizer,\n AuthGroupName,\n createDefaultAuthGroups,\n UserStatus,\n Permission,\n UserTitle,\n UserFactory,\n Users,\n} from './auth'\nexport type {\n ArenaAuthGroup,\n ArenaUser,\n ArenaUserAuthGroup,\n ArenaUserAuthGroupProps,\n ArenaAuthToken,\n ArenaUserAuthTokenPayload,\n ArenaUserAuthTokenService,\n ArenaUserPrefs,\n ArenaUserPrefSurveys,\n ArenaUserProps,\n ArenaUserAuthRefreshToken,\n ArenaUserAuthRefreshTokenProps,\n ArenaUserAuthRefreshTokenPayload,\n ArenaUserService,\n ArenaUserTokenPayload,\n ArenaDownloadAuthTokenPayload,\n ArenaUserGroup,\n ArenaUserGroupProps,\n ArenaUserGroupQualifier,\n ArenaUserInvitation,\n} from './auth'\n\nexport { CategoryFactory, CategoryItemFactory, CategoryLevelFactory } from './category'\nexport type {\n ArenaCategoryItemProps,\n ArenaCategory,\n ArenaCategoryItem,\n ArenaCategoryLevel,\n ArenaCategoryLevelProps,\n ArenaCategoryProps,\n} from './category'\n\nexport { Categories, CategoryItems } from './category'\n\nexport { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain'\nexport type {\n ArenaChain,\n ArenaChainProps,\n ArenaChainNodeDef,\n ArenaChainNodeDefProps,\n ArenaChainNodeDefAggregate,\n ArenaChainNodeDefAggregateProps,\n} from './chain'\n\nexport { TraverseMethod } from './common'\nexport type { ArenaObject, ArenaService, ArenaDictionary, ArenaFactory, ArenaI18n } from './common'\n\nexport type { ArenaFlatDataExportOptions, ArenaExportInfoFactoryParams, ArenaExportInfo } from './dataExport'\nexport {\n FlatDataExportDefaultOptions,\n FlatDataExportOption,\n FlatDataFiles,\n FlatDataExportModel,\n FlatDataExportColumnDataType,\n ArenaExportFile,\n ArenaExportInfoFactory,\n ArenaExportType,\n UniqueFileNamesGenerator,\n} from './dataExport'\n\nexport { DataQueryMode, DataQuerySummaries } from './dataQuery'\nexport type { ArenaDataQuery, ArenaDataQuerySummary, ArenaDataQuerySummaryProps } from './dataQuery'\n\nexport { SystemError, SystemErrorKeys } from './error'\n\nexport {\n ExpressionNodeType,\n ExpressionNodeEvaluator,\n ExpressionVariable,\n JavascriptExpressionEvaluator,\n JavascriptExpressionParser,\n} from './expression'\nexport type {\n ArenaArrayExpression,\n ArenaBinaryExpression,\n ArenaCallExpression,\n ArenaCompoundExpression,\n ArenaConditionalExpression,\n ArenaExpressionContext,\n ArenaExpressionEvaluator,\n ArenaExpressionFunction,\n ArenaExpressionFunctions,\n ArenaAnyExpressionNode,\n ArenaExpressionNode,\n ArenaExpressionNodeEvaluatorConstructor,\n ArenaMemberExpression,\n ArenaIdentifierExpression,\n ArenaLiteralExpression,\n ArenaSequenceExpression,\n ArenaThisExpression,\n ArenaUnaryExpression,\n} from './expression'\n\nexport { ExtraPropDataType, ExtraPropsDataGenerator } from './extraProp'\nexport type { ArenaExtraPropDef, ArenaExtraPropDefs } from './extraProp'\n\nexport { PointFactory, Points } from './geo'\nexport type {\n ArenaAreaOfInterest,\n ArenaAreaOfInterestDescriptor,\n ArenaGeoPolygonFeature,\n ArenaGeoTrackFeature,\n ArenaGeoTrackFeatureProperties,\n ArenaPoint,\n} from './geo'\n\nexport { JobBase, JobEventType, JobStatus } from './job'\nexport type { ArenaJob, ArenaJobContext, ArenaJobEvent, ArenaJobSerialized, ArenaJobTxClient } from './job'\n\nexport { LanguageCode, Languages, LanguagesISO639part2 } from './language'\nexport type { ArenaLabels } from './language'\n\nexport type { ArenaLogger } from './logger'\n\nexport type { ArenaMessage } from './message'\nexport { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message'\n\nexport {\n RecordNodeFactory,\n RecordNodeKeys,\n RecordNodeMetaKeys,\n RecordNodes,\n RecordNodeValueFormatter,\n RecordNodeValues,\n} from './node'\nexport type {\n ArenaRecordNode,\n ArenaRecordNodeMeta,\n ArenaRecordNodePointer,\n ArenaRecordNodeRefData,\n ArenaRecordNodesMap,\n ArenaRecordNodeUpdateOptions,\n ArenaRecordNodeValue,\n ArenaRecordNodeValueCode,\n ArenaRecordNodeValueCoordinate,\n ArenaRecordNodeValueFile,\n ArenaRecordNodeValueGeo,\n ArenaRecordNodeValueTaxon,\n} from './node'\n\nexport {\n NodeDefCountType,\n NodeDefExpressionFactory,\n NodeDefType,\n NodeDefFactory,\n NodeDefs,\n NodeDefEntityRenderType,\n NodeDefFileType,\n NodeDefTextInputType,\n NodeDefTextRenderType,\n FormHeaderColor,\n} from './nodeDef'\n\nexport { NodeDefExpressionEvaluator, NodeDefExpressionValidator } from './nodeDefExpressionEvaluator'\nexport type {\n ArenaAreaOfInterestProvider,\n ArenaCategoryItemProvider,\n ArenaTaxonProvider,\n} from './nodeDefExpressionEvaluator'\n\nexport type {\n ArenaNodeDef,\n ArenaAnyNodeDef,\n ArenaNodeDefLayout,\n ArenaNodeDefMeta,\n ArenaNodeDefProps,\n ArenaNodeDefPropsWithLayout,\n ArenaNodeDefBoolean,\n ArenaNodeDefBooleanProps,\n ArenaNodeDefCode,\n ArenaNodeDefCodeLayout,\n ArenaNodeDefCodeProps,\n ArenaCoordinateAdditionalField,\n ArenaNodeDefCoordinate,\n ArenaNodeDefCoordinateProps,\n ArenaNodeDefDate,\n ArenaNodeDefDecimal,\n ArenaNodeDefDecimalProps,\n ArenaNodeDefEntity,\n ArenaNodeDefEntityChildPosition,\n ArenaNodeDefEntityLayout,\n ArenaNodeDefEntityLayoutChildItem,\n ArenaNodeDefEntityProps,\n ArenaNodeDefPrintOrientation,\n ArenaNodeDefFile,\n ArenaNodeDefFileProps,\n ArenaNodeDefGeo,\n ArenaNodeDefGeoProps,\n ArenaNodeDefFormHeader,\n ArenaNodeDefFormHeaderProps,\n ArenaNodeDefInteger,\n ArenaNodeDefPropsAdvanced,\n ArenaNodeDefTaxon,\n ArenaNodeDefTaxonProps,\n ArenaNodeDefText,\n ArenaNodeDefTextProps,\n ArenaNodeDefTextLayout,\n ArenaNodeDefTime,\n ArenaNodeDefTimeProps,\n ArenaNodeDefCountExpression,\n ArenaNodeDefExpression,\n ArenaNodeDefExpressionFactoryParams,\n ArenaNodeDefMap,\n ArenaNodeDefValidations,\n} from './nodeDef'\n\nexport {\n RecordNodePointers,\n RecordCloner,\n RecordFactory,\n RecordFixer,\n Records,\n RECORD_STEP_DEFAULT,\n RecordStepAnalysisCode,\n RecordStepCleansingCode,\n RecordStepEntryCode,\n RecordStepNames,\n RecordSteps,\n RecordStepsList,\n RecordExpressionEvaluator,\n RecordNodesUpdater,\n RecordPrettyPrinter,\n RecordUpdater,\n RecordUpdateResult,\n RecordValidator,\n RecordValidations,\n} from './record'\nexport type {\n ArenaAttributeValidatorParams,\n ArenaAttributesValidatorParams,\n ArenaRecordNodeCreateParams,\n ArenaRecordNodesUpdateParams,\n ArenaRecord,\n ArenaRecordExpressionContext,\n ArenaRecordExpressionEvaluationContext,\n ArenaRecordService,\n ArenaRecordStep,\n ArenaRecordSummary,\n ArenaRecordUpdateOptions,\n ArenaRecordValidatorParams,\n ArenaSortedAttributesValidatorParams,\n} from './record'\n\nexport { ServiceRegistry, ServiceType } from './registry'\nexport type { ArenaServiceTypeMap } from './registry'\n\nexport { DEFAULT_SRS, DEFAULT_SRS_INDEX, SRSFactory } from './srs'\nexport type { ArenaSRS, ArenaSRSIndex } from './srs'\n\nexport {\n NodeDefsFixer,\n SurveyDocImages,\n SurveyDocImageFactory,\n SurveyDocPlace,\n SurveyDependencyType,\n SurveyFactory,\n SurveyFileFactory,\n SurveyFileType,\n SurveyRefDataFactory,\n SurveySecurityProp,\n Surveys,\n surveyDocImagePropKeys,\n surveySecurityDefaults,\n defaultCycle,\n} from './survey'\nexport type {\n ArenaSurvey,\n ArenaSurveyCycle,\n ArenaSurveyDependency,\n ArenaSurveyDependencyGraph,\n ArenaSurveyDocImage,\n ArenaSurveyDocImageFactoryParams,\n ArenaSurveyDocImageProps,\n ArenaSurveyFile,\n ArenaSurveyFileFactoryParams,\n ArenaSurveyFileProps,\n ArenaSurveyNodeDefsIndex,\n ArenaSurveyProps,\n ArenaSurveyRefData,\n ArenaSurveySecurity,\n ArenaSurveyService,\n ArenaSurveyOrSummary,\n ArenaSurveySummary,\n} from './survey'\n\nexport { Taxa, Taxonomies, TaxonomyFactory, TaxonFactory, TaxonGenerator, VernacularNameFactory } from './taxonomy'\nexport type {\n ArenaVernacularNameParams,\n ArenaTaxonomyFactoryParams,\n ArenaTaxonFactoryParams,\n ArenaTaxonomy,\n ArenaVernacularNameProps,\n ArenaVernacularName,\n ArenaTaxonProps,\n ArenaTaxon,\n ArenaTaxonomyProps,\n} from './taxonomy'\n\nexport { SurveyBuilder, SurveyObjectBuilders } from './tests/builder/surveyBuilder'\nexport { RecordBuilder, RecordNodeBuilders } from './tests/builder/recordBuilder'\n\nexport {\n Arrays,\n DateFormats,\n Dates,\n FileNames,\n FileProcessor,\n Numbers,\n Objects,\n Promises,\n Queue,\n RetryProcessor,\n Strings,\n UnitOfTime,\n UUIDs,\n Versions,\n} from './utils'\n\nexport type {\n ArenaFileProcessorChunk,\n ArenaFileProcessorConstructorArgs,\n ArenaFileProcessorUriChunk,\n ArenaMutationOptions,\n ArenaParsedVersion,\n} from './utils'\n\nexport {\n FieldValidators,\n ValidationFactory,\n ValidationResultFactory,\n ValidationResults,\n Validations,\n ValidationSeverity,\n Validator,\n ValidatorErrorKeys,\n} from './validation'\nexport type {\n ArenaDissocFieldValidationOptions,\n ArenaFieldValidator,\n ArenaValidation,\n ArenaValidationFields,\n ArenaValidationResult,\n ArenaValidationCounts,\n} from './validation'\n"]}
@@ -4,5 +4,6 @@ export type { ArenaRecordNodePointer } from './nodePointer';
4
4
  export type { ArenaRecordNodeValue, ArenaRecordNodeValueCode, ArenaRecordNodeValueCoordinate, ArenaRecordNodeValueFile, ArenaRecordNodeValueGeo, ArenaRecordNodeValueTaxon, } from './nodeValue';
5
5
  export { RecordNodeFactory } from './factory';
6
6
  export { RecordNodes } from './nodes';
7
+ export type { ArenaRecordNodeUpdateOptions } from './nodes';
7
8
  export { RecordNodeValueFormatter } from './nodeValueFormatter';
8
9
  export { RecordNodeValues } from './nodeValues';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;AAEA,+BAA2D;AAAlD,sGAAA,cAAc,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAa3C,qCAA6C;AAApC,4GAAA,iBAAiB,OAAA;AAE1B,iCAAqC;AAA5B,oGAAA,WAAW,OAAA;AAEpB,2DAA+D;AAAtD,8HAAA,wBAAwB,OAAA;AAEjC,2CAA+C;AAAtC,8GAAA,gBAAgB,OAAA","sourcesContent":["export type { ArenaRecordNode, ArenaRecordNodeMeta, ArenaRecordNodeRefData, ArenaRecordNodesMap } from './node'\n\nexport { RecordNodeKeys, RecordNodeMetaKeys } from './node'\n\nexport type { ArenaRecordNodePointer } from './nodePointer'\n\nexport type {\n ArenaRecordNodeValue,\n ArenaRecordNodeValueCode,\n ArenaRecordNodeValueCoordinate,\n ArenaRecordNodeValueFile,\n ArenaRecordNodeValueGeo,\n ArenaRecordNodeValueTaxon,\n} from './nodeValue'\n\nexport { RecordNodeFactory } from './factory'\n\nexport { RecordNodes } from './nodes'\n\nexport { RecordNodeValueFormatter } from './nodeValueFormatter'\n\nexport { RecordNodeValues } from './nodeValues'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;AAEA,+BAA2D;AAAlD,sGAAA,cAAc,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAa3C,qCAA6C;AAApC,4GAAA,iBAAiB,OAAA;AAE1B,iCAAqC;AAA5B,oGAAA,WAAW,OAAA;AAGpB,2DAA+D;AAAtD,8HAAA,wBAAwB,OAAA;AAEjC,2CAA+C;AAAtC,8GAAA,gBAAgB,OAAA","sourcesContent":["export type { ArenaRecordNode, ArenaRecordNodeMeta, ArenaRecordNodeRefData, ArenaRecordNodesMap } from './node'\n\nexport { RecordNodeKeys, RecordNodeMetaKeys } from './node'\n\nexport type { ArenaRecordNodePointer } from './nodePointer'\n\nexport type {\n ArenaRecordNodeValue,\n ArenaRecordNodeValueCode,\n ArenaRecordNodeValueCoordinate,\n ArenaRecordNodeValueFile,\n ArenaRecordNodeValueGeo,\n ArenaRecordNodeValueTaxon,\n} from './nodeValue'\n\nexport { RecordNodeFactory } from './factory'\n\nexport { RecordNodes } from './nodes'\nexport type { ArenaRecordNodeUpdateOptions } from './nodes'\n\nexport { RecordNodeValueFormatter } from './nodeValueFormatter'\n\nexport { RecordNodeValues } from './nodeValues'\n"]}
@@ -7,7 +7,7 @@ type FormatParams = {
7
7
  cycle: string;
8
8
  nodeDef: ArenaAnyNodeDef;
9
9
  node?: ArenaRecordNode;
10
- value: any;
10
+ value: unknown;
11
11
  showLabel?: boolean;
12
12
  quoteLabels?: boolean;
13
13
  lang?: LanguageCode;
@@ -70,6 +70,7 @@ const formatters = {
70
70
  return quoteLabels ? utils_1.Strings.quote(value) : value;
71
71
  },
72
72
  };
73
+ // any: null when the category item or taxon is not found, the raw value for types without a formatter
73
74
  const format = (params) => {
74
75
  const { nodeDef, value } = params;
75
76
  if (utils_1.Objects.isEmpty(value)) {
@@ -1 +1 @@
1
- {"version":3,"file":"nodeValueFormatter.js","sourceRoot":"","sources":["../../src/node/nodeValueFormatter.ts"],"names":[],"mappings":";;;AAAA,0CAA8D;AAE9D,wCAA0G;AAC1G,sCAAgD;AAChD,0CAAkC;AAClC,oCAAwE;AAExE,6CAA+C;AAE/C,MAAM,mBAAmB,GAAG,CAAC,MAI5B,EAAiC,EAAE;;;IAClC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAEtC,MAAM,QAAQ,GAAG,6BAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACzD,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAA;IAE/B,MAAM,IAAI,SAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,YAAY,mCAAI,gBAAO,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC/F,yDAAyD;IACzD,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,KAAI,eAAO,CAAC,UAAU,CAAC,wBAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AAC1F,CAAC,CAAA;AAaD,MAAM,UAAU,GAA6D;IAC3E,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,CAAC,MAAoB,EAAE,EAAE;QAC3C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,M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C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IACjC,IAAI,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,kBAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;IACvD,MAAM,WAAW,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,iCAAM,MAAM,KAAE,KAAK,EAAE,CAAC,IAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEpF,OAAO,kBAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AACtH,CAAC,CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,MAAM;CACP,CAAA","sourcesContent":["import { ArenaCategoryItem, CategoryItems } from '../category'\nimport { LanguageCode } from '../language'\nimport { ArenaAnyNodeDef, ArenaNodeDefCode, ArenaNodeDefDecimal, NodeDefs, NodeDefType } from '../nodeDef'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { Taxa } from '../taxonomy'\nimport { DateFormats, Dates, Numbers, Objects, Strings } from '../utils'\nimport { ArenaRecordNode } from './node'\nimport { RecordNodeValues } from './nodeValues'\n\nconst extractCategoryItem = (params: {\n survey: ArenaSurvey\n node?: ArenaRecordNode\n value: any\n}): ArenaCategoryItem | undefined => {\n const { survey, node, value } = params\n\n const itemUuid = RecordNodeValues.getValueItemUuid(value)\n if (!itemUuid) return undefined\n\n const item = node?.refData?.categoryItem ?? Surveys.getCategoryItemByUuid({ survey, itemUuid })\n // check the validity of the reference data category item\n return item?.props && Objects.isNotEmpty(CategoryItems.getCode(item)) ? item : undefined\n}\n\ntype FormatParams = {\n survey: ArenaSurvey\n cycle: string\n nodeDef: ArenaAnyNodeDef\n node?: ArenaRecordNode\n value: any\n showLabel?: boolean\n quoteLabels?: boolean\n lang?: LanguageCode\n}\n\nconst formatters: { [key in NodeDefType]?: (params: FormatParams) => any } = {\n [NodeDefType.code]: (params: FormatParams) => {\n const { survey, cycle, nodeDef, node, value, showLabel, quoteLabels, lang } = params\n\n if (!showLabel) {\n // item code already inside value, no need to get category item\n const itemCode = RecordNodeValues.getValueCode(value)\n if (!Objects.isEmpty(itemCode)) return itemCode\n }\n const categoryItem = extractCategoryItem({ survey, node, value })\n if (!categoryItem) return null\n\n if (showLabel) {\n let result\n if (NodeDefs.isCodeShown(cycle)(nodeDef as ArenaNodeDefCode)) {\n result = CategoryItems.getLabelWithCode(categoryItem, lang!)\n } else {\n result = CategoryItems.getLabel(categoryItem, lang!, true)\n }\n return quoteLabels ? Strings.quote(result) : result\n }\n return CategoryItems.getCode(categoryItem)\n },\n [NodeDefType.date]: (params: FormatParams) => {\n const { value } = params\n const dateParsed = Dates.parseISO(value)\n return Dates.format(dateParsed, DateFormats.dateDisplay)\n },\n [NodeDefType.decimal]: (params: FormatParams) => {\n const { value, nodeDef } = params\n return Numbers.formatDecimal(value, NodeDefs.getMaxNumberDecimalDigits(nodeDef as ArenaNodeDefDecimal))\n },\n [NodeDefType.integer]: (params: FormatParams) => {\n const { value } = params\n return Numbers.formatInteger(Number(value))\n },\n [NodeDefType.taxon]: (params: FormatParams) => {\n const { survey, value, showLabel } = params\n const taxonUuid = RecordNodeValues.getValueTaxonUuid(value)\n if (!taxonUuid) return null\n const taxon = Surveys.getTaxonByUuid({ survey, taxonUuid })\n if (!taxon) return null\n return showLabel ? Taxa.getScientificName(taxon) : Taxa.getCode(taxon)\n },\n [NodeDefType.text]: (params: FormatParams) => {\n const { value, quoteLabels } = params\n return quoteLabels ? Strings.quote(value) : value\n },\n}\n\nconst format = (params: FormatParams) => {\n const { nodeDef, value } = params\n if (Objects.isEmpty(value)) {\n return ''\n }\n const formatter = formatters[NodeDefs.getType(nodeDef)]\n const formatValue = (v: any) => (formatter ? formatter({ ...params, value: v }) : v)\n\n return NodeDefs.isMultiple(nodeDef) && Array.isArray(value) ? value.map(formatValue).join(', ') : formatValue(value)\n}\n\nexport const RecordNodeValueFormatter = {\n format,\n}\n"]}
1
+ {"version":3,"file":"nodeValueFormatter.js","sourceRoot":"","sources":["../../src/node/nodeValueFormatter.ts"],"names":[],"mappings":";;;AAAA,0CAA8D;AAE9D,wCAA0G;AAC1G,sCAAgD;AAChD,0CAAkC;AAClC,oCAAwE;AAExE,6CAA+C;AAE/C,MAAM,mBAAmB,GAAG,CAAC,MAI5B,EAAiC,EAAE;;;IAClC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAEtC,MAAM,QAAQ,GAAG,6BAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACzD,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAA;IAE/B,MAAM,IAAI,SAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,YAAY,mCAAI,gBAAO,CAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC/F,yDAAyD;IACzD,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,KAAI,eAAO,CAAC,UAAU,CAAC,wBAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AAC1F,CAAC,CAAA;AAcD,MAAM,UAAU,GAAiE;IAC/E,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,CAAC,MAAoB,EAAE,EAAE;QAC3C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI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;CACF,CAAA;AAED,sGAAsG;AACtG,MAAM,MAAM,GAAG,CAAC,MAAoB,EAAO,EAAE;IAC3C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IACjC,IAAI,eAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,kBAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;IACvD,MAAM,WAAW,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,iCAAM,MAAM,KAAE,KAAK,EAAE,CAAC,IAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAExF,OAAO,kBAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AACtH,CAAC,CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,MAAM;CACP,CAAA","sourcesContent":["import { ArenaCategoryItem, CategoryItems } from '../category'\nimport { LanguageCode } from '../language'\nimport { ArenaAnyNodeDef, ArenaNodeDefCode, ArenaNodeDefDecimal, NodeDefs, NodeDefType } from '../nodeDef'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { Taxa } from '../taxonomy'\nimport { DateFormats, Dates, Numbers, Objects, Strings } from '../utils'\nimport { ArenaRecordNode } from './node'\nimport { RecordNodeValues } from './nodeValues'\n\nconst extractCategoryItem = (params: {\n survey: ArenaSurvey\n node?: ArenaRecordNode\n value: unknown\n}): ArenaCategoryItem | undefined => {\n const { survey, node, value } = params\n\n const itemUuid = RecordNodeValues.getValueItemUuid(value)\n if (!itemUuid) return undefined\n\n const item = node?.refData?.categoryItem ?? Surveys.getCategoryItemByUuid({ survey, itemUuid })\n // check the validity of the reference data category item\n return item?.props && Objects.isNotEmpty(CategoryItems.getCode(item)) ? item : undefined\n}\n\ntype FormatParams = {\n survey: ArenaSurvey\n cycle: string\n nodeDef: ArenaAnyNodeDef\n node?: ArenaRecordNode\n // a node value, or an array of values for multiple attributes\n value: unknown\n showLabel?: boolean\n quoteLabels?: boolean\n lang?: LanguageCode\n}\n\nconst formatters: { [key in NodeDefType]?: (params: FormatParams) => unknown } = {\n [NodeDefType.code]: (params: FormatParams) => {\n const { survey, cycle, nodeDef, node, value, showLabel, quoteLabels, lang } = params\n\n if (!showLabel) {\n // item code already inside value, no need to get category item\n const itemCode = RecordNodeValues.getValueCode(value)\n if (!Objects.isEmpty(itemCode)) return itemCode\n }\n const categoryItem = extractCategoryItem({ survey, node, value })\n if (!categoryItem) return null\n\n if (showLabel) {\n let result\n if (NodeDefs.isCodeShown(cycle)(nodeDef as ArenaNodeDefCode)) {\n result = CategoryItems.getLabelWithCode(categoryItem, lang!)\n } else {\n result = CategoryItems.getLabel(categoryItem, lang!, true)\n }\n return quoteLabels ? Strings.quote(result) : result\n }\n return CategoryItems.getCode(categoryItem)\n },\n [NodeDefType.date]: (params: FormatParams) => {\n const { value } = params\n const dateParsed = Dates.parseISO(value as string)\n return Dates.format(dateParsed, DateFormats.dateDisplay)\n },\n [NodeDefType.decimal]: (params: FormatParams) => {\n const { value, nodeDef } = params\n return Numbers.formatDecimal(value as number, NodeDefs.getMaxNumberDecimalDigits(nodeDef as ArenaNodeDefDecimal))\n },\n [NodeDefType.integer]: (params: FormatParams) => {\n const { value } = params\n return Numbers.formatInteger(Number(value))\n },\n [NodeDefType.taxon]: (params: FormatParams) => {\n const { survey, value, showLabel } = params\n const taxonUuid = RecordNodeValues.getValueTaxonUuid(value)\n if (!taxonUuid) return null\n const taxon = Surveys.getTaxonByUuid({ survey, taxonUuid })\n if (!taxon) return null\n return showLabel ? Taxa.getScientificName(taxon) : Taxa.getCode(taxon)\n },\n [NodeDefType.text]: (params: FormatParams) => {\n const { value, quoteLabels } = params\n return quoteLabels ? Strings.quote(value as string) : value\n },\n}\n\n// any: null when the category item or taxon is not found, the raw value for types without a formatter\nconst format = (params: FormatParams): any => {\n const { nodeDef, value } = params\n if (Objects.isEmpty(value)) {\n return ''\n }\n const formatter = formatters[NodeDefs.getType(nodeDef)]\n const formatValue = (v: unknown) => (formatter ? formatter({ ...params, value: v }) : v)\n\n return NodeDefs.isMultiple(nodeDef) && Array.isArray(value) ? value.map(formatValue).join(', ') : formatValue(value)\n}\n\nexport const RecordNodeValueFormatter = {\n format,\n}\n"]}
@@ -1,6 +1,16 @@
1
1
  import { ArenaNodeDef, NodeDefCountType } from '../nodeDef';
2
2
  import { ArenaMutationOptions } from '../utils/mutationOptions';
3
3
  import { ArenaRecordNode } from './node';
4
+ /**
5
+ * Options of the node update functions.
6
+ */
7
+ export interface ArenaRecordNodeUpdateOptions extends ArenaMutationOptions {
8
+ /**
9
+ * Date of the modification (formatted for storage); the same date is used for all the nodes modified in the same record update.
10
+ * @default now
11
+ */
12
+ dateModified?: string;
13
+ }
4
14
  declare const isRoot: (node: ArenaRecordNode) => boolean;
5
15
  declare const areEqual: (nodeA: ArenaRecordNode, nodeB: ArenaRecordNode) => boolean;
6
16
  declare const isChildApplicable: (node: ArenaRecordNode, nodeDefUuid: string) => boolean;
@@ -28,7 +38,7 @@ declare const isQualifierValueApplied: (node: ArenaRecordNode) => boolean;
28
38
  declare const isValueBlank: (node: ArenaRecordNode) => boolean;
29
39
  declare const isValueNotBlank: (node: ArenaRecordNode) => boolean;
30
40
  declare const hasUserInputValue: (node: ArenaRecordNode) => boolean;
31
- declare const assocChildApplicability: (node: ArenaRecordNode, nodeDefUuid: string, applicable: boolean) => ArenaRecordNode;
41
+ declare const assocChildApplicability: (node: ArenaRecordNode, nodeDefUuid: string, applicable: boolean, options?: Omit<ArenaRecordNodeUpdateOptions, 'sideEffect'>) => ArenaRecordNode;
32
42
  declare const dissocChildApplicability: (node: ArenaRecordNode, nodeDefUuid: string) => {
33
43
  dateCreated?: string;
34
44
  dateModified?: string;
@@ -69,30 +79,33 @@ declare const dissocChildApplicability: (node: ArenaRecordNode, nodeDefUuid: str
69
79
  };
70
80
  };
71
81
  };
72
- declare function assocChildEditable(node: ArenaRecordNode, nodeDefUuid: string, editable: boolean, options?: ArenaMutationOptions): ArenaRecordNode;
73
- declare const assocChildRequired: (node: ArenaRecordNode, nodeDefUuid: string, required: boolean, options?: ArenaMutationOptions) => ArenaRecordNode;
74
- declare function assocChildVisible(node: ArenaRecordNode, nodeDefUuid: string, visible: boolean, options?: ArenaMutationOptions): ArenaRecordNode;
82
+ declare function assocChildEditable(node: ArenaRecordNode, nodeDefUuid: string, editable: boolean, options?: ArenaRecordNodeUpdateOptions): ArenaRecordNode;
83
+ declare const assocChildRequired: (node: ArenaRecordNode, nodeDefUuid: string, required: boolean, options?: ArenaRecordNodeUpdateOptions) => ArenaRecordNode;
84
+ declare function assocChildVisible(node: ArenaRecordNode, nodeDefUuid: string, visible: boolean, options?: ArenaRecordNodeUpdateOptions): ArenaRecordNode;
75
85
  declare const assocChildrenCount: (params: {
76
86
  node: ArenaRecordNode;
77
87
  nodeDefUuid: string;
78
88
  count: number;
79
89
  countType: NodeDefCountType;
90
+ dateModified?: string;
80
91
  }) => ArenaRecordNode;
81
92
  declare const assocChildrenMaxCount: (params: {
82
93
  node: ArenaRecordNode;
83
94
  nodeDefUuid: string;
84
95
  count: number;
96
+ dateModified?: string;
85
97
  }) => ArenaRecordNode;
86
98
  declare const assocChildrenMinCount: (params: {
87
99
  node: ArenaRecordNode;
88
100
  nodeDefUuid: string;
89
101
  count: number;
102
+ dateModified?: string;
90
103
  }) => ArenaRecordNode;
91
104
  declare const removeStatusFlags: ({ node, sideEffect, }: {
92
105
  node: ArenaRecordNode;
93
106
  sideEffect?: boolean;
94
107
  }) => ArenaRecordNode;
95
- declare function assocValue(node: ArenaRecordNode, value: any, options?: ArenaMutationOptions): ArenaRecordNode;
108
+ declare function assocValue(node: ArenaRecordNode, value: any, options?: ArenaRecordNodeUpdateOptions): ArenaRecordNode;
96
109
  export declare const RecordNodes: {
97
110
  isRoot: typeof isRoot;
98
111
  areEqual: typeof areEqual;
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.RecordNodes = void 0;
15
15
  const nodeDef_1 = require("../nodeDef");
16
16
  const utils_1 = require("../utils");
17
+ const getDateModified = (options) => { var _a; return (_a = options === null || options === void 0 ? void 0 : options.dateModified) !== null && _a !== void 0 ? _a : utils_1.Dates.nowFormattedForStorage(); };
17
18
  const isRoot = (node) => !node.parentUuid;
18
19
  const areEqual = (nodeA, nodeB) => nodeA.uuid === nodeB.uuid;
19
20
  const isChildApplicable = (node, nodeDefUuid) => {
@@ -58,7 +59,7 @@ const isQualifierValueApplied = (node) => { var _a; var _b; return (_b = (_a = n
58
59
  const isValueBlank = (node) => utils_1.Objects.isEmpty(node.value);
59
60
  const isValueNotBlank = (node) => utils_1.Objects.isNotEmpty(node.value);
60
61
  const hasUserInputValue = (node) => node && !isValueBlank(node) && !isDefaultValueApplied(node) && !isQualifierValueApplied(node);
61
- const assocChildApplicability = (node, nodeDefUuid, applicable) => {
62
+ const assocChildApplicability = (node, nodeDefUuid, applicable, options) => {
62
63
  var _a;
63
64
  const childApplicability = Object.assign({}, (_a = node.meta) === null || _a === void 0 ? void 0 : _a.childApplicability);
64
65
  if (!applicable) {
@@ -67,7 +68,7 @@ const assocChildApplicability = (node, nodeDefUuid, applicable) => {
67
68
  else {
68
69
  delete childApplicability[nodeDefUuid];
69
70
  }
70
- return Object.assign(Object.assign({}, node), { meta: Object.assign(Object.assign({}, node.meta), { childApplicability }), updated: true, dateModified: utils_1.Dates.nowFormattedForStorage() });
71
+ return Object.assign(Object.assign({}, node), { meta: Object.assign(Object.assign({}, node.meta), { childApplicability }), updated: true, dateModified: getDateModified(options) });
71
72
  };
72
73
  const dissocChildApplicability = (node, nodeDefUuid) => {
73
74
  var _a;
@@ -75,7 +76,7 @@ const dissocChildApplicability = (node, nodeDefUuid) => {
75
76
  delete childApplicability[nodeDefUuid];
76
77
  return Object.assign(Object.assign({}, node), { meta: Object.assign(Object.assign({}, node.meta), { childApplicability }) });
77
78
  };
78
- const updateMetaDictionary = ({ node, nodeDefUuid, propName, propValue, defaultValue = true, sideEffect, }) => {
79
+ const updateMetaDictionary = ({ node, nodeDefUuid, propName, propValue, defaultValue = true, sideEffect, dateModified, }) => {
79
80
  var _a, _b;
80
81
  const nodeUpdated = sideEffect ? node : Object.assign({}, node);
81
82
  const metaOriginal = (_a = nodeUpdated.meta) !== null && _a !== void 0 ? _a : {};
@@ -92,15 +93,15 @@ const updateMetaDictionary = ({ node, nodeDefUuid, propName, propValue, defaultV
92
93
  meta[propName] = dictionary;
93
94
  nodeUpdated.meta = meta;
94
95
  nodeUpdated.updated = true;
95
- nodeUpdated.dateModified = utils_1.Dates.nowFormattedForStorage();
96
+ nodeUpdated.dateModified = getDateModified({ dateModified });
96
97
  return nodeUpdated;
97
98
  };
98
99
  function assocChildEditable(node, nodeDefUuid, editable, options) {
99
- const { sideEffect = false } = options !== null && options !== void 0 ? options : {};
100
- return updateMetaDictionary({ node, nodeDefUuid, propName: 'cEdit', propValue: editable, sideEffect });
100
+ const { sideEffect = false, dateModified } = options !== null && options !== void 0 ? options : {};
101
+ return updateMetaDictionary({ node, nodeDefUuid, propName: 'cEdit', propValue: editable, sideEffect, dateModified });
101
102
  }
102
103
  const assocChildRequired = (node, nodeDefUuid, required, options) => {
103
- const { sideEffect = false } = options !== null && options !== void 0 ? options : {};
104
+ const { sideEffect = false, dateModified } = options !== null && options !== void 0 ? options : {};
104
105
  return updateMetaDictionary({
105
106
  node,
106
107
  nodeDefUuid,
@@ -108,15 +109,16 @@ const assocChildRequired = (node, nodeDefUuid, required, options) => {
108
109
  propValue: required,
109
110
  defaultValue: false,
110
111
  sideEffect,
112
+ dateModified,
111
113
  });
112
114
  };
113
115
  function assocChildVisible(node, nodeDefUuid, visible, options) {
114
- const { sideEffect = false } = options !== null && options !== void 0 ? options : {};
115
- return updateMetaDictionary({ node, nodeDefUuid, propName: 'cVis', propValue: visible, sideEffect });
116
+ const { sideEffect = false, dateModified } = options !== null && options !== void 0 ? options : {};
117
+ return updateMetaDictionary({ node, nodeDefUuid, propName: 'cVis', propValue: visible, sideEffect, dateModified });
116
118
  }
117
119
  const assocChildrenCount = (params) => {
118
120
  var _a, _b;
119
- const { node, nodeDefUuid, count, countType } = params;
121
+ const { node, nodeDefUuid, count, countType, dateModified } = params;
120
122
  const countIndex = Object.assign({}, (countType === nodeDef_1.NodeDefCountType.max ? (_a = node.meta) === null || _a === void 0 ? void 0 : _a.childrenMaxCount : (_b = node.meta) === null || _b === void 0 ? void 0 : _b.childrenMinCount));
121
123
  if (Number.isNaN(count)) {
122
124
  delete countIndex[nodeDefUuid];
@@ -131,7 +133,7 @@ const assocChildrenCount = (params) => {
131
133
  else {
132
134
  metaUpdated.childrenMinCount = countIndex;
133
135
  }
134
- return Object.assign(Object.assign({}, node), { meta: metaUpdated, updated: true, dateModified: utils_1.Dates.nowFormattedForStorage() });
136
+ return Object.assign(Object.assign({}, node), { meta: metaUpdated, updated: true, dateModified: getDateModified({ dateModified }) });
135
137
  };
136
138
  const assocChildrenMaxCount = (params) => assocChildrenCount(Object.assign(Object.assign({}, params), { countType: nodeDef_1.NodeDefCountType.max }));
137
139
  const assocChildrenMinCount = (params) => assocChildrenCount(Object.assign(Object.assign({}, params), { countType: nodeDef_1.NodeDefCountType.min }));
@@ -156,7 +158,7 @@ function assocValue(node, value, options) {
156
158
  const nodeUpdated = sideEffect ? node : Object.assign({}, node);
157
159
  nodeUpdated.value = value;
158
160
  nodeUpdated.updated = true;
159
- nodeUpdated.dateModified = utils_1.Dates.nowFormattedForStorage();
161
+ nodeUpdated.dateModified = getDateModified(options);
160
162
  if (isDefaultValueApplied(nodeUpdated) || isQualifierValueApplied(nodeUpdated)) {
161
163
  // reset defaultValueApplied and qualifierValueApplied flags
162
164
  const metaOriginal = (_a = nodeUpdated.meta) !== null && _a !== void 0 ? _a : {};
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/node/nodes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,wCAAqE;AACrE,oCAAyC;AAIzC,MAAM,MAAM,GAAG,CAAC,IAAqB,EAAW,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAA;AAEnE,MAAM,QAAQ,GAAG,CAAC,KAAsB,EAAE,KAAsB,EAAW,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAA;AAEvG,MAAM,iBAAiB,GAAG,CAAC,IAAqB,EAAE,WAAmB,EAAW,EAAE;;IAChF,sFAAsF;IACtF,OAAO,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,kBAAkB,0CAAG,WAAW,CAAC,MAAK,KAAK,CAAA;AAC/D,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,WAAmB,EAAW,EAAE;;IAC9E,kFAAkF;IAClF,OAAO,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,0CAAG,WAAW,CAAC,MAAK,KAAK,CAAA;AAClD,CAAC,CAAA;AAED,MAAM,cAAc,GAAG,CAAC,IAAqB,EAAE,WAAmB,EAAW,EAAE;;IAC7E,gFAAgF;IAChF,OAAO,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,0CAAG,WAAW,CAAC,MAAK,KAAK,CAAA;AACjD,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAE,WAAmB,EAAW,EAAE;;IAC9E,6GAA6G;IAC7G,OAAO,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,0CAAG,WAAW,CAAC,MAAK,IAAI,CAAA;AAChD,CAAC,CAAA;AAED,MA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uB,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/E,4DAA4D;QAC5D,MAAM,YAAY,SAAG,WAAW,CAAC,IAAI,mCAAI,EAAE,CAAA;QAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,mBAAM,YAAY,CAAE,CAAA;QAC5D,WAAW,CAAC,IAAI,mCAAQ,IAAI,KAAE,mBAAmB,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,GAAE,CAAA;IAC1F,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAEY,QAAA,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,eAAe;IACf,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;IACZ,gBAAgB;IAChB,qBAAqB;IACrB,uBAAuB;IACvB,YAAY;IACZ,eAAe;IACf,iBAAiB;IACjB,SAAS;IACT,uBAAuB;IACvB,wBAAwB;IACxB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,UAAU;IACV,iBAAiB;IACjB,UAAU;CACX,CAAA","sourcesContent":["import { ArenaDictionary } from '../common'\nimport { ArenaNodeDef, NodeDefCountType, NodeDefs } from '../nodeDef'\nimport { Dates, Objects } from '../utils'\nimport { ArenaMutationOptions } from '../utils/mutationOptions'\nimport { ArenaRecordNode } from './node'\n\nconst isRoot = (node: ArenaRecordNode): boolean => !node.parentUuid\n\nconst areEqual = (nodeA: ArenaRecordNode, nodeB: ArenaRecordNode): boolean => nodeA.uuid === nodeB.uuid\n\nconst isChildApplicable = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child applicability is not defined for a node definition, consider it applicable\n return node.meta?.childApplicability?.[nodeDefUuid] !== false\n}\n\nconst isChildEditable = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child editability is not defined for a node definition, consider it editable\n return node.meta?.cEdit?.[nodeDefUuid] !== false\n}\n\nconst isChildVisible = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child visibility is not defined for a node definition, consider it visible\n return node.meta?.cVis?.[nodeDefUuid] !== false\n}\n\nconst isChildRequired = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child \"required if\" condition is not defined or not met for a node definition, consider it not required\n return node.meta?.cReq?.[nodeDefUuid] === true\n}\n\nconst getChildrenMinOrMaxCount = (params: {\n parentNode: ArenaRecordNode\n nodeDef: ArenaNodeDef<any>\n countType: NodeDefCountType\n}): number => {\n const { parentNode, nodeDef, countType } = params\n const countIndex =\n countType === NodeDefCountType.max ? parentNode.meta?.childrenMaxCount : parentNode.meta?.childrenMinCount\n\n const count = countIndex?.[nodeDef.uuid]\n if (!Objects.isEmpty(count)) return count!\n\n // count can be a constant value, specified in the node def min/max count prop\n const nodeDefCount =\n countType === NodeDefCountType.max ? NodeDefs.getMaxCount(nodeDef) : NodeDefs.getMinCount(nodeDef)\n // count expressions (array) are evaluated into the parent node meta (childrenMinCount/childrenMaxCount)\n return nodeDefCount && !Array.isArray(nodeDefCount) ? Number(nodeDefCount) : Number.NaN\n}\n\nconst getChildrenMaxCount = (params: { parentNode: ArenaRecordNode; nodeDef: ArenaNodeDef<any> }): number =>\n getChildrenMinOrMaxCount({ ...params, countType: NodeDefCountType.max })\n\nconst getChildrenMinCount = (params: { parentNode: ArenaRecordNode; nodeDef: ArenaNodeDef<any> }): number =>\n getChildrenMinOrMaxCount({ ...params, countType: NodeDefCountType.min })\n\nconst getHierarchy = (node: ArenaRecordNode): string[] => [...(node.meta?.h ?? [])]\n\nconst getHierarchyCode = (node: ArenaRecordNode): string[] => [...(node.meta?.hCode ?? [])]\n\nconst mergeNodes = (target: ArenaRecordNode, ...sources: ArenaRecordNode[] | object[]): ArenaRecordNode =>\n Objects.deepMerge(target, ...sources) as unknown as ArenaRecordNode\n\nconst isDefaultValueApplied = (node: ArenaRecordNode): boolean => node?.meta?.defaultValueApplied ?? false\n\nconst isQualifierValueApplied = (node: ArenaRecordNode): boolean => node?.meta?.qualifierValueApplied ?? false\n\nconst isValueBlank = (node: ArenaRecordNode): boolean => Objects.isEmpty(node.value)\n\nconst isValueNotBlank = (node: ArenaRecordNode): boolean => Objects.isNotEmpty(node.value)\n\nconst hasUserInputValue = (node: ArenaRecordNode): boolean =>\n node && !isValueBlank(node) && !isDefaultValueApplied(node) && !isQualifierValueApplied(node)\n\nconst assocChildApplicability = (node: ArenaRecordNode, nodeDefUuid: string, applicable: boolean): ArenaRecordNode => {\n const childApplicability = { ...node.meta?.childApplicability }\n if (!applicable) {\n childApplicability[nodeDefUuid] = applicable\n } else {\n delete childApplicability[nodeDefUuid]\n }\n return {\n ...node,\n meta: { ...node.meta, childApplicability },\n updated: true,\n dateModified: Dates.nowFormattedForStorage(),\n }\n}\n\nconst dissocChildApplicability = (node: ArenaRecordNode, nodeDefUuid: string) => {\n const childApplicability = { ...node.meta?.childApplicability }\n delete childApplicability[nodeDefUuid]\n return {\n ...node,\n meta: { ...node.meta, childApplicability },\n }\n}\n\ntype MetaBooleanDictionaryProp = 'childApplicability' | 'cEdit' | 'cVis' | 'cReq'\n\nconst updateMetaDictionary = ({\n node,\n nodeDefUuid,\n propName,\n propValue,\n defaultValue = true,\n sideEffect,\n}: {\n node: ArenaRecordNode\n nodeDefUuid: string\n propName: MetaBooleanDictionaryProp\n propValue: boolean\n defaultValue?: boolean\n sideEffect: boolean\n}): ArenaRecordNode => {\n const nodeUpdated = sideEffect ? node : { ...node }\n const metaOriginal = nodeUpdated.meta ?? {}\n const meta = sideEffect ? metaOriginal : { ...metaOriginal }\n const existingDictionary: ArenaDictionary<boolean> = meta[propName] ?? {}\n const dictionary = sideEffect ? existingDictionary : { ...existingDictionary }\n if (propValue === defaultValue) {\n // default value: not stored\n delete dictionary[nodeDefUuid]\n } else {\n dictionary[nodeDefUuid] = propValue\n }\n meta[propName] = dictionary\n nodeUpdated.meta = meta\n nodeUpdated.updated = true\n nodeUpdated.dateModified = Dates.nowFormattedForStorage()\n return nodeUpdated\n}\n\nfunction assocChildEditable(\n node: ArenaRecordNode,\n nodeDefUuid: string,\n editable: boolean,\n options?: ArenaMutationOptions\n): ArenaRecordNode {\n const { sideEffect = false } = options ?? {}\n return updateMetaDictionary({ node, nodeDefUuid, propName: 'cEdit', propValue: editable, sideEffect })\n}\n\nconst assocChildRequired = (\n node: ArenaRecordNode,\n nodeDefUuid: string,\n required: boolean,\n options?: ArenaMutationOptions\n): ArenaRecordNode => {\n const { sideEffect = false } = options ?? {}\n return updateMetaDictionary({\n node,\n nodeDefUuid,\n propName: 'cReq',\n propValue: required,\n defaultValue: false,\n sideEffect,\n })\n}\n\nfunction assocChildVisible(\n node: ArenaRecordNode,\n nodeDefUuid: string,\n visible: boolean,\n options?: ArenaMutationOptions\n): ArenaRecordNode {\n const { sideEffect = false } = options ?? {}\n return updateMetaDictionary({ node, nodeDefUuid, propName: 'cVis', propValue: visible, sideEffect })\n}\n\nconst assocChildrenCount = (params: {\n node: ArenaRecordNode\n nodeDefUuid: string\n count: number\n countType: NodeDefCountType\n}): ArenaRecordNode => {\n const { node, nodeDefUuid, count, countType } = params\n const countIndex = {\n ...(countType === NodeDefCountType.max ? node.meta?.childrenMaxCount : node.meta?.childrenMinCount),\n }\n if (Number.isNaN(count)) {\n delete countIndex[nodeDefUuid]\n } else {\n countIndex[nodeDefUuid] = count\n }\n const metaUpdated = { ...node.meta }\n if (countType === NodeDefCountType.max) {\n metaUpdated.childrenMaxCount = countIndex\n } else {\n metaUpdated.childrenMinCount = countIndex\n }\n return {\n ...node,\n meta: metaUpdated,\n updated: true,\n dateModified: Dates.nowFormattedForStorage(),\n }\n}\n\nconst assocChildrenMaxCount = (params: {\n node: ArenaRecordNode\n nodeDefUuid: string\n count: number\n}): ArenaRecordNode => assocChildrenCount({ ...params, countType: NodeDefCountType.max })\n\nconst assocChildrenMinCount = (params: {\n node: ArenaRecordNode\n nodeDefUuid: string\n count: number\n}): ArenaRecordNode => assocChildrenCount({ ...params, countType: NodeDefCountType.min })\n\nconst clearStatusFlagsInPlace = (node: ArenaRecordNode): ArenaRecordNode => {\n // do not use \"delete\": it would switch the node object to the (much bigger) V8 dictionary mode\n if (node.created !== undefined) node.created = undefined\n if (node.deleted !== undefined) node.deleted = undefined\n if (node.updated !== undefined) node.updated = undefined\n return node\n}\n\nconst omitStatusFlags = (node: ArenaRecordNode): ArenaRecordNode => {\n const { created: _created, deleted: _deleted, updated: _updated, ...nodeCleaned } = node\n return nodeCleaned\n}\n\nconst removeStatusFlags = ({\n node,\n sideEffect = false,\n}: {\n node: ArenaRecordNode\n sideEffect?: boolean\n}): ArenaRecordNode => (sideEffect ? clearStatusFlagsInPlace(node) : omitStatusFlags(node))\n\nfunction assocValue(node: ArenaRecordNode, value: any, options?: ArenaMutationOptions): ArenaRecordNode {\n const { sideEffect = false } = options ?? {}\n const nodeUpdated = sideEffect ? node : { ...node }\n nodeUpdated.value = value\n nodeUpdated.updated = true\n nodeUpdated.dateModified = Dates.nowFormattedForStorage()\n if (isDefaultValueApplied(nodeUpdated) || isQualifierValueApplied(nodeUpdated)) {\n // reset defaultValueApplied and qualifierValueApplied flags\n const metaOriginal = nodeUpdated.meta ?? {}\n const meta = sideEffect ? metaOriginal : { ...metaOriginal }\n nodeUpdated.meta = { ...meta, defaultValueApplied: false, qualifierValueApplied: false }\n }\n return nodeUpdated\n}\n\nexport const RecordNodes = {\n isRoot,\n areEqual,\n isChildApplicable,\n isChildEditable,\n isChildVisible,\n isChildRequired,\n getChildrenMinOrMaxCount,\n getChildrenMaxCount,\n getChildrenMinCount,\n getHierarchy,\n getHierarchyCode,\n isDefaultValueApplied,\n isQualifierValueApplied,\n isValueBlank,\n isValueNotBlank,\n hasUserInputValue,\n // update\n assocChildApplicability,\n dissocChildApplicability,\n assocChildEditable,\n assocChildVisible,\n assocChildRequired,\n assocChildrenCount,\n assocChildrenMaxCount,\n assocChildrenMinCount,\n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,WAAW,CAAC,KAAK,GAAG,KAAK,CAAA;IACzB,WAAW,CAAC,OAAO,GAAG,IAAI,CAAA;IAC1B,WAAW,CAAC,YAAY,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;IACnD,IAAI,qBAAqB,CAAC,WAAW,CAAC,IAAI,uBAAuB,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/E,4DAA4D;QAC5D,MAAM,YAAY,SAAG,WAAW,CAAC,IAAI,mCAAI,EAAE,CAAA;QAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,mBAAM,YAAY,CAAE,CAAA;QAC5D,WAAW,CAAC,IAAI,mCAAQ,IAAI,KAAE,mBAAmB,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,GAAE,CAAA;IAC1F,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAEY,QAAA,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,eAAe;IACf,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;IACnB,YAAY;IACZ,gBAAgB;IAChB,qBAAqB;IACrB,uBAAuB;IACvB,YAAY;IACZ,eAAe;IACf,iBAAiB;IACjB,SAAS;IACT,uBAAuB;IACvB,wBAAwB;IACxB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,UAAU;IACV,iBAAiB;IACjB,UAAU;CACX,CAAA","sourcesContent":["import { ArenaDictionary } from '../common'\nimport { ArenaNodeDef, NodeDefCountType, NodeDefs } from '../nodeDef'\nimport { Dates, Objects } from '../utils'\nimport { ArenaMutationOptions } from '../utils/mutationOptions'\nimport { ArenaRecordNode } from './node'\n\n/**\n * Options of the node update functions.\n */\nexport interface ArenaRecordNodeUpdateOptions extends ArenaMutationOptions {\n /**\n * Date of the modification (formatted for storage); the same date is used for all the nodes modified in the same record update.\n * @default now\n */\n dateModified?: string\n}\n\nconst getDateModified = (options?: ArenaRecordNodeUpdateOptions): string =>\n options?.dateModified ?? Dates.nowFormattedForStorage()\n\nconst isRoot = (node: ArenaRecordNode): boolean => !node.parentUuid\n\nconst areEqual = (nodeA: ArenaRecordNode, nodeB: ArenaRecordNode): boolean => nodeA.uuid === nodeB.uuid\n\nconst isChildApplicable = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child applicability is not defined for a node definition, consider it applicable\n return node.meta?.childApplicability?.[nodeDefUuid] !== false\n}\n\nconst isChildEditable = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child editability is not defined for a node definition, consider it editable\n return node.meta?.cEdit?.[nodeDefUuid] !== false\n}\n\nconst isChildVisible = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child visibility is not defined for a node definition, consider it visible\n return node.meta?.cVis?.[nodeDefUuid] !== false\n}\n\nconst isChildRequired = (node: ArenaRecordNode, nodeDefUuid: string): boolean => {\n // if child \"required if\" condition is not defined or not met for a node definition, consider it not required\n return node.meta?.cReq?.[nodeDefUuid] === true\n}\n\nconst getChildrenMinOrMaxCount = (params: {\n parentNode: ArenaRecordNode\n nodeDef: ArenaNodeDef<any>\n countType: NodeDefCountType\n}): number => {\n const { parentNode, nodeDef, countType } = params\n const countIndex =\n countType === NodeDefCountType.max ? parentNode.meta?.childrenMaxCount : parentNode.meta?.childrenMinCount\n\n const count = countIndex?.[nodeDef.uuid]\n if (!Objects.isEmpty(count)) return count!\n\n // count can be a constant value, specified in the node def min/max count prop\n const nodeDefCount =\n countType === NodeDefCountType.max ? NodeDefs.getMaxCount(nodeDef) : NodeDefs.getMinCount(nodeDef)\n // count expressions (array) are evaluated into the parent node meta (childrenMinCount/childrenMaxCount)\n return nodeDefCount && !Array.isArray(nodeDefCount) ? Number(nodeDefCount) : Number.NaN\n}\n\nconst getChildrenMaxCount = (params: { parentNode: ArenaRecordNode; nodeDef: ArenaNodeDef<any> }): number =>\n getChildrenMinOrMaxCount({ ...params, countType: NodeDefCountType.max })\n\nconst getChildrenMinCount = (params: { parentNode: ArenaRecordNode; nodeDef: ArenaNodeDef<any> }): number =>\n getChildrenMinOrMaxCount({ ...params, countType: NodeDefCountType.min })\n\nconst getHierarchy = (node: ArenaRecordNode): string[] => [...(node.meta?.h ?? [])]\n\nconst getHierarchyCode = (node: ArenaRecordNode): string[] => [...(node.meta?.hCode ?? [])]\n\nconst mergeNodes = (target: ArenaRecordNode, ...sources: ArenaRecordNode[] | object[]): ArenaRecordNode =>\n Objects.deepMerge(target, ...sources) as unknown as ArenaRecordNode\n\nconst isDefaultValueApplied = (node: ArenaRecordNode): boolean => node?.meta?.defaultValueApplied ?? false\n\nconst isQualifierValueApplied = (node: ArenaRecordNode): boolean => node?.meta?.qualifierValueApplied ?? false\n\nconst isValueBlank = (node: ArenaRecordNode): boolean => Objects.isEmpty(node.value)\n\nconst isValueNotBlank = (node: ArenaRecordNode): boolean => Objects.isNotEmpty(node.value)\n\nconst hasUserInputValue = (node: ArenaRecordNode): boolean =>\n node && !isValueBlank(node) && !isDefaultValueApplied(node) && !isQualifierValueApplied(node)\n\nconst assocChildApplicability = (\n node: ArenaRecordNode,\n nodeDefUuid: string,\n applicable: boolean,\n options?: Omit<ArenaRecordNodeUpdateOptions, 'sideEffect'>\n): ArenaRecordNode => {\n const childApplicability = { ...node.meta?.childApplicability }\n if (!applicable) {\n childApplicability[nodeDefUuid] = applicable\n } else {\n delete childApplicability[nodeDefUuid]\n }\n return {\n ...node,\n meta: { ...node.meta, childApplicability },\n updated: true,\n dateModified: getDateModified(options),\n }\n}\n\nconst dissocChildApplicability = (node: ArenaRecordNode, nodeDefUuid: string) => {\n const childApplicability = { ...node.meta?.childApplicability }\n delete childApplicability[nodeDefUuid]\n return {\n ...node,\n meta: { ...node.meta, childApplicability },\n }\n}\n\ntype MetaBooleanDictionaryProp = 'childApplicability' | 'cEdit' | 'cVis' | 'cReq'\n\nconst updateMetaDictionary = ({\n node,\n nodeDefUuid,\n propName,\n propValue,\n defaultValue = true,\n sideEffect,\n dateModified,\n}: {\n node: ArenaRecordNode\n nodeDefUuid: string\n propName: MetaBooleanDictionaryProp\n propValue: boolean\n defaultValue?: boolean\n sideEffect: boolean\n dateModified?: string\n}): ArenaRecordNode => {\n const nodeUpdated = sideEffect ? node : { ...node }\n const metaOriginal = nodeUpdated.meta ?? {}\n const meta = sideEffect ? metaOriginal : { ...metaOriginal }\n const existingDictionary: ArenaDictionary<boolean> = meta[propName] ?? {}\n const dictionary = sideEffect ? existingDictionary : { ...existingDictionary }\n if (propValue === defaultValue) {\n // default value: not stored\n delete dictionary[nodeDefUuid]\n } else {\n dictionary[nodeDefUuid] = propValue\n }\n meta[propName] = dictionary\n nodeUpdated.meta = meta\n nodeUpdated.updated = true\n nodeUpdated.dateModified = getDateModified({ dateModified })\n return nodeUpdated\n}\n\nfunction assocChildEditable(\n node: ArenaRecordNode,\n nodeDefUuid: string,\n editable: boolean,\n options?: ArenaRecordNodeUpdateOptions\n): ArenaRecordNode {\n const { sideEffect = false, dateModified } = options ?? {}\n return updateMetaDictionary({ node, nodeDefUuid, propName: 'cEdit', propValue: editable, sideEffect, dateModified })\n}\n\nconst assocChildRequired = (\n node: ArenaRecordNode,\n nodeDefUuid: string,\n required: boolean,\n options?: ArenaRecordNodeUpdateOptions\n): ArenaRecordNode => {\n const { sideEffect = false, dateModified } = options ?? {}\n return updateMetaDictionary({\n node,\n nodeDefUuid,\n propName: 'cReq',\n propValue: required,\n defaultValue: false,\n sideEffect,\n dateModified,\n })\n}\n\nfunction assocChildVisible(\n node: ArenaRecordNode,\n nodeDefUuid: string,\n visible: boolean,\n options?: ArenaRecordNodeUpdateOptions\n): ArenaRecordNode {\n const { sideEffect = false, dateModified } = options ?? {}\n return updateMetaDictionary({ node, nodeDefUuid, propName: 'cVis', propValue: visible, sideEffect, dateModified })\n}\n\nconst assocChildrenCount = (params: {\n node: ArenaRecordNode\n nodeDefUuid: string\n count: number\n countType: NodeDefCountType\n dateModified?: string\n}): ArenaRecordNode => {\n const { node, nodeDefUuid, count, countType, dateModified } = params\n const countIndex = {\n ...(countType === NodeDefCountType.max ? node.meta?.childrenMaxCount : node.meta?.childrenMinCount),\n }\n if (Number.isNaN(count)) {\n delete countIndex[nodeDefUuid]\n } else {\n countIndex[nodeDefUuid] = count\n }\n const metaUpdated = { ...node.meta }\n if (countType === NodeDefCountType.max) {\n metaUpdated.childrenMaxCount = countIndex\n } else {\n metaUpdated.childrenMinCount = countIndex\n }\n return {\n ...node,\n meta: metaUpdated,\n updated: true,\n dateModified: getDateModified({ dateModified }),\n }\n}\n\nconst assocChildrenMaxCount = (params: {\n node: ArenaRecordNode\n nodeDefUuid: string\n count: number\n dateModified?: string\n}): ArenaRecordNode => assocChildrenCount({ ...params, countType: NodeDefCountType.max })\n\nconst assocChildrenMinCount = (params: {\n node: ArenaRecordNode\n nodeDefUuid: string\n count: number\n dateModified?: string\n}): ArenaRecordNode => assocChildrenCount({ ...params, countType: NodeDefCountType.min })\n\nconst clearStatusFlagsInPlace = (node: ArenaRecordNode): ArenaRecordNode => {\n // do not use \"delete\": it would switch the node object to the (much bigger) V8 dictionary mode\n if (node.created !== undefined) node.created = undefined\n if (node.deleted !== undefined) node.deleted = undefined\n if (node.updated !== undefined) node.updated = undefined\n return node\n}\n\nconst omitStatusFlags = (node: ArenaRecordNode): ArenaRecordNode => {\n const { created: _created, deleted: _deleted, updated: _updated, ...nodeCleaned } = node\n return nodeCleaned\n}\n\nconst removeStatusFlags = ({\n node,\n sideEffect = false,\n}: {\n node: ArenaRecordNode\n sideEffect?: boolean\n}): ArenaRecordNode => (sideEffect ? clearStatusFlagsInPlace(node) : omitStatusFlags(node))\n\nfunction assocValue(node: ArenaRecordNode, value: any, options?: ArenaRecordNodeUpdateOptions): ArenaRecordNode {\n const { sideEffect = false } = options ?? {}\n const nodeUpdated = sideEffect ? node : { ...node }\n nodeUpdated.value = value\n nodeUpdated.updated = true\n nodeUpdated.dateModified = getDateModified(options)\n if (isDefaultValueApplied(nodeUpdated) || isQualifierValueApplied(nodeUpdated)) {\n // reset defaultValueApplied and qualifierValueApplied flags\n const metaOriginal = nodeUpdated.meta ?? {}\n const meta = sideEffect ? metaOriginal : { ...metaOriginal }\n nodeUpdated.meta = { ...meta, defaultValueApplied: false, qualifierValueApplied: false }\n }\n return nodeUpdated\n}\n\nexport const RecordNodes = {\n isRoot,\n areEqual,\n isChildApplicable,\n isChildEditable,\n isChildVisible,\n isChildRequired,\n getChildrenMinOrMaxCount,\n getChildrenMaxCount,\n getChildrenMinCount,\n getHierarchy,\n getHierarchyCode,\n isDefaultValueApplied,\n isQualifierValueApplied,\n isValueBlank,\n isValueNotBlank,\n hasUserInputValue,\n // update\n assocChildApplicability,\n dissocChildApplicability,\n assocChildEditable,\n assocChildVisible,\n assocChildRequired,\n assocChildrenCount,\n assocChildrenMaxCount,\n assocChildrenMinCount,\n mergeNodes,\n removeStatusFlags,\n assocValue,\n}\n"]}
@@ -28,6 +28,6 @@ export interface ArenaNodeDefEntityLayout extends ArenaNodeDefLayout {
28
28
  indexChildren?: string[];
29
29
  layoutChildren?: ArenaNodeDefEntityLayoutChildItem[];
30
30
  pageUuid?: string;
31
- renderType: NodeDefEntityRenderType;
31
+ renderType?: NodeDefEntityRenderType;
32
32
  }
33
33
  export type ArenaNodeDefEntity = ArenaNodeDef<NodeDefType.entity, ArenaNodeDefEntityProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/nodeDef/types/entity.ts"],"names":[],"mappings":";;;AA2BA,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAa,CAAA;IACb,0CAAe,CAAA;AACjB,CAAC,EAHW,uBAAuB,aAAvB,uBAAuB,GAAvB,uBAAuB,QAGlC","sourcesContent":["import { ArenaNodeDef, ArenaNodeDefLayout, ArenaNodeDefPropsWithLayout, NodeDefType } from '../nodeDef'\n\nexport interface ArenaNodeDefEntityChildPosition {\n h?: number\n i: string\n maxH?: number\n minH?: number\n minW?: number\n moved?: boolean\n static?: boolean\n w?: number\n x: number\n y: number\n}\n\nexport type ArenaNodeDefEntityLayoutChildItem = ArenaNodeDefEntityChildPosition | string\n\nexport type ArenaNodeDefPrintOrientation = 'portrait' | 'landscape'\n\nexport interface ArenaNodeDefEntityProps extends ArenaNodeDefPropsWithLayout<ArenaNodeDefEntityLayout> {\n // Applies only to multiple entities; when true, missing repetitions up to min count are auto-created.\n autoCreateMinCountItems?: boolean\n enumerate?: boolean\n /** When set, printable export uses this orientation for the entity's print section. */\n printOrientation?: ArenaNodeDefPrintOrientation\n}\n\nexport enum NodeDefEntityRenderType {\n form = 'form',\n table = 'table',\n}\n\nexport interface ArenaNodeDefEntityLayout extends ArenaNodeDefLayout {\n columnsNo?: number\n indexChildren?: string[] // sorted children pages uuids\n layoutChildren?: ArenaNodeDefEntityLayoutChildItem[]\n pageUuid?: string\n renderType: NodeDefEntityRenderType\n}\n\nexport type ArenaNodeDefEntity = ArenaNodeDef<NodeDefType.entity, ArenaNodeDefEntityProps>\n"]}
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/nodeDef/types/entity.ts"],"names":[],"mappings":";;;AA2BA,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAa,CAAA;IACb,0CAAe,CAAA;AACjB,CAAC,EAHW,uBAAuB,aAAvB,uBAAuB,GAAvB,uBAAuB,QAGlC","sourcesContent":["import { ArenaNodeDef, ArenaNodeDefLayout, ArenaNodeDefPropsWithLayout, NodeDefType } from '../nodeDef'\n\nexport interface ArenaNodeDefEntityChildPosition {\n h?: number\n i: string\n maxH?: number\n minH?: number\n minW?: number\n moved?: boolean\n static?: boolean\n w?: number\n x: number\n y: number\n}\n\nexport type ArenaNodeDefEntityLayoutChildItem = ArenaNodeDefEntityChildPosition | string\n\nexport type ArenaNodeDefPrintOrientation = 'portrait' | 'landscape'\n\nexport interface ArenaNodeDefEntityProps extends ArenaNodeDefPropsWithLayout<ArenaNodeDefEntityLayout> {\n // Applies only to multiple entities; when true, missing repetitions up to min count are auto-created.\n autoCreateMinCountItems?: boolean\n enumerate?: boolean\n /** When set, printable export uses this orientation for the entity's print section. */\n printOrientation?: ArenaNodeDefPrintOrientation\n}\n\nexport enum NodeDefEntityRenderType {\n form = 'form',\n table = 'table',\n}\n\nexport interface ArenaNodeDefEntityLayout extends ArenaNodeDefLayout {\n columnsNo?: number\n indexChildren?: string[] // sorted children pages uuids\n layoutChildren?: ArenaNodeDefEntityLayoutChildItem[]\n pageUuid?: string\n renderType?: NodeDefEntityRenderType\n}\n\nexport type ArenaNodeDefEntity = ArenaNodeDef<NodeDefType.entity, ArenaNodeDefEntityProps>\n"]}
@@ -14,6 +14,10 @@ export interface NodeDefExpressionContext extends ArenaExpressionContext {
14
14
  * Unique UUIDs of node definitions being visited during expression evaluation.
15
15
  */
16
16
  referencedNodeDefUuids?: Set<string>;
17
+ /**
18
+ * Unique UUIDs of entity definitions whose nodes dates are used in the expression (nodeDateCreated, nodeDateModified).
19
+ */
20
+ nodeDateReferencedNodeDefUuids?: Set<string>;
17
21
  selfReferenceAllowed?: boolean;
18
22
  itemsFilter?: boolean;
19
23
  memberProperty?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/nodeDefExpressionEvaluator/context.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaUser } from '../auth'\nimport { ArenaExpressionContext } from '../expression'\nimport { ArenaAnyNodeDef } from '../nodeDef'\nimport { ArenaSurvey } from '../survey'\nimport { ArenaAreaOfInterestProvider } from './areaOfInterestProvider'\nimport { ArenaCategoryItemProvider } from './categoryItemProvider'\nimport { ArenaTaxonProvider } from './taxonProvider'\n\nexport interface NodeDefExpressionContext extends ArenaExpressionContext {\n survey: ArenaSurvey\n user?: ArenaUser\n nodeDefCurrent: ArenaAnyNodeDef\n nodeDefContext?: ArenaAnyNodeDef\n /**\n * Unique UUIDs of node definitions being visited during expression evaluation.\n */\n referencedNodeDefUuids?: Set<string>\n selfReferenceAllowed?: boolean\n // true when the expression is used to filter code or taxon items\n itemsFilter?: boolean\n // true when evaluating the property of a member expression (e.g. \"length\" in \"text_attr.length\")\n memberProperty?: boolean\n\n categoryItemProvider?: ArenaCategoryItemProvider\n taxonProvider?: ArenaTaxonProvider\n areaOfInterestProvider?: ArenaAreaOfInterestProvider\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/nodeDefExpressionEvaluator/context.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaUser } from '../auth'\nimport { ArenaExpressionContext } from '../expression'\nimport { ArenaAnyNodeDef } from '../nodeDef'\nimport { ArenaSurvey } from '../survey'\nimport { ArenaAreaOfInterestProvider } from './areaOfInterestProvider'\nimport { ArenaCategoryItemProvider } from './categoryItemProvider'\nimport { ArenaTaxonProvider } from './taxonProvider'\n\nexport interface NodeDefExpressionContext extends ArenaExpressionContext {\n survey: ArenaSurvey\n user?: ArenaUser\n nodeDefCurrent: ArenaAnyNodeDef\n nodeDefContext?: ArenaAnyNodeDef\n /**\n * Unique UUIDs of node definitions being visited during expression evaluation.\n */\n referencedNodeDefUuids?: Set<string>\n /**\n * Unique UUIDs of entity definitions whose nodes dates are used in the expression (nodeDateCreated, nodeDateModified).\n */\n nodeDateReferencedNodeDefUuids?: Set<string>\n selfReferenceAllowed?: boolean\n // true when the expression is used to filter code or taxon items\n itemsFilter?: boolean\n // true when evaluating the property of a member expression (e.g. \"length\" in \"text_attr.length\")\n memberProperty?: boolean\n\n categoryItemProvider?: ArenaCategoryItemProvider\n taxonProvider?: ArenaTaxonProvider\n areaOfInterestProvider?: ArenaAreaOfInterestProvider\n}\n"]}
@@ -14,7 +14,7 @@ export type ExpressionEvaluatorParams = {
14
14
  };
15
15
  export declare class NodeDefExpressionEvaluator extends JavascriptExpressionEvaluator<NodeDefExpressionContext> {
16
16
  constructor();
17
- _eval(params: ExpressionEvaluatorParams, referencedNodeDefUuids?: Set<string>): Promise<{
17
+ _eval(params: ExpressionEvaluatorParams, referencedNodeDefUuids?: Set<string>, nodeDateReferencedNodeDefUuids?: Set<string>): Promise<{
18
18
  result: any;
19
19
  referencedNodeDefUuids: Set<string>;
20
20
  }>;
@@ -24,5 +24,13 @@ export declare class NodeDefExpressionEvaluator extends JavascriptExpressionEval
24
24
  * all the dependencies of the expression.
25
25
  */
26
26
  findReferencedNodeDefUuids(params: ExpressionEvaluatorParams): Promise<Set<string>>;
27
+ /**
28
+ * Finds the node defs referenced by the expression (see findReferencedNodeDefUuids) and the entity defs
29
+ * whose nodes dates are used in it (nodeDateCreated, nodeDateModified functions).
30
+ */
31
+ findReferencedNodeDefUuidsWithNodeDates(params: ExpressionEvaluatorParams): Promise<{
32
+ referencedNodeDefUuids: Set<string>;
33
+ nodeDateReferencedNodeDefUuids: Set<string>;
34
+ }>;
27
35
  evalExpression(params: ExpressionEvaluatorParams): Promise<any>;
28
36
  }