@prudai/cli 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +190 -2
- package/dist/api.d.ts +3 -0
- package/dist/approvals.d.ts +13 -0
- package/dist/args.d.ts +14 -0
- package/dist/auth.d.ts +36 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +4452 -0
- package/dist/catalog.d.ts +115 -0
- package/dist/cli.d.ts +8 -0
- package/dist/config.d.ts +70 -0
- package/dist/context.d.ts +55 -0
- package/dist/core.d.ts +91 -0
- package/dist/discovery.d.ts +103 -0
- package/dist/exchange.d.ts +25 -0
- package/dist/execute.d.ts +57 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +4622 -0
- package/dist/keycloak.d.ts +54 -0
- package/dist/openapi.d.ts +116 -0
- package/dist/output.d.ts +27 -0
- package/dist/parity.d.ts +16 -0
- package/dist/platform.d.ts +110 -0
- package/dist/products.d.ts +31 -0
- package/dist/projects.d.ts +36 -0
- package/dist/scopes.d.ts +66 -0
- package/dist/session.d.ts +49 -0
- package/dist/skill.d.ts +6 -0
- package/dist/specs/irma.json +1 -0
- package/dist/specs/manifest.json +12 -0
- package/dist/system.d.ts +10 -0
- package/dist/transfer.d.ts +30 -0
- package/dist/trust.d.ts +7 -0
- package/dist/version.d.ts +2 -0
- package/package.json +27 -4
package/dist/system.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Environment = Record<string, string | undefined>;
|
|
2
|
+
/** The executable `binary` resolves to on PATH, or undefined. A name with a path separator is never looked up. */
|
|
3
|
+
export declare function which(binary: string, env?: Environment, platform?: string): string | undefined;
|
|
4
|
+
/** Start `command … url` detached and silent, without waiting for it (opening a browser). */
|
|
5
|
+
export declare function openDetached(command: string[], url: string): void;
|
|
6
|
+
/** Run `path args…` with the terminal attached; resolves to its exit code (128+signal when it was killed). */
|
|
7
|
+
export declare function runInherited(path: string, args: string[]): Promise<number>;
|
|
8
|
+
/** Standard input as UTF-8 text. With `maxChars`, reading stops once more than that has arrived (the result then has maxChars + 1 characters). */
|
|
9
|
+
export declare function readStdinText(maxChars?: number): Promise<string>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type UploadPart } from "./core";
|
|
2
|
+
export interface LocalFile extends UploadPart {
|
|
3
|
+
path: string;
|
|
4
|
+
dev: number;
|
|
5
|
+
ino: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Checks the file before anything is sent: it must exist, be a regular file (not a directory, not a symlink:
|
|
9
|
+
* the same rule the config file follows) and not be empty. Opened with O_NOFOLLOW, so a symlink cannot be
|
|
10
|
+
* swapped in between the check and the upload. Returns the part to send; its `open` re-checks identity and size.
|
|
11
|
+
*/
|
|
12
|
+
export declare function inspectUploadFile(raw: string, field?: string): LocalFile;
|
|
13
|
+
/** sha256 of an inspected file, streamed (a dry run shows it without sending anything). */
|
|
14
|
+
export declare function sha256File(file: LocalFile): Promise<string>;
|
|
15
|
+
export interface Written {
|
|
16
|
+
path: string;
|
|
17
|
+
bytes: number;
|
|
18
|
+
sha256: string;
|
|
19
|
+
}
|
|
20
|
+
/** Where --out points: an absolute path in an existing directory, not stdout, not an existing file unless --force. */
|
|
21
|
+
export declare function checkOutTarget(raw: string, force: boolean): string;
|
|
22
|
+
/** File bytes from a response body to --out. `expectedBytes` is the Content-Length when the server sent one. */
|
|
23
|
+
export declare function writeStreamToFile(out: string, stream: ReadableStream<Uint8Array>, options: {
|
|
24
|
+
force: boolean;
|
|
25
|
+
expectedBytes?: number;
|
|
26
|
+
}): Promise<Written>;
|
|
27
|
+
/** Text (a transcript) to --out, under the same rules as a download. */
|
|
28
|
+
export declare function writeTextToFile(out: string, text: string, force: boolean): Promise<Written>;
|
|
29
|
+
/** Control characters (ESC and friends) in text that a person reads on a terminal are shown as "?", so a document cannot drive the terminal. */
|
|
30
|
+
export declare function terminalSafe(text: string): string;
|
package/dist/trust.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Environment } from "./config";
|
|
2
|
+
/**
|
|
3
|
+
* Credentials and approval links are trusted only on https://*.prudai.com (default port),
|
|
4
|
+
* on localhost/127.0.0.1/[::1], or on an exact origin the user opted into via PRUDAI_ALLOW_ORIGIN.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isTrustedOrigin(raw: string, env?: Environment): boolean;
|
|
7
|
+
export declare function requireTrustedOrigin(raw: string, env?: Environment): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prudai/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Shared Prudai CLI core: device login, OpenAPI commands, dry-run and approvals",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": { "prudai": "dist/bin.js" },
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },
|
|
10
|
+
"files": ["dist/", "README.md", "LICENSE"],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "bun scripts/build.ts",
|
|
13
|
+
"prepack": "bun run build",
|
|
14
|
+
"test": "bun test",
|
|
15
|
+
"test:break": "bun scripts/break-test.ts",
|
|
16
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.node.json",
|
|
17
|
+
"check:source": "bun scripts/check-source.ts",
|
|
18
|
+
"check:pack": "bun scripts/check-pack.ts",
|
|
19
|
+
"e2e": "bun e2e/run.ts",
|
|
20
|
+
"test:e2e": "bun test e2e"
|
|
21
|
+
},
|
|
22
|
+
"engines": { "node": ">=20" },
|
|
23
|
+
"packageManager": "bun@1.3.6",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Prudai B.V.",
|
|
26
|
+
"repository": { "type": "git", "url": "git+https://github.com/Prudai/prudai-cli.git" },
|
|
27
|
+
"dependencies": { "yaml": "2.9.1" },
|
|
28
|
+
"devDependencies": { "@types/bun": "1.3.6", "@types/node": "20.19.43", "typescript": "5.7.2" }
|
|
29
|
+
}
|