@prudai/cli 0.1.0 → 0.1.2
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 +33 -8
- package/dist/approvals.d.ts +2 -0
- package/dist/bin.js +2173 -1793
- package/dist/config.d.ts +2 -0
- package/dist/context.d.ts +5 -0
- package/dist/core.d.ts +3 -1
- package/dist/discovery.d.ts +3 -1
- package/dist/execute.d.ts +2 -0
- package/dist/index.js +565 -183
- package/dist/openapi.d.ts +7 -0
- package/dist/organization.d.ts +17 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/openapi.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type OrganizationDeclaration } from "./organization";
|
|
1
2
|
/**
|
|
2
3
|
* list/get/create/update/replace/delete are CRUD on a collection; restore and action are task
|
|
3
4
|
* actions (POST on a non-collection path); read is a GET that is neither list nor get.
|
|
@@ -13,6 +14,7 @@ export interface GeneratedParameter {
|
|
|
13
14
|
[key: string]: unknown;
|
|
14
15
|
}
|
|
15
16
|
export interface GeneratedCommand {
|
|
17
|
+
organization?: OrganizationDeclaration;
|
|
16
18
|
product: string;
|
|
17
19
|
/** Command words after the product, e.g. "risks history" or "context". */
|
|
18
20
|
name: string;
|
|
@@ -75,6 +77,11 @@ export interface GenerateOptions {
|
|
|
75
77
|
* the whole product. Writes stay dry-run-gated either way.
|
|
76
78
|
*/
|
|
77
79
|
lenientApproval?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Catalogue mode: commands whose generated name stays ambiguous are left out (all of them, so
|
|
82
|
+
* none silently runs the wrong operation) and reported here, instead of failing the whole product.
|
|
83
|
+
*/
|
|
84
|
+
onAmbiguous?: (name: string, operations: string[]) => void;
|
|
78
85
|
}
|
|
79
86
|
/** Base path of the first server, e.g. "/v1" for https://api.prudai.com/v1; "" when absent. */
|
|
80
87
|
export declare function serverBasePath(spec: unknown): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RunContext } from "./context";
|
|
2
|
+
export interface OrganizationDeclaration {
|
|
3
|
+
header: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface OrganizationSelection {
|
|
7
|
+
id: string;
|
|
8
|
+
product: string;
|
|
9
|
+
source: "flag" | "environment" | "profile" | "login";
|
|
10
|
+
}
|
|
11
|
+
/** A specification may select an environment, never overwrite a transport or approval header. */
|
|
12
|
+
export declare function organizationDeclaration(spec: unknown): OrganizationDeclaration | undefined;
|
|
13
|
+
export declare function organizationChoice(product: string, ctx: Pick<RunContext, "flags" | "env" | "config"> & Partial<Pick<RunContext, "session">>, useFlag?: boolean): OrganizationSelection | undefined;
|
|
14
|
+
/** Called before credentials are requested or an operation is sent. Unsupported overrides fail closed. */
|
|
15
|
+
export declare function organizationHeaders(product: string, declaration: OrganizationDeclaration | undefined, ctx: RunContext): Record<string, string>;
|
|
16
|
+
/** Inspect the server's response before any local envelope can relabel its organisation. */
|
|
17
|
+
export declare function assertOrganizationMatches(body: unknown, selected: OrganizationSelection | undefined, mayHaveWritten?: boolean, contextOperation?: boolean): void;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The one version constant; tests compare it with package.json. */
|
|
2
|
-
export declare const VERSION = "0.1.
|
|
2
|
+
export declare const VERSION = "0.1.2";
|