@manta-eu/codegen 0.1.3 → 0.1.5
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/README.md +7 -3
- package/dist/cli.js +4 -4
- package/dist/fetch-shapes.d.ts.map +1 -1
- package/dist/fetch-shapes.js +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -6,6 +6,12 @@ repository has neither the files nor Nix, so this package reads the shapes over
|
|
|
6
6
|
|
|
7
7
|
## Use
|
|
8
8
|
|
|
9
|
+
```shell
|
|
10
|
+
pnpm manta-codegen generate --datastore your-datastore --out ./.ldkit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The run targets hiremanta.com production unless flags name another deployment:
|
|
14
|
+
|
|
9
15
|
```shell
|
|
10
16
|
pnpm manta-codegen generate \
|
|
11
17
|
--api-url https://app.example \
|
|
@@ -34,9 +40,7 @@ one login serves both CLIs.
|
|
|
34
40
|
**No secret — a person.** Log in once:
|
|
35
41
|
|
|
36
42
|
```shell
|
|
37
|
-
pnpm manta-codegen login
|
|
38
|
-
--keycloak-url https://keycloak.example \
|
|
39
|
-
--keycloak-realm your-realm
|
|
43
|
+
pnpm manta-codegen login
|
|
40
44
|
```
|
|
41
45
|
|
|
42
46
|
| Command | What it does |
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { cachedToken, ciClientId, clientIdHelp, defaultDeployment, describeError, mintWithClientCredentials, publicClientFrom, registerAuthCommands, userTokenSource, } from "@manta-eu/auth";
|
|
2
3
|
import { Command, Option } from "commander";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
|
-
import { cachedToken, ciClientId, clientIdHelp, describeError, mintWithClientCredentials, publicClientFrom, registerAuthCommands, userTokenSource, } from "@manta-eu/auth";
|
|
5
5
|
import { fetchRealmShapes, sparqlEndpoint } from "./fetch-shapes.js";
|
|
6
6
|
import { generatePackage } from "./generate.js";
|
|
7
7
|
// The secret stays out of the flags: an argument list is readable to every process on the machine.
|
|
@@ -43,10 +43,10 @@ const program = new Command()
|
|
|
43
43
|
program
|
|
44
44
|
.command("generate")
|
|
45
45
|
.description("read the realm's shapes and generate the LDkit schemas, one file per namespace")
|
|
46
|
-
.
|
|
46
|
+
.option("--api-url <url>", "Manta API base URL", defaultDeployment.apiUrl)
|
|
47
47
|
.requiredOption("--datastore <id>", "datastore to read")
|
|
48
|
-
.
|
|
49
|
-
.
|
|
48
|
+
.option("--keycloak-url <url>", "Keycloak base URL", defaultDeployment.keycloakUrl)
|
|
49
|
+
.option("--keycloak-realm <realm>", "Keycloak realm", defaultDeployment.keycloakRealm)
|
|
50
50
|
.option("--client-id <id>", clientIdHelp)
|
|
51
51
|
.option("--scope <scope>", "OAuth scope to ask a service account token for")
|
|
52
52
|
.option("--use-device-code", "if a login is needed, use a one-time code instead of a browser redirect")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-shapes.d.ts","sourceRoot":"","sources":["../src/fetch-shapes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch-shapes.d.ts","sourceRoot":"","sources":["../src/fetch-shapes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAU/E,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,WAAW,EAClB,SAAS,GAAE,SAAiB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAkBtB"}
|
package/dist/fetch-shapes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { countTargetClasses, fetchGraphList, fetchGraphTurtle, findOntologyGraph, shaclGraphIri, vocabBaseFromOntologyGraph, } from "./shapes.js";
|
|
2
1
|
import { withRenewal } from "@manta-eu/auth";
|
|
2
|
+
import { countTargetClasses, fetchGraphList, fetchGraphTurtle, findOntologyGraph, shaclGraphIri, vocabBaseFromOntologyGraph, } from "./shapes.js";
|
|
3
3
|
export function sparqlEndpoint(apiUrl, datastoreId) {
|
|
4
4
|
return `${apiUrl.replace(/\/$/, "")}/d/${encodeURIComponent(datastoreId)}/sparql`;
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manta-eu/codegen",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "CLI that generates LDkit schemas from a realm's SHACL shapes, read from its datastore",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,16 +20,15 @@
|
|
|
20
20
|
"ldkit": "^2.8.0",
|
|
21
21
|
"n3": "^2.7.12",
|
|
22
22
|
"prettier": "^3.8.1",
|
|
23
|
-
"@manta-eu/auth": "0.1.
|
|
23
|
+
"@manta-eu/auth": "0.1.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^24.13.3",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
28
|
-
"@typescript-eslint/parser": "^8.56.1",
|
|
29
27
|
"eslint": "^9.39.2",
|
|
30
28
|
"rimraf": "^6.1.3",
|
|
31
29
|
"typescript": "^5.9.3",
|
|
32
|
-
"vitest": "^4.1.8"
|
|
30
|
+
"vitest": "^4.1.8",
|
|
31
|
+
"@manta-eu/eslint-config": "0.1.0"
|
|
33
32
|
},
|
|
34
33
|
"main": "./dist/index.js",
|
|
35
34
|
"types": "./dist/index.d.ts",
|
|
@@ -43,6 +42,8 @@
|
|
|
43
42
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
44
43
|
"build:lib": "pnpm run build",
|
|
45
44
|
"test": "vitest --run",
|
|
46
|
-
"types": "tsc --noEmit"
|
|
45
|
+
"types": "tsc --noEmit",
|
|
46
|
+
"lint": "eslint .",
|
|
47
|
+
"lint:fix": "eslint . --fix"
|
|
47
48
|
}
|
|
48
49
|
}
|