@chanl/eval-sdk 0.4.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/LICENSE +21 -0
- package/dist/client.d.ts +75 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +124 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +51 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/chat.d.ts +32 -0
- package/dist/modules/chat.d.ts.map +1 -0
- package/dist/modules/chat.js +41 -0
- package/dist/modules/chat.js.map +1 -0
- package/dist/modules/datasets.d.ts +114 -0
- package/dist/modules/datasets.d.ts.map +1 -0
- package/dist/modules/datasets.js +93 -0
- package/dist/modules/datasets.js.map +1 -0
- package/dist/modules/executions.d.ts +54 -0
- package/dist/modules/executions.d.ts.map +1 -0
- package/dist/modules/executions.js +119 -0
- package/dist/modules/executions.js.map +1 -0
- package/dist/modules/generation.d.ts +82 -0
- package/dist/modules/generation.d.ts.map +1 -0
- package/dist/modules/generation.js +32 -0
- package/dist/modules/generation.js.map +1 -0
- package/dist/modules/personas.d.ts +43 -0
- package/dist/modules/personas.d.ts.map +1 -0
- package/dist/modules/personas.js +98 -0
- package/dist/modules/personas.js.map +1 -0
- package/dist/modules/prompts.d.ts +17 -0
- package/dist/modules/prompts.d.ts.map +1 -0
- package/dist/modules/prompts.js +48 -0
- package/dist/modules/prompts.js.map +1 -0
- package/dist/modules/scenarios.d.ts +47 -0
- package/dist/modules/scenarios.d.ts.map +1 -0
- package/dist/modules/scenarios.js +100 -0
- package/dist/modules/scenarios.js.map +1 -0
- package/dist/modules/scorecards.d.ts +83 -0
- package/dist/modules/scorecards.d.ts.map +1 -0
- package/dist/modules/scorecards.js +154 -0
- package/dist/modules/scorecards.js.map +1 -0
- package/dist/modules/settings.d.ts +13 -0
- package/dist/modules/settings.d.ts.map +1 -0
- package/dist/modules/settings.js +29 -0
- package/dist/modules/settings.js.map +1 -0
- package/dist/modules/tool-fixtures.d.ts +39 -0
- package/dist/modules/tool-fixtures.d.ts.map +1 -0
- package/dist/modules/tool-fixtures.js +77 -0
- package/dist/modules/tool-fixtures.js.map +1 -0
- package/dist/types.d.ts +583 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenarios Module
|
|
3
|
+
*
|
|
4
|
+
* SDK module for managing test scenarios.
|
|
5
|
+
*/
|
|
6
|
+
import type { AxiosInstance } from 'axios';
|
|
7
|
+
import type { Scenario, CreateScenarioDto, UpdateScenarioDto, ListScenariosParams, ListScenariosResponse, ExecuteScenarioDto, Execution } from '../types';
|
|
8
|
+
export declare class ScenariosModule {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: AxiosInstance);
|
|
11
|
+
/**
|
|
12
|
+
* List scenarios with optional filters.
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ListScenariosParams): Promise<ListScenariosResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Get a scenario by ID.
|
|
17
|
+
*/
|
|
18
|
+
get(id: string): Promise<Scenario>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new scenario.
|
|
21
|
+
*/
|
|
22
|
+
create(dto: CreateScenarioDto): Promise<Scenario>;
|
|
23
|
+
/**
|
|
24
|
+
* Update a scenario.
|
|
25
|
+
*/
|
|
26
|
+
update(id: string, dto: UpdateScenarioDto): Promise<Scenario>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete (archive) a scenario.
|
|
29
|
+
*/
|
|
30
|
+
remove(id: string): Promise<{
|
|
31
|
+
deleted: boolean;
|
|
32
|
+
message: string;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Execute a scenario.
|
|
36
|
+
*/
|
|
37
|
+
execute(id: string, options: ExecuteScenarioDto): Promise<Execution>;
|
|
38
|
+
/**
|
|
39
|
+
* Import a scenario from YAML.
|
|
40
|
+
*/
|
|
41
|
+
importYaml(yaml: string): Promise<Scenario>;
|
|
42
|
+
/**
|
|
43
|
+
* Export a scenario to YAML.
|
|
44
|
+
*/
|
|
45
|
+
exportYaml(id: string): Promise<string>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=scenarios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.d.ts","sourceRoot":"","sources":["../../src/modules/scenarios.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACV,MAAM,UAAU,CAAC;AAElB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAoBxE;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMxC;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMvD;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMnE;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAKxE;;OAEG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IAM1E;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAMjD;;OAEG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAK9C"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scenarios Module
|
|
4
|
+
*
|
|
5
|
+
* SDK module for managing test scenarios.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ScenariosModule = void 0;
|
|
9
|
+
const client_1 = require("../client");
|
|
10
|
+
class ScenariosModule {
|
|
11
|
+
constructor(http) {
|
|
12
|
+
this.http = http;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List scenarios with optional filters.
|
|
16
|
+
*/
|
|
17
|
+
async list(params) {
|
|
18
|
+
const queryParams = {};
|
|
19
|
+
if (params?.status)
|
|
20
|
+
queryParams.status = params.status;
|
|
21
|
+
if (params?.category)
|
|
22
|
+
queryParams.category = params.category;
|
|
23
|
+
if (params?.difficulty)
|
|
24
|
+
queryParams.difficulty = params.difficulty;
|
|
25
|
+
if (params?.tags)
|
|
26
|
+
queryParams.tags = params.tags;
|
|
27
|
+
if (params?.page)
|
|
28
|
+
queryParams.page = params.page;
|
|
29
|
+
if (params?.limit)
|
|
30
|
+
queryParams.limit = params.limit;
|
|
31
|
+
if (params?.sortBy)
|
|
32
|
+
queryParams.sortBy = params.sortBy;
|
|
33
|
+
if (params?.sortOrder)
|
|
34
|
+
queryParams.sortOrder = params.sortOrder;
|
|
35
|
+
const response = await this.http.get('/scenarios', { params: queryParams });
|
|
36
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
37
|
+
return {
|
|
38
|
+
scenarios: data.scenarios || [],
|
|
39
|
+
total: data.total || 0,
|
|
40
|
+
pagination: data.pagination,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get a scenario by ID.
|
|
45
|
+
*/
|
|
46
|
+
async get(id) {
|
|
47
|
+
const response = await this.http.get(`/scenarios/${id}`);
|
|
48
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
49
|
+
return data.scenario || data;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new scenario.
|
|
53
|
+
*/
|
|
54
|
+
async create(dto) {
|
|
55
|
+
const response = await this.http.post('/scenarios', dto);
|
|
56
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
57
|
+
return data.scenario || data;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update a scenario.
|
|
61
|
+
*/
|
|
62
|
+
async update(id, dto) {
|
|
63
|
+
const response = await this.http.patch(`/scenarios/${id}`, dto);
|
|
64
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
65
|
+
return data.scenario || data;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Delete (archive) a scenario.
|
|
69
|
+
*/
|
|
70
|
+
async remove(id) {
|
|
71
|
+
const response = await this.http.delete(`/scenarios/${id}`);
|
|
72
|
+
return (0, client_1.unwrapResponse)(response);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Execute a scenario.
|
|
76
|
+
*/
|
|
77
|
+
async execute(id, options) {
|
|
78
|
+
const response = await this.http.post(`/scenarios/${id}/execute`, options);
|
|
79
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
80
|
+
return data.execution || data;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Import a scenario from YAML.
|
|
84
|
+
*/
|
|
85
|
+
async importYaml(yaml) {
|
|
86
|
+
const response = await this.http.post('/scenarios/import/yaml', { yaml });
|
|
87
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
88
|
+
return data.scenario || data;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Export a scenario to YAML.
|
|
92
|
+
*/
|
|
93
|
+
async exportYaml(id) {
|
|
94
|
+
const response = await this.http.get(`/scenarios/${id}/export/yaml`);
|
|
95
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
96
|
+
return data.yaml || data;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.ScenariosModule = ScenariosModule;
|
|
100
|
+
//# sourceMappingURL=scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.js","sourceRoot":"","sources":["../../src/modules/scenarios.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,sCAA2C;AAW3C,MAAa,eAAe;IAC1B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAA4B;QACrC,MAAM,WAAW,GAA8C,EAAE,CAAC;QAClE,IAAI,MAAM,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACvD,IAAI,MAAM,EAAE,QAAQ;YAAE,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC7D,IAAI,MAAM,EAAE,UAAU;YAAE,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACnE,IAAI,MAAM,EAAE,IAAI;YAAE,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,MAAM,EAAE,IAAI;YAAE,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,MAAM,EAAE,KAAK;YAAE,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACpD,IAAI,MAAM,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC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orecards and evaluation results.
|
|
5
|
+
*/
|
|
6
|
+
import type { AxiosInstance } from 'axios';
|
|
7
|
+
import type { Scorecard, ScorecardCategory, ScorecardCriteria, CreateScorecardDto, UpdateScorecardDto, ListScorecardsParams, ListScorecardsResponse, ScorecardDefaultResponse, ScorecardResult, CreateScorecardResultDto, EvaluateRequest } from '../types';
|
|
8
|
+
export declare class ScorecardsModule {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: AxiosInstance);
|
|
11
|
+
/**
|
|
12
|
+
* List scorecards with optional filters.
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ListScorecardsParams): Promise<ListScorecardsResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Get a scorecard by ID.
|
|
17
|
+
*/
|
|
18
|
+
get(id: string): Promise<Scorecard>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new scorecard.
|
|
21
|
+
*/
|
|
22
|
+
create(dto: CreateScorecardDto): Promise<Scorecard>;
|
|
23
|
+
/**
|
|
24
|
+
* Update a scorecard.
|
|
25
|
+
*/
|
|
26
|
+
update(id: string, dto: UpdateScorecardDto): Promise<Scorecard>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete a scorecard.
|
|
29
|
+
*/
|
|
30
|
+
remove(id: string): Promise<{
|
|
31
|
+
deleted: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the default scorecard.
|
|
35
|
+
*/
|
|
36
|
+
getDefault(): Promise<ScorecardDefaultResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Submit an evaluation result for a scorecard.
|
|
39
|
+
*/
|
|
40
|
+
evaluate(scorecardId: string, request: EvaluateRequest): Promise<ScorecardResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a scorecard result directly.
|
|
43
|
+
*/
|
|
44
|
+
createResult(dto: CreateScorecardResultDto): Promise<ScorecardResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Get a scorecard result by ID.
|
|
47
|
+
*/
|
|
48
|
+
getResult(resultId: string): Promise<ScorecardResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Get scorecard results for an execution (by executionId UUID).
|
|
51
|
+
*/
|
|
52
|
+
getResultsByExecution(executionId: string): Promise<ScorecardResult[]>;
|
|
53
|
+
listCategories(scorecardId: string): Promise<ScorecardCategory[]>;
|
|
54
|
+
createCategory(scorecardId: string, dto: {
|
|
55
|
+
name: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
weight?: number;
|
|
58
|
+
}): Promise<ScorecardCategory>;
|
|
59
|
+
updateCategory(scorecardId: string, categoryId: string, dto: {
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
weight?: number;
|
|
63
|
+
}): Promise<ScorecardCategory>;
|
|
64
|
+
removeCategory(scorecardId: string, categoryId: string): Promise<void>;
|
|
65
|
+
listCriteria(scorecardId: string): Promise<ScorecardCriteria[]>;
|
|
66
|
+
createCriterion(scorecardId: string, dto: {
|
|
67
|
+
categoryId: string;
|
|
68
|
+
name: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
type: string;
|
|
71
|
+
settings: Record<string, unknown>;
|
|
72
|
+
threshold?: Record<string, unknown>;
|
|
73
|
+
}): Promise<ScorecardCriteria>;
|
|
74
|
+
updateCriterion(scorecardId: string, criterionId: string, dto: {
|
|
75
|
+
name?: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
type?: string;
|
|
78
|
+
settings?: Record<string, unknown>;
|
|
79
|
+
threshold?: Record<string, unknown>;
|
|
80
|
+
}): Promise<ScorecardCriteria>;
|
|
81
|
+
removeCriterion(scorecardId: string, criterionId: string): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=scorecards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorecards.d.ts","sourceRoot":"","sources":["../../src/modules/scorecards.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,C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AM,EAAE,OAAO,CAAC,CAAC;KACrC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMxB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/E"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scorecards Module
|
|
4
|
+
*
|
|
5
|
+
* SDK module for managing scorecards and evaluation results.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ScorecardsModule = void 0;
|
|
9
|
+
const client_1 = require("../client");
|
|
10
|
+
class ScorecardsModule {
|
|
11
|
+
constructor(http) {
|
|
12
|
+
this.http = http;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List scorecards with optional filters.
|
|
16
|
+
*/
|
|
17
|
+
async list(params) {
|
|
18
|
+
const queryParams = {};
|
|
19
|
+
if (params?.page)
|
|
20
|
+
queryParams.page = params.page;
|
|
21
|
+
if (params?.limit)
|
|
22
|
+
queryParams.limit = params.limit;
|
|
23
|
+
if (params?.status)
|
|
24
|
+
queryParams.status = params.status;
|
|
25
|
+
const response = await this.http.get('/scorecards', { params: queryParams });
|
|
26
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
27
|
+
return {
|
|
28
|
+
scorecards: data.scorecards || [],
|
|
29
|
+
total: data.total || 0,
|
|
30
|
+
pagination: data.pagination,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get a scorecard by ID.
|
|
35
|
+
*/
|
|
36
|
+
async get(id) {
|
|
37
|
+
const response = await this.http.get(`/scorecards/${id}`);
|
|
38
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
39
|
+
return data.scorecard || data;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a new scorecard.
|
|
43
|
+
*/
|
|
44
|
+
async create(dto) {
|
|
45
|
+
const response = await this.http.post('/scorecards', dto);
|
|
46
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
47
|
+
return data.scorecard || data;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Update a scorecard.
|
|
51
|
+
*/
|
|
52
|
+
async update(id, dto) {
|
|
53
|
+
const response = await this.http.put(`/scorecards/${id}`, dto);
|
|
54
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
55
|
+
return data.scorecard || data;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Delete a scorecard.
|
|
59
|
+
*/
|
|
60
|
+
async remove(id) {
|
|
61
|
+
const response = await this.http.delete(`/scorecards/${id}`);
|
|
62
|
+
return (0, client_1.unwrapResponse)(response);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get the default scorecard.
|
|
66
|
+
*/
|
|
67
|
+
async getDefault() {
|
|
68
|
+
const response = await this.http.get('/scorecards/default');
|
|
69
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
70
|
+
// The controller wraps in { data: { scorecard, source } }
|
|
71
|
+
return data.data || data;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Submit an evaluation result for a scorecard.
|
|
75
|
+
*/
|
|
76
|
+
async evaluate(scorecardId, request) {
|
|
77
|
+
const dto = {
|
|
78
|
+
scorecardId,
|
|
79
|
+
callId: request.callId,
|
|
80
|
+
executionId: request.executionId,
|
|
81
|
+
};
|
|
82
|
+
const response = await this.http.post('/scorecards/results', dto);
|
|
83
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
84
|
+
return data.result || data;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create a scorecard result directly.
|
|
88
|
+
*/
|
|
89
|
+
async createResult(dto) {
|
|
90
|
+
const response = await this.http.post('/scorecards/results', dto);
|
|
91
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
92
|
+
return data.result || data;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get a scorecard result by ID.
|
|
96
|
+
*/
|
|
97
|
+
async getResult(resultId) {
|
|
98
|
+
const response = await this.http.get(`/scorecards/results/${resultId}`);
|
|
99
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
100
|
+
return data.result || data;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get scorecard results for an execution (by executionId UUID).
|
|
104
|
+
*/
|
|
105
|
+
async getResultsByExecution(executionId) {
|
|
106
|
+
const response = await this.http.get(`/scorecards/results/by-execution/${executionId}`);
|
|
107
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
108
|
+
return data.results || [];
|
|
109
|
+
}
|
|
110
|
+
// ===========================================================================
|
|
111
|
+
// CATEGORIES
|
|
112
|
+
// ===========================================================================
|
|
113
|
+
async listCategories(scorecardId) {
|
|
114
|
+
const response = await this.http.get(`/scorecards/${scorecardId}/categories`);
|
|
115
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
116
|
+
return data.categories || [];
|
|
117
|
+
}
|
|
118
|
+
async createCategory(scorecardId, dto) {
|
|
119
|
+
const response = await this.http.post(`/scorecards/${scorecardId}/categories`, dto);
|
|
120
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
121
|
+
return data.category || data;
|
|
122
|
+
}
|
|
123
|
+
async updateCategory(scorecardId, categoryId, dto) {
|
|
124
|
+
const response = await this.http.put(`/scorecards/${scorecardId}/categories/${categoryId}`, dto);
|
|
125
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
126
|
+
return data.category || data;
|
|
127
|
+
}
|
|
128
|
+
async removeCategory(scorecardId, categoryId) {
|
|
129
|
+
await this.http.delete(`/scorecards/${scorecardId}/categories/${categoryId}`);
|
|
130
|
+
}
|
|
131
|
+
// ===========================================================================
|
|
132
|
+
// CRITERIA
|
|
133
|
+
// ===========================================================================
|
|
134
|
+
async listCriteria(scorecardId) {
|
|
135
|
+
const response = await this.http.get(`/scorecards/${scorecardId}/criteria`);
|
|
136
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
137
|
+
return data.criteria || [];
|
|
138
|
+
}
|
|
139
|
+
async createCriterion(scorecardId, dto) {
|
|
140
|
+
const response = await this.http.post(`/scorecards/${scorecardId}/criteria`, dto);
|
|
141
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
142
|
+
return data.criterion || data;
|
|
143
|
+
}
|
|
144
|
+
async updateCriterion(scorecardId, criterionId, dto) {
|
|
145
|
+
const response = await this.http.put(`/scorecards/${scorecardId}/criteria/${criterionId}`, dto);
|
|
146
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
147
|
+
return data.criterion || data;
|
|
148
|
+
}
|
|
149
|
+
async removeCriterion(scorecardId, criterionId) {
|
|
150
|
+
await this.http.delete(`/scorecards/${scorecardId}/criteria/${criterionId}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.ScorecardsModule = ScorecardsModule;
|
|
154
|
+
//# sourceMappingURL=scorecards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorecards.js","sourceRoot":"","sources":["../../src/modules/scorecards.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,sCAA2C;AAe3C,MAAa,gBAAgB;IAC3B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAA6B;QACtC,MAAM,WAAW,GAAoC,EAAE,CAAC;QACxD,IAAI,MAAM,EAAE,IAAI;YAAE,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,MAAM,EAAE,KAAK;YAAE,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACpD,IAAI,MAAM,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAEvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,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AC;CACF;AA3KD,4CA2KC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings Module — singleton settings for centralized provider API keys.
|
|
3
|
+
*/
|
|
4
|
+
import type { AxiosInstance } from 'axios';
|
|
5
|
+
import type { Settings, UpdateSettingsDto } from '../types';
|
|
6
|
+
export declare class SettingsModule {
|
|
7
|
+
private readonly http;
|
|
8
|
+
constructor(http: AxiosInstance);
|
|
9
|
+
get(): Promise<Settings>;
|
|
10
|
+
getApiKey(provider: string): Promise<string>;
|
|
11
|
+
update(dto: UpdateSettingsDto): Promise<Settings>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/modules/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE5D,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAE1C,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;IAMxB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM5C,MAAM,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAKxD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Settings Module — singleton settings for centralized provider API keys.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SettingsModule = void 0;
|
|
7
|
+
const client_1 = require("../client");
|
|
8
|
+
class SettingsModule {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
async get() {
|
|
13
|
+
const response = await this.http.get('/settings');
|
|
14
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
15
|
+
return data.settings || data;
|
|
16
|
+
}
|
|
17
|
+
async getApiKey(provider) {
|
|
18
|
+
const response = await this.http.get(`/settings/keys/${provider}`);
|
|
19
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
20
|
+
return data.apiKey;
|
|
21
|
+
}
|
|
22
|
+
async update(dto) {
|
|
23
|
+
const response = await this.http.put('/settings', dto);
|
|
24
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
25
|
+
return data.settings || data;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.SettingsModule = SettingsModule;
|
|
29
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/modules/settings.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,sCAA2C;AAG3C,MAAa,cAAc;IACzB,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,GAAG;QACP,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAA,uBAAc,EAAM,QAAQ,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;QACnE,MAAM,IAAI,GAAG,IAAA,uBAAc,EAAM,QAAQ,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAsB;QACjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,IAAA,uBAAc,EAAM,QAAQ,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC;IAC/B,CAAC;CACF;AApBD,wCAoBC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Fixtures Module
|
|
3
|
+
*
|
|
4
|
+
* SDK module for managing tool fixtures (mock tools for scenario testing).
|
|
5
|
+
*/
|
|
6
|
+
import type { AxiosInstance } from 'axios';
|
|
7
|
+
import type { ToolFixture, CreateToolFixtureDto, UpdateToolFixtureDto, ListToolFixturesParams, ListToolFixturesResponse, ToolFixtureStats } from '../types';
|
|
8
|
+
export declare class ToolFixturesModule {
|
|
9
|
+
private readonly http;
|
|
10
|
+
constructor(http: AxiosInstance);
|
|
11
|
+
/**
|
|
12
|
+
* List tool fixtures with optional filters.
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ListToolFixturesParams): Promise<ListToolFixturesResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Get tool fixture stats.
|
|
17
|
+
*/
|
|
18
|
+
getStats(): Promise<ToolFixtureStats>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a tool fixture by ID.
|
|
21
|
+
*/
|
|
22
|
+
get(id: string): Promise<ToolFixture>;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new tool fixture.
|
|
25
|
+
*/
|
|
26
|
+
create(dto: CreateToolFixtureDto): Promise<ToolFixture>;
|
|
27
|
+
/**
|
|
28
|
+
* Update a tool fixture.
|
|
29
|
+
*/
|
|
30
|
+
update(id: string, dto: UpdateToolFixtureDto): Promise<ToolFixture>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete a tool fixture.
|
|
33
|
+
*/
|
|
34
|
+
remove(id: string): Promise<{
|
|
35
|
+
deleted: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=tool-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixtures.d.ts","sourceRoot":"","sources":["../../src/modules/tool-fixtures.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAiB9E;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAK3C;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM3C;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7D;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;IAMzE;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAIzE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool Fixtures Module
|
|
4
|
+
*
|
|
5
|
+
* SDK module for managing tool fixtures (mock tools for scenario testing).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ToolFixturesModule = void 0;
|
|
9
|
+
const client_1 = require("../client");
|
|
10
|
+
class ToolFixturesModule {
|
|
11
|
+
constructor(http) {
|
|
12
|
+
this.http = http;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List tool fixtures with optional filters.
|
|
16
|
+
*/
|
|
17
|
+
async list(params) {
|
|
18
|
+
const queryParams = {};
|
|
19
|
+
if (params?.isActive !== undefined)
|
|
20
|
+
queryParams.isActive = params.isActive;
|
|
21
|
+
if (params?.tags)
|
|
22
|
+
queryParams.tags = params.tags;
|
|
23
|
+
if (params?.search)
|
|
24
|
+
queryParams.search = params.search;
|
|
25
|
+
if (params?.page)
|
|
26
|
+
queryParams.page = params.page;
|
|
27
|
+
if (params?.limit)
|
|
28
|
+
queryParams.limit = params.limit;
|
|
29
|
+
const response = await this.http.get('/tool-fixtures', { params: queryParams });
|
|
30
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
31
|
+
return {
|
|
32
|
+
toolFixtures: data.toolFixtures || [],
|
|
33
|
+
total: data.total || 0,
|
|
34
|
+
pagination: data.pagination,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get tool fixture stats.
|
|
39
|
+
*/
|
|
40
|
+
async getStats() {
|
|
41
|
+
const response = await this.http.get('/tool-fixtures/stats');
|
|
42
|
+
return (0, client_1.unwrapResponse)(response);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get a tool fixture by ID.
|
|
46
|
+
*/
|
|
47
|
+
async get(id) {
|
|
48
|
+
const response = await this.http.get(`/tool-fixtures/${id}`);
|
|
49
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
50
|
+
return data.toolFixture || data;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create a new tool fixture.
|
|
54
|
+
*/
|
|
55
|
+
async create(dto) {
|
|
56
|
+
const response = await this.http.post('/tool-fixtures', dto);
|
|
57
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
58
|
+
return data.toolFixture || data;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Update a tool fixture.
|
|
62
|
+
*/
|
|
63
|
+
async update(id, dto) {
|
|
64
|
+
const response = await this.http.patch(`/tool-fixtures/${id}`, dto);
|
|
65
|
+
const data = (0, client_1.unwrapResponse)(response);
|
|
66
|
+
return data.toolFixture || data;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Delete a tool fixture.
|
|
70
|
+
*/
|
|
71
|
+
async remove(id) {
|
|
72
|
+
const response = await this.http.delete(`/tool-fixtures/${id}`);
|
|
73
|
+
return (0, client_1.unwrapResponse)(response);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.ToolFixturesModule = ToolFixturesModule;
|
|
77
|
+
//# sourceMappingURL=tool-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-fixtures.js","sourceRoot":"","sources":["../../src/modules/tool-fixtures.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,sCAA2C;AAU3C,MAAa,kBAAkB;IAC7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAA+B;QACxC,MAAM,WAAW,GAA8C,EAAE,CAAC;QAClE,IAAI,MAAM,EAAE,QAAQ,KAAK,SAAS;YAAE,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC3E,IAAI,MAAM,EAAE,IAAI;YAAE,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACjD,IAAI,MAAM,EAAE,MAAM;YAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACvD,IAAI,MAAM,EAAE,IAAI;YAAE,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,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