@manta-eu/upload 0.1.4 → 0.1.6
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 +6 -7
- package/dist/cli.js +4 -4
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -10,13 +10,12 @@ Any other type is stored but not ingested.
|
|
|
10
10
|
## Use
|
|
11
11
|
|
|
12
12
|
```shell
|
|
13
|
-
pnpm manta-upload people.csv orders.parquet
|
|
14
|
-
--api-url https://app.example \
|
|
15
|
-
--datastore your-datastore \
|
|
16
|
-
--keycloak-url https://keycloak.example \
|
|
17
|
-
--keycloak-realm your-realm
|
|
13
|
+
pnpm manta-upload people.csv orders.parquet --datastore your-datastore
|
|
18
14
|
```
|
|
19
15
|
|
|
16
|
+
The upload targets hiremanta.com production unless `--api-url`, `--keycloak-url` and
|
|
17
|
+
`--keycloak-realm` name another deployment, as for `manta-codegen`.
|
|
18
|
+
|
|
20
19
|
For each file the CLI prints the file's IRI, its media type and its size.
|
|
21
20
|
|
|
22
21
|
## Log in
|
|
@@ -25,8 +24,8 @@ Login works as it does for `manta-codegen`: both CLIs register the same commands
|
|
|
25
24
|
`@manta-eu/auth`. `MANTA_CLIENT_SECRET` decides the path.
|
|
26
25
|
|
|
27
26
|
**No secret: a person.** Log in once with `manta-upload login`, which takes the same
|
|
28
|
-
`--keycloak-url` and `--keycloak-realm
|
|
29
|
-
upload is attributed to that person. The login is stored and renewed silently, and it is the same
|
|
27
|
+
`--keycloak-url` and `--keycloak-realm` (both default to hiremanta.com production); `status` and
|
|
28
|
+
`logout` sit next to it. The upload is attributed to that person. The login is stored and renewed silently, and it is the same
|
|
30
29
|
stored login `manta-codegen` uses, so logging in with either CLI serves both. See
|
|
31
30
|
[`@manta-eu/auth`](https://www.npmjs.com/package/@manta-eu/auth) for how the browser login
|
|
32
31
|
works, where the login is stored and how long it lasts.
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { cachedToken, ciClientId, clientIdHelp, describeError, mintWithClientCredentials, publicClientFrom, registerAuthCommands, userTokenSource, } from "@manta-eu/auth";
|
|
2
|
+
import { cachedToken, ciClientId, clientIdHelp, defaultDeployment, describeError, mintWithClientCredentials, publicClientFrom, registerAuthCommands, userTokenSource, } from "@manta-eu/auth";
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import { graphqlClient, graphqlEndpoint } from "./graphql.js";
|
|
5
5
|
import { uploadFile } from "./upload.js";
|
|
@@ -44,10 +44,10 @@ program
|
|
|
44
44
|
.command("upload", { isDefault: true })
|
|
45
45
|
.description("upload the files; the default when no other command is named")
|
|
46
46
|
.argument("<files...>", "files to upload")
|
|
47
|
-
.
|
|
47
|
+
.option("--api-url <url>", "Manta API base URL", defaultDeployment.apiUrl)
|
|
48
48
|
.requiredOption("--datastore <id>", "datastore to upload into")
|
|
49
|
-
.
|
|
50
|
-
.
|
|
49
|
+
.option("--keycloak-url <url>", "Keycloak base URL", defaultDeployment.keycloakUrl)
|
|
50
|
+
.option("--keycloak-realm <realm>", "Keycloak realm", defaultDeployment.keycloakRealm)
|
|
51
51
|
.option("--client-id <id>", clientIdHelp)
|
|
52
52
|
.option("--scope <scope>", "scope to ask a service account token for")
|
|
53
53
|
.option("--use-device-code", "if a login is needed, use a one-time code instead of a browser redirect")
|
package/dist/upload.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,eAAO,MAAM,cAAc,QAAkB,CAAC;AAoB9C,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAExG,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5G,CAAC;AAGF,wBAAsB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAapG;AAED,MAAM,MAAM,KAAK,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAiDlD,wBAAsB,UAAU,CAAC,OAAO,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,GAAG,OAAO,CAAC,YAAY,CAAC,CASxB"}
|
package/dist/upload.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { isTransientStatus } from "@manta-eu/auth";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import { open } from "node:fs/promises";
|
|
3
4
|
import { basename } from "node:path";
|
|
4
|
-
import { isTransientStatus } from "@manta-eu/auth";
|
|
5
5
|
// Must equal agents' uploadPartSize: the API presigns one part per this many bytes.
|
|
6
6
|
export const uploadPartSize = 8 * 1024 * 1024;
|
|
7
7
|
const initiateMutation = `mutation Initiate($input: InitiateUploadInput!) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manta-eu/upload",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "CLI that uploads files to a Manta datastore, where supported types are ingested into its knowledge graph",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,16 +16,15 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"commander": "^15.0.0",
|
|
19
|
-
"@manta-eu/auth": "0.1.
|
|
19
|
+
"@manta-eu/auth": "0.1.6"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^24.13.3",
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
|
24
|
-
"@typescript-eslint/parser": "^8.56.1",
|
|
25
23
|
"eslint": "^9.39.2",
|
|
26
24
|
"rimraf": "^6.1.3",
|
|
27
25
|
"typescript": "^5.9.3",
|
|
28
|
-
"vitest": "^4.1.8"
|
|
26
|
+
"vitest": "^4.1.8",
|
|
27
|
+
"@manta-eu/eslint-config": "0.1.0"
|
|
29
28
|
},
|
|
30
29
|
"main": "./dist/index.js",
|
|
31
30
|
"types": "./dist/index.d.ts",
|
|
@@ -38,6 +37,8 @@
|
|
|
38
37
|
"scripts": {
|
|
39
38
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
40
39
|
"test": "vitest --run",
|
|
41
|
-
"types": "tsc --noEmit"
|
|
40
|
+
"types": "tsc --noEmit",
|
|
41
|
+
"lint": "eslint .",
|
|
42
|
+
"lint:fix": "eslint . --fix"
|
|
42
43
|
}
|
|
43
44
|
}
|