@inconvoai/node 0.4.0 → 0.6.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 +45 -0
- package/README.md +37 -20
- package/client.d.mts +0 -9
- package/client.d.mts.map +1 -1
- package/client.d.ts +0 -9
- package/client.d.ts.map +1 -1
- package/client.js +3 -11
- package/client.js.map +1 -1
- package/client.mjs +3 -11
- package/client.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/agents/agents.d.mts +12 -0
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +12 -0
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js +12 -0
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +12 -0
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/{conversations → agents/conversations}/conversations.d.mts +35 -16
- package/resources/agents/conversations/conversations.d.mts.map +1 -0
- package/resources/{conversations → agents/conversations}/conversations.d.ts +35 -16
- package/resources/agents/conversations/conversations.d.ts.map +1 -0
- package/resources/agents/conversations/conversations.js +64 -0
- package/resources/agents/conversations/conversations.js.map +1 -0
- package/resources/agents/conversations/conversations.mjs +59 -0
- package/resources/agents/conversations/conversations.mjs.map +1 -0
- package/resources/{conversations → agents/conversations}/index.d.mts +1 -1
- package/resources/agents/conversations/index.d.mts.map +1 -0
- package/resources/{conversations → agents/conversations}/index.d.ts +1 -1
- package/resources/agents/conversations/index.d.ts.map +1 -0
- package/resources/agents/conversations/index.js.map +1 -0
- package/resources/agents/conversations/index.mjs.map +1 -0
- package/resources/{conversations → agents/conversations}/response/feedback.d.mts +25 -9
- package/resources/agents/conversations/response/feedback.d.mts.map +1 -0
- package/resources/{conversations → agents/conversations}/response/feedback.d.ts +25 -9
- package/resources/agents/conversations/response/feedback.d.ts.map +1 -0
- package/resources/agents/conversations/response/feedback.js +50 -0
- package/resources/agents/conversations/response/feedback.js.map +1 -0
- package/resources/agents/conversations/response/feedback.mjs +46 -0
- package/resources/agents/conversations/response/feedback.mjs.map +1 -0
- package/resources/agents/conversations/response/index.d.mts.map +1 -0
- package/resources/agents/conversations/response/index.d.ts.map +1 -0
- package/resources/agents/conversations/response/index.js.map +1 -0
- package/resources/agents/conversations/response/index.mjs.map +1 -0
- package/resources/{conversations → agents/conversations}/response/response.d.mts +32 -17
- package/resources/agents/conversations/response/response.d.mts.map +1 -0
- package/resources/{conversations → agents/conversations}/response/response.d.ts +32 -17
- package/resources/agents/conversations/response/response.d.ts.map +1 -0
- package/resources/{conversations → agents/conversations}/response/response.js +17 -13
- package/resources/agents/conversations/response/response.js.map +1 -0
- package/resources/{conversations → agents/conversations}/response/response.mjs +16 -12
- package/resources/agents/conversations/response/response.mjs.map +1 -0
- package/resources/agents/conversations/response.d.mts.map +1 -0
- package/resources/agents/conversations/response.d.ts.map +1 -0
- package/resources/{conversations → agents/conversations}/response.js +1 -1
- package/resources/agents/conversations/response.js.map +1 -0
- package/resources/agents/conversations/response.mjs.map +1 -0
- package/resources/agents/conversations.d.mts.map +1 -0
- package/resources/agents/conversations.d.ts.map +1 -0
- package/resources/{conversations.js → agents/conversations.js} +1 -1
- package/resources/agents/conversations.js.map +1 -0
- package/resources/agents/conversations.mjs.map +1 -0
- package/resources/agents/data-summary.d.mts +7 -1
- package/resources/agents/data-summary.d.mts.map +1 -1
- package/resources/agents/data-summary.d.ts +7 -1
- package/resources/agents/data-summary.d.ts.map +1 -1
- package/resources/agents/data-summary.js +9 -2
- package/resources/agents/data-summary.js.map +1 -1
- package/resources/agents/data-summary.mjs +9 -2
- package/resources/agents/data-summary.mjs.map +1 -1
- package/resources/{datasets → agents/datasets}/context.d.mts +33 -16
- package/resources/agents/datasets/context.d.mts.map +1 -0
- package/resources/{datasets → agents/datasets}/context.d.ts +33 -16
- package/resources/agents/datasets/context.d.ts.map +1 -0
- package/resources/agents/datasets/context.js +66 -0
- package/resources/agents/datasets/context.js.map +1 -0
- package/resources/agents/datasets/context.mjs +62 -0
- package/resources/agents/datasets/context.mjs.map +1 -0
- package/resources/{datasets → agents/datasets}/datasets.d.mts +3 -3
- package/resources/agents/datasets/datasets.d.mts.map +1 -0
- package/resources/{datasets → agents/datasets}/datasets.d.ts +3 -3
- package/resources/agents/datasets/datasets.d.ts.map +1 -0
- package/resources/{datasets → agents/datasets}/datasets.js +2 -2
- package/resources/agents/datasets/datasets.js.map +1 -0
- package/resources/{datasets → agents/datasets}/datasets.mjs +1 -1
- package/resources/agents/datasets/datasets.mjs.map +1 -0
- package/resources/{datasets → agents/datasets}/index.d.mts +1 -1
- package/resources/agents/datasets/index.d.mts.map +1 -0
- package/resources/{datasets → agents/datasets}/index.d.ts +1 -1
- package/resources/agents/datasets/index.d.ts.map +1 -0
- package/resources/agents/datasets/index.js.map +1 -0
- package/resources/agents/datasets/index.mjs.map +1 -0
- package/resources/agents/datasets/user.d.mts +98 -0
- package/resources/agents/datasets/user.d.mts.map +1 -0
- package/resources/agents/datasets/user.d.ts +98 -0
- package/resources/agents/datasets/user.d.ts.map +1 -0
- package/resources/agents/datasets/user.js +59 -0
- package/resources/agents/datasets/user.js.map +1 -0
- package/resources/agents/datasets/user.mjs +55 -0
- package/resources/agents/datasets/user.mjs.map +1 -0
- package/resources/agents/datasets.d.mts.map +1 -0
- package/resources/agents/datasets.d.ts.map +1 -0
- package/resources/{datasets.js → agents/datasets.js} +1 -1
- package/resources/agents/datasets.js.map +1 -0
- package/resources/agents/datasets.mjs.map +1 -0
- package/resources/agents/index.d.mts +3 -0
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +3 -0
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js +7 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs +3 -0
- package/resources/agents/index.mjs.map +1 -1
- package/resources/agents/mcp-servers/index.d.mts +3 -0
- package/resources/agents/mcp-servers/index.d.mts.map +1 -0
- package/resources/agents/mcp-servers/index.d.ts +3 -0
- package/resources/agents/mcp-servers/index.d.ts.map +1 -0
- package/resources/agents/mcp-servers/index.js.map +1 -0
- package/resources/agents/mcp-servers/index.mjs.map +1 -0
- package/resources/agents/mcp-servers/mcp-servers.d.mts +10 -0
- package/resources/agents/mcp-servers/mcp-servers.d.mts.map +1 -0
- package/resources/agents/mcp-servers/mcp-servers.d.ts +10 -0
- package/resources/agents/mcp-servers/mcp-servers.d.ts.map +1 -0
- package/resources/{mcp-servers → agents/mcp-servers}/mcp-servers.js +2 -2
- package/resources/agents/mcp-servers/mcp-servers.js.map +1 -0
- package/resources/{mcp-servers → agents/mcp-servers}/mcp-servers.mjs +2 -2
- package/resources/agents/mcp-servers/mcp-servers.mjs.map +1 -0
- package/resources/agents/mcp-servers/tenants.d.mts +79 -0
- package/resources/agents/mcp-servers/tenants.d.mts.map +1 -0
- package/resources/agents/mcp-servers/tenants.d.ts +79 -0
- package/resources/agents/mcp-servers/tenants.d.ts.map +1 -0
- package/resources/agents/mcp-servers/tenants.js +50 -0
- package/resources/agents/mcp-servers/tenants.js.map +1 -0
- package/resources/agents/mcp-servers/tenants.mjs +46 -0
- package/resources/agents/mcp-servers/tenants.mjs.map +1 -0
- package/resources/agents/mcp-servers.d.mts.map +1 -0
- package/resources/agents/mcp-servers.d.ts.map +1 -0
- package/resources/{mcp-servers.js → agents/mcp-servers.js} +1 -1
- package/resources/agents/mcp-servers.js.map +1 -0
- package/resources/agents/mcp-servers.mjs.map +1 -0
- package/resources/index.d.mts +0 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +0 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -3
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +3 -33
- package/src/index.ts +1 -1
- package/src/internal/parse.ts +6 -0
- package/src/resources/agents/agents.ts +36 -0
- package/src/resources/{conversations → agents/conversations}/conversations.ts +53 -21
- package/src/resources/{conversations → agents/conversations}/index.ts +1 -0
- package/src/resources/{conversations → agents/conversations}/response/feedback.ts +38 -20
- package/src/resources/{conversations → agents/conversations}/response/response.ts +47 -25
- package/src/resources/agents/data-summary.ts +9 -2
- package/src/resources/{datasets → agents/datasets}/context.ts +47 -24
- package/src/resources/{datasets → agents/datasets}/datasets.ts +3 -1
- package/src/resources/{datasets → agents/datasets}/index.ts +1 -0
- package/src/resources/agents/datasets/user.ts +151 -0
- package/src/resources/agents/index.ts +12 -0
- package/src/resources/{mcp-servers → agents/mcp-servers}/index.ts +1 -0
- package/src/resources/{mcp-servers → agents/mcp-servers}/mcp-servers.ts +9 -2
- package/src/resources/agents/mcp-servers/tenants.ts +108 -0
- package/src/resources/index.ts +0 -11
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/conversations/conversations.d.mts.map +0 -1
- package/resources/conversations/conversations.d.ts.map +0 -1
- package/resources/conversations/conversations.js +0 -61
- package/resources/conversations/conversations.js.map +0 -1
- package/resources/conversations/conversations.mjs +0 -56
- package/resources/conversations/conversations.mjs.map +0 -1
- package/resources/conversations/index.d.mts.map +0 -1
- package/resources/conversations/index.d.ts.map +0 -1
- package/resources/conversations/index.js.map +0 -1
- package/resources/conversations/index.mjs.map +0 -1
- package/resources/conversations/response/feedback.d.mts.map +0 -1
- package/resources/conversations/response/feedback.d.ts.map +0 -1
- package/resources/conversations/response/feedback.js +0 -48
- package/resources/conversations/response/feedback.js.map +0 -1
- package/resources/conversations/response/feedback.mjs +0 -44
- package/resources/conversations/response/feedback.mjs.map +0 -1
- package/resources/conversations/response/index.d.mts.map +0 -1
- package/resources/conversations/response/index.d.ts.map +0 -1
- package/resources/conversations/response/index.js.map +0 -1
- package/resources/conversations/response/index.mjs.map +0 -1
- package/resources/conversations/response/response.d.mts.map +0 -1
- package/resources/conversations/response/response.d.ts.map +0 -1
- package/resources/conversations/response/response.js.map +0 -1
- package/resources/conversations/response/response.mjs.map +0 -1
- package/resources/conversations/response.d.mts.map +0 -1
- package/resources/conversations/response.d.ts.map +0 -1
- package/resources/conversations/response.js.map +0 -1
- package/resources/conversations/response.mjs.map +0 -1
- package/resources/conversations.d.mts.map +0 -1
- package/resources/conversations.d.ts.map +0 -1
- package/resources/conversations.js.map +0 -1
- package/resources/conversations.mjs.map +0 -1
- package/resources/datasets/context.d.mts.map +0 -1
- package/resources/datasets/context.d.ts.map +0 -1
- package/resources/datasets/context.js +0 -61
- package/resources/datasets/context.js.map +0 -1
- package/resources/datasets/context.mjs +0 -57
- package/resources/datasets/context.mjs.map +0 -1
- package/resources/datasets/datasets.d.mts.map +0 -1
- package/resources/datasets/datasets.d.ts.map +0 -1
- package/resources/datasets/datasets.js.map +0 -1
- package/resources/datasets/datasets.mjs.map +0 -1
- package/resources/datasets/index.d.mts.map +0 -1
- package/resources/datasets/index.d.ts.map +0 -1
- package/resources/datasets/index.js.map +0 -1
- package/resources/datasets/index.mjs.map +0 -1
- package/resources/datasets/user.d.mts +0 -77
- package/resources/datasets/user.d.mts.map +0 -1
- package/resources/datasets/user.d.ts +0 -77
- package/resources/datasets/user.d.ts.map +0 -1
- package/resources/datasets/user.js +0 -50
- package/resources/datasets/user.js.map +0 -1
- package/resources/datasets/user.mjs +0 -46
- package/resources/datasets/user.mjs.map +0 -1
- package/resources/datasets.d.mts.map +0 -1
- package/resources/datasets.d.ts.map +0 -1
- package/resources/datasets.js.map +0 -1
- package/resources/datasets.mjs.map +0 -1
- package/resources/mcp-servers/index.d.mts +0 -3
- package/resources/mcp-servers/index.d.mts.map +0 -1
- package/resources/mcp-servers/index.d.ts +0 -3
- package/resources/mcp-servers/index.d.ts.map +0 -1
- package/resources/mcp-servers/index.js.map +0 -1
- package/resources/mcp-servers/index.mjs.map +0 -1
- package/resources/mcp-servers/mcp-servers.d.mts +0 -10
- package/resources/mcp-servers/mcp-servers.d.mts.map +0 -1
- package/resources/mcp-servers/mcp-servers.d.ts +0 -10
- package/resources/mcp-servers/mcp-servers.d.ts.map +0 -1
- package/resources/mcp-servers/mcp-servers.js.map +0 -1
- package/resources/mcp-servers/mcp-servers.mjs.map +0 -1
- package/resources/mcp-servers/tenants.d.mts +0 -63
- package/resources/mcp-servers/tenants.d.mts.map +0 -1
- package/resources/mcp-servers/tenants.d.ts +0 -63
- package/resources/mcp-servers/tenants.d.ts.map +0 -1
- package/resources/mcp-servers/tenants.js +0 -47
- package/resources/mcp-servers/tenants.js.map +0 -1
- package/resources/mcp-servers/tenants.mjs +0 -43
- package/resources/mcp-servers/tenants.mjs.map +0 -1
- package/resources/mcp-servers.d.mts.map +0 -1
- package/resources/mcp-servers.d.ts.map +0 -1
- package/resources/mcp-servers.js.map +0 -1
- package/resources/mcp-servers.mjs.map +0 -1
- package/src/resources/datasets/user.ts +0 -120
- package/src/resources/mcp-servers/tenants.ts +0 -81
- /package/resources/{conversations → agents/conversations}/index.js +0 -0
- /package/resources/{conversations → agents/conversations}/index.mjs +0 -0
- /package/resources/{conversations → agents/conversations}/response/index.d.mts +0 -0
- /package/resources/{conversations → agents/conversations}/response/index.d.ts +0 -0
- /package/resources/{conversations → agents/conversations}/response/index.js +0 -0
- /package/resources/{conversations → agents/conversations}/response/index.mjs +0 -0
- /package/resources/{conversations → agents/conversations}/response.d.mts +0 -0
- /package/resources/{conversations → agents/conversations}/response.d.ts +0 -0
- /package/resources/{conversations → agents/conversations}/response.mjs +0 -0
- /package/resources/{conversations.d.mts → agents/conversations.d.mts} +0 -0
- /package/resources/{conversations.d.ts → agents/conversations.d.ts} +0 -0
- /package/resources/{conversations.mjs → agents/conversations.mjs} +0 -0
- /package/resources/{datasets → agents/datasets}/index.js +0 -0
- /package/resources/{datasets → agents/datasets}/index.mjs +0 -0
- /package/resources/{datasets.d.mts → agents/datasets.d.mts} +0 -0
- /package/resources/{datasets.d.ts → agents/datasets.d.ts} +0 -0
- /package/resources/{datasets.mjs → agents/datasets.mjs} +0 -0
- /package/resources/{mcp-servers → agents/mcp-servers}/index.js +0 -0
- /package/resources/{mcp-servers → agents/mcp-servers}/index.mjs +0 -0
- /package/resources/{mcp-servers.d.mts → agents/mcp-servers.d.mts} +0 -0
- /package/resources/{mcp-servers.d.ts → agents/mcp-servers.d.ts} +0 -0
- /package/resources/{mcp-servers.mjs → agents/mcp-servers.mjs} +0 -0
- /package/src/resources/{conversations → agents/conversations}/response/index.ts +0 -0
- /package/src/resources/{conversations → agents/conversations}/response.ts +0 -0
- /package/src/resources/{conversations.ts → agents/conversations.ts} +0 -0
- /package/src/resources/{datasets.ts → agents/datasets.ts} +0 -0
- /package/src/resources/{mcp-servers.ts → agents/mcp-servers.ts} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
4
|
+
export declare class Tenants extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a tenant for an MCP Server
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const tenant =
|
|
11
|
+
* await client.agents.mcpServers.tenants.create(
|
|
12
|
+
* 'mcpserver_id',
|
|
13
|
+
* {
|
|
14
|
+
* agentId: 'agentId',
|
|
15
|
+
* tenant: {
|
|
16
|
+
* 'fromapi@api.com': { organisationId: 'bar' },
|
|
17
|
+
* },
|
|
18
|
+
* },
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(mcpserverID: string, params: TenantCreateParams, options?: RequestOptions): APIPromise<TenantCreateResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Delete a tenant mapping from an MCP Server
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const tenant =
|
|
29
|
+
* await client.agents.mcpServers.tenants.delete(
|
|
30
|
+
* 'mcpserver_id',
|
|
31
|
+
* { agentId: 'agentId', tenant_key: 'tenant_key' },
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
delete(mcpserverID: string, params: TenantDeleteParams, options?: RequestOptions): APIPromise<TenantDeleteResponse>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Arbitrary key-value mapping.
|
|
39
|
+
*
|
|
40
|
+
* - Keys are strings.
|
|
41
|
+
* - Values are JSON objects with arbitrary properties.
|
|
42
|
+
*/
|
|
43
|
+
export type TenantCreateResponse = {
|
|
44
|
+
[key: string]: {
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export interface TenantDeleteResponse {
|
|
49
|
+
success: boolean;
|
|
50
|
+
tenantKey: string;
|
|
51
|
+
}
|
|
52
|
+
export interface TenantCreateParams {
|
|
53
|
+
/**
|
|
54
|
+
* Path param: The unique identifier of the agent
|
|
55
|
+
*/
|
|
56
|
+
agentId: string;
|
|
57
|
+
/**
|
|
58
|
+
* Body param: Arbitrary key-value mapping.
|
|
59
|
+
*
|
|
60
|
+
* - Keys are strings.
|
|
61
|
+
* - Values are JSON objects with arbitrary properties.
|
|
62
|
+
*/
|
|
63
|
+
tenant: {
|
|
64
|
+
[key: string]: {
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface TenantDeleteParams {
|
|
70
|
+
/**
|
|
71
|
+
* The unique identifier of the agent
|
|
72
|
+
*/
|
|
73
|
+
agentId: string;
|
|
74
|
+
tenant_key: string;
|
|
75
|
+
}
|
|
76
|
+
export declare namespace Tenants {
|
|
77
|
+
export { type TenantCreateResponse as TenantCreateResponse, type TenantDeleteResponse as TenantDeleteResponse, type TenantCreateParams as TenantCreateParams, type TenantDeleteParams as TenantDeleteParams, };
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=tenants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../../src/resources/agents/mcp-servers/tenants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAQnC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;CAOpC;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC;AAEjF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAA;KAAE,CAAC;CACvD;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Tenants = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
7
|
+
class Tenants extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a tenant for an MCP Server
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const tenant =
|
|
14
|
+
* await client.agents.mcpServers.tenants.create(
|
|
15
|
+
* 'mcpserver_id',
|
|
16
|
+
* {
|
|
17
|
+
* agentId: 'agentId',
|
|
18
|
+
* tenant: {
|
|
19
|
+
* 'fromapi@api.com': { organisationId: 'bar' },
|
|
20
|
+
* },
|
|
21
|
+
* },
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(mcpserverID, params, options) {
|
|
26
|
+
const { agentId, tenant } = params;
|
|
27
|
+
return this._client.post((0, path_1.path) `/agents/${agentId}/mcpservers/${mcpserverID}/tenants`, {
|
|
28
|
+
body: tenant,
|
|
29
|
+
...options,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Delete a tenant mapping from an MCP Server
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const tenant =
|
|
38
|
+
* await client.agents.mcpServers.tenants.delete(
|
|
39
|
+
* 'mcpserver_id',
|
|
40
|
+
* { agentId: 'agentId', tenant_key: 'tenant_key' },
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
delete(mcpserverID, params, options) {
|
|
45
|
+
const { agentId, tenant_key } = params;
|
|
46
|
+
return this._client.delete((0, path_1.path) `/agents/${agentId}/mcpservers/${mcpserverID}/tenants/${tenant_key}`, options);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Tenants = Tenants;
|
|
50
|
+
//# sourceMappingURL=tenants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../../src/resources/agents/mcp-servers/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,OAAO,eAAe,WAAW,UAAU,EAAE;YACnF,IAAI,EAAE,MAAM;YACZ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAA,WAAI,EAAA,WAAW,OAAO,eAAe,WAAW,YAAY,UAAU,EAAE,EACxE,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AArDD,0BAqDC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
4
|
+
export class Tenants extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a tenant for an MCP Server
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const tenant =
|
|
11
|
+
* await client.agents.mcpServers.tenants.create(
|
|
12
|
+
* 'mcpserver_id',
|
|
13
|
+
* {
|
|
14
|
+
* agentId: 'agentId',
|
|
15
|
+
* tenant: {
|
|
16
|
+
* 'fromapi@api.com': { organisationId: 'bar' },
|
|
17
|
+
* },
|
|
18
|
+
* },
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
create(mcpserverID, params, options) {
|
|
23
|
+
const { agentId, tenant } = params;
|
|
24
|
+
return this._client.post(path `/agents/${agentId}/mcpservers/${mcpserverID}/tenants`, {
|
|
25
|
+
body: tenant,
|
|
26
|
+
...options,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Delete a tenant mapping from an MCP Server
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const tenant =
|
|
35
|
+
* await client.agents.mcpServers.tenants.delete(
|
|
36
|
+
* 'mcpserver_id',
|
|
37
|
+
* { agentId: 'agentId', tenant_key: 'tenant_key' },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
delete(mcpserverID, params, options) {
|
|
42
|
+
const { agentId, tenant_key } = params;
|
|
43
|
+
return this._client.delete(path `/agents/${agentId}/mcpservers/${mcpserverID}/tenants/${tenant_key}`, options);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=tenants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../../src/resources/agents/mcp-servers/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,OAAO,eAAe,WAAW,UAAU,EAAE;YACnF,IAAI,EAAE,MAAM;YACZ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,WAAmB,EACnB,MAA0B,EAC1B,OAAwB;QAExB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CACxB,IAAI,CAAA,WAAW,OAAO,eAAe,WAAW,YAAY,UAAU,EAAE,EACxE,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.d.mts","sourceRoot":"","sources":["../../src/resources/agents/mcp-servers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.d.ts","sourceRoot":"","sources":["../../src/resources/agents/mcp-servers.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
5
|
tslib_1.__exportStar(require("./mcp-servers/index.js"), exports);
|
|
6
6
|
//# sourceMappingURL=mcp-servers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.js","sourceRoot":"","sources":["../../src/resources/agents/mcp-servers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,iEAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-servers.mjs","sourceRoot":"","sources":["../../src/resources/agents/mcp-servers.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
export { Agents } from "./agents/agents.mjs";
|
|
2
|
-
export { Conversations, type InconvoConversation, type ConversationCreateResponse, type ConversationListResponse, type ConversationCreateParams, type ConversationListParams, type ConversationListResponsesConversationsCursor, } from "./conversations/conversations.mjs";
|
|
3
|
-
export { Datasets } from "./datasets/datasets.mjs";
|
|
4
|
-
export { McpServers } from "./mcp-servers/mcp-servers.mjs";
|
|
5
2
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
export { Agents } from "./agents/agents.js";
|
|
2
|
-
export { Conversations, type InconvoConversation, type ConversationCreateResponse, type ConversationListResponse, type ConversationCreateParams, type ConversationListParams, type ConversationListResponsesConversationsCursor, } from "./conversations/conversations.js";
|
|
3
|
-
export { Datasets } from "./datasets/datasets.js";
|
|
4
|
-
export { McpServers } from "./mcp-servers/mcp-servers.js";
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE"}
|
package/resources/index.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.Agents = void 0;
|
|
5
5
|
var agents_1 = require("./agents/agents.js");
|
|
6
6
|
Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
|
|
7
|
-
var conversations_1 = require("./conversations/conversations.js");
|
|
8
|
-
Object.defineProperty(exports, "Conversations", { enumerable: true, get: function () { return conversations_1.Conversations; } });
|
|
9
|
-
var datasets_1 = require("./datasets/datasets.js");
|
|
10
|
-
Object.defineProperty(exports, "Datasets", { enumerable: true, get: function () { return datasets_1.Datasets; } });
|
|
11
|
-
var mcp_servers_1 = require("./mcp-servers/mcp-servers.js");
|
|
12
|
-
Object.defineProperty(exports, "McpServers", { enumerable: true, get: function () { return mcp_servers_1.McpServers; } });
|
|
13
7
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAAyC;AAAhC,gGAAA,MAAM,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAAyC;AAAhC,gGAAA,MAAM,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Agents } from "./agents/agents.mjs";
|
|
3
|
-
export { Conversations, } from "./conversations/conversations.mjs";
|
|
4
|
-
export { Datasets } from "./datasets/datasets.mjs";
|
|
5
|
-
export { McpServers } from "./mcp-servers/mcp-servers.mjs";
|
|
6
3
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAE"}
|
package/src/client.ts
CHANGED
|
@@ -20,17 +20,6 @@ import * as Uploads from './core/uploads';
|
|
|
20
20
|
import * as API from './resources/index';
|
|
21
21
|
import { APIPromise } from './core/api-promise';
|
|
22
22
|
import { Agents } from './resources/agents/agents';
|
|
23
|
-
import {
|
|
24
|
-
ConversationCreateParams,
|
|
25
|
-
ConversationCreateResponse,
|
|
26
|
-
ConversationListParams,
|
|
27
|
-
ConversationListResponse,
|
|
28
|
-
ConversationListResponsesConversationsCursor,
|
|
29
|
-
Conversations,
|
|
30
|
-
InconvoConversation,
|
|
31
|
-
} from './resources/conversations/conversations';
|
|
32
|
-
import { Datasets } from './resources/datasets/datasets';
|
|
33
|
-
import { McpServers } from './resources/mcp-servers/mcp-servers';
|
|
34
23
|
import { type Fetch } from './internal/builtin-types';
|
|
35
24
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
36
25
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -506,9 +495,10 @@ export class Inconvo {
|
|
|
506
495
|
controller: AbortController,
|
|
507
496
|
): Promise<Response> {
|
|
508
497
|
const { signal, method, ...options } = init || {};
|
|
509
|
-
|
|
498
|
+
const abort = controller.abort.bind(controller);
|
|
499
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
510
500
|
|
|
511
|
-
const timeout = setTimeout(
|
|
501
|
+
const timeout = setTimeout(abort, ms);
|
|
512
502
|
|
|
513
503
|
const isReadableBody =
|
|
514
504
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -731,16 +721,10 @@ export class Inconvo {
|
|
|
731
721
|
|
|
732
722
|
static toFile = Uploads.toFile;
|
|
733
723
|
|
|
734
|
-
conversations: API.Conversations = new API.Conversations(this);
|
|
735
|
-
mcpServers: API.McpServers = new API.McpServers(this);
|
|
736
724
|
agents: API.Agents = new API.Agents(this);
|
|
737
|
-
datasets: API.Datasets = new API.Datasets(this);
|
|
738
725
|
}
|
|
739
726
|
|
|
740
|
-
Inconvo.Conversations = Conversations;
|
|
741
|
-
Inconvo.McpServers = McpServers;
|
|
742
727
|
Inconvo.Agents = Agents;
|
|
743
|
-
Inconvo.Datasets = Datasets;
|
|
744
728
|
|
|
745
729
|
export declare namespace Inconvo {
|
|
746
730
|
export type RequestOptions = Opts.RequestOptions;
|
|
@@ -751,19 +735,5 @@ export declare namespace Inconvo {
|
|
|
751
735
|
type ConversationsCursorResponse as ConversationsCursorResponse,
|
|
752
736
|
};
|
|
753
737
|
|
|
754
|
-
export {
|
|
755
|
-
Conversations as Conversations,
|
|
756
|
-
type InconvoConversation as InconvoConversation,
|
|
757
|
-
type ConversationCreateResponse as ConversationCreateResponse,
|
|
758
|
-
type ConversationListResponse as ConversationListResponse,
|
|
759
|
-
type ConversationListResponsesConversationsCursor as ConversationListResponsesConversationsCursor,
|
|
760
|
-
type ConversationCreateParams as ConversationCreateParams,
|
|
761
|
-
type ConversationListParams as ConversationListParams,
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
export { McpServers as McpServers };
|
|
765
|
-
|
|
766
738
|
export { Agents as Agents };
|
|
767
|
-
|
|
768
|
-
export { Datasets as Datasets };
|
|
769
739
|
}
|
package/src/index.ts
CHANGED
package/src/internal/parse.ts
CHANGED
|
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Inconvo, props: APIRespons
|
|
|
29
29
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
30
30
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
31
31
|
if (isJSON) {
|
|
32
|
+
const contentLength = response.headers.get('content-length');
|
|
33
|
+
if (contentLength === '0') {
|
|
34
|
+
// if there is no content we can't do anything
|
|
35
|
+
return undefined as T;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json as T;
|
|
34
40
|
}
|
|
@@ -3,13 +3,49 @@
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as DataSummaryAPI from './data-summary';
|
|
5
5
|
import { DataSummary, DataSummaryRetrieveResponse } from './data-summary';
|
|
6
|
+
import * as ConversationsAPI from './conversations/conversations';
|
|
7
|
+
import {
|
|
8
|
+
ConversationCreateParams,
|
|
9
|
+
ConversationCreateResponse,
|
|
10
|
+
ConversationListParams,
|
|
11
|
+
ConversationListResponse,
|
|
12
|
+
ConversationListResponsesConversationsCursor,
|
|
13
|
+
ConversationRetrieveParams,
|
|
14
|
+
Conversations,
|
|
15
|
+
InconvoConversation,
|
|
16
|
+
} from './conversations/conversations';
|
|
17
|
+
import * as DatasetsAPI from './datasets/datasets';
|
|
18
|
+
import { Datasets } from './datasets/datasets';
|
|
19
|
+
import * as McpServersAPI from './mcp-servers/mcp-servers';
|
|
20
|
+
import { McpServers } from './mcp-servers/mcp-servers';
|
|
6
21
|
|
|
7
22
|
export class Agents extends APIResource {
|
|
8
23
|
dataSummary: DataSummaryAPI.DataSummary = new DataSummaryAPI.DataSummary(this._client);
|
|
24
|
+
conversations: ConversationsAPI.Conversations = new ConversationsAPI.Conversations(this._client);
|
|
25
|
+
datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client);
|
|
26
|
+
mcpServers: McpServersAPI.McpServers = new McpServersAPI.McpServers(this._client);
|
|
9
27
|
}
|
|
10
28
|
|
|
11
29
|
Agents.DataSummary = DataSummary;
|
|
30
|
+
Agents.Conversations = Conversations;
|
|
31
|
+
Agents.Datasets = Datasets;
|
|
32
|
+
Agents.McpServers = McpServers;
|
|
12
33
|
|
|
13
34
|
export declare namespace Agents {
|
|
14
35
|
export { DataSummary as DataSummary, type DataSummaryRetrieveResponse as DataSummaryRetrieveResponse };
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
Conversations as Conversations,
|
|
39
|
+
type InconvoConversation as InconvoConversation,
|
|
40
|
+
type ConversationCreateResponse as ConversationCreateResponse,
|
|
41
|
+
type ConversationListResponse as ConversationListResponse,
|
|
42
|
+
type ConversationListResponsesConversationsCursor as ConversationListResponsesConversationsCursor,
|
|
43
|
+
type ConversationCreateParams as ConversationCreateParams,
|
|
44
|
+
type ConversationRetrieveParams as ConversationRetrieveParams,
|
|
45
|
+
type ConversationListParams as ConversationListParams,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { Datasets as Datasets };
|
|
49
|
+
|
|
50
|
+
export { McpServers as McpServers };
|
|
15
51
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as ResponseAPI from './response/response';
|
|
5
5
|
import {
|
|
6
6
|
Chart,
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
ResponseRetrieveResponse,
|
|
12
12
|
Table,
|
|
13
13
|
} from './response/response';
|
|
14
|
-
import { APIPromise } from '
|
|
15
|
-
import { ConversationsCursor, type ConversationsCursorParams, PagePromise } from '
|
|
16
|
-
import { RequestOptions } from '
|
|
17
|
-
import { path } from '
|
|
14
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
15
|
+
import { ConversationsCursor, type ConversationsCursorParams, PagePromise } from '../../../core/pagination';
|
|
16
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
17
|
+
import { path } from '../../../internal/utils/path';
|
|
18
18
|
|
|
19
19
|
export class Conversations extends APIResource {
|
|
20
20
|
response: ResponseAPI.Response = new ResponseAPI.Response(this._client);
|
|
@@ -24,13 +24,18 @@ export class Conversations extends APIResource {
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```ts
|
|
27
|
-
* const conversation =
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* const conversation =
|
|
28
|
+
* await client.agents.conversations.create('agentId', {
|
|
29
|
+
* userIdentifier: 'user_123',
|
|
30
|
+
* });
|
|
30
31
|
* ```
|
|
31
32
|
*/
|
|
32
|
-
create(
|
|
33
|
-
|
|
33
|
+
create(
|
|
34
|
+
agentID: string,
|
|
35
|
+
body: ConversationCreateParams,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<ConversationCreateResponse> {
|
|
38
|
+
return this._client.post(path`/agents/${agentID}/conversations`, { body, ...options });
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
/**
|
|
@@ -39,11 +44,18 @@ export class Conversations extends APIResource {
|
|
|
39
44
|
* @example
|
|
40
45
|
* ```ts
|
|
41
46
|
* const inconvoConversation =
|
|
42
|
-
* await client.conversations.retrieve('id'
|
|
47
|
+
* await client.agents.conversations.retrieve('id', {
|
|
48
|
+
* agentId: 'agentId',
|
|
49
|
+
* });
|
|
43
50
|
* ```
|
|
44
51
|
*/
|
|
45
|
-
retrieve(
|
|
46
|
-
|
|
52
|
+
retrieve(
|
|
53
|
+
id: string,
|
|
54
|
+
params: ConversationRetrieveParams,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): APIPromise<InconvoConversation> {
|
|
57
|
+
const { agentId } = params;
|
|
58
|
+
return this._client.get(path`/agents/${agentId}/conversations/${id}`, options);
|
|
47
59
|
}
|
|
48
60
|
|
|
49
61
|
/**
|
|
@@ -52,19 +64,23 @@ export class Conversations extends APIResource {
|
|
|
52
64
|
* @example
|
|
53
65
|
* ```ts
|
|
54
66
|
* // Automatically fetches more pages as needed.
|
|
55
|
-
* for await (const conversationListResponse of client.conversations.list(
|
|
67
|
+
* for await (const conversationListResponse of client.agents.conversations.list(
|
|
68
|
+
* 'agentId',
|
|
69
|
+
* )) {
|
|
56
70
|
* // ...
|
|
57
71
|
* }
|
|
58
72
|
* ```
|
|
59
73
|
*/
|
|
60
74
|
list(
|
|
75
|
+
agentID: string,
|
|
61
76
|
query: ConversationListParams | null | undefined = {},
|
|
62
77
|
options?: RequestOptions,
|
|
63
78
|
): PagePromise<ConversationListResponsesConversationsCursor, ConversationListResponse> {
|
|
64
|
-
return this._client.getAPIList(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
return this._client.getAPIList(
|
|
80
|
+
path`/agents/${agentID}/conversations`,
|
|
81
|
+
ConversationsCursor<ConversationListResponse>,
|
|
82
|
+
{ query, ...options },
|
|
83
|
+
);
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
86
|
|
|
@@ -75,7 +91,10 @@ export interface InconvoConversation {
|
|
|
75
91
|
|
|
76
92
|
messages: Array<InconvoConversation.Message>;
|
|
77
93
|
|
|
78
|
-
|
|
94
|
+
/**
|
|
95
|
+
* User context values (null when user context is disabled)
|
|
96
|
+
*/
|
|
97
|
+
userContext: { [key: string]: string | number } | null;
|
|
79
98
|
|
|
80
99
|
/**
|
|
81
100
|
* Unique identifier for the end-user (may be null for legacy conversations)
|
|
@@ -114,7 +133,10 @@ export interface ConversationListResponse {
|
|
|
114
133
|
|
|
115
134
|
title: string;
|
|
116
135
|
|
|
117
|
-
|
|
136
|
+
/**
|
|
137
|
+
* User context values (null when user context is disabled)
|
|
138
|
+
*/
|
|
139
|
+
userContext: { [key: string]: string | number } | null;
|
|
118
140
|
|
|
119
141
|
/**
|
|
120
142
|
* Unique identifier for the end-user (may be null for legacy conversations)
|
|
@@ -130,11 +152,20 @@ export interface ConversationCreateParams {
|
|
|
130
152
|
userIdentifier: string;
|
|
131
153
|
|
|
132
154
|
/**
|
|
133
|
-
* Optional context key-values for additional filtering/tenancy.
|
|
155
|
+
* Optional context key-values for additional filtering/tenancy. Required when User
|
|
156
|
+
* Context status is ENABLED. Must be omitted when User Context status is DISABLED.
|
|
157
|
+
* Requests fail when User Context is UNSET.
|
|
134
158
|
*/
|
|
135
159
|
userContext?: { [key: string]: unknown };
|
|
136
160
|
}
|
|
137
161
|
|
|
162
|
+
export interface ConversationRetrieveParams {
|
|
163
|
+
/**
|
|
164
|
+
* The unique identifier of the agent
|
|
165
|
+
*/
|
|
166
|
+
agentId: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
138
169
|
export interface ConversationListParams extends ConversationsCursorParams {
|
|
139
170
|
/**
|
|
140
171
|
* Arbitrary userContext filters, encoded as a deep object. Example: GET
|
|
@@ -157,6 +188,7 @@ export declare namespace Conversations {
|
|
|
157
188
|
type ConversationListResponse as ConversationListResponse,
|
|
158
189
|
type ConversationListResponsesConversationsCursor as ConversationListResponsesConversationsCursor,
|
|
159
190
|
type ConversationCreateParams as ConversationCreateParams,
|
|
191
|
+
type ConversationRetrieveParams as ConversationRetrieveParams,
|
|
160
192
|
type ConversationListParams as ConversationListParams,
|
|
161
193
|
};
|
|
162
194
|
|