ahbicht-ts-models
v0.1.8
Published
Model classes for AHBicht
Downloads
490
Readme
ahbicht-ts-models
This repository contains the NPM package ahbicht-ts-models. The package contains the AHBicht data model as TypeScript interfaces.
This repository contains no logic, just types for ease of use in any frontend project.
The files in src are completly autogenerated from JSON Schemas, so they're inherently consistent with the AHBicht Python code. Any push to the Python repos json_schemas directory will create a commit in this repository.
Installation
npm install ahbicht-ts-modelsExample
import axios from "axios";
import {
CategorizedKeyExtract,
ContentEvaluationResult,
AhbExpressionEvaluationResult,
} from "ahbicht-ts-models";
axios
.get("https://ahbicht-backend-prod-fnfnegeqfwcffrhw.germanywestcentral-01.azurewebsites.net/CategorizedKeyExtract/", {
params: {
expression: "Muss ([2]O[3])[902][501]",
},
})
.then(function (ckeResponse) {
let categorizedKeyExtract: CategorizedKeyExtract = ckeResponse.data;
console.log(
"Retrieved categorized keys from AHBicht: ",
categorizedKeyExtract
);
// You can now extract the key of the packages, RCs, FCs and hints from the categorized key extract.
// Then you could build a content evaluation result from it; here we hard code it for simplicity:
let contentEvaluationResult: ContentEvaluationResult = {
requirement_constraints: { "2": "FULFILLED", "3": "UNFULFILLED" },
format_constraints: { "902": { format_constraint_fulfilled: true } },
hints: { "501": "muss 42 nachkommastellen haben" },
};
axios
.post(
"https://ahbicht-backend-prod-fnfnegeqfwcffrhw.germanywestcentral-01.azurewebsites.net/ParseExpression/",
contentEvaluationResult,
{
params: {
expression: "Muss ([2]O[3])[902][501]",
},
}
)
.then(function (cerResponse) {
let ahbExpressionEvaluationResult: AhbExpressionEvaluationResult = cerResponse.data;
console.log(ahbExpressionEvaluationResult);
});
});Release Workflow (CI/CD)
- Update the source code (happens automatically for
/src) - iff there are any new classes, re-export the autogenerated models in index.d.ts
- click on "Draft a new Release" in the right sidebar on Github
- Choose a tag of the form
v1.2.3on themainbranch - Autogenerate Release Notes
- Publish the release. That triggers
npm-publish.yml, which publishes to npm.
Notes on the release workflow:
- The tag is the only source of truth for the version. Do not bump
package.jsonby hand: the workflow derives the version from the tag and overwrites the field before publishing. The value committed inpackage.jsonis therefore stale by design. - A tag of the form
v1.2.3-rc.1is published under thenextdist-tag instead oflatest, regardless of GitHub's "this is a pre-release" checkbox. Build metadata (v1.2.3+build.4) is rejected, because npm cannot represent it. - The release must point at a commit on
main; releases cut from other branches are refused. - The run fails if nothing actually reached npm. That check is new; without it the failure was silent:
v0.1.6was released in December 2025, its run reported success, and npm stayed on0.1.5— sov0.1.6was never published. Do not try to fix that by re-releasingv0.1.6: a release runs the workflow as it existed at the tag's commit, which for that tag predates this one. Cut a new tag instead. - Publishing is authorized by npm trusted publishing via OIDC, not by a token. npm identifies this repository by the workflow filename and the environment (
npm-publish.yml/release), so renaming the workflow file or changing the job'senvironment:breaks publishing until the trusted publisher is updated at the package's access settings.
Detailed Information on the AHBicht Types
Please refer to the official AHBicht docs.
