@orq-ai/node 3.2.9 → 3.2.11

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 (153) hide show
  1. package/bin/mcp-server.js +32 -32
  2. package/bin/mcp-server.js.map +17 -17
  3. package/hooks/types.d.ts +1 -1
  4. package/hooks/types.d.ts.map +1 -1
  5. package/jsr.json +1 -1
  6. package/lib/config.d.ts +3 -3
  7. package/lib/config.js +3 -3
  8. package/lib/config.js.map +1 -1
  9. package/mcp-server/mcp-server.js +1 -1
  10. package/mcp-server/mcp-server.js.map +1 -1
  11. package/mcp-server/server.js +1 -1
  12. package/mcp-server/server.js.map +1 -1
  13. package/models/operations/bulkcreatedatapoints.js +2 -2
  14. package/models/operations/createcontact.js +2 -2
  15. package/models/operations/createdataset.js +2 -2
  16. package/models/operations/createdatasetitem.js +2 -2
  17. package/models/operations/fileget.js +2 -2
  18. package/models/operations/filelist.js +2 -2
  19. package/models/operations/fileupload.js +2 -2
  20. package/models/operations/listdatasetdatapoints.js +2 -2
  21. package/models/operations/listdatasets.js +2 -2
  22. package/models/operations/retrievedatapoint.js +2 -2
  23. package/models/operations/retrievedataset.js +2 -2
  24. package/models/operations/updatedatapoint.js +2 -2
  25. package/models/operations/updatedataset.js +2 -2
  26. package/package.json +1 -1
  27. package/packages/orq-rc/README.md +37 -1
  28. package/packages/orq-rc/docs/sdks/files/README.md +8 -2
  29. package/packages/orq-rc/docs/sdks/knowledge/README.md +1197 -0
  30. package/packages/orq-rc/jsr.json +1 -1
  31. package/packages/orq-rc/package-lock.json +2 -2
  32. package/packages/orq-rc/package.json +1 -1
  33. package/packages/orq-rc/src/funcs/contactsCreate.ts +1 -1
  34. package/packages/orq-rc/src/funcs/datasetsClear.ts +1 -1
  35. package/packages/orq-rc/src/funcs/datasetsCreate.ts +1 -1
  36. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +1 -1
  37. package/packages/orq-rc/src/funcs/datasetsCreateDatapoints.ts +1 -1
  38. package/packages/orq-rc/src/funcs/datasetsDelete.ts +1 -1
  39. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +1 -1
  40. package/packages/orq-rc/src/funcs/datasetsList.ts +1 -1
  41. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +1 -1
  42. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +1 -1
  43. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +1 -1
  44. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +1 -1
  45. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +1 -1
  46. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +1 -1
  47. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +1 -1
  48. package/packages/orq-rc/src/funcs/deploymentsList.ts +1 -1
  49. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +1 -1
  50. package/packages/orq-rc/src/funcs/deploymentsStream.ts +1 -1
  51. package/packages/orq-rc/src/funcs/feedbackCreate.ts +1 -1
  52. package/packages/orq-rc/src/funcs/filesCreate.ts +19 -22
  53. package/packages/orq-rc/src/funcs/filesDelete.ts +1 -1
  54. package/packages/orq-rc/src/funcs/filesGet.ts +1 -1
  55. package/packages/orq-rc/src/funcs/filesList.ts +1 -1
  56. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +152 -0
  57. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +165 -0
  58. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +160 -0
  59. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +161 -0
  60. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +168 -0
  61. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +167 -0
  62. package/packages/orq-rc/src/funcs/knowledgeList.ts +163 -0
  63. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +172 -0
  64. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +168 -0
  65. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +160 -0
  66. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +163 -0
  67. package/packages/orq-rc/src/funcs/knowledgeRetrieveFileUrl.ts +176 -0
  68. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +158 -0
  69. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +158 -0
  70. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +168 -0
  71. package/packages/orq-rc/src/funcs/promptsCreate.ts +1 -1
  72. package/packages/orq-rc/src/funcs/promptsDelete.ts +1 -1
  73. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +1 -1
  74. package/packages/orq-rc/src/funcs/promptsList.ts +1 -1
  75. package/packages/orq-rc/src/funcs/promptsListVersions.ts +1 -1
  76. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +1 -1
  77. package/packages/orq-rc/src/funcs/promptsUpdate.ts +1 -1
  78. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +1 -1
  79. package/packages/orq-rc/src/hooks/types.ts +1 -1
  80. package/packages/orq-rc/src/lib/config.ts +3 -3
  81. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  82. package/packages/orq-rc/src/mcp-server/server.ts +31 -1
  83. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +1 -1
  84. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +35 -0
  85. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +35 -0
  86. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +35 -0
  87. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +35 -0
  88. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +33 -0
  89. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +35 -0
  90. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +37 -0
  91. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +35 -0
  92. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +35 -0
  93. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +37 -0
  94. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +35 -0
  95. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveFileUrl.ts +35 -0
  96. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +35 -0
  97. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +35 -0
  98. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +35 -0
  99. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +2 -2
  100. package/packages/orq-rc/src/models/operations/createchunk.ts +680 -0
  101. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  103. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
  104. package/packages/orq-rc/src/models/operations/createdatasource.ts +852 -0
  105. package/packages/orq-rc/src/models/operations/createknowledge.ts +2920 -0
  106. package/packages/orq-rc/src/models/operations/createprompt.ts +6 -0
  107. package/packages/orq-rc/src/models/operations/deletechunk.ts +96 -0
  108. package/packages/orq-rc/src/models/operations/deletedatasource.ts +87 -0
  109. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +78 -0
  110. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  111. package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
  112. package/packages/orq-rc/src/models/operations/fileupload.ts +6 -6
  113. package/packages/orq-rc/src/models/operations/getallprompts.ts +3 -0
  114. package/packages/orq-rc/src/models/operations/getonefileuploadurl.ts +157 -0
  115. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +1631 -0
  116. package/packages/orq-rc/src/models/operations/getoneprompt.ts +3 -0
  117. package/packages/orq-rc/src/models/operations/getpromptversion.ts +3 -0
  118. package/packages/orq-rc/src/models/operations/index.ts +15 -0
  119. package/packages/orq-rc/src/models/operations/listchunks.ts +444 -0
  120. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
  121. package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
  122. package/packages/orq-rc/src/models/operations/listdatasources.ts +447 -0
  123. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +1782 -0
  124. package/packages/orq-rc/src/models/operations/listpromptversions.ts +3 -0
  125. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  127. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +273 -0
  128. package/packages/orq-rc/src/models/operations/searchknowledge.ts +1673 -0
  129. package/packages/orq-rc/src/models/operations/updatechunk.ts +418 -0
  130. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
  131. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  132. package/packages/orq-rc/src/models/operations/updateknowledge.ts +3123 -0
  133. package/packages/orq-rc/src/models/operations/updateprompt.ts +6 -0
  134. package/packages/orq-rc/src/sdk/files.ts +1 -1
  135. package/packages/orq-rc/src/sdk/knowledge.ts +246 -0
  136. package/packages/orq-rc/src/sdk/sdk.ts +6 -0
  137. package/src/hooks/types.ts +1 -1
  138. package/src/lib/config.ts +3 -3
  139. package/src/mcp-server/mcp-server.ts +1 -1
  140. package/src/mcp-server/server.ts +1 -1
  141. package/src/models/operations/bulkcreatedatapoints.ts +2 -2
  142. package/src/models/operations/createcontact.ts +2 -2
  143. package/src/models/operations/createdataset.ts +2 -2
  144. package/src/models/operations/createdatasetitem.ts +2 -2
  145. package/src/models/operations/fileget.ts +2 -2
  146. package/src/models/operations/filelist.ts +2 -2
  147. package/src/models/operations/fileupload.ts +2 -2
  148. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  149. package/src/models/operations/listdatasets.ts +2 -2
  150. package/src/models/operations/retrievedatapoint.ts +2 -2
  151. package/src/models/operations/retrievedataset.ts +2 -2
  152. package/src/models/operations/updatedatapoint.ts +2 -2
  153. package/src/models/operations/updatedataset.ts +2 -2
