@orq-ai/node 4.2.0-rc.29 → 4.2.0-rc.30
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/FUNCTIONS.md +7 -17
- package/README.md +82 -118
- package/bin/mcp-server.js +1687 -692
- package/bin/mcp-server.js.map +67 -49
- package/examples/feedbackCreate.example.ts +32 -0
- package/examples/package-lock.json +2 -2
- package/funcs/contactsCreate.d.ts +2 -0
- package/funcs/contactsCreate.d.ts.map +1 -1
- package/funcs/contactsCreate.js +2 -0
- package/funcs/contactsCreate.js.map +1 -1
- package/funcs/contactsDelete.d.ts +2 -0
- package/funcs/contactsDelete.d.ts.map +1 -1
- package/funcs/contactsDelete.js +2 -0
- package/funcs/contactsDelete.js.map +1 -1
- package/funcs/contactsList.d.ts +2 -0
- package/funcs/contactsList.d.ts.map +1 -1
- package/funcs/contactsList.js +2 -0
- package/funcs/contactsList.js.map +1 -1
- package/funcs/contactsRetrieve.d.ts +2 -0
- package/funcs/contactsRetrieve.d.ts.map +1 -1
- package/funcs/contactsRetrieve.js +2 -0
- package/funcs/contactsRetrieve.js.map +1 -1
- package/funcs/contactsUpdate.d.ts +2 -0
- package/funcs/contactsUpdate.d.ts.map +1 -1
- package/funcs/contactsUpdate.js +2 -0
- package/funcs/contactsUpdate.js.map +1 -1
- package/funcs/identitiesCreate.d.ts +17 -0
- package/funcs/identitiesCreate.d.ts.map +1 -0
- package/funcs/identitiesCreate.js +116 -0
- package/funcs/identitiesCreate.js.map +1 -0
- package/funcs/identitiesDelete.d.ts +18 -0
- package/funcs/identitiesDelete.d.ts.map +1 -0
- package/funcs/identitiesDelete.js +124 -0
- package/funcs/identitiesDelete.js.map +1 -0
- package/funcs/identitiesList.d.ts +17 -0
- package/funcs/identitiesList.d.ts.map +1 -0
- package/funcs/identitiesList.js +122 -0
- package/funcs/identitiesList.js.map +1 -0
- package/funcs/identitiesRetrieve.d.ts +18 -0
- package/funcs/identitiesRetrieve.d.ts.map +1 -0
- package/funcs/identitiesRetrieve.js +123 -0
- package/funcs/identitiesRetrieve.js.map +1 -0
- package/funcs/identitiesUpdate.d.ts +18 -0
- package/funcs/identitiesUpdate.d.ts.map +1 -0
- package/funcs/identitiesUpdate.js +124 -0
- package/funcs/identitiesUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +11 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/identitiesCreate.d.ts +8 -0
- package/mcp-server/tools/identitiesCreate.d.ts.map +1 -0
- package/mcp-server/tools/identitiesCreate.js +64 -0
- package/mcp-server/tools/identitiesCreate.js.map +1 -0
- package/mcp-server/tools/identitiesDelete.d.ts +8 -0
- package/mcp-server/tools/identitiesDelete.d.ts.map +1 -0
- package/mcp-server/tools/identitiesDelete.js +63 -0
- package/mcp-server/tools/identitiesDelete.js.map +1 -0
- package/mcp-server/tools/identitiesList.d.ts +8 -0
- package/mcp-server/tools/identitiesList.d.ts.map +1 -0
- package/mcp-server/tools/identitiesList.js +64 -0
- package/mcp-server/tools/identitiesList.js.map +1 -0
- package/mcp-server/tools/identitiesRetrieve.d.ts +8 -0
- package/mcp-server/tools/identitiesRetrieve.d.ts.map +1 -0
- package/mcp-server/tools/identitiesRetrieve.js +64 -0
- package/mcp-server/tools/identitiesRetrieve.js.map +1 -0
- package/mcp-server/tools/identitiesUpdate.d.ts +8 -0
- package/mcp-server/tools/identitiesUpdate.d.ts.map +1 -0
- package/mcp-server/tools/identitiesUpdate.js +64 -0
- package/mcp-server/tools/identitiesUpdate.js.map +1 -0
- package/models/components/conversationresponse.js +2 -2
- package/models/components/conversationwithmessagesresponse.js +2 -2
- package/models/components/partdoneevent.js +2 -2
- package/models/components/reasoningpart.js +2 -2
- package/models/errors/deleteidentity.d.ts +36 -0
- package/models/errors/deleteidentity.d.ts.map +1 -0
- package/models/errors/deleteidentity.js +77 -0
- package/models/errors/deleteidentity.js.map +1 -0
- package/models/errors/index.d.ts +3 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +3 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/retrieveidentity.d.ts +36 -0
- package/models/errors/retrieveidentity.d.ts.map +1 -0
- package/models/errors/retrieveidentity.js +77 -0
- package/models/errors/retrieveidentity.js.map +1 -0
- package/models/errors/updateidentity.d.ts +32 -0
- package/models/errors/updateidentity.d.ts.map +1 -0
- package/models/errors/updateidentity.js +74 -0
- package/models/errors/updateidentity.js.map +1 -0
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createconversation.js +2 -2
- package/models/operations/createconversationresponse.js +4 -4
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createidentity.d.ts +120 -0
- package/models/operations/createidentity.d.ts.map +1 -0
- package/models/operations/createidentity.js +133 -0
- package/models/operations/createidentity.js.map +1 -0
- package/models/operations/createtool.js +12 -12
- package/models/operations/deleteidentity.d.ts +20 -0
- package/models/operations/deleteidentity.d.ts.map +1 -0
- package/models/operations/deleteidentity.js +58 -0
- package/models/operations/deleteidentity.js.map +1 -0
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/generateconversationname.js +2 -2
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getevals.js +28 -28
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listcontacts.d.ts +8 -8
- package/models/operations/listcontacts.d.ts.map +1 -1
- package/models/operations/listcontacts.js +15 -13
- package/models/operations/listcontacts.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/listidentities.d.ts +183 -0
- package/models/operations/listidentities.d.ts.map +1 -0
- package/models/operations/listidentities.js +220 -0
- package/models/operations/listidentities.js.map +1 -0
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrieveidentity.d.ts +83 -0
- package/models/operations/retrieveidentity.d.ts.map +1 -0
- package/models/operations/retrieveidentity.js +107 -0
- package/models/operations/retrieveidentity.js.map +1 -0
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.js +2 -2
- package/models/operations/streamrunagent.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updateconversation.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updateidentity.d.ts +131 -0
- package/models/operations/updateidentity.d.ts.map +1 -0
- package/models/operations/updateidentity.js +152 -0
- package/models/operations/updateidentity.js.map +1 -0
- package/models/operations/updatetool.js +14 -14
- package/package.json +2 -2
- package/sdk/contacts.d.ts +10 -0
- package/sdk/contacts.d.ts.map +1 -1
- package/sdk/contacts.js +10 -0
- package/sdk/contacts.js.map +1 -1
- package/sdk/identities.d.ts +40 -0
- package/sdk/identities.d.ts.map +1 -0
- package/sdk/identities.js +62 -0
- package/sdk/identities.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/contactsCreate.ts +2 -0
- package/src/funcs/contactsDelete.ts +2 -0
- package/src/funcs/contactsList.ts +2 -0
- package/src/funcs/contactsRetrieve.ts +2 -0
- package/src/funcs/contactsUpdate.ts +2 -0
- package/src/funcs/identitiesCreate.ts +165 -0
- package/src/funcs/identitiesDelete.ts +176 -0
- package/src/funcs/identitiesList.ts +170 -0
- package/src/funcs/identitiesRetrieve.ts +175 -0
- package/src/funcs/identitiesUpdate.ts +176 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +11 -1
- package/src/mcp-server/tools/identitiesCreate.ts +37 -0
- package/src/mcp-server/tools/identitiesDelete.ts +35 -0
- package/src/mcp-server/tools/identitiesList.ts +37 -0
- package/src/mcp-server/tools/identitiesRetrieve.ts +37 -0
- package/src/mcp-server/tools/identitiesUpdate.ts +37 -0
- package/src/models/components/conversationresponse.ts +2 -2
- package/src/models/components/conversationwithmessagesresponse.ts +2 -2
- package/src/models/components/partdoneevent.ts +2 -2
- package/src/models/components/reasoningpart.ts +2 -2
- package/src/models/errors/deleteidentity.ts +78 -0
- package/src/models/errors/index.ts +3 -0
- package/src/models/errors/retrieveidentity.ts +78 -0
- package/src/models/errors/updateidentity.ts +70 -0
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createconversation.ts +2 -2
- package/src/models/operations/createconversationresponse.ts +4 -4
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createidentity.ts +237 -0
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/deleteidentity.ts +54 -0
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/generateconversationname.ts +2 -2
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/listcontacts.ts +24 -20
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/listidentities.ts +432 -0
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrieveidentity.ts +180 -0
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +2 -2
- package/src/models/operations/streamrunagent.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updateconversation.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updateidentity.ts +281 -0
- package/src/models/operations/updatetool.ts +14 -14
- package/src/sdk/contacts.ts +10 -0
- package/src/sdk/identities.ts +99 -0
- package/src/sdk/sdk.ts +6 -0
- package/examples/contactsCreate.example.ts +0 -42
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve an identity
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Retrieves detailed information about a specific identity using their identity ID or external ID from your system.
|
|
33
|
+
*/
|
|
34
|
+
export function identitiesRetrieve(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: operations.RetrieveIdentityRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.RetrieveIdentityResponseBody,
|
|
41
|
+
| errors.RetrieveIdentityResponseBody
|
|
42
|
+
| OrqError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: OrqCore,
|
|
61
|
+
request: operations.RetrieveIdentityRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.RetrieveIdentityResponseBody,
|
|
67
|
+
| errors.RetrieveIdentityResponseBody
|
|
68
|
+
| OrqError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) => operations.RetrieveIdentityRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = null;
|
|
90
|
+
|
|
91
|
+
const pathParams = {
|
|
92
|
+
id: encodeSimple("id", payload.id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v2/identities/{id}")(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
105
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "RetrieveIdentity",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.apiKey,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "GET",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
141
|
+
retryConfig: context.retryConfig,
|
|
142
|
+
retryCodes: context.retryCodes,
|
|
143
|
+
});
|
|
144
|
+
if (!doResult.ok) {
|
|
145
|
+
return [doResult, { status: "request-error", request: req }];
|
|
146
|
+
}
|
|
147
|
+
const response = doResult.value;
|
|
148
|
+
|
|
149
|
+
const responseFields = {
|
|
150
|
+
HttpMeta: { Response: response, Request: req },
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const [result] = await M.match<
|
|
154
|
+
operations.RetrieveIdentityResponseBody,
|
|
155
|
+
| errors.RetrieveIdentityResponseBody
|
|
156
|
+
| OrqError
|
|
157
|
+
| ResponseValidationError
|
|
158
|
+
| ConnectionError
|
|
159
|
+
| RequestAbortedError
|
|
160
|
+
| RequestTimeoutError
|
|
161
|
+
| InvalidRequestError
|
|
162
|
+
| UnexpectedClientError
|
|
163
|
+
| SDKValidationError
|
|
164
|
+
>(
|
|
165
|
+
M.json(200, operations.RetrieveIdentityResponseBody$inboundSchema),
|
|
166
|
+
M.jsonErr(404, errors.RetrieveIdentityResponseBody$inboundSchema),
|
|
167
|
+
M.fail("4XX"),
|
|
168
|
+
M.fail("5XX"),
|
|
169
|
+
)(response, req, { extraFields: responseFields });
|
|
170
|
+
if (!result.ok) {
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return [result, { status: "complete", request: req, response }];
|
|
175
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Update an identity
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Updates specific fields of an existing identity. Only the fields provided in the request body will be updated.
|
|
33
|
+
*/
|
|
34
|
+
export function identitiesUpdate(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: operations.UpdateIdentityRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.UpdateIdentityResponseBody,
|
|
41
|
+
| errors.UpdateIdentityResponseBody
|
|
42
|
+
| OrqError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: OrqCore,
|
|
61
|
+
request: operations.UpdateIdentityRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.UpdateIdentityResponseBody,
|
|
67
|
+
| errors.UpdateIdentityResponseBody
|
|
68
|
+
| OrqError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) => operations.UpdateIdentityRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
90
|
+
|
|
91
|
+
const pathParams = {
|
|
92
|
+
id: encodeSimple("id", payload.id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v2/identities/{id}")(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "UpdateIdentity",
|
|
113
|
+
oAuth2Scopes: null,
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "PATCH",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const responseFields = {
|
|
151
|
+
HttpMeta: { Response: response, Request: req },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
operations.UpdateIdentityResponseBody,
|
|
156
|
+
| errors.UpdateIdentityResponseBody
|
|
157
|
+
| OrqError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.json(200, operations.UpdateIdentityResponseBody$inboundSchema),
|
|
167
|
+
M.jsonErr(404, errors.UpdateIdentityResponseBody$inboundSchema),
|
|
168
|
+
M.fail("4XX"),
|
|
169
|
+
M.fail("5XX"),
|
|
170
|
+
)(response, req, { extraFields: responseFields });
|
|
171
|
+
if (!result.ok) {
|
|
172
|
+
return [result, { status: "complete", request: req, response }];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return [result, { status: "complete", request: req, response }];
|
|
176
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
68
68
|
export const SDK_METADATA = {
|
|
69
69
|
language: "typescript",
|
|
70
70
|
openapiDocVersion: "2.0",
|
|
71
|
-
sdkVersion: "4.2.0-rc.
|
|
72
|
-
genVersion: "2.
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 4.2.0-rc.
|
|
71
|
+
sdkVersion: "4.2.0-rc.30",
|
|
72
|
+
genVersion: "2.795.8",
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 4.2.0-rc.30 2.795.8 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -63,6 +63,11 @@ import { tool$filesCreate } from "./tools/filesCreate.js";
|
|
|
63
63
|
import { tool$filesDelete } from "./tools/filesDelete.js";
|
|
64
64
|
import { tool$filesGet } from "./tools/filesGet.js";
|
|
65
65
|
import { tool$filesList } from "./tools/filesList.js";
|
|
66
|
+
import { tool$identitiesCreate } from "./tools/identitiesCreate.js";
|
|
67
|
+
import { tool$identitiesDelete } from "./tools/identitiesDelete.js";
|
|
68
|
+
import { tool$identitiesList } from "./tools/identitiesList.js";
|
|
69
|
+
import { tool$identitiesRetrieve } from "./tools/identitiesRetrieve.js";
|
|
70
|
+
import { tool$identitiesUpdate } from "./tools/identitiesUpdate.js";
|
|
66
71
|
import { tool$knowledgeCreate } from "./tools/knowledgeCreate.js";
|
|
67
72
|
import { tool$knowledgeCreateChunks } from "./tools/knowledgeCreateChunks.js";
|
|
68
73
|
import { tool$knowledgeCreateDatasource } from "./tools/knowledgeCreateDatasource.js";
|
|
@@ -128,7 +133,7 @@ export function createMCPServer(deps: {
|
|
|
128
133
|
}) {
|
|
129
134
|
const server = new McpServer({
|
|
130
135
|
name: "Orq",
|
|
131
|
-
version: "4.2.0-rc.
|
|
136
|
+
version: "4.2.0-rc.30",
|
|
132
137
|
});
|
|
133
138
|
|
|
134
139
|
const client = new OrqCore({
|
|
@@ -172,6 +177,11 @@ export function createMCPServer(deps: {
|
|
|
172
177
|
tool(tool$evalsDelete);
|
|
173
178
|
tool(tool$evalsInvoke);
|
|
174
179
|
tool(tool$evaluatorsGetV2EvaluatorsIdVersions);
|
|
180
|
+
tool(tool$identitiesList);
|
|
181
|
+
tool(tool$identitiesCreate);
|
|
182
|
+
tool(tool$identitiesRetrieve);
|
|
183
|
+
tool(tool$identitiesUpdate);
|
|
184
|
+
tool(tool$identitiesDelete);
|
|
175
185
|
tool(tool$deploymentsInvoke);
|
|
176
186
|
tool(tool$deploymentsList);
|
|
177
187
|
tool(tool$deploymentsGetConfig);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { identitiesCreate } from "../../funcs/identitiesCreate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateIdentityRequestBody$inboundSchema.optional(),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$identitiesCreate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "identities-create",
|
|
15
|
+
description: `Create an identity
|
|
16
|
+
|
|
17
|
+
Creates a new identity with a unique external_id. If an identity with the same external_id already exists, the operation will fail. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await identitiesCreate(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { identitiesDelete } from "../../funcs/identitiesDelete.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.DeleteIdentityRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$identitiesDelete: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "identities-delete",
|
|
15
|
+
description: `Delete an identity
|
|
16
|
+
|
|
17
|
+
Permanently deletes an identity from your workspace and cleans up associated budget configurations. This action cannot be undone.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await identitiesDelete(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return formatResult(void 0, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { identitiesList } from "../../funcs/identitiesList.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListIdentitiesRequest$inboundSchema.optional(),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$identitiesList: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "identities-list",
|
|
15
|
+
description: `List identities
|
|
16
|
+
|
|
17
|
+
Retrieves a paginated list of identities in your workspace. Use pagination parameters to navigate through large identity lists efficiently.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await identitiesList(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { identitiesRetrieve } from "../../funcs/identitiesRetrieve.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.RetrieveIdentityRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$identitiesRetrieve: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "identities-retrieve",
|
|
15
|
+
description: `Retrieve an identity
|
|
16
|
+
|
|
17
|
+
Retrieves detailed information about a specific identity using their identity ID or external ID from your system.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await identitiesRetrieve(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { identitiesUpdate } from "../../funcs/identitiesUpdate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.UpdateIdentityRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$identitiesUpdate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "identities-update",
|
|
15
|
+
description: `Update an identity
|
|
16
|
+
|
|
17
|
+
Updates specific fields of an existing identity. Only the fields provided in the request body will be updated.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await identitiesUpdate(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -131,7 +131,7 @@ export const ConversationResponse$inboundSchema: z.ZodType<
|
|
|
131
131
|
z.ZodTypeDef,
|
|
132
132
|
unknown
|
|
133
133
|
> = z.object({
|
|
134
|
-
_id: z.string().default("
|
|
134
|
+
_id: z.string().default("conv_01kezxqgb08gx8ew5nvaznhq1j"),
|
|
135
135
|
kind: ConversationResponseKind$inboundSchema,
|
|
136
136
|
displayName: z.string(),
|
|
137
137
|
createdAt: z.number(),
|
|
@@ -162,7 +162,7 @@ export const ConversationResponse$outboundSchema: z.ZodType<
|
|
|
162
162
|
z.ZodTypeDef,
|
|
163
163
|
ConversationResponse
|
|
164
164
|
> = z.object({
|
|
165
|
-
id: z.string().default("
|
|
165
|
+
id: z.string().default("conv_01kezxqgb08gx8ew5nvaznhq1j"),
|
|
166
166
|
kind: ConversationResponseKind$outboundSchema,
|
|
167
167
|
displayName: z.string(),
|
|
168
168
|
createdAt: z.number(),
|
|
@@ -155,7 +155,7 @@ export const ConversationWithMessagesResponse$inboundSchema: z.ZodType<
|
|
|
155
155
|
z.ZodTypeDef,
|
|
156
156
|
unknown
|
|
157
157
|
> = z.object({
|
|
158
|
-
_id: z.string().default("
|
|
158
|
+
_id: z.string().default("conv_01kezxqgb67f3qeebxskzc5v1r"),
|
|
159
159
|
kind: ConversationWithMessagesResponseKind$inboundSchema,
|
|
160
160
|
displayName: z.string(),
|
|
161
161
|
createdAt: z.number(),
|
|
@@ -189,7 +189,7 @@ export const ConversationWithMessagesResponse$outboundSchema: z.ZodType<
|
|
|
189
189
|
z.ZodTypeDef,
|
|
190
190
|
ConversationWithMessagesResponse
|
|
191
191
|
> = z.object({
|
|
192
|
-
id: z.string().default("
|
|
192
|
+
id: z.string().default("conv_01kezxqgb67f3qeebxskzc5v1r"),
|
|
193
193
|
kind: ConversationWithMessagesResponseKind$outboundSchema,
|
|
194
194
|
displayName: z.string(),
|
|
195
195
|
createdAt: z.number(),
|
|
@@ -79,7 +79,7 @@ export const PartReasoningPart$inboundSchema: z.ZodType<
|
|
|
79
79
|
z.ZodTypeDef,
|
|
80
80
|
unknown
|
|
81
81
|
> = z.object({
|
|
82
|
-
_id: z.string().default("
|
|
82
|
+
_id: z.string().default("reasoning_01kezxqfz85kehwvprzc4smnxa"),
|
|
83
83
|
metadata: z.record(z.any()).optional(),
|
|
84
84
|
kind: PartKind$inboundSchema,
|
|
85
85
|
reasoning: z.string(),
|
|
@@ -104,7 +104,7 @@ export const PartReasoningPart$outboundSchema: z.ZodType<
|
|
|
104
104
|
z.ZodTypeDef,
|
|
105
105
|
PartReasoningPart
|
|
106
106
|
> = z.object({
|
|
107
|
-
id: z.string().default("
|
|
107
|
+
id: z.string().default("reasoning_01kezxqfz85kehwvprzc4smnxa"),
|
|
108
108
|
metadata: z.record(z.any()).optional(),
|
|
109
109
|
kind: PartKind$outboundSchema,
|
|
110
110
|
reasoning: z.string(),
|
|
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
|
|
|
40
40
|
z.ZodTypeDef,
|
|
41
41
|
unknown
|
|
42
42
|
> = z.object({
|
|
43
|
-
_id: z.string().default("
|
|
43
|
+
_id: z.string().default("reasoning_01kezxqfz1cb8hpqcbav2dq58n"),
|
|
44
44
|
metadata: z.record(z.any()).optional(),
|
|
45
45
|
kind: z.literal("reasoning"),
|
|
46
46
|
reasoning: z.string(),
|
|
@@ -65,7 +65,7 @@ export const ReasoningPart$outboundSchema: z.ZodType<
|
|
|
65
65
|
z.ZodTypeDef,
|
|
66
66
|
ReasoningPart
|
|
67
67
|
> = z.object({
|
|
68
|
-
id: z.string().default("
|
|
68
|
+
id: z.string().default("reasoning_01kezxqfz1cb8hpqcbav2dq58n"),
|
|
69
69
|
metadata: z.record(z.any()).optional(),
|
|
70
70
|
kind: z.literal("reasoning"),
|
|
71
71
|
reasoning: z.string(),
|