@maschinenlesbar.org/marktstammdatenregister-cli 0.0.1
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/CONTRIBUTING.md +25 -0
- package/LICENSE +661 -0
- package/LICENSING.md +47 -0
- package/README.md +72 -0
- package/dist/src/cli/commands/units.d.ts +4 -0
- package/dist/src/cli/commands/units.d.ts.map +1 -0
- package/dist/src/cli/commands/units.js +64 -0
- package/dist/src/cli/commands/units.js.map +1 -0
- package/dist/src/cli/index.d.ts +3 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +11 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/io.d.ts +12 -0
- package/dist/src/cli/io.d.ts.map +1 -0
- package/dist/src/cli/io.js +7 -0
- package/dist/src/cli/io.js.map +1 -0
- package/dist/src/cli/program.d.ts +7 -0
- package/dist/src/cli/program.d.ts.map +1 -0
- package/dist/src/cli/program.js +54 -0
- package/dist/src/cli/program.js.map +1 -0
- package/dist/src/cli/run.d.ts +3 -0
- package/dist/src/cli/run.d.ts.map +1 -0
- package/dist/src/cli/run.js +85 -0
- package/dist/src/cli/run.js.map +1 -0
- package/dist/src/cli/shared.d.ts +53 -0
- package/dist/src/cli/shared.d.ts.map +1 -0
- package/dist/src/cli/shared.js +96 -0
- package/dist/src/cli/shared.js.map +1 -0
- package/dist/src/client/client.d.ts +35 -0
- package/dist/src/client/client.d.ts.map +1 -0
- package/dist/src/client/client.js +109 -0
- package/dist/src/client/client.js.map +1 -0
- package/dist/src/client/engine.d.ts +55 -0
- package/dist/src/client/engine.d.ts.map +1 -0
- package/dist/src/client/engine.js +114 -0
- package/dist/src/client/engine.js.map +1 -0
- package/dist/src/client/errors.d.ts +42 -0
- package/dist/src/client/errors.d.ts.map +1 -0
- package/dist/src/client/errors.js +52 -0
- package/dist/src/client/errors.js.map +1 -0
- package/dist/src/client/http.d.ts +26 -0
- package/dist/src/client/http.d.ts.map +1 -0
- package/dist/src/client/http.js +80 -0
- package/dist/src/client/http.js.map +1 -0
- package/dist/src/client/index.d.ts +11 -0
- package/dist/src/client/index.d.ts.map +1 -0
- package/dist/src/client/index.js +8 -0
- package/dist/src/client/index.js.map +1 -0
- package/dist/src/client/query.d.ts +9 -0
- package/dist/src/client/query.d.ts.map +1 -0
- package/dist/src/client/query.js +33 -0
- package/dist/src/client/query.js.map +1 -0
- package/dist/src/client/types.d.ts +103 -0
- package/dist/src/client/types.d.ts.map +1 -0
- package/dist/src/client/types.js +4 -0
- package/dist/src/client/types.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Microsoft-AJAX date string as MaStR returns them, e.g. `"/Date(1548979200000)/"`
|
|
3
|
+
* (milliseconds since the Unix epoch, UTC). Use `parseMsDate()` to convert, or the
|
|
4
|
+
* CLI's `--iso-dates` flag to rewrite every such field to ISO-8601.
|
|
5
|
+
*/
|
|
6
|
+
export type MastrDate = string;
|
|
7
|
+
/** The four datasets the public search exposes. */
|
|
8
|
+
export type UnitCategory = "stromerzeugung" | "stromverbrauch" | "gaserzeugung" | "gasverbrauch";
|
|
9
|
+
/**
|
|
10
|
+
* A unit ("Einheit") record. The API returns a very wide row (~90 fields) whose
|
|
11
|
+
* populated columns vary by category (a solar unit carries module fields a gas
|
|
12
|
+
* consumer does not), so only the broadly-useful, category-independent fields are
|
|
13
|
+
* typed; the index signature carries the rest. Natural-person and confidential data
|
|
14
|
+
* are withheld upstream, so operator names may be anonymised (e.g.
|
|
15
|
+
* `"natürliche Person (ABR…)"`).
|
|
16
|
+
*/
|
|
17
|
+
export interface MastrUnit {
|
|
18
|
+
Id?: number;
|
|
19
|
+
/** The unit's MaStR number, e.g. `"SEE984033548619"`. */
|
|
20
|
+
MaStRNummer?: string;
|
|
21
|
+
/** Display name of the unit. */
|
|
22
|
+
EinheitName?: string;
|
|
23
|
+
/** Operating status name, e.g. `"In Betrieb"`. */
|
|
24
|
+
BetriebsStatusName?: string;
|
|
25
|
+
BetriebsStatusId?: number;
|
|
26
|
+
/** Energy carrier name, e.g. `"Solare Strahlungsenergie"`. */
|
|
27
|
+
EnergietraegerName?: string;
|
|
28
|
+
EnergietraegerId?: number;
|
|
29
|
+
/** Gross capacity in kW. */
|
|
30
|
+
Bruttoleistung?: number;
|
|
31
|
+
/** Net rated capacity in kW. */
|
|
32
|
+
Nettonennleistung?: number;
|
|
33
|
+
Bundesland?: string;
|
|
34
|
+
Landkreis?: string;
|
|
35
|
+
Gemeinde?: string;
|
|
36
|
+
Ort?: string;
|
|
37
|
+
Plz?: string;
|
|
38
|
+
/** Latitude (may be withheld for small units). */
|
|
39
|
+
Breitengrad?: number | null;
|
|
40
|
+
/** Longitude (may be withheld for small units). */
|
|
41
|
+
Laengengrad?: number | null;
|
|
42
|
+
/** Commissioning date. */
|
|
43
|
+
InbetriebnahmeDatum?: MastrDate | null;
|
|
44
|
+
/** Registration date in MaStR. */
|
|
45
|
+
EinheitRegistrierungsdatum?: MastrDate;
|
|
46
|
+
/** Final decommissioning date, if any. */
|
|
47
|
+
EndgueltigeStilllegungDatum?: MastrDate | null;
|
|
48
|
+
/** Operator name (often anonymised). */
|
|
49
|
+
AnlagenbetreiberName?: string;
|
|
50
|
+
AnlagenbetreiberMaStRNummer?: string;
|
|
51
|
+
/** Grid operator name(s). */
|
|
52
|
+
NetzbetreiberNamen?: string;
|
|
53
|
+
/** Everything else the row carries (category-specific columns, IDs, ...). */
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
/** The raw response envelope of a data endpoint (Kendo UI Grid shape). */
|
|
57
|
+
export interface UnitResponse {
|
|
58
|
+
Data: MastrUnit[] | null;
|
|
59
|
+
/** Total number of matching units (across all pages). */
|
|
60
|
+
Total: number;
|
|
61
|
+
AggregateResults?: unknown;
|
|
62
|
+
/** A logical error message (e.g. `"Die Anfrage ist Null."`); null on success. */
|
|
63
|
+
Errors?: string | null;
|
|
64
|
+
}
|
|
65
|
+
/** A page of units plus the total match count — what the client returns. */
|
|
66
|
+
export interface UnitPage {
|
|
67
|
+
/** Total matching units across all pages (respects the filter). */
|
|
68
|
+
total: number;
|
|
69
|
+
/** The units on this page. */
|
|
70
|
+
data: MastrUnit[];
|
|
71
|
+
}
|
|
72
|
+
/** Query parameters for a unit search. `group` is always sent empty by the client. */
|
|
73
|
+
export interface UnitQuery {
|
|
74
|
+
/** 1-based page number (default 1). */
|
|
75
|
+
page?: number;
|
|
76
|
+
/** Rows per page. */
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
/** Sort spec: `FieldKey-asc` or `FieldKey-desc`, e.g. `"Bruttoleistung-desc"`. */
|
|
79
|
+
sort?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Filter spec: `FilterName~op~'value'~[and|or]~…` with ops
|
|
82
|
+
* `eq|neq|sw|ct|nct|ew|null|nn`, e.g. `"Energieträger~eq~'2495'"`. Discover the
|
|
83
|
+
* `FilterName`s and dropdown codes via {@link MastrClient.filterColumns}.
|
|
84
|
+
*/
|
|
85
|
+
filter?: string;
|
|
86
|
+
}
|
|
87
|
+
/** A filterable column, from a `GetFilterColumns…` endpoint. */
|
|
88
|
+
export interface FilterColumn {
|
|
89
|
+
/** Human-readable filter name (used as the field in a filter spec). */
|
|
90
|
+
FilterName?: string;
|
|
91
|
+
/** Filter type. */
|
|
92
|
+
Type?: "text" | "number" | "multidropdown" | "date" | "boolean" | string;
|
|
93
|
+
/** For dropdown filters: the allowed `{ Name, Value }` options (Value is the code to send). */
|
|
94
|
+
ListObject?: {
|
|
95
|
+
Name?: string;
|
|
96
|
+
Value?: string;
|
|
97
|
+
}[];
|
|
98
|
+
CustomSelectString?: string | null;
|
|
99
|
+
FilterField?: string | null;
|
|
100
|
+
Position?: number | null;
|
|
101
|
+
OptionalFilterEntity?: unknown;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,mDAAmD;AACnD,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,GAAG,cAAc,CAAC;AAEjG;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4BAA4B;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0BAA0B;IAC1B,mBAAmB,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACvC,kCAAkC;IAClC,0BAA0B,CAAC,EAAE,SAAS,CAAC;IACvC,0CAA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jD,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0CAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,cAAc,mBAAmB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maschinenlesbar.org/marktstammdatenregister-cli",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "TypeScript API client and CLI for the Marktstammdatenregister (MaStR) — the Bundesnetzagentur's register of German electricity & gas market units",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mastr": "dist/src/cli/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/src/index.js",
|
|
10
|
+
"types": "dist/src/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/src/index.d.ts",
|
|
14
|
+
"import": "./dist/src/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/src",
|
|
19
|
+
"LICENSING.md",
|
|
20
|
+
"CONTRIBUTING.md"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
27
|
+
"build": "tsc -p tsconfig.json",
|
|
28
|
+
"prepack": "npm run build",
|
|
29
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
30
|
+
"pretest": "npm run build",
|
|
31
|
+
"test": "node --test dist/test/*.test.js",
|
|
32
|
+
"docs": "typedoc src/index.ts --out out",
|
|
33
|
+
"start": "node dist/src/cli/index.js"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"marktstammdatenregister",
|
|
37
|
+
"mastr",
|
|
38
|
+
"bundesnetzagentur",
|
|
39
|
+
"energie",
|
|
40
|
+
"strom",
|
|
41
|
+
"gas",
|
|
42
|
+
"photovoltaik",
|
|
43
|
+
"windkraft",
|
|
44
|
+
"energy",
|
|
45
|
+
"germany",
|
|
46
|
+
"cli",
|
|
47
|
+
"api-client"
|
|
48
|
+
],
|
|
49
|
+
"author": "Sebastian Schürmann <sebs@2xs.org>",
|
|
50
|
+
"license": "AGPL-3.0-or-later",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/maschinenlesbar-org/marktstammdatenregister-cli.git"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/maschinenlesbar-org/marktstammdatenregister-cli/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/maschinenlesbar-org/marktstammdatenregister-cli#readme",
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"commander": "15.0.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/node": "^22.19.19",
|
|
67
|
+
"typedoc": "0.28.19",
|
|
68
|
+
"typescript": "6.0.3"
|
|
69
|
+
}
|
|
70
|
+
}
|