@agent-os-sdk/client 0.4.9 → 0.5.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/modules/triggers.d.ts +60 -16
- package/dist/modules/triggers.d.ts.map +1 -1
- package/dist/modules/triggers.js +33 -7
- package/package.json +1 -1
- package/src/modules/triggers.ts +84 -21
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Triggers Module -
|
|
2
|
+
* Triggers Module - Wave 5 Aligned
|
|
3
|
+
*
|
|
4
|
+
* Provides typed access to trigger management and execution.
|
|
5
|
+
* Follows Law 065 (Security DTO Bifurcation) - secrets only via dedicated endpoint.
|
|
3
6
|
*/
|
|
4
7
|
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
5
8
|
export interface Trigger {
|
|
@@ -7,29 +10,57 @@ export interface Trigger {
|
|
|
7
10
|
name: string;
|
|
8
11
|
workspace_id: string;
|
|
9
12
|
agent_id: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
config?: Record<string, unknown>;
|
|
13
|
-
webhook_url?: string;
|
|
14
|
-
webhook_secret?: string;
|
|
13
|
+
trigger_type: string;
|
|
14
|
+
template_slug?: string;
|
|
15
15
|
is_active: boolean;
|
|
16
|
+
invoke_url: string;
|
|
17
|
+
request_contract?: TriggerRequestContract;
|
|
16
18
|
created_at: string;
|
|
17
|
-
updated_at: string;
|
|
19
|
+
updated_at: string | null;
|
|
18
20
|
}
|
|
19
|
-
export interface
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
export interface TriggerRequestContract {
|
|
22
|
+
method: string;
|
|
23
|
+
invoke_url: string;
|
|
24
|
+
headers: Record<string, string>;
|
|
25
|
+
signing: SigningContract;
|
|
26
|
+
body_schema?: Record<string, unknown>;
|
|
27
|
+
example_payload?: Record<string, unknown>;
|
|
28
|
+
curl_example: string;
|
|
22
29
|
}
|
|
23
|
-
export interface
|
|
30
|
+
export interface SigningContract {
|
|
31
|
+
algorithm: string;
|
|
32
|
+
signature_header: string;
|
|
33
|
+
timestamp_header: string;
|
|
34
|
+
timestamp_format: string;
|
|
35
|
+
string_to_sign: string;
|
|
36
|
+
signature_format: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TriggerSecretResponse {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
secret_key: string;
|
|
42
|
+
invoke_url: string;
|
|
43
|
+
request_contract?: TriggerRequestContract;
|
|
44
|
+
created_at: string;
|
|
45
|
+
}
|
|
46
|
+
export interface TestTriggerResponse {
|
|
24
47
|
run_id: string;
|
|
48
|
+
trigger_id: string;
|
|
49
|
+
agent_id: string;
|
|
50
|
+
status: string;
|
|
25
51
|
triggered_at: string;
|
|
52
|
+
reused: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface TriggerListResponse {
|
|
55
|
+
items: Trigger[];
|
|
56
|
+
total: number;
|
|
26
57
|
}
|
|
27
58
|
export declare class TriggersModule {
|
|
28
59
|
private client;
|
|
29
60
|
private headers;
|
|
30
61
|
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
31
62
|
/**
|
|
32
|
-
* List all triggers.
|
|
63
|
+
* List all triggers (workspace-scoped).
|
|
33
64
|
*/
|
|
34
65
|
list(params?: {
|
|
35
66
|
workspace_id?: string;
|
|
@@ -38,18 +69,28 @@ export declare class TriggersModule {
|
|
|
38
69
|
limit?: number;
|
|
39
70
|
offset?: number;
|
|
40
71
|
}): Promise<APIResponse<TriggerListResponse>>;
|
|
72
|
+
/**
|
|
73
|
+
* List triggers for a specific agent.
|
|
74
|
+
* Convenience wrapper around list() with agent_id filter.
|
|
75
|
+
*/
|
|
76
|
+
listByAgent(agentId: string): Promise<APIResponse<TriggerListResponse>>;
|
|
41
77
|
/**
|
|
42
78
|
* Get a trigger by ID.
|
|
43
79
|
*/
|
|
44
80
|
get(triggerId: string): Promise<APIResponse<Trigger>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get trigger with secret (Law 065 - Security DTO).
|
|
83
|
+
* Use this when you need the webhook_secret for signing.
|
|
84
|
+
*/
|
|
85
|
+
getSecret(triggerId: string): Promise<APIResponse<TriggerSecretResponse>>;
|
|
45
86
|
/**
|
|
46
87
|
* Create a new trigger.
|
|
47
88
|
*/
|
|
48
89
|
create(body: {
|
|
49
90
|
name: string;
|
|
50
91
|
agent_id: string;
|
|
51
|
-
|
|
52
|
-
|
|
92
|
+
trigger_type: string;
|
|
93
|
+
template_slug?: string;
|
|
53
94
|
config?: Record<string, unknown>;
|
|
54
95
|
}): Promise<APIResponse<Trigger>>;
|
|
55
96
|
/**
|
|
@@ -64,8 +105,11 @@ export declare class TriggersModule {
|
|
|
64
105
|
*/
|
|
65
106
|
delete(triggerId: string): Promise<APIResponse<void>>;
|
|
66
107
|
/**
|
|
67
|
-
*
|
|
108
|
+
* Test a trigger (server-side execution).
|
|
109
|
+
* Avoids client-side secret exposure - server signs the request.
|
|
110
|
+
* @param triggerId - The trigger to test
|
|
111
|
+
* @param payload - Optional JSON payload (wrapped in { payload: ... } per backend contract)
|
|
68
112
|
*/
|
|
69
|
-
|
|
113
|
+
test(triggerId: string, payload?: unknown): Promise<APIResponse<TestTriggerResponse>>;
|
|
70
114
|
}
|
|
71
115
|
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../src/modules/triggers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../src/modules/triggers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM/D,MAAM,WAAW,OAAO;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,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d,SAAS,CAAC,EAAE,OAAO,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAQjC;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAO3D;;;;;OAKG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;CAO9F"}
|
package/dist/modules/triggers.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Triggers Module -
|
|
2
|
+
* Triggers Module - Wave 5 Aligned
|
|
3
|
+
*
|
|
4
|
+
* Provides typed access to trigger management and execution.
|
|
5
|
+
* Follows Law 065 (Security DTO Bifurcation) - secrets only via dedicated endpoint.
|
|
3
6
|
*/
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// Module
|
|
9
|
+
// =============================================================================
|
|
4
10
|
export class TriggersModule {
|
|
5
11
|
client;
|
|
6
12
|
headers;
|
|
@@ -9,7 +15,7 @@ export class TriggersModule {
|
|
|
9
15
|
this.headers = headers;
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
|
-
* List all triggers.
|
|
18
|
+
* List all triggers (workspace-scoped).
|
|
13
19
|
*/
|
|
14
20
|
async list(params) {
|
|
15
21
|
return this.client.GET("/v1/api/triggers", {
|
|
@@ -17,6 +23,13 @@ export class TriggersModule {
|
|
|
17
23
|
headers: this.headers(),
|
|
18
24
|
});
|
|
19
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* List triggers for a specific agent.
|
|
28
|
+
* Convenience wrapper around list() with agent_id filter.
|
|
29
|
+
*/
|
|
30
|
+
async listByAgent(agentId) {
|
|
31
|
+
return this.list({ agent_id: agentId });
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
34
|
* Get a trigger by ID.
|
|
22
35
|
*/
|
|
@@ -26,6 +39,16 @@ export class TriggersModule {
|
|
|
26
39
|
headers: this.headers(),
|
|
27
40
|
});
|
|
28
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Get trigger with secret (Law 065 - Security DTO).
|
|
44
|
+
* Use this when you need the webhook_secret for signing.
|
|
45
|
+
*/
|
|
46
|
+
async getSecret(triggerId) {
|
|
47
|
+
return this.client.GET("/v1/api/triggers/{id}/secret", {
|
|
48
|
+
params: { path: { id: triggerId } },
|
|
49
|
+
headers: this.headers(),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
29
52
|
/**
|
|
30
53
|
* Create a new trigger.
|
|
31
54
|
*/
|
|
@@ -39,7 +62,7 @@ export class TriggersModule {
|
|
|
39
62
|
* Update a trigger.
|
|
40
63
|
*/
|
|
41
64
|
async update(triggerId, body) {
|
|
42
|
-
return this.client.
|
|
65
|
+
return this.client.PATCH("/v1/api/triggers/{id}", {
|
|
43
66
|
params: { path: { id: triggerId } },
|
|
44
67
|
body,
|
|
45
68
|
headers: this.headers(),
|
|
@@ -55,12 +78,15 @@ export class TriggersModule {
|
|
|
55
78
|
});
|
|
56
79
|
}
|
|
57
80
|
/**
|
|
58
|
-
*
|
|
81
|
+
* Test a trigger (server-side execution).
|
|
82
|
+
* Avoids client-side secret exposure - server signs the request.
|
|
83
|
+
* @param triggerId - The trigger to test
|
|
84
|
+
* @param payload - Optional JSON payload (wrapped in { payload: ... } per backend contract)
|
|
59
85
|
*/
|
|
60
|
-
async
|
|
61
|
-
return this.client.POST("/v1/api/triggers/{id}/
|
|
86
|
+
async test(triggerId, payload) {
|
|
87
|
+
return this.client.POST("/v1/api/triggers/{id}/test", {
|
|
62
88
|
params: { path: { id: triggerId } },
|
|
63
|
-
body: { payload },
|
|
89
|
+
body: payload !== undefined ? { payload } : undefined,
|
|
64
90
|
headers: this.headers(),
|
|
65
91
|
});
|
|
66
92
|
}
|
package/package.json
CHANGED
package/src/modules/triggers.ts
CHANGED
|
@@ -1,41 +1,82 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Triggers Module -
|
|
2
|
+
* Triggers Module - Wave 5 Aligned
|
|
3
|
+
*
|
|
4
|
+
* Provides typed access to trigger management and execution.
|
|
5
|
+
* Follows Law 065 (Security DTO Bifurcation) - secrets only via dedicated endpoint.
|
|
3
6
|
*/
|
|
4
7
|
|
|
5
|
-
import type { RawClient, APIResponse
|
|
8
|
+
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Types - Wave 5 Aligned
|
|
12
|
+
// =============================================================================
|
|
8
13
|
|
|
9
14
|
export interface Trigger {
|
|
10
15
|
id: string;
|
|
11
16
|
name: string;
|
|
12
17
|
workspace_id: string;
|
|
13
18
|
agent_id: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
config?: Record<string, unknown>;
|
|
17
|
-
webhook_url?: string;
|
|
18
|
-
webhook_secret?: string;
|
|
19
|
+
trigger_type: string; // String label, not union - frontend treats as display value
|
|
20
|
+
template_slug?: string;
|
|
19
21
|
is_active: boolean;
|
|
22
|
+
invoke_url: string;
|
|
23
|
+
request_contract?: TriggerRequestContract;
|
|
20
24
|
created_at: string;
|
|
21
|
-
updated_at: string;
|
|
25
|
+
updated_at: string | null;
|
|
26
|
+
// Law 065: webhook_secret REMOVED - use getSecret() for sensitive data
|
|
22
27
|
}
|
|
23
28
|
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
export interface TriggerRequestContract {
|
|
30
|
+
method: string;
|
|
31
|
+
invoke_url: string;
|
|
32
|
+
headers: Record<string, string>;
|
|
33
|
+
signing: SigningContract;
|
|
34
|
+
body_schema?: Record<string, unknown>;
|
|
35
|
+
example_payload?: Record<string, unknown>;
|
|
36
|
+
curl_example: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SigningContract {
|
|
40
|
+
algorithm: string;
|
|
41
|
+
signature_header: string;
|
|
42
|
+
timestamp_header: string;
|
|
43
|
+
timestamp_format: string;
|
|
44
|
+
string_to_sign: string;
|
|
45
|
+
signature_format: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface TriggerSecretResponse {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
secret_key: string;
|
|
52
|
+
invoke_url: string;
|
|
53
|
+
request_contract?: TriggerRequestContract;
|
|
54
|
+
created_at: string;
|
|
27
55
|
}
|
|
28
56
|
|
|
29
|
-
export interface
|
|
57
|
+
export interface TestTriggerResponse {
|
|
30
58
|
run_id: string;
|
|
59
|
+
trigger_id: string;
|
|
60
|
+
agent_id: string;
|
|
61
|
+
status: string;
|
|
31
62
|
triggered_at: string;
|
|
63
|
+
reused: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface TriggerListResponse {
|
|
67
|
+
items: Trigger[];
|
|
68
|
+
total: number;
|
|
32
69
|
}
|
|
33
70
|
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// Module
|
|
73
|
+
// =============================================================================
|
|
74
|
+
|
|
34
75
|
export class TriggersModule {
|
|
35
76
|
constructor(private client: RawClient, private headers: () => Record<string, string>) { }
|
|
36
77
|
|
|
37
78
|
/**
|
|
38
|
-
* List all triggers.
|
|
79
|
+
* List all triggers (workspace-scoped).
|
|
39
80
|
*/
|
|
40
81
|
async list(params?: {
|
|
41
82
|
workspace_id?: string;
|
|
@@ -50,6 +91,14 @@ export class TriggersModule {
|
|
|
50
91
|
});
|
|
51
92
|
}
|
|
52
93
|
|
|
94
|
+
/**
|
|
95
|
+
* List triggers for a specific agent.
|
|
96
|
+
* Convenience wrapper around list() with agent_id filter.
|
|
97
|
+
*/
|
|
98
|
+
async listByAgent(agentId: string): Promise<APIResponse<TriggerListResponse>> {
|
|
99
|
+
return this.list({ agent_id: agentId });
|
|
100
|
+
}
|
|
101
|
+
|
|
53
102
|
/**
|
|
54
103
|
* Get a trigger by ID.
|
|
55
104
|
*/
|
|
@@ -60,14 +109,25 @@ export class TriggersModule {
|
|
|
60
109
|
});
|
|
61
110
|
}
|
|
62
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Get trigger with secret (Law 065 - Security DTO).
|
|
114
|
+
* Use this when you need the webhook_secret for signing.
|
|
115
|
+
*/
|
|
116
|
+
async getSecret(triggerId: string): Promise<APIResponse<TriggerSecretResponse>> {
|
|
117
|
+
return this.client.GET<TriggerSecretResponse>("/v1/api/triggers/{id}/secret", {
|
|
118
|
+
params: { path: { id: triggerId } },
|
|
119
|
+
headers: this.headers(),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
63
123
|
/**
|
|
64
124
|
* Create a new trigger.
|
|
65
125
|
*/
|
|
66
126
|
async create(body: {
|
|
67
127
|
name: string;
|
|
68
128
|
agent_id: string;
|
|
69
|
-
|
|
70
|
-
|
|
129
|
+
trigger_type: string;
|
|
130
|
+
template_slug?: string;
|
|
71
131
|
config?: Record<string, unknown>;
|
|
72
132
|
}): Promise<APIResponse<Trigger>> {
|
|
73
133
|
return this.client.POST<Trigger>("/v1/api/triggers", {
|
|
@@ -83,7 +143,7 @@ export class TriggersModule {
|
|
|
83
143
|
name?: string;
|
|
84
144
|
is_active?: boolean;
|
|
85
145
|
}): Promise<APIResponse<Trigger>> {
|
|
86
|
-
return this.client.
|
|
146
|
+
return this.client.PATCH<Trigger>("/v1/api/triggers/{id}", {
|
|
87
147
|
params: { path: { id: triggerId } },
|
|
88
148
|
body,
|
|
89
149
|
headers: this.headers(),
|
|
@@ -101,12 +161,15 @@ export class TriggersModule {
|
|
|
101
161
|
}
|
|
102
162
|
|
|
103
163
|
/**
|
|
104
|
-
*
|
|
164
|
+
* Test a trigger (server-side execution).
|
|
165
|
+
* Avoids client-side secret exposure - server signs the request.
|
|
166
|
+
* @param triggerId - The trigger to test
|
|
167
|
+
* @param payload - Optional JSON payload (wrapped in { payload: ... } per backend contract)
|
|
105
168
|
*/
|
|
106
|
-
async
|
|
107
|
-
return this.client.POST<
|
|
169
|
+
async test(triggerId: string, payload?: unknown): Promise<APIResponse<TestTriggerResponse>> {
|
|
170
|
+
return this.client.POST<TestTriggerResponse>("/v1/api/triggers/{id}/test", {
|
|
108
171
|
params: { path: { id: triggerId } },
|
|
109
|
-
body: { payload },
|
|
172
|
+
body: payload !== undefined ? { payload } : undefined,
|
|
110
173
|
headers: this.headers(),
|
|
111
174
|
});
|
|
112
175
|
}
|