@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,62 +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 { OrqError } from "./orqerror.js";
7
-
8
- /**
9
- * Contact not found
10
- */
11
- export type DeleteContactResponseBodyData = {
12
- /**
13
- * Error message
14
- */
15
- error: string;
16
- };
17
-
18
- /**
19
- * Contact not found
20
- */
21
- export class DeleteContactResponseBody extends OrqError {
22
- /**
23
- * Error message
24
- */
25
- error: string;
26
-
27
- /** The original data that was passed to this error instance. */
28
- data$: DeleteContactResponseBodyData;
29
-
30
- constructor(
31
- err: DeleteContactResponseBodyData,
32
- httpMeta: { response: Response; request: Request; body: string },
33
- ) {
34
- const message = "message" in err && typeof err.message === "string"
35
- ? err.message
36
- : `API error occurred: ${JSON.stringify(err)}`;
37
- super(message, httpMeta);
38
- this.data$ = err;
39
- this.error = err.error;
40
-
41
- this.name = "DeleteContactResponseBody";
42
- }
43
- }
44
-
45
- /** @internal */
46
- export const DeleteContactResponseBody$inboundSchema: z.ZodType<
47
- DeleteContactResponseBody,
48
- z.ZodTypeDef,
49
- unknown
50
- > = z.object({
51
- error: z.string(),
52
- request$: z.instanceof(Request),
53
- response$: z.instanceof(Response),
54
- body$: z.string(),
55
- })
56
- .transform((v) => {
57
- return new DeleteContactResponseBody(v, {
58
- request: v.request$,
59
- response: v.response$,
60
- body: v.body$,
61
- });
62
- });
@@ -1,62 +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 { OrqError } from "./orqerror.js";
7
-
8
- /**
9
- * Contact not found
10
- */
11
- export type RetrieveContactResponseBodyData = {
12
- /**
13
- * Error message
14
- */
15
- error: string;
16
- };
17
-
18
- /**
19
- * Contact not found
20
- */
21
- export class RetrieveContactResponseBody extends OrqError {
22
- /**
23
- * Error message
24
- */
25
- error: string;
26
-
27
- /** The original data that was passed to this error instance. */
28
- data$: RetrieveContactResponseBodyData;
29
-
30
- constructor(
31
- err: RetrieveContactResponseBodyData,
32
- httpMeta: { response: Response; request: Request; body: string },
33
- ) {
34
- const message = "message" in err && typeof err.message === "string"
35
- ? err.message
36
- : `API error occurred: ${JSON.stringify(err)}`;
37
- super(message, httpMeta);
38
- this.data$ = err;
39
- this.error = err.error;
40
-
41
- this.name = "RetrieveContactResponseBody";
42
- }
43
- }
44
-
45
- /** @internal */
46
- export const RetrieveContactResponseBody$inboundSchema: z.ZodType<
47
- RetrieveContactResponseBody,
48
- z.ZodTypeDef,
49
- unknown
50
- > = z.object({
51
- error: z.string(),
52
- request$: z.instanceof(Request),
53
- response$: z.instanceof(Response),
54
- body$: z.string(),
55
- })
56
- .transform((v) => {
57
- return new RetrieveContactResponseBody(v, {
58
- request: v.request$,
59
- response: v.response$,
60
- body: v.body$,
61
- });
62
- });
@@ -1,54 +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 { OrqError } from "./orqerror.js";
7
-
8
- /**
9
- * Contact not found
10
- */
11
- export type UpdateContactResponseBodyData = {
12
- /**
13
- * Error message
14
- */
15
- message: string;
16
- };
17
-
18
- /**
19
- * Contact not found
20
- */
21
- export class UpdateContactResponseBody extends OrqError {
22
- /** The original data that was passed to this error instance. */
23
- data$: UpdateContactResponseBodyData;
24
-
25
- constructor(
26
- err: UpdateContactResponseBodyData,
27
- httpMeta: { response: Response; request: Request; body: string },
28
- ) {
29
- const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
30
- super(message, httpMeta);
31
- this.data$ = err;
32
-
33
- this.name = "UpdateContactResponseBody";
34
- }
35
- }
36
-
37
- /** @internal */
38
- export const UpdateContactResponseBody$inboundSchema: z.ZodType<
39
- UpdateContactResponseBody,
40
- z.ZodTypeDef,
41
- unknown
42
- > = z.object({
43
- message: z.string(),
44
- request$: z.instanceof(Request),
45
- response$: z.instanceof(Response),
46
- body$: z.string(),
47
- })
48
- .transform((v) => {
49
- return new UpdateContactResponseBody(v, {
50
- request: v.request$,
51
- response: v.response$,
52
- body: v.body$,
53
- });
54
- });
@@ -1,34 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
-
7
- export type DeleteContactRequest = {
8
- /**
9
- * Contact ID or External ID
10
- */
11
- id: string;
12
- };
13
-
14
- /** @internal */
15
- export type DeleteContactRequest$Outbound = {
16
- id: string;
17
- };
18
-
19
- /** @internal */
20
- export const DeleteContactRequest$outboundSchema: z.ZodType<
21
- DeleteContactRequest$Outbound,
22
- z.ZodTypeDef,
23
- DeleteContactRequest
24
- > = z.object({
25
- id: z.string(),
26
- });
27
-
28
- export function deleteContactRequestToJSON(
29
- deleteContactRequest: DeleteContactRequest,
30
- ): string {
31
- return JSON.stringify(
32
- DeleteContactRequest$outboundSchema.parse(deleteContactRequest),
33
- );
34
- }
@@ -1,274 +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 { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- /**
13
- * Filter contacts by tags. Can be provided as JSON object {"tags": ["premium", "beta-user"]} or as query format "tags=premium,beta-user"
14
- */
15
- export type ListContactsQueryParamFilterBy = {
16
- tags?: Array<string> | undefined;
17
- };
18
-
19
- export type ListContactsRequest = {
20
- /**
21
- * A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10
22
- */
23
- limit?: number | undefined;
24
- /**
25
- * A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, ending with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `after=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the next page of the list.
26
- */
27
- startingAfter?: string | undefined;
28
- /**
29
- * A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 20 objects, starting with `01JJ1HDHN79XAS7A01WB3HYSDB`, your subsequent call can include `before=01JJ1HDHN79XAS7A01WB3HYSDB` in order to fetch the previous page of the list.
30
- */
31
- endingBefore?: string | undefined;
32
- /**
33
- * Search contacts by display name or email address. Minimum 2 characters required.
34
- */
35
- search?: string | undefined;
36
- /**
37
- * Filter contacts by tags. Can be provided as JSON object {"tags": ["premium", "beta-user"]} or as query format "tags=premium,beta-user"
38
- */
39
- filterBy?: ListContactsQueryParamFilterBy | undefined;
40
- /**
41
- * Include usage metrics of the last 30 days for each contact.
42
- */
43
- includeMetrics?: boolean | null | undefined;
44
- };
45
-
46
- export const ObjectT = {
47
- List: "list",
48
- } as const;
49
- export type ObjectT = ClosedEnum<typeof ObjectT>;
50
-
51
- export type ListContactsMetrics = {
52
- /**
53
- * Total cost in dollars of the last 30 days
54
- */
55
- totalCost: number;
56
- /**
57
- * Total tokens of the last 30 days
58
- */
59
- totalTokens: number;
60
- /**
61
- * Total requests of the last 30 days
62
- */
63
- totalRequests: number;
64
- /**
65
- * P50 error rate of the last 30 days
66
- */
67
- errorRate: number;
68
- };
69
-
70
- export type Data = {
71
- /**
72
- * Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
73
- */
74
- id: string;
75
- /**
76
- * Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user.
77
- */
78
- externalId: string;
79
- /**
80
- * Display name or nickname of the contact user. This is typically shown in user interfaces.
81
- */
82
- displayName?: string | null | undefined;
83
- /**
84
- * Email address of the contact user
85
- */
86
- email?: string | null | undefined;
87
- /**
88
- * URL linking to the contact user's avatar image
89
- */
90
- avatarUrl?: string | null | undefined;
91
- /**
92
- * Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
93
- */
94
- tags?: Array<string> | undefined;
95
- /**
96
- * Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
97
- */
98
- metadata?: { [k: string]: any } | undefined;
99
- /**
100
- * The date and time the resource was created
101
- */
102
- created?: Date | undefined;
103
- /**
104
- * The date and time the resource was last updated
105
- */
106
- updated: Date;
107
- metrics: ListContactsMetrics;
108
- };
109
-
110
- /**
111
- * List of contacts
112
- */
113
- export type ListContactsResponseBody = {
114
- object: ObjectT;
115
- data: Array<Data>;
116
- hasMore: boolean;
117
- };
118
-
119
- /** @internal */
120
- export type ListContactsQueryParamFilterBy$Outbound = {
121
- tags?: Array<string> | undefined;
122
- };
123
-
124
- /** @internal */
125
- export const ListContactsQueryParamFilterBy$outboundSchema: z.ZodType<
126
- ListContactsQueryParamFilterBy$Outbound,
127
- z.ZodTypeDef,
128
- ListContactsQueryParamFilterBy
129
- > = z.object({
130
- tags: z.array(z.string()).optional(),
131
- });
132
-
133
- export function listContactsQueryParamFilterByToJSON(
134
- listContactsQueryParamFilterBy: ListContactsQueryParamFilterBy,
135
- ): string {
136
- return JSON.stringify(
137
- ListContactsQueryParamFilterBy$outboundSchema.parse(
138
- listContactsQueryParamFilterBy,
139
- ),
140
- );
141
- }
142
-
143
- /** @internal */
144
- export type ListContactsRequest$Outbound = {
145
- limit: number;
146
- starting_after?: string | undefined;
147
- ending_before?: string | undefined;
148
- search?: string | undefined;
149
- filter_by?: ListContactsQueryParamFilterBy$Outbound | undefined;
150
- include_metrics: boolean | null;
151
- };
152
-
153
- /** @internal */
154
- export const ListContactsRequest$outboundSchema: z.ZodType<
155
- ListContactsRequest$Outbound,
156
- z.ZodTypeDef,
157
- ListContactsRequest
158
- > = z.object({
159
- limit: z.number().default(10),
160
- startingAfter: z.string().optional(),
161
- endingBefore: z.string().optional(),
162
- search: z.string().optional(),
163
- filterBy: z.lazy(() => ListContactsQueryParamFilterBy$outboundSchema)
164
- .optional(),
165
- includeMetrics: z.nullable(z.boolean().default(false)),
166
- }).transform((v) => {
167
- return remap$(v, {
168
- startingAfter: "starting_after",
169
- endingBefore: "ending_before",
170
- filterBy: "filter_by",
171
- includeMetrics: "include_metrics",
172
- });
173
- });
174
-
175
- export function listContactsRequestToJSON(
176
- listContactsRequest: ListContactsRequest,
177
- ): string {
178
- return JSON.stringify(
179
- ListContactsRequest$outboundSchema.parse(listContactsRequest),
180
- );
181
- }
182
-
183
- /** @internal */
184
- export const ObjectT$inboundSchema: z.ZodNativeEnum<typeof ObjectT> = z
185
- .nativeEnum(ObjectT);
186
-
187
- /** @internal */
188
- export const ListContactsMetrics$inboundSchema: z.ZodType<
189
- ListContactsMetrics,
190
- z.ZodTypeDef,
191
- unknown
192
- > = z.object({
193
- total_cost: z.number(),
194
- total_tokens: z.number(),
195
- total_requests: z.number(),
196
- error_rate: z.number(),
197
- }).transform((v) => {
198
- return remap$(v, {
199
- "total_cost": "totalCost",
200
- "total_tokens": "totalTokens",
201
- "total_requests": "totalRequests",
202
- "error_rate": "errorRate",
203
- });
204
- });
205
-
206
- export function listContactsMetricsFromJSON(
207
- jsonString: string,
208
- ): SafeParseResult<ListContactsMetrics, SDKValidationError> {
209
- return safeParse(
210
- jsonString,
211
- (x) => ListContactsMetrics$inboundSchema.parse(JSON.parse(x)),
212
- `Failed to parse 'ListContactsMetrics' from JSON`,
213
- );
214
- }
215
-
216
- /** @internal */
217
- export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
218
- .object({
219
- _id: z.string(),
220
- external_id: z.string(),
221
- display_name: z.nullable(z.string()).optional(),
222
- email: z.nullable(z.string()).optional(),
223
- avatar_url: z.nullable(z.string()).optional(),
224
- tags: z.array(z.string()).optional(),
225
- metadata: z.record(z.any()).optional(),
226
- created: z.string().datetime({ offset: true }).transform(v => new Date(v))
227
- .optional(),
228
- updated: z.string().datetime({ offset: true }).default(
229
- "2026-01-23T11:14:01.166Z",
230
- ).transform(v => new Date(v)),
231
- metrics: z.lazy(() => ListContactsMetrics$inboundSchema),
232
- }).transform((v) => {
233
- return remap$(v, {
234
- "_id": "id",
235
- "external_id": "externalId",
236
- "display_name": "displayName",
237
- "avatar_url": "avatarUrl",
238
- });
239
- });
240
-
241
- export function dataFromJSON(
242
- jsonString: string,
243
- ): SafeParseResult<Data, SDKValidationError> {
244
- return safeParse(
245
- jsonString,
246
- (x) => Data$inboundSchema.parse(JSON.parse(x)),
247
- `Failed to parse 'Data' from JSON`,
248
- );
249
- }
250
-
251
- /** @internal */
252
- export const ListContactsResponseBody$inboundSchema: z.ZodType<
253
- ListContactsResponseBody,
254
- z.ZodTypeDef,
255
- unknown
256
- > = z.object({
257
- object: ObjectT$inboundSchema,
258
- data: z.array(z.lazy(() => Data$inboundSchema)),
259
- has_more: z.boolean(),
260
- }).transform((v) => {
261
- return remap$(v, {
262
- "has_more": "hasMore",
263
- });
264
- });
265
-
266
- export function listContactsResponseBodyFromJSON(
267
- jsonString: string,
268
- ): SafeParseResult<ListContactsResponseBody, SDKValidationError> {
269
- return safeParse(
270
- jsonString,
271
- (x) => ListContactsResponseBody$inboundSchema.parse(JSON.parse(x)),
272
- `Failed to parse 'ListContactsResponseBody' from JSON`,
273
- );
274
- }
@@ -1,117 +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 { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- export type RetrieveContactRequest = {
12
- /**
13
- * Unique contact id or external id
14
- */
15
- id: string;
16
- };
17
-
18
- /**
19
- * Contact details
20
- */
21
- export type RetrieveContactResponseBody = {
22
- /**
23
- * Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
24
- */
25
- id: string;
26
- /**
27
- * Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user.
28
- */
29
- externalId: string;
30
- /**
31
- * Display name or nickname of the contact user. This is typically shown in user interfaces.
32
- */
33
- displayName?: string | null | undefined;
34
- /**
35
- * Email address of the contact user
36
- */
37
- email?: string | null | undefined;
38
- /**
39
- * URL linking to the contact user's avatar image
40
- */
41
- avatarUrl?: string | null | undefined;
42
- /**
43
- * Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
44
- */
45
- tags?: Array<string> | undefined;
46
- /**
47
- * Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
48
- */
49
- metadata?: { [k: string]: any } | undefined;
50
- /**
51
- * The date and time the resource was created
52
- */
53
- created?: Date | undefined;
54
- /**
55
- * The date and time the resource was last updated
56
- */
57
- updated: Date;
58
- };
59
-
60
- /** @internal */
61
- export type RetrieveContactRequest$Outbound = {
62
- id: string;
63
- };
64
-
65
- /** @internal */
66
- export const RetrieveContactRequest$outboundSchema: z.ZodType<
67
- RetrieveContactRequest$Outbound,
68
- z.ZodTypeDef,
69
- RetrieveContactRequest
70
- > = z.object({
71
- id: z.string(),
72
- });
73
-
74
- export function retrieveContactRequestToJSON(
75
- retrieveContactRequest: RetrieveContactRequest,
76
- ): string {
77
- return JSON.stringify(
78
- RetrieveContactRequest$outboundSchema.parse(retrieveContactRequest),
79
- );
80
- }
81
-
82
- /** @internal */
83
- export const RetrieveContactResponseBody$inboundSchema: z.ZodType<
84
- RetrieveContactResponseBody,
85
- z.ZodTypeDef,
86
- unknown
87
- > = z.object({
88
- _id: z.string(),
89
- external_id: z.string(),
90
- display_name: z.nullable(z.string()).optional(),
91
- email: z.nullable(z.string()).optional(),
92
- avatar_url: z.nullable(z.string()).optional(),
93
- tags: z.array(z.string()).optional(),
94
- metadata: z.record(z.any()).optional(),
95
- created: z.string().datetime({ offset: true }).transform(v => new Date(v))
96
- .optional(),
97
- updated: z.string().datetime({ offset: true }).default(
98
- "2026-01-23T11:14:01.166Z",
99
- ).transform(v => new Date(v)),
100
- }).transform((v) => {
101
- return remap$(v, {
102
- "_id": "id",
103
- "external_id": "externalId",
104
- "display_name": "displayName",
105
- "avatar_url": "avatarUrl",
106
- });
107
- });
108
-
109
- export function retrieveContactResponseBodyFromJSON(
110
- jsonString: string,
111
- ): SafeParseResult<RetrieveContactResponseBody, SDKValidationError> {
112
- return safeParse(
113
- jsonString,
114
- (x) => RetrieveContactResponseBody$inboundSchema.parse(JSON.parse(x)),
115
- `Failed to parse 'RetrieveContactResponseBody' from JSON`,
116
- );
117
- }