@orq-ai/node 3.7.0-rc.7 → 3.7.0-rc.9

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.
Files changed (156) hide show
  1. package/README.md +24 -11
  2. package/bin/mcp-server.js +2228 -1371
  3. package/bin/mcp-server.js.map +53 -38
  4. package/docs/sdks/contacts/README.md +354 -3
  5. package/funcs/contactsCreate.d.ts +3 -3
  6. package/funcs/contactsCreate.d.ts.map +1 -1
  7. package/funcs/contactsCreate.js +7 -5
  8. package/funcs/contactsCreate.js.map +1 -1
  9. package/funcs/contactsDelete.d.ts +17 -0
  10. package/funcs/contactsDelete.d.ts.map +1 -0
  11. package/funcs/contactsDelete.js +124 -0
  12. package/funcs/contactsDelete.js.map +1 -0
  13. package/funcs/contactsList.d.ts +16 -0
  14. package/funcs/contactsList.d.ts.map +1 -0
  15. package/funcs/contactsList.js +121 -0
  16. package/funcs/contactsList.js.map +1 -0
  17. package/funcs/contactsRetrieve.d.ts +17 -0
  18. package/funcs/contactsRetrieve.d.ts.map +1 -0
  19. package/funcs/contactsRetrieve.js +123 -0
  20. package/funcs/contactsRetrieve.js.map +1 -0
  21. package/funcs/contactsUpdate.d.ts +17 -0
  22. package/funcs/contactsUpdate.d.ts.map +1 -0
  23. package/funcs/contactsUpdate.js +124 -0
  24. package/funcs/contactsUpdate.js.map +1 -0
  25. package/jsr.json +1 -1
  26. package/lib/config.d.ts +2 -2
  27. package/lib/config.js +2 -2
  28. package/mcp-server/mcp-server.js +1 -1
  29. package/mcp-server/server.d.ts.map +1 -1
  30. package/mcp-server/server.js +9 -1
  31. package/mcp-server/server.js.map +1 -1
  32. package/mcp-server/tools/contactsCreate.d.ts +1 -1
  33. package/mcp-server/tools/contactsCreate.js +3 -3
  34. package/mcp-server/tools/contactsCreate.js.map +1 -1
  35. package/mcp-server/tools/contactsDelete.d.ts +8 -0
  36. package/mcp-server/tools/contactsDelete.d.ts.map +1 -0
  37. package/mcp-server/tools/contactsDelete.js +63 -0
  38. package/mcp-server/tools/contactsDelete.js.map +1 -0
  39. package/mcp-server/tools/contactsList.d.ts +8 -0
  40. package/mcp-server/tools/contactsList.d.ts.map +1 -0
  41. package/mcp-server/tools/contactsList.js +64 -0
  42. package/mcp-server/tools/contactsList.js.map +1 -0
  43. package/mcp-server/tools/contactsRetrieve.d.ts +8 -0
  44. package/mcp-server/tools/contactsRetrieve.d.ts.map +1 -0
  45. package/mcp-server/tools/contactsRetrieve.js +64 -0
  46. package/mcp-server/tools/contactsRetrieve.js.map +1 -0
  47. package/mcp-server/tools/contactsUpdate.d.ts +8 -0
  48. package/mcp-server/tools/contactsUpdate.d.ts.map +1 -0
  49. package/mcp-server/tools/contactsUpdate.js +64 -0
  50. package/mcp-server/tools/contactsUpdate.js.map +1 -0
  51. package/models/errors/deletecontact.d.ts +43 -0
  52. package/models/errors/deletecontact.d.ts.map +1 -0
  53. package/models/errors/deletecontact.js +80 -0
  54. package/models/errors/deletecontact.js.map +1 -0
  55. package/models/errors/index.d.ts +3 -0
  56. package/models/errors/index.d.ts.map +1 -1
  57. package/models/errors/index.js +3 -0
  58. package/models/errors/index.js.map +1 -1
  59. package/models/errors/retrievecontact.d.ts +43 -0
  60. package/models/errors/retrievecontact.d.ts.map +1 -0
  61. package/models/errors/retrievecontact.js +80 -0
  62. package/models/errors/retrievecontact.js.map +1 -0
  63. package/models/errors/updatecontact.d.ts +39 -0
  64. package/models/errors/updatecontact.d.ts.map +1 -0
  65. package/models/errors/updatecontact.js +79 -0
  66. package/models/errors/updatecontact.js.map +1 -0
  67. package/models/operations/createcontact.d.ts +21 -16
  68. package/models/operations/createcontact.d.ts.map +1 -1
  69. package/models/operations/createcontact.js +9 -3
  70. package/models/operations/createcontact.js.map +1 -1
  71. package/models/operations/createdataset.js +2 -2
  72. package/models/operations/createdatasetitem.js +2 -2
  73. package/models/operations/createdatasource.js +2 -2
  74. package/models/operations/createeval.js +16 -16
  75. package/models/operations/deletecontact.d.ts +32 -0
  76. package/models/operations/deletecontact.d.ts.map +1 -0
  77. package/models/operations/deletecontact.js +69 -0
  78. package/models/operations/deletecontact.js.map +1 -0
  79. package/models/operations/deployments.d.ts +23 -23
  80. package/models/operations/deployments.d.ts.map +1 -1
  81. package/models/operations/deployments.js +31 -33
  82. package/models/operations/deployments.js.map +1 -1
  83. package/models/operations/fileget.js +2 -2
  84. package/models/operations/filelist.js +2 -2
  85. package/models/operations/fileupload.js +2 -2
  86. package/models/operations/index.d.ts +4 -0
  87. package/models/operations/index.d.ts.map +1 -1
  88. package/models/operations/index.js +4 -0
  89. package/models/operations/index.js.map +1 -1
  90. package/models/operations/listcontacts.d.ts +249 -0
  91. package/models/operations/listcontacts.d.ts.map +1 -0
  92. package/models/operations/listcontacts.js +286 -0
  93. package/models/operations/listcontacts.js.map +1 -0
  94. package/models/operations/listdatasetdatapoints.js +2 -2
  95. package/models/operations/listdatasets.js +2 -2
  96. package/models/operations/listdatasources.js +2 -2
  97. package/models/operations/retrievecontact.d.ts +107 -0
  98. package/models/operations/retrievecontact.d.ts.map +1 -0
  99. package/models/operations/retrievecontact.js +129 -0
  100. package/models/operations/retrievecontact.js.map +1 -0
  101. package/models/operations/retrievedatapoint.js +2 -2
  102. package/models/operations/retrievedataset.js +2 -2
  103. package/models/operations/retrievedatasource.js +2 -2
  104. package/models/operations/updatecontact.d.ts +167 -0
  105. package/models/operations/updatecontact.d.ts.map +1 -0
  106. package/models/operations/updatecontact.js +184 -0
  107. package/models/operations/updatecontact.js.map +1 -0
  108. package/models/operations/updatedatapoint.js +2 -2
  109. package/models/operations/updatedataset.js +2 -2
  110. package/models/operations/updatedatasource.js +2 -2
  111. package/package.json +1 -1
  112. package/sdk/contacts.d.ts +31 -3
  113. package/sdk/contacts.d.ts.map +1 -1
  114. package/sdk/contacts.js +42 -2
  115. package/sdk/contacts.js.map +1 -1
  116. package/src/funcs/contactsCreate.ts +12 -7
  117. package/src/funcs/contactsDelete.ts +172 -0
  118. package/src/funcs/contactsList.ts +165 -0
  119. package/src/funcs/contactsRetrieve.ts +171 -0
  120. package/src/funcs/contactsUpdate.ts +172 -0
  121. package/src/lib/config.ts +2 -2
  122. package/src/mcp-server/mcp-server.ts +1 -1
  123. package/src/mcp-server/server.ts +9 -1
  124. package/src/mcp-server/tools/contactsCreate.ts +3 -3
  125. package/src/mcp-server/tools/contactsDelete.ts +35 -0
  126. package/src/mcp-server/tools/contactsList.ts +37 -0
  127. package/src/mcp-server/tools/contactsRetrieve.ts +37 -0
  128. package/src/mcp-server/tools/contactsUpdate.ts +37 -0
  129. package/src/models/errors/deletecontact.ts +81 -0
  130. package/src/models/errors/index.ts +3 -0
  131. package/src/models/errors/retrievecontact.ts +81 -0
  132. package/src/models/errors/updatecontact.ts +74 -0
  133. package/src/models/operations/createcontact.ts +30 -19
  134. package/src/models/operations/createdataset.ts +2 -2
  135. package/src/models/operations/createdatasetitem.ts +2 -2
  136. package/src/models/operations/createdatasource.ts +2 -2
  137. package/src/models/operations/createeval.ts +16 -16
  138. package/src/models/operations/deletecontact.ts +69 -0
  139. package/src/models/operations/deployments.ts +69 -59
  140. package/src/models/operations/fileget.ts +2 -2
  141. package/src/models/operations/filelist.ts +2 -2
  142. package/src/models/operations/fileupload.ts +2 -2
  143. package/src/models/operations/index.ts +4 -0
  144. package/src/models/operations/listcontacts.ts +490 -0
  145. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  146. package/src/models/operations/listdatasets.ts +2 -2
  147. package/src/models/operations/listdatasources.ts +2 -2
  148. package/src/models/operations/retrievecontact.ts +210 -0
  149. package/src/models/operations/retrievedatapoint.ts +2 -2
  150. package/src/models/operations/retrievedataset.ts +2 -2
  151. package/src/models/operations/retrievedatasource.ts +2 -2
  152. package/src/models/operations/updatecontact.ts +325 -0
  153. package/src/models/operations/updatedatapoint.ts +2 -2
  154. package/src/models/operations/updatedataset.ts +2 -2
  155. package/src/models/operations/updatedatasource.ts +2 -2
  156. package/src/sdk/contacts.ts +75 -3
@@ -0,0 +1,165 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeFormQuery } 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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import * as operations from "../models/operations/index.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * List contacts
28
+ *
29
+ * @remarks
30
+ * Retrieves a paginated list of contacts in your workspace. Use pagination parameters to navigate through large contact lists efficiently.
31
+ */
32
+ export function contactsList(
33
+ client: OrqCore,
34
+ request?: operations.ListContactsRequest | undefined,
35
+ options?: RequestOptions,
36
+ ): APIPromise<
37
+ Result<
38
+ operations.ListContactsResponseBody,
39
+ | APIError
40
+ | SDKValidationError
41
+ | UnexpectedClientError
42
+ | InvalidRequestError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | ConnectionError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ async function $do(
56
+ client: OrqCore,
57
+ request?: operations.ListContactsRequest | undefined,
58
+ options?: RequestOptions,
59
+ ): Promise<
60
+ [
61
+ Result<
62
+ operations.ListContactsResponseBody,
63
+ | APIError
64
+ | SDKValidationError
65
+ | UnexpectedClientError
66
+ | InvalidRequestError
67
+ | RequestAbortedError
68
+ | RequestTimeoutError
69
+ | ConnectionError
70
+ >,
71
+ APICall,
72
+ ]
73
+ > {
74
+ const parsed = safeParse(
75
+ request,
76
+ (value) =>
77
+ operations.ListContactsRequest$outboundSchema.optional().parse(value),
78
+ "Input validation failed",
79
+ );
80
+ if (!parsed.ok) {
81
+ return [parsed, { status: "invalid" }];
82
+ }
83
+ const payload = parsed.value;
84
+ const body = null;
85
+
86
+ const path = pathToFunc("/v2/contacts")();
87
+
88
+ const query = encodeFormQuery({
89
+ "ending_before": payload?.ending_before,
90
+ "filter_by": payload?.filter_by,
91
+ "include_metrics": payload?.include_metrics,
92
+ "limit": payload?.limit,
93
+ "starting_after": payload?.starting_after,
94
+ });
95
+
96
+ const headers = new Headers(compactMap({
97
+ Accept: "application/json",
98
+ }));
99
+
100
+ const secConfig = await extractSecurity(client._options.apiKey);
101
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
103
+
104
+ const context = {
105
+ options: client._options,
106
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
107
+ operationID: "ListContacts",
108
+ oAuth2Scopes: [],
109
+
110
+ resolvedSecurity: requestSecurity,
111
+
112
+ securitySource: client._options.apiKey,
113
+ retryConfig: options?.retries
114
+ || client._options.retryConfig
115
+ || { strategy: "none" },
116
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
117
+ };
118
+
119
+ const requestRes = client._createRequest(context, {
120
+ security: requestSecurity,
121
+ method: "GET",
122
+ baseURL: options?.serverURL,
123
+ path: path,
124
+ headers: headers,
125
+ query: query,
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: ["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 [result] = await M.match<
147
+ operations.ListContactsResponseBody,
148
+ | APIError
149
+ | SDKValidationError
150
+ | UnexpectedClientError
151
+ | InvalidRequestError
152
+ | RequestAbortedError
153
+ | RequestTimeoutError
154
+ | ConnectionError
155
+ >(
156
+ M.json(200, operations.ListContactsResponseBody$inboundSchema),
157
+ M.fail("4XX"),
158
+ M.fail("5XX"),
159
+ )(response);
160
+ if (!result.ok) {
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
163
+
164
+ return [result, { status: "complete", request: req, response }];
165
+ }
@@ -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
+ }
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: "3.7.0-rc.7",
71
+ sdkVersion: "3.7.0-rc.9",
72
72
  genVersion: "2.618.0",
73
- userAgent: "speakeasy-sdk/typescript 3.7.0-rc.7 2.618.0 2.0 @orq-ai/node",
73
+ userAgent: "speakeasy-sdk/typescript 3.7.0-rc.9 2.618.0 2.0 @orq-ai/node",
74
74
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "3.7.0-rc.7",
22
+ currentVersion: "3.7.0-rc.9",
23
23
  },
24
24
  });
25
25
 
@@ -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.7.0-rc.7",
117
+ version: "3.7.0-rc.9",
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: `Update user information
15
+ description: `Create a contact
16
16
 
17
- Update or add user information to workspace`,
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
+ };