A set of scripts generating fake-data and testdata for a new mDIS instance.
Written in Javascript for the Node Platform v14+
You must use node v14 because the JS code internaly uses the `?.` 'optional chaining' operator as a shortcut for definedness of nested object properties.
### Inserting fake data
First, cd into the `bin/` subdirectory to execute Shell scripts,
or enter the `src/`subdirectory to execute node scripts.
#### Inserting a Fake Program
#### Inserting a Fake Expedition
#### Inserting a Fake Site
#### Inserting a Fake Hole
#### Inserting a Fake Core
#### Inserting a Fake Section
#### Inserting a Fake Split
Command:
```sh
node src/split-inserter.js -c 118 # -c stands for core
Stop early. Core 5363_A_AB_14_1 (id 118) and its 2 sections
seems to be split already, at least partially.
Maybe create the missing split sections manually.
Map(2){
'5363_A_AB_14_1'=>{ A: 1, W: 1, WR: 1 },
'5363_A_AB_14_2'=>{ A: 1, W: 1, WR: 1 }
}
```
### Querying the List-values table
Get value list names, and get all items of that list.
#### Get value list names
```js
nodelist-values.js-a
[
'ABUNDANCE',
'ACCESSORIES',
'ACTIVITY_TYPE',
]// and ~ 100 more
```
#### Get all entries of a single value list, filtered by na
Get all entries of a single value list, filtered by name
optionally.
-d values only, or
-e value+remark/labeltext paired
```sh
node list-values.js -n CITIES -e
```
##### Expected result
```js
{
Aarau:'Aargau, Switzerland',
Aarhus:'Central Jutland, Denmark',
Abiko:'Chiba, Japan',
Abo:'Finland Proper, Finland',
}
```
### Configuration
To use the scripts you must get a Bearer token for the REST API first. Add it either as an environment variable, or insert it at the top of the `src/config` file.