@orq-ai/node 4.2.3 → 4.2.4

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 (155) hide show
  1. package/examples/package-lock.json +1 -1
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +2 -2
  4. package/lib/config.js +2 -2
  5. package/models/components/conversationresponse.js +1 -1
  6. package/models/components/conversationwithmessagesresponse.js +1 -1
  7. package/models/components/partdoneevent.js +1 -1
  8. package/models/components/reasoningpart.js +1 -1
  9. package/models/operations/createcontact.js +1 -1
  10. package/models/operations/createconversation.js +1 -1
  11. package/models/operations/createconversationresponse.js +2 -2
  12. package/models/operations/createdataset.js +1 -1
  13. package/models/operations/createdatasetitem.js +4 -4
  14. package/models/operations/createdatasource.js +1 -1
  15. package/models/operations/createeval.js +14 -14
  16. package/models/operations/createidentity.js +1 -1
  17. package/models/operations/createtool.js +6 -6
  18. package/models/operations/fileget.js +1 -1
  19. package/models/operations/filelist.js +1 -1
  20. package/models/operations/fileupload.js +1 -1
  21. package/models/operations/generateconversationname.js +1 -1
  22. package/models/operations/getalltools.js +6 -6
  23. package/models/operations/getevals.js +14 -14
  24. package/models/operations/listdatasetdatapoints.js +4 -4
  25. package/models/operations/listdatasets.js +1 -1
  26. package/models/operations/listdatasources.js +1 -1
  27. package/models/operations/listidentities.js +1 -1
  28. package/models/operations/retrievedatapoint.js +4 -4
  29. package/models/operations/retrievedataset.js +1 -1
  30. package/models/operations/retrievedatasource.js +1 -1
  31. package/models/operations/retrieveidentity.js +1 -1
  32. package/models/operations/retrievetool.js +6 -6
  33. package/models/operations/runagent.js +1 -1
  34. package/models/operations/streamrunagent.js +1 -1
  35. package/models/operations/updateconversation.js +1 -1
  36. package/models/operations/updatedatapoint.js +4 -4
  37. package/models/operations/updatedataset.js +1 -1
  38. package/models/operations/updatedatasource.js +1 -1
  39. package/models/operations/updateeval.js +14 -14
  40. package/models/operations/updateidentity.js +1 -1
  41. package/models/operations/updatetool.js +7 -7
  42. package/package.json +1 -1
  43. package/packages/orq-rc/examples/contactsCreate.example.ts +42 -0
  44. package/packages/orq-rc/examples/package-lock.json +1 -1
  45. package/packages/orq-rc/jsr.json +1 -1
  46. package/packages/orq-rc/package-lock.json +2 -2
  47. package/packages/orq-rc/package.json +1 -1
  48. package/packages/orq-rc/src/funcs/contactsCreate.ts +7 -14
  49. package/packages/orq-rc/src/lib/config.ts +2 -2
  50. package/packages/orq-rc/src/models/components/conversationresponse.ts +1 -1
  51. package/packages/orq-rc/src/models/components/conversationwithmessagesresponse.ts +1 -1
  52. package/packages/orq-rc/src/models/components/index.ts +1 -0
  53. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +11 -0
  54. package/packages/orq-rc/src/models/components/partdoneevent.ts +1 -1
  55. package/packages/orq-rc/src/models/components/publiccontact.ts +3 -1
  56. package/packages/orq-rc/src/models/components/publicidentity.ts +69 -0
  57. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  58. package/packages/orq-rc/src/models/errors/index.ts +0 -3
  59. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +11 -78
  60. package/packages/orq-rc/src/models/operations/createcompletion.ts +11 -75
  61. package/packages/orq-rc/src/models/operations/createcontact.ts +3 -9
  62. package/packages/orq-rc/src/models/operations/createconversation.ts +1 -1
  63. package/packages/orq-rc/src/models/operations/createconversationresponse.ts +2 -2
  64. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  65. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  66. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  67. package/packages/orq-rc/src/models/operations/createembedding.ts +11 -75
  68. package/packages/orq-rc/src/models/operations/createeval.ts +14 -14
  69. package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
  70. package/packages/orq-rc/src/models/operations/createimage.ts +11 -75
  71. package/packages/orq-rc/src/models/operations/createimageedit.ts +11 -75
  72. package/packages/orq-rc/src/models/operations/createimagevariation.ts +11 -77
  73. package/packages/orq-rc/src/models/operations/creatererank.ts +11 -75
  74. package/packages/orq-rc/src/models/operations/createspeech.ts +11 -75
  75. package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
  76. package/packages/orq-rc/src/models/operations/createtranscription.ts +11 -75
  77. package/packages/orq-rc/src/models/operations/createtranslation.ts +11 -75
  78. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +6 -0
  79. package/packages/orq-rc/src/models/operations/deploymentstream.ts +6 -0
  80. package/packages/orq-rc/src/models/operations/fileget.ts +1 -1
  81. package/packages/orq-rc/src/models/operations/filelist.ts +1 -1
  82. package/packages/orq-rc/src/models/operations/fileupload.ts +1 -1
  83. package/packages/orq-rc/src/models/operations/generateconversationname.ts +1 -1
  84. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  85. package/packages/orq-rc/src/models/operations/getevals.ts +35 -39
  86. package/packages/orq-rc/src/models/operations/index.ts +0 -4
  87. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  88. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  89. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  90. package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
  91. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  92. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  93. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  94. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
  95. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  96. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  97. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  98. package/packages/orq-rc/src/models/operations/updateconversation.ts +1 -1
  99. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  100. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  101. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  102. package/packages/orq-rc/src/models/operations/updateeval.ts +14 -14
  103. package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
  104. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  105. package/packages/orq-rc/src/sdk/contacts.ts +3 -85
  106. package/src/lib/config.ts +2 -2
  107. package/src/models/components/conversationresponse.ts +1 -1
  108. package/src/models/components/conversationwithmessagesresponse.ts +1 -1
  109. package/src/models/components/partdoneevent.ts +1 -1
  110. package/src/models/components/reasoningpart.ts +1 -1
  111. package/src/models/operations/createcontact.ts +1 -1
  112. package/src/models/operations/createconversation.ts +1 -1
  113. package/src/models/operations/createconversationresponse.ts +2 -2
  114. package/src/models/operations/createdataset.ts +1 -1
  115. package/src/models/operations/createdatasetitem.ts +4 -4
  116. package/src/models/operations/createdatasource.ts +1 -1
  117. package/src/models/operations/createeval.ts +14 -14
  118. package/src/models/operations/createidentity.ts +1 -1
  119. package/src/models/operations/createtool.ts +6 -6
  120. package/src/models/operations/fileget.ts +1 -1
  121. package/src/models/operations/filelist.ts +1 -1
  122. package/src/models/operations/fileupload.ts +1 -1
  123. package/src/models/operations/generateconversationname.ts +1 -1
  124. package/src/models/operations/getalltools.ts +6 -6
  125. package/src/models/operations/getevals.ts +14 -14
  126. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  127. package/src/models/operations/listdatasets.ts +1 -1
  128. package/src/models/operations/listdatasources.ts +1 -1
  129. package/src/models/operations/listidentities.ts +1 -1
  130. package/src/models/operations/retrievedatapoint.ts +4 -4
  131. package/src/models/operations/retrievedataset.ts +1 -1
  132. package/src/models/operations/retrievedatasource.ts +1 -1
  133. package/src/models/operations/retrieveidentity.ts +1 -1
  134. package/src/models/operations/retrievetool.ts +6 -6
  135. package/src/models/operations/runagent.ts +1 -1
  136. package/src/models/operations/streamrunagent.ts +1 -1
  137. package/src/models/operations/updateconversation.ts +1 -1
  138. package/src/models/operations/updatedatapoint.ts +4 -4
  139. package/src/models/operations/updatedataset.ts +1 -1
  140. package/src/models/operations/updatedatasource.ts +1 -1
  141. package/src/models/operations/updateeval.ts +14 -14
  142. package/src/models/operations/updateidentity.ts +1 -1
  143. package/src/models/operations/updatetool.ts +7 -7
  144. package/packages/orq-rc/examples/feedbackCreate.example.ts +0 -32
  145. package/packages/orq-rc/src/funcs/contactsDelete.ts +0 -178
  146. package/packages/orq-rc/src/funcs/contactsList.ts +0 -172
  147. package/packages/orq-rc/src/funcs/contactsRetrieve.ts +0 -177
  148. package/packages/orq-rc/src/funcs/contactsUpdate.ts +0 -178
  149. package/packages/orq-rc/src/models/errors/deletecontact.ts +0 -62
  150. package/packages/orq-rc/src/models/errors/retrievecontact.ts +0 -62
  151. package/packages/orq-rc/src/models/errors/updatecontact.ts +0 -54
  152. package/packages/orq-rc/src/models/operations/deletecontact.ts +0 -34
  153. package/packages/orq-rc/src/models/operations/listcontacts.ts +0 -274
  154. package/packages/orq-rc/src/models/operations/retrievecontact.ts +0 -117
  155. package/packages/orq-rc/src/models/operations/updatecontact.ts +0 -188
@@ -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-23T09:49:01.865Z",
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-23T09:49:01.865Z",
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
- }
@@ -1,188 +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
- /**
12
- * Contact fields to update
13
- */
14
- export type UpdateContactRequestBody = {
15
- /**
16
- * Display name or nickname of the contact user. This is typically shown in user interfaces.
17
- */
18
- displayName?: string | null | undefined;
19
- /**
20
- * Email address of the contact user
21
- */
22
- email?: string | null | undefined;
23
- /**
24
- * URL linking to the contact user's avatar image
25
- */
26
- avatarUrl?: string | null | undefined;
27
- /**
28
- * Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
29
- */
30
- tags?: Array<string> | undefined;
31
- /**
32
- * Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
33
- */
34
- metadata?: { [k: string]: any } | undefined;
35
- };
36
-
37
- export type UpdateContactRequest = {
38
- /**
39
- * Unique contact id or external id
40
- */
41
- id: string;
42
- /**
43
- * Contact fields to update
44
- */
45
- requestBody?: UpdateContactRequestBody | undefined;
46
- };
47
-
48
- /**
49
- * Updated contact
50
- */
51
- export type UpdateContactResponseBody = {
52
- /**
53
- * Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact
54
- */
55
- id: string;
56
- /**
57
- * 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.
58
- */
59
- externalId: string;
60
- /**
61
- * Display name or nickname of the contact user. This is typically shown in user interfaces.
62
- */
63
- displayName?: string | null | undefined;
64
- /**
65
- * Email address of the contact user
66
- */
67
- email?: string | null | undefined;
68
- /**
69
- * URL linking to the contact user's avatar image
70
- */
71
- avatarUrl?: string | null | undefined;
72
- /**
73
- * Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications.
74
- */
75
- tags?: Array<string> | undefined;
76
- /**
77
- * Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application.
78
- */
79
- metadata?: { [k: string]: any } | undefined;
80
- /**
81
- * The date and time the resource was created
82
- */
83
- created?: Date | undefined;
84
- /**
85
- * The date and time the resource was last updated
86
- */
87
- updated: Date;
88
- };
89
-
90
- /** @internal */
91
- export type UpdateContactRequestBody$Outbound = {
92
- display_name?: string | null | undefined;
93
- email?: string | null | undefined;
94
- avatar_url?: string | null | undefined;
95
- tags?: Array<string> | undefined;
96
- metadata?: { [k: string]: any } | undefined;
97
- };
98
-
99
- /** @internal */
100
- export const UpdateContactRequestBody$outboundSchema: z.ZodType<
101
- UpdateContactRequestBody$Outbound,
102
- z.ZodTypeDef,
103
- UpdateContactRequestBody
104
- > = z.object({
105
- displayName: z.nullable(z.string()).optional(),
106
- email: z.nullable(z.string()).optional(),
107
- avatarUrl: z.nullable(z.string()).optional(),
108
- tags: z.array(z.string()).optional(),
109
- metadata: z.record(z.any()).optional(),
110
- }).transform((v) => {
111
- return remap$(v, {
112
- displayName: "display_name",
113
- avatarUrl: "avatar_url",
114
- });
115
- });
116
-
117
- export function updateContactRequestBodyToJSON(
118
- updateContactRequestBody: UpdateContactRequestBody,
119
- ): string {
120
- return JSON.stringify(
121
- UpdateContactRequestBody$outboundSchema.parse(updateContactRequestBody),
122
- );
123
- }
124
-
125
- /** @internal */
126
- export type UpdateContactRequest$Outbound = {
127
- id: string;
128
- RequestBody?: UpdateContactRequestBody$Outbound | undefined;
129
- };
130
-
131
- /** @internal */
132
- export const UpdateContactRequest$outboundSchema: z.ZodType<
133
- UpdateContactRequest$Outbound,
134
- z.ZodTypeDef,
135
- UpdateContactRequest
136
- > = z.object({
137
- id: z.string(),
138
- requestBody: z.lazy(() => UpdateContactRequestBody$outboundSchema).optional(),
139
- }).transform((v) => {
140
- return remap$(v, {
141
- requestBody: "RequestBody",
142
- });
143
- });
144
-
145
- export function updateContactRequestToJSON(
146
- updateContactRequest: UpdateContactRequest,
147
- ): string {
148
- return JSON.stringify(
149
- UpdateContactRequest$outboundSchema.parse(updateContactRequest),
150
- );
151
- }
152
-
153
- /** @internal */
154
- export const UpdateContactResponseBody$inboundSchema: z.ZodType<
155
- UpdateContactResponseBody,
156
- z.ZodTypeDef,
157
- unknown
158
- > = z.object({
159
- _id: z.string(),
160
- external_id: z.string(),
161
- display_name: z.nullable(z.string()).optional(),
162
- email: z.nullable(z.string()).optional(),
163
- avatar_url: z.nullable(z.string()).optional(),
164
- tags: z.array(z.string()).optional(),
165
- metadata: z.record(z.any()).optional(),
166
- created: z.string().datetime({ offset: true }).transform(v => new Date(v))
167
- .optional(),
168
- updated: z.string().datetime({ offset: true }).default(
169
- "2026-01-23T09:49:01.865Z",
170
- ).transform(v => new Date(v)),
171
- }).transform((v) => {
172
- return remap$(v, {
173
- "_id": "id",
174
- "external_id": "externalId",
175
- "display_name": "displayName",
176
- "avatar_url": "avatarUrl",
177
- });
178
- });
179
-
180
- export function updateContactResponseBodyFromJSON(
181
- jsonString: string,
182
- ): SafeParseResult<UpdateContactResponseBody, SDKValidationError> {
183
- return safeParse(
184
- jsonString,
185
- (x) => UpdateContactResponseBody$inboundSchema.parse(JSON.parse(x)),
186
- `Failed to parse 'UpdateContactResponseBody' from JSON`,
187
- );
188
- }