@agent-os-sdk/client 0.9.25 → 0.9.27
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/generated/openapi.d.ts +82 -0
- package/dist/generated/openapi.d.ts.map +1 -1
- package/dist/modules/runs.d.ts.map +1 -1
- package/dist/modules/templates.d.ts +23 -0
- package/dist/modules/templates.d.ts.map +1 -1
- package/dist/modules/templates.js +7 -0
- package/package.json +2 -2
- package/src/client/AgentOsClient.ts +0 -294
- package/src/client/HttpRequestBuilder.ts +0 -115
- package/src/client/OperationContext.ts +0 -22
- package/src/client/OperationContextProvider.ts +0 -89
- package/src/client/auth.ts +0 -136
- package/src/client/config.ts +0 -100
- package/src/client/helpers.ts +0 -98
- package/src/client/pagination.ts +0 -218
- package/src/client/raw.ts +0 -609
- package/src/client/retry.ts +0 -150
- package/src/client/sanitize.ts +0 -31
- package/src/client/timeout.ts +0 -59
- package/src/errors/factory.ts +0 -140
- package/src/errors/index.ts +0 -365
- package/src/generated/client.ts +0 -32
- package/src/generated/index.ts +0 -2
- package/src/generated/openapi.ts +0 -12302
- package/src/generated/swagger.json +0 -16851
- package/src/index.ts +0 -131
- package/src/modules/a2a.ts +0 -64
- package/src/modules/agents.ts +0 -604
- package/src/modules/apiTokens.ts +0 -101
- package/src/modules/approvals.ts +0 -151
- package/src/modules/audit.ts +0 -145
- package/src/modules/auth.ts +0 -33
- package/src/modules/catalog.ts +0 -241
- package/src/modules/chatwoot.ts +0 -242
- package/src/modules/checkpoints.ts +0 -87
- package/src/modules/contracts.ts +0 -80
- package/src/modules/credentials.ts +0 -216
- package/src/modules/crons.ts +0 -115
- package/src/modules/datasets.ts +0 -142
- package/src/modules/evaluation.ts +0 -269
- package/src/modules/files.ts +0 -208
- package/src/modules/improvements.ts +0 -71
- package/src/modules/info.ts +0 -143
- package/src/modules/me.ts +0 -74
- package/src/modules/members.ts +0 -199
- package/src/modules/memberships.ts +0 -42
- package/src/modules/metaAgent.ts +0 -131
- package/src/modules/metrics.ts +0 -34
- package/src/modules/observability.ts +0 -28
- package/src/modules/playground.ts +0 -68
- package/src/modules/presets.ts +0 -246
- package/src/modules/prompts.ts +0 -147
- package/src/modules/roles.ts +0 -112
- package/src/modules/runs.ts +0 -878
- package/src/modules/store.ts +0 -65
- package/src/modules/templates.ts +0 -40
- package/src/modules/tenants.ts +0 -79
- package/src/modules/threads.ts +0 -343
- package/src/modules/tools.ts +0 -91
- package/src/modules/traces.ts +0 -133
- package/src/modules/triggers.ts +0 -357
- package/src/modules/usage.ts +0 -117
- package/src/modules/vectorStores.ts +0 -257
- package/src/modules/workspaces.ts +0 -216
- package/src/sse/client.ts +0 -179
package/src/modules/approvals.ts
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Approvals Module - Human-in-the-Loop Native
|
|
3
|
-
*
|
|
4
|
-
* Wave 2.x: Real implementation for HITL workflow.
|
|
5
|
-
* Endpoints: /v1/api/workspaces/{workspaceId}/approvals
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
9
|
-
|
|
10
|
-
// ============================================================================
|
|
11
|
-
// Types
|
|
12
|
-
// ============================================================================
|
|
13
|
-
|
|
14
|
-
export type ApprovalStatus = "pending" | "approved" | "denied" | "expired";
|
|
15
|
-
|
|
16
|
-
export interface Approval {
|
|
17
|
-
id: string;
|
|
18
|
-
run_id: string;
|
|
19
|
-
attempt_id: string;
|
|
20
|
-
policy_name: string;
|
|
21
|
-
reason: string;
|
|
22
|
-
status: ApprovalStatus;
|
|
23
|
-
created_at: string;
|
|
24
|
-
decided_at?: string;
|
|
25
|
-
decided_by_actor?: string;
|
|
26
|
-
payload?: Record<string, unknown>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ApprovalDecision {
|
|
30
|
-
decision: "approve" | "deny";
|
|
31
|
-
comment?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ApprovalListResponse {
|
|
35
|
-
items: Approval[];
|
|
36
|
-
total: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ApprovalStatusResponse {
|
|
40
|
-
id: string;
|
|
41
|
-
status: ApprovalStatus;
|
|
42
|
-
decided_at?: string;
|
|
43
|
-
decided_by_actor?: string;
|
|
44
|
-
decision_comment?: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// ============================================================================
|
|
48
|
-
// Module
|
|
49
|
-
// ============================================================================
|
|
50
|
-
|
|
51
|
-
export class ApprovalsModule {
|
|
52
|
-
constructor(
|
|
53
|
-
private client: RawClient,
|
|
54
|
-
private headers: () => Record<string, string>
|
|
55
|
-
) { }
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* List approvals for a workspace.
|
|
59
|
-
* @param workspaceId - Workspace ID
|
|
60
|
-
* @param params - Filter options
|
|
61
|
-
*/
|
|
62
|
-
async list(workspaceId: string, params?: {
|
|
63
|
-
status?: ApprovalStatus;
|
|
64
|
-
limit?: number;
|
|
65
|
-
}): Promise<APIResponse<ApprovalListResponse>> {
|
|
66
|
-
return this.client.GET<ApprovalListResponse>(
|
|
67
|
-
"/v1/api/workspaces/{workspaceId}/approvals",
|
|
68
|
-
{
|
|
69
|
-
params: {
|
|
70
|
-
path: { workspaceId },
|
|
71
|
-
query: {
|
|
72
|
-
status: params?.status,
|
|
73
|
-
limit: params?.limit ?? 50
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
headers: this.headers(),
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get a specific approval by ID.
|
|
83
|
-
* @param workspaceId - Workspace ID
|
|
84
|
-
* @param approvalId - Approval ID
|
|
85
|
-
*/
|
|
86
|
-
async get(workspaceId: string, approvalId: string): Promise<APIResponse<Approval>> {
|
|
87
|
-
return this.client.GET<Approval>(
|
|
88
|
-
"/v1/api/workspaces/{workspaceId}/approvals/{approvalId}",
|
|
89
|
-
{
|
|
90
|
-
params: {
|
|
91
|
-
path: { workspaceId, approvalId }
|
|
92
|
-
},
|
|
93
|
-
headers: this.headers(),
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Approve an approval request.
|
|
100
|
-
* @param workspaceId - Workspace ID
|
|
101
|
-
* @param approvalId - Approval ID
|
|
102
|
-
* @param comment - Optional reason for approval
|
|
103
|
-
*/
|
|
104
|
-
async approve(workspaceId: string, approvalId: string, comment?: string): Promise<APIResponse<ApprovalStatusResponse>> {
|
|
105
|
-
return this.client.POST<ApprovalStatusResponse>(
|
|
106
|
-
"/v1/api/workspaces/{workspaceId}/approvals/{approvalId}/decision",
|
|
107
|
-
{
|
|
108
|
-
params: {
|
|
109
|
-
path: { workspaceId, approvalId }
|
|
110
|
-
},
|
|
111
|
-
body: {
|
|
112
|
-
decision: "approve",
|
|
113
|
-
comment
|
|
114
|
-
},
|
|
115
|
-
headers: this.headers(),
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Deny an approval request.
|
|
122
|
-
* @param workspaceId - Workspace ID
|
|
123
|
-
* @param approvalId - Approval ID
|
|
124
|
-
* @param comment - Optional reason for denial
|
|
125
|
-
*/
|
|
126
|
-
async deny(workspaceId: string, approvalId: string, comment?: string): Promise<APIResponse<ApprovalStatusResponse>> {
|
|
127
|
-
return this.client.POST<ApprovalStatusResponse>(
|
|
128
|
-
"/v1/api/workspaces/{workspaceId}/approvals/{approvalId}/decision",
|
|
129
|
-
{
|
|
130
|
-
params: {
|
|
131
|
-
path: { workspaceId, approvalId }
|
|
132
|
-
},
|
|
133
|
-
body: {
|
|
134
|
-
decision: "deny",
|
|
135
|
-
comment
|
|
136
|
-
},
|
|
137
|
-
headers: this.headers(),
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Shorthand: List pending approvals for a workspace.
|
|
144
|
-
*/
|
|
145
|
-
async listPending(workspaceId: string, limit = 50): Promise<APIResponse<ApprovalListResponse>> {
|
|
146
|
-
return this.list(workspaceId, { status: "pending", limit });
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Convenience aliases
|
|
150
|
-
reject = this.deny;
|
|
151
|
-
}
|
package/src/modules/audit.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Audit Module - Fully Typed
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
6
|
-
|
|
7
|
-
export interface AuditLogEntry {
|
|
8
|
-
id: string;
|
|
9
|
-
tenant_id: string;
|
|
10
|
-
workspace_id?: string;
|
|
11
|
-
actor: string;
|
|
12
|
-
actor_type: "user" | "system" | "api_token";
|
|
13
|
-
action: string;
|
|
14
|
-
resource: string;
|
|
15
|
-
resource_id?: string;
|
|
16
|
-
metadata?: Record<string, unknown>;
|
|
17
|
-
ip_address?: string;
|
|
18
|
-
user_agent?: string;
|
|
19
|
-
created_at: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface AuditListResponse {
|
|
23
|
-
items: AuditLogEntry[];
|
|
24
|
-
total: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class AuditModule {
|
|
28
|
-
constructor(private client: RawClient, private headers: () => Record<string, string>) { }
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* List audit log entries.
|
|
32
|
-
*/
|
|
33
|
-
async list(params?: {
|
|
34
|
-
actor?: string;
|
|
35
|
-
action?: string;
|
|
36
|
-
resource?: string;
|
|
37
|
-
workspace_id?: string;
|
|
38
|
-
from?: string;
|
|
39
|
-
to?: string;
|
|
40
|
-
limit?: number;
|
|
41
|
-
offset?: number;
|
|
42
|
-
}): Promise<APIResponse<AuditListResponse>> {
|
|
43
|
-
const queryParams: any = { ...params };
|
|
44
|
-
if (params?.limit !== undefined) {
|
|
45
|
-
queryParams.take = params.limit;
|
|
46
|
-
delete queryParams.limit;
|
|
47
|
-
}
|
|
48
|
-
if (params?.offset !== undefined) {
|
|
49
|
-
queryParams.skip = params.offset;
|
|
50
|
-
delete queryParams.offset;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return this.client.GET<AuditListResponse>("/v1/api/audit", {
|
|
54
|
-
params: { query: queryParams },
|
|
55
|
-
headers: this.headers(),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Get a specific audit log entry.
|
|
61
|
-
*/
|
|
62
|
-
async get(auditId: string): Promise<APIResponse<AuditLogEntry>> {
|
|
63
|
-
return this.client.GET<AuditLogEntry>("/v1/api/audit/{id}", {
|
|
64
|
-
params: { path: { id: auditId } },
|
|
65
|
-
headers: this.headers(),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Search audit logs by action pattern.
|
|
71
|
-
*/
|
|
72
|
-
async search(params?: {
|
|
73
|
-
query?: string;
|
|
74
|
-
from?: string;
|
|
75
|
-
to?: string;
|
|
76
|
-
limit?: number;
|
|
77
|
-
offset?: number;
|
|
78
|
-
}): Promise<APIResponse<AuditListResponse>> {
|
|
79
|
-
const queryParams: any = { ...params };
|
|
80
|
-
if (params?.limit !== undefined) {
|
|
81
|
-
queryParams.take = params.limit;
|
|
82
|
-
delete queryParams.limit;
|
|
83
|
-
}
|
|
84
|
-
if (params?.offset !== undefined) {
|
|
85
|
-
queryParams.skip = params.offset;
|
|
86
|
-
delete queryParams.offset;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return this.client.GET<AuditListResponse>("/v1/api/audit/search", {
|
|
90
|
-
params: { query: queryParams },
|
|
91
|
-
headers: this.headers(),
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Iterate through all audit logs with automatic pagination.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```ts
|
|
100
|
-
* // Get all audit logs for a specific action
|
|
101
|
-
* for await (const entry of client.audit.iterate({ action: "agent.created" })) {
|
|
102
|
-
* console.log(entry.actor, entry.action);
|
|
103
|
-
* }
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
async *iterate(
|
|
107
|
-
filters?: {
|
|
108
|
-
actor?: string;
|
|
109
|
-
action?: string;
|
|
110
|
-
resource?: string;
|
|
111
|
-
workspace_id?: string;
|
|
112
|
-
from?: string;
|
|
113
|
-
to?: string;
|
|
114
|
-
},
|
|
115
|
-
options?: { pageSize?: number; maxItems?: number; signal?: AbortSignal }
|
|
116
|
-
): AsyncGenerator<AuditLogEntry, void, unknown> {
|
|
117
|
-
const pageSize = options?.pageSize ?? 100;
|
|
118
|
-
const maxItems = options?.maxItems ?? Infinity;
|
|
119
|
-
let offset = 0;
|
|
120
|
-
let yielded = 0;
|
|
121
|
-
let hasMore = true;
|
|
122
|
-
|
|
123
|
-
while (hasMore && yielded < maxItems) {
|
|
124
|
-
if (options?.signal?.aborted) return;
|
|
125
|
-
|
|
126
|
-
const response = await this.list({
|
|
127
|
-
...filters,
|
|
128
|
-
limit: Math.min(pageSize, maxItems - yielded),
|
|
129
|
-
offset,
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
if (response.error) throw response.error;
|
|
133
|
-
const data = response.data!;
|
|
134
|
-
|
|
135
|
-
for (const entry of data.items) {
|
|
136
|
-
if (yielded >= maxItems) return;
|
|
137
|
-
yield entry;
|
|
138
|
-
yielded++;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
offset += data.items.length;
|
|
142
|
-
hasMore = offset < data.total && data.items.length > 0;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
package/src/modules/auth.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth Module - Bootstrap & Identity
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
6
|
-
|
|
7
|
-
export interface BootstrapResponse {
|
|
8
|
-
status: "existing" | "created";
|
|
9
|
-
tenant_id: string;
|
|
10
|
-
tenant_name?: string;
|
|
11
|
-
tenant_slug?: string;
|
|
12
|
-
workspace_id?: string;
|
|
13
|
-
workspace_name?: string;
|
|
14
|
-
workspace_slug?: string;
|
|
15
|
-
member_id: string;
|
|
16
|
-
role_name?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class AuthModule {
|
|
20
|
-
constructor(private client: RawClient, private headers: () => Record<string, string>) { }
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Bootstrap the authenticated user with a default tenant, workspace, and roles.
|
|
24
|
-
* Idempotent: returns existing resources if already provisioned.
|
|
25
|
-
*
|
|
26
|
-
* @returns 200 if already bootstrapped, 201 if newly created.
|
|
27
|
-
*/
|
|
28
|
-
async bootstrap(): Promise<APIResponse<BootstrapResponse>> {
|
|
29
|
-
return this.client.POST<BootstrapResponse>("/v1/api/auth/bootstrap", {
|
|
30
|
-
headers: this.headers(),
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
package/src/modules/catalog.ts
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Catalog Module - Canonical Catalog Access
|
|
3
|
-
*
|
|
4
|
-
* Provides access to versioned catalogs:
|
|
5
|
-
* - Node Catalog (node types, config schemas)
|
|
6
|
-
* - Tool Catalog (tool definitions)
|
|
7
|
-
* - Trigger Templates (trigger configurations)
|
|
8
|
-
*
|
|
9
|
-
* All responses include:
|
|
10
|
-
* - ETag header for caching
|
|
11
|
-
* - X-Content-Hash header for integrity verification
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const client = new AgentOsClient({ ... })
|
|
16
|
-
*
|
|
17
|
-
* // Get all catalogs
|
|
18
|
-
* const nodes = await unwrap(client.catalog.getNodes())
|
|
19
|
-
* const tools = await unwrap(client.catalog.getTools())
|
|
20
|
-
* const triggers = await unwrap(client.catalog.getTriggers())
|
|
21
|
-
*
|
|
22
|
-
* // Use returned metadata for caching
|
|
23
|
-
* console.log(nodes.etag, nodes.contentHash)
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
28
|
-
|
|
29
|
-
export interface CatalogVersions {
|
|
30
|
-
nodes: string;
|
|
31
|
-
tools: string;
|
|
32
|
-
triggers: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface CatalogMetadata {
|
|
36
|
-
version: string;
|
|
37
|
-
etag?: string;
|
|
38
|
-
contentHash?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface PaletteCatalogResponse extends CatalogMetadata {
|
|
42
|
-
nodes: NodeDefinition[];
|
|
43
|
-
tools: ToolDefinition[];
|
|
44
|
-
triggers: TriggerTemplate[];
|
|
45
|
-
presets: PresetDefinition[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface NodeCatalogResponse extends CatalogMetadata {
|
|
49
|
-
nodes: NodeDefinition[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface NodeDefinition {
|
|
53
|
-
capability_ref: string;
|
|
54
|
-
capability_version: string;
|
|
55
|
-
execution_binding: string;
|
|
56
|
-
required_credentials: string[];
|
|
57
|
-
kind: string; // visual hint only
|
|
58
|
-
title: string;
|
|
59
|
-
category: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
inputs?: string[];
|
|
62
|
-
outputs?: string[];
|
|
63
|
-
config_schema?: Record<string, unknown>;
|
|
64
|
-
default_config?: Record<string, unknown>;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface ToolCatalogResponse extends CatalogMetadata {
|
|
68
|
-
tools: ToolDefinition[];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface ToolDefinition {
|
|
72
|
-
capability_ref: string;
|
|
73
|
-
capability_version: string;
|
|
74
|
-
execution_binding: string;
|
|
75
|
-
slug?: string; // compatibility/display only
|
|
76
|
-
required_credentials: string[];
|
|
77
|
-
name: string;
|
|
78
|
-
description?: string;
|
|
79
|
-
type: string;
|
|
80
|
-
version?: number;
|
|
81
|
-
input_schema?: Record<string, unknown>;
|
|
82
|
-
output_schema?: Record<string, unknown>;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface TriggerCatalogResponse extends CatalogMetadata {
|
|
86
|
-
templates: TriggerTemplate[];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface TriggerTemplate {
|
|
90
|
-
capability_ref: string;
|
|
91
|
-
capability_version: string;
|
|
92
|
-
slug?: string; // compatibility/display only
|
|
93
|
-
kind: string; // visual hint only
|
|
94
|
-
description?: string;
|
|
95
|
-
run_input_schema?: Record<string, unknown>;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface PresetCatalogResponse extends CatalogMetadata {
|
|
99
|
-
presets: PresetDefinition[];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export interface PresetDefinition {
|
|
103
|
-
preset_slug: string;
|
|
104
|
-
base_capability_ref: string;
|
|
105
|
-
title: string;
|
|
106
|
-
description?: string;
|
|
107
|
-
default_config?: Record<string, unknown>;
|
|
108
|
-
locked_fields?: string[];
|
|
109
|
-
ui_variant?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export class CatalogModule {
|
|
113
|
-
constructor(private client: RawClient) { }
|
|
114
|
-
|
|
115
|
-
async getPalette(version: string = "1"): Promise<APIResponse<PaletteCatalogResponse>> {
|
|
116
|
-
const [nodesRes, toolsRes, triggersRes, presetsRes] = await Promise.all([
|
|
117
|
-
this.getNodes(version),
|
|
118
|
-
this.getTools(version),
|
|
119
|
-
this.getTriggers(version),
|
|
120
|
-
this.getPresets(version),
|
|
121
|
-
]);
|
|
122
|
-
|
|
123
|
-
const fallbackResponse =
|
|
124
|
-
nodesRes.response || toolsRes.response || triggersRes.response || presetsRes.response;
|
|
125
|
-
|
|
126
|
-
if (nodesRes.error || toolsRes.error || triggersRes.error || presetsRes.error) {
|
|
127
|
-
return {
|
|
128
|
-
data: undefined,
|
|
129
|
-
error:
|
|
130
|
-
nodesRes.error ||
|
|
131
|
-
toolsRes.error ||
|
|
132
|
-
triggersRes.error ||
|
|
133
|
-
presetsRes.error || { code: "NOT_FOUND", message: "Palette catalog is unavailable" },
|
|
134
|
-
response: fallbackResponse,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return {
|
|
139
|
-
data: {
|
|
140
|
-
version,
|
|
141
|
-
nodes: nodesRes.data?.nodes || [],
|
|
142
|
-
tools: toolsRes.data?.tools || [],
|
|
143
|
-
triggers: triggersRes.data?.templates || [],
|
|
144
|
-
presets: presetsRes.data?.presets || [],
|
|
145
|
-
},
|
|
146
|
-
error: undefined,
|
|
147
|
-
response: fallbackResponse,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Get the Node Catalog.
|
|
153
|
-
* Returns node types with their configuration schemas.
|
|
154
|
-
*/
|
|
155
|
-
async getNodes(version: string = "1"): Promise<APIResponse<NodeCatalogResponse>> {
|
|
156
|
-
const response = await this.client.GET<NodeCatalogResponse>("/v1/api/catalog/nodes", {
|
|
157
|
-
params: { query: { version } },
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// Extract headers for metadata (if available from raw response)
|
|
161
|
-
return response;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Get the Tool Catalog.
|
|
166
|
-
* Returns tool definitions with input/output schemas.
|
|
167
|
-
*/
|
|
168
|
-
async getTools(version: string = "1"): Promise<APIResponse<ToolCatalogResponse>> {
|
|
169
|
-
const response = await this.client.GET<ToolCatalogResponse>("/v1/api/tools/definitions", {
|
|
170
|
-
params: { query: { version } },
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
return response;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Get the Trigger Templates Catalog.
|
|
178
|
-
* Returns trigger configurations and input schemas.
|
|
179
|
-
*/
|
|
180
|
-
async getTriggers(version: string = "1"): Promise<APIResponse<TriggerCatalogResponse>> {
|
|
181
|
-
const response = await this.client.GET<TriggerCatalogResponse>("/v1/api/triggers/templates", {
|
|
182
|
-
params: { query: { version } },
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
return response;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Get the Node Presets Catalog.
|
|
190
|
-
* Returns pre-configured node variants with locked fields.
|
|
191
|
-
*/
|
|
192
|
-
async getPresets(version: string = "1"): Promise<APIResponse<PresetCatalogResponse>> {
|
|
193
|
-
const response = await this.client.GET<PresetCatalogResponse>("/v1/api/catalog/presets", {
|
|
194
|
-
params: { query: { version } },
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
return response;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Get all catalogs at once for convenience.
|
|
202
|
-
* Returns combined catalog data with versions.
|
|
203
|
-
*/
|
|
204
|
-
async getAll(version: string = "1"): Promise<{
|
|
205
|
-
data?: {
|
|
206
|
-
nodes: NodeCatalogResponse;
|
|
207
|
-
tools: ToolCatalogResponse;
|
|
208
|
-
triggers: TriggerCatalogResponse;
|
|
209
|
-
presets: PresetCatalogResponse;
|
|
210
|
-
catalog_versions: CatalogVersions;
|
|
211
|
-
};
|
|
212
|
-
error?: { code: string; message: string; details?: unknown };
|
|
213
|
-
}> {
|
|
214
|
-
const [nodesRes, toolsRes, triggersRes, presetsRes] = await Promise.all([
|
|
215
|
-
this.getNodes(version),
|
|
216
|
-
this.getTools(version),
|
|
217
|
-
this.getTriggers(version),
|
|
218
|
-
this.getPresets(version),
|
|
219
|
-
]);
|
|
220
|
-
|
|
221
|
-
if (nodesRes.error) return { data: undefined, error: nodesRes.error };
|
|
222
|
-
if (toolsRes.error) return { data: undefined, error: toolsRes.error };
|
|
223
|
-
if (triggersRes.error) return { data: undefined, error: triggersRes.error };
|
|
224
|
-
if (presetsRes.error) return { data: undefined, error: presetsRes.error };
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
data: {
|
|
228
|
-
nodes: nodesRes.data!,
|
|
229
|
-
tools: toolsRes.data!,
|
|
230
|
-
triggers: triggersRes.data!,
|
|
231
|
-
presets: presetsRes.data!,
|
|
232
|
-
catalog_versions: {
|
|
233
|
-
nodes: version,
|
|
234
|
-
tools: version,
|
|
235
|
-
triggers: version,
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
error: undefined,
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
}
|