@orq-ai/node 4.2.0 → 4.2.3

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 (243) hide show
  1. package/FUNCTIONS.md +17 -7
  2. package/README.md +125 -70
  3. package/examples/contactsCreate.example.ts +42 -0
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/contactsCreate.d.ts +3 -5
  6. package/funcs/contactsCreate.d.ts.map +1 -1
  7. package/funcs/contactsCreate.js +5 -9
  8. package/funcs/contactsCreate.js.map +1 -1
  9. package/jsr.json +1 -1
  10. package/lib/config.d.ts +2 -2
  11. package/lib/config.js +2 -2
  12. package/models/components/conversationresponse.js +1 -1
  13. package/models/components/conversationwithmessagesresponse.js +1 -1
  14. package/models/components/index.d.ts +1 -0
  15. package/models/components/index.d.ts.map +1 -1
  16. package/models/components/index.js +1 -0
  17. package/models/components/index.js.map +1 -1
  18. package/models/components/invokedeploymentrequest.d.ts +6 -0
  19. package/models/components/invokedeploymentrequest.d.ts.map +1 -1
  20. package/models/components/invokedeploymentrequest.js +2 -0
  21. package/models/components/invokedeploymentrequest.js.map +1 -1
  22. package/models/components/partdoneevent.js +1 -1
  23. package/models/components/publiccontact.d.ts +3 -1
  24. package/models/components/publiccontact.d.ts.map +1 -1
  25. package/models/components/publiccontact.js.map +1 -1
  26. package/models/components/publicidentity.d.ts +47 -0
  27. package/models/components/publicidentity.d.ts.map +1 -0
  28. package/models/{operations/deletecontact.js → components/publicidentity.js} +17 -6
  29. package/models/components/publicidentity.js.map +1 -0
  30. package/models/components/reasoningpart.js +1 -1
  31. package/models/errors/index.d.ts +0 -3
  32. package/models/errors/index.d.ts.map +1 -1
  33. package/models/errors/index.js +0 -3
  34. package/models/errors/index.js.map +1 -1
  35. package/models/operations/createchatcompletion.d.ts +9 -51
  36. package/models/operations/createchatcompletion.d.ts.map +1 -1
  37. package/models/operations/createchatcompletion.js +5 -24
  38. package/models/operations/createchatcompletion.js.map +1 -1
  39. package/models/operations/createcompletion.d.ts +9 -51
  40. package/models/operations/createcompletion.d.ts.map +1 -1
  41. package/models/operations/createcompletion.js +4 -22
  42. package/models/operations/createcompletion.js.map +1 -1
  43. package/models/operations/createcontact.d.ts +2 -6
  44. package/models/operations/createcontact.d.ts.map +1 -1
  45. package/models/operations/createcontact.js +1 -3
  46. package/models/operations/createcontact.js.map +1 -1
  47. package/models/operations/createconversation.js +1 -1
  48. package/models/operations/createconversationresponse.js +2 -2
  49. package/models/operations/createdataset.js +1 -1
  50. package/models/operations/createdatasetitem.js +4 -4
  51. package/models/operations/createdatasource.js +1 -1
  52. package/models/operations/createembedding.d.ts +9 -51
  53. package/models/operations/createembedding.d.ts.map +1 -1
  54. package/models/operations/createembedding.js +3 -21
  55. package/models/operations/createembedding.js.map +1 -1
  56. package/models/operations/createeval.js +14 -14
  57. package/models/operations/createidentity.js +1 -1
  58. package/models/operations/createimage.d.ts +9 -51
  59. package/models/operations/createimage.d.ts.map +1 -1
  60. package/models/operations/createimage.js +3 -21
  61. package/models/operations/createimage.js.map +1 -1
  62. package/models/operations/createimageedit.d.ts +9 -51
  63. package/models/operations/createimageedit.d.ts.map +1 -1
  64. package/models/operations/createimageedit.js +3 -21
  65. package/models/operations/createimageedit.js.map +1 -1
  66. package/models/operations/createimagevariation.d.ts +9 -51
  67. package/models/operations/createimagevariation.d.ts.map +1 -1
  68. package/models/operations/createimagevariation.js +3 -21
  69. package/models/operations/createimagevariation.js.map +1 -1
  70. package/models/operations/creatererank.d.ts +9 -51
  71. package/models/operations/creatererank.d.ts.map +1 -1
  72. package/models/operations/creatererank.js +3 -21
  73. package/models/operations/creatererank.js.map +1 -1
  74. package/models/operations/createspeech.d.ts +9 -51
  75. package/models/operations/createspeech.d.ts.map +1 -1
  76. package/models/operations/createspeech.js +3 -21
  77. package/models/operations/createspeech.js.map +1 -1
  78. package/models/operations/createtool.js +6 -6
  79. package/models/operations/createtranscription.d.ts +9 -51
  80. package/models/operations/createtranscription.d.ts.map +1 -1
  81. package/models/operations/createtranscription.js +3 -21
  82. package/models/operations/createtranscription.js.map +1 -1
  83. package/models/operations/createtranslation.d.ts +9 -51
  84. package/models/operations/createtranslation.d.ts.map +1 -1
  85. package/models/operations/createtranslation.js +3 -21
  86. package/models/operations/createtranslation.js.map +1 -1
  87. package/models/operations/deploymentgetconfig.d.ts +5 -0
  88. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  89. package/models/operations/deploymentgetconfig.js +1 -0
  90. package/models/operations/deploymentgetconfig.js.map +1 -1
  91. package/models/operations/deploymentstream.d.ts +5 -0
  92. package/models/operations/deploymentstream.d.ts.map +1 -1
  93. package/models/operations/deploymentstream.js +1 -0
  94. package/models/operations/deploymentstream.js.map +1 -1
  95. package/models/operations/fileget.js +1 -1
  96. package/models/operations/filelist.js +1 -1
  97. package/models/operations/fileupload.js +1 -1
  98. package/models/operations/generateconversationname.js +1 -1
  99. package/models/operations/getalltools.js +6 -6
  100. package/models/operations/getevals.d.ts +7 -7
  101. package/models/operations/getevals.d.ts.map +1 -1
  102. package/models/operations/getevals.js +25 -23
  103. package/models/operations/getevals.js.map +1 -1
  104. package/models/operations/index.d.ts +0 -4
  105. package/models/operations/index.d.ts.map +1 -1
  106. package/models/operations/index.js +0 -4
  107. package/models/operations/index.js.map +1 -1
  108. package/models/operations/listdatasetdatapoints.js +4 -4
  109. package/models/operations/listdatasets.js +1 -1
  110. package/models/operations/listdatasources.js +1 -1
  111. package/models/operations/listidentities.js +1 -1
  112. package/models/operations/retrievedatapoint.js +4 -4
  113. package/models/operations/retrievedataset.js +1 -1
  114. package/models/operations/retrievedatasource.js +1 -1
  115. package/models/operations/retrieveidentity.js +1 -1
  116. package/models/operations/retrievetool.js +6 -6
  117. package/models/operations/runagent.js +1 -1
  118. package/models/operations/streamrunagent.js +1 -1
  119. package/models/operations/updateconversation.js +1 -1
  120. package/models/operations/updatedatapoint.js +4 -4
  121. package/models/operations/updatedataset.js +1 -1
  122. package/models/operations/updatedatasource.js +1 -1
  123. package/models/operations/updateeval.js +14 -14
  124. package/models/operations/updateidentity.js +1 -1
  125. package/models/operations/updatetool.js +7 -7
  126. package/package.json +1 -1
  127. package/sdk/contacts.d.ts +3 -41
  128. package/sdk/contacts.d.ts.map +1 -1
  129. package/sdk/contacts.js +2 -52
  130. package/sdk/contacts.js.map +1 -1
  131. package/src/funcs/contactsCreate.ts +7 -14
  132. package/src/lib/config.ts +2 -2
  133. package/src/models/components/conversationresponse.ts +1 -1
  134. package/src/models/components/conversationwithmessagesresponse.ts +1 -1
  135. package/src/models/components/index.ts +1 -0
  136. package/src/models/components/invokedeploymentrequest.ts +11 -0
  137. package/src/models/components/partdoneevent.ts +1 -1
  138. package/src/models/components/publiccontact.ts +3 -1
  139. package/src/models/components/publicidentity.ts +69 -0
  140. package/src/models/components/reasoningpart.ts +1 -1
  141. package/src/models/errors/index.ts +0 -3
  142. package/src/models/operations/createchatcompletion.ts +11 -78
  143. package/src/models/operations/createcompletion.ts +11 -75
  144. package/src/models/operations/createcontact.ts +3 -9
  145. package/src/models/operations/createconversation.ts +1 -1
  146. package/src/models/operations/createconversationresponse.ts +2 -2
  147. package/src/models/operations/createdataset.ts +1 -1
  148. package/src/models/operations/createdatasetitem.ts +4 -4
  149. package/src/models/operations/createdatasource.ts +1 -1
  150. package/src/models/operations/createembedding.ts +11 -75
  151. package/src/models/operations/createeval.ts +14 -14
  152. package/src/models/operations/createidentity.ts +1 -1
  153. package/src/models/operations/createimage.ts +11 -75
  154. package/src/models/operations/createimageedit.ts +11 -75
  155. package/src/models/operations/createimagevariation.ts +11 -77
  156. package/src/models/operations/creatererank.ts +11 -75
  157. package/src/models/operations/createspeech.ts +11 -75
  158. package/src/models/operations/createtool.ts +6 -6
  159. package/src/models/operations/createtranscription.ts +11 -75
  160. package/src/models/operations/createtranslation.ts +11 -75
  161. package/src/models/operations/deploymentgetconfig.ts +6 -0
  162. package/src/models/operations/deploymentstream.ts +6 -0
  163. package/src/models/operations/fileget.ts +1 -1
  164. package/src/models/operations/filelist.ts +1 -1
  165. package/src/models/operations/fileupload.ts +1 -1
  166. package/src/models/operations/generateconversationname.ts +1 -1
  167. package/src/models/operations/getalltools.ts +6 -6
  168. package/src/models/operations/getevals.ts +35 -39
  169. package/src/models/operations/index.ts +0 -4
  170. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  171. package/src/models/operations/listdatasets.ts +1 -1
  172. package/src/models/operations/listdatasources.ts +1 -1
  173. package/src/models/operations/listidentities.ts +1 -1
  174. package/src/models/operations/retrievedatapoint.ts +4 -4
  175. package/src/models/operations/retrievedataset.ts +1 -1
  176. package/src/models/operations/retrievedatasource.ts +1 -1
  177. package/src/models/operations/retrieveidentity.ts +1 -1
  178. package/src/models/operations/retrievetool.ts +6 -6
  179. package/src/models/operations/runagent.ts +1 -1
  180. package/src/models/operations/streamrunagent.ts +1 -1
  181. package/src/models/operations/updateconversation.ts +1 -1
  182. package/src/models/operations/updatedatapoint.ts +4 -4
  183. package/src/models/operations/updatedataset.ts +1 -1
  184. package/src/models/operations/updatedatasource.ts +1 -1
  185. package/src/models/operations/updateeval.ts +14 -14
  186. package/src/models/operations/updateidentity.ts +1 -1
  187. package/src/models/operations/updatetool.ts +7 -7
  188. package/src/sdk/contacts.ts +3 -85
  189. package/examples/feedbackCreate.example.ts +0 -32
  190. package/funcs/contactsDelete.d.ts +0 -20
  191. package/funcs/contactsDelete.d.ts.map +0 -1
  192. package/funcs/contactsDelete.js +0 -126
  193. package/funcs/contactsDelete.js.map +0 -1
  194. package/funcs/contactsList.d.ts +0 -19
  195. package/funcs/contactsList.d.ts.map +0 -1
  196. package/funcs/contactsList.js +0 -124
  197. package/funcs/contactsList.js.map +0 -1
  198. package/funcs/contactsRetrieve.d.ts +0 -20
  199. package/funcs/contactsRetrieve.d.ts.map +0 -1
  200. package/funcs/contactsRetrieve.js +0 -125
  201. package/funcs/contactsRetrieve.js.map +0 -1
  202. package/funcs/contactsUpdate.d.ts +0 -20
  203. package/funcs/contactsUpdate.d.ts.map +0 -1
  204. package/funcs/contactsUpdate.js +0 -126
  205. package/funcs/contactsUpdate.js.map +0 -1
  206. package/models/errors/deletecontact.d.ts +0 -30
  207. package/models/errors/deletecontact.d.ts.map +0 -1
  208. package/models/errors/deletecontact.js +0 -71
  209. package/models/errors/deletecontact.js.map +0 -1
  210. package/models/errors/retrievecontact.d.ts +0 -30
  211. package/models/errors/retrievecontact.d.ts.map +0 -1
  212. package/models/errors/retrievecontact.js +0 -71
  213. package/models/errors/retrievecontact.js.map +0 -1
  214. package/models/errors/updatecontact.d.ts +0 -26
  215. package/models/errors/updatecontact.d.ts.map +0 -1
  216. package/models/errors/updatecontact.js +0 -68
  217. package/models/errors/updatecontact.js.map +0 -1
  218. package/models/operations/deletecontact.d.ts +0 -15
  219. package/models/operations/deletecontact.d.ts.map +0 -1
  220. package/models/operations/deletecontact.js.map +0 -1
  221. package/models/operations/listcontacts.d.ts +0 -138
  222. package/models/operations/listcontacts.d.ts.map +0 -1
  223. package/models/operations/listcontacts.js +0 -136
  224. package/models/operations/listcontacts.js.map +0 -1
  225. package/models/operations/retrievecontact.d.ts +0 -63
  226. package/models/operations/retrievecontact.d.ts.map +0 -1
  227. package/models/operations/retrievecontact.js +0 -75
  228. package/models/operations/retrievecontact.js.map +0 -1
  229. package/models/operations/updatecontact.d.ts +0 -108
  230. package/models/operations/updatecontact.d.ts.map +0 -1
  231. package/models/operations/updatecontact.js +0 -97
  232. package/models/operations/updatecontact.js.map +0 -1
  233. package/src/funcs/contactsDelete.ts +0 -178
  234. package/src/funcs/contactsList.ts +0 -172
  235. package/src/funcs/contactsRetrieve.ts +0 -177
  236. package/src/funcs/contactsUpdate.ts +0 -178
  237. package/src/models/errors/deletecontact.ts +0 -62
  238. package/src/models/errors/retrievecontact.ts +0 -62
  239. package/src/models/errors/updatecontact.ts +0 -54
  240. package/src/models/operations/deletecontact.ts +0 -34
  241. package/src/models/operations/listcontacts.ts +0 -274
  242. package/src/models/operations/retrievecontact.ts +0 -117
  243. package/src/models/operations/updatecontact.ts +0 -188
@@ -1,178 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { OrqCore } from "../core.js";
7
- import { encodeSimple } from "../lib/encodings.js";
8
- import * as M from "../lib/matchers.js";
9
- import { compactMap } from "../lib/primitives.js";
10
- import { safeParse } from "../lib/schemas.js";
11
- import { RequestOptions } from "../lib/sdks.js";
12
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
- import { pathToFunc } from "../lib/url.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 { OrqError } from "../models/errors/orqerror.js";
23
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
- import * as operations from "../models/operations/index.js";
26
- import { APICall, APIPromise } from "../types/async.js";
27
- import { Result } from "../types/fp.js";
28
-
29
- /**
30
- * Delete a contact
31
- *
32
- * @remarks
33
- * Permanently deletes a contact from your workspace and cleans up associated budget configurations. This action cannot be undone.
34
- *
35
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
36
- */
37
- export function contactsDelete(
38
- client: OrqCore,
39
- request: operations.DeleteContactRequest,
40
- options?: RequestOptions,
41
- ): APIPromise<
42
- Result<
43
- void,
44
- | errors.DeleteContactResponseBody
45
- | OrqError
46
- | ResponseValidationError
47
- | ConnectionError
48
- | RequestAbortedError
49
- | RequestTimeoutError
50
- | InvalidRequestError
51
- | UnexpectedClientError
52
- | SDKValidationError
53
- >
54
- > {
55
- return new APIPromise($do(
56
- client,
57
- request,
58
- options,
59
- ));
60
- }
61
-
62
- async function $do(
63
- client: OrqCore,
64
- request: operations.DeleteContactRequest,
65
- options?: RequestOptions,
66
- ): Promise<
67
- [
68
- Result<
69
- void,
70
- | errors.DeleteContactResponseBody
71
- | OrqError
72
- | ResponseValidationError
73
- | ConnectionError
74
- | RequestAbortedError
75
- | RequestTimeoutError
76
- | InvalidRequestError
77
- | UnexpectedClientError
78
- | SDKValidationError
79
- >,
80
- APICall,
81
- ]
82
- > {
83
- const parsed = safeParse(
84
- request,
85
- (value) => operations.DeleteContactRequest$outboundSchema.parse(value),
86
- "Input validation failed",
87
- );
88
- if (!parsed.ok) {
89
- return [parsed, { status: "invalid" }];
90
- }
91
- const payload = parsed.value;
92
- const body = null;
93
-
94
- const pathParams = {
95
- id: encodeSimple("id", payload.id, {
96
- explode: false,
97
- charEncoding: "percent",
98
- }),
99
- };
100
-
101
- const path = pathToFunc("/v2/contacts/{id}")(pathParams);
102
-
103
- const headers = new Headers(compactMap({
104
- Accept: "application/json",
105
- }));
106
-
107
- const secConfig = await extractSecurity(client._options.apiKey);
108
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
109
- const requestSecurity = resolveGlobalSecurity(securityInput);
110
-
111
- const context = {
112
- options: client._options,
113
- baseURL: options?.serverURL ?? client._baseURL ?? "",
114
- operationID: "DeleteContact",
115
- oAuth2Scopes: null,
116
-
117
- resolvedSecurity: requestSecurity,
118
-
119
- securitySource: client._options.apiKey,
120
- retryConfig: options?.retries
121
- || client._options.retryConfig
122
- || { strategy: "none" },
123
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
124
- };
125
-
126
- const requestRes = client._createRequest(context, {
127
- security: requestSecurity,
128
- method: "DELETE",
129
- baseURL: options?.serverURL,
130
- path: path,
131
- headers: headers,
132
- body: body,
133
- userAgent: client._options.userAgent,
134
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
135
- }, options);
136
- if (!requestRes.ok) {
137
- return [requestRes, { status: "invalid" }];
138
- }
139
- const req = requestRes.value;
140
-
141
- const doResult = await client._do(req, {
142
- context,
143
- errorCodes: ["404", "4XX", "5XX"],
144
- retryConfig: context.retryConfig,
145
- retryCodes: context.retryCodes,
146
- });
147
- if (!doResult.ok) {
148
- return [doResult, { status: "request-error", request: req }];
149
- }
150
- const response = doResult.value;
151
-
152
- const responseFields = {
153
- HttpMeta: { Response: response, Request: req },
154
- };
155
-
156
- const [result] = await M.match<
157
- void,
158
- | errors.DeleteContactResponseBody
159
- | OrqError
160
- | ResponseValidationError
161
- | ConnectionError
162
- | RequestAbortedError
163
- | RequestTimeoutError
164
- | InvalidRequestError
165
- | UnexpectedClientError
166
- | SDKValidationError
167
- >(
168
- M.nil(204, z.void()),
169
- M.jsonErr(404, errors.DeleteContactResponseBody$inboundSchema),
170
- M.fail("4XX"),
171
- M.fail("5XX"),
172
- )(response, req, { extraFields: responseFields });
173
- if (!result.ok) {
174
- return [result, { status: "complete", request: req, response }];
175
- }
176
-
177
- return [result, { status: "complete", request: req, response }];
178
- }
@@ -1,172 +0,0 @@
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 {
14
- ConnectionError,
15
- InvalidRequestError,
16
- RequestAbortedError,
17
- RequestTimeoutError,
18
- UnexpectedClientError,
19
- } from "../models/errors/httpclienterrors.js";
20
- import { OrqError } from "../models/errors/orqerror.js";
21
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.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
- * List contacts
29
- *
30
- * @remarks
31
- * Retrieves a paginated list of contacts in your workspace. Use pagination parameters to navigate through large contact lists efficiently.
32
- *
33
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
34
- */
35
- export function contactsList(
36
- client: OrqCore,
37
- request?: operations.ListContactsRequest | undefined,
38
- options?: RequestOptions,
39
- ): APIPromise<
40
- Result<
41
- operations.ListContactsResponseBody,
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.ListContactsRequest | undefined,
62
- options?: RequestOptions,
63
- ): Promise<
64
- [
65
- Result<
66
- operations.ListContactsResponseBody,
67
- | OrqError
68
- | ResponseValidationError
69
- | ConnectionError
70
- | RequestAbortedError
71
- | RequestTimeoutError
72
- | InvalidRequestError
73
- | UnexpectedClientError
74
- | SDKValidationError
75
- >,
76
- APICall,
77
- ]
78
- > {
79
- const parsed = safeParse(
80
- request,
81
- (value) =>
82
- operations.ListContactsRequest$outboundSchema.optional().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 path = pathToFunc("/v2/contacts")();
92
-
93
- const query = encodeFormQuery({
94
- "ending_before": payload?.ending_before,
95
- "filter_by": payload?.filter_by,
96
- "include_metrics": payload?.include_metrics,
97
- "limit": payload?.limit,
98
- "search": payload?.search,
99
- "starting_after": payload?.starting_after,
100
- });
101
-
102
- const headers = new Headers(compactMap({
103
- Accept: "application/json",
104
- }));
105
-
106
- const secConfig = await extractSecurity(client._options.apiKey);
107
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
108
- const requestSecurity = resolveGlobalSecurity(securityInput);
109
-
110
- const context = {
111
- options: client._options,
112
- baseURL: options?.serverURL ?? client._baseURL ?? "",
113
- operationID: "ListContacts",
114
- oAuth2Scopes: null,
115
-
116
- resolvedSecurity: requestSecurity,
117
-
118
- securitySource: client._options.apiKey,
119
- retryConfig: options?.retries
120
- || client._options.retryConfig
121
- || { strategy: "none" },
122
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
- };
124
-
125
- const requestRes = client._createRequest(context, {
126
- security: requestSecurity,
127
- method: "GET",
128
- baseURL: options?.serverURL,
129
- path: path,
130
- headers: headers,
131
- query: query,
132
- body: body,
133
- userAgent: client._options.userAgent,
134
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
135
- }, options);
136
- if (!requestRes.ok) {
137
- return [requestRes, { status: "invalid" }];
138
- }
139
- const req = requestRes.value;
140
-
141
- const doResult = await client._do(req, {
142
- context,
143
- errorCodes: ["4XX", "5XX"],
144
- retryConfig: context.retryConfig,
145
- retryCodes: context.retryCodes,
146
- });
147
- if (!doResult.ok) {
148
- return [doResult, { status: "request-error", request: req }];
149
- }
150
- const response = doResult.value;
151
-
152
- const [result] = await M.match<
153
- operations.ListContactsResponseBody,
154
- | OrqError
155
- | ResponseValidationError
156
- | ConnectionError
157
- | RequestAbortedError
158
- | RequestTimeoutError
159
- | InvalidRequestError
160
- | UnexpectedClientError
161
- | SDKValidationError
162
- >(
163
- M.json(200, operations.ListContactsResponseBody$inboundSchema),
164
- M.fail("4XX"),
165
- M.fail("5XX"),
166
- )(response, req);
167
- if (!result.ok) {
168
- return [result, { status: "complete", request: req, response }];
169
- }
170
-
171
- return [result, { status: "complete", request: req, response }];
172
- }
@@ -1,177 +0,0 @@
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 a contact
30
- *
31
- * @remarks
32
- * Retrieves detailed information about a specific contact using their contact ID or external ID from your system.
33
- *
34
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
35
- */
36
- export function contactsRetrieve(
37
- client: OrqCore,
38
- request: operations.RetrieveContactRequest,
39
- options?: RequestOptions,
40
- ): APIPromise<
41
- Result<
42
- operations.RetrieveContactResponseBody,
43
- | errors.RetrieveContactResponseBody
44
- | OrqError
45
- | ResponseValidationError
46
- | ConnectionError
47
- | RequestAbortedError
48
- | RequestTimeoutError
49
- | InvalidRequestError
50
- | UnexpectedClientError
51
- | SDKValidationError
52
- >
53
- > {
54
- return new APIPromise($do(
55
- client,
56
- request,
57
- options,
58
- ));
59
- }
60
-
61
- async function $do(
62
- client: OrqCore,
63
- request: operations.RetrieveContactRequest,
64
- options?: RequestOptions,
65
- ): Promise<
66
- [
67
- Result<
68
- operations.RetrieveContactResponseBody,
69
- | errors.RetrieveContactResponseBody
70
- | OrqError
71
- | ResponseValidationError
72
- | ConnectionError
73
- | RequestAbortedError
74
- | RequestTimeoutError
75
- | InvalidRequestError
76
- | UnexpectedClientError
77
- | SDKValidationError
78
- >,
79
- APICall,
80
- ]
81
- > {
82
- const parsed = safeParse(
83
- request,
84
- (value) => operations.RetrieveContactRequest$outboundSchema.parse(value),
85
- "Input validation failed",
86
- );
87
- if (!parsed.ok) {
88
- return [parsed, { status: "invalid" }];
89
- }
90
- const payload = parsed.value;
91
- const body = null;
92
-
93
- const pathParams = {
94
- id: encodeSimple("id", payload.id, {
95
- explode: false,
96
- charEncoding: "percent",
97
- }),
98
- };
99
-
100
- const path = pathToFunc("/v2/contacts/{id}")(pathParams);
101
-
102
- const headers = new Headers(compactMap({
103
- Accept: "application/json",
104
- }));
105
-
106
- const secConfig = await extractSecurity(client._options.apiKey);
107
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
108
- const requestSecurity = resolveGlobalSecurity(securityInput);
109
-
110
- const context = {
111
- options: client._options,
112
- baseURL: options?.serverURL ?? client._baseURL ?? "",
113
- operationID: "RetrieveContact",
114
- oAuth2Scopes: null,
115
-
116
- resolvedSecurity: requestSecurity,
117
-
118
- securitySource: client._options.apiKey,
119
- retryConfig: options?.retries
120
- || client._options.retryConfig
121
- || { strategy: "none" },
122
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
- };
124
-
125
- const requestRes = client._createRequest(context, {
126
- security: requestSecurity,
127
- method: "GET",
128
- baseURL: options?.serverURL,
129
- path: path,
130
- headers: headers,
131
- body: body,
132
- userAgent: client._options.userAgent,
133
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
134
- }, options);
135
- if (!requestRes.ok) {
136
- return [requestRes, { status: "invalid" }];
137
- }
138
- const req = requestRes.value;
139
-
140
- const doResult = await client._do(req, {
141
- context,
142
- errorCodes: ["404", "4XX", "5XX"],
143
- retryConfig: context.retryConfig,
144
- retryCodes: context.retryCodes,
145
- });
146
- if (!doResult.ok) {
147
- return [doResult, { status: "request-error", request: req }];
148
- }
149
- const response = doResult.value;
150
-
151
- const responseFields = {
152
- HttpMeta: { Response: response, Request: req },
153
- };
154
-
155
- const [result] = await M.match<
156
- operations.RetrieveContactResponseBody,
157
- | errors.RetrieveContactResponseBody
158
- | OrqError
159
- | ResponseValidationError
160
- | ConnectionError
161
- | RequestAbortedError
162
- | RequestTimeoutError
163
- | InvalidRequestError
164
- | UnexpectedClientError
165
- | SDKValidationError
166
- >(
167
- M.json(200, operations.RetrieveContactResponseBody$inboundSchema),
168
- M.jsonErr(404, errors.RetrieveContactResponseBody$inboundSchema),
169
- M.fail("4XX"),
170
- M.fail("5XX"),
171
- )(response, req, { extraFields: responseFields });
172
- if (!result.ok) {
173
- return [result, { status: "complete", request: req, response }];
174
- }
175
-
176
- return [result, { status: "complete", request: req, response }];
177
- }
@@ -1,178 +0,0 @@
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 a contact
30
- *
31
- * @remarks
32
- * Updates specific fields of an existing contact. Only the fields provided in the request body will be updated.
33
- *
34
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
35
- */
36
- export function contactsUpdate(
37
- client: OrqCore,
38
- request: operations.UpdateContactRequest,
39
- options?: RequestOptions,
40
- ): APIPromise<
41
- Result<
42
- operations.UpdateContactResponseBody,
43
- | errors.UpdateContactResponseBody
44
- | OrqError
45
- | ResponseValidationError
46
- | ConnectionError
47
- | RequestAbortedError
48
- | RequestTimeoutError
49
- | InvalidRequestError
50
- | UnexpectedClientError
51
- | SDKValidationError
52
- >
53
- > {
54
- return new APIPromise($do(
55
- client,
56
- request,
57
- options,
58
- ));
59
- }
60
-
61
- async function $do(
62
- client: OrqCore,
63
- request: operations.UpdateContactRequest,
64
- options?: RequestOptions,
65
- ): Promise<
66
- [
67
- Result<
68
- operations.UpdateContactResponseBody,
69
- | errors.UpdateContactResponseBody
70
- | OrqError
71
- | ResponseValidationError
72
- | ConnectionError
73
- | RequestAbortedError
74
- | RequestTimeoutError
75
- | InvalidRequestError
76
- | UnexpectedClientError
77
- | SDKValidationError
78
- >,
79
- APICall,
80
- ]
81
- > {
82
- const parsed = safeParse(
83
- request,
84
- (value) => operations.UpdateContactRequest$outboundSchema.parse(value),
85
- "Input validation failed",
86
- );
87
- if (!parsed.ok) {
88
- return [parsed, { status: "invalid" }];
89
- }
90
- const payload = parsed.value;
91
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
92
-
93
- const pathParams = {
94
- id: encodeSimple("id", payload.id, {
95
- explode: false,
96
- charEncoding: "percent",
97
- }),
98
- };
99
-
100
- const path = pathToFunc("/v2/contacts/{id}")(pathParams);
101
-
102
- const headers = new Headers(compactMap({
103
- "Content-Type": "application/json",
104
- Accept: "application/json",
105
- }));
106
-
107
- const secConfig = await extractSecurity(client._options.apiKey);
108
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
109
- const requestSecurity = resolveGlobalSecurity(securityInput);
110
-
111
- const context = {
112
- options: client._options,
113
- baseURL: options?.serverURL ?? client._baseURL ?? "",
114
- operationID: "UpdateContact",
115
- oAuth2Scopes: null,
116
-
117
- resolvedSecurity: requestSecurity,
118
-
119
- securitySource: client._options.apiKey,
120
- retryConfig: options?.retries
121
- || client._options.retryConfig
122
- || { strategy: "none" },
123
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
124
- };
125
-
126
- const requestRes = client._createRequest(context, {
127
- security: requestSecurity,
128
- method: "PATCH",
129
- baseURL: options?.serverURL,
130
- path: path,
131
- headers: headers,
132
- body: body,
133
- userAgent: client._options.userAgent,
134
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
135
- }, options);
136
- if (!requestRes.ok) {
137
- return [requestRes, { status: "invalid" }];
138
- }
139
- const req = requestRes.value;
140
-
141
- const doResult = await client._do(req, {
142
- context,
143
- errorCodes: ["404", "4XX", "5XX"],
144
- retryConfig: context.retryConfig,
145
- retryCodes: context.retryCodes,
146
- });
147
- if (!doResult.ok) {
148
- return [doResult, { status: "request-error", request: req }];
149
- }
150
- const response = doResult.value;
151
-
152
- const responseFields = {
153
- HttpMeta: { Response: response, Request: req },
154
- };
155
-
156
- const [result] = await M.match<
157
- operations.UpdateContactResponseBody,
158
- | errors.UpdateContactResponseBody
159
- | OrqError
160
- | ResponseValidationError
161
- | ConnectionError
162
- | RequestAbortedError
163
- | RequestTimeoutError
164
- | InvalidRequestError
165
- | UnexpectedClientError
166
- | SDKValidationError
167
- >(
168
- M.json(200, operations.UpdateContactResponseBody$inboundSchema),
169
- M.jsonErr(404, errors.UpdateContactResponseBody$inboundSchema),
170
- M.fail("4XX"),
171
- M.fail("5XX"),
172
- )(response, req, { extraFields: responseFields });
173
- if (!result.ok) {
174
- return [result, { status: "complete", request: req, response }];
175
- }
176
-
177
- return [result, { status: "complete", request: req, response }];
178
- }