@@ -0,0 +1,447 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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 datasources by status.
14
+ */
15
+ export type Status = Array<string> | string;
16
+
17
+ export type ListDatasourcesRequest = {
18
+ /**
19
+ * Unique identifier of the knowledge base
20
+ */
21
+ knowledgeId: string;
22
+ /**
23
+ * A limit on the number of objects to be returned. Limit can range between 1 and 50, and the default is 10
24
+ */
25
+ limit?: number | undefined;
26
+ /**
27
+ * 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.
28
+ */
29
+ startingAfter?: string | undefined;
30
+ /**
31
+ * 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.
32
+ */
33
+ endingBefore?: string | undefined;
34
+ /**
35
+ * Search query to find datasources by name.
36
+ */
37
+ q?: string | undefined;
38
+ /**
39
+ * Filter datasources by status.
40
+ */
41
+ status?: Array<string> | string | undefined;
42
+ };
43
+
44
+ export const ListDatasourcesObject = {
45
+ List: "list",
46
+ } as const;
47
+ export type ListDatasourcesObject = ClosedEnum<typeof ListDatasourcesObject>;
48
+
49
+ export const ListDatasourcesStatus = {
50
+ Pending: "pending",
51
+ Processing: "processing",
52
+ Completed: "completed",
53
+ Failed: "failed",
54
+ Queued: "queued",
55
+ } as const;
56
+ export type ListDatasourcesStatus = ClosedEnum<typeof ListDatasourcesStatus>;
57
+
58
+ export type ListDatasourcesData = {
59
+ /**
60
+ * The id of the resource
61
+ */
62
+ id?: string | undefined;
63
+ /**
64
+ * The display name of the datasource. Normally the name of the uploaded file
65
+ */
66
+ displayName: string;
67
+ /**
68
+ * The description of the knowledge base
69
+ */
70
+ description?: string | undefined;
71
+ status: ListDatasourcesStatus;
72
+ /**
73
+ * The unique identifier of the file used to create the datasource.
74
+ */
75
+ fileId?: string | null | undefined;
76
+ /**
77
+ * The date and time the datasource was created
78
+ */
79
+ created: string;
80
+ /**
81
+ * The date and time the datasource was updated
82
+ */
83
+ updated: string;
84
+ /**
85
+ * The id of the resource
86
+ */
87
+ createdById?: string | undefined;
88
+ /**
89
+ * The id of the resource
90
+ */
91
+ updateById?: string | undefined;
92
+ /**
93
+ * The unique identifier of the knowledge base
94
+ */
95
+ knowledgeId: string;
96
+ /**
97
+ * The number of chunks in the datasource
98
+ */
99
+ chunksCount: number;
100
+ };
101
+
102
+ /**
103
+ * Datasources successfully retrieved
104
+ */
105
+ export type ListDatasourcesResponseBody = {
106
+ object: ListDatasourcesObject;
107
+ data: Array<ListDatasourcesData>;
108
+ hasMore: boolean;
109
+ };
110
+
111
+ /** @internal */
112
+ export const Status$inboundSchema: z.ZodType<Status, z.ZodTypeDef, unknown> = z
113
+ .union([z.array(z.string()), z.string()]);
114
+
115
+ /** @internal */
116
+ export type Status$Outbound = Array<string> | string;
117
+
118
+ /** @internal */
119
+ export const Status$outboundSchema: z.ZodType<
120
+ Status$Outbound,
121
+ z.ZodTypeDef,
122
+ Status
123
+ > = z.union([z.array(z.string()), z.string()]);
124
+
125
+ /**
126
+ * @internal
127
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
128
+ */
129
+ export namespace Status$ {
130
+ /** @deprecated use `Status$inboundSchema` instead. */
131
+ export const inboundSchema = Status$inboundSchema;
132
+ /** @deprecated use `Status$outboundSchema` instead. */
133
+ export const outboundSchema = Status$outboundSchema;
134
+ /** @deprecated use `Status$Outbound` instead. */
135
+ export type Outbound = Status$Outbound;
136
+ }
137
+
138
+ export function statusToJSON(status: Status): string {
139
+ return JSON.stringify(Status$outboundSchema.parse(status));
140
+ }
141
+
142
+ export function statusFromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<Status, SDKValidationError> {
145
+ return safeParse(
146
+ jsonString,
147
+ (x) => Status$inboundSchema.parse(JSON.parse(x)),
148
+ `Failed to parse 'Status' from JSON`,
149
+ );
150
+ }
151
+
152
+ /** @internal */
153
+ export const ListDatasourcesRequest$inboundSchema: z.ZodType<
154
+ ListDatasourcesRequest,
155
+ z.ZodTypeDef,
156
+ unknown
157
+ > = z.object({
158
+ knowledge_id: z.string(),
159
+ limit: z.number().default(10),
160
+ starting_after: z.string().optional(),
161
+ ending_before: z.string().optional(),
162
+ q: z.string().optional(),
163
+ status: z.union([z.array(z.string()), z.string()]).optional(),
164
+ }).transform((v) => {
165
+ return remap$(v, {
166
+ "knowledge_id": "knowledgeId",
167
+ "starting_after": "startingAfter",
168
+ "ending_before": "endingBefore",
169
+ });
170
+ });
171
+
172
+ /** @internal */
173
+ export type ListDatasourcesRequest$Outbound = {
174
+ knowledge_id: string;
175
+ limit: number;
176
+ starting_after?: string | undefined;
177
+ ending_before?: string | undefined;
178
+ q?: string | undefined;
179
+ status?: Array<string> | string | undefined;
180
+ };
181
+
182
+ /** @internal */
183
+ export const ListDatasourcesRequest$outboundSchema: z.ZodType<
184
+ ListDatasourcesRequest$Outbound,
185
+ z.ZodTypeDef,
186
+ ListDatasourcesRequest
187
+ > = z.object({
188
+ knowledgeId: z.string(),
189
+ limit: z.number().default(10),
190
+ startingAfter: z.string().optional(),
191
+ endingBefore: z.string().optional(),
192
+ q: z.string().optional(),
193
+ status: z.union([z.array(z.string()), z.string()]).optional(),
194
+ }).transform((v) => {
195
+ return remap$(v, {
196
+ knowledgeId: "knowledge_id",
197
+ startingAfter: "starting_after",
198
+ endingBefore: "ending_before",
199
+ });
200
+ });
201
+
202
+ /**
203
+ * @internal
204
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
205
+ */
206
+ export namespace ListDatasourcesRequest$ {
207
+ /** @deprecated use `ListDatasourcesRequest$inboundSchema` instead. */
208
+ export const inboundSchema = ListDatasourcesRequest$inboundSchema;
209
+ /** @deprecated use `ListDatasourcesRequest$outboundSchema` instead. */
210
+ export const outboundSchema = ListDatasourcesRequest$outboundSchema;
211
+ /** @deprecated use `ListDatasourcesRequest$Outbound` instead. */
212
+ export type Outbound = ListDatasourcesRequest$Outbound;
213
+ }
214
+
215
+ export function listDatasourcesRequestToJSON(
216
+ listDatasourcesRequest: ListDatasourcesRequest,
217
+ ): string {
218
+ return JSON.stringify(
219
+ ListDatasourcesRequest$outboundSchema.parse(listDatasourcesRequest),
220
+ );
221
+ }
222
+
223
+ export function listDatasourcesRequestFromJSON(
224
+ jsonString: string,
225
+ ): SafeParseResult<ListDatasourcesRequest, SDKValidationError> {
226
+ return safeParse(
227
+ jsonString,
228
+ (x) => ListDatasourcesRequest$inboundSchema.parse(JSON.parse(x)),
229
+ `Failed to parse 'ListDatasourcesRequest' from JSON`,
230
+ );
231
+ }
232
+
233
+ /** @internal */
234
+ export const ListDatasourcesObject$inboundSchema: z.ZodNativeEnum<
235
+ typeof ListDatasourcesObject
236
+ > = z.nativeEnum(ListDatasourcesObject);
237
+
238
+ /** @internal */
239
+ export const ListDatasourcesObject$outboundSchema: z.ZodNativeEnum<
240
+ typeof ListDatasourcesObject
241
+ > = ListDatasourcesObject$inboundSchema;
242
+
243
+ /**
244
+ * @internal
245
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
246
+ */
247
+ export namespace ListDatasourcesObject$ {
248
+ /** @deprecated use `ListDatasourcesObject$inboundSchema` instead. */
249
+ export const inboundSchema = ListDatasourcesObject$inboundSchema;
250
+ /** @deprecated use `ListDatasourcesObject$outboundSchema` instead. */
251
+ export const outboundSchema = ListDatasourcesObject$outboundSchema;
252
+ }
253
+
254
+ /** @internal */
255
+ export const ListDatasourcesStatus$inboundSchema: z.ZodNativeEnum<
256
+ typeof ListDatasourcesStatus
257
+ > = z.nativeEnum(ListDatasourcesStatus);
258
+
259
+ /** @internal */
260
+ export const ListDatasourcesStatus$outboundSchema: z.ZodNativeEnum<
261
+ typeof ListDatasourcesStatus
262
+ > = ListDatasourcesStatus$inboundSchema;
263
+
264
+ /**
265
+ * @internal
266
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
267
+ */
268
+ export namespace ListDatasourcesStatus$ {
269
+ /** @deprecated use `ListDatasourcesStatus$inboundSchema` instead. */
270
+ export const inboundSchema = ListDatasourcesStatus$inboundSchema;
271
+ /** @deprecated use `ListDatasourcesStatus$outboundSchema` instead. */
272
+ export const outboundSchema = ListDatasourcesStatus$outboundSchema;
273
+ }
274
+
275
+ /** @internal */
276
+ export const ListDatasourcesData$inboundSchema: z.ZodType<
277
+ ListDatasourcesData,
278
+ z.ZodTypeDef,
279
+ unknown
280
+ > = z.object({
281
+ _id: z.string().default("01JQCTRB531JQVNWM64H1NSW6S"),
282
+ display_name: z.string(),
283
+ description: z.string().optional(),
284
+ status: ListDatasourcesStatus$inboundSchema,
285
+ file_id: z.nullable(z.string()).optional(),
286
+ created: z.string(),
287
+ updated: z.string(),
288
+ created_by_id: z.string().optional(),
289
+ update_by_id: z.string().optional(),
290
+ knowledge_id: z.string(),
291
+ chunks_count: z.number(),
292
+ }).transform((v) => {
293
+ return remap$(v, {
294
+ "_id": "id",
295
+ "display_name": "displayName",
296
+ "file_id": "fileId",
297
+ "created_by_id": "createdById",
298
+ "update_by_id": "updateById",
299
+ "knowledge_id": "knowledgeId",
300
+ "chunks_count": "chunksCount",
301
+ });
302
+ });
303
+
304
+ /** @internal */
305
+ export type ListDatasourcesData$Outbound = {
306
+ _id: string;
307
+ display_name: string;
308
+ description?: string | undefined;
309
+ status: string;
310
+ file_id?: string | null | undefined;
311
+ created: string;
312
+ updated: string;
313
+ created_by_id?: string | undefined;
314
+ update_by_id?: string | undefined;
315
+ knowledge_id: string;
316
+ chunks_count: number;
317
+ };
318
+
319
+ /** @internal */
320
+ export const ListDatasourcesData$outboundSchema: z.ZodType<
321
+ ListDatasourcesData$Outbound,
322
+ z.ZodTypeDef,
323
+ ListDatasourcesData
324
+ > = z.object({
325
+ id: z.string().default("01JQCTRB531JQVNWM64H1NSW6S"),
326
+ displayName: z.string(),
327
+ description: z.string().optional(),
328
+ status: ListDatasourcesStatus$outboundSchema,
329
+ fileId: z.nullable(z.string()).optional(),
330
+ created: z.string(),
331
+ updated: z.string(),
332
+ createdById: z.string().optional(),
333
+ updateById: z.string().optional(),
334
+ knowledgeId: z.string(),
335
+ chunksCount: z.number(),
336
+ }).transform((v) => {
337
+ return remap$(v, {
338
+ id: "_id",
339
+ displayName: "display_name",
340
+ fileId: "file_id",
341
+ createdById: "created_by_id",
342
+ updateById: "update_by_id",
343
+ knowledgeId: "knowledge_id",
344
+ chunksCount: "chunks_count",
345
+ });
346
+ });
347
+
348
+ /**
349
+ * @internal
350
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
351
+ */
352
+ export namespace ListDatasourcesData$ {
353
+ /** @deprecated use `ListDatasourcesData$inboundSchema` instead. */
354
+ export const inboundSchema = ListDatasourcesData$inboundSchema;
355
+ /** @deprecated use `ListDatasourcesData$outboundSchema` instead. */
356
+ export const outboundSchema = ListDatasourcesData$outboundSchema;
357
+ /** @deprecated use `ListDatasourcesData$Outbound` instead. */
358
+ export type Outbound = ListDatasourcesData$Outbound;
359
+ }
360
+
361
+ export function listDatasourcesDataToJSON(
362
+ listDatasourcesData: ListDatasourcesData,
363
+ ): string {
364
+ return JSON.stringify(
365
+ ListDatasourcesData$outboundSchema.parse(listDatasourcesData),
366
+ );
367
+ }
368
+
369
+ export function listDatasourcesDataFromJSON(
370
+ jsonString: string,
371
+ ): SafeParseResult<ListDatasourcesData, SDKValidationError> {
372
+ return safeParse(
373
+ jsonString,
374
+ (x) => ListDatasourcesData$inboundSchema.parse(JSON.parse(x)),
375
+ `Failed to parse 'ListDatasourcesData' from JSON`,
376
+ );
377
+ }
378
+
379
+ /** @internal */
380
+ export const ListDatasourcesResponseBody$inboundSchema: z.ZodType<
381
+ ListDatasourcesResponseBody,
382
+ z.ZodTypeDef,
383
+ unknown
384
+ > = z.object({
385
+ object: ListDatasourcesObject$inboundSchema,
386
+ data: z.array(z.lazy(() => ListDatasourcesData$inboundSchema)),
387
+ has_more: z.boolean(),
388
+ }).transform((v) => {
389
+ return remap$(v, {
390
+ "has_more": "hasMore",
391
+ });
392
+ });
393
+
394
+ /** @internal */
395
+ export type ListDatasourcesResponseBody$Outbound = {
396
+ object: string;
397
+ data: Array<ListDatasourcesData$Outbound>;
398
+ has_more: boolean;
399
+ };
400
+
401
+ /** @internal */
402
+ export const ListDatasourcesResponseBody$outboundSchema: z.ZodType<
403
+ ListDatasourcesResponseBody$Outbound,
404
+ z.ZodTypeDef,
405
+ ListDatasourcesResponseBody
406
+ > = z.object({
407
+ object: ListDatasourcesObject$outboundSchema,
408
+ data: z.array(z.lazy(() => ListDatasourcesData$outboundSchema)),
409
+ hasMore: z.boolean(),
410
+ }).transform((v) => {
411
+ return remap$(v, {
412
+ hasMore: "has_more",
413
+ });
414
+ });
415
+
416
+ /**
417
+ * @internal
418
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
419
+ */
420
+ export namespace ListDatasourcesResponseBody$ {
421
+ /** @deprecated use `ListDatasourcesResponseBody$inboundSchema` instead. */
422
+ export const inboundSchema = ListDatasourcesResponseBody$inboundSchema;
423
+ /** @deprecated use `ListDatasourcesResponseBody$outboundSchema` instead. */
424
+ export const outboundSchema = ListDatasourcesResponseBody$outboundSchema;
425
+ /** @deprecated use `ListDatasourcesResponseBody$Outbound` instead. */
426
+ export type Outbound = ListDatasourcesResponseBody$Outbound;
427
+ }
428
+
429
+ export function listDatasourcesResponseBodyToJSON(
430
+ listDatasourcesResponseBody: ListDatasourcesResponseBody,
431
+ ): string {
432
+ return JSON.stringify(
433
+ ListDatasourcesResponseBody$outboundSchema.parse(
434
+ listDatasourcesResponseBody,
435
+ ),
436
+ );
437
+ }
438
+
439
+ export function listDatasourcesResponseBodyFromJSON(
440
+ jsonString: string,
441
+ ): SafeParseResult<ListDatasourcesResponseBody, SDKValidationError> {
442
+ return safeParse(
443
+ jsonString,
444
+ (x) => ListDatasourcesResponseBody$inboundSchema.parse(JSON.parse(x)),
445
+ `Failed to parse 'ListDatasourcesResponseBody' from JSON`,
446
+ );
447
+ }