@openforis/arena-core 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dataExport/ArenaExportFile.d.ts +50 -0
- package/dist/dataExport/ArenaExportFile.js +48 -0
- package/dist/dataExport/ArenaExportFile.js.map +1 -0
- package/dist/dataExport/index.d.ts +1 -0
- package/dist/dataExport/index.js +3 -1
- package/dist/dataExport/index.js.map +1 -1
- package/dist/error/systemErrorKeys.d.ts +1 -0
- package/dist/error/systemErrorKeys.js +1 -0
- package/dist/error/systemErrorKeys.js.map +1 -1
- package/dist/esm/dataExport/ArenaExportFile.js +45 -0
- package/dist/esm/dataExport/ArenaExportFile.js.map +1 -0
- package/dist/esm/dataExport/index.js +1 -0
- package/dist/esm/dataExport/index.js.map +1 -1
- package/dist/esm/error/systemErrorKeys.js +1 -0
- package/dist/esm/error/systemErrorKeys.js.map +1 -1
- package/dist/esm/geo/areaOfInterest.js.map +1 -1
- package/dist/esm/geo/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/areaOfInterestProvider.js +2 -0
- package/dist/esm/nodeDefExpressionEvaluator/areaOfInterestProvider.js.map +1 -0
- package/dist/esm/nodeDefExpressionEvaluator/context.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/functions.js +45 -8
- package/dist/esm/nodeDefExpressionEvaluator/functions.js.map +1 -1
- package/dist/esm/nodeDefExpressionEvaluator/index.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/context.js.map +1 -1
- package/dist/esm/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
- package/dist/esm/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
- package/dist/esm/record/recordValidator/attributeValidator.js +2 -1
- package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
- package/dist/esm/survey/survey.js.map +1 -1
- package/dist/esm/survey/surveys/index.js +3 -2
- package/dist/esm/survey/surveys/index.js.map +1 -1
- package/dist/esm/survey/surveys/surveysGetters.js +3 -2
- package/dist/esm/survey/surveys/surveysGetters.js.map +1 -1
- package/dist/geo/areaOfInterest.d.ts +14 -1
- package/dist/geo/areaOfInterest.js.map +1 -1
- package/dist/geo/index.d.ts +1 -1
- package/dist/geo/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.d.ts +11 -0
- package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.js +3 -0
- package/dist/nodeDefExpressionEvaluator/areaOfInterestProvider.js.map +1 -0
- package/dist/nodeDefExpressionEvaluator/context.d.ts +2 -0
- package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/functions.js +44 -7
- package/dist/nodeDefExpressionEvaluator/functions.js.map +1 -1
- package/dist/nodeDefExpressionEvaluator/index.d.ts +1 -0
- package/dist/nodeDefExpressionEvaluator/index.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/context.d.ts +2 -0
- package/dist/record/recordExpressionEvaluator/context.js.map +1 -1
- package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.d.ts +2 -0
- package/dist/record/recordExpressionEvaluator/recordExpressionEvaluator.js.map +1 -1
- package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.d.ts +2 -0
- package/dist/record/recordNodesUpdater/recordExpressionEvaluationContext.js.map +1 -1
- package/dist/record/recordValidator/attributeValidator.d.ts +2 -0
- package/dist/record/recordValidator/attributeValidator.js +2 -1
- package/dist/record/recordValidator/attributeValidator.js.map +1 -1
- package/dist/survey/survey.d.ts +2 -2
- package/dist/survey/survey.js.map +1 -1
- package/dist/survey/surveys/index.d.ts +3 -2
- package/dist/survey/surveys/index.js +2 -1
- package/dist/survey/surveys/index.js.map +1 -1
- package/dist/survey/surveys/surveysGetters.d.ts +6 -2
- package/dist/survey/surveys/surveysGetters.js +6 -4
- package/dist/survey/surveys/surveysGetters.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const ArenaExportFile: {
|
|
2
|
+
activityLog: ({ index }: {
|
|
3
|
+
index: number;
|
|
4
|
+
}) => string;
|
|
5
|
+
categories: string;
|
|
6
|
+
categoryItemsSingleFile: ({ categoryUuid }: {
|
|
7
|
+
categoryUuid: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
categoryItemsPart: ({ categoryUuid, index }: {
|
|
10
|
+
categoryUuid: string;
|
|
11
|
+
index: number;
|
|
12
|
+
}) => string;
|
|
13
|
+
chains: string;
|
|
14
|
+
chain: ({ chainUuid }: {
|
|
15
|
+
chainUuid: string;
|
|
16
|
+
}) => string;
|
|
17
|
+
filesDir: string;
|
|
18
|
+
filesSummaries: string;
|
|
19
|
+
file: ({ fileUuid }: {
|
|
20
|
+
fileUuid: string;
|
|
21
|
+
}) => string;
|
|
22
|
+
info: string;
|
|
23
|
+
recordsDir: string;
|
|
24
|
+
records: string;
|
|
25
|
+
record: ({ recordUuid }: {
|
|
26
|
+
recordUuid: string;
|
|
27
|
+
}) => string;
|
|
28
|
+
survey: string;
|
|
29
|
+
surveyFilesDir: string;
|
|
30
|
+
surveyFile: ({ fileUuid }: {
|
|
31
|
+
fileUuid: string;
|
|
32
|
+
}) => string;
|
|
33
|
+
chainMauFilesSummaries: string;
|
|
34
|
+
taxonomies: string;
|
|
35
|
+
taxa: ({ taxonomyUuid }: {
|
|
36
|
+
taxonomyUuid: string;
|
|
37
|
+
}) => string;
|
|
38
|
+
taxaPart: ({ taxonomyUuid, index }: {
|
|
39
|
+
taxonomyUuid: string;
|
|
40
|
+
index: number;
|
|
41
|
+
}) => string;
|
|
42
|
+
users: string;
|
|
43
|
+
userInvitations: string;
|
|
44
|
+
userProfilePicture: ({ userUuid }: {
|
|
45
|
+
userUuid: string;
|
|
46
|
+
}) => string;
|
|
47
|
+
fileOld: ({ fileUuid }: {
|
|
48
|
+
fileUuid: string;
|
|
49
|
+
}) => string;
|
|
50
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Entry names of the Arena format export (zip), shared by Arena (export / import) and Arena Mobile
|
|
3
|
+
// (records export, survey package download)
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.ArenaExportFile = void 0;
|
|
6
|
+
const separator = '/';
|
|
7
|
+
const dir = {
|
|
8
|
+
activityLog: 'activitylog',
|
|
9
|
+
categories: 'categories',
|
|
10
|
+
chains: 'chains',
|
|
11
|
+
files: 'files',
|
|
12
|
+
records: 'records',
|
|
13
|
+
surveyFiles: 'surveyfiles',
|
|
14
|
+
taxonomies: 'taxonomies',
|
|
15
|
+
users: 'users',
|
|
16
|
+
userProfilePictures: ['users', 'profilepictures'].join(separator),
|
|
17
|
+
};
|
|
18
|
+
const path = (...parts) => parts.join(separator);
|
|
19
|
+
exports.ArenaExportFile = {
|
|
20
|
+
activityLog: ({ index }) => path(dir.activityLog, `activityLog_${index}.json`),
|
|
21
|
+
categories: path(dir.categories, 'categories.json'),
|
|
22
|
+
categoryItemsSingleFile: ({ categoryUuid }) => path(dir.categories, `${categoryUuid}.json`),
|
|
23
|
+
categoryItemsPart: ({ categoryUuid, index }) => path(dir.categories, `${categoryUuid}_${index}.json`),
|
|
24
|
+
chains: path(dir.chains, 'chains.json'),
|
|
25
|
+
chain: ({ chainUuid }) => path(dir.chains, `${chainUuid}.json`),
|
|
26
|
+
// record files
|
|
27
|
+
filesDir: dir.files,
|
|
28
|
+
filesSummaries: path(dir.files, 'files.json'),
|
|
29
|
+
file: ({ fileUuid }) => path(dir.files, `${fileUuid}.bin`),
|
|
30
|
+
info: 'info.json',
|
|
31
|
+
recordsDir: dir.records,
|
|
32
|
+
records: path(dir.records, 'records.json'),
|
|
33
|
+
record: ({ recordUuid }) => path(dir.records, `${recordUuid}.json`),
|
|
34
|
+
survey: 'survey.json',
|
|
35
|
+
// survey files (e.g. preloaded map layers, branding images)
|
|
36
|
+
surveyFilesDir: dir.surveyFiles,
|
|
37
|
+
surveyFile: ({ fileUuid }) => path(dir.surveyFiles, `${fileUuid}.bin`),
|
|
38
|
+
chainMauFilesSummaries: path(dir.surveyFiles, 'chainMauFiles.json'),
|
|
39
|
+
taxonomies: path(dir.taxonomies, 'taxonomies.json'),
|
|
40
|
+
taxa: ({ taxonomyUuid }) => path(dir.taxonomies, `${taxonomyUuid}.json`),
|
|
41
|
+
taxaPart: ({ taxonomyUuid, index }) => path(dir.taxonomies, `${taxonomyUuid}_${index}.json`),
|
|
42
|
+
users: path(dir.users, 'users.json'),
|
|
43
|
+
userInvitations: path(dir.users, 'userInvitations.json'),
|
|
44
|
+
userProfilePicture: ({ userUuid }) => path(dir.userProfilePictures, userUuid),
|
|
45
|
+
// deprecated (old export format)
|
|
46
|
+
fileOld: ({ fileUuid }) => path(dir.files, `${fileUuid}.json`),
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=ArenaExportFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArenaExportFile.js","sourceRoot":"","sources":["../../src/dataExport/ArenaExportFile.ts"],"names":[],"mappings":";AAAA,mGAAmG;AACnG,4CAA4C;;;AAE5C,MAAM,SAAS,GAAG,GAAG,CAAA;AAErB,MAAM,GAAG,GAAG;IACV,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,mBAAmB,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;CAClE,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,GAAG,KAAe,EAAU,EAAE,CAAC,KAAK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rB,4DAA4D;IAC5D,cAAc,EAAE,GAAG,CAAC,WAAW;IAC/B,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAwB,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,QAAQ,MAAM,CAAC;IACpG,sBAAsB,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,oBAAoB,CAAC;IACnE,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACnD,IAAI,EAAE,CAAC,EAAE,YAAY,EAA4B,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,YAAY,OAAO,CAAC;IAC1G,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAA2C,EAAU,EAAE,CACrF,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,YAAY,IAAI,KAAK,OAAO,CAAC;IACvD,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC;IACpC,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACxD,kBAAkB,EAAE,CAAC,EAAE,QAAQ,EAAwB,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAE3G,iCAAiC;IACjC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAwB,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,QAAQ,OAAO,CAAC;CAC7F,CAAA","sourcesContent":["// Entry names of the Arena format export (zip), shared by Arena (export / import) and Arena Mobile\n// (records export, survey package download)\n\nconst separator = '/'\n\nconst dir = {\n activityLog: 'activitylog',\n categories: 'categories',\n chains: 'chains',\n files: 'files',\n records: 'records',\n surveyFiles: 'surveyfiles',\n taxonomies: 'taxonomies',\n users: 'users',\n userProfilePictures: ['users', 'profilepictures'].join(separator),\n}\n\nconst path = (...parts: string[]): string => parts.join(separator)\n\nexport const ArenaExportFile = {\n activityLog: ({ index }: { index: number }): string => path(dir.activityLog, `activityLog_${index}.json`),\n categories: path(dir.categories, 'categories.json'),\n categoryItemsSingleFile: ({ categoryUuid }: { categoryUuid: string }): string =>\n path(dir.categories, `${categoryUuid}.json`),\n categoryItemsPart: ({ categoryUuid, index }: { categoryUuid: string; index: number }): string =>\n path(dir.categories, `${categoryUuid}_${index}.json`),\n chains: path(dir.chains, 'chains.json'),\n chain: ({ chainUuid }: { chainUuid: string }): string => path(dir.chains, `${chainUuid}.json`),\n // record files\n filesDir: dir.files,\n filesSummaries: path(dir.files, 'files.json'),\n file: ({ fileUuid }: { fileUuid: string }): string => path(dir.files, `${fileUuid}.bin`),\n info: 'info.json',\n recordsDir: dir.records,\n records: path(dir.records, 'records.json'),\n record: ({ recordUuid }: { recordUuid: string }): string => path(dir.records, `${recordUuid}.json`),\n survey: 'survey.json',\n // survey files (e.g. preloaded map layers, branding images)\n surveyFilesDir: dir.surveyFiles,\n surveyFile: ({ fileUuid }: { fileUuid: string }): string => path(dir.surveyFiles, `${fileUuid}.bin`),\n chainMauFilesSummaries: path(dir.surveyFiles, 'chainMauFiles.json'),\n taxonomies: path(dir.taxonomies, 'taxonomies.json'),\n taxa: ({ taxonomyUuid }: { taxonomyUuid: string }): string => path(dir.taxonomies, `${taxonomyUuid}.json`),\n taxaPart: ({ taxonomyUuid, index }: { taxonomyUuid: string; index: number }): string =>\n path(dir.taxonomies, `${taxonomyUuid}_${index}.json`),\n users: path(dir.users, 'users.json'),\n userInvitations: path(dir.users, 'userInvitations.json'),\n userProfilePicture: ({ userUuid }: { userUuid: string }): string => path(dir.userProfilePictures, userUuid),\n\n // deprecated (old export format)\n fileOld: ({ fileUuid }: { fileUuid: string }): string => path(dir.files, `${fileUuid}.json`),\n}\n"]}
|
|
@@ -8,3 +8,4 @@ export { ArenaExportType } from './ArenaExportInfo';
|
|
|
8
8
|
export { ArenaExportInfoFactory } from './ArenaExportInfoFactory';
|
|
9
9
|
export type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory';
|
|
10
10
|
export { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator';
|
|
11
|
+
export { ArenaExportFile } from './ArenaExportFile';
|
package/dist/dataExport/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniqueFileNamesGenerator = exports.ArenaExportInfoFactory = exports.ArenaExportType = exports.FlatDataExportColumnDataType = exports.FlatDataExportModel = exports.FlatDataFiles = exports.FlatDataExportDefaultOptions = exports.FlatDataExportOption = void 0;
|
|
3
|
+
exports.ArenaExportFile = exports.UniqueFileNamesGenerator = exports.ArenaExportInfoFactory = exports.ArenaExportType = exports.FlatDataExportColumnDataType = exports.FlatDataExportModel = exports.FlatDataFiles = exports.FlatDataExportDefaultOptions = exports.FlatDataExportOption = void 0;
|
|
4
4
|
var FlatDataExportOptions_1 = require("./FlatDataExportOptions");
|
|
5
5
|
Object.defineProperty(exports, "FlatDataExportOption", { enumerable: true, get: function () { return FlatDataExportOptions_1.FlatDataExportOption; } });
|
|
6
6
|
Object.defineProperty(exports, "FlatDataExportDefaultOptions", { enumerable: true, get: function () { return FlatDataExportOptions_1.FlatDataExportDefaultOptions; } });
|
|
@@ -16,4 +16,6 @@ var ArenaExportInfoFactory_1 = require("./ArenaExportInfoFactory");
|
|
|
16
16
|
Object.defineProperty(exports, "ArenaExportInfoFactory", { enumerable: true, get: function () { return ArenaExportInfoFactory_1.ArenaExportInfoFactory; } });
|
|
17
17
|
var UniqueFileNamesGenerator_1 = require("./UniqueFileNamesGenerator");
|
|
18
18
|
Object.defineProperty(exports, "UniqueFileNamesGenerator", { enumerable: true, get: function () { return UniqueFileNamesGenerator_1.UniqueFileNamesGenerator; } });
|
|
19
|
+
var ArenaExportFile_1 = require("./ArenaExportFile");
|
|
20
|
+
Object.defineProperty(exports, "ArenaExportFile", { enumerable: true, get: function () { return ArenaExportFile_1.ArenaExportFile; } });
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dataExport/index.ts"],"names":[],"mappings":";;;AACA,iEAA4F;AAAnF,6HAAA,oBAAoB,OAAA;AAAE,qIAAA,4BAA4B,OAAA;AAC3D,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,6DAAoE;AAA3D,mIAAA,4BAA4B,OAAA;AAErC,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAE/B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA","sourcesContent":["export type { FlatDataExportOptions } from './FlatDataExportOptions'\nexport { FlatDataExportOption, FlatDataExportDefaultOptions } from './FlatDataExportOptions'\nexport { FlatDataFiles } from './FlatDataFiles'\nexport { FlatDataExportModel } from './FlatDataExportModel'\nexport { FlatDataExportColumnDataType } from './FlatDataExportModel'\nexport type { ArenaExportInfo } from './ArenaExportInfo'\nexport { ArenaExportType } from './ArenaExportInfo'\nexport { ArenaExportInfoFactory } from './ArenaExportInfoFactory'\nexport type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory'\nexport { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dataExport/index.ts"],"names":[],"mappings":";;;AACA,iEAA4F;AAAnF,6HAAA,oBAAoB,OAAA;AAAE,qIAAA,4BAA4B,OAAA;AAC3D,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,6DAAoE;AAA3D,mIAAA,4BAA4B,OAAA;AAErC,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAE/B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,qDAAmD;AAA1C,kHAAA,eAAe,OAAA","sourcesContent":["export type { FlatDataExportOptions } from './FlatDataExportOptions'\nexport { FlatDataExportOption, FlatDataExportDefaultOptions } from './FlatDataExportOptions'\nexport { FlatDataFiles } from './FlatDataFiles'\nexport { FlatDataExportModel } from './FlatDataExportModel'\nexport { FlatDataExportColumnDataType } from './FlatDataExportModel'\nexport type { ArenaExportInfo } from './ArenaExportInfo'\nexport { ArenaExportType } from './ArenaExportInfo'\nexport { ArenaExportInfoFactory } from './ArenaExportInfoFactory'\nexport type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory'\nexport { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator'\nexport { ArenaExportFile } from './ArenaExportFile'\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const SystemErrorKeys: {
|
|
5
5
|
readonly expression: {
|
|
6
|
+
readonly areaOfInterestNotFound: 'expression.areaOfInterestNotFound';
|
|
6
7
|
readonly booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported';
|
|
7
8
|
readonly functionHasTooFewArguments: 'expression.functionHasTooFewArguments';
|
|
8
9
|
readonly functionHasTooManyArguments: 'expression.functionHasTooManyArguments';
|
|
@@ -6,6 +6,7 @@ exports.SystemErrorKeys = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
exports.SystemErrorKeys = {
|
|
8
8
|
expression: {
|
|
9
|
+
areaOfInterestNotFound: 'expression.areaOfInterestNotFound',
|
|
9
10
|
booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported',
|
|
10
11
|
functionHasTooFewArguments: 'expression.functionHasTooFewArguments',
|
|
11
12
|
functionHasTooManyArguments: 'expression.functionHasTooManyArguments',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemErrorKeys.js","sourceRoot":"","sources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["/**\n * Keys of the errors thrown by arena-core as SystemError (translatable, see SystemError.key).\n */\nexport const SystemErrorKeys = {\n expression: {\n booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported',\n functionHasTooFewArguments: 'expression.functionHasTooFewArguments',\n functionHasTooManyArguments: 'expression.functionHasTooManyArguments',\n identifierNotFound: 'expression.identifierNotFound',\n invalidAttributeValuePropertyName: 'expression.invalidAttributeValuePropertyName',\n invalidCalleeType: 'expression.invalidCalleeType',\n invalidCategoryExtraProp: 'expression.invalidCategoryExtraProp',\n invalidCategoryName: 'expression.invalidCategoryName',\n invalidTaxonVernacularNameLanguageCode: 'expression.invalidTaxonVernacularNameLanguageCode',\n invalidTaxonomyExtraProp: 'expression.invalidTaxonomyExtraProp',\n invalidTaxonomyName: 'expression.invalidTaxonomyName',\n missingFunctionParameters: 'expression.missingFunctionParameters',\n multipleNodesFoundForNodeDef: 'expression.multipleNodesFoundForNodeDef',\n nodeNotFoundForNodeDef: 'expression.nodeNotFoundForNodeDef',\n notSupported: 'expression.notSupported',\n unaryOperatorNotSupported: 'expression.unaryOperatorNotSupported',\n undefinedFunction: 'expression.undefinedFunction',\n unsupportedFunctionType: 'expression.unsupportedFunctionType',\n },\n geo: {\n pointNotFilled: 'geo.pointNotFilled',\n srsNotFound: 'geo.srsNotFound',\n transformFailed: 'geo.transformFailed',\n },\n job: {\n canceledOrErrorsFound: 'jobCanceledOrErrorsFound',\n },\n nodeDef: {\n hierarchyCircularDependency: 'nodeDef.hierarchyCircularDependency',\n parentNotFound: 'nodeDef.parentNotFound',\n },\n record: {\n dependencyOnRootFound: 'record.nodes.dependents.dependencyOnRootFound',\n enumeratorNodeNotFound: 'record.enumeratorNodeNotFound',\n multipleNodesFound: 'systemError.record.multipleNodesFound',\n nodeNotFound: 'record.nodeNotFound',\n nodesIndexNotInitialized: 'record.nodesIndexNotInitialized',\n updateSelfAndDependentsDefaultValues: 'record.updateSelfAndDependentsDefaultValues',\n updateSelfAndDependentsFileNames: 'record.updateSelfAndDependentsFileNames',\n },\n survey: {\n emptyNodeDefs: 'survey.emptyNodeDefs',\n nodeDefNameNotFound: 'survey.nodeDefNameNotFound',\n nodeDefUuidNotFound: 'survey.nodeDefUuidNotFound',\n rootDefNotFound: 'survey.rootDefNotFound',\n },\n} as const\n"]}
|
|
1
|
+
{"version":3,"file":"systemErrorKeys.js","sourceRoot":"","sources":["../../src/error/systemErrorKeys.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,UAAU,EAAE;QACV,sBAAsB,EAAE,mCAAmC;QAC3D,2BAA2B,EAAE,wCAAwC;QACrE,0BAA0B,EAAE,uCAAuC;QACnE,2BAA2B,EAAE,wCAAwC;QACrE,kBAAkB,EAAE,+BAA+B;QACnD,iCAAiC,EAAE,8CAA8C;QACjF,iBAAiB,EAAE,8BAA8B;QACjD,wBAAwB,EAAE,qCAAqC;QAC/D,mBAAmB,EAAE,gCAAgC;QACrD,sCAAsC,EAAE,mDAAmD;QAC3F,wBAAwB,EAAE,qCAAqC;QAC/D,mBAAmB,EAAE,gCAAgC;QACrD,yBAAyB,EAAE,sCAAsC;QACjE,4BAA4B,EAAE,yCAAyC;QACvE,sBAAsB,EAAE,mCAAmC;QAC3D,YAAY,EAAE,yBAAyB;QACvC,yBAAyB,EAAE,sCAAsC;QACjE,iBAAiB,EAAE,8BAA8B;QACjD,uBAAuB,EAAE,oCAAoC;KAC9D;IACD,GAAG,EAAE;QACH,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,iBAAiB;QAC9B,eAAe,EAAE,qBAAqB;KACvC;IACD,GAAG,EAAE;QACH,qBAAqB,EAAE,0BAA0B;KAClD;IACD,OAAO,EAAE;QACP,2BAA2B,EAAE,qCAAqC;QAClE,cAAc,EAAE,wBAAwB;KACzC;IACD,MAAM,EAAE;QACN,qBAAqB,EAAE,+CAA+C;QACtE,sBAAsB,EAAE,+BAA+B;QACvD,kBAAkB,EAAE,uCAAuC;QAC3D,YAAY,EAAE,qBAAqB;QACnC,wBAAwB,EAAE,iCAAiC;QAC3D,oCAAoC,EAAE,6CAA6C;QACnF,gCAAgC,EAAE,yCAAyC;KAC5E;IACD,MAAM,EAAE;QACN,aAAa,EAAE,sBAAsB;QACrC,mBAAmB,EAAE,4BAA4B;QACjD,mBAAmB,EAAE,4BAA4B;QACjD,eAAe,EAAE,wBAAwB;KAC1C;CACO,CAAA","sourcesContent":["/**\n * Keys of the errors thrown by arena-core as SystemError (translatable, see SystemError.key).\n */\nexport const SystemErrorKeys = {\n expression: {\n areaOfInterestNotFound: 'expression.areaOfInterestNotFound',\n booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported',\n functionHasTooFewArguments: 'expression.functionHasTooFewArguments',\n functionHasTooManyArguments: 'expression.functionHasTooManyArguments',\n identifierNotFound: 'expression.identifierNotFound',\n invalidAttributeValuePropertyName: 'expression.invalidAttributeValuePropertyName',\n invalidCalleeType: 'expression.invalidCalleeType',\n invalidCategoryExtraProp: 'expression.invalidCategoryExtraProp',\n invalidCategoryName: 'expression.invalidCategoryName',\n invalidTaxonVernacularNameLanguageCode: 'expression.invalidTaxonVernacularNameLanguageCode',\n invalidTaxonomyExtraProp: 'expression.invalidTaxonomyExtraProp',\n invalidTaxonomyName: 'expression.invalidTaxonomyName',\n missingFunctionParameters: 'expression.missingFunctionParameters',\n multipleNodesFoundForNodeDef: 'expression.multipleNodesFoundForNodeDef',\n nodeNotFoundForNodeDef: 'expression.nodeNotFoundForNodeDef',\n notSupported: 'expression.notSupported',\n unaryOperatorNotSupported: 'expression.unaryOperatorNotSupported',\n undefinedFunction: 'expression.undefinedFunction',\n unsupportedFunctionType: 'expression.unsupportedFunctionType',\n },\n geo: {\n pointNotFilled: 'geo.pointNotFilled',\n srsNotFound: 'geo.srsNotFound',\n transformFailed: 'geo.transformFailed',\n },\n job: {\n canceledOrErrorsFound: 'jobCanceledOrErrorsFound',\n },\n nodeDef: {\n hierarchyCircularDependency: 'nodeDef.hierarchyCircularDependency',\n parentNotFound: 'nodeDef.parentNotFound',\n },\n record: {\n dependencyOnRootFound: 'record.nodes.dependents.dependencyOnRootFound',\n enumeratorNodeNotFound: 'record.enumeratorNodeNotFound',\n multipleNodesFound: 'systemError.record.multipleNodesFound',\n nodeNotFound: 'record.nodeNotFound',\n nodesIndexNotInitialized: 'record.nodesIndexNotInitialized',\n updateSelfAndDependentsDefaultValues: 'record.updateSelfAndDependentsDefaultValues',\n updateSelfAndDependentsFileNames: 'record.updateSelfAndDependentsFileNames',\n },\n survey: {\n emptyNodeDefs: 'survey.emptyNodeDefs',\n nodeDefNameNotFound: 'survey.nodeDefNameNotFound',\n nodeDefUuidNotFound: 'survey.nodeDefUuidNotFound',\n rootDefNotFound: 'survey.rootDefNotFound',\n },\n} as const\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Entry names of the Arena format export (zip), shared by Arena (export / import) and Arena Mobile
|
|
2
|
+
// (records export, survey package download)
|
|
3
|
+
const separator = '/';
|
|
4
|
+
const dir = {
|
|
5
|
+
activityLog: 'activitylog',
|
|
6
|
+
categories: 'categories',
|
|
7
|
+
chains: 'chains',
|
|
8
|
+
files: 'files',
|
|
9
|
+
records: 'records',
|
|
10
|
+
surveyFiles: 'surveyfiles',
|
|
11
|
+
taxonomies: 'taxonomies',
|
|
12
|
+
users: 'users',
|
|
13
|
+
userProfilePictures: ['users', 'profilepictures'].join(separator),
|
|
14
|
+
};
|
|
15
|
+
const path = (...parts) => parts.join(separator);
|
|
16
|
+
export const ArenaExportFile = {
|
|
17
|
+
activityLog: ({ index }) => path(dir.activityLog, `activityLog_${index}.json`),
|
|
18
|
+
categories: path(dir.categories, 'categories.json'),
|
|
19
|
+
categoryItemsSingleFile: ({ categoryUuid }) => path(dir.categories, `${categoryUuid}.json`),
|
|
20
|
+
categoryItemsPart: ({ categoryUuid, index }) => path(dir.categories, `${categoryUuid}_${index}.json`),
|
|
21
|
+
chains: path(dir.chains, 'chains.json'),
|
|
22
|
+
chain: ({ chainUuid }) => path(dir.chains, `${chainUuid}.json`),
|
|
23
|
+
// record files
|
|
24
|
+
filesDir: dir.files,
|
|
25
|
+
filesSummaries: path(dir.files, 'files.json'),
|
|
26
|
+
file: ({ fileUuid }) => path(dir.files, `${fileUuid}.bin`),
|
|
27
|
+
info: 'info.json',
|
|
28
|
+
recordsDir: dir.records,
|
|
29
|
+
records: path(dir.records, 'records.json'),
|
|
30
|
+
record: ({ recordUuid }) => path(dir.records, `${recordUuid}.json`),
|
|
31
|
+
survey: 'survey.json',
|
|
32
|
+
// survey files (e.g. preloaded map layers, branding images)
|
|
33
|
+
surveyFilesDir: dir.surveyFiles,
|
|
34
|
+
surveyFile: ({ fileUuid }) => path(dir.surveyFiles, `${fileUuid}.bin`),
|
|
35
|
+
chainMauFilesSummaries: path(dir.surveyFiles, 'chainMauFiles.json'),
|
|
36
|
+
taxonomies: path(dir.taxonomies, 'taxonomies.json'),
|
|
37
|
+
taxa: ({ taxonomyUuid }) => path(dir.taxonomies, `${taxonomyUuid}.json`),
|
|
38
|
+
taxaPart: ({ taxonomyUuid, index }) => path(dir.taxonomies, `${taxonomyUuid}_${index}.json`),
|
|
39
|
+
users: path(dir.users, 'users.json'),
|
|
40
|
+
userInvitations: path(dir.users, 'userInvitations.json'),
|
|
41
|
+
userProfilePicture: ({ userUuid }) => path(dir.userProfilePictures, userUuid),
|
|
42
|
+
// deprecated (old export format)
|
|
43
|
+
fileOld: ({ fileUuid }) => path(dir.files, `${fileUuid}.json`),
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=ArenaExportFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArenaExportFile.js","sourceRoot":"","sources":["../../../src/dataExport/ArenaExportFile.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,4CAA4C;AAE5C,MAAM,SAAS,GAAG,GAAG,CAAA;AAErB,MAAM,GAAG,GAAG;IACV,WAAW,EAAE,aAAa;IAC1B,UAAU,E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,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,QAAQ,OAAO,CAAC;CAC7F,CAAA","sourcesContent":["// Entry names of the Arena format export (zip), shared by Arena (export / import) and Arena Mobile\n// (records export, survey package download)\n\nconst separator = '/'\n\nconst dir = {\n activityLog: 'activitylog',\n categories: 'categories',\n chains: 'chains',\n files: 'files',\n records: 'records',\n surveyFiles: 'surveyfiles',\n taxonomies: 'taxonomies',\n users: 'users',\n userProfilePictures: ['users', 'profilepictures'].join(separator),\n}\n\nconst path = (...parts: string[]): string => parts.join(separator)\n\nexport const ArenaExportFile = {\n activityLog: ({ index }: { index: number }): string => path(dir.activityLog, `activityLog_${index}.json`),\n categories: path(dir.categories, 'categories.json'),\n categoryItemsSingleFile: ({ categoryUuid }: { categoryUuid: string }): string =>\n path(dir.categories, `${categoryUuid}.json`),\n categoryItemsPart: ({ categoryUuid, index }: { categoryUuid: string; index: number }): string =>\n path(dir.categories, `${categoryUuid}_${index}.json`),\n chains: path(dir.chains, 'chains.json'),\n chain: ({ chainUuid }: { chainUuid: string }): string => path(dir.chains, `${chainUuid}.json`),\n // record files\n filesDir: dir.files,\n filesSummaries: path(dir.files, 'files.json'),\n file: ({ fileUuid }: { fileUuid: string }): string => path(dir.files, `${fileUuid}.bin`),\n info: 'info.json',\n recordsDir: dir.records,\n records: path(dir.records, 'records.json'),\n record: ({ recordUuid }: { recordUuid: string }): string => path(dir.records, `${recordUuid}.json`),\n survey: 'survey.json',\n // survey files (e.g. preloaded map layers, branding images)\n surveyFilesDir: dir.surveyFiles,\n surveyFile: ({ fileUuid }: { fileUuid: string }): string => path(dir.surveyFiles, `${fileUuid}.bin`),\n chainMauFilesSummaries: path(dir.surveyFiles, 'chainMauFiles.json'),\n taxonomies: path(dir.taxonomies, 'taxonomies.json'),\n taxa: ({ taxonomyUuid }: { taxonomyUuid: string }): string => path(dir.taxonomies, `${taxonomyUuid}.json`),\n taxaPart: ({ taxonomyUuid, index }: { taxonomyUuid: string; index: number }): string =>\n path(dir.taxonomies, `${taxonomyUuid}_${index}.json`),\n users: path(dir.users, 'users.json'),\n userInvitations: path(dir.users, 'userInvitations.json'),\n userProfilePicture: ({ userUuid }: { userUuid: string }): string => path(dir.userProfilePictures, userUuid),\n\n // deprecated (old export format)\n fileOld: ({ fileUuid }: { fileUuid: string }): string => path(dir.files, `${fileUuid}.json`),\n}\n"]}
|
|
@@ -5,4 +5,5 @@ export { FlatDataExportColumnDataType } from './FlatDataExportModel';
|
|
|
5
5
|
export { ArenaExportType } from './ArenaExportInfo';
|
|
6
6
|
export { ArenaExportInfoFactory } from './ArenaExportInfoFactory';
|
|
7
7
|
export { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator';
|
|
8
|
+
export { ArenaExportFile } from './ArenaExportFile';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dataExport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA","sourcesContent":["export type { FlatDataExportOptions } from './FlatDataExportOptions'\nexport { FlatDataExportOption, FlatDataExportDefaultOptions } from './FlatDataExportOptions'\nexport { FlatDataFiles } from './FlatDataFiles'\nexport { FlatDataExportModel } from './FlatDataExportModel'\nexport { FlatDataExportColumnDataType } from './FlatDataExportModel'\nexport type { ArenaExportInfo } from './ArenaExportInfo'\nexport { ArenaExportType } from './ArenaExportInfo'\nexport { ArenaExportInfoFactory } from './ArenaExportInfoFactory'\nexport type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory'\nexport { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dataExport/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAA;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["export type { FlatDataExportOptions } from './FlatDataExportOptions'\nexport { FlatDataExportOption, FlatDataExportDefaultOptions } from './FlatDataExportOptions'\nexport { FlatDataFiles } from './FlatDataFiles'\nexport { FlatDataExportModel } from './FlatDataExportModel'\nexport { FlatDataExportColumnDataType } from './FlatDataExportModel'\nexport type { ArenaExportInfo } from './ArenaExportInfo'\nexport { ArenaExportType } from './ArenaExportInfo'\nexport { ArenaExportInfoFactory } from './ArenaExportInfoFactory'\nexport type { ArenaExportInfoFactoryParams } from './ArenaExportInfoFactory'\nexport { UniqueFileNamesGenerator } from './UniqueFileNamesGenerator'\nexport { ArenaExportFile } from './ArenaExportFile'\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const SystemErrorKeys = {
|
|
5
5
|
expression: {
|
|
6
|
+
areaOfInterestNotFound: 'expression.areaOfInterestNotFound',
|
|
6
7
|
booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported',
|
|
7
8
|
functionHasTooFewArguments: 'expression.functionHasTooFewArguments',
|
|
8
9
|
functionHasTooManyArguments: 'expression.functionHasTooManyArguments',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemErrorKeys.js","sourceRoot":"","sources":["../../../src/error/systemErrorKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU,EAAE;QACV,2BAA2B,EAAE,wCAAwC;QACrE,0BAA0B,EAAE,uCAAuC;QACnE,2BAA2B,EAAE,wCAAwC;QACrE,kBAAkB,EAAE,+BAA+B;QACnD,iCAAiC,EAAE,8CAA8C;QACjF,iBAAiB,EAAE,8BAA8B;QACjD,wBAAwB,EAAE,qCAAqC;QAC/D,mBAAmB,EAAE,gCAAgC;QACrD,sCAAsC,EAAE,mDAAmD;QAC3F,wBAAwB,EAAE,qCAAqC;QAC/D,mBAAmB,EAAE,gCAAgC;QACrD,yBAAyB,EAAE,sCAAsC;QACjE,4BAA4B,EAAE,yCAAyC;QACvE,sBAAsB,EAAE,mCAAmC;QAC3D,YAAY,EAAE,yBAAyB;QACvC,yBAAyB,EAAE,sCAAsC;QACjE,iBAAiB,EAAE,8BAA8B;QACjD,uBAAuB,EAAE,oCAAoC;KAC9D;IACD,GAAG,EAAE;QACH,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,iBAAiB;QAC9B,eAAe,EAAE,qBAAqB;KACvC;IACD,GAAG,EAAE;QACH,qBAAqB,EAAE,0BAA0B;KAClD;IACD,OAAO,EAAE;QACP,2BAA2B,EAAE,qCAAqC;QAClE,cAAc,EAAE,wBAAwB;KACzC;IACD,MAAM,EAAE;QACN,qBAAqB,EAAE,+CAA+C;QACtE,sBAAsB,EAAE,+BAA+B;QACvD,kBAAkB,EAAE,uCAAuC;QAC3D,YAAY,EAAE,qBAAqB;QACnC,wBAAwB,EAAE,iCAAiC;QAC3D,oCAAoC,EAAE,6CAA6C;QACnF,gCAAgC,EAAE,yCAAyC;KAC5E;IACD,MAAM,EAAE;QACN,aAAa,EAAE,sBAAsB;QACrC,mBAAmB,EAAE,4BAA4B;QACjD,mBAAmB,EAAE,4BAA4B;QACjD,eAAe,EAAE,wBAAwB;KAC1C;CACO,CAAA","sourcesContent":["/**\n * Keys of the errors thrown by arena-core as SystemError (translatable, see SystemError.key).\n */\nexport const SystemErrorKeys = {\n expression: {\n booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported',\n functionHasTooFewArguments: 'expression.functionHasTooFewArguments',\n functionHasTooManyArguments: 'expression.functionHasTooManyArguments',\n identifierNotFound: 'expression.identifierNotFound',\n invalidAttributeValuePropertyName: 'expression.invalidAttributeValuePropertyName',\n invalidCalleeType: 'expression.invalidCalleeType',\n invalidCategoryExtraProp: 'expression.invalidCategoryExtraProp',\n invalidCategoryName: 'expression.invalidCategoryName',\n invalidTaxonVernacularNameLanguageCode: 'expression.invalidTaxonVernacularNameLanguageCode',\n invalidTaxonomyExtraProp: 'expression.invalidTaxonomyExtraProp',\n invalidTaxonomyName: 'expression.invalidTaxonomyName',\n missingFunctionParameters: 'expression.missingFunctionParameters',\n multipleNodesFoundForNodeDef: 'expression.multipleNodesFoundForNodeDef',\n nodeNotFoundForNodeDef: 'expression.nodeNotFoundForNodeDef',\n notSupported: 'expression.notSupported',\n unaryOperatorNotSupported: 'expression.unaryOperatorNotSupported',\n undefinedFunction: 'expression.undefinedFunction',\n unsupportedFunctionType: 'expression.unsupportedFunctionType',\n },\n geo: {\n pointNotFilled: 'geo.pointNotFilled',\n srsNotFound: 'geo.srsNotFound',\n transformFailed: 'geo.transformFailed',\n },\n job: {\n canceledOrErrorsFound: 'jobCanceledOrErrorsFound',\n },\n nodeDef: {\n hierarchyCircularDependency: 'nodeDef.hierarchyCircularDependency',\n parentNotFound: 'nodeDef.parentNotFound',\n },\n record: {\n dependencyOnRootFound: 'record.nodes.dependents.dependencyOnRootFound',\n enumeratorNodeNotFound: 'record.enumeratorNodeNotFound',\n multipleNodesFound: 'systemError.record.multipleNodesFound',\n nodeNotFound: 'record.nodeNotFound',\n nodesIndexNotInitialized: 'record.nodesIndexNotInitialized',\n updateSelfAndDependentsDefaultValues: 'record.updateSelfAndDependentsDefaultValues',\n updateSelfAndDependentsFileNames: 'record.updateSelfAndDependentsFileNames',\n },\n survey: {\n emptyNodeDefs: 'survey.emptyNodeDefs',\n nodeDefNameNotFound: 'survey.nodeDefNameNotFound',\n nodeDefUuidNotFound: 'survey.nodeDefUuidNotFound',\n rootDefNotFound: 'survey.rootDefNotFound',\n },\n} as const\n"]}
|
|
1
|
+
{"version":3,"file":"systemErrorKeys.js","sourceRoot":"","sources":["../../../src/error/systemErrorKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,UAAU,EAAE;QACV,sBAAsB,EAAE,mCAAmC;QAC3D,2BAA2B,EAAE,wCAAwC;QACrE,0BAA0B,EAAE,uCAAuC;QACnE,2BAA2B,EAAE,wCAAwC;QACrE,kBAAkB,EAAE,+BAA+B;QACnD,iCAAiC,EAAE,8CAA8C;QACjF,iBAAiB,EAAE,8BAA8B;QACjD,wBAAwB,EAAE,qCAAqC;QAC/D,mBAAmB,EAAE,gCAAgC;QACrD,sCAAsC,EAAE,mDAAmD;QAC3F,wBAAwB,EAAE,qCAAqC;QAC/D,mBAAmB,EAAE,gCAAgC;QACrD,yBAAyB,EAAE,sCAAsC;QACjE,4BAA4B,EAAE,yCAAyC;QACvE,sBAAsB,EAAE,mCAAmC;QAC3D,YAAY,EAAE,yBAAyB;QACvC,yBAAyB,EAAE,sCAAsC;QACjE,iBAAiB,EAAE,8BAA8B;QACjD,uBAAuB,EAAE,oCAAoC;KAC9D;IACD,GAAG,EAAE;QACH,cAAc,EAAE,oBAAoB;QACpC,WAAW,EAAE,iBAAiB;QAC9B,eAAe,EAAE,qBAAqB;KACvC;IACD,GAAG,EAAE;QACH,qBAAqB,EAAE,0BAA0B;KAClD;IACD,OAAO,EAAE;QACP,2BAA2B,EAAE,qCAAqC;QAClE,cAAc,EAAE,wBAAwB;KACzC;IACD,MAAM,EAAE;QACN,qBAAqB,EAAE,+CAA+C;QACtE,sBAAsB,EAAE,+BAA+B;QACvD,kBAAkB,EAAE,uCAAuC;QAC3D,YAAY,EAAE,qBAAqB;QACnC,wBAAwB,EAAE,iCAAiC;QAC3D,oCAAoC,EAAE,6CAA6C;QACnF,gCAAgC,EAAE,yCAAyC;KAC5E;IACD,MAAM,EAAE;QACN,aAAa,EAAE,sBAAsB;QACrC,mBAAmB,EAAE,4BAA4B;QACjD,mBAAmB,EAAE,4BAA4B;QACjD,eAAe,EAAE,wBAAwB;KAC1C;CACO,CAAA","sourcesContent":["/**\n * Keys of the errors thrown by arena-core as SystemError (translatable, see SystemError.key).\n */\nexport const SystemErrorKeys = {\n expression: {\n areaOfInterestNotFound: 'expression.areaOfInterestNotFound',\n booleanOperatorNotSupported: 'expression.booleanOperatorNotSupported',\n functionHasTooFewArguments: 'expression.functionHasTooFewArguments',\n functionHasTooManyArguments: 'expression.functionHasTooManyArguments',\n identifierNotFound: 'expression.identifierNotFound',\n invalidAttributeValuePropertyName: 'expression.invalidAttributeValuePropertyName',\n invalidCalleeType: 'expression.invalidCalleeType',\n invalidCategoryExtraProp: 'expression.invalidCategoryExtraProp',\n invalidCategoryName: 'expression.invalidCategoryName',\n invalidTaxonVernacularNameLanguageCode: 'expression.invalidTaxonVernacularNameLanguageCode',\n invalidTaxonomyExtraProp: 'expression.invalidTaxonomyExtraProp',\n invalidTaxonomyName: 'expression.invalidTaxonomyName',\n missingFunctionParameters: 'expression.missingFunctionParameters',\n multipleNodesFoundForNodeDef: 'expression.multipleNodesFoundForNodeDef',\n nodeNotFoundForNodeDef: 'expression.nodeNotFoundForNodeDef',\n notSupported: 'expression.notSupported',\n unaryOperatorNotSupported: 'expression.unaryOperatorNotSupported',\n undefinedFunction: 'expression.undefinedFunction',\n unsupportedFunctionType: 'expression.unsupportedFunctionType',\n },\n geo: {\n pointNotFilled: 'geo.pointNotFilled',\n srsNotFound: 'geo.srsNotFound',\n transformFailed: 'geo.transformFailed',\n },\n job: {\n canceledOrErrorsFound: 'jobCanceledOrErrorsFound',\n },\n nodeDef: {\n hierarchyCircularDependency: 'nodeDef.hierarchyCircularDependency',\n parentNotFound: 'nodeDef.parentNotFound',\n },\n record: {\n dependencyOnRootFound: 'record.nodes.dependents.dependencyOnRootFound',\n enumeratorNodeNotFound: 'record.enumeratorNodeNotFound',\n multipleNodesFound: 'systemError.record.multipleNodesFound',\n nodeNotFound: 'record.nodeNotFound',\n nodesIndexNotInitialized: 'record.nodesIndexNotInitialized',\n updateSelfAndDependentsDefaultValues: 'record.updateSelfAndDependentsDefaultValues',\n updateSelfAndDependentsFileNames: 'record.updateSelfAndDependentsFileNames',\n },\n survey: {\n emptyNodeDefs: 'survey.emptyNodeDefs',\n nodeDefNameNotFound: 'survey.nodeDefNameNotFound',\n nodeDefUuidNotFound: 'survey.nodeDefUuidNotFound',\n rootDefNotFound: 'survey.rootDefNotFound',\n },\n} as const\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"areaOfInterest.js","sourceRoot":"","sources":["../../../src/geo/areaOfInterest.ts"],"names":[],"mappings":"","sourcesContent":["import type { MultiPolygon, Polygon } from 'geojson'\n\n/**\n * Area of interest
|
|
1
|
+
{"version":3,"file":"areaOfInterest.js","sourceRoot":"","sources":["../../../src/geo/areaOfInterest.ts"],"names":[],"mappings":"","sourcesContent":["import type { MultiPolygon, Polygon } from 'geojson'\n\nimport type { Labels } from '../language'\n\n/**\n * Area of interest geometry: GeoJSON polygon or multi polygon in WGS84 (EPSG:4326).\n */\nexport type AreaOfInterest = Polygon | MultiPolygon\n\n/**\n * Area of interest defined in a survey; the geometry is stored in a separate file (fetched by AreaOfInterestProvider).\n */\nexport interface AreaOfInterestDescriptor {\n // identifier used in expressions\n name: string\n labels?: Labels\n fileUuid: string\n fileName: string\n size: number\n polygons: number\n vertices: number\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/geo/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA","sourcesContent":["export type { AreaOfInterest } from './areaOfInterest'\nexport type { Point } from './point'\n\nexport { PointFactory } from './pointFactory'\n\nexport { Points } from './points'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/geo/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA","sourcesContent":["export type { AreaOfInterest, AreaOfInterestDescriptor } from './areaOfInterest'\nexport type { Point } from './point'\n\nexport { PointFactory } from './pointFactory'\n\nexport { Points } from './points'\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { CategoryFactory, CategoryImportColumnType, CategoryItemFactory, Categor
|
|
|
3
3
|
export { Categories, CategoryItems } from './category';
|
|
4
4
|
export { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain';
|
|
5
5
|
export { TraverseMethod } from './common';
|
|
6
|
-
export { FlatDataExportDefaultOptions, FlatDataExportOption, FlatDataFiles, FlatDataExportModel, FlatDataExportColumnDataType, ArenaExportInfoFactory, ArenaExportType, UniqueFileNamesGenerator, } from './dataExport';
|
|
6
|
+
export { FlatDataExportDefaultOptions, FlatDataExportOption, FlatDataFiles, FlatDataExportModel, FlatDataExportColumnDataType, ArenaExportFile, ArenaExportInfoFactory, ArenaExportType, UniqueFileNamesGenerator, } from './dataExport';
|
|
7
7
|
export { DataQueryMode, DataQuerySummaries } from './dataQuery';
|
|
8
8
|
export { SystemError, SystemErrorKeys } from './error';
|
|
9
9
|
export { ExpressionNodeType, ExpressionNodeEvaluator, ExpressionVariable, JavascriptExpressionEvaluator, JavascriptExpressionParser, } from './expression';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAwBzG,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAejH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAY5E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAIzC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EACf,wBAAwB,GACzB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAG/D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,cAAc,CAAA;AAsBrB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAG5C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,EAAE,YAAY,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E,aAAa,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAEjF,OAAO,EACL,MAAM,EACN,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,EACL,cAAc,EACd,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,GACT,MAAM,SAAS,CAAA;AAIhB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,kBAAkB,GACnB,MAAM,cAAc,CAAA","sourcesContent":["export type { AppInfo } from './app'\n\nexport { Authorizer, AuthGroupName, UserStatus, Permission, UserTitle, UserFactory, Users } from './auth'\nexport type {\n AuthGroup,\n User,\n UserAuthGroup,\n UserAuthGroupProps,\n AuthToken,\n UserAuthTokenPayload,\n UserAuthTokenService,\n UserPrefs,\n UserPrefSurveys,\n UserProps,\n UserAuthRefreshToken,\n UserAuthRefreshTokenProps,\n UserAuthRefreshTokenPayload,\n UserService,\n UserTokenPayload,\n DownloadAuthTokenPayload,\n UserGroup,\n UserGroupProps,\n UserGroupQualifier,\n UserInvitation,\n} from './auth'\n\nexport { CategoryFactory, CategoryImportColumnType, CategoryItemFactory, CategoryLevelFactory } from './category'\nexport type {\n CategoryItemProps,\n Category,\n CategoryItem,\n CategoryLevel,\n CategoryLevelProps,\n CategoryImportSummary,\n CategoryImportSummaryColumn,\n CategoryItemService,\n CategoryLevelService,\n CategoryProps,\n CategoryService,\n} from './category'\n\nexport { Categories, CategoryItems } from './category'\n\nexport { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain'\nexport type {\n Chain,\n ChainProps,\n ChainService,\n ChainNodeDef,\n ChainNodeDefProps,\n ChainNodeDefService,\n ChainNodeDefAggregate,\n ChainNodeDefAggregateProps,\n} from './chain'\n\nexport { TraverseMethod } from './common'\nexport type { ArenaObject, ArenaService, Dictionary, Factory, I18n } from './common'\n\nexport type { FlatDataExportOptions, ArenaExportInfoFactoryParams, ArenaExportInfo } from './dataExport'\nexport {\n FlatDataExportDefaultOptions,\n FlatDataExportOption,\n FlatDataFiles,\n FlatDataExportModel,\n FlatDataExportColumnDataType,\n ArenaExportInfoFactory,\n ArenaExportType,\n UniqueFileNamesGenerator,\n} from './dataExport'\n\nexport { DataQueryMode, DataQuerySummaries } from './dataQuery'\nexport type { DataQuery, DataQuerySummary, DataQuerySummaryProps } 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 ArrayExpression,\n BinaryExpression,\n CallExpression,\n CompoundExpression,\n ConditionalExpression,\n ExpressionContext,\n ExpressionEvaluator,\n ExpressionFunction,\n ExpressionFunctions,\n AnyExpressionNode,\n ExpressionNode,\n ExpressionNodeEvaluatorConstructor,\n MemberExpression,\n IdentifierExpression,\n LiteralExpression,\n SequenceExpression,\n ThisExpression,\n UnaryExpression,\n} from './expression'\n\nexport { ExtraPropDataType, ExtraPropsDataGenerator } from './extraProp'\nexport type { ExtraPropDef, ExtraPropDefs } from './extraProp'\n\nexport { PointFactory, Points } from './geo'\nexport type { AreaOfInterest, Point } from './geo'\n\nexport { JobBase, JobEventType, JobStatus } from './job'\nexport type { Job, JobContext, JobEvent, JobSerialized, JobTxClient } from './job'\n\nexport { LanguageCode, Languages, LanguagesISO639part2 } from './language'\nexport type { Labels } from './language'\n\nexport type { Logger } from './logger'\n\nexport type { Message } from './message'\nexport { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message'\n\nexport { NodeFactory, NodeKeys, NodeMetaKeys, Nodes, NodeValueFormatter, NodeValues } from './node'\nexport type {\n ArenaRecordNode,\n Node,\n NodeMeta,\n NodePointer,\n NodeRefData,\n NodeService,\n NodesMap,\n NodeValueCode,\n NodeValueCoordinate,\n NodeValueFile,\n NodeValueTaxon,\n} from './node'\n\nexport {\n NodeDefCountType,\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 { CategoryItemProvider, TaxonProvider } from './nodeDefExpressionEvaluator'\n\nexport type {\n NodeDef,\n NodeDefLayout,\n NodeDefMeta,\n NodeDefProps,\n NodeDefPropsWithLayout,\n NodeDefBoolean,\n NodeDefBooleanProps,\n NodeDefCode,\n NodeDefCodeLayout,\n NodeDefCodeProps,\n NodeDefCoordinate,\n NodeDefCoordinateProps,\n NodeDefDate,\n NodeDefDecimal,\n NodeDefDecimalProps,\n NodeDefEntity,\n NodeDefEntityChildPosition,\n NodeDefEntityLayout,\n NodeDefEntityProps,\n NodeDefPrintOrientation,\n NodeDefFile,\n NodeDefFileProps,\n NodeDefGeo,\n NodeDefGeoProps,\n NodeDefFormHeader,\n NodeDefFormHeaderProps,\n NodeDefInteger,\n NodeDefPropsAdvanced,\n NodeDefTaxon,\n NodeDefTaxonProps,\n NodeDefText,\n NodeDefTextProps,\n NodeDefTextLayout,\n NodeDefTime,\n NodeDefTimeProps,\n NodeDefExpression,\n NodeDefMap,\n NodeDefService,\n NodeDefValidations,\n} from './nodeDef'\n\nexport {\n NodePointers,\n RecordCloner,\n RecordFactory,\n RecordFixer,\n Records,\n RECORD_STEP_DEFAULT,\n RecordExpressionEvaluator,\n RecordNodesUpdater,\n RecordPrettyPrinter,\n RecordUpdater,\n RecordUpdateResult,\n RecordValidator,\n RecordValidations,\n} from './record'\nexport type {\n AttributeValidatorParams,\n AttributesValidatorParams,\n NodeCreateParams,\n NodesUpdateParams,\n ArenaRecord,\n Record,\n RecordExpressionContext,\n RecordExpressionEvaluationContext,\n RecordService,\n RecordUpdateOptions,\n RecordValidatorParams,\n SortedAttributesValidatorParams,\n} from './record'\n\nexport { ServiceRegistry, ServiceType } from './registry'\nexport type { ServiceTypeMap } from './registry'\n\nexport { DEFAULT_SRS, DEFAULT_SRS_INDEX, SRSFactory } from './srs'\nexport type { SRS, SRSIndex } 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 Survey,\n SurveyCycle,\n SurveyDependency,\n SurveyDependencyGraph,\n SurveyDocImage,\n SurveyDocImageFactoryParams,\n SurveyDocImageProps,\n SurveyFile,\n SurveyFileFactoryParams,\n SurveyFileProps,\n SurveyProps,\n SurveyRefData,\n SurveySecurity,\n SurveyService,\n} from './survey'\n\nexport { Taxa, Taxonomies, TaxonomyFactory, TaxonFactory, TaxonGenerator, VernacularNameFactory } from './taxonomy'\nexport type {\n VernacularNameParams,\n TaxonomyFactoryParams,\n TaxonFactoryParams,\n Taxonomy,\n TaxonomyService,\n VernacularNameProps,\n VernacularName,\n TaxonProps,\n Taxon,\n TaxonomyProps,\n TaxonService,\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 { FileProcessorConstructorArgs, MutationOptions, ParsedVersion } 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 DissocFieldValidationOptions,\n FieldValidator,\n Validation,\n ValidationFields,\n ValidationResult,\n ValidationCounts,\n} from './validation'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAwBzG,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAejH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAY5E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAIzC,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,wBAAwB,GACzB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAG/D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,cAAc,CAAA;AAsBrB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAG5C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAM1E,OAAO,EAA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MAAM,EACN,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,EACL,cAAc,EACd,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,GACT,MAAM,SAAS,CAAA;AAIhB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,kBAAkB,GACnB,MAAM,cAAc,CAAA","sourcesContent":["export type { AppInfo } from './app'\n\nexport { Authorizer, AuthGroupName, UserStatus, Permission, UserTitle, UserFactory, Users } from './auth'\nexport type {\n AuthGroup,\n User,\n UserAuthGroup,\n UserAuthGroupProps,\n AuthToken,\n UserAuthTokenPayload,\n UserAuthTokenService,\n UserPrefs,\n UserPrefSurveys,\n UserProps,\n UserAuthRefreshToken,\n UserAuthRefreshTokenProps,\n UserAuthRefreshTokenPayload,\n UserService,\n UserTokenPayload,\n DownloadAuthTokenPayload,\n UserGroup,\n UserGroupProps,\n UserGroupQualifier,\n UserInvitation,\n} from './auth'\n\nexport { CategoryFactory, CategoryImportColumnType, CategoryItemFactory, CategoryLevelFactory } from './category'\nexport type {\n CategoryItemProps,\n Category,\n CategoryItem,\n CategoryLevel,\n CategoryLevelProps,\n CategoryImportSummary,\n CategoryImportSummaryColumn,\n CategoryItemService,\n CategoryLevelService,\n CategoryProps,\n CategoryService,\n} from './category'\n\nexport { Categories, CategoryItems } from './category'\n\nexport { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain'\nexport type {\n Chain,\n ChainProps,\n ChainService,\n ChainNodeDef,\n ChainNodeDefProps,\n ChainNodeDefService,\n ChainNodeDefAggregate,\n ChainNodeDefAggregateProps,\n} from './chain'\n\nexport { TraverseMethod } from './common'\nexport type { ArenaObject, ArenaService, Dictionary, Factory, I18n } from './common'\n\nexport type { FlatDataExportOptions, 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 { DataQuery, DataQuerySummary, DataQuerySummaryProps } 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 ArrayExpression,\n BinaryExpression,\n CallExpression,\n CompoundExpression,\n ConditionalExpression,\n ExpressionContext,\n ExpressionEvaluator,\n ExpressionFunction,\n ExpressionFunctions,\n AnyExpressionNode,\n ExpressionNode,\n ExpressionNodeEvaluatorConstructor,\n MemberExpression,\n IdentifierExpression,\n LiteralExpression,\n SequenceExpression,\n ThisExpression,\n UnaryExpression,\n} from './expression'\n\nexport { ExtraPropDataType, ExtraPropsDataGenerator } from './extraProp'\nexport type { ExtraPropDef, ExtraPropDefs } from './extraProp'\n\nexport { PointFactory, Points } from './geo'\nexport type { AreaOfInterest, AreaOfInterestDescriptor, Point } from './geo'\n\nexport { JobBase, JobEventType, JobStatus } from './job'\nexport type { Job, JobContext, JobEvent, JobSerialized, JobTxClient } from './job'\n\nexport { LanguageCode, Languages, LanguagesISO639part2 } from './language'\nexport type { Labels } from './language'\n\nexport type { Logger } from './logger'\n\nexport type { Message } from './message'\nexport { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message'\n\nexport { NodeFactory, NodeKeys, NodeMetaKeys, Nodes, NodeValueFormatter, NodeValues } from './node'\nexport type {\n ArenaRecordNode,\n Node,\n NodeMeta,\n NodePointer,\n NodeRefData,\n NodeService,\n NodesMap,\n NodeValueCode,\n NodeValueCoordinate,\n NodeValueFile,\n NodeValueTaxon,\n} from './node'\n\nexport {\n NodeDefCountType,\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 { AreaOfInterestProvider, CategoryItemProvider, TaxonProvider } from './nodeDefExpressionEvaluator'\n\nexport type {\n NodeDef,\n NodeDefLayout,\n NodeDefMeta,\n NodeDefProps,\n NodeDefPropsWithLayout,\n NodeDefBoolean,\n NodeDefBooleanProps,\n NodeDefCode,\n NodeDefCodeLayout,\n NodeDefCodeProps,\n NodeDefCoordinate,\n NodeDefCoordinateProps,\n NodeDefDate,\n NodeDefDecimal,\n NodeDefDecimalProps,\n NodeDefEntity,\n NodeDefEntityChildPosition,\n NodeDefEntityLayout,\n NodeDefEntityProps,\n NodeDefPrintOrientation,\n NodeDefFile,\n NodeDefFileProps,\n NodeDefGeo,\n NodeDefGeoProps,\n NodeDefFormHeader,\n NodeDefFormHeaderProps,\n NodeDefInteger,\n NodeDefPropsAdvanced,\n NodeDefTaxon,\n NodeDefTaxonProps,\n NodeDefText,\n NodeDefTextProps,\n NodeDefTextLayout,\n NodeDefTime,\n NodeDefTimeProps,\n NodeDefExpression,\n NodeDefMap,\n NodeDefService,\n NodeDefValidations,\n} from './nodeDef'\n\nexport {\n NodePointers,\n RecordCloner,\n RecordFactory,\n RecordFixer,\n Records,\n RECORD_STEP_DEFAULT,\n RecordExpressionEvaluator,\n RecordNodesUpdater,\n RecordPrettyPrinter,\n RecordUpdater,\n RecordUpdateResult,\n RecordValidator,\n RecordValidations,\n} from './record'\nexport type {\n AttributeValidatorParams,\n AttributesValidatorParams,\n NodeCreateParams,\n NodesUpdateParams,\n ArenaRecord,\n Record,\n RecordExpressionContext,\n RecordExpressionEvaluationContext,\n RecordService,\n RecordUpdateOptions,\n RecordValidatorParams,\n SortedAttributesValidatorParams,\n} from './record'\n\nexport { ServiceRegistry, ServiceType } from './registry'\nexport type { ServiceTypeMap } from './registry'\n\nexport { DEFAULT_SRS, DEFAULT_SRS_INDEX, SRSFactory } from './srs'\nexport type { SRS, SRSIndex } 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 Survey,\n SurveyCycle,\n SurveyDependency,\n SurveyDependencyGraph,\n SurveyDocImage,\n SurveyDocImageFactoryParams,\n SurveyDocImageProps,\n SurveyFile,\n SurveyFileFactoryParams,\n SurveyFileProps,\n SurveyProps,\n SurveyRefData,\n SurveySecurity,\n SurveyService,\n} from './survey'\n\nexport { Taxa, Taxonomies, TaxonomyFactory, TaxonFactory, TaxonGenerator, VernacularNameFactory } from './taxonomy'\nexport type {\n VernacularNameParams,\n TaxonomyFactoryParams,\n TaxonFactoryParams,\n Taxonomy,\n TaxonomyService,\n VernacularNameProps,\n VernacularName,\n TaxonProps,\n Taxon,\n TaxonomyProps,\n TaxonService,\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 { FileProcessorConstructorArgs, MutationOptions, ParsedVersion } 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 DissocFieldValidationOptions,\n FieldValidator,\n Validation,\n ValidationFields,\n ValidationResult,\n ValidationCounts,\n} from './validation'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"areaOfInterestProvider.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/areaOfInterestProvider.ts"],"names":[],"mappings":"","sourcesContent":["import type { AreaOfInterest } from '../geo'\nimport { Survey } from '../survey'\n\n/**\n * Fetches the geometry of the areas of interest of a survey: they are stored outside the survey (e.g. in files).\n */\nexport interface AreaOfInterestProvider {\n getAreaOfInterest: (params: { survey: Survey; name: string }) => Promise<AreaOfInterest | undefined>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/context.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ExpressionContext } from '../expression'\nimport { NodeDef } from '../nodeDef'\nimport { NodeDefProps, NodeDefType } from '../nodeDef/nodeDef'\nimport { Survey } from '../survey'\nimport { CategoryItemProvider } from './categoryItemProvider'\nimport { TaxonProvider } from './taxonProvider'\n\nexport interface NodeDefExpressionContext extends ExpressionContext {\n survey: Survey\n user?: User\n nodeDefCurrent: NodeDef<NodeDefType, NodeDefProps>\n nodeDefContext?: NodeDef<NodeDefType, NodeDefProps>\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?: CategoryItemProvider\n taxonProvider?: TaxonProvider\n}\n"]}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/context.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from '../auth'\nimport { ExpressionContext } from '../expression'\nimport { NodeDef } from '../nodeDef'\nimport { NodeDefProps, NodeDefType } from '../nodeDef/nodeDef'\nimport { Survey } from '../survey'\nimport { AreaOfInterestProvider } from './areaOfInterestProvider'\nimport { CategoryItemProvider } from './categoryItemProvider'\nimport { TaxonProvider } from './taxonProvider'\n\nexport interface NodeDefExpressionContext extends ExpressionContext {\n survey: Survey\n user?: User\n nodeDefCurrent: NodeDef<NodeDefType, NodeDefProps>\n nodeDefContext?: NodeDef<NodeDefType, NodeDefProps>\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?: CategoryItemProvider\n taxonProvider?: TaxonProvider\n areaOfInterestProvider?: AreaOfInterestProvider\n}\n"]}
|
|
@@ -14,7 +14,7 @@ import { Points } from '../geo';
|
|
|
14
14
|
import { LanguagesISO639part2 } from '../language';
|
|
15
15
|
import { getNodeDefParent } from '../survey/surveys/nodeDefs';
|
|
16
16
|
import { getCategoryItemByCodePaths, getTaxonByCode } from '../survey/surveys/refsData';
|
|
17
|
-
import {
|
|
17
|
+
import { getAreaOfInterestByName, getAreasOfInterest, getCategoryByName, getSRSIndex, getTaxonomyByName, } from '../survey/surveys/surveysGetters';
|
|
18
18
|
import { Dates, Numbers, Objects } from '../utils';
|
|
19
19
|
const sampleGeoJsonPolygon = {
|
|
20
20
|
type: 'Feature',
|
|
@@ -65,6 +65,28 @@ const getOrFetchTaxon = (params) => __awaiter(void 0, void 0, void 0, function*
|
|
|
65
65
|
const draft = !record || !!record.preview;
|
|
66
66
|
return taxon !== null && taxon !== void 0 ? taxon : taxonProvider === null || taxonProvider === void 0 ? void 0 : taxonProvider.getTaxonByCode({ survey, taxonomyUuid, taxonCode, draft });
|
|
67
67
|
});
|
|
68
|
+
const fetchAreaOfInterest = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
const { context, name } = params;
|
|
70
|
+
const { survey, areaOfInterestProvider } = context;
|
|
71
|
+
if (!areaOfInterestProvider || !getAreaOfInterestByName({ survey, name }))
|
|
72
|
+
return undefined;
|
|
73
|
+
return areaOfInterestProvider.getAreaOfInterest({ survey, name });
|
|
74
|
+
});
|
|
75
|
+
// expression validation (no record): a literal area name must be defined in the survey
|
|
76
|
+
const validateAreaOfInterestName = (params) => {
|
|
77
|
+
const { context, name } = params;
|
|
78
|
+
const record = context.record;
|
|
79
|
+
if (!record && typeof name === 'string' && !getAreaOfInterestByName({ survey: context.survey, name })) {
|
|
80
|
+
throw new SystemError(SystemErrorKeys.expression.areaOfInterestNotFound, { name });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const distanceToAreaOfInterestBoundary = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
const { context, point, name } = params;
|
|
85
|
+
const areaOfInterest = yield fetchAreaOfInterest({ context, name });
|
|
86
|
+
if (!areaOfInterest)
|
|
87
|
+
return null;
|
|
88
|
+
return Points.distanceToPolygonBoundary(point, areaOfInterest, getSRSIndex(context.survey));
|
|
89
|
+
});
|
|
68
90
|
const geoDistanceExecutor = (context) => (coordinateFrom, coordinateTo) => {
|
|
69
91
|
const { survey } = context;
|
|
70
92
|
const srsIndex = getSRSIndex(survey);
|
|
@@ -146,17 +168,32 @@ export const nodeDefExpressionFunctions = {
|
|
|
146
168
|
},
|
|
147
169
|
},
|
|
148
170
|
geoDistance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },
|
|
149
|
-
|
|
171
|
+
geoAOIContaining: {
|
|
150
172
|
minArity: 1,
|
|
151
173
|
maxArity: 1,
|
|
152
|
-
executor: (context) => (coordinate) => {
|
|
153
|
-
const { survey } = context;
|
|
154
|
-
const areaOfInterest = getAreaOfInterest(survey);
|
|
174
|
+
executor: (context) => (coordinate) => __awaiter(void 0, void 0, void 0, function* () {
|
|
155
175
|
const point = Points.parse(coordinate);
|
|
156
|
-
if (!
|
|
176
|
+
if (!point || !context.areaOfInterestProvider)
|
|
157
177
|
return null;
|
|
158
|
-
|
|
159
|
-
|
|
178
|
+
// the survey order is the priority of overlapping areas
|
|
179
|
+
for (const { name } of getAreasOfInterest(context.survey)) {
|
|
180
|
+
const distance = yield distanceToAreaOfInterestBoundary({ context, point, name }); // NOSONAR
|
|
181
|
+
if (distance !== null && distance <= 0)
|
|
182
|
+
return name;
|
|
183
|
+
}
|
|
184
|
+
return null;
|
|
185
|
+
}),
|
|
186
|
+
},
|
|
187
|
+
geoDistanceToAOIBoundary: {
|
|
188
|
+
minArity: 2,
|
|
189
|
+
maxArity: 2,
|
|
190
|
+
executor: (context) => (coordinate, name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
191
|
+
validateAreaOfInterestName({ context, name });
|
|
192
|
+
const point = Points.parse(coordinate);
|
|
193
|
+
if (!point || typeof name !== 'string')
|
|
194
|
+
return null;
|
|
195
|
+
return distanceToAreaOfInterestBoundary({ context, point, name });
|
|
196
|
+
}),
|
|
160
197
|
},
|
|
161
198
|
geoPolygon: {
|
|
162
199
|
minArity: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/functions.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,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E,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE;KACnE;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,OAAiC,EAAE,EAAE,CAAC,GAAG,EAAE,kBAAC,MAAA,OAAO,CAAC,IAAI,0CAAE,KAAK,GAAA;KAC3E;IACD,iBAAiB,EAAE;QACjB,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,QAAkC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK;KAC9D;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,OAAiC,EAAE,EAAE,CAAC,GAAG,EAAE,kBAAC,MAAA,OAAO,CAAC,IAAI,0CAAE,IAAI,GAAA;KAC1E;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC,OAAiC,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,EAAE;YACpE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;YAChC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,CAAA;YACtC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAA;YACnC,MAAM,kBAAkB,GAAG,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAA;YACxE,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAA;QACrC,CAAC;KACF;CACF,CAAA","sourcesContent":["import { Users } from '../auth'\nimport { CategoryItem } from '../category'\nimport { SystemError, SystemErrorKeys } from '../error'\nimport { ExpressionFunctions } from '../expression'\nimport { ExtraProps } from '../extraProp/extraProps'\nimport { Point, Points } from '../geo'\nimport { LanguagesISO639part2 } from '../language'\nimport { ArenaRecord } from '../record'\nimport { getNodeDefParent } from '../survey/surveys/nodeDefs'\nimport { getCategoryItemByCodePaths, getTaxonByCode } from '../survey/surveys/refsData'\nimport { getAreaOfInterest, getCategoryByName, getSRSIndex, getTaxonomyByName } from '../survey/surveys/surveysGetters'\nimport { Taxon } from '../taxonomy'\nimport { Dates, Numbers, Objects } from '../utils'\nimport { NodeDefExpressionContext } from './context'\n\nconst sampleGeoJsonPolygon = {\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n ],\n },\n}\n\nconst isNotValidString = (value: string): boolean => Objects.isEmpty(value) || typeof value !== 'string'\n\nconst emptyExecutor = (_context: NodeDefExpressionContext) => () => null\n\nconst isUsingDraftProps = (context: NodeDefExpressionContext) => {\n // use draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n return !record || !!record.preview\n}\n\nconst getOrFetchCategoryItem = async (params: {\n context: NodeDefExpressionContext\n categoryUuid: string\n codePaths: string[]\n}): Promise<CategoryItem | undefined> => {\n const { context, categoryUuid, codePaths } = params\n // if any code path is empty, return null (no category item can be found)\n if (Objects.isEmpty(codePaths) || codePaths.some(Objects.isEmpty)) {\n return undefined\n }\n const { survey, categoryItemProvider } = context\n const categoryItem = getCategoryItemByCodePaths({ survey, categoryUuid, codePaths })\n const draft = isUsingDraftProps(context)\n return categoryItem ?? categoryItemProvider?.getItemByCodePaths({ survey, categoryUuid, codePaths, draft })\n}\n\nconst getOrFetchTaxon = async (params: {\n context: NodeDefExpressionContext\n taxonomyUuid: string\n taxonCode: string\n}): Promise<Taxon | undefined> => {\n const { context, taxonomyUuid, taxonCode } = params\n if (typeof taxonCode !== 'string' && typeof taxonCode !== 'number') {\n return undefined // node def expression validator could call it passing a node def object\n }\n // if taxonCode is empty, return undefined\n if (Objects.isEmpty(taxonCode)) {\n return undefined\n }\n const { survey, taxonProvider } = context\n const taxon = getTaxonByCode({ survey, taxonomyUuid, taxonCode })\n // fetch draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n const draft = !record || !!record.preview\n return taxon ?? taxonProvider?.getTaxonByCode({ survey, taxonomyUuid, taxonCode, draft })\n}\n\nconst geoDistanceExecutor =\n (context: NodeDefExpressionContext) =>\n (coordinateFrom: Point | string, coordinateTo: Point | string): number | null => {\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n const pointFrom = Points.parse(coordinateFrom)\n const pointTo = Points.parse(coordinateTo)\n\n return pointFrom && pointTo ? Points.distance(pointFrom, pointTo, srsIndex) : null\n }\n\nexport const nodeDefExpressionFunctions: ExpressionFunctions<NodeDefExpressionContext> = {\n categoryItemProp: {\n minArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (categoryName: string, itemPropName: string, ...codePaths: string[]): Promise<any> => {\n const { survey } = context\n\n if (Objects.isEmpty(categoryName) || Objects.isEmpty(itemPropName) || Objects.isEmpty(codePaths))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n\n const category = getCategoryByName({ survey, categoryName })\n if (!category) throw new SystemError(SystemErrorKeys.expression.invalidCategoryName, { name: categoryName })\n\n const extraPropDef = category.props.itemExtraDef?.[itemPropName]\n if (!extraPropDef)\n throw new SystemError(SystemErrorKeys.expression.invalidCategoryExtraProp, { propName: itemPropName })\n\n const { uuid: categoryUuid } = category\n const categoryItem = await getOrFetchCategoryItem({ context, categoryUuid, codePaths })\n if (!categoryItem) return null\n\n const value = categoryItem.props.extra?.[itemPropName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n count: {\n minArity: 1,\n maxArity: 1,\n executor:\n (_context: NodeDefExpressionContext) =>\n (_nodeSet): number =>\n 1,\n },\n dateTimeDiff: {\n minArity: 4,\n maxArity: 4,\n executor:\n (_context: NodeDefExpressionContext) =>\n (date1: string, time1: string, date2: string, time2: string): number | null => {\n if (isNotValidString(date1) || isNotValidString(time1) || isNotValidString(date2) || isNotValidString(time2))\n return null\n const [hours1, minutes1] = time1.split(':')\n const [hours2, minutes2] = time2.split(':')\n let dt1 = Dates.addHours(date1, Number(hours1))\n dt1 = Dates.addMinutes(dt1, Number(minutes1))\n let dt2 = Dates.addHours(date2, Number(hours2))\n dt2 = Dates.addMinutes(dt2, Number(minutes2))\n return Dates.diffInMinutes(dt1, dt2)\n },\n },\n // deprecated, use geoDistance instead\n distance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n first: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n geoCoordinateAtDistance: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n (coordinate: Point | string, distanceMeters: number, bearingDeg: number): Point | null => {\n // validate parameters\n const origin = Points.parse(coordinate)\n if (!origin) return null\n\n const distanceMetersNumber = Number(distanceMeters)\n const bearingDegNumber = Number(bearingDeg)\n if (!Number.isFinite(distanceMetersNumber) || distanceMetersNumber < 0 || !Number.isFinite(bearingDegNumber)) {\n return null\n }\n\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n return Points.pointAtDistance({\n origin,\n distanceMeters: distanceMetersNumber,\n bearingDeg: bearingDegNumber,\n srsIndex,\n })\n },\n },\n geoDistance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n geoDistanceToAOIBoundary: {\n minArity: 1,\n maxArity: 1,\n executor:\n (context: NodeDefExpressionContext) =>\n (coordinate: Point | string): number | null => {\n const { survey } = context\n const areaOfInterest = getAreaOfInterest(survey)\n const point = Points.parse(coordinate)\n if (!areaOfInterest || !point) return null\n return Points.distanceToPolygonBoundary(point, areaOfInterest, getSRSIndex(survey))\n },\n },\n geoPolygon: {\n minArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => sampleGeoJsonPolygon,\n },\n includes: {\n minArity: 2,\n maxArity: 2,\n evaluateArgsToNodes: false,\n executor:\n () =>\n (items: any, value: any): boolean =>\n Array.isArray(items) && items.map(String).includes(String(value)),\n },\n index: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => -1,\n },\n last: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n now: {\n minArity: 0,\n maxArity: 0,\n evaluateToNode: false,\n executor: () => () => Dates.nowFormattedForStorage(),\n },\n numberToWords: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: false,\n executor:\n (context: NodeDefExpressionContext) =>\n (value: any): string | null => {\n if (Objects.isEmpty(value)) return null\n return Numbers.toWords(value, context.lang)\n },\n },\n parent: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n evaluateToNode: true,\n executor: (context: NodeDefExpressionContext) => (nodeDef) => {\n const { survey } = context\n return getNodeDefParent({ survey, nodeDef })\n },\n },\n prevCycleValue: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n prevCycleValues: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n recordCycle: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateCreated: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateLastModified: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerEmail: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerName: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerRole: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n sum: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => 1,\n },\n taxonProp: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) => async (taxonomyName: string, propName: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(propName))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n const extraPropDef = taxonomy.props.extraPropsDefs?.[propName]\n if (!extraPropDef) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyExtraProp, { propName })\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const value = taxon.props.extra?.[propName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n taxonVernacularName: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (taxonomyName: string, vernacularLangCode: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(vernacularLangCode))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n if (!LanguagesISO639part2[vernacularLangCode]) {\n throw new SystemError(SystemErrorKeys.expression.invalidTaxonVernacularNameLanguageCode, {\n vernacularLangCode,\n })\n }\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const vernacularNameArray = taxon.vernacularNames?.[vernacularLangCode]\n // consider first vernacular name object only\n const firstVernacularName = vernacularNameArray?.[0]\n return firstVernacularName?.props?.name\n },\n },\n unique: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => [],\n },\n userEmail: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.email,\n },\n userIsRecordOwner: {\n minArity: 0,\n maxArity: 0,\n executor: (_context: NodeDefExpressionContext) => () => false,\n },\n userName: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.name,\n },\n userProp: {\n minArity: 1,\n maxArity: 1,\n executor: (context: NodeDefExpressionContext) => (propName: string) => {\n const { user, survey } = context\n if (!survey || !user) return undefined\n const { uuid: surveyUuid } = survey\n const combinedExtraProps = Users.getCombinedExtraProps(surveyUuid)(user)\n return combinedExtraProps[propName]\n },\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/functions.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAyB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,GAClB,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGlD,MAAM,oBAAoB,GAAG;IAC3B,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE;QACR,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACX;gBACE,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,GAAG,CAAC;gBACZ,CAAC,KAAK,EAAE,G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,CAAC,IAAI,CAAC,CAAA;YACxE,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAA;QACrC,CAAC;KACF;CACF,CAAA","sourcesContent":["import { Users } from '../auth'\nimport { CategoryItem } from '../category'\nimport { SystemError, SystemErrorKeys } from '../error'\nimport { ExpressionFunctions } from '../expression'\nimport { ExtraProps } from '../extraProp/extraProps'\nimport { AreaOfInterest, Point, Points } from '../geo'\nimport { LanguagesISO639part2 } from '../language'\nimport { ArenaRecord } from '../record'\nimport { getNodeDefParent } from '../survey/surveys/nodeDefs'\nimport { getCategoryItemByCodePaths, getTaxonByCode } from '../survey/surveys/refsData'\nimport {\n getAreaOfInterestByName,\n getAreasOfInterest,\n getCategoryByName,\n getSRSIndex,\n getTaxonomyByName,\n} from '../survey/surveys/surveysGetters'\nimport { Taxon } from '../taxonomy'\nimport { Dates, Numbers, Objects } from '../utils'\nimport { NodeDefExpressionContext } from './context'\n\nconst sampleGeoJsonPolygon = {\n type: 'Feature',\n geometry: {\n type: 'Polygon',\n coordinates: [\n [\n [100.0, 0.0],\n [101.0, 0.0],\n [101.0, 1.0],\n [100.0, 1.0],\n [100.0, 0.0],\n ],\n ],\n },\n}\n\nconst isNotValidString = (value: string): boolean => Objects.isEmpty(value) || typeof value !== 'string'\n\nconst emptyExecutor = (_context: NodeDefExpressionContext) => () => null\n\nconst isUsingDraftProps = (context: NodeDefExpressionContext) => {\n // use draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n return !record || !!record.preview\n}\n\nconst getOrFetchCategoryItem = async (params: {\n context: NodeDefExpressionContext\n categoryUuid: string\n codePaths: string[]\n}): Promise<CategoryItem | undefined> => {\n const { context, categoryUuid, codePaths } = params\n // if any code path is empty, return null (no category item can be found)\n if (Objects.isEmpty(codePaths) || codePaths.some(Objects.isEmpty)) {\n return undefined\n }\n const { survey, categoryItemProvider } = context\n const categoryItem = getCategoryItemByCodePaths({ survey, categoryUuid, codePaths })\n const draft = isUsingDraftProps(context)\n return categoryItem ?? categoryItemProvider?.getItemByCodePaths({ survey, categoryUuid, codePaths, draft })\n}\n\nconst getOrFetchTaxon = async (params: {\n context: NodeDefExpressionContext\n taxonomyUuid: string\n taxonCode: string\n}): Promise<Taxon | undefined> => {\n const { context, taxonomyUuid, taxonCode } = params\n if (typeof taxonCode !== 'string' && typeof taxonCode !== 'number') {\n return undefined // node def expression validator could call it passing a node def object\n }\n // if taxonCode is empty, return undefined\n if (Objects.isEmpty(taxonCode)) {\n return undefined\n }\n const { survey, taxonProvider } = context\n const taxon = getTaxonByCode({ survey, taxonomyUuid, taxonCode })\n // fetch draft props when validating expression or previewing record\n const record: ArenaRecord = (context as any).record\n const draft = !record || !!record.preview\n return taxon ?? taxonProvider?.getTaxonByCode({ survey, taxonomyUuid, taxonCode, draft })\n}\n\nconst fetchAreaOfInterest = async (params: {\n context: NodeDefExpressionContext\n name: string\n}): Promise<AreaOfInterest | undefined> => {\n const { context, name } = params\n const { survey, areaOfInterestProvider } = context\n if (!areaOfInterestProvider || !getAreaOfInterestByName({ survey, name })) return undefined\n return areaOfInterestProvider.getAreaOfInterest({ survey, name })\n}\n\n// expression validation (no record): a literal area name must be defined in the survey\nconst validateAreaOfInterestName = (params: { context: NodeDefExpressionContext; name: unknown }): void => {\n const { context, name } = params\n const record: ArenaRecord = (context as any).record\n if (!record && typeof name === 'string' && !getAreaOfInterestByName({ survey: context.survey, name })) {\n throw new SystemError(SystemErrorKeys.expression.areaOfInterestNotFound, { name })\n }\n}\n\nconst distanceToAreaOfInterestBoundary = async (params: {\n context: NodeDefExpressionContext\n point: Point\n name: string\n}): Promise<number | null> => {\n const { context, point, name } = params\n const areaOfInterest = await fetchAreaOfInterest({ context, name })\n if (!areaOfInterest) return null\n return Points.distanceToPolygonBoundary(point, areaOfInterest, getSRSIndex(context.survey))\n}\n\nconst geoDistanceExecutor =\n (context: NodeDefExpressionContext) =>\n (coordinateFrom: Point | string, coordinateTo: Point | string): number | null => {\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n const pointFrom = Points.parse(coordinateFrom)\n const pointTo = Points.parse(coordinateTo)\n\n return pointFrom && pointTo ? Points.distance(pointFrom, pointTo, srsIndex) : null\n }\n\nexport const nodeDefExpressionFunctions: ExpressionFunctions<NodeDefExpressionContext> = {\n categoryItemProp: {\n minArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (categoryName: string, itemPropName: string, ...codePaths: string[]): Promise<any> => {\n const { survey } = context\n\n if (Objects.isEmpty(categoryName) || Objects.isEmpty(itemPropName) || Objects.isEmpty(codePaths))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n\n const category = getCategoryByName({ survey, categoryName })\n if (!category) throw new SystemError(SystemErrorKeys.expression.invalidCategoryName, { name: categoryName })\n\n const extraPropDef = category.props.itemExtraDef?.[itemPropName]\n if (!extraPropDef)\n throw new SystemError(SystemErrorKeys.expression.invalidCategoryExtraProp, { propName: itemPropName })\n\n const { uuid: categoryUuid } = category\n const categoryItem = await getOrFetchCategoryItem({ context, categoryUuid, codePaths })\n if (!categoryItem) return null\n\n const value = categoryItem.props.extra?.[itemPropName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n count: {\n minArity: 1,\n maxArity: 1,\n executor:\n (_context: NodeDefExpressionContext) =>\n (_nodeSet): number =>\n 1,\n },\n dateTimeDiff: {\n minArity: 4,\n maxArity: 4,\n executor:\n (_context: NodeDefExpressionContext) =>\n (date1: string, time1: string, date2: string, time2: string): number | null => {\n if (isNotValidString(date1) || isNotValidString(time1) || isNotValidString(date2) || isNotValidString(time2))\n return null\n const [hours1, minutes1] = time1.split(':')\n const [hours2, minutes2] = time2.split(':')\n let dt1 = Dates.addHours(date1, Number(hours1))\n dt1 = Dates.addMinutes(dt1, Number(minutes1))\n let dt2 = Dates.addHours(date2, Number(hours2))\n dt2 = Dates.addMinutes(dt2, Number(minutes2))\n return Dates.diffInMinutes(dt1, dt2)\n },\n },\n // deprecated, use geoDistance instead\n distance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n first: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n geoCoordinateAtDistance: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n (coordinate: Point | string, distanceMeters: number, bearingDeg: number): Point | null => {\n // validate parameters\n const origin = Points.parse(coordinate)\n if (!origin) return null\n\n const distanceMetersNumber = Number(distanceMeters)\n const bearingDegNumber = Number(bearingDeg)\n if (!Number.isFinite(distanceMetersNumber) || distanceMetersNumber < 0 || !Number.isFinite(bearingDegNumber)) {\n return null\n }\n\n const { survey } = context\n const srsIndex = getSRSIndex(survey)\n\n return Points.pointAtDistance({\n origin,\n distanceMeters: distanceMetersNumber,\n bearingDeg: bearingDegNumber,\n srsIndex,\n })\n },\n },\n geoDistance: { minArity: 2, maxArity: 2, executor: geoDistanceExecutor },\n geoAOIContaining: {\n minArity: 1,\n maxArity: 1,\n executor:\n (context: NodeDefExpressionContext) =>\n async (coordinate: Point | string): Promise<string | null> => {\n const point = Points.parse(coordinate)\n if (!point || !context.areaOfInterestProvider) return null\n // the survey order is the priority of overlapping areas\n for (const { name } of getAreasOfInterest(context.survey)) {\n const distance = await distanceToAreaOfInterestBoundary({ context, point, name }) // NOSONAR\n if (distance !== null && distance <= 0) return name\n }\n return null\n },\n },\n geoDistanceToAOIBoundary: {\n minArity: 2,\n maxArity: 2,\n executor:\n (context: NodeDefExpressionContext) =>\n async (coordinate: Point | string, name: string): Promise<number | null> => {\n validateAreaOfInterestName({ context, name })\n const point = Points.parse(coordinate)\n if (!point || typeof name !== 'string') return null\n return distanceToAreaOfInterestBoundary({ context, point, name })\n },\n },\n geoPolygon: {\n minArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => sampleGeoJsonPolygon,\n },\n includes: {\n minArity: 2,\n maxArity: 2,\n evaluateArgsToNodes: false,\n executor:\n () =>\n (items: any, value: any): boolean =>\n Array.isArray(items) && items.map(String).includes(String(value)),\n },\n index: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: () => () => -1,\n },\n last: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: emptyExecutor,\n },\n now: {\n minArity: 0,\n maxArity: 0,\n evaluateToNode: false,\n executor: () => () => Dates.nowFormattedForStorage(),\n },\n numberToWords: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: false,\n executor:\n (context: NodeDefExpressionContext) =>\n (value: any): string | null => {\n if (Objects.isEmpty(value)) return null\n return Numbers.toWords(value, context.lang)\n },\n },\n parent: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n evaluateToNode: true,\n executor: (context: NodeDefExpressionContext) => (nodeDef) => {\n const { survey } = context\n return getNodeDefParent({ survey, nodeDef })\n },\n },\n prevCycleValue: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n prevCycleValues: {\n minArity: 1,\n maxArity: 1,\n executor: emptyExecutor,\n },\n recordCycle: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateCreated: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordDateLastModified: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerEmail: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerName: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n recordOwnerRole: {\n minArity: 0,\n maxArity: 0,\n executor: emptyExecutor,\n },\n sum: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => 1,\n },\n taxonProp: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) => async (taxonomyName: string, propName: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(propName))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n const extraPropDef = taxonomy.props.extraPropsDefs?.[propName]\n if (!extraPropDef) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyExtraProp, { propName })\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const value = taxon.props.extra?.[propName]\n return ExtraProps.convertValue({ survey, extraPropDef, value })\n },\n },\n taxonVernacularName: {\n minArity: 3,\n maxArity: 3,\n executor:\n (context: NodeDefExpressionContext) =>\n async (taxonomyName: string, vernacularLangCode: string, taxonCode: string) => {\n if (Objects.isEmpty(taxonomyName) || Objects.isEmpty(vernacularLangCode))\n throw new SystemError(SystemErrorKeys.expression.missingFunctionParameters)\n if (Objects.isEmpty(taxonCode)) return null\n\n const { survey } = context\n const taxonomy = getTaxonomyByName({ survey, taxonomyName })\n if (!taxonomy) throw new SystemError(SystemErrorKeys.expression.invalidTaxonomyName, { name: taxonomyName })\n\n if (!LanguagesISO639part2[vernacularLangCode]) {\n throw new SystemError(SystemErrorKeys.expression.invalidTaxonVernacularNameLanguageCode, {\n vernacularLangCode,\n })\n }\n\n const taxon = await getOrFetchTaxon({ context, taxonomyUuid: taxonomy.uuid, taxonCode })\n if (!taxon) return null\n\n const vernacularNameArray = taxon.vernacularNames?.[vernacularLangCode]\n // consider first vernacular name object only\n const firstVernacularName = vernacularNameArray?.[0]\n return firstVernacularName?.props?.name\n },\n },\n unique: {\n minArity: 1,\n maxArity: 1,\n evaluateArgsToNodes: true,\n executor: (_context: NodeDefExpressionContext) => (_nodeSet) => [],\n },\n userEmail: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.email,\n },\n userIsRecordOwner: {\n minArity: 0,\n maxArity: 0,\n executor: (_context: NodeDefExpressionContext) => () => false,\n },\n userName: {\n minArity: 0,\n maxArity: 0,\n executor: (context: NodeDefExpressionContext) => () => context.user?.name,\n },\n userProp: {\n minArity: 1,\n maxArity: 1,\n executor: (context: NodeDefExpressionContext) => (propName: string) => {\n const { user, survey } = context\n if (!survey || !user) return undefined\n const { uuid: surveyUuid } = survey\n const combinedExtraProps = Users.getCombinedExtraProps(surveyUuid)(user)\n return combinedExtraProps[propName]\n },\n },\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA","sourcesContent":["export { NodeDefExpressionEvaluator } from './evaluator'\nexport { NodeDefExpressionValidator } from './validator'\nexport type { CategoryItemProvider } from './categoryItemProvider'\nexport type { TaxonProvider } from './taxonProvider'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nodeDefExpressionEvaluator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA","sourcesContent":["export { NodeDefExpressionEvaluator } from './evaluator'\nexport { NodeDefExpressionValidator } from './validator'\nexport type { AreaOfInterestProvider } from './areaOfInterestProvider'\nexport type { CategoryItemProvider } from './categoryItemProvider'\nexport type { TaxonProvider } from './taxonProvider'\n"]}
|