@respan/cli 0.7.3 → 0.8.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/dist/commands/auth/logout.d.ts +1 -0
- package/dist/commands/auth/status.d.ts +1 -0
- package/dist/commands/auth/status.js +2 -1
- package/dist/commands/config/get.d.ts +1 -0
- package/dist/commands/config/get.js +5 -0
- package/dist/commands/config/list.d.ts +1 -0
- package/dist/commands/config/list.js +9 -2
- package/dist/commands/config/set.d.ts +1 -0
- package/dist/commands/config/set.js +4 -0
- package/dist/commands/datasets/add-spans.d.ts +1 -0
- package/dist/commands/datasets/create-span.d.ts +1 -0
- package/dist/commands/datasets/create.d.ts +1 -0
- package/dist/commands/datasets/get-span.d.ts +1 -0
- package/dist/commands/datasets/get.d.ts +1 -0
- package/dist/commands/datasets/list.d.ts +1 -0
- package/dist/commands/datasets/spans.d.ts +1 -0
- package/dist/commands/datasets/update.d.ts +1 -0
- package/dist/commands/evaluators/create.d.ts +1 -0
- package/dist/commands/evaluators/get.d.ts +1 -0
- package/dist/commands/evaluators/list.d.ts +1 -0
- package/dist/commands/evaluators/run.d.ts +1 -0
- package/dist/commands/evaluators/update.d.ts +1 -0
- package/dist/commands/experiments/create.d.ts +1 -0
- package/dist/commands/experiments/get.d.ts +1 -0
- package/dist/commands/experiments/list.d.ts +1 -0
- package/dist/commands/logs/create.d.ts +1 -0
- package/dist/commands/logs/get.d.ts +1 -0
- package/dist/commands/logs/list.d.ts +1 -0
- package/dist/commands/logs/summary.d.ts +1 -0
- package/dist/commands/prompts/create-version.d.ts +1 -0
- package/dist/commands/prompts/create.d.ts +1 -0
- package/dist/commands/prompts/get.d.ts +1 -0
- package/dist/commands/prompts/list.d.ts +1 -0
- package/dist/commands/prompts/update.d.ts +1 -0
- package/dist/commands/prompts/versions.d.ts +1 -0
- package/dist/commands/setup/doctor.d.ts +17 -0
- package/dist/commands/setup/doctor.js +224 -0
- package/dist/commands/setup/index.d.ts +45 -0
- package/dist/commands/setup/index.js +915 -0
- package/dist/commands/traces/get.d.ts +1 -0
- package/dist/commands/traces/list.d.ts +1 -0
- package/dist/commands/traces/summary.d.ts +1 -0
- package/dist/commands/users/create.d.ts +1 -0
- package/dist/commands/users/get.d.ts +1 -0
- package/dist/commands/users/list.d.ts +1 -0
- package/dist/commands/users/update.d.ts +1 -0
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/whoami.js +3 -2
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.js +16 -7
- package/dist/lib/base-command.d.ts +1 -0
- package/dist/lib/base-command.js +4 -0
- package/oclif.manifest.json +1062 -621
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export default class TracesGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -10,6 +10,7 @@ export default class TracesList extends BaseCommand {
|
|
|
10
10
|
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
filter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
15
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -5,6 +5,7 @@ export default class TracesSummary extends BaseCommand {
|
|
|
5
5
|
'start-time': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
'end-time': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class UsersCreate extends BaseCommand {
|
|
|
7
7
|
email: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
metadata: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,6 +6,7 @@ export default class UsersGet extends BaseCommand {
|
|
|
6
6
|
};
|
|
7
7
|
static flags: {
|
|
8
8
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,6 +7,7 @@ export default class UsersList extends BaseCommand {
|
|
|
7
7
|
'sort-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
environment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
11
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
12
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -9,6 +9,7 @@ export default class UsersUpdate extends BaseCommand {
|
|
|
9
9
|
email: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
metadata: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
13
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
14
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -3,6 +3,7 @@ export default class Whoami extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
7
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
8
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
package/dist/commands/whoami.js
CHANGED
|
@@ -4,16 +4,17 @@ class Whoami extends BaseCommand {
|
|
|
4
4
|
async run() {
|
|
5
5
|
const { flags } = await this.parse(Whoami);
|
|
6
6
|
this.globalFlags = flags;
|
|
7
|
-
const profile = getActiveProfile();
|
|
7
|
+
const profile = flags.profile || getActiveProfile();
|
|
8
8
|
const cred = getCredential(profile);
|
|
9
9
|
if (!cred) {
|
|
10
10
|
this.log('Not authenticated.');
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
+
const auth = this.getAuth();
|
|
13
14
|
this.log(`Profile: ${profile}`);
|
|
14
15
|
if (cred.type === 'jwt')
|
|
15
16
|
this.log(`Email: ${cred.email}`);
|
|
16
|
-
this.log(`Base URL: ${
|
|
17
|
+
this.log(`Base URL: ${auth.baseUrl}`);
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
Whoami.description = 'Show current user information';
|
package/dist/lib/auth.d.ts
CHANGED
package/dist/lib/auth.js
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
import { getCredential } from './config.js';
|
|
2
2
|
export const DEFAULT_BASE_URL = 'https://api.respan.ai';
|
|
3
3
|
export const ENTERPRISE_BASE_URL = 'https://endpoint.respan.ai';
|
|
4
|
+
function normalizeBaseUrl(baseUrl) {
|
|
5
|
+
return (baseUrl || DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
6
|
+
}
|
|
7
|
+
function resolveConfiguredBaseUrl(credential, flagBaseUrl) {
|
|
8
|
+
// Keep the legacy env override for scripted/CI flows while auth login remains
|
|
9
|
+
// the main persistent configuration path for CLI users.
|
|
10
|
+
return normalizeBaseUrl(flagBaseUrl || process.env.RESPAN_API_BASE_URL || credential?.baseUrl || DEFAULT_BASE_URL);
|
|
11
|
+
}
|
|
4
12
|
export function resolveAuth(flags) {
|
|
13
|
+
const credential = getCredential(flags.profile);
|
|
14
|
+
const baseUrl = resolveConfiguredBaseUrl(credential, flags['base-url']);
|
|
5
15
|
if (flags['api-key']) {
|
|
6
|
-
return { apiKey: flags['api-key'], baseUrl
|
|
16
|
+
return { apiKey: flags['api-key'], baseUrl };
|
|
7
17
|
}
|
|
8
18
|
if (process.env.RESPAN_API_KEY) {
|
|
9
19
|
return {
|
|
10
20
|
apiKey: process.env.RESPAN_API_KEY,
|
|
11
|
-
baseUrl
|
|
21
|
+
baseUrl,
|
|
12
22
|
};
|
|
13
23
|
}
|
|
14
|
-
const credential = getCredential(flags.profile);
|
|
15
24
|
if (credential) {
|
|
16
|
-
return credentialToAuth(credential);
|
|
25
|
+
return credentialToAuth(credential, baseUrl);
|
|
17
26
|
}
|
|
18
27
|
throw new Error('Not authenticated. Run `respan auth login` or set RESPAN_API_KEY.');
|
|
19
28
|
}
|
|
20
|
-
function credentialToAuth(cred) {
|
|
29
|
+
function credentialToAuth(cred, baseUrl) {
|
|
21
30
|
if (cred.type === 'api_key') {
|
|
22
|
-
return { apiKey: cred.apiKey, baseUrl
|
|
31
|
+
return { apiKey: cred.apiKey, baseUrl };
|
|
23
32
|
}
|
|
24
33
|
return {
|
|
25
34
|
accessToken: cred.accessToken,
|
|
26
35
|
refreshToken: cred.refreshToken,
|
|
27
|
-
baseUrl
|
|
36
|
+
baseUrl,
|
|
28
37
|
};
|
|
29
38
|
}
|
|
30
39
|
export async function refreshJwtToken(credential) {
|
|
@@ -5,6 +5,7 @@ export type GlobalFlags = Interfaces.InferredFlags<typeof BaseCommand.baseFlags>
|
|
|
5
5
|
export declare abstract class BaseCommand extends Command {
|
|
6
6
|
static baseFlags: {
|
|
7
7
|
'api-key': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
8
|
+
'base-url': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
8
9
|
profile: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
9
10
|
json: Interfaces.BooleanFlag<boolean>;
|
|
10
11
|
csv: Interfaces.BooleanFlag<boolean>;
|
package/dist/lib/base-command.js
CHANGED
|
@@ -7,6 +7,7 @@ export class BaseCommand extends Command {
|
|
|
7
7
|
getAuth() {
|
|
8
8
|
return resolveAuth({
|
|
9
9
|
'api-key': this.globalFlags['api-key'],
|
|
10
|
+
'base-url': this.globalFlags['base-url'],
|
|
10
11
|
profile: this.globalFlags.profile,
|
|
11
12
|
});
|
|
12
13
|
}
|
|
@@ -55,6 +56,9 @@ BaseCommand.baseFlags = {
|
|
|
55
56
|
description: 'API key (env: RESPAN_API_KEY)',
|
|
56
57
|
env: 'RESPAN_API_KEY',
|
|
57
58
|
}),
|
|
59
|
+
'base-url': Flags.string({
|
|
60
|
+
description: 'Temporary API base URL override for this command',
|
|
61
|
+
}),
|
|
58
62
|
profile: Flags.string({
|
|
59
63
|
description: 'Named profile to use',
|
|
60
64
|
}),
|