Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ecc0b49
Create LithologyType.json
marykruk Oct 8, 2024
ac9ddff
sort LithologyType.json
marykruk Oct 8, 2024
b9d1dfb
Merge branch 'main' into feature/groundwater
willfarrell Oct 22, 2024
76983e7
Update MonitoringLocationVerticalUnit.primary.json
marykruk Jul 10, 2025
68f213c
Merge branch 'main' into feature/groundwater
jayakishore709 Jan 7, 2026
a35fae3
chore: wqx update
jayakishore709 Jan 20, 2026
4837eb3
feat: support for new groudwater fields
jayakishore709 Jan 21, 2026
3e585e3
feat: add/update allowed values for groundwater
jayakishore709 Jan 21, 2026
3aff08b
feat: add new errors for groundwater fields
jayakishore709 Jan 23, 2026
ca77976
Merge branch 'main' into feature/groundwater
jayakishore709 Apr 20, 2026
0b2b00a
feat: align schema $ids and $refs for spec-compliant URL resolution
jayakishore709 Apr 28, 2026
edc8897
test: migrate from AVA to Node.js built-in test runner
jayakishore709 Apr 28, 2026
059cf75
ci: update build to use bash
jayakishore709 Apr 28, 2026
5cc04a1
ci: change build order to fix missing definition file
jayakishore709 Apr 28, 2026
5a3dfcb
ci: update deps and node 24
jayakishore709 Apr 29, 2026
46380a9
ci: increase stack size for ajv compiled output
jayakishore709 Apr 29, 2026
148dd13
ci: revert to node 22 due to stack size issues
jayakishore709 Apr 29, 2026
d8fa602
feat: update GW specific errors to only apply to GW data
jayakishore709 Apr 29, 2026
adf9a11
feat: update GW allowed values and errors
jayakishore709 Apr 30, 2026
885b242
feat: logic to prevent GW fields with non GW media
jayakishore709 Apr 30, 2026
e8fd59a
chore: add more fields to GW only logic
jayakishore709 May 1, 2026
d9c140c
feat: switch AquiferType to a custom field to keep title casing
jayakishore709 May 14, 2026
9c83858
feat: add GW enum fields to build-locales
jayakishore709 May 14, 2026
1e0c50c
chore: major version bump (rc)
jayakishore709 May 14, 2026
72b19fb
feat: add new error message for continuous activity type check
jayakishore709 Jun 10, 2026
982ecca
Create ActivityMediaName-ActivityDepthHeightMeasure-Maximum.json
nlibera2 Jun 18, 2026
3574caf
Create ActivityType subset, deprecate unused, add new
nlibera2 Jun 19, 2026
02a1e1f
Create ResultValueType subset, rm subtraction
nlibera2 Jun 19, 2026
bb255d3
Create ResultSampleFraction subset, rm subtraction
nlibera2 Jun 19, 2026
fc5a950
feat: new EventID field
jayakishore709 Jun 24, 2026
c3be5d0
New characteristics
nlibera2 Jun 24, 2026
a0f72a3
New ActivityTypes, remove deprecated from logic
nlibera2 Jun 24, 2026
6e1cbd2
Deprecate ResultStatusID Rejected
nlibera2 Jun 24, 2026
fdf7dfe
New SampleCollectionEquipmentName
nlibera2 Jun 24, 2026
0cd6195
New ResultAnalyticalMethodContext
nlibera2 Jun 24, 2026
2c19478
New ActivityGroupTypes and mapping
nlibera2 Jun 24, 2026
91188b8
Update ActivityTypes in field qc checks
nlibera2 Jun 24, 2026
09ca041
Update chr groups and unit normalizations
nlibera2 Jun 25, 2026
b1acf31
Update locales
nlibera2 Jun 25, 2026
11cc8c6
feat: add new error and two QC warnings
jayakishore709 Jun 25, 2026
c51d8dd
Merge pull request #88 from datastreamapp/Q2-2026
jayakishore709 Jun 26, 2026
6a3108b
feat: convert ActivityGroupType to a custom enum and finalize Q2-2026…
jayakishore709 Jun 26, 2026
7662d82
style: reformat source with prettier (JSON & JS) and add prettier config
jayakishore709 Jun 26, 2026
3918c49
build: enable lint-staged prettier pre-commit hook
jayakishore709 Jun 26, 2026
d2efd95
chore: rc version bump
jayakishore709 Jun 29, 2026
6211435
fix(locales): de-duplicate wrapped value blocks and guard build-locales
jayakishore709 Jul 7, 2026
4e7e234
feat: add CSV-injection and whitespace checks to new free-text ID/nam…
jayakishore709 Jul 8, 2026
b701356
fix(locales): add fr names and drop stale deprecated entries for Acti…
jayakishore709 Jul 8, 2026
4d19b6d
fix: error message quotes
jayakishore709 Jul 9, 2026
24c0203
fix(build): stop stripping errorMessage from shared definitions build
jayakishore709 Jul 9, 2026
f108f8f
chore: update qc warning message
jayakishore709 Jul 9, 2026
0eb0839
chore: update error message
jayakishore709 Jul 10, 2026
598794c
chore: add missing descriptions for ActivityType values
jayakishore709 Jul 10, 2026
d7e3468
chore: rc version bump
jayakishore709 Jul 10, 2026
4596451
chore: release version update
jayakishore709 Jul 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/data-update-wqx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.x
registry-url: "https://npm.pkg.github.com"
cache: 'npm'
- name: Create .npmrc
run: |
echo "//npm.pkg.github.com/:_authToken=${{ github.token }}" >> ~/.npmrc
echo "@gordonfn:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "@datastreamapp:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo ".npmrc" >> .gitignore
- name: Cache npm
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# -
# name: Install dependencies
# run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
uses: ossf/scorecard-action@99c09fe975337306107572b4fdf4db224cf8e2f2 # v2.4.3
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: SARIF file
path: results.sarif
Expand All @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@babb554ede22fd5605947329c4d04d8e7a0b8155 # v3.27.7
uses: github/codeql-action/upload-sarif@7fc6561ed893d15cec696e062df840b21db27eb0 # v4.35.2
with:
sarif_file: results.sarif
8 changes: 4 additions & 4 deletions .github/workflows/sec-sast-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@babb554ede22fd5605947329c4d04d8e7a0b8155 # v2.27.7
uses: github/codeql-action/init@7fc6561ed893d15cec696e062df840b21db27eb0 # v4.35.2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@babb554ede22fd5605947329c4d04d8e7a0b8155 # v2.27.7
uses: github/codeql-action/autobuild@7fc6561ed893d15cec696e062df840b21db27eb0 # v4.35.2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@babb554ede22fd5605947329c4d04d8e7a0b8155 # v2.27.7
uses: github/codeql-action/analyze@7fc6561ed893d15cec696e062df840b21db27eb0 # v4.35.2
with:
category: "/language:${{ matrix.language }}"
6 changes: 3 additions & 3 deletions .github/workflows/sec-sast-sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 5

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@02ef91109b2d589e757aefcfb2854c2783fd7b19 # 4.0.0
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@59db25f34e16620e48ab4bb9e4a5dce155cb5432 # v8.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/sec-secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: TruffleHog Scan
uses: edplato/trufflehog-actions-scan@6cf4d6ab0edcfee4251c8c4d214e3655b84c6cb6 # 0.9m-beta
uses: trufflesecurity/trufflehog@17456f8c7d042d8c82c9a8ca9e937231f9f42e26 # v3.95.2
16 changes: 5 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.x
registry-url: "https://npm.pkg.github.com"
cache: 'npm'
- name: Create .npmrc
run: |
echo "@gordonfn:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "@datastreamapp:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo ".npmrc" >> .gitignore
- name: Cache npm
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
npm install

- name: Build and test
run: |
npm test
npm test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ typings/
.DS_Store

# AI

CLAUDE.md
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build-generated source — owned by the build (build-values / build-locales).
# Keep their JSON.stringify output so Prettier and the build don't fight.
schemas/data/src/values
schemas/data/src/locales
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Changelog

All notable changes to `@datastreamapp/data-schema` are documented in this file.

The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

Targets `3.0.0`. Introduces **Groundwater support** to the DataStream schema.

### Added

- **Groundwater media** — `Groundwater` added to `ActivityMediaName`, plus new Groundwater-related fields covering well identification, aquifer attributes, well construction depths, sample-collection method, and depth-altitude reference:
- `MonitoringLocationVerticalAccuracyMeasure`, `MonitoringLocationVerticalAccuracyUnit`, `MonitoringLocationVerticalCollectionMethod`, `MonitoringLocationVerticalCoordinateReferenceSystem`
- `WellID`, `WellIDContext`, `WellUseType`
- `AquiferCode`, `AquiferUnitName`, `AquiferType`, `AquiferUnitPorosityType`, `LithologyType`
- `BoreholeDepthMeasure` / `Unit`, `WellDepthMeasure` / `Unit`, `WellOpenIntervalTopMeasure` / `Unit`, `WellOpenIntervalBottomMeasure` / `Unit`
- `ActivityDepthAltitudeReferencePoint`, `ActivityDepthAltitudeReferencePointMeasure`, `ActivityDepthAltitudeReferencePointUnit`
- `SampleCondition`, `SampleCollectionMethodID`, `SampleCollectionMethodContext`, `SampleCollectionMethodName`
- **Groundwater conditional logic rules** (errors block submission):
- `GroundwaterFields-ActivityMediaName-Groundwater` — Groundwater-only fields require `ActivityMediaName` of `Groundwater` or `Porewater`.
- `ActivityMediaName-Groundwater-DepthMeasure` — at least one depth measure required.
- `ActivityDepthHeightMeasure-ActivityDepthAltitudeReferencePoint` — reference point required when depth is reported.
- `CharacteristicName-WaterLevel-ActivityDepthAltitudeReferencePoint` — reference point required for water-level observations.
- `MonitoringLocationType-Well-WellUseType` — well/piezometer locations require `WellUseType`.
- `MonitoringLocationType-Well-SampleCondition` — well/piezometer locations require `SampleCondition` (except continuous time series).
- **Groundwater-related enum additions** (forward-compatible):
- `MonitoringLocationType`: `Borehole`, `Dug Well`, `Multilevel Well`, `Nested Well`, `Other-Ground Water`, `Piezometer`, `Seep`, `Sump`, `Well`
- `MonitoringLocationHorizontalCoordinateReferenceSystem`: `OTHER`
- `MonitoringLocationVerticalUnit`: `ft`, `m`
- `SampleCollectionEquipmentName`: `Air line`, `Bailer`, `Hydrasleeve`, `Snap sampler`, `Tubing`, `Water level meter`, `Wetted tape`
- `CharacteristicName`: `Water level elevation`, `Water level in well, depth from a reference point`
- **`EventID` field** — optional free-text identifier (max 255 characters) for grouping observations by field sampling event; available for all data types.
- **Input-safety checks on new free-text ID/name fields** — `EventID`, `WellID`, `AquiferCode`, `SampleCollectionMethodID`, and `SampleCollectionMethodName` now get the same CSV-injection and leading/trailing-whitespace checks as existing text columns like `LaboratorySampleID`.
- **`ResultStatusID` deprecation warning** — new quality-control warning `ResultStatusID-Deprecated`: `Final` and `Accepted` are flagged as no longer recommended (use `Preliminary`, `Provisional`, or `Validated`). The values remain valid in the enum; the warning does not block submission.
- **Q2 2026 WQX update** (`wqx` `3.0.260` → `3.0.276`): new values across `CharacteristicName`, `ActivityType`, `ResultAnalyticalMethodContext`, and `SampleCollectionEquipmentName`.

### Changed

- **`AnalysisStartTime` / `AnalysisStartTimeZone` co-dependency relaxed** — `AnalysisStartTime` without `AnalysisStartTimeZone` is no longer an error; it is now a quality-control warning (`AnalysisStartTime-AnalysisStartTimeZone`). The reverse — `AnalysisStartTimeZone` without `AnalysisStartTime` — remains an error.
- **`ActivityType`, `ResultSampleFraction`, and `ResultValueType` restricted to a curated subset** in the strict flavors (`primary`/`frontend`/`extract`); these now use an allowed-value list (`subset/`) rather than a removal list (`subtraction/`). Values outside the subset stay accepted by the loose `backend` import flavor.

### Breaking

- **New error — `ActivityDepthHeightMeasure` not allowed for depth characteristics** — new conditional logic rule `CharacteristicName-Depth-ActivityDepthHeightMeasure` (blocks submission): when `CharacteristicName` measures depth/height (e.g. `Depth of water column`, `Water level`, `Depth, Secchi disk depth`), `ActivityDepthHeightMeasure` and `ActivityDepthHeightUnit` must not be populated. Records that previously validated with a depth characteristic paired with an activity depth/height will now be rejected.
- **Top-level `$id`s now end in `.json`**, mirroring filesystem paths so JSON Schema URL resolution works without filesystem fallbacks. Consumers must update `$ref`s when upgrading:
- `https://datastream.org/schema/data/backend` → `…/backend.json`
- `…/frontend` → `…/frontend.json`
- `…/primary` → `…/primary.json`
- `…/extract` → `…/extract.json`
- `…/quality-control` → `…/quality-control.json`
- `…/definitions` → `…/definitions.json`
- **All value-file `$id`s renamed** from `.loose.json` / `.strict.json` to `.legacy.json` / `.primary.json` (≈50 files each). Any `$ref` to a `values/*.loose.json` or `values/*.strict.json` URL must be updated.
- **Misplaced `$id`s corrected** (drifted from their filesystem paths):
- `logic/ResultUnit-Salinity.json` (was `quality-control/ResultUnit-Salinity.json`)
- `quality-control/ResultDetectionQuantitationLimitMeasure-Minimum.json` (was `…MinimumMeasure-Minimum.json`)
- **`ActivityGroupType` values replaced** — `ActivityGroupType` is now a DataStream-defined enum (`Continuous Data`, `Field Measure`, `Lab Sample`, `Other`, `Quality Control - Field Measure`, `Quality Control - Lab Sample`, `Unspecified`) instead of the inherited WQX set (`Field Set`, `QC Sample`, `Replicate`, `Subsample`, `Trip` dropped; `Other`/`Unspecified` kept). The published `database/ActivityGroupType.json` value list and the `ActivityType` → `ActivityGroupType` mapping (`lookup/ActivityType-ActivityGroupType.json`) change accordingly. Downstream consumers that store ActivityGroupType values or UUIDs must migrate.
- **`ResultStatusID` value `Rejected` removed** from the allowed (strict) value set — records with `ResultStatusID` of `Rejected` are now rejected by `primary`/`frontend`/`extract` (the value remains in the loose `backend` enum for historical import).
- **New error — `ActivityDepthHeightMeasure` must be negative for certain media** — new conditional logic rule `ActivityMediaName-ActivityDepthHeightMeasure-Maximum` (blocks submission): when `ActivityMediaName` is `Ocean Water`, `Rainwater`, `Stormwater`, `Subsurface Soil/Sediment`, `Surface Water`, or `Surface Water Sediment`, `ActivityDepthHeightMeasure` must be reported as a negative value. For `Groundwater`/`Porewater`, a positive depth instead raises the existing quality-control warning.

## [2.29.0] - 2026-03-12

### Added

- Q1 2026 WQX update: new values across `CharacteristicName`, `CharacteristicGroup`, `ActivityType`, `MeasurementUnit`, `ResultDetectionQuantitationLimitUnit`, `ResultUnit`, `SampleCollectionEquipmentName`.

## [2.0.0] - 2020-07-26

- Rewrite build process to:
- Pull the latest version of WQX values and simplify future updates
- Improve maintainability and audit control
- `MonitoringLocationID` is now required
- `MonitoringLocationWaterbody` is now deprecated
- `MethodSpeciation` has new conditional requirements
- `ActivityMediaName` has new allowed values: `Ambient Air`, `Surface Water Sediment`, `Pore Water`, `Ocean Water`
- Additional checks to prevent the common issues people run into surrounding Dissolved Oxygen, Hardness, and others. See `src/logic/ResultValue-*.json`.

## [1.0.0] - 2019-10-12

Starting from US EPA WQX:

- `ProjectName` → `DatasetName` to be more generic.
- `ActivityDepthHeightMeasure` — added maximum restriction due to only recording water samples.
- `ResultAnalyticalMethodName` — added for readability.
- `ResultAnalyticalMethodID` — removed allowed values.
- `LaboratorySampleID` — added to improve metadata.
- `AnalysisStartTimeZone` — changed format to follow ISO 8601 (e.g. `-0600`).
- `ActivityStartTimeZone` / `ActivityEndTimeZone` — removed because they can be inferred from the location.
- `State` and `County` → `MonitoringLocationRegion` to allow for a broader meaning that can be applied internationally.
2 changes: 1 addition & 1 deletion commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
extends: ['@commitlint/config-conventional'],
}
4 changes: 2 additions & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
'**/*.js': ['prettier --write', 'standard --fix'],
'**/*.json': ['prettier --write']
'**/*.js': ['prettier --write'],
'**/*.json': ['prettier --write'],
// https://medium.com/slalom-build/pre-commit-hooks-for-terraform-9356ee6db882
// '**/*.tf': [
// 'terraform fmt -recursive -write',
Expand Down
Loading