@letta-ai/letta-client 0.1.161 → 0.1.163

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 (264) hide show
  1. package/api/resources/agents/client/Client.d.ts +6 -48
  2. package/api/resources/agents/client/Client.js +34 -231
  3. package/api/resources/agents/resources/blocks/client/Client.js +5 -5
  4. package/api/resources/agents/resources/context/client/Client.js +1 -1
  5. package/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  6. package/api/resources/agents/resources/files/client/Client.d.ts +83 -0
  7. package/api/resources/agents/resources/files/client/Client.js +276 -0
  8. package/api/resources/agents/resources/files/client/index.d.ts +1 -0
  9. package/api/resources/agents/resources/files/client/index.js +2 -0
  10. package/api/resources/agents/resources/files/index.d.ts +1 -0
  11. package/api/resources/agents/resources/files/index.js +17 -0
  12. package/api/resources/agents/resources/folders/client/Client.d.ts +74 -0
  13. package/api/resources/agents/resources/folders/client/Client.js +272 -0
  14. package/api/resources/agents/resources/folders/client/index.d.ts +1 -0
  15. package/api/resources/agents/resources/folders/client/index.js +2 -0
  16. package/api/resources/agents/resources/folders/index.d.ts +1 -0
  17. package/api/resources/agents/resources/folders/index.js +17 -0
  18. package/api/resources/agents/resources/groups/client/Client.js +1 -1
  19. package/api/resources/agents/resources/index.d.ts +2 -0
  20. package/api/resources/agents/resources/index.js +3 -1
  21. package/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  22. package/api/resources/agents/resources/messages/client/Client.js +8 -8
  23. package/api/resources/agents/resources/passages/client/Client.js +4 -4
  24. package/api/resources/agents/resources/sources/client/Client.js +3 -3
  25. package/api/resources/agents/resources/templates/client/Client.js +3 -3
  26. package/api/resources/agents/resources/tools/client/Client.js +3 -3
  27. package/api/resources/batches/client/Client.js +4 -4
  28. package/api/resources/blocks/client/Client.js +6 -6
  29. package/api/resources/blocks/resources/agents/client/Client.js +1 -1
  30. package/api/resources/clientSideAccessTokens/client/Client.js +3 -3
  31. package/api/resources/embeddingModels/client/Client.js +1 -1
  32. package/api/resources/folders/client/Client.d.ts +20 -69
  33. package/api/resources/folders/client/Client.js +36 -326
  34. package/api/resources/folders/client/requests/index.d.ts +0 -3
  35. package/api/resources/folders/index.d.ts +1 -0
  36. package/api/resources/folders/index.js +1 -0
  37. package/api/resources/folders/resources/files/client/Client.d.ts +78 -0
  38. package/api/resources/folders/resources/files/client/Client.js +289 -0
  39. package/api/resources/folders/resources/files/client/index.d.ts +1 -0
  40. package/api/resources/folders/resources/files/client/index.js +17 -0
  41. package/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.d.ts +1 -1
  42. package/{dist/api/resources/folders/client/requests/ListFolderFilesRequest.d.ts → api/resources/folders/resources/files/client/requests/FilesListRequest.d.ts} +1 -1
  43. package/api/resources/folders/resources/files/client/requests/index.d.ts +2 -0
  44. package/api/resources/folders/resources/files/client/requests/index.js +2 -0
  45. package/api/resources/folders/resources/files/index.d.ts +1 -0
  46. package/api/resources/folders/resources/files/index.js +17 -0
  47. package/api/resources/folders/resources/index.d.ts +4 -0
  48. package/api/resources/folders/resources/index.js +43 -0
  49. package/api/resources/folders/resources/passages/client/Client.d.ts +49 -0
  50. package/api/resources/folders/resources/passages/client/Client.js +149 -0
  51. package/api/resources/folders/resources/passages/client/index.d.ts +1 -0
  52. package/api/resources/folders/resources/passages/client/index.js +17 -0
  53. package/api/resources/folders/{client/requests/ListFolderPassagesRequest.d.ts → resources/passages/client/requests/PassagesListRequest.d.ts} +1 -1
  54. package/api/resources/folders/resources/passages/client/requests/index.d.ts +1 -0
  55. package/api/resources/folders/resources/passages/client/requests/index.js +2 -0
  56. package/api/resources/folders/resources/passages/index.d.ts +1 -0
  57. package/api/resources/folders/resources/passages/index.js +17 -0
  58. package/api/resources/groups/client/Client.js +6 -6
  59. package/api/resources/groups/resources/messages/client/Client.js +5 -5
  60. package/api/resources/health/client/Client.js +1 -1
  61. package/api/resources/identities/client/Client.js +7 -7
  62. package/api/resources/identities/resources/properties/client/Client.js +1 -1
  63. package/api/resources/jobs/client/Client.js +5 -5
  64. package/api/resources/messages/client/Client.js +1 -1
  65. package/api/resources/models/client/Client.js +1 -1
  66. package/api/resources/projects/client/Client.js +1 -1
  67. package/api/resources/providers/client/Client.js +5 -5
  68. package/api/resources/runs/client/Client.js +4 -4
  69. package/api/resources/runs/resources/messages/client/Client.js +1 -1
  70. package/api/resources/runs/resources/steps/client/Client.js +1 -1
  71. package/api/resources/runs/resources/usage/client/Client.js +1 -1
  72. package/api/resources/sources/client/Client.js +10 -10
  73. package/api/resources/sources/resources/files/client/Client.js +3 -3
  74. package/api/resources/sources/resources/passages/client/Client.js +1 -1
  75. package/api/resources/steps/client/Client.js +2 -2
  76. package/api/resources/steps/resources/feedback/client/Client.js +1 -1
  77. package/api/resources/tags/client/Client.js +1 -1
  78. package/api/resources/telemetry/client/Client.js +1 -1
  79. package/api/resources/templates/client/Client.js +1 -1
  80. package/api/resources/templates/resources/agents/client/Client.js +1 -1
  81. package/api/resources/tools/client/Client.js +19 -19
  82. package/api/resources/voice/client/Client.js +1 -1
  83. package/dist/api/resources/agents/client/Client.d.ts +6 -48
  84. package/dist/api/resources/agents/client/Client.js +34 -231
  85. package/dist/api/resources/agents/resources/blocks/client/Client.js +5 -5
  86. package/dist/api/resources/agents/resources/context/client/Client.js +1 -1
  87. package/dist/api/resources/agents/resources/coreMemory/client/Client.js +1 -1
  88. package/dist/api/resources/agents/resources/files/client/Client.d.ts +83 -0
  89. package/dist/api/resources/agents/resources/files/client/Client.js +276 -0
  90. package/dist/api/resources/agents/resources/files/client/index.d.ts +1 -0
  91. package/dist/api/resources/agents/resources/files/client/index.js +2 -0
  92. package/dist/api/resources/agents/resources/files/index.d.ts +1 -0
  93. package/dist/api/resources/agents/resources/files/index.js +17 -0
  94. package/dist/api/resources/agents/resources/folders/client/Client.d.ts +74 -0
  95. package/dist/api/resources/agents/resources/folders/client/Client.js +272 -0
  96. package/dist/api/resources/agents/resources/folders/client/index.d.ts +1 -0
  97. package/dist/api/resources/agents/resources/folders/client/index.js +2 -0
  98. package/dist/api/resources/agents/resources/folders/index.d.ts +1 -0
  99. package/dist/api/resources/agents/resources/folders/index.js +17 -0
  100. package/dist/api/resources/agents/resources/groups/client/Client.js +1 -1
  101. package/dist/api/resources/agents/resources/index.d.ts +2 -0
  102. package/dist/api/resources/agents/resources/index.js +3 -1
  103. package/dist/api/resources/agents/resources/memoryVariables/client/Client.js +1 -1
  104. package/dist/api/resources/agents/resources/messages/client/Client.js +8 -8
  105. package/dist/api/resources/agents/resources/passages/client/Client.js +4 -4
  106. package/dist/api/resources/agents/resources/sources/client/Client.js +3 -3
  107. package/dist/api/resources/agents/resources/templates/client/Client.js +3 -3
  108. package/dist/api/resources/agents/resources/tools/client/Client.js +3 -3
  109. package/dist/api/resources/batches/client/Client.js +4 -4
  110. package/dist/api/resources/blocks/client/Client.js +6 -6
  111. package/dist/api/resources/blocks/resources/agents/client/Client.js +1 -1
  112. package/dist/api/resources/clientSideAccessTokens/client/Client.js +3 -3
  113. package/dist/api/resources/embeddingModels/client/Client.js +1 -1
  114. package/dist/api/resources/folders/client/Client.d.ts +20 -69
  115. package/dist/api/resources/folders/client/Client.js +36 -326
  116. package/dist/api/resources/folders/client/requests/index.d.ts +0 -3
  117. package/dist/api/resources/folders/index.d.ts +1 -0
  118. package/dist/api/resources/folders/index.js +1 -0
  119. package/dist/api/resources/folders/resources/files/client/Client.d.ts +78 -0
  120. package/dist/api/resources/folders/resources/files/client/Client.js +289 -0
  121. package/dist/api/resources/folders/resources/files/client/index.d.ts +1 -0
  122. package/dist/api/resources/folders/resources/files/client/index.js +17 -0
  123. package/dist/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.d.ts +1 -1
  124. package/{api/resources/folders/client/requests/ListFolderFilesRequest.d.ts → dist/api/resources/folders/resources/files/client/requests/FilesListRequest.d.ts} +1 -1
  125. package/dist/api/resources/folders/resources/files/client/requests/index.d.ts +2 -0
  126. package/dist/api/resources/folders/resources/files/client/requests/index.js +2 -0
  127. package/dist/api/resources/folders/resources/files/index.d.ts +1 -0
  128. package/dist/api/resources/folders/resources/files/index.js +17 -0
  129. package/dist/api/resources/folders/resources/index.d.ts +4 -0
  130. package/dist/api/resources/folders/resources/index.js +43 -0
  131. package/dist/api/resources/folders/resources/passages/client/Client.d.ts +49 -0
  132. package/dist/api/resources/folders/resources/passages/client/Client.js +149 -0
  133. package/dist/api/resources/folders/resources/passages/client/index.d.ts +1 -0
  134. package/dist/api/resources/folders/resources/passages/client/index.js +17 -0
  135. package/dist/api/resources/folders/{client/requests/ListFolderPassagesRequest.d.ts → resources/passages/client/requests/PassagesListRequest.d.ts} +1 -1
  136. package/dist/api/resources/folders/resources/passages/client/requests/index.d.ts +1 -0
  137. package/dist/api/resources/folders/resources/passages/client/requests/index.js +2 -0
  138. package/dist/api/resources/folders/resources/passages/index.d.ts +1 -0
  139. package/dist/api/resources/folders/resources/passages/index.js +17 -0
  140. package/dist/api/resources/groups/client/Client.js +6 -6
  141. package/dist/api/resources/groups/resources/messages/client/Client.js +5 -5
  142. package/dist/api/resources/health/client/Client.js +1 -1
  143. package/dist/api/resources/identities/client/Client.js +7 -7
  144. package/dist/api/resources/identities/resources/properties/client/Client.js +1 -1
  145. package/dist/api/resources/jobs/client/Client.js +5 -5
  146. package/dist/api/resources/messages/client/Client.js +1 -1
  147. package/dist/api/resources/models/client/Client.js +1 -1
  148. package/dist/api/resources/projects/client/Client.js +1 -1
  149. package/dist/api/resources/providers/client/Client.js +5 -5
  150. package/dist/api/resources/runs/client/Client.js +4 -4
  151. package/dist/api/resources/runs/resources/messages/client/Client.js +1 -1
  152. package/dist/api/resources/runs/resources/steps/client/Client.js +1 -1
  153. package/dist/api/resources/runs/resources/usage/client/Client.js +1 -1
  154. package/dist/api/resources/sources/client/Client.js +10 -10
  155. package/dist/api/resources/sources/resources/files/client/Client.js +3 -3
  156. package/dist/api/resources/sources/resources/passages/client/Client.js +1 -1
  157. package/dist/api/resources/steps/client/Client.js +2 -2
  158. package/dist/api/resources/steps/resources/feedback/client/Client.js +1 -1
  159. package/dist/api/resources/tags/client/Client.js +1 -1
  160. package/dist/api/resources/telemetry/client/Client.js +1 -1
  161. package/dist/api/resources/templates/client/Client.js +1 -1
  162. package/dist/api/resources/templates/resources/agents/client/Client.js +1 -1
  163. package/dist/api/resources/tools/client/Client.js +19 -19
  164. package/dist/api/resources/voice/client/Client.js +1 -1
  165. package/dist/serialization/resources/agents/client/index.d.ts +0 -2
  166. package/dist/serialization/resources/agents/client/index.js +1 -3
  167. package/dist/serialization/resources/agents/{client/openFile.d.ts → resources/files/client/closeAll.d.ts} +3 -3
  168. package/dist/serialization/resources/agents/{client/closeAllOpenFiles.js → resources/files/client/closeAll.js} +1 -1
  169. package/dist/serialization/resources/agents/resources/files/client/index.d.ts +2 -0
  170. package/dist/serialization/resources/agents/resources/files/client/index.js +38 -0
  171. package/{serialization/resources/agents/client/closeAllOpenFiles.d.ts → dist/serialization/resources/agents/resources/files/client/open.d.ts} +3 -3
  172. package/dist/serialization/resources/agents/{client/openFile.js → resources/files/client/open.js} +1 -1
  173. package/dist/serialization/resources/agents/resources/files/index.d.ts +1 -0
  174. package/dist/serialization/resources/agents/resources/files/index.js +17 -0
  175. package/dist/serialization/resources/agents/resources/folders/client/index.d.ts +1 -0
  176. package/dist/serialization/resources/agents/resources/folders/client/index.js +37 -0
  177. package/dist/serialization/resources/agents/resources/folders/client/list.d.ts +11 -0
  178. package/dist/serialization/resources/agents/resources/folders/client/list.js +42 -0
  179. package/dist/serialization/resources/agents/resources/folders/index.d.ts +1 -0
  180. package/dist/serialization/resources/agents/resources/folders/index.js +17 -0
  181. package/dist/serialization/resources/agents/resources/index.d.ts +2 -0
  182. package/dist/serialization/resources/agents/resources/index.js +3 -1
  183. package/dist/serialization/resources/folders/client/{countFolders.d.ts → count.d.ts} +1 -1
  184. package/dist/serialization/resources/folders/client/index.d.ts +3 -5
  185. package/dist/serialization/resources/folders/client/index.js +4 -6
  186. package/dist/serialization/resources/folders/client/{listFolders.d.ts → list.d.ts} +1 -1
  187. package/{serialization/resources/folders/client/getFolderIdByName.d.ts → dist/serialization/resources/folders/client/retrieveByName.d.ts} +1 -1
  188. package/dist/serialization/resources/folders/index.d.ts +1 -0
  189. package/dist/serialization/resources/folders/index.js +1 -0
  190. package/dist/serialization/resources/folders/resources/files/client/index.d.ts +1 -0
  191. package/dist/serialization/resources/folders/resources/files/client/index.js +37 -0
  192. package/dist/serialization/resources/folders/resources/files/client/list.d.ts +11 -0
  193. package/dist/serialization/resources/folders/{client/listFolderFiles.js → resources/files/client/list.js} +2 -2
  194. package/dist/serialization/resources/folders/resources/files/index.d.ts +1 -0
  195. package/dist/serialization/resources/folders/resources/files/index.js +17 -0
  196. package/dist/serialization/resources/folders/resources/index.d.ts +2 -0
  197. package/dist/serialization/resources/folders/resources/index.js +38 -0
  198. package/dist/serialization/resources/folders/resources/passages/client/index.d.ts +1 -0
  199. package/dist/serialization/resources/folders/resources/passages/client/index.js +37 -0
  200. package/dist/serialization/resources/folders/resources/passages/client/list.d.ts +11 -0
  201. package/dist/serialization/resources/folders/{client/listFolderPassages.js → resources/passages/client/list.js} +2 -2
  202. package/dist/serialization/resources/folders/resources/passages/index.d.ts +1 -0
  203. package/dist/serialization/resources/folders/resources/passages/index.js +17 -0
  204. package/dist/version.d.ts +1 -1
  205. package/dist/version.js +1 -1
  206. package/package.json +1 -1
  207. package/reference.md +1144 -931
  208. package/serialization/resources/agents/client/index.d.ts +0 -2
  209. package/serialization/resources/agents/client/index.js +1 -3
  210. package/serialization/resources/agents/{client/openFile.d.ts → resources/files/client/closeAll.d.ts} +3 -3
  211. package/serialization/resources/agents/{client/closeAllOpenFiles.js → resources/files/client/closeAll.js} +1 -1
  212. package/serialization/resources/agents/resources/files/client/index.d.ts +2 -0
  213. package/serialization/resources/agents/resources/files/client/index.js +38 -0
  214. package/{dist/serialization/resources/agents/client/closeAllOpenFiles.d.ts → serialization/resources/agents/resources/files/client/open.d.ts} +3 -3
  215. package/serialization/resources/agents/{client/openFile.js → resources/files/client/open.js} +1 -1
  216. package/serialization/resources/agents/resources/files/index.d.ts +1 -0
  217. package/serialization/resources/agents/resources/files/index.js +17 -0
  218. package/serialization/resources/agents/resources/folders/client/index.d.ts +1 -0
  219. package/serialization/resources/agents/resources/folders/client/index.js +37 -0
  220. package/serialization/resources/agents/resources/folders/client/list.d.ts +11 -0
  221. package/serialization/resources/agents/resources/folders/client/list.js +42 -0
  222. package/serialization/resources/agents/resources/folders/index.d.ts +1 -0
  223. package/serialization/resources/agents/resources/folders/index.js +17 -0
  224. package/serialization/resources/agents/resources/index.d.ts +2 -0
  225. package/serialization/resources/agents/resources/index.js +3 -1
  226. package/serialization/resources/folders/client/{countFolders.d.ts → count.d.ts} +1 -1
  227. package/serialization/resources/folders/client/index.d.ts +3 -5
  228. package/serialization/resources/folders/client/index.js +4 -6
  229. package/serialization/resources/folders/client/{listFolders.d.ts → list.d.ts} +1 -1
  230. package/{dist/serialization/resources/folders/client/getFolderIdByName.d.ts → serialization/resources/folders/client/retrieveByName.d.ts} +1 -1
  231. package/serialization/resources/folders/index.d.ts +1 -0
  232. package/serialization/resources/folders/index.js +1 -0
  233. package/serialization/resources/folders/resources/files/client/index.d.ts +1 -0
  234. package/serialization/resources/folders/resources/files/client/index.js +37 -0
  235. package/serialization/resources/folders/resources/files/client/list.d.ts +11 -0
  236. package/serialization/resources/folders/{client/listFolderFiles.js → resources/files/client/list.js} +2 -2
  237. package/serialization/resources/folders/resources/files/index.d.ts +1 -0
  238. package/serialization/resources/folders/resources/files/index.js +17 -0
  239. package/serialization/resources/folders/resources/index.d.ts +2 -0
  240. package/serialization/resources/folders/resources/index.js +38 -0
  241. package/serialization/resources/folders/resources/passages/client/index.d.ts +1 -0
  242. package/serialization/resources/folders/resources/passages/client/index.js +37 -0
  243. package/serialization/resources/folders/resources/passages/client/list.d.ts +11 -0
  244. package/serialization/resources/folders/{client/listFolderPassages.js → resources/passages/client/list.js} +2 -2
  245. package/serialization/resources/folders/resources/passages/index.d.ts +1 -0
  246. package/serialization/resources/folders/resources/passages/index.js +17 -0
  247. package/version.d.ts +1 -1
  248. package/version.js +1 -1
  249. package/dist/serialization/resources/folders/client/listFolderFiles.d.ts +0 -11
  250. package/dist/serialization/resources/folders/client/listFolderPassages.d.ts +0 -11
  251. package/serialization/resources/folders/client/listFolderFiles.d.ts +0 -11
  252. package/serialization/resources/folders/client/listFolderPassages.d.ts +0 -11
  253. /package/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.js +0 -0
  254. /package/api/resources/folders/{client/requests/ListFolderFilesRequest.js → resources/files/client/requests/FilesListRequest.js} +0 -0
  255. /package/api/resources/folders/{client/requests/ListFolderPassagesRequest.js → resources/passages/client/requests/PassagesListRequest.js} +0 -0
  256. /package/dist/api/resources/folders/{client → resources/files/client}/requests/BodyUploadFileToFolder.js +0 -0
  257. /package/dist/api/resources/folders/{client/requests/ListFolderFilesRequest.js → resources/files/client/requests/FilesListRequest.js} +0 -0
  258. /package/dist/api/resources/folders/{client/requests/ListFolderPassagesRequest.js → resources/passages/client/requests/PassagesListRequest.js} +0 -0
  259. /package/dist/serialization/resources/folders/client/{countFolders.js → count.js} +0 -0
  260. /package/dist/serialization/resources/folders/client/{listFolders.js → list.js} +0 -0
  261. /package/dist/serialization/resources/folders/client/{getFolderIdByName.js → retrieveByName.js} +0 -0
  262. /package/serialization/resources/folders/client/{countFolders.js → count.js} +0 -0
  263. /package/serialization/resources/folders/client/{listFolders.js → list.js} +0 -0
  264. /package/serialization/resources/folders/client/{getFolderIdByName.js → retrieveByName.js} +0 -0
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Files = void 0;
52
+ const environments = __importStar(require("../../../../../../environments"));
53
+ const core = __importStar(require("../../../../../../core"));
54
+ const Letta = __importStar(require("../../../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const serializers = __importStar(require("../../../../../../serialization/index"));
57
+ const errors = __importStar(require("../../../../../../errors/index"));
58
+ class Files {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * Upload a file to a data folder.
64
+ *
65
+ * @param {File | fs.ReadStream | Blob} file
66
+ * @param {string} folderId
67
+ * @param {Letta.folders.BodyUploadFileToFolder} request
68
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
69
+ *
70
+ * @throws {@link Letta.UnprocessableEntityError}
71
+ *
72
+ * @example
73
+ * await client.folders.files.upload(fs.createReadStream("/path/to/your/file"), "folder_id", {})
74
+ */
75
+ upload(file, folderId, request, requestOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ var _a, _b, _c;
78
+ const _queryParams = {};
79
+ if (request.duplicateHandling != null) {
80
+ _queryParams["duplicate_handling"] = request.duplicateHandling;
81
+ }
82
+ const _request = yield core.newFormData();
83
+ yield _request.appendFile("file", file);
84
+ const _maybeEncodedRequest = yield _request.getRequest();
85
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
86
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/folders/${encodeURIComponent(folderId)}/upload`),
87
+ method: "POST",
88
+ headers: Object.assign(Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
89
+ ? yield core.Supplier.get(this._options.project)
90
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
+ queryParameters: _queryParams,
92
+ requestType: "file",
93
+ duplex: _maybeEncodedRequest.duplex,
94
+ body: _maybeEncodedRequest.body,
95
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
96
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
97
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
98
+ });
99
+ if (_response.ok) {
100
+ return serializers.FileMetadata.parseOrThrow(_response.body, {
101
+ unrecognizedObjectKeys: "passthrough",
102
+ allowUnrecognizedUnionMembers: true,
103
+ allowUnrecognizedEnumValues: true,
104
+ skipValidation: true,
105
+ breadcrumbsPrefix: ["response"],
106
+ });
107
+ }
108
+ if (_response.error.reason === "status-code") {
109
+ switch (_response.error.statusCode) {
110
+ case 422:
111
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
112
+ unrecognizedObjectKeys: "passthrough",
113
+ allowUnrecognizedUnionMembers: true,
114
+ allowUnrecognizedEnumValues: true,
115
+ skipValidation: true,
116
+ breadcrumbsPrefix: ["response"],
117
+ }));
118
+ default:
119
+ throw new errors.LettaError({
120
+ statusCode: _response.error.statusCode,
121
+ body: _response.error.body,
122
+ });
123
+ }
124
+ }
125
+ switch (_response.error.reason) {
126
+ case "non-json":
127
+ throw new errors.LettaError({
128
+ statusCode: _response.error.statusCode,
129
+ body: _response.error.rawBody,
130
+ });
131
+ case "timeout":
132
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling POST /v1/folders/{folder_id}/upload.");
133
+ case "unknown":
134
+ throw new errors.LettaError({
135
+ message: _response.error.errorMessage,
136
+ });
137
+ }
138
+ });
139
+ }
140
+ /**
141
+ * List paginated files associated with a data folder.
142
+ *
143
+ * @param {string} folderId
144
+ * @param {Letta.folders.FilesListRequest} request
145
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link Letta.UnprocessableEntityError}
148
+ *
149
+ * @example
150
+ * await client.folders.files.list("folder_id")
151
+ */
152
+ list(folderId_1) {
153
+ return __awaiter(this, arguments, void 0, function* (folderId, request = {}, requestOptions) {
154
+ var _a, _b, _c;
155
+ const { limit, after, includeContent } = request;
156
+ const _queryParams = {};
157
+ if (limit != null) {
158
+ _queryParams["limit"] = limit.toString();
159
+ }
160
+ if (after != null) {
161
+ _queryParams["after"] = after;
162
+ }
163
+ if (includeContent != null) {
164
+ _queryParams["include_content"] = includeContent.toString();
165
+ }
166
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
167
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/folders/${encodeURIComponent(folderId)}/files`),
168
+ method: "GET",
169
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
170
+ ? yield core.Supplier.get(this._options.project)
171
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
172
+ contentType: "application/json",
173
+ queryParameters: _queryParams,
174
+ requestType: "json",
175
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
176
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
177
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
178
+ });
179
+ if (_response.ok) {
180
+ return serializers.folders.files.list.Response.parseOrThrow(_response.body, {
181
+ unrecognizedObjectKeys: "passthrough",
182
+ allowUnrecognizedUnionMembers: true,
183
+ allowUnrecognizedEnumValues: true,
184
+ skipValidation: true,
185
+ breadcrumbsPrefix: ["response"],
186
+ });
187
+ }
188
+ if (_response.error.reason === "status-code") {
189
+ switch (_response.error.statusCode) {
190
+ case 422:
191
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
192
+ unrecognizedObjectKeys: "passthrough",
193
+ allowUnrecognizedUnionMembers: true,
194
+ allowUnrecognizedEnumValues: true,
195
+ skipValidation: true,
196
+ breadcrumbsPrefix: ["response"],
197
+ }));
198
+ default:
199
+ throw new errors.LettaError({
200
+ statusCode: _response.error.statusCode,
201
+ body: _response.error.body,
202
+ });
203
+ }
204
+ }
205
+ switch (_response.error.reason) {
206
+ case "non-json":
207
+ throw new errors.LettaError({
208
+ statusCode: _response.error.statusCode,
209
+ body: _response.error.rawBody,
210
+ });
211
+ case "timeout":
212
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/folders/{folder_id}/files.");
213
+ case "unknown":
214
+ throw new errors.LettaError({
215
+ message: _response.error.errorMessage,
216
+ });
217
+ }
218
+ });
219
+ }
220
+ /**
221
+ * Delete a file from a folder.
222
+ *
223
+ * @param {string} folderId
224
+ * @param {string} fileId
225
+ * @param {Files.RequestOptions} requestOptions - Request-specific configuration.
226
+ *
227
+ * @throws {@link Letta.UnprocessableEntityError}
228
+ *
229
+ * @example
230
+ * await client.folders.files.delete("folder_id", "file_id")
231
+ */
232
+ delete(folderId, fileId, requestOptions) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ var _a, _b, _c;
235
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
236
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/folders/${encodeURIComponent(folderId)}/${encodeURIComponent(fileId)}`),
237
+ method: "DELETE",
238
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
239
+ ? yield core.Supplier.get(this._options.project)
240
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
241
+ contentType: "application/json",
242
+ requestType: "json",
243
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
244
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
245
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
246
+ });
247
+ if (_response.ok) {
248
+ return;
249
+ }
250
+ if (_response.error.reason === "status-code") {
251
+ switch (_response.error.statusCode) {
252
+ case 422:
253
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
254
+ unrecognizedObjectKeys: "passthrough",
255
+ allowUnrecognizedUnionMembers: true,
256
+ allowUnrecognizedEnumValues: true,
257
+ skipValidation: true,
258
+ breadcrumbsPrefix: ["response"],
259
+ }));
260
+ default:
261
+ throw new errors.LettaError({
262
+ statusCode: _response.error.statusCode,
263
+ body: _response.error.body,
264
+ });
265
+ }
266
+ }
267
+ switch (_response.error.reason) {
268
+ case "non-json":
269
+ throw new errors.LettaError({
270
+ statusCode: _response.error.statusCode,
271
+ body: _response.error.rawBody,
272
+ });
273
+ case "timeout":
274
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling DELETE /v1/folders/{folder_id}/{file_id}.");
275
+ case "unknown":
276
+ throw new errors.LettaError({
277
+ message: _response.error.errorMessage,
278
+ });
279
+ }
280
+ });
281
+ }
282
+ _getCustomAuthorizationHeaders() {
283
+ return __awaiter(this, void 0, void 0, function* () {
284
+ const tokenValue = yield core.Supplier.get(this._options.token);
285
+ return { Authorization: `Bearer ${tokenValue}` };
286
+ });
287
+ }
288
+ }
289
+ exports.Files = Files;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as Letta from "../../../../index";
4
+ import * as Letta from "../../../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {}
@@ -5,7 +5,7 @@
5
5
  * @example
6
6
  * {}
7
7
  */
8
- export interface ListFolderFilesRequest {
8
+ export interface FilesListRequest {
9
9
  /**
10
10
  * Number of files to return
11
11
  */
@@ -0,0 +1,2 @@
1
+ export { type BodyUploadFileToFolder } from "./BodyUploadFileToFolder";
2
+ export { type FilesListRequest } from "./FilesListRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,4 @@
1
+ export * as files from "./files";
2
+ export * as passages from "./passages";
3
+ export * from "./files/client/requests";
4
+ export * from "./passages/client/requests";
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.passages = exports.files = void 0;
40
+ exports.files = __importStar(require("./files"));
41
+ exports.passages = __importStar(require("./passages"));
42
+ __exportStar(require("./files/client/requests"), exports);
43
+ __exportStar(require("./passages/client/requests"), exports);
@@ -0,0 +1,49 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments";
5
+ import * as core from "../../../../../../core";
6
+ import * as Letta from "../../../../../index";
7
+ export declare namespace Passages {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.LettaEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ token?: core.Supplier<string | undefined>;
13
+ /** Override the X-Project header */
14
+ project?: core.Supplier<string | undefined>;
15
+ fetcher?: core.FetchFunction;
16
+ }
17
+ interface RequestOptions {
18
+ /** The maximum time to wait for a response in seconds. */
19
+ timeoutInSeconds?: number;
20
+ /** The number of times to retry the request. Defaults to 2. */
21
+ maxRetries?: number;
22
+ /** A hook to abort the request. */
23
+ abortSignal?: AbortSignal;
24
+ /** Override the X-Project header */
25
+ project?: string | undefined;
26
+ /** Additional headers to include in the request. */
27
+ headers?: Record<string, string>;
28
+ }
29
+ }
30
+ export declare class Passages {
31
+ protected readonly _options: Passages.Options;
32
+ constructor(_options?: Passages.Options);
33
+ /**
34
+ * List all passages associated with a data folder.
35
+ *
36
+ * @param {string} folderId
37
+ * @param {Letta.folders.PassagesListRequest} request
38
+ * @param {Passages.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Letta.UnprocessableEntityError}
41
+ *
42
+ * @example
43
+ * await client.folders.passages.list("folder_id")
44
+ */
45
+ list(folderId: string, request?: Letta.folders.PassagesListRequest, requestOptions?: Passages.RequestOptions): Promise<Letta.Passage[]>;
46
+ protected _getCustomAuthorizationHeaders(): Promise<{
47
+ Authorization: string;
48
+ }>;
49
+ }
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.Passages = void 0;
52
+ const environments = __importStar(require("../../../../../../environments"));
53
+ const core = __importStar(require("../../../../../../core"));
54
+ const Letta = __importStar(require("../../../../../index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const serializers = __importStar(require("../../../../../../serialization/index"));
57
+ const errors = __importStar(require("../../../../../../errors/index"));
58
+ class Passages {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * List all passages associated with a data folder.
64
+ *
65
+ * @param {string} folderId
66
+ * @param {Letta.folders.PassagesListRequest} request
67
+ * @param {Passages.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link Letta.UnprocessableEntityError}
70
+ *
71
+ * @example
72
+ * await client.folders.passages.list("folder_id")
73
+ */
74
+ list(folderId_1) {
75
+ return __awaiter(this, arguments, void 0, function* (folderId, request = {}, requestOptions) {
76
+ var _a, _b, _c;
77
+ const { after, before, limit } = request;
78
+ const _queryParams = {};
79
+ if (after != null) {
80
+ _queryParams["after"] = after;
81
+ }
82
+ if (before != null) {
83
+ _queryParams["before"] = before;
84
+ }
85
+ if (limit != null) {
86
+ _queryParams["limit"] = limit.toString();
87
+ }
88
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
89
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LettaEnvironment.LettaCloud, `v1/folders/${encodeURIComponent(folderId)}/passages`),
90
+ method: "GET",
91
+ headers: Object.assign(Object.assign({ "X-Project": (yield core.Supplier.get(this._options.project)) != null
92
+ ? yield core.Supplier.get(this._options.project)
93
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@letta-ai/letta-client", "X-Fern-SDK-Version": "0.1.163", "User-Agent": "@letta-ai/letta-client/0.1.163", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
94
+ contentType: "application/json",
95
+ queryParameters: _queryParams,
96
+ requestType: "json",
97
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
98
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
99
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
100
+ });
101
+ if (_response.ok) {
102
+ return serializers.folders.passages.list.Response.parseOrThrow(_response.body, {
103
+ unrecognizedObjectKeys: "passthrough",
104
+ allowUnrecognizedUnionMembers: true,
105
+ allowUnrecognizedEnumValues: true,
106
+ skipValidation: true,
107
+ breadcrumbsPrefix: ["response"],
108
+ });
109
+ }
110
+ if (_response.error.reason === "status-code") {
111
+ switch (_response.error.statusCode) {
112
+ case 422:
113
+ throw new Letta.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
114
+ unrecognizedObjectKeys: "passthrough",
115
+ allowUnrecognizedUnionMembers: true,
116
+ allowUnrecognizedEnumValues: true,
117
+ skipValidation: true,
118
+ breadcrumbsPrefix: ["response"],
119
+ }));
120
+ default:
121
+ throw new errors.LettaError({
122
+ statusCode: _response.error.statusCode,
123
+ body: _response.error.body,
124
+ });
125
+ }
126
+ }
127
+ switch (_response.error.reason) {
128
+ case "non-json":
129
+ throw new errors.LettaError({
130
+ statusCode: _response.error.statusCode,
131
+ body: _response.error.rawBody,
132
+ });
133
+ case "timeout":
134
+ throw new errors.LettaTimeoutError("Timeout exceeded when calling GET /v1/folders/{folder_id}/passages.");
135
+ case "unknown":
136
+ throw new errors.LettaError({
137
+ message: _response.error.errorMessage,
138
+ });
139
+ }
140
+ });
141
+ }
142
+ _getCustomAuthorizationHeaders() {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ const tokenValue = yield core.Supplier.get(this._options.token);
145
+ return { Authorization: `Bearer ${tokenValue}` };
146
+ });
147
+ }
148
+ }
149
+ exports.Passages = Passages;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -5,7 +5,7 @@
5
5
  * @example
6
6
  * {}
7
7
  */
8
- export interface ListFolderPassagesRequest {
8
+ export interface PassagesListRequest {
9
9
  /**
10
10
  * Message after which to retrieve the returned messages.
11
11
  */
@@ -0,0 +1 @@
1
+ export { type PassagesListRequest } from "./PassagesListRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";