diff --git a/.gitignore b/.gitignore
index 8ee5ef57..d8dddb01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,5 @@ package-lock.json
.smbdelete*
test-data/*
.env
-.vscode
*.sublime-project
*.sublime-workspace
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 00000000..7bb1de3a
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,18 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Debug Jest Tests",
+ "type": "node",
+ "preLaunchTask": "start-containers",
+ "request": "launch",
+ "runtimeArgs": [
+ "--inspect-brk",
+ "${workspaceRoot}/node_modules/.bin/jest",
+ "--runInBand"
+ ],
+ "console": "integratedTerminal",
+ "internalConsoleOptions": "neverOpen"
+ }
+ ]
+}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 00000000..7130fa7c
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,13 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "start-containers",
+ "type": "shell",
+ "command": "${workspaceRoot}/bin/test.sh",
+ "args": ["-oc"]
+ }
+ ]
+}
diff --git a/bin/test.sh b/bin/test.sh
new file mode 100755
index 00000000..78e62e65
--- /dev/null
+++ b/bin/test.sh
@@ -0,0 +1,87 @@
+root=$(pwd)
+
+#Global variables
+USAGE='Usage: test.sh [options] [-- [options]].\n Options:\n -oc, --only-containers: only start docker containers\n -sc, --stop-containers: stop docker containers\n -k, --keep: keep jest runing after the completion of the tests suites\n -c: run tests with coverage\n -h, --help: show this help message\n --: pass extra options'
+KEEP=0
+FORCE_STOP_JEST='--forceExit'
+ONLY_CONTAINERS=0
+STOP_CONTAINERSq=0
+COMMAND_ARGS=''
+
+function moveToTestDir {
+ echo 'Moving to tests dir'
+ cd ${root}/tests
+}
+
+function moveToRootDir {
+ echo 'Moving to root dir'
+ cd ${root}
+}
+
+## obtain options
+while [ "$1" != "" ]; do
+ case $1 in
+ -oc | --only-containers ) ONLY_CONTAINERS=1
+ ;;
+ -sc | --stop-containers ) STOP_CONTAINERS=1
+ ;;
+ -k | --keep ) KEEP=1
+ ;;
+ -c) shift
+ COMMAND_ARGS="${COMMAND_ARGS} --coverage"
+ ;;
+ -h | --help ) echo "$USAGE"
+ exit
+ ;;
+ --) shift
+ while [ "$1" != "" ]; do
+ COMMAND_ARGS="${COMMAND_ARGS} -- $1"
+ shift
+ done
+ ;;
+ * ) echo "$USAGE"
+ exit 1
+ esac
+ shift
+done
+
+## STOP_CONTAINERS is a final option
+if [ $STOP_CONTAINERS -eq 1 ]; then
+ echo 'Stopping docker containers'
+ moveToTestDir
+ docker-compose down
+ exit 0
+fi
+
+## ONLY_CONTAINERS must be 1 and STOP must be 0
+if [ $ONLY_CONTAINERS -eq 1 ] && [ $STOP -eq 1 ]; then
+ echo 'Invalid options - when using option -oc, option -ns must be used as well'
+ echo "$usage"
+ exit 1
+fi
+
+## should we check if docker is running?
+echo 'Starting docker containers'
+moveToTestDir
+docker-compose up -d
+
+if [ $ONLY_CONTAINERS -eq 1 ]; then
+ exit 0
+fi
+
+## run tests
+echo 'Running tests'
+moveToRootDir
+
+if [ $KEEP -eq 0 ]; then
+ FORCE_STOP_JEST=''
+fi
+
+yarn jest $COMMAND_ARGS $FORCE_STOP_JEST
+
+if [ $KEEP -eq 0 ]; then
+ ## stop docker containers
+ echo 'Stopping docker containers'
+ moveToTestDir
+ docker-compose down
+fi
\ No newline at end of file
diff --git a/config/services/solr/confs/conf/accents_ar.txt b/config/services/solr/confs/conf/accents_ar.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/accents_en.txt b/config/services/solr/confs/conf/accents_en.txt
new file mode 100644
index 00000000..bed05147
--- /dev/null
+++ b/config/services/solr/confs/conf/accents_en.txt
@@ -0,0 +1,164 @@
+# À => A
+"\u00C0" => "A"
+# Á => A
+"\u00C1" => "A"
+# Â => A
+"\u00C2" => "A"
+# Ã => A
+"\u00C3" => "A"
+# Ä => A
+"\u00C4" => "A"
+# Å => A
+"\u00C5" => "A"
+# Ą => A
+"\u0104" => "A"
+# Æ => AE
+"\u00C6" => "AE"
+# Ç => C
+"\u00C7" => "C"
+# Ć => C
+"\U0106" => "C"
+# È => E
+"\u00C8" => "E"
+# É => E
+"\u00C9" => "E"
+# Ê => E
+"\u00CA" => "E"
+# Ë => E
+"\u00CB" => "E"
+# Ę => E
+"\u0118" => "E"
+# Ì => I
+"\u00CC" => "I"
+# Í => I
+"\u00CD" => "I"
+# Î => I
+"\u00CE" => "I"
+# Ï => I
+"\u00CF" => "I"
+# IJ => IJ
+"\u0132" => "IJ"
+# Ð => D
+"\u00D0" => "D"
+# Ł => L
+"\u0141" => "L"
+# Ñ => N
+"\u00D1" => "N"
+# Ń => N
+"\u0143" => "N"
+# Ò => O
+"\u00D2" => "O"
+# Ó => O
+"\u00D3" => "O"
+# Ô => O
+"\u00D4" => "O"
+# Õ => O
+"\u00D5" => "O"
+# Ö => O
+"\u00D6" => "O"
+# Ø => O
+"\u00D8" => "O"
+# Œ => OE
+"\u0152" => "OE"
+# Þ
+"\u00DE" => "TH"
+# Ù => U
+"\u00D9" => "U"
+# Ú => U
+"\u00DA" => "U"
+# Û => U
+"\u00DB" => "U"
+# Ü => U
+"\u00DC" => "U"
+# Ý => Y
+"\u00DD" => "Y"
+# Ÿ => Y
+"\u0178" => "Y"
+# à => a
+"\u00E0" => "a"
+# á => a
+"\u00E1" => "a"
+# â => a
+"\u00E2" => "a"
+# ã => a
+"\u00E3" => "a"
+# ä => a
+"\u00E4" => "a"
+# å => a
+"\u00E5" => "a"
+# æ => ae
+"\u00E6" => "ae"
+# ç => c
+"\u00E7" => "c"
+# è => e
+"\u00E8" => "e"
+# é => e
+"\u00E9" => "e"
+# ê => e
+"\u00EA" => "e"
+# ë => e
+"\u00EB" => "e"
+# ì => i
+"\u00EC" => "i"
+# í => i
+"\u00ED" => "i"
+# î => i
+"\u00EE" => "i"
+# ï => i
+"\u00EF" => "i"
+# ij => ij
+"\u0133" => "ij"
+# ð => d
+"\u00F0" => "d"
+# ñ => n
+"\u00F1" => "n"
+# ò => o
+"\u00F2" => "o"
+# ó => o
+"\u00F3" => "o"
+# ô => o
+"\u00F4" => "o"
+# õ => o
+"\u00F5" => "o"
+# ö => o
+"\u00F6" => "o"
+# ø => o
+"\u00F8" => "o"
+# œ => oe
+"\u0153" => "oe"
+# ß => ss
+"\u00DF" => "ss"
+# Ś => S
+"\u015a" => "S"
+# þ => th
+"\u00FE" => "th"
+# ù => u
+"\u00F9" => "u"
+# ú => u
+"\u00FA" => "u"
+# û => u
+"\u00FB" => "u"
+# ü => u
+"\u00FC" => "u"
+# ý => y
+"\u00FD" => "y"
+# ÿ => y
+"\u00FF" => "y"
+# Ź => Z
+"\u0179" => "Z"
+# Ż => Z
+"\u017b" => "Z"
+# ff => ff
+"\uFB00" => "ff"
+# fi => fi
+"\uFB01" => "fi"
+# fl => fl
+"\uFB02" => "fl"
+# ffi => ffi
+"\uFB03" => "ffi"
+# ffl => ffl
+"\uFB04" => "ffl"
+# ſt => st
+"\uFB05" => "st"
+# st => st
+"\uFB06" => "st"
diff --git a/config/services/solr/confs/conf/accents_es.txt b/config/services/solr/confs/conf/accents_es.txt
new file mode 100644
index 00000000..265e5e3d
--- /dev/null
+++ b/config/services/solr/confs/conf/accents_es.txt
@@ -0,0 +1,164 @@
+# À => A
+"\u00C0" => "A"
+# Á => A
+#"\u00C1" => "A"
+# Â => A
+"\u00C2" => "A"
+# Ã => A
+"\u00C3" => "A"
+# Ä => A
+"\u00C4" => "A"
+# Å => A
+"\u00C5" => "A"
+# Ą => A
+"\u0104" => "A"
+# Æ => AE
+"\u00C6" => "AE"
+# Ç => C
+"\u00C7" => "C"
+# Ć => C
+"\U0106" => "C"
+# È => E
+"\u00C8" => "E"
+# É => E
+#"\u00C9" => "E"
+# Ê => E
+"\u00CA" => "E"
+# Ë => E
+"\u00CB" => "E"
+# Ę => E
+"\u0118" => "E"
+# Ì => I
+"\u00CC" => "I"
+# Í => I
+#"\u00CD" => "I"
+# Î => I
+"\u00CE" => "I"
+# Ï => I
+"\u00CF" => "I"
+# IJ => IJ
+"\u0132" => "IJ"
+# Ð => D
+"\u00D0" => "D"
+# Ł => L
+"\u0141" => "L"
+# Ñ => N
+#"\u00D1" => "N"
+# Ń => N
+"\u0143" => "N"
+# Ò => O
+"\u00D2" => "O"
+# Ó => O
+#"\u00D3" => "O"
+# Ô => O
+"\u00D4" => "O"
+# Õ => O
+"\u00D5" => "O"
+# Ö => O
+"\u00D6" => "O"
+# Ø => O
+"\u00D8" => "O"
+# Œ => OE
+"\u0152" => "OE"
+# Þ
+"\u00DE" => "TH"
+# Ù => U
+"\u00D9" => "U"
+# Ú => U
+#"\u00DA" => "U"
+# Û => U
+"\u00DB" => "U"
+# Ü => U
+"\u00DC" => "U"
+# Ý => Y
+"\u00DD" => "Y"
+# Ÿ => Y
+"\u0178" => "Y"
+# à => a
+"\u00E0" => "a"
+# á => a
+#"\u00E1" => "a"
+# â => a
+"\u00E2" => "a"
+# ã => a
+"\u00E3" => "a"
+# ä => a
+"\u00E4" => "a"
+# å => a
+"\u00E5" => "a"
+# æ => ae
+"\u00E6" => "ae"
+# ç => c
+"\u00E7" => "c"
+# è => e
+"\u00E8" => "e"
+# é => e
+#"\u00E9" => "e"
+# ê => e
+"\u00EA" => "e"
+# ë => e
+"\u00EB" => "e"
+# ì => i
+"\u00EC" => "i"
+# í => i
+#"\u00ED" => "i"
+# î => i
+"\u00EE" => "i"
+# ï => i
+"\u00EF" => "i"
+# ij => ij
+"\u0133" => "ij"
+# ð => d
+"\u00F0" => "d"
+# ñ => n
+#"\u00F1" => "n"
+# ò => o
+"\u00F2" => "o"
+# ó => o
+#"\u00F3" => "o"
+# ô => o
+"\u00F4" => "o"
+# õ => o
+"\u00F5" => "o"
+# ö => o
+"\u00F6" => "o"
+# ø => o
+"\u00F8" => "o"
+# œ => oe
+"\u0153" => "oe"
+# ß => ss
+"\u00DF" => "ss"
+# Ś => S
+"\u015a" => "S"
+# þ => th
+"\u00FE" => "th"
+# ù => u
+"\u00F9" => "u"
+# ú => u
+#"\u00FA" => "u"
+# û => u
+"\u00FB" => "u"
+# ü => u
+"\u00FC" => "u"
+# ý => y
+"\u00FD" => "y"
+# ÿ => y
+"\u00FF" => "y"
+# Ź => Z
+"\u0179" => "Z"
+# Ż => Z
+"\u017b" => "Z"
+# ff => ff
+"\uFB00" => "ff"
+# fi => fi
+"\uFB01" => "fi"
+# fl => fl
+"\uFB02" => "fl"
+# ffi => ffi
+"\uFB03" => "ffi"
+# ffl => ffl
+"\uFB04" => "ffl"
+# ſt => st
+"\uFB05" => "st"
+# st => st
+"\uFB06" => "st"
diff --git a/config/services/solr/confs/conf/accents_fr.txt b/config/services/solr/confs/conf/accents_fr.txt
new file mode 100644
index 00000000..7f66a29c
--- /dev/null
+++ b/config/services/solr/confs/conf/accents_fr.txt
@@ -0,0 +1,164 @@
+# À => A
+"\u00C0" => "A"
+# Á => A
+#"\u00C1" => "A"
+# Â => A
+"\u00C2" => "A"
+# Ã => A
+#"\u00C3" => "A"
+# Ä => A
+#"\u00C4" => "A"
+# Å => A
+#"\u00C5" => "A"
+# Ą => A
+#"\u0104" => "A"
+# Æ => AE
+"\u00C6" => "AE"
+# Ç => C
+"\u00C7" => "C"
+# Ć => C
+#"\U0106" => "C"
+# È => E
+"\u00C8" => "E"
+# É => E
+"\u00C9" => "E"
+# Ê => E
+"\u00CA" => "E"
+# Ë => E
+#"\u00CB" => "E"
+# Ę => E
+#"\u0118" => "E"
+# Ì => I
+#"\u00CC" => "I"
+# Í => I
+#"\u00CD" => "I"
+# Î => I
+"\u00CE" => "I"
+# Ï => I
+#"\u00CF" => "I"
+# IJ => IJ
+#"\u0132" => "IJ"
+# Ð => D
+#"\u00D0" => "D"
+# Ł => L
+#"\u0141" => "L"
+# Ñ => N
+#"\u00D1" => "N"
+# Ń => N
+#"\u0143" => "N"
+# Ò => O
+#"\u00D2" => "O"
+# Ó => O
+#"\u00D3" => "O"
+# Ô => O
+"\u00D4" => "O"
+# Õ => O
+#"\u00D5" => "O"
+# Ö => O
+#"\u00D6" => "O"
+# Ø => O
+#"\u00D8" => "O"
+# Œ => OE
+"\u0152" => "OE"
+# Þ
+#"\u00DE" => "TH"
+# Ù => U
+"\u00D9" => "U"
+# Ú => U
+#"\u00DA" => "U"
+# Û => U
+"\u00DB" => "U"
+# Ü => U
+#"\u00DC" => "U"
+# Ý => Y
+#"\u00DD" => "Y"
+# Ÿ => Y
+#"\u0178" => "Y"
+# à => a
+"\u00E0" => "a"
+# á => a
+#"\u00E1" => "a"
+# â => a
+"\u00E2" => "a"
+# ã => a
+#"\u00E3" => "a"
+# ä => a
+#"\u00E4" => "a"
+# å => a
+#"\u00E5" => "a"
+# æ => ae
+"\u00E6" => "ae"
+# ç => c
+"\u00E7" => "c"
+# è => e
+"\u00E8" => "e"
+# é => e
+"\u00E9" => "e"
+# ê => e
+"\u00EA" => "e"
+# ë => e
+#"\u00EB" => "e"
+# ì => i
+#"\u00EC" => "i"
+# í => i
+#"\u00ED" => "i"
+# î => i
+"\u00EE" => "i"
+# ï => i
+#"\u00EF" => "i"
+# ij => ij
+#"\u0133" => "ij"
+# ð => d
+#"\u00F0" => "d"
+# ñ => n
+#"\u00F1" => "n"
+# ò => o
+#"\u00F2" => "o"
+# ó => o
+#"\u00F3" => "o"
+# ô => o
+"\u00F4" => "o"
+# õ => o
+#"\u00F5" => "o"
+# ö => o
+#"\u00F6" => "o"
+# ø => o
+#"\u00F8" => "o"
+# œ => oe
+"\u0153" => "oe"
+# ß => ss
+#"\u00DF" => "ss"
+# Ś => S
+#"\u015a" => "S"
+# þ => th
+#"\u00FE" => "th"
+# ù => u
+"\u00F9" => "u"
+# ú => u
+#"\u00FA" => "u"
+# û => u
+"\u00FB" => "u"
+# ü => u
+"\u00FC" => "u"
+# ý => y
+#"\u00FD" => "y"
+# ÿ => y
+#"\u00FF" => "y"
+# Ź => Z
+#"\u0179" => "Z"
+# Ż => Z
+#"\u017b" => "Z"
+# ff => ff
+#"\uFB00" => "ff"
+# fi => fi
+#"\uFB01" => "fi"
+# fl => fl
+#"\uFB02" => "fl"
+# ffi => ffi
+#"\uFB03" => "ffi"
+# ffl => ffl
+#"\uFB04" => "ffl"
+# ſt => st
+#"\uFB05" => "st"
+# st => st
+#"\uFB06" => "st"
diff --git a/config/services/solr/confs/conf/accents_und.txt b/config/services/solr/confs/conf/accents_und.txt
new file mode 100644
index 00000000..7c883f87
--- /dev/null
+++ b/config/services/solr/confs/conf/accents_und.txt
@@ -0,0 +1,148 @@
+# À => A
+"\u00C0" => "A"
+# Á => A
+"\u00C1" => "A"
+# Â => A
+"\u00C2" => "A"
+# Ã => A
+"\u00C3" => "A"
+# Ä => A
+"\u00C4" => "A"
+# Å => A
+"\u00C5" => "A"
+# Æ => AE
+"\u00C6" => "AE"
+# Ç => C
+"\u00C7" => "C"
+# È => E
+"\u00C8" => "E"
+# É => E
+"\u00C9" => "E"
+# Ê => E
+"\u00CA" => "E"
+# Ë => E
+"\u00CB" => "E"
+# Ì => I
+"\u00CC" => "I"
+# Í => I
+"\u00CD" => "I"
+# Î => I
+"\u00CE" => "I"
+# Ï => I
+"\u00CF" => "I"
+# IJ => IJ
+"\u0132" => "IJ"
+# Ð => D
+"\u00D0" => "D"
+# Ñ => N
+"\u00D1" => "N"
+# Ò => O
+"\u00D2" => "O"
+# Ó => O
+"\u00D3" => "O"
+# Ô => O
+"\u00D4" => "O"
+# Õ => O
+"\u00D5" => "O"
+# Ö => O
+"\u00D6" => "O"
+# Ø => O
+"\u00D8" => "O"
+# Œ => OE
+"\u0152" => "OE"
+# Þ
+"\u00DE" => "TH"
+# Ù => U
+"\u00D9" => "U"
+# Ú => U
+"\u00DA" => "U"
+# Û => U
+"\u00DB" => "U"
+# Ü => U
+"\u00DC" => "U"
+# Ý => Y
+"\u00DD" => "Y"
+# Ÿ => Y
+"\u0178" => "Y"
+# à => a
+"\u00E0" => "a"
+# á => a
+"\u00E1" => "a"
+# â => a
+"\u00E2" => "a"
+# ã => a
+"\u00E3" => "a"
+# ä => a
+"\u00E4" => "a"
+# å => a
+"\u00E5" => "a"
+# æ => ae
+"\u00E6" => "ae"
+# ç => c
+"\u00E7" => "c"
+# è => e
+"\u00E8" => "e"
+# é => e
+"\u00E9" => "e"
+# ê => e
+"\u00EA" => "e"
+# ë => e
+"\u00EB" => "e"
+# ì => i
+"\u00EC" => "i"
+# í => i
+"\u00ED" => "i"
+# î => i
+"\u00EE" => "i"
+# ï => i
+"\u00EF" => "i"
+# ij => ij
+"\u0133" => "ij"
+# ð => d
+"\u00F0" => "d"
+# ñ => n
+"\u00F1" => "n"
+# ò => o
+"\u00F2" => "o"
+# ó => o
+"\u00F3" => "o"
+# ô => o
+"\u00F4" => "o"
+# õ => o
+"\u00F5" => "o"
+# ö => o
+"\u00F6" => "o"
+# ø => o
+"\u00F8" => "o"
+# œ => oe
+"\u0153" => "oe"
+# ß => ss
+"\u00DF" => "ss"
+# þ => th
+"\u00FE" => "th"
+# ù => u
+"\u00F9" => "u"
+# ú => u
+"\u00FA" => "u"
+# û => u
+"\u00FB" => "u"
+# ü => u
+"\u00FC" => "u"
+# ý => y
+"\u00FD" => "y"
+# ÿ => y
+"\u00FF" => "y"
+# ff => ff
+"\uFB00" => "ff"
+# fi => fi
+"\uFB01" => "fi"
+# fl => fl
+"\uFB02" => "fl"
+# ffi => ffi
+"\uFB03" => "ffi"
+# ffl => ffl
+"\uFB04" => "ffl"
+# ſt => st
+"\uFB05" => "st"
+# st => st
+"\uFB06" => "st"
diff --git a/config/services/solr/confs/conf/elevate.xml b/config/services/solr/confs/conf/elevate.xml
new file mode 100644
index 00000000..193a0e72
--- /dev/null
+++ b/config/services/solr/confs/conf/elevate.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/config/services/solr/confs/conf/nouns_ar.txt b/config/services/solr/confs/conf/nouns_ar.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/nouns_es.txt b/config/services/solr/confs/conf/nouns_es.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/nouns_fr.txt b/config/services/solr/confs/conf/nouns_fr.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/protwords_ar.txt b/config/services/solr/confs/conf/protwords_ar.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/protwords_en.txt b/config/services/solr/confs/conf/protwords_en.txt
new file mode 100644
index 00000000..cda85814
--- /dev/null
+++ b/config/services/solr/confs/conf/protwords_en.txt
@@ -0,0 +1,7 @@
+#-----------------------------------------------------------------------
+# This file blocks words from being operated on by the stemmer and word delimiter.
+&
+<
+>
+'
+"
diff --git a/config/services/solr/confs/conf/protwords_es.txt b/config/services/solr/confs/conf/protwords_es.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/protwords_fr.txt b/config/services/solr/confs/conf/protwords_fr.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/protwords_und.txt b/config/services/solr/confs/conf/protwords_und.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/schema.xml b/config/services/solr/confs/conf/schema.xml
new file mode 100644
index 00000000..179f5886
--- /dev/null
+++ b/config/services/solr/confs/conf/schema.xml
@@ -0,0 +1,499 @@
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &extrafields;
+
+
+ &extratypes;
+
+
+ id
+
+
+
+
+
diff --git a/config/services/solr/confs/conf/schema_extra_fields.xml b/config/services/solr/confs/conf/schema_extra_fields.xml
new file mode 100644
index 00000000..c8eb41b4
--- /dev/null
+++ b/config/services/solr/confs/conf/schema_extra_fields.xml
@@ -0,0 +1,425 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/services/solr/confs/conf/schema_extra_types.xml b/config/services/solr/confs/conf/schema_extra_types.xml
new file mode 100644
index 00000000..69ee225e
--- /dev/null
+++ b/config/services/solr/confs/conf/schema_extra_types.xml
@@ -0,0 +1,481 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/services/solr/confs/conf/solrconfig.xml b/config/services/solr/confs/conf/solrconfig.xml
new file mode 100644
index 00000000..e225b691
--- /dev/null
+++ b/config/services/solr/confs/conf/solrconfig.xml
@@ -0,0 +1,810 @@
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+ ${solr.abortOnConfigurationError:true}
+
+
+ ${solr.luceneMatchVersion:8.11}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${solr.data.dir:}
+
+
+
+
+
+
+
+
+ ${solr.hdfs.home:}
+
+ ${solr.hdfs.confdir:}
+
+ ${solr.hdfs.blockcache.enabled:true}
+
+ ${solr.hdfs.blockcache.global:true}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${solr.lock.type:native}
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ &index;
+
+
+
+
+
+
+
+
+ ${solr.ulog.dir:}
+
+
+
+
+ ${solr.autoCommit.MaxDocs:-1}
+ ${solr.autoCommit.MaxTime:15000}
+
+
+
+
+
+ ${solr.autoSoftCommit.MaxDocs:-1}
+ ${solr.autoSoftCommit.MaxTime:5000}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &query;
+
+
+
+
+
+
+
+
+
+
+
+ static firstSearcher warming in solrconfig.xml
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+ &requestdispatcher;
+
+
+
+
+
+
+ &extra;
+
+
+
+
+
+
+
+
+ 100
+
+
+
+
+
+
+
+ 70
+
+ 0.5
+
+ [-\w ,/\n\"']{20,200}
+
+
+
+
+
+
+ ]]>
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ,,
+ ,,
+ ,,
+ ,,
+ ,]]>
+ ]]>
+
+
+
+
+
+ 10
+ .,!?
+
+
+
+
+
+
+ WORD
+
+
+ en
+ US
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/config/services/solr/confs/conf/solrconfig_extra.xml b/config/services/solr/confs/conf/solrconfig_extra.xml
new file mode 100644
index 00000000..78e5d31f
--- /dev/null
+++ b/config/services/solr/confs/conf/solrconfig_extra.xml
@@ -0,0 +1,281 @@
+
+
+ ar
+ spellcheck_ar
+ solr.DirectSolrSpellChecker
+ internal
+ 0.5
+ 2
+ 1
+ 5
+ 4
+ 0.01
+ .01
+ true
+
+
+
+ en
+ spellcheck_en
+ solr.DirectSolrSpellChecker
+ internal
+ 0.5
+ 2
+ 1
+ 5
+ 4
+ 0.01
+ .01
+ true
+
+
+
+ fr
+ spellcheck_fr
+ solr.DirectSolrSpellChecker
+ internal
+ 0.5
+ 2
+ 1
+ 5
+ 4
+ 0.01
+ .01
+ true
+
+
+
+ und
+ spellcheck_und
+ solr.DirectSolrSpellChecker
+ internal
+ 0.5
+ 2
+ 1
+ 5
+ 4
+ 0.01
+ .01
+ true
+
+
+
+ zh_hans
+ spellcheck_zh_hans
+ solr.DirectSolrSpellChecker
+ internal
+ 0.5
+ 1
+ 1
+ 5
+ 1
+ 0.01
+ true
+
+
+
+ es
+ spellcheck_es
+ solr.DirectSolrSpellChecker
+ internal
+ 0.5
+ 2
+ 1
+ 5
+ 4
+ 0.01
+ .01
+ true
+
+
+
+
+ ar
+ AnalyzingInfixLookupFactory
+ DocumentDictionaryFactory
+ twm_suggest
+ text_ar
+ sm_context_tags
+ true
+ false
+
+
+
+ en
+ AnalyzingInfixLookupFactory
+ DocumentDictionaryFactory
+ twm_suggest
+ text_en
+ sm_context_tags
+ true
+ false
+
+
+
+ fr
+ AnalyzingInfixLookupFactory
+ DocumentDictionaryFactory
+ twm_suggest
+ text_fr
+ sm_context_tags
+ true
+ false
+
+
+
+ und
+ AnalyzingInfixLookupFactory
+ DocumentDictionaryFactory
+ twm_suggest
+ text_und
+ sm_context_tags
+ true
+ false
+
+
+
+ es
+ AnalyzingInfixLookupFactory
+ DocumentDictionaryFactory
+ twm_suggest
+ text_es
+ sm_context_tags
+ true
+ false
+
+
+
+
+
+ false
+ false
+ false
+ true
+ false
+ 1
+ false
+ 10
+
+
+ terms
+ spellcheck
+ suggest
+
+
+
+
+
+
+ true
+ ignored_
+ true
+ links
+ ignored_
+
+
+
+
+
+
+ 1
+ 1
+ false
+ ${solr.mlt.timeAllowed:2000}
+
+
+
+
+
+
+ lucene
+ id
+ explicit
+ true
+ ${solr.selectSearchHandler.timeAllowed:-1}
+ false
+
+
+ spellcheck
+ elevator
+
+
+
+
+
+
+ id
+ und
+ on
+ false
+ false
+ 1
+ 5
+ 5
+ true
+ true
+ 10
+ 5
+
+
+ spellcheck
+
+
+
+
+
+
+ true
+ und
+ 10
+
+
+ suggest
+
+
+
+
+
+
+ id
+ true
+
+
+ tvComponent
+
+
+
+
+
+ string
+ elevate.xml
+
+
+
+
diff --git a/config/services/solr/confs/conf/solrconfig_index.xml b/config/services/solr/confs/conf/solrconfig_index.xml
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/solrconfig_query.xml b/config/services/solr/confs/conf/solrconfig_query.xml
new file mode 100644
index 00000000..5bdd6969
--- /dev/null
+++ b/config/services/solr/confs/conf/solrconfig_query.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+ false
+
+ 20
+ 200
+ 1024
diff --git a/config/services/solr/confs/conf/solrconfig_requestdispatcher.xml b/config/services/solr/confs/conf/solrconfig_requestdispatcher.xml
new file mode 100644
index 00000000..3a3f17d1
--- /dev/null
+++ b/config/services/solr/confs/conf/solrconfig_requestdispatcher.xml
@@ -0,0 +1,6 @@
+
+
+
diff --git a/config/services/solr/confs/conf/solrcore.properties b/config/services/solr/confs/conf/solrcore.properties
new file mode 100644
index 00000000..af505a62
--- /dev/null
+++ b/config/services/solr/confs/conf/solrcore.properties
@@ -0,0 +1,9 @@
+#conf/solrcore.properties
+solr.mlt.timeAllowed=2000
+solr.luceneMatchVersion=8.11.2
+solr.selectSearchHandler.timeAllowed=-1
+solr.autoCommit.MaxDocs=10000
+solr.autoCommit.MaxTime=15000
+solr.autoSoftCommit.MaxDocs=-1
+solr.autoSoftCommit.MaxTime=-1
+solr.install.dir=/opt/solr
\ No newline at end of file
diff --git a/config/services/solr/confs/conf/stopwords_ar.txt b/config/services/solr/confs/conf/stopwords_ar.txt
new file mode 100644
index 00000000..e5ba3908
--- /dev/null
+++ b/config/services/solr/confs/conf/stopwords_ar.txt
@@ -0,0 +1,119 @@
+من
+ومن
+منها
+منه
+في
+وفي
+فيها
+فيه
+و
+ف
+ثم
+او
+أو
+ب
+بها
+به
+ا
+أ
+اى
+اي
+أي
+أى
+لا
+ولا
+الا
+ألا
+إلا
+لكن
+ما
+وما
+كما
+فما
+عن
+مع
+اذا
+إذا
+ان
+أن
+إن
+انها
+أنها
+إنها
+انه
+أنه
+إنه
+بان
+بأن
+فان
+فأن
+وان
+وأن
+وإن
+التى
+التي
+الذى
+الذي
+الذين
+الى
+الي
+إلى
+إلي
+على
+عليها
+عليه
+اما
+أما
+إما
+ايضا
+أيضا
+كل
+وكل
+لم
+ولم
+لن
+ولن
+هى
+هي
+هو
+وهى
+وهي
+وهو
+فهى
+فهي
+فهو
+انت
+أنت
+لك
+لها
+له
+هذه
+هذا
+تلك
+ذلك
+هناك
+كانت
+كان
+يكون
+تكون
+وكانت
+وكان
+غير
+بعض
+قد
+نحو
+بين
+بينما
+منذ
+ضمن
+حيث
+الان
+الآن
+خلال
+بعد
+قبل
+حتى
+عند
+عندما
+لدى
+جميع
diff --git a/config/services/solr/confs/conf/stopwords_en.txt b/config/services/solr/confs/conf/stopwords_en.txt
new file mode 100644
index 00000000..69810507
--- /dev/null
+++ b/config/services/solr/confs/conf/stopwords_en.txt
@@ -0,0 +1,35 @@
+a
+an
+and
+are
+as
+at
+be
+but
+by
+for
+if
+in
+into
+is
+it
+no
+not
+of
+on
+or
+s
+such
+t
+that
+the
+their
+then
+there
+these
+they
+this
+to
+was
+will
+with
diff --git a/config/services/solr/confs/conf/stopwords_es.txt b/config/services/solr/confs/conf/stopwords_es.txt
new file mode 100644
index 00000000..c59d9b20
--- /dev/null
+++ b/config/services/solr/confs/conf/stopwords_es.txt
@@ -0,0 +1,308 @@
+de
+la
+que
+el
+en
+y
+a
+los
+del
+se
+las
+por
+un
+para
+con
+no
+una
+su
+al
+lo
+como
+más
+pero
+sus
+le
+ya
+o
+este
+sí
+porque
+esta
+entre
+cuando
+muy
+sin
+sobre
+también
+me
+hasta
+hay
+donde
+quien
+desde
+todo
+nos
+durante
+todos
+uno
+les
+ni
+contra
+otros
+ese
+eso
+ante
+ellos
+e
+esto
+mí
+antes
+algunos
+qué
+unos
+yo
+otro
+otras
+otra
+él
+tanto
+esa
+estos
+mucho
+quienes
+nada
+muchos
+cual
+poco
+ella
+estar
+estas
+algunas
+algo
+nosotros
+mi
+mis
+tú
+te
+ti
+tu
+tus
+ellas
+nosotras
+vosotros
+vosotras
+os
+mío
+mía
+míos
+mías
+tuyo
+tuya
+tuyos
+tuyas
+suyo
+suya
+suyos
+suyas
+nuestro
+nuestra
+nuestros
+nuestras
+vuestro
+vuestra
+vuestros
+vuestras
+esos
+esas
+estoy
+estás
+está
+estamos
+estáis
+están
+esté
+estés
+estemos
+estéis
+estén
+estaré
+estarás
+estará
+estaremos
+estaréis
+estarán
+estaría
+estarías
+estaríamos
+estaríais
+estarían
+estaba
+estabas
+estábamos
+estabais
+estaban
+estuve
+estuviste
+estuvo
+estuvimos
+estuvisteis
+estuvieron
+estuviera
+estuvieras
+estuviéramos
+estuvierais
+estuvieran
+estuviese
+estuvieses
+estuviésemos
+estuvieseis
+estuviesen
+estando
+estado
+estada
+estados
+estadas
+estad
+he
+has
+ha
+hemos
+habéis
+han
+haya
+hayas
+hayamos
+hayáis
+hayan
+habré
+habrás
+habrá
+habremos
+habréis
+habrán
+habría
+habrías
+habríamos
+habríais
+habrían
+había
+habías
+habíamos
+habíais
+habían
+hube
+hubiste
+hubo
+hubimos
+hubisteis
+hubieron
+hubiera
+hubieras
+hubiéramos
+hubierais
+hubieran
+hubiese
+hubieses
+hubiésemos
+hubieseis
+hubiesen
+habiendo
+habido
+habida
+habidos
+habidas
+soy
+eres
+es
+somos
+sois
+son
+sea
+seas
+seamos
+seáis
+sean
+seré
+serás
+será
+seremos
+seréis
+serán
+sería
+serías
+seríamos
+seríais
+serían
+era
+eras
+éramos
+erais
+eran
+fui
+fuiste
+fue
+fuimos
+fuisteis
+fueron
+fuera
+fueras
+fuéramos
+fuerais
+fueran
+fuese
+fueses
+fuésemos
+fueseis
+fuesen
+siendo
+sido
+tengo
+tienes
+tiene
+tenemos
+tenéis
+tienen
+tenga
+tengas
+tengamos
+tengáis
+tengan
+tendré
+tendrás
+tendrá
+tendremos
+tendréis
+tendrán
+tendría
+tendrías
+tendríamos
+tendríais
+tendrían
+tenía
+tenías
+teníamos
+teníais
+tenían
+tuve
+tuviste
+tuvo
+tuvimos
+tuvisteis
+tuvieron
+tuviera
+tuvieras
+tuviéramos
+tuvierais
+tuvieran
+tuviese
+tuvieses
+tuviésemos
+tuvieseis
+tuviesen
+teniendo
+tenido
+tenida
+tenidos
+tenidas
+tened
diff --git a/config/services/solr/confs/conf/stopwords_fr.txt b/config/services/solr/confs/conf/stopwords_fr.txt
new file mode 100644
index 00000000..c78ec5aa
--- /dev/null
+++ b/config/services/solr/confs/conf/stopwords_fr.txt
@@ -0,0 +1,163 @@
+au
+aux
+avec
+ce
+ces
+dans
+de
+des
+du
+elle
+en
+et
+eux
+il
+je
+la
+le
+leur
+lui
+ma
+mais
+me
+même
+mes
+moi
+mon
+ne
+nos
+notre
+nous
+on
+ou
+par
+pas
+pour
+qu
+que
+qui
+sa
+se
+ses
+son
+sur
+ta
+te
+tes
+toi
+ton
+tu
+un
+une
+vos
+votre
+vous
+c
+d
+j
+l
+à
+m
+n
+s
+t
+y
+été
+étée
+étées
+étés
+étant
+suis
+es
+est
+sommes
+êtes
+sont
+serai
+seras
+sera
+serons
+serez
+seront
+serais
+serait
+serions
+seriez
+seraient
+étais
+était
+étions
+étiez
+étaient
+fus
+fut
+fûmes
+fûtes
+furent
+sois
+soit
+soyons
+soyez
+soient
+fusse
+fusses
+fût
+fussions
+fussiez
+fussent
+ayant
+eu
+eue
+eues
+eus
+ai
+as
+avons
+avez
+ont
+aurai
+auras
+aura
+aurons
+aurez
+auront
+aurais
+aurait
+aurions
+auriez
+auraient
+avais
+avait
+avions
+aviez
+avaient
+eut
+eûmes
+eûtes
+eurent
+aie
+aies
+ait
+ayons
+ayez
+aient
+eusse
+eusses
+eût
+eussions
+eussiez
+eussent
+ceci
+celà
+cet
+cette
+ici
+ils
+les
+leurs
+quel
+quels
+quelle
+quelles
+sans
+soi
diff --git a/config/services/solr/confs/conf/stopwords_und.txt b/config/services/solr/confs/conf/stopwords_und.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/config/services/solr/confs/conf/synonyms_ar.txt b/config/services/solr/confs/conf/synonyms_ar.txt
new file mode 100644
index 00000000..91689ff9
--- /dev/null
+++ b/config/services/solr/confs/conf/synonyms_ar.txt
@@ -0,0 +1 @@
+drupal, durpal
diff --git a/config/services/solr/confs/conf/synonyms_en.txt b/config/services/solr/confs/conf/synonyms_en.txt
new file mode 100644
index 00000000..91689ff9
--- /dev/null
+++ b/config/services/solr/confs/conf/synonyms_en.txt
@@ -0,0 +1 @@
+drupal, durpal
diff --git a/config/services/solr/confs/conf/synonyms_es.txt b/config/services/solr/confs/conf/synonyms_es.txt
new file mode 100644
index 00000000..91689ff9
--- /dev/null
+++ b/config/services/solr/confs/conf/synonyms_es.txt
@@ -0,0 +1 @@
+drupal, durpal
diff --git a/config/services/solr/confs/conf/synonyms_fr.txt b/config/services/solr/confs/conf/synonyms_fr.txt
new file mode 100644
index 00000000..91689ff9
--- /dev/null
+++ b/config/services/solr/confs/conf/synonyms_fr.txt
@@ -0,0 +1 @@
+drupal, durpal
diff --git a/config/services/solr/confs/conf/synonyms_und.txt b/config/services/solr/confs/conf/synonyms_und.txt
new file mode 100644
index 00000000..91689ff9
--- /dev/null
+++ b/config/services/solr/confs/conf/synonyms_und.txt
@@ -0,0 +1 @@
+drupal, durpal
diff --git a/config/services/solr/run/entrypoint b/config/services/solr/run/entrypoint
new file mode 100755
index 00000000..8a4ed49b
--- /dev/null
+++ b/config/services/solr/run/entrypoint
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+echo "Changing permissions of solr directories"
+chown -R solr:solr /var/solr/data/
+chown -R solr:solr /var/solr/logs/
+
+exec su solr -c "export PATH=$PATH; /opt/hpc-solr/run/solr"
diff --git a/config/services/solr/run/solr b/config/services/solr/run/solr
new file mode 100755
index 00000000..d94b7ea3
--- /dev/null
+++ b/config/services/solr/run/solr
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+SOLR_HOME=/var/solr/data
+
+CONFDIR=/opt/hpc-solr/confs
+SOLR_CORE=${SOLR_CORE:-fts}
+
+cd ${SOLR_HOME}
+
+if [ -d ${SOLR_HOME}/${SOLR_CORE} ]; then
+ echo "HPC-specific SOLR initialization seems completed. Skipping it."
+ solr-foreground
+else
+ echo "Performing a one time HPC-specific SOLR initialization..."
+ echo "Creating a new solr core..."
+ VERBOSE=yes solr-precreate ${SOLR_CORE} ${CONFDIR}
+ echo "HPC init done!"
+fi
diff --git a/jest.config.ts b/jest.config.ts
new file mode 100644
index 00000000..e8f237e1
--- /dev/null
+++ b/jest.config.ts
@@ -0,0 +1,20 @@
+import type { Config } from '@jest/types';
+
+const config: Config.InitialOptions = {
+ verbose: true,
+ preset: 'ts-jest',
+ testEnvironment: 'node',
+ testPathIgnorePatterns: ['/node_modules/'],
+ testMatch: ['/**/*.spec.ts'],
+ coveragePathIgnorePatterns: ['/node_modules/', '/test/'],
+ clearMocks: true,
+ transform: {
+ '^.+\\.ts?$': 'ts-jest',
+ },
+ transformIgnorePatterns: ['node_modules/(?!(@unocha)/)'],
+ modulePathIgnorePatterns: ['/test/'],
+ setupFilesAfterEnv: ['/tests/test-environment-setup.ts'],
+ testTimeout: 100000,
+};
+
+export default config;
diff --git a/package.json b/package.json
index ab843778..de390225 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,8 @@
"lint": "yarn lint-prettier && yarn lint-eslint"
},
"dependencies": {
- "@unocha/hpc-api-core": "^6.0.0",
+ "@types/jest": "^29.5.7",
+ "@unocha/hpc-api-core": "https://github.com/UN-OCHA/hpc-api-core.git#cb95d90ca4a936f382a6e9b7758da1a0af88851b",
"apollo-server-hapi": "^3.12.0",
"bunyan": "^1.8.15",
"class-validator": "^0.14.0",
@@ -35,11 +36,14 @@
"@types/bunyan": "^1.8.8",
"@types/hapi__hapi": "^20.0.9",
"@types/node": "^18.16.19",
+ "@types/pg": "^8.10.2",
"@unocha/hpc-repo-tools": "^3.0.1",
"eslint": "^8.44.0",
"husky": "^8.0.3",
+ "jest": "^29.7.0",
"lint-staged": "^13.2.2",
"prettier": "2.8.8",
+ "ts-jest": "^29.1.1",
"ts-node-dev": "^2.0.0"
},
"engines": {
diff --git a/src/data-providers/postgres/index.ts b/src/data-providers/postgres/index.ts
index 3514399a..3daa3406 100644
--- a/src/data-providers/postgres/index.ts
+++ b/src/data-providers/postgres/index.ts
@@ -4,10 +4,10 @@ import { CONFIG } from '../../../config';
/**
* Initialize a new Postgres provider
*/
-export async function createDbConnetion() {
+export async function createDbConnetion(connection?: string) {
const knex = Knex({
client: 'pg',
- connection: CONFIG.db.connection,
+ connection: connection ?? CONFIG.db.connection,
pool: {
min: CONFIG.db.poolMin,
max: CONFIG.db.poolMax,
diff --git a/src/domain-services/categories/category-service.ts b/src/domain-services/categories/category-service.ts
new file mode 100644
index 00000000..7d8464f8
--- /dev/null
+++ b/src/domain-services/categories/category-service.ts
@@ -0,0 +1,85 @@
+import { Database } from '@unocha/hpc-api-core/src/db';
+import { Op } from '@unocha/hpc-api-core/src/db/util/conditions';
+import { createBrandedValue } from '@unocha/hpc-api-core/src/util/types';
+import { Service } from 'typedi';
+import { FlowCategory } from '../flows/graphql/types';
+import { InstanceDataOfModel } from '@unocha/hpc-api-core/src/db/util/raw-model';
+
+// TODO: add proper type for flowLinks
+@Service()
+export class CategoryService {
+ async getCategoriesForFlows(
+ flowLinks: Map,
+ models: Database
+ ): Promise