@gonovus-ai/spec-flow-cli 0.0.0-stage → 0.3.0
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 +805 -2
- package/dist/authentication-command-topology.d.ts +7 -0
- package/dist/authentication-command-topology.js +9 -0
- package/dist/authentication-command-topology.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +52 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +16 -0
- package/dist/cli.js +3355 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-identity.d.ts +12 -0
- package/dist/client-identity.js +29 -0
- package/dist/client-identity.js.map +1 -0
- package/dist/credential-store.d.ts +20 -0
- package/dist/credential-store.js +146 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/default-api-origin.d.ts +1 -0
- package/dist/default-api-origin.js +1 -0
- package/dist/default-api-origin.js.map +1 -0
- package/dist/github-account-commands.d.ts +25 -0
- package/dist/github-account-commands.js +117 -0
- package/dist/github-account-commands.js.map +1 -0
- package/dist/github-connection-commands.d.ts +4 -0
- package/dist/github-connection-commands.js +99 -0
- package/dist/github-connection-commands.js.map +1 -0
- package/dist/github-import-commands.d.ts +3 -0
- package/dist/github-import-commands.js +64 -0
- package/dist/github-import-commands.js.map +1 -0
- package/dist/http-origin.d.ts +13 -0
- package/dist/http-origin.js +39 -0
- package/dist/http-origin.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/dist/node-version.d.ts +1 -0
- package/dist/node-version.js +8 -0
- package/dist/node-version.js.map +1 -0
- package/dist/product-map-commands.d.ts +17 -0
- package/dist/product-map-commands.js +48 -0
- package/dist/product-map-commands.js.map +1 -0
- package/dist/safe-cli-error.d.ts +2 -0
- package/dist/safe-cli-error.js +3 -0
- package/dist/safe-cli-error.js.map +1 -0
- package/dist/user-agent.d.ts +3 -0
- package/dist/user-agent.js +10 -0
- package/dist/user-agent.js.map +1 -0
- package/dist/user-api-key-commands.d.ts +28 -0
- package/dist/user-api-key-commands.js +129 -0
- package/dist/user-api-key-commands.js.map +1 -0
- package/dist/work-item-asset-commands.d.ts +24 -0
- package/dist/work-item-asset-commands.js +217 -0
- package/dist/work-item-asset-commands.js.map +1 -0
- package/dist/work-item-exchange-file.d.ts +4 -0
- package/dist/work-item-exchange-file.js +66 -0
- package/dist/work-item-exchange-file.js.map +1 -0
- package/dist/work-item-resource-link-commands.d.ts +23 -0
- package/dist/work-item-resource-link-commands.js +96 -0
- package/dist/work-item-resource-link-commands.js.map +1 -0
- package/dist/work-item-time-entry-input.d.ts +4 -0
- package/dist/work-item-time-entry-input.js +27 -0
- package/dist/work-item-time-entry-input.js.map +1 -0
- package/package.json +54 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
export interface AuthenticationCommandTopology {
|
|
3
|
+
readonly login: Command;
|
|
4
|
+
readonly logout: Command;
|
|
5
|
+
readonly status: Command;
|
|
6
|
+
}
|
|
7
|
+
export declare function addAuthenticationCommandTopology(program: Command): AuthenticationCommandTopology;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function addAuthenticationCommandTopology(program) {
|
|
2
|
+
const auth = program.command("auth").description("Manage this CLI Session");
|
|
3
|
+
return {
|
|
4
|
+
login: auth.command("login").description("Authorize a new CLI Session"),
|
|
5
|
+
logout: auth.command("logout").description("Revoke the current CLI Session"),
|
|
6
|
+
status: auth.command("status").description("Inspect the current CLI Session"),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=authentication-command-topology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication-command-topology.js","sourceRoot":"","sources":["../src/authentication-command-topology.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,gCAAgC,CAC9C,OAAgB;IAEhB,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;IAC5E,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC;QACvE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,gCAAgC,CAAC;QAC5E,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,iCAAiC,CAAC;KAC9E,CAAC;AACJ,CAAC"}
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import openBrowser from "open";
|
|
3
|
+
import { formatResourceDiagnostic, runCli } from "./cli.js";
|
|
4
|
+
import { createCredentialStore, } from "./credential-store.js";
|
|
5
|
+
import { readServerFlag, unresolvedSpecFlowApiOrigin, } from "./http-origin.js";
|
|
6
|
+
import { assertSupportedNodeVersion } from "./node-version.js";
|
|
7
|
+
const arguments_ = process.argv.slice(2);
|
|
8
|
+
const usesAuthenticationCli = arguments_.includes("auth") ||
|
|
9
|
+
arguments_.includes("--version") ||
|
|
10
|
+
arguments_.includes("-V");
|
|
11
|
+
if (usesAuthenticationCli) {
|
|
12
|
+
const { runSpecFlowCli } = await import("./index.js");
|
|
13
|
+
process.exitCode = await runSpecFlowCli(process.argv);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
try {
|
|
17
|
+
assertSupportedNodeVersion(process.versions.node);
|
|
18
|
+
const credentialStores = new Map();
|
|
19
|
+
const getCredentialStore = (apiKeyId) => {
|
|
20
|
+
const slot = apiKeyId ?? "session";
|
|
21
|
+
const existing = credentialStores.get(slot);
|
|
22
|
+
if (existing !== undefined)
|
|
23
|
+
return existing;
|
|
24
|
+
const credentialStore = createCredentialStore({
|
|
25
|
+
...(apiKeyId === undefined ? {} : { apiKeyId }),
|
|
26
|
+
allowFileFallback: arguments_.includes("--allow-file-fallback"),
|
|
27
|
+
serverOrigin: new URL(unresolvedSpecFlowApiOrigin(readServerFlag(arguments_), process.env.SPEC_FLOW_API_URL)).origin,
|
|
28
|
+
warning: (value) => process.stderr.write(formatResourceDiagnostic(value)),
|
|
29
|
+
});
|
|
30
|
+
credentialStores.set(slot, credentialStore);
|
|
31
|
+
return credentialStore;
|
|
32
|
+
};
|
|
33
|
+
process.exitCode = await runCli(arguments_, {
|
|
34
|
+
credentialStore: {
|
|
35
|
+
read: async () => (await getCredentialStore()).get(),
|
|
36
|
+
readApiKey: async (id) => (await getCredentialStore(id)).get(),
|
|
37
|
+
writeApiKey: async (id, credential) => (await getCredentialStore(id)).set(credential),
|
|
38
|
+
deleteApiKey: async (id) => (await getCredentialStore(id)).delete(),
|
|
39
|
+
},
|
|
40
|
+
environment: process.env,
|
|
41
|
+
fetch: globalThis.fetch,
|
|
42
|
+
open: openBrowser,
|
|
43
|
+
stderr: (value) => process.stderr.write(value),
|
|
44
|
+
stdout: (value) => process.stdout.write(value),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
process.stderr.write(`${error instanceof Error ? error.message : "SpecFlow CLI failed."}\n`);
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,WAAW,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EACL,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAA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,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ResourceCredentialStore {
|
|
2
|
+
readonly read: () => Promise<string | null>;
|
|
3
|
+
readonly readApiKey?: (apiKeyId: string) => Promise<string | null>;
|
|
4
|
+
readonly writeApiKey?: (apiKeyId: string, credential: string) => Promise<void>;
|
|
5
|
+
readonly deleteApiKey?: (apiKeyId: string) => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface CliDependencies {
|
|
8
|
+
readonly open?: (url: string) => Promise<unknown>;
|
|
9
|
+
readonly credentialStore: ResourceCredentialStore;
|
|
10
|
+
readonly environment: Readonly<Record<string, string | undefined>>;
|
|
11
|
+
readonly fetch: (request: Request) => Promise<Response>;
|
|
12
|
+
readonly stderr: (value: string) => void;
|
|
13
|
+
readonly stdout: (value: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function formatResourceDiagnostic(message: string): string;
|
|
16
|
+
export declare function runCli(arguments_: readonly string[], dependencies: CliDependencies): Promise<number>;
|