@orq-ai/node 3.6.5 → 3.6.7
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 +5 -22
- package/README.md +45 -47
- package/bin/mcp-server.js +43 -43
- package/bin/mcp-server.js.map +23 -23
- package/docs/sdks/contacts/README.md +5 -9
- package/docs/sdks/datasets/README.md +65 -111
- package/docs/sdks/deployments/README.md +34 -44
- package/docs/sdks/feedback/README.md +5 -9
- package/docs/sdks/files/README.md +20 -34
- package/docs/sdks/knowledge/README.md +80 -138
- package/docs/sdks/metrics/README.md +5 -9
- package/docs/sdks/models/README.md +5 -9
- package/docs/sdks/prompts/README.md +35 -61
- package/docs/sdks/remoteconfigs/README.md +5 -9
- 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.js +1 -1
- package/models/errors/apierror.d.ts +14 -2
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +1 -1
- package/models/errors/apierror.js.map +1 -1
- package/models/operations/bulkcreatedatapoints.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/package.json +1 -1
- package/packages/orq-rc/FUNCTIONS.md +5 -22
- package/packages/orq-rc/README.md +129 -47
- package/packages/orq-rc/docs/sdks/contacts/README.md +344 -11
- package/packages/orq-rc/docs/sdks/datasets/README.md +60 -102
- package/packages/orq-rc/docs/sdks/deployments/README.md +34 -44
- package/packages/orq-rc/docs/sdks/evals/README.md +175 -315
- package/packages/orq-rc/docs/sdks/feedback/README.md +5 -9
- package/packages/orq-rc/docs/sdks/files/README.md +20 -34
- package/packages/orq-rc/docs/sdks/knowledge/README.md +80 -138
- package/packages/orq-rc/docs/sdks/metrics/README.md +5 -9
- package/packages/orq-rc/docs/sdks/models/README.md +5 -9
- package/packages/orq-rc/docs/sdks/prompts/README.md +35 -61
- package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +5 -9
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/contactsCreate.ts +12 -7
- package/packages/orq-rc/src/funcs/contactsDelete.ts +172 -0
- package/packages/orq-rc/src/funcs/contactsList.ts +165 -0
- package/packages/orq-rc/src/funcs/contactsRetrieve.ts +171 -0
- package/packages/orq-rc/src/funcs/contactsUpdate.ts +172 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +9 -1
- package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +3 -3
- package/packages/orq-rc/src/mcp-server/tools/contactsDelete.ts +35 -0
- package/packages/orq-rc/src/mcp-server/tools/contactsList.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/contactsRetrieve.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/contactsUpdate.ts +37 -0
- package/packages/orq-rc/src/models/errors/apierror.ts +18 -3
- package/packages/orq-rc/src/models/errors/deletecontact.ts +81 -0
- package/packages/orq-rc/src/models/errors/index.ts +3 -0
- package/packages/orq-rc/src/models/errors/retrievecontact.ts +81 -0
- package/packages/orq-rc/src/models/errors/updatecontact.ts +74 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +30 -19
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/deletecontact.ts +69 -0
- package/packages/orq-rc/src/models/operations/deployments.ts +69 -59
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/index.ts +4 -0
- package/packages/orq-rc/src/models/operations/listcontacts.ts +490 -0
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +210 -0
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +325 -0
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/sdk/contacts.ts +75 -3
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/errors/apierror.ts +18 -3
- package/src/models/operations/bulkcreatedatapoints.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- 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/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
|
@@ -0,0 +1,171 @@
|
|
|
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 { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a contact
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Retrieves detailed information about a specific contact using their contact ID or external ID from your system.
|
|
32
|
+
*/
|
|
33
|
+
export function contactsRetrieve(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request: operations.RetrieveContactRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.RetrieveContactResponseBody,
|
|
40
|
+
| errors.RetrieveContactResponseBody
|
|
41
|
+
| APIError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request: operations.RetrieveContactRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.RetrieveContactResponseBody,
|
|
65
|
+
| errors.RetrieveContactResponseBody
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.RetrieveContactRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
id: encodeSimple("id", payload.id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/v2/contacts/{id}")(pathParams);
|
|
96
|
+
|
|
97
|
+
const headers = new Headers(compactMap({
|
|
98
|
+
Accept: "application/json",
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
102
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
103
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
+
|
|
105
|
+
const context = {
|
|
106
|
+
options: client._options,
|
|
107
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
108
|
+
operationID: "RetrieveContact",
|
|
109
|
+
oAuth2Scopes: [],
|
|
110
|
+
|
|
111
|
+
resolvedSecurity: requestSecurity,
|
|
112
|
+
|
|
113
|
+
securitySource: client._options.apiKey,
|
|
114
|
+
retryConfig: options?.retries
|
|
115
|
+
|| client._options.retryConfig
|
|
116
|
+
|| { strategy: "none" },
|
|
117
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const requestRes = client._createRequest(context, {
|
|
121
|
+
security: requestSecurity,
|
|
122
|
+
method: "GET",
|
|
123
|
+
baseURL: options?.serverURL,
|
|
124
|
+
path: path,
|
|
125
|
+
headers: headers,
|
|
126
|
+
body: body,
|
|
127
|
+
userAgent: client._options.userAgent,
|
|
128
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
129
|
+
}, options);
|
|
130
|
+
if (!requestRes.ok) {
|
|
131
|
+
return [requestRes, { status: "invalid" }];
|
|
132
|
+
}
|
|
133
|
+
const req = requestRes.value;
|
|
134
|
+
|
|
135
|
+
const doResult = await client._do(req, {
|
|
136
|
+
context,
|
|
137
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
138
|
+
retryConfig: context.retryConfig,
|
|
139
|
+
retryCodes: context.retryCodes,
|
|
140
|
+
});
|
|
141
|
+
if (!doResult.ok) {
|
|
142
|
+
return [doResult, { status: "request-error", request: req }];
|
|
143
|
+
}
|
|
144
|
+
const response = doResult.value;
|
|
145
|
+
|
|
146
|
+
const responseFields = {
|
|
147
|
+
HttpMeta: { Response: response, Request: req },
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
operations.RetrieveContactResponseBody,
|
|
152
|
+
| errors.RetrieveContactResponseBody
|
|
153
|
+
| APIError
|
|
154
|
+
| SDKValidationError
|
|
155
|
+
| UnexpectedClientError
|
|
156
|
+
| InvalidRequestError
|
|
157
|
+
| RequestAbortedError
|
|
158
|
+
| RequestTimeoutError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
>(
|
|
161
|
+
M.json(200, operations.RetrieveContactResponseBody$inboundSchema),
|
|
162
|
+
M.jsonErr(404, errors.RetrieveContactResponseBody$inboundSchema),
|
|
163
|
+
M.fail("4XX"),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response, { extraFields: responseFields });
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
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 { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Update a contact
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Updates specific fields of an existing contact. Only the fields provided in the request body will be updated.
|
|
32
|
+
*/
|
|
33
|
+
export function contactsUpdate(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request: operations.UpdateContactRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.UpdateContactResponseBody,
|
|
40
|
+
| errors.UpdateContactResponseBody
|
|
41
|
+
| APIError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request: operations.UpdateContactRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.UpdateContactResponseBody,
|
|
65
|
+
| errors.UpdateContactResponseBody
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.UpdateContactRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
id: encodeSimple("id", payload.id, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/v2/contacts/{id}")(pathParams);
|
|
96
|
+
|
|
97
|
+
const headers = new Headers(compactMap({
|
|
98
|
+
"Content-Type": "application/json",
|
|
99
|
+
Accept: "application/json",
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
103
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
104
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
105
|
+
|
|
106
|
+
const context = {
|
|
107
|
+
options: client._options,
|
|
108
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
109
|
+
operationID: "UpdateContact",
|
|
110
|
+
oAuth2Scopes: [],
|
|
111
|
+
|
|
112
|
+
resolvedSecurity: requestSecurity,
|
|
113
|
+
|
|
114
|
+
securitySource: client._options.apiKey,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const requestRes = client._createRequest(context, {
|
|
122
|
+
security: requestSecurity,
|
|
123
|
+
method: "PATCH",
|
|
124
|
+
baseURL: options?.serverURL,
|
|
125
|
+
path: path,
|
|
126
|
+
headers: headers,
|
|
127
|
+
body: body,
|
|
128
|
+
userAgent: client._options.userAgent,
|
|
129
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
130
|
+
}, options);
|
|
131
|
+
if (!requestRes.ok) {
|
|
132
|
+
return [requestRes, { status: "invalid" }];
|
|
133
|
+
}
|
|
134
|
+
const req = requestRes.value;
|
|
135
|
+
|
|
136
|
+
const doResult = await client._do(req, {
|
|
137
|
+
context,
|
|
138
|
+
errorCodes: ["404", "4XX", "5XX"],
|
|
139
|
+
retryConfig: context.retryConfig,
|
|
140
|
+
retryCodes: context.retryCodes,
|
|
141
|
+
});
|
|
142
|
+
if (!doResult.ok) {
|
|
143
|
+
return [doResult, { status: "request-error", request: req }];
|
|
144
|
+
}
|
|
145
|
+
const response = doResult.value;
|
|
146
|
+
|
|
147
|
+
const responseFields = {
|
|
148
|
+
HttpMeta: { Response: response, Request: req },
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
operations.UpdateContactResponseBody,
|
|
153
|
+
| errors.UpdateContactResponseBody
|
|
154
|
+
| APIError
|
|
155
|
+
| SDKValidationError
|
|
156
|
+
| UnexpectedClientError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| RequestAbortedError
|
|
159
|
+
| RequestTimeoutError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, operations.UpdateContactResponseBody$inboundSchema),
|
|
163
|
+
M.jsonErr(404, errors.UpdateContactResponseBody$inboundSchema),
|
|
164
|
+
M.fail("4XX"),
|
|
165
|
+
M.fail("5XX"),
|
|
166
|
+
)(response, { extraFields: responseFields });
|
|
167
|
+
if (!result.ok) {
|
|
168
|
+
return [result, { status: "complete", request: req, response }];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
@@ -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: "3.
|
|
72
|
-
genVersion: "2.
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 3.
|
|
71
|
+
sdkVersion: "3.8.0-rc.1",
|
|
72
|
+
genVersion: "2.620.2",
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 3.8.0-rc.1 2.620.2 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
|
@@ -14,6 +14,10 @@ import {
|
|
|
14
14
|
import { MCPScope } from "./scopes.js";
|
|
15
15
|
import { createRegisterTool } from "./tools.js";
|
|
16
16
|
import { tool$contactsCreate } from "./tools/contactsCreate.js";
|
|
17
|
+
import { tool$contactsDelete } from "./tools/contactsDelete.js";
|
|
18
|
+
import { tool$contactsList } from "./tools/contactsList.js";
|
|
19
|
+
import { tool$contactsRetrieve } from "./tools/contactsRetrieve.js";
|
|
20
|
+
import { tool$contactsUpdate } from "./tools/contactsUpdate.js";
|
|
17
21
|
import { tool$datasetsClear } from "./tools/datasetsClear.js";
|
|
18
22
|
import { tool$datasetsCreate } from "./tools/datasetsCreate.js";
|
|
19
23
|
import { tool$datasetsCreateDatapoint } from "./tools/datasetsCreateDatapoint.js";
|
|
@@ -110,7 +114,7 @@ export function createMCPServer(deps: {
|
|
|
110
114
|
}) {
|
|
111
115
|
const server = new McpServer({
|
|
112
116
|
name: "Orq",
|
|
113
|
-
version: "3.
|
|
117
|
+
version: "3.8.0-rc.1",
|
|
114
118
|
});
|
|
115
119
|
|
|
116
120
|
const client = new OrqCore({
|
|
@@ -143,6 +147,10 @@ export function createMCPServer(deps: {
|
|
|
143
147
|
void register; // suppress unused warnings
|
|
144
148
|
|
|
145
149
|
tool(tool$contactsCreate);
|
|
150
|
+
tool(tool$contactsList);
|
|
151
|
+
tool(tool$contactsRetrieve);
|
|
152
|
+
tool(tool$contactsUpdate);
|
|
153
|
+
tool(tool$contactsDelete);
|
|
146
154
|
tool(tool$feedbackCreate);
|
|
147
155
|
tool(tool$deploymentsList);
|
|
148
156
|
tool(tool$deploymentsGetConfig);
|
|
@@ -7,14 +7,14 @@ import * as operations from "../../models/operations/index.js";
|
|
|
7
7
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
|
-
request: operations.CreateContactRequestBody$inboundSchema,
|
|
10
|
+
request: operations.CreateContactRequestBody$inboundSchema.optional(),
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$contactsCreate: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "contacts-create",
|
|
15
|
-
description: `
|
|
15
|
+
description: `Create a contact
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Creates a new contact or updates an existing one based on external_id. Use this endpoint to add users from your system to orq.ai for tracking their usage and engagement.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await contactsCreate(
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { contactsDelete } from "../../funcs/contactsDelete.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.DeleteContactRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$contactsDelete: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "contacts-delete",
|
|
15
|
+
description: `Delete a contact
|
|
16
|
+
|
|
17
|
+
Permanently deletes a contact from your workspace. This action cannot be undone.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await contactsDelete(
|
|
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 { contactsList } from "../../funcs/contactsList.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListContactsRequest$inboundSchema.optional(),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$contactsList: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "contacts-list",
|
|
15
|
+
description: `List contacts
|
|
16
|
+
|
|
17
|
+
Retrieves a paginated list of contacts in your workspace. Use pagination parameters to navigate through large contact lists efficiently.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await contactsList(
|
|
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 { contactsRetrieve } from "../../funcs/contactsRetrieve.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.RetrieveContactRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$contactsRetrieve: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "contacts-retrieve",
|
|
15
|
+
description: `Retrieve a contact
|
|
16
|
+
|
|
17
|
+
Retrieves detailed information about a specific contact using their contact ID or external ID from your system.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await contactsRetrieve(
|
|
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 { contactsUpdate } from "../../funcs/contactsUpdate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.UpdateContactRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$contactsUpdate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "contacts-update",
|
|
15
|
+
description: `Update a contact
|
|
16
|
+
|
|
17
|
+
Updates specific fields of an existing contact. Only the fields provided in the request body will be updated.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await contactsUpdate(
|
|
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
|
+
};
|
|
@@ -3,22 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export class APIError extends Error {
|
|
6
|
+
/**
|
|
7
|
+
* HTTP status code
|
|
8
|
+
*/
|
|
6
9
|
public readonly statusCode: number;
|
|
10
|
+
/**
|
|
11
|
+
* HTTP content type
|
|
12
|
+
*/
|
|
7
13
|
public readonly contentType: string;
|
|
14
|
+
/**
|
|
15
|
+
* HTTP body
|
|
16
|
+
*/
|
|
17
|
+
public readonly body: string;
|
|
18
|
+
/**
|
|
19
|
+
* Raw response
|
|
20
|
+
*/
|
|
21
|
+
public readonly rawResponse: Response;
|
|
8
22
|
|
|
9
23
|
constructor(
|
|
10
24
|
message: string,
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
rawResponse: Response,
|
|
26
|
+
body: string = "",
|
|
13
27
|
) {
|
|
14
28
|
const statusCode = rawResponse.status;
|
|
15
29
|
const contentType = rawResponse.headers.get("content-type") || "";
|
|
16
30
|
const bodyString = body.length > 0 ? `\n${body}` : "";
|
|
17
|
-
|
|
18
31
|
super(
|
|
19
32
|
`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`,
|
|
20
33
|
);
|
|
21
34
|
|
|
35
|
+
this.body = body;
|
|
36
|
+
this.rawResponse = rawResponse;
|
|
22
37
|
this.statusCode = statusCode;
|
|
23
38
|
this.contentType = contentType;
|
|
24
39
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Contact not found
|
|
9
|
+
*/
|
|
10
|
+
export type DeleteContactResponseBodyData = {
|
|
11
|
+
/**
|
|
12
|
+
* Error message
|
|
13
|
+
*/
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Contact not found
|
|
19
|
+
*/
|
|
20
|
+
export class DeleteContactResponseBody extends Error {
|
|
21
|
+
/**
|
|
22
|
+
* Error message
|
|
23
|
+
*/
|
|
24
|
+
error: string;
|
|
25
|
+
|
|
26
|
+
/** The original data that was passed to this error instance. */
|
|
27
|
+
data$: DeleteContactResponseBodyData;
|
|
28
|
+
|
|
29
|
+
constructor(err: DeleteContactResponseBodyData) {
|
|
30
|
+
const message = "message" in err && typeof err.message === "string"
|
|
31
|
+
? err.message
|
|
32
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
33
|
+
super(message);
|
|
34
|
+
this.data$ = err;
|
|
35
|
+
|
|
36
|
+
this.error = err.error;
|
|
37
|
+
|
|
38
|
+
this.name = "DeleteContactResponseBody";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const DeleteContactResponseBody$inboundSchema: z.ZodType<
|
|
44
|
+
DeleteContactResponseBody,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
unknown
|
|
47
|
+
> = z.object({
|
|
48
|
+
error: z.string(),
|
|
49
|
+
})
|
|
50
|
+
.transform((v) => {
|
|
51
|
+
return new DeleteContactResponseBody(v);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type DeleteContactResponseBody$Outbound = {
|
|
56
|
+
error: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const DeleteContactResponseBody$outboundSchema: z.ZodType<
|
|
61
|
+
DeleteContactResponseBody$Outbound,
|
|
62
|
+
z.ZodTypeDef,
|
|
63
|
+
DeleteContactResponseBody
|
|
64
|
+
> = z.instanceof(DeleteContactResponseBody)
|
|
65
|
+
.transform(v => v.data$)
|
|
66
|
+
.pipe(z.object({
|
|
67
|
+
error: z.string(),
|
|
68
|
+
}));
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
73
|
+
*/
|
|
74
|
+
export namespace DeleteContactResponseBody$ {
|
|
75
|
+
/** @deprecated use `DeleteContactResponseBody$inboundSchema` instead. */
|
|
76
|
+
export const inboundSchema = DeleteContactResponseBody$inboundSchema;
|
|
77
|
+
/** @deprecated use `DeleteContactResponseBody$outboundSchema` instead. */
|
|
78
|
+
export const outboundSchema = DeleteContactResponseBody$outboundSchema;
|
|
79
|
+
/** @deprecated use `DeleteContactResponseBody$Outbound` instead. */
|
|
80
|
+
export type Outbound = DeleteContactResponseBody$Outbound;
|
|
81
|
+
}
|