@honcho-ai/core 1.2.0 → 1.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/CHANGELOG.md +48 -0
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +4 -5
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/workspaces/index.d.ts +4 -3
- package/resources/workspaces/index.d.ts.map +1 -1
- package/resources/workspaces/index.js +4 -1
- package/resources/workspaces/index.js.map +1 -1
- package/resources/workspaces/index.mjs +1 -0
- package/resources/workspaces/index.mjs.map +1 -1
- package/resources/workspaces/peers/index.d.ts +1 -1
- package/resources/workspaces/peers/index.d.ts.map +1 -1
- package/resources/workspaces/peers/index.js.map +1 -1
- package/resources/workspaces/peers/index.mjs.map +1 -1
- package/resources/workspaces/peers/peers.d.ts +23 -11
- package/resources/workspaces/peers/peers.d.ts.map +1 -1
- package/resources/workspaces/peers/peers.js +4 -12
- package/resources/workspaces/peers/peers.js.map +1 -1
- package/resources/workspaces/peers/peers.mjs +3 -11
- package/resources/workspaces/peers/peers.mjs.map +1 -1
- package/resources/workspaces/peers/sessions.d.ts +1 -1
- package/resources/workspaces/peers/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/index.d.ts +2 -2
- package/resources/workspaces/sessions/index.d.ts.map +1 -1
- package/resources/workspaces/sessions/index.js.map +1 -1
- package/resources/workspaces/sessions/index.mjs.map +1 -1
- package/resources/workspaces/sessions/messages.d.ts +3 -2
- package/resources/workspaces/sessions/messages.d.ts.map +1 -1
- package/resources/workspaces/sessions/messages.js.map +1 -1
- package/resources/workspaces/sessions/messages.mjs.map +1 -1
- package/resources/workspaces/sessions/peers.d.ts +5 -33
- package/resources/workspaces/sessions/peers.d.ts.map +1 -1
- package/resources/workspaces/sessions/peers.js.map +1 -1
- package/resources/workspaces/sessions/peers.mjs.map +1 -1
- package/resources/workspaces/sessions/sessions.d.ts +128 -35
- package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/sessions.js +16 -7
- package/resources/workspaces/sessions/sessions.js.map +1 -1
- package/resources/workspaces/sessions/sessions.mjs +17 -8
- package/resources/workspaces/sessions/sessions.mjs.map +1 -1
- package/resources/workspaces/webhooks.d.ts +41 -0
- package/resources/workspaces/webhooks.d.ts.map +1 -0
- package/resources/workspaces/webhooks.js +42 -0
- package/resources/workspaces/webhooks.js.map +1 -0
- package/resources/workspaces/webhooks.mjs +37 -0
- package/resources/workspaces/webhooks.mjs.map +1 -0
- package/resources/workspaces/workspaces.d.ts +42 -13
- package/resources/workspaces/workspaces.d.ts.map +1 -1
- package/resources/workspaces/workspaces.js +9 -12
- package/resources/workspaces/workspaces.js.map +1 -1
- package/resources/workspaces/workspaces.mjs +8 -11
- package/resources/workspaces/workspaces.mjs.map +1 -1
- package/src/index.ts +4 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/workspaces/index.ts +15 -0
- package/src/resources/workspaces/peers/index.ts +2 -0
- package/src/resources/workspaces/peers/peers.ts +31 -19
- package/src/resources/workspaces/peers/sessions.ts +1 -1
- package/src/resources/workspaces/sessions/index.ts +3 -1
- package/src/resources/workspaces/sessions/messages.ts +4 -2
- package/src/resources/workspaces/sessions/peers.ts +5 -37
- package/src/resources/workspaces/sessions/sessions.ts +162 -47
- package/src/resources/workspaces/webhooks.ts +94 -0
- package/src/resources/workspaces/workspaces.ts +70 -17
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -61,7 +61,7 @@ export class Peers extends APIResource {
|
|
|
61
61
|
sessionId: string,
|
|
62
62
|
peerId: string,
|
|
63
63
|
options?: Core.RequestOptions,
|
|
64
|
-
): Core.APIPromise<
|
|
64
|
+
): Core.APIPromise<SessionPeerConfig> {
|
|
65
65
|
return this._client.get(
|
|
66
66
|
`/v2/workspaces/${workspaceId}/sessions/${sessionId}/peers/${peerId}/config`,
|
|
67
67
|
options,
|
|
@@ -115,7 +115,7 @@ export class Peers extends APIResource {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export interface
|
|
118
|
+
export interface SessionPeerConfig {
|
|
119
119
|
/**
|
|
120
120
|
* Whether other peers in this session should try to form a session-level
|
|
121
121
|
* theory-of-mind representation of this peer
|
|
@@ -133,43 +133,11 @@ export type PeerSetConfigResponse = unknown;
|
|
|
133
133
|
|
|
134
134
|
export interface PeerListParams extends PageParams {}
|
|
135
135
|
|
|
136
|
-
export type PeerAddParams = { [key: string]:
|
|
137
|
-
|
|
138
|
-
export namespace PeerAddParams {
|
|
139
|
-
export interface Body {
|
|
140
|
-
/**
|
|
141
|
-
* Whether other peers in this session should try to form a session-level
|
|
142
|
-
* theory-of-mind representation of this peer
|
|
143
|
-
*/
|
|
144
|
-
observe_me?: boolean | null;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Whether this peer should form a session-level theory-of-mind representation of
|
|
148
|
-
* other peers in the session
|
|
149
|
-
*/
|
|
150
|
-
observe_others?: boolean;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
136
|
+
export type PeerAddParams = { [key: string]: SessionPeerConfig };
|
|
153
137
|
|
|
154
138
|
export type PeerRemoveParams = Array<string>;
|
|
155
139
|
|
|
156
|
-
export type PeerSetParams = { [key: string]:
|
|
157
|
-
|
|
158
|
-
export namespace PeerSetParams {
|
|
159
|
-
export interface Body {
|
|
160
|
-
/**
|
|
161
|
-
* Whether other peers in this session should try to form a session-level
|
|
162
|
-
* theory-of-mind representation of this peer
|
|
163
|
-
*/
|
|
164
|
-
observe_me?: boolean | null;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Whether this peer should form a session-level theory-of-mind representation of
|
|
168
|
-
* other peers in the session
|
|
169
|
-
*/
|
|
170
|
-
observe_others?: boolean;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
140
|
+
export type PeerSetParams = { [key: string]: SessionPeerConfig };
|
|
173
141
|
|
|
174
142
|
export interface PeerSetConfigParams {
|
|
175
143
|
/**
|
|
@@ -187,7 +155,7 @@ export interface PeerSetConfigParams {
|
|
|
187
155
|
|
|
188
156
|
export declare namespace Peers {
|
|
189
157
|
export {
|
|
190
|
-
type
|
|
158
|
+
type SessionPeerConfig as SessionPeerConfig,
|
|
191
159
|
type PeerSetConfigResponse as PeerSetConfigResponse,
|
|
192
160
|
type PeerListParams as PeerListParams,
|
|
193
161
|
type PeerAddParams as PeerAddParams,
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
import * as PeersAPI from "./peers.js";
|
|
20
20
|
import {
|
|
21
21
|
PeerAddParams,
|
|
22
|
-
PeerGetConfigResponse,
|
|
23
22
|
PeerListParams,
|
|
24
23
|
PeerRemoveParams,
|
|
25
24
|
PeerSetConfigParams,
|
|
26
25
|
PeerSetConfigResponse,
|
|
27
26
|
PeerSetParams,
|
|
28
|
-
Peers
|
|
27
|
+
Peers,
|
|
28
|
+
SessionPeerConfig,
|
|
29
29
|
} from "./peers.js";
|
|
30
30
|
import { Page, type PageParams } from "../../../pagination.js";
|
|
31
31
|
|
|
@@ -104,11 +104,12 @@ export class Sessions extends APIResource {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
* Produce a context object from the session. The caller provides
|
|
108
|
-
* which the entire context must fit into.
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
107
|
+
* Produce a context object from the session. The caller provides an optional token
|
|
108
|
+
* limit which the entire context must fit into. If not provided, the context will
|
|
109
|
+
* be exhaustive (within configured max tokens). To do this, we allocate 40% of the
|
|
110
|
+
* token limit to the summary, and 60% to recent messages -- as many as can fit.
|
|
111
|
+
* Note that the summary will usually take up less space than this. If the caller
|
|
112
|
+
* does not want a summary, we allocate all the tokens to recent messages.
|
|
112
113
|
*/
|
|
113
114
|
getContext(
|
|
114
115
|
workspaceId: string,
|
|
@@ -140,8 +141,7 @@ export class Sessions extends APIResource {
|
|
|
140
141
|
* Get a specific session in a workspace.
|
|
141
142
|
*
|
|
142
143
|
* If session_id is provided as a query parameter, it verifies the session is in
|
|
143
|
-
* the workspace. Otherwise, it uses the session_id from the JWT
|
|
144
|
-
* verification.
|
|
144
|
+
* the workspace. Otherwise, it uses the session_id from the JWT for verification.
|
|
145
145
|
*/
|
|
146
146
|
getOrCreate(
|
|
147
147
|
workspaceId: string,
|
|
@@ -157,15 +157,27 @@ export class Sessions extends APIResource {
|
|
|
157
157
|
search(
|
|
158
158
|
workspaceId: string,
|
|
159
159
|
sessionId: string,
|
|
160
|
-
|
|
160
|
+
body: SessionSearchParams,
|
|
161
161
|
options?: Core.RequestOptions,
|
|
162
|
-
): Core.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
): Core.APIPromise<SessionSearchResponse> {
|
|
163
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/sessions/${sessionId}/search`, {
|
|
164
|
+
body,
|
|
165
|
+
...options,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Get available summaries for a session.
|
|
171
|
+
*
|
|
172
|
+
* Returns both short and long summaries if available, including metadata like the
|
|
173
|
+
* message ID they cover up to, creation timestamp, and token count.
|
|
174
|
+
*/
|
|
175
|
+
summaries(
|
|
176
|
+
workspaceId: string,
|
|
177
|
+
sessionId: string,
|
|
178
|
+
options?: Core.RequestOptions,
|
|
179
|
+
): Core.APIPromise<SessionSummariesResponse> {
|
|
180
|
+
return this._client.get(`/v2/workspaces/${workspaceId}/sessions/${sessionId}/summaries`, options);
|
|
169
181
|
}
|
|
170
182
|
}
|
|
171
183
|
|
|
@@ -192,7 +204,120 @@ export interface SessionGetContextResponse {
|
|
|
192
204
|
|
|
193
205
|
messages: Array<MessagesAPI.Message>;
|
|
194
206
|
|
|
195
|
-
|
|
207
|
+
/**
|
|
208
|
+
* The summary if available
|
|
209
|
+
*/
|
|
210
|
+
summary?: SessionGetContextResponse.Summary | null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export namespace SessionGetContextResponse {
|
|
214
|
+
/**
|
|
215
|
+
* The summary if available
|
|
216
|
+
*/
|
|
217
|
+
export interface Summary {
|
|
218
|
+
/**
|
|
219
|
+
* The summary text
|
|
220
|
+
*/
|
|
221
|
+
content: string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The timestamp of when the summary was created (ISO format)
|
|
225
|
+
*/
|
|
226
|
+
created_at: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The ID of the message that this summary covers up to
|
|
230
|
+
*/
|
|
231
|
+
message_id: number;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* The type of summary (short or long)
|
|
235
|
+
*/
|
|
236
|
+
summary_type: string;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The number of tokens in the summary text
|
|
240
|
+
*/
|
|
241
|
+
token_count: number;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export type SessionSearchResponse = Array<MessagesAPI.Message>;
|
|
246
|
+
|
|
247
|
+
export interface SessionSummariesResponse {
|
|
248
|
+
id: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* The long summary if available
|
|
252
|
+
*/
|
|
253
|
+
long_summary?: SessionSummariesResponse.LongSummary | null;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The short summary if available
|
|
257
|
+
*/
|
|
258
|
+
short_summary?: SessionSummariesResponse.ShortSummary | null;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export namespace SessionSummariesResponse {
|
|
262
|
+
/**
|
|
263
|
+
* The long summary if available
|
|
264
|
+
*/
|
|
265
|
+
export interface LongSummary {
|
|
266
|
+
/**
|
|
267
|
+
* The summary text
|
|
268
|
+
*/
|
|
269
|
+
content: string;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The timestamp of when the summary was created (ISO format)
|
|
273
|
+
*/
|
|
274
|
+
created_at: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The ID of the message that this summary covers up to
|
|
278
|
+
*/
|
|
279
|
+
message_id: number;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* The type of summary (short or long)
|
|
283
|
+
*/
|
|
284
|
+
summary_type: string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The number of tokens in the summary text
|
|
288
|
+
*/
|
|
289
|
+
token_count: number;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* The short summary if available
|
|
294
|
+
*/
|
|
295
|
+
export interface ShortSummary {
|
|
296
|
+
/**
|
|
297
|
+
* The summary text
|
|
298
|
+
*/
|
|
299
|
+
content: string;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The timestamp of when the summary was created (ISO format)
|
|
303
|
+
*/
|
|
304
|
+
created_at: string;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* The ID of the message that this summary covers up to
|
|
308
|
+
*/
|
|
309
|
+
message_id: number;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* The type of summary (short or long)
|
|
313
|
+
*/
|
|
314
|
+
summary_type: string;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* The number of tokens in the summary text
|
|
318
|
+
*/
|
|
319
|
+
token_count: number;
|
|
320
|
+
}
|
|
196
321
|
}
|
|
197
322
|
|
|
198
323
|
export interface SessionUpdateParams {
|
|
@@ -205,7 +330,7 @@ export interface SessionListParams extends PageParams {
|
|
|
205
330
|
/**
|
|
206
331
|
* Body param:
|
|
207
332
|
*/
|
|
208
|
-
|
|
333
|
+
filters?: { [key: string]: unknown } | null;
|
|
209
334
|
}
|
|
210
335
|
|
|
211
336
|
export interface SessionCloneParams {
|
|
@@ -217,12 +342,13 @@ export interface SessionCloneParams {
|
|
|
217
342
|
|
|
218
343
|
export interface SessionGetContextParams {
|
|
219
344
|
/**
|
|
220
|
-
* Whether to
|
|
345
|
+
* Whether or not to include a summary _if_ one is available for the session
|
|
221
346
|
*/
|
|
222
347
|
summary?: boolean;
|
|
223
348
|
|
|
224
349
|
/**
|
|
225
|
-
* Number of tokens to use for the context. Includes summary if set to true
|
|
350
|
+
* Number of tokens to use for the context. Includes summary if set to true. If not
|
|
351
|
+
* provided, the context will be exhaustive (within 100000 tokens)
|
|
226
352
|
*/
|
|
227
353
|
tokens?: number | null;
|
|
228
354
|
}
|
|
@@ -234,47 +360,38 @@ export interface SessionGetOrCreateParams {
|
|
|
234
360
|
|
|
235
361
|
metadata?: { [key: string]: unknown } | null;
|
|
236
362
|
|
|
237
|
-
peers?: { [key: string]:
|
|
363
|
+
peers?: { [key: string]: PeersAPI.SessionPeerConfig } | null;
|
|
238
364
|
}
|
|
239
365
|
|
|
240
|
-
export
|
|
241
|
-
export interface Peers {
|
|
242
|
-
/**
|
|
243
|
-
* Whether other peers in this session should try to form a session-level
|
|
244
|
-
* theory-of-mind representation of this peer
|
|
245
|
-
*/
|
|
246
|
-
observe_me?: boolean | null;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Whether this peer should form a session-level theory-of-mind representation of
|
|
250
|
-
* other peers in the session
|
|
251
|
-
*/
|
|
252
|
-
observe_others?: boolean;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export interface SessionSearchParams extends PageParams {
|
|
366
|
+
export interface SessionSearchParams {
|
|
257
367
|
/**
|
|
258
|
-
*
|
|
368
|
+
* Search query
|
|
259
369
|
*/
|
|
260
370
|
query: string;
|
|
261
371
|
|
|
262
372
|
/**
|
|
263
|
-
*
|
|
373
|
+
* Filters to scope the search
|
|
264
374
|
*/
|
|
265
|
-
|
|
375
|
+
filters?: { [key: string]: unknown } | null;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Number of results to return
|
|
379
|
+
*/
|
|
380
|
+
limit?: number;
|
|
266
381
|
}
|
|
267
382
|
|
|
268
383
|
Sessions.SessionsPage = SessionsPage;
|
|
269
384
|
Sessions.Messages = Messages;
|
|
270
385
|
Sessions.MessagesPage = MessagesPage;
|
|
271
|
-
Sessions.Peers =
|
|
386
|
+
Sessions.Peers = Peers;
|
|
272
387
|
|
|
273
388
|
export declare namespace Sessions {
|
|
274
389
|
export {
|
|
275
390
|
type Session as Session,
|
|
276
391
|
type SessionDeleteResponse as SessionDeleteResponse,
|
|
277
392
|
type SessionGetContextResponse as SessionGetContextResponse,
|
|
393
|
+
type SessionSearchResponse as SessionSearchResponse,
|
|
394
|
+
type SessionSummariesResponse as SessionSummariesResponse,
|
|
278
395
|
SessionsPage as SessionsPage,
|
|
279
396
|
type SessionUpdateParams as SessionUpdateParams,
|
|
280
397
|
type SessionListParams as SessionListParams,
|
|
@@ -298,8 +415,8 @@ export declare namespace Sessions {
|
|
|
298
415
|
};
|
|
299
416
|
|
|
300
417
|
export {
|
|
301
|
-
|
|
302
|
-
type
|
|
418
|
+
Peers as Peers,
|
|
419
|
+
type SessionPeerConfig as SessionPeerConfig,
|
|
303
420
|
type PeerSetConfigResponse as PeerSetConfigResponse,
|
|
304
421
|
type PeerListParams as PeerListParams,
|
|
305
422
|
type PeerAddParams as PeerAddParams,
|
|
@@ -308,5 +425,3 @@ export declare namespace Sessions {
|
|
|
308
425
|
type PeerSetConfigParams as PeerSetConfigParams,
|
|
309
426
|
};
|
|
310
427
|
}
|
|
311
|
-
|
|
312
|
-
export { MessagesPage };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../core.js";
|
|
5
|
+
import * as Core from "../../core.js";
|
|
6
|
+
import { Page, type PageParams } from "../../pagination.js";
|
|
7
|
+
|
|
8
|
+
export class Webhooks extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List all webhook endpoints, optionally filtered by workspace.
|
|
11
|
+
*/
|
|
12
|
+
list(
|
|
13
|
+
workspaceId: string,
|
|
14
|
+
query?: WebhookListParams,
|
|
15
|
+
options?: Core.RequestOptions,
|
|
16
|
+
): Core.PagePromise<WebhookEndpointsPage, WebhookEndpoint>;
|
|
17
|
+
list(
|
|
18
|
+
workspaceId: string,
|
|
19
|
+
options?: Core.RequestOptions,
|
|
20
|
+
): Core.PagePromise<WebhookEndpointsPage, WebhookEndpoint>;
|
|
21
|
+
list(
|
|
22
|
+
workspaceId: string,
|
|
23
|
+
query: WebhookListParams | Core.RequestOptions = {},
|
|
24
|
+
options?: Core.RequestOptions,
|
|
25
|
+
): Core.PagePromise<WebhookEndpointsPage, WebhookEndpoint> {
|
|
26
|
+
if (isRequestOptions(query)) {
|
|
27
|
+
return this.list(workspaceId, {}, query);
|
|
28
|
+
}
|
|
29
|
+
return this._client.getAPIList(`/v2/workspaces/${workspaceId}/webhooks`, WebhookEndpointsPage, {
|
|
30
|
+
query,
|
|
31
|
+
...options,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Delete a specific webhook endpoint.
|
|
37
|
+
*/
|
|
38
|
+
delete(workspaceId: string, endpointId: string, options?: Core.RequestOptions): Core.APIPromise<unknown> {
|
|
39
|
+
return this._client.delete(`/v2/workspaces/${workspaceId}/webhooks/${endpointId}`, options);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get or create a webhook endpoint URL.
|
|
44
|
+
*/
|
|
45
|
+
getOrCreate(
|
|
46
|
+
workspaceId: string,
|
|
47
|
+
body: WebhookGetOrCreateParams,
|
|
48
|
+
options?: Core.RequestOptions,
|
|
49
|
+
): Core.APIPromise<WebhookEndpoint> {
|
|
50
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/webhooks`, { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Test publishing a webhook event.
|
|
55
|
+
*/
|
|
56
|
+
testEmit(workspaceId: string, options?: Core.RequestOptions): Core.APIPromise<unknown> {
|
|
57
|
+
return this._client.get(`/v2/workspaces/${workspaceId}/webhooks/test`, options);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class WebhookEndpointsPage extends Page<WebhookEndpoint> {}
|
|
62
|
+
|
|
63
|
+
export interface WebhookEndpoint {
|
|
64
|
+
id: string;
|
|
65
|
+
|
|
66
|
+
created_at: string;
|
|
67
|
+
|
|
68
|
+
url: string;
|
|
69
|
+
|
|
70
|
+
workspace_id: string | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type WebhookDeleteResponse = unknown;
|
|
74
|
+
|
|
75
|
+
export type WebhookTestEmitResponse = unknown;
|
|
76
|
+
|
|
77
|
+
export interface WebhookListParams extends PageParams {}
|
|
78
|
+
|
|
79
|
+
export interface WebhookGetOrCreateParams {
|
|
80
|
+
url: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
Webhooks.WebhookEndpointsPage = WebhookEndpointsPage;
|
|
84
|
+
|
|
85
|
+
export declare namespace Webhooks {
|
|
86
|
+
export {
|
|
87
|
+
type WebhookEndpoint as WebhookEndpoint,
|
|
88
|
+
type WebhookDeleteResponse as WebhookDeleteResponse,
|
|
89
|
+
type WebhookTestEmitResponse as WebhookTestEmitResponse,
|
|
90
|
+
WebhookEndpointsPage as WebhookEndpointsPage,
|
|
91
|
+
type WebhookListParams as WebhookListParams,
|
|
92
|
+
type WebhookGetOrCreateParams as WebhookGetOrCreateParams,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
import { APIResource } from "../../resource.js";
|
|
4
4
|
import { isRequestOptions } from "../../core.js";
|
|
5
5
|
import * as Core from "../../core.js";
|
|
6
|
+
import * as WebhooksAPI from "./webhooks.js";
|
|
7
|
+
import {
|
|
8
|
+
WebhookDeleteResponse,
|
|
9
|
+
WebhookEndpoint,
|
|
10
|
+
WebhookEndpointsPage,
|
|
11
|
+
WebhookGetOrCreateParams,
|
|
12
|
+
WebhookListParams,
|
|
13
|
+
WebhookTestEmitResponse,
|
|
14
|
+
Webhooks,
|
|
15
|
+
} from "./webhooks.js";
|
|
6
16
|
import * as PeersAPI from "./peers/peers.js";
|
|
7
17
|
import {
|
|
18
|
+
PagePeer,
|
|
8
19
|
PageSession,
|
|
9
20
|
Peer,
|
|
10
21
|
PeerChatParams,
|
|
@@ -12,6 +23,7 @@ import {
|
|
|
12
23
|
PeerGetOrCreateParams,
|
|
13
24
|
PeerListParams,
|
|
14
25
|
PeerSearchParams,
|
|
26
|
+
PeerSearchResponse,
|
|
15
27
|
PeerUpdateParams,
|
|
16
28
|
PeerWorkingRepresentationParams,
|
|
17
29
|
PeerWorkingRepresentationResponse,
|
|
@@ -20,7 +32,6 @@ import {
|
|
|
20
32
|
SessionGet,
|
|
21
33
|
} from "./peers/peers.js";
|
|
22
34
|
import * as MessagesAPI from "./sessions/messages.js";
|
|
23
|
-
import { MessagesPage } from "./sessions/messages.js";
|
|
24
35
|
import * as SessionsAPI from "./sessions/sessions.js";
|
|
25
36
|
import {
|
|
26
37
|
Session,
|
|
@@ -31,6 +42,8 @@ import {
|
|
|
31
42
|
SessionGetOrCreateParams,
|
|
32
43
|
SessionListParams,
|
|
33
44
|
SessionSearchParams,
|
|
45
|
+
SessionSearchResponse,
|
|
46
|
+
SessionSummariesResponse,
|
|
34
47
|
SessionUpdateParams,
|
|
35
48
|
Sessions as SessionsAPISessions,
|
|
36
49
|
SessionsPage,
|
|
@@ -40,6 +53,7 @@ import { Page, type PageParams } from "../../pagination.js";
|
|
|
40
53
|
export class Workspaces extends APIResource {
|
|
41
54
|
peers: PeersAPI.Peers = new PeersAPI.Peers(this._client);
|
|
42
55
|
sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client);
|
|
56
|
+
webhooks: WebhooksAPI.Webhooks = new WebhooksAPI.Webhooks(this._client);
|
|
43
57
|
|
|
44
58
|
/**
|
|
45
59
|
* Update a Workspace
|
|
@@ -101,7 +115,7 @@ export class Workspaces extends APIResource {
|
|
|
101
115
|
* Get a Workspace by ID.
|
|
102
116
|
*
|
|
103
117
|
* If workspace_id is provided as a query parameter, it uses that (must match JWT
|
|
104
|
-
* workspace_id). Otherwise, it uses the workspace_id from the JWT
|
|
118
|
+
* workspace_id). Otherwise, it uses the workspace_id from the JWT.
|
|
105
119
|
*/
|
|
106
120
|
getOrCreate(body: WorkspaceGetOrCreateParams, options?: Core.RequestOptions): Core.APIPromise<Workspace> {
|
|
107
121
|
return this._client.post('/v2/workspaces', { body, ...options });
|
|
@@ -112,16 +126,10 @@ export class Workspaces extends APIResource {
|
|
|
112
126
|
*/
|
|
113
127
|
search(
|
|
114
128
|
workspaceId: string,
|
|
115
|
-
|
|
129
|
+
body: WorkspaceSearchParams,
|
|
116
130
|
options?: Core.RequestOptions,
|
|
117
|
-
): Core.
|
|
118
|
-
|
|
119
|
-
return this._client.getAPIList(`/v2/workspaces/${workspaceId}/search`, MessagesPage, {
|
|
120
|
-
query: { page, size },
|
|
121
|
-
body: body,
|
|
122
|
-
method: 'post',
|
|
123
|
-
...options,
|
|
124
|
-
});
|
|
131
|
+
): Core.APIPromise<WorkspaceSearchResponse> {
|
|
132
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/search`, { body, ...options });
|
|
125
133
|
}
|
|
126
134
|
}
|
|
127
135
|
|
|
@@ -183,6 +191,23 @@ export namespace DeriverStatus {
|
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
193
|
|
|
194
|
+
export interface MessageSearchOptions {
|
|
195
|
+
/**
|
|
196
|
+
* Search query
|
|
197
|
+
*/
|
|
198
|
+
query: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Filters to scope the search
|
|
202
|
+
*/
|
|
203
|
+
filters?: { [key: string]: unknown } | null;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Number of results to return
|
|
207
|
+
*/
|
|
208
|
+
limit?: number;
|
|
209
|
+
}
|
|
210
|
+
|
|
186
211
|
export interface Workspace {
|
|
187
212
|
id: string;
|
|
188
213
|
|
|
@@ -193,6 +218,8 @@ export interface Workspace {
|
|
|
193
218
|
metadata?: { [key: string]: unknown };
|
|
194
219
|
}
|
|
195
220
|
|
|
221
|
+
export type WorkspaceSearchResponse = Array<MessagesAPI.Message>;
|
|
222
|
+
|
|
196
223
|
export interface WorkspaceUpdateParams {
|
|
197
224
|
configuration?: { [key: string]: unknown } | null;
|
|
198
225
|
|
|
@@ -203,7 +230,7 @@ export interface WorkspaceListParams extends PageParams {
|
|
|
203
230
|
/**
|
|
204
231
|
* Body param:
|
|
205
232
|
*/
|
|
206
|
-
|
|
233
|
+
filters?: { [key: string]: unknown } | null;
|
|
207
234
|
}
|
|
208
235
|
|
|
209
236
|
export interface WorkspaceDeriverStatusParams {
|
|
@@ -231,11 +258,21 @@ export interface WorkspaceGetOrCreateParams {
|
|
|
231
258
|
metadata?: { [key: string]: unknown };
|
|
232
259
|
}
|
|
233
260
|
|
|
234
|
-
export interface WorkspaceSearchParams
|
|
261
|
+
export interface WorkspaceSearchParams {
|
|
235
262
|
/**
|
|
236
|
-
*
|
|
263
|
+
* Search query
|
|
237
264
|
*/
|
|
238
|
-
|
|
265
|
+
query: string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Filters to scope the search
|
|
269
|
+
*/
|
|
270
|
+
filters?: { [key: string]: unknown } | null;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Number of results to return
|
|
274
|
+
*/
|
|
275
|
+
limit?: number;
|
|
239
276
|
}
|
|
240
277
|
|
|
241
278
|
Workspaces.WorkspacesPage = WorkspacesPage;
|
|
@@ -243,11 +280,15 @@ Workspaces.Peers = Peers;
|
|
|
243
280
|
Workspaces.PeersPage = PeersPage;
|
|
244
281
|
Workspaces.Sessions = SessionsAPISessions;
|
|
245
282
|
Workspaces.SessionsPage = SessionsPage;
|
|
283
|
+
Workspaces.Webhooks = Webhooks;
|
|
284
|
+
Workspaces.WebhookEndpointsPage = WebhookEndpointsPage;
|
|
246
285
|
|
|
247
286
|
export declare namespace Workspaces {
|
|
248
287
|
export {
|
|
249
288
|
type DeriverStatus as DeriverStatus,
|
|
289
|
+
type MessageSearchOptions as MessageSearchOptions,
|
|
250
290
|
type Workspace as Workspace,
|
|
291
|
+
type WorkspaceSearchResponse as WorkspaceSearchResponse,
|
|
251
292
|
WorkspacesPage as WorkspacesPage,
|
|
252
293
|
type WorkspaceUpdateParams as WorkspaceUpdateParams,
|
|
253
294
|
type WorkspaceListParams as WorkspaceListParams,
|
|
@@ -258,10 +299,12 @@ export declare namespace Workspaces {
|
|
|
258
299
|
|
|
259
300
|
export {
|
|
260
301
|
Peers as Peers,
|
|
302
|
+
type PagePeer as PagePeer,
|
|
261
303
|
type PageSession as PageSession,
|
|
262
304
|
type Peer as Peer,
|
|
263
305
|
type SessionGet as SessionGet,
|
|
264
306
|
type PeerChatResponse as PeerChatResponse,
|
|
307
|
+
type PeerSearchResponse as PeerSearchResponse,
|
|
265
308
|
type PeerWorkingRepresentationResponse as PeerWorkingRepresentationResponse,
|
|
266
309
|
PeersPage as PeersPage,
|
|
267
310
|
type PeerUpdateParams as PeerUpdateParams,
|
|
@@ -277,6 +320,8 @@ export declare namespace Workspaces {
|
|
|
277
320
|
type Session as Session,
|
|
278
321
|
type SessionDeleteResponse as SessionDeleteResponse,
|
|
279
322
|
type SessionGetContextResponse as SessionGetContextResponse,
|
|
323
|
+
type SessionSearchResponse as SessionSearchResponse,
|
|
324
|
+
type SessionSummariesResponse as SessionSummariesResponse,
|
|
280
325
|
SessionsPage as SessionsPage,
|
|
281
326
|
type SessionUpdateParams as SessionUpdateParams,
|
|
282
327
|
type SessionListParams as SessionListParams,
|
|
@@ -285,6 +330,14 @@ export declare namespace Workspaces {
|
|
|
285
330
|
type SessionGetOrCreateParams as SessionGetOrCreateParams,
|
|
286
331
|
type SessionSearchParams as SessionSearchParams,
|
|
287
332
|
};
|
|
288
|
-
}
|
|
289
333
|
|
|
290
|
-
export {
|
|
334
|
+
export {
|
|
335
|
+
Webhooks as Webhooks,
|
|
336
|
+
type WebhookEndpoint as WebhookEndpoint,
|
|
337
|
+
type WebhookDeleteResponse as WebhookDeleteResponse,
|
|
338
|
+
type WebhookTestEmitResponse as WebhookTestEmitResponse,
|
|
339
|
+
WebhookEndpointsPage as WebhookEndpointsPage,
|
|
340
|
+
type WebhookListParams as WebhookListParams,
|
|
341
|
+
type WebhookGetOrCreateParams as WebhookGetOrCreateParams,
|
|
342
|
+
};
|
|
343
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.4.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.4.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|