@nebula-ai/sdk 1.2.2 → 1.3.0

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 (423) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +4 -23
  3. package/README.md +305 -126
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +205 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +205 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +505 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +501 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +13 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +13 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +43 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +13 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +79 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +79 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +86 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +80 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/query.d.mts +2 -0
  239. package/internal/utils/query.d.mts.map +1 -0
  240. package/internal/utils/query.d.ts +2 -0
  241. package/internal/utils/query.d.ts.map +1 -0
  242. package/internal/utils/query.js +10 -0
  243. package/internal/utils/query.js.map +1 -0
  244. package/internal/utils/query.mjs +6 -0
  245. package/internal/utils/query.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +8 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +8 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +12 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +9 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/lib/dx.d.mts +96 -0
  279. package/lib/dx.d.mts.map +1 -0
  280. package/lib/dx.d.ts +96 -0
  281. package/lib/dx.d.ts.map +1 -0
  282. package/lib/dx.js +239 -0
  283. package/lib/dx.js.map +1 -0
  284. package/lib/dx.mjs +235 -0
  285. package/lib/dx.mjs.map +1 -0
  286. package/package.json +144 -58
  287. package/resource.d.mts +2 -0
  288. package/resource.d.mts.map +1 -0
  289. package/resource.d.ts +2 -0
  290. package/resource.d.ts.map +1 -0
  291. package/resource.js +6 -0
  292. package/resource.js.map +1 -0
  293. package/resource.mjs +2 -0
  294. package/resource.mjs.map +1 -0
  295. package/resources/collections.d.mts +289 -0
  296. package/resources/collections.d.mts.map +1 -0
  297. package/resources/collections.d.ts +289 -0
  298. package/resources/collections.d.ts.map +1 -0
  299. package/resources/collections.js +72 -0
  300. package/resources/collections.js.map +1 -0
  301. package/resources/collections.mjs +68 -0
  302. package/resources/collections.mjs.map +1 -0
  303. package/resources/connectors.d.mts +148 -0
  304. package/resources/connectors.d.mts.map +1 -0
  305. package/resources/connectors.d.ts +148 -0
  306. package/resources/connectors.d.ts.map +1 -0
  307. package/resources/connectors.js +50 -0
  308. package/resources/connectors.js.map +1 -0
  309. package/resources/connectors.mjs +46 -0
  310. package/resources/connectors.mjs.map +1 -0
  311. package/resources/index.d.mts +6 -0
  312. package/resources/index.d.mts.map +1 -0
  313. package/resources/index.d.ts +6 -0
  314. package/resources/index.d.ts.map +1 -0
  315. package/resources/index.js +13 -0
  316. package/resources/index.js.map +1 -0
  317. package/resources/index.mjs +6 -0
  318. package/resources/index.mjs.map +1 -0
  319. package/resources/memories.d.mts +1737 -0
  320. package/resources/memories.d.mts.map +1 -0
  321. package/resources/memories.d.ts +1737 -0
  322. package/resources/memories.d.ts.map +1 -0
  323. package/resources/memories.js +157 -0
  324. package/resources/memories.js.map +1 -0
  325. package/resources/memories.mjs +153 -0
  326. package/resources/memories.mjs.map +1 -0
  327. package/resources/snapshots.d.mts +281 -0
  328. package/resources/snapshots.d.mts.map +1 -0
  329. package/resources/snapshots.d.ts +281 -0
  330. package/resources/snapshots.d.ts.map +1 -0
  331. package/resources/snapshots.js +22 -0
  332. package/resources/snapshots.js.map +1 -0
  333. package/resources/snapshots.mjs +18 -0
  334. package/resources/snapshots.mjs.map +1 -0
  335. package/resources/top-level.d.mts +14 -0
  336. package/resources/top-level.d.mts.map +1 -0
  337. package/resources/top-level.d.ts +14 -0
  338. package/resources/top-level.d.ts.map +1 -0
  339. package/resources/top-level.js +4 -0
  340. package/resources/top-level.js.map +1 -0
  341. package/resources/top-level.mjs +3 -0
  342. package/resources/top-level.mjs.map +1 -0
  343. package/resources.d.mts +2 -0
  344. package/resources.d.mts.map +1 -0
  345. package/resources.d.ts +2 -0
  346. package/resources.d.ts.map +1 -0
  347. package/resources.js +5 -0
  348. package/resources.js.map +1 -0
  349. package/resources.mjs +2 -0
  350. package/resources.mjs.map +1 -0
  351. package/src/api-promise.ts +2 -0
  352. package/src/client.ts +892 -0
  353. package/src/core/README.md +3 -0
  354. package/src/core/api-promise.ts +92 -0
  355. package/src/core/error.ts +130 -0
  356. package/src/core/resource.ts +11 -0
  357. package/src/core/uploads.ts +2 -0
  358. package/src/error.ts +2 -0
  359. package/src/index.ts +36 -0
  360. package/src/internal/README.md +3 -0
  361. package/src/internal/builtin-types.ts +93 -0
  362. package/src/internal/detect-platform.ts +196 -0
  363. package/src/internal/errors.ts +33 -0
  364. package/src/internal/headers.ts +97 -0
  365. package/src/internal/parse.ts +56 -0
  366. package/src/internal/qs/LICENSE.md +13 -0
  367. package/src/internal/qs/README.md +3 -0
  368. package/src/internal/qs/formats.ts +10 -0
  369. package/src/internal/qs/index.ts +13 -0
  370. package/src/internal/qs/stringify.ts +385 -0
  371. package/src/internal/qs/types.ts +71 -0
  372. package/src/internal/qs/utils.ts +265 -0
  373. package/src/internal/request-options.ts +93 -0
  374. package/src/internal/shim-types.ts +26 -0
  375. package/src/internal/shims.ts +107 -0
  376. package/src/internal/to-file.ts +154 -0
  377. package/src/internal/types.ts +95 -0
  378. package/src/internal/uploads.ts +187 -0
  379. package/src/internal/utils/base64.ts +40 -0
  380. package/src/internal/utils/bytes.ts +32 -0
  381. package/src/internal/utils/env.ts +18 -0
  382. package/src/internal/utils/log.ts +127 -0
  383. package/src/internal/utils/path.ts +88 -0
  384. package/src/internal/utils/query.ts +7 -0
  385. package/src/internal/utils/sleep.ts +3 -0
  386. package/src/internal/utils/uuid.ts +17 -0
  387. package/src/internal/utils/values.ts +105 -0
  388. package/src/internal/utils.ts +9 -0
  389. package/src/lib/.keep +4 -0
  390. package/src/lib/dx.ts +459 -0
  391. package/src/resource.ts +2 -0
  392. package/src/resources/collections.ts +474 -0
  393. package/src/resources/connectors.ts +236 -0
  394. package/src/resources/index.ts +56 -0
  395. package/src/resources/memories.ts +2409 -0
  396. package/src/resources/snapshots.ts +387 -0
  397. package/src/resources/top-level.ts +19 -0
  398. package/src/resources.ts +1 -0
  399. package/src/tsconfig.json +11 -0
  400. package/src/uploads.ts +2 -0
  401. package/src/version.ts +1 -0
  402. package/uploads.d.mts +2 -0
  403. package/uploads.d.mts.map +1 -0
  404. package/uploads.d.ts +2 -0
  405. package/uploads.d.ts.map +1 -0
  406. package/uploads.js +6 -0
  407. package/uploads.js.map +1 -0
  408. package/uploads.mjs +2 -0
  409. package/uploads.mjs.map +1 -0
  410. package/version.d.mts +2 -0
  411. package/version.d.mts.map +1 -0
  412. package/version.d.ts +2 -0
  413. package/version.d.ts.map +1 -0
  414. package/version.js +5 -0
  415. package/version.js.map +1 -0
  416. package/version.mjs +2 -0
  417. package/version.mjs.map +1 -0
  418. package/dist/index.d.mts +0 -599
  419. package/dist/index.d.ts +0 -599
  420. package/dist/index.js +0 -1345
  421. package/dist/index.js.map +0 -1
  422. package/dist/index.mjs +0 -1330
  423. package/dist/index.mjs.map +0 -1
package/dist/index.js DELETED
@@ -1,1345 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- // src/types.ts
6
- var GraphSearchResultType = /* @__PURE__ */ ((GraphSearchResultType2) => {
7
- GraphSearchResultType2["ENTITY"] = "entity";
8
- GraphSearchResultType2["RELATIONSHIP"] = "relationship";
9
- GraphSearchResultType2["COMMUNITY"] = "community";
10
- return GraphSearchResultType2;
11
- })(GraphSearchResultType || {});
12
- var NebulaException = class extends Error {
13
- constructor(message, statusCode, details) {
14
- super(message);
15
- this.statusCode = statusCode;
16
- this.details = details;
17
- this.name = "NebulaException";
18
- }
19
- };
20
- var NebulaClientException = class extends NebulaException {
21
- constructor(message, cause) {
22
- super(message);
23
- this.cause = cause;
24
- this.name = "NebulaClientException";
25
- }
26
- };
27
- var NebulaAuthenticationException = class extends NebulaException {
28
- constructor(message = "Invalid API key") {
29
- super(message, 401);
30
- this.name = "NebulaAuthenticationException";
31
- }
32
- };
33
- var NebulaRateLimitException = class extends NebulaException {
34
- constructor(message = "Rate limit exceeded") {
35
- super(message, 429);
36
- this.name = "NebulaRateLimitException";
37
- }
38
- };
39
- var NebulaValidationException = class extends NebulaException {
40
- constructor(message = "Validation error", details) {
41
- super(message, 400);
42
- this.details = details;
43
- this.name = "NebulaValidationException";
44
- }
45
- };
46
- var NebulaCollectionNotFoundException = class extends NebulaException {
47
- constructor(message = "Collection not found") {
48
- super(message, 404);
49
- this.name = "NebulaCollectionNotFoundException";
50
- }
51
- };
52
- var NebulaNotFoundException = class extends NebulaException {
53
- constructor(resourceId, resourceType = "Resource") {
54
- super(`${resourceType} not found: ${resourceId}`, 404);
55
- this.name = "NebulaNotFoundException";
56
- }
57
- };
58
-
59
- // src/client.ts
60
- var _Nebula = class _Nebula {
61
- // 5MB
62
- constructor(config = {}) {
63
- this.apiKey = config.apiKey;
64
- if (!this.apiKey) {
65
- throw new NebulaClientException(
66
- "API key is required. Pass it to the constructor or set NEBULA_API_KEY environment variable."
67
- );
68
- }
69
- this.baseUrl = (config.baseUrl || "https://api.trynebula.ai").replace(/\/$/, "");
70
- this.timeout = config.timeout || 3e4;
71
- }
72
- // Public mutators used by tests
73
- setApiKey(next) {
74
- this.apiKey = next;
75
- }
76
- setBaseUrl(next) {
77
- this.baseUrl = (next || this.baseUrl).replace(/\/$/, "");
78
- }
79
- // Kept for backwards-compat tests; no-op in current implementation
80
- setCorsProxy(_next) {
81
- }
82
- /** Check if API key is set */
83
- isApiKeySet() {
84
- return !!(this.apiKey && this.apiKey.trim() !== "");
85
- }
86
- /** Detect if a token looks like a Nebula API key (public.raw) */
87
- _isNebulaApiKey(token) {
88
- const candidate = token || this.apiKey;
89
- if (!candidate) return false;
90
- const parts = candidate.split(".");
91
- if (parts.length !== 2) return false;
92
- const [publicPart, rawPart] = parts;
93
- return (publicPart.startsWith("key_") || publicPart.startsWith("neb_")) && !!rawPart && rawPart.length > 0;
94
- }
95
- /** Build authentication headers */
96
- _buildAuthHeaders(includeContentType = true) {
97
- const headers = {};
98
- if (this._isNebulaApiKey()) {
99
- headers["X-API-Key"] = this.apiKey;
100
- } else {
101
- headers["Authorization"] = `Bearer ${this.apiKey}`;
102
- }
103
- if (includeContentType) {
104
- headers["Content-Type"] = "application/json";
105
- }
106
- return headers;
107
- }
108
- _isRecord(value) {
109
- return typeof value === "object" && value !== null && !Array.isArray(value);
110
- }
111
- _unwrapResults(value) {
112
- if (this._isRecord(value) && "results" in value) {
113
- return value.results;
114
- }
115
- return value;
116
- }
117
- _unwrapResultsArray(value) {
118
- const unwrapped = this._unwrapResults(value);
119
- if (Array.isArray(unwrapped)) {
120
- return unwrapped;
121
- }
122
- if (unwrapped === void 0 || unwrapped === null) {
123
- return [];
124
- }
125
- return [unwrapped];
126
- }
127
- _looksLikeMultimodalContent(content) {
128
- if (!Array.isArray(content)) return false;
129
- return content.some((part) => {
130
- if (!this._isRecord(part)) return false;
131
- if (typeof part.type === "string") return true;
132
- if ("data" in part || "s3_key" in part || "url" in part) return true;
133
- return false;
134
- });
135
- }
136
- _normalizeContentParts(contentParts) {
137
- return contentParts.map((part) => {
138
- if (typeof part === "string") {
139
- return { type: "text", text: part };
140
- }
141
- if (!this._isRecord(part)) {
142
- return { type: "text", text: String(part) };
143
- }
144
- if (typeof part.type === "string") {
145
- return part;
146
- }
147
- if ("s3_key" in part && typeof part.s3_key === "string") {
148
- return {
149
- type: "s3_ref",
150
- s3_key: part.s3_key,
151
- bucket: typeof part.bucket === "string" ? part.bucket : void 0,
152
- media_type: typeof part.media_type === "string" ? part.media_type : "application/octet-stream",
153
- filename: typeof part.filename === "string" ? part.filename : void 0,
154
- size_bytes: typeof part.size_bytes === "number" ? part.size_bytes : void 0
155
- };
156
- }
157
- if ("data" in part && typeof part.data === "string") {
158
- return {
159
- type: "file",
160
- data: part.data,
161
- media_type: typeof part.media_type === "string" ? part.media_type : "application/octet-stream",
162
- filename: typeof part.filename === "string" ? part.filename : void 0,
163
- duration_seconds: typeof part.duration_seconds === "number" ? part.duration_seconds : void 0
164
- };
165
- }
166
- return { type: "text", text: String(part) };
167
- });
168
- }
169
- async _serializeContentAsText(content) {
170
- if (this._looksLikeMultimodalContent(content)) {
171
- const normalized = this._normalizeContentParts(content);
172
- const processed = await this._processContentParts(normalized);
173
- return JSON.stringify(processed);
174
- }
175
- if (typeof content === "object" && content !== null) {
176
- return JSON.stringify(content);
177
- }
178
- return String(content ?? "");
179
- }
180
- async _serializeContentAsParts(content) {
181
- if (!this._looksLikeMultimodalContent(content)) return null;
182
- const normalized = this._normalizeContentParts(content);
183
- return await this._processContentParts(normalized);
184
- }
185
- /** Make an HTTP request to the Nebula API */
186
- async _makeRequest(method, endpoint, jsonData, params, extraHeaders) {
187
- const url = new URL(endpoint, this.baseUrl);
188
- if (params) {
189
- Object.entries(params).forEach(([key, value]) => {
190
- if (value !== void 0 && value !== null) {
191
- if (Array.isArray(value)) {
192
- value.forEach((item) => {
193
- url.searchParams.append(key, String(item));
194
- });
195
- } else {
196
- url.searchParams.append(key, String(value));
197
- }
198
- }
199
- });
200
- }
201
- const headers = { ...this._buildAuthHeaders(true), ...extraHeaders };
202
- const controller = new AbortController();
203
- const timeoutId = setTimeout(() => controller.abort(), this.timeout);
204
- try {
205
- const response = await fetch(url.toString(), {
206
- method,
207
- headers,
208
- body: jsonData ? JSON.stringify(jsonData) : void 0,
209
- signal: controller.signal
210
- });
211
- clearTimeout(timeoutId);
212
- if (response.status === 200 || response.status === 202) {
213
- return await response.json();
214
- } else if (response.status === 401) {
215
- throw new NebulaAuthenticationException("Invalid API key");
216
- } else if (response.status === 429) {
217
- throw new NebulaRateLimitException("Rate limit exceeded");
218
- } else if (response.status === 400) {
219
- const errorData = await response.json().catch(() => ({}));
220
- throw new NebulaValidationException(errorData.message || "Validation error", errorData.details);
221
- } else if (response.status === 422) {
222
- const errorData = await response.json().catch(() => ({}));
223
- console.error("[SDK] 422 Validation error - Full details:");
224
- console.error(" Status:", response.status);
225
- console.error(" Error data:", JSON.stringify(errorData, null, 2));
226
- console.error(" Message:", errorData.message);
227
- console.error(" Detail:", errorData.detail);
228
- throw new NebulaValidationException(
229
- errorData.message || (typeof errorData.detail === "string" ? errorData.detail : JSON.stringify(errorData.detail)) || "Validation error",
230
- errorData
231
- );
232
- } else {
233
- const errorData = await response.json().catch(() => ({}));
234
- throw new NebulaException(errorData.message || `API error: ${response.status}`, response.status, errorData);
235
- }
236
- } catch (error) {
237
- clearTimeout(timeoutId);
238
- if (error instanceof NebulaException) {
239
- throw error;
240
- }
241
- if (error instanceof Error && error.name === "AbortError") {
242
- throw new NebulaClientException(`Request timed out after ${this.timeout} milliseconds`);
243
- }
244
- if (error instanceof Error) {
245
- throw new NebulaClientException(`Request failed: ${error.message}`, error);
246
- }
247
- throw new NebulaClientException(`Request failed: ${String(error)}`);
248
- }
249
- }
250
- // Collection Management Methods
251
- /** Create a new collection */
252
- async createCollection(options) {
253
- const data = { name: options.name };
254
- if (options.description) data.description = options.description;
255
- if (options.metadata) data.metadata = options.metadata;
256
- const response = await this._makeRequest("POST", "/v1/collections", data);
257
- const result = response.results || response;
258
- return this._collectionFromDict(result);
259
- }
260
- /** Get a specific collection by ID */
261
- async getCollection(collectionId) {
262
- const response = await this._makeRequest("GET", `/v1/collections/${collectionId}`);
263
- const result = response.results || response;
264
- return this._collectionFromDict(result);
265
- }
266
- /** Get a specific collection by name */
267
- async getCollectionByName(name) {
268
- const response = await this._makeRequest("GET", `/v1/collections/name/${name}`);
269
- const result = response.results || response;
270
- return this._collectionFromDict(result);
271
- }
272
- /** Get all collections */
273
- async listCollections(options) {
274
- const params = {
275
- limit: options?.limit ?? 100,
276
- offset: options?.offset ?? 0
277
- };
278
- if (options?.name !== void 0) {
279
- params.name = options.name;
280
- }
281
- const response = await this._makeRequest("GET", "/v1/collections", void 0, params);
282
- let collections;
283
- if (typeof response === "object" && response !== null && "results" in response) {
284
- collections = response.results;
285
- } else if (Array.isArray(response)) {
286
- collections = response;
287
- } else {
288
- collections = [response];
289
- }
290
- return collections.map((collection) => this._collectionFromDict(collection));
291
- }
292
- /** Update a collection */
293
- async updateCollection(options) {
294
- const data = {};
295
- if (options.name !== void 0) data.name = options.name;
296
- if (options.description !== void 0) data.description = options.description;
297
- if (options.metadata !== void 0) data.metadata = options.metadata;
298
- const response = await this._makeRequest("POST", `/v1/collections/${options.collectionId}`, data);
299
- const result = response.results || response;
300
- return this._collectionFromDict(result);
301
- }
302
- /** Delete a collection */
303
- async deleteCollection(collectionId) {
304
- await this._makeRequest("DELETE", `/v1/collections/${collectionId}`);
305
- return true;
306
- }
307
- // Memory Management Methods
308
- /**
309
- * Legacy convenience: store raw text content into a collection as a document
310
- */
311
- async store(content, collectionId, metadata = {}) {
312
- const docMetadata = {
313
- ...metadata,
314
- memory_type: "memory",
315
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
316
- };
317
- const payload = {
318
- collection_id: collectionId,
319
- raw_text: String(content || ""),
320
- metadata: docMetadata,
321
- ingestion_mode: "fast"
322
- };
323
- const response = await this._makeRequest("POST", "/v1/memories", payload);
324
- const id = response?.results?.engram_id || response?.results?.id || response?.id || "";
325
- const timestamp = docMetadata.timestamp;
326
- const result = {
327
- id: String(id),
328
- memory_id: String(id),
329
- content: String(content || ""),
330
- metadata: docMetadata,
331
- collection_ids: [collectionId],
332
- created_at: timestamp,
333
- updated_at: timestamp
334
- };
335
- return result;
336
- }
337
- /**
338
- * Store a single memory using the unified engrams API.
339
- *
340
- * Automatically infers memory type:
341
- * - If role is present, creates a conversation
342
- * - Otherwise, creates a document
343
- */
344
- async storeMemory(memory, name) {
345
- let mem;
346
- if ("collection_id" in memory || "snapshot" in memory) {
347
- mem = memory;
348
- } else {
349
- const memRecord2 = memory;
350
- mem = {
351
- collection_id: memRecord2.collection_id || memRecord2.collectionId || "",
352
- content: memRecord2.content || "",
353
- role: memRecord2.role,
354
- memory_id: memRecord2.memory_id || memRecord2.memoryId || void 0,
355
- metadata: memRecord2.metadata || {},
356
- snapshot: memRecord2.snapshot
357
- };
358
- }
359
- if (mem.snapshot) {
360
- const contentText = await this._serializeContentAsText(mem.content);
361
- const payload2 = {
362
- snapshot: mem.snapshot,
363
- raw_text: contentText
364
- };
365
- const response2 = await this._makeRequest("POST", "/v1/memories", payload2);
366
- const snapshot = response2?.results?.snapshot;
367
- if (snapshot) {
368
- return snapshot;
369
- }
370
- return response2?.results ?? {};
371
- }
372
- if (mem.memory_id) {
373
- return await this._appendToMemory(mem.memory_id, mem);
374
- }
375
- const memoryType = mem.role ? "conversation" : "document";
376
- if (memoryType === "conversation") {
377
- const messages = [];
378
- if (mem.content && mem.role) {
379
- const multimodalParts2 = await this._serializeContentAsParts(mem.content);
380
- const msgContent = multimodalParts2 ?? await this._serializeContentAsText(mem.content);
381
- const memRecord2 = mem;
382
- messages.push({
383
- content: msgContent,
384
- role: mem.role,
385
- metadata: mem.metadata || {},
386
- ...typeof memRecord2.authority === "number" ? { authority: Number(memRecord2.authority) } : {}
387
- });
388
- }
389
- if (messages.length === 0) {
390
- throw new NebulaClientException("Cannot create conversation without messages. Provide content and role.");
391
- }
392
- const data = {
393
- collection_id: mem.collection_id,
394
- name: name || "Conversation",
395
- messages,
396
- metadata: mem.metadata || {}
397
- };
398
- const response2 = await this._makeRequest("POST", "/v1/memories", data);
399
- if (response2.results) {
400
- const convId = response2.results.memory_id || response2.results.id;
401
- if (!convId) {
402
- throw new NebulaClientException("Failed to create conversation: no id returned");
403
- }
404
- return String(convId);
405
- }
406
- throw new NebulaClientException("Failed to create conversation: invalid response format");
407
- }
408
- const docMetadata = { ...mem.metadata };
409
- docMetadata.memory_type = "memory";
410
- const memRecord = mem;
411
- if (typeof memRecord.authority === "number") {
412
- const v = Number(memRecord.authority);
413
- if (!Number.isNaN(v) && v >= 0 && v <= 1) {
414
- docMetadata.authority = v;
415
- }
416
- }
417
- let payload;
418
- const multimodalParts = await this._serializeContentAsParts(mem.content);
419
- if (multimodalParts) {
420
- payload = {
421
- collection_id: mem.collection_id,
422
- content_parts: multimodalParts,
423
- metadata: docMetadata,
424
- ingestion_mode: "fast"
425
- };
426
- } else if (Array.isArray(mem.content) && mem.content.every((x) => typeof x === "string")) {
427
- payload = {
428
- collection_id: mem.collection_id,
429
- chunks: mem.content,
430
- metadata: docMetadata,
431
- ingestion_mode: "fast"
432
- };
433
- } else {
434
- const contentText = await this._serializeContentAsText(mem.content);
435
- if (!contentText || contentText === '""' || contentText === "[]" || contentText === "{}") {
436
- throw new NebulaClientException("Content is required for document memories");
437
- }
438
- payload = {
439
- collection_id: mem.collection_id,
440
- raw_text: contentText,
441
- metadata: docMetadata,
442
- ingestion_mode: "fast"
443
- };
444
- }
445
- const response = await this._makeRequest("POST", "/v1/memories", payload);
446
- const id = response?.results?.engram_id || response?.results?.id || response?.id || "";
447
- return String(id || "");
448
- }
449
- /**
450
- * Internal method to append content to an existing memory
451
- *
452
- * @throws NebulaNotFoundException if memory_id doesn't exist
453
- */
454
- async _appendToMemory(memoryId, memory) {
455
- const collectionId = memory.collection_id;
456
- const content = memory.content;
457
- const metadata = memory.metadata;
458
- if (!collectionId) {
459
- throw new NebulaClientException("collection_id is required");
460
- }
461
- const payload = {
462
- collection_id: collectionId
463
- };
464
- if (Array.isArray(content)) {
465
- if (content.length > 0 && typeof content[0] === "object" && "content" in content[0]) {
466
- payload.messages = content;
467
- } else {
468
- payload.chunks = content;
469
- }
470
- } else if (typeof content === "string") {
471
- payload.raw_text = content;
472
- } else {
473
- throw new NebulaClientException(
474
- "content must be a string, array of strings, or array of message objects"
475
- );
476
- }
477
- if (metadata) {
478
- payload.metadata = metadata;
479
- }
480
- try {
481
- await this._makeRequest("POST", `/v1/memories/${memoryId}/append`, payload);
482
- return memoryId;
483
- } catch (error) {
484
- if (error instanceof NebulaException && error.statusCode === 404) {
485
- throw new NebulaNotFoundException(memoryId, "Memory");
486
- }
487
- throw error;
488
- }
489
- }
490
- /** Store multiple memories using the unified engrams API.
491
- * @param memories - List of Memory objects to store.
492
- * @param metadata - Optional memory-level metadata for conversation groups.
493
- * Each Memory's own metadata is used as per-message metadata.
494
- */
495
- async storeMemories(memories, metadata) {
496
- const results = [];
497
- const convGroups = {};
498
- const others = [];
499
- for (const m of memories) {
500
- if (m.role) {
501
- const key = m.memory_id || `__new__::${m.collection_id}`;
502
- if (!convGroups[key]) convGroups[key] = [];
503
- convGroups[key].push(m);
504
- } else {
505
- others.push(m);
506
- }
507
- }
508
- for (const [key, group] of Object.entries(convGroups)) {
509
- const collectionId = group[0].collection_id;
510
- let convId;
511
- const messages = [];
512
- for (const m of group) {
513
- const multimodalParts = await this._serializeContentAsParts(m.content);
514
- const msgContent = multimodalParts ?? await this._serializeContentAsText(m.content);
515
- if (typeof msgContent === "string") {
516
- if (!msgContent.trim()) continue;
517
- } else if (msgContent.length === 0) {
518
- continue;
519
- }
520
- const mRecord = m;
521
- messages.push({
522
- content: msgContent,
523
- role: m.role,
524
- metadata: m.metadata || {},
525
- ...typeof mRecord.authority === "number" ? { authority: Number(mRecord.authority) } : {}
526
- });
527
- }
528
- if (!messages.length) {
529
- throw new NebulaClientException(
530
- "Cannot create/append conversation without messages. Provide non-empty content."
531
- );
532
- }
533
- if (key.startsWith("__new__::")) {
534
- const data = {
535
- collection_id: collectionId,
536
- name: "Conversation",
537
- messages,
538
- metadata: metadata ?? {}
539
- };
540
- const response = await this._makeRequest("POST", "/v1/memories", data);
541
- if (response.results) {
542
- convId = response.results.memory_id || response.results.id || "";
543
- if (!convId) {
544
- throw new NebulaClientException("Failed to create conversation: no id returned");
545
- }
546
- } else {
547
- throw new NebulaClientException("Failed to create conversation: invalid response format");
548
- }
549
- } else {
550
- convId = key;
551
- const appendMem = {
552
- collection_id: collectionId,
553
- content: messages,
554
- memory_id: convId,
555
- metadata: metadata ?? {}
556
- };
557
- await this._appendToMemory(convId, appendMem);
558
- }
559
- results.push(...Array(group.length).fill(String(convId)));
560
- }
561
- for (const m of others) {
562
- results.push(await this.storeMemory(m));
563
- }
564
- return results;
565
- }
566
- /** Delete one or more memories */
567
- async delete(memoryIds) {
568
- try {
569
- console.log("[SDK] delete() called with:", { memoryIds, type: typeof memoryIds, isArray: Array.isArray(memoryIds) });
570
- if (typeof memoryIds === "string") {
571
- console.log("[SDK] Single deletion path for ID:", memoryIds);
572
- try {
573
- await this._makeRequest("DELETE", `/v1/memories/${memoryIds}`);
574
- return true;
575
- } catch {
576
- console.log("[SDK] Falling back to POST /v1/memories/delete with single ID");
577
- const response = await this._makeRequest("POST", "/v1/memories/delete", memoryIds);
578
- return typeof response === "object" && response.success !== void 0 ? response.success : true;
579
- }
580
- } else {
581
- console.log("[SDK] Batch deletion path for IDs:", memoryIds);
582
- console.log("[SDK] Sending POST request with body:", memoryIds);
583
- const response = await this._makeRequest("POST", "/v1/memories/delete", memoryIds);
584
- console.log("[SDK] Batch deletion response:", response);
585
- return response;
586
- }
587
- } catch (error) {
588
- console.error("[SDK] Delete error:", error);
589
- if (error instanceof Error) {
590
- throw error;
591
- }
592
- throw new NebulaClientException(`Unknown error: ${String(error)}`);
593
- }
594
- }
595
- /** Delete a specific source within a memory */
596
- async deleteSource(sourceId) {
597
- try {
598
- await this._makeRequest("DELETE", `/v1/sources/${sourceId}`);
599
- return true;
600
- } catch (error) {
601
- if (error instanceof NebulaException && error.statusCode === 404) {
602
- throw new NebulaNotFoundException(sourceId, "Source");
603
- }
604
- throw error;
605
- }
606
- }
607
- /** Update a specific source within a memory */
608
- async updateSource(sourceId, content, metadata) {
609
- const payload = { content };
610
- if (metadata !== void 0) {
611
- payload.metadata = metadata;
612
- }
613
- try {
614
- await this._makeRequest("PATCH", `/v1/sources/${sourceId}`, payload);
615
- return true;
616
- } catch (error) {
617
- if (error instanceof NebulaException && error.statusCode === 404) {
618
- throw new NebulaNotFoundException(sourceId, "Source");
619
- }
620
- throw error;
621
- }
622
- }
623
- /**
624
- * Update memory-level properties including name, metadata, and collection associations.
625
- *
626
- * This method allows updating properties of an entire memory (document or conversation)
627
- * without modifying its content. For updating individual sources within a memory,
628
- * use updateSource(). For updating content, use storeMemory() to append.
629
- *
630
- * @param options - Update configuration
631
- * @param options.memoryId - The ID of the memory to update
632
- * @param options.name - New name for the memory (useful for conversations and documents)
633
- * @param options.metadata - Metadata to set. By default, replaces existing metadata.
634
- * Set mergeMetadata=true to merge with existing metadata instead.
635
- * @param options.collectionIds - New collection associations. Must specify at least one valid collection.
636
- * @param options.mergeMetadata - If true, merges provided metadata with existing metadata.
637
- * If false (default), replaces existing metadata entirely.
638
- *
639
- * @returns Promise resolving to true if successful
640
- *
641
- * @throws NebulaNotFoundException if memory_id doesn't exist
642
- * @throws NebulaValidationException if validation fails (e.g., no fields provided)
643
- * @throws NebulaAuthenticationException if user doesn't have permission to update this memory
644
- */
645
- async updateMemory(options) {
646
- const payload = {};
647
- if (options.name !== void 0) {
648
- payload.name = options.name;
649
- }
650
- if (options.metadata !== void 0) {
651
- payload.metadata = options.metadata;
652
- payload.merge_metadata = options.mergeMetadata ?? false;
653
- }
654
- if (options.collectionIds !== void 0) {
655
- payload.collection_ids = options.collectionIds;
656
- }
657
- if (Object.keys(payload).length === 0) {
658
- throw new NebulaValidationException(
659
- "At least one field (name, metadata, or collectionIds) must be provided to update"
660
- );
661
- }
662
- try {
663
- await this._makeRequest("PATCH", `/v1/memories/${options.memoryId}`, payload);
664
- return true;
665
- } catch (error) {
666
- if (error instanceof NebulaException && error.statusCode === 404) {
667
- throw new NebulaNotFoundException(options.memoryId, "Memory");
668
- }
669
- throw error;
670
- }
671
- }
672
- /**
673
- * Get all memories from specific collections with optional metadata filtering
674
- *
675
- * @param options - Configuration for listing memories
676
- * @param options.collection_ids - One or more collection IDs to retrieve memories from
677
- * @param options.limit - Maximum number of memories to return (default: 100)
678
- * @param options.offset - Number of memories to skip for pagination (default: 0)
679
- * @param options.metadata_filters - Optional metadata filters using MongoDB-like operators.
680
- * Supported operators: $eq, $ne, $in, $nin, $exists, $and, $or
681
- *
682
- * @returns Promise resolving to array of MemoryResponse objects
683
- *
684
- * @example
685
- * // Get all playground memories excluding conversations
686
- * const memories = await client.listMemories({
687
- * collection_ids: ['collection-id'],
688
- * metadata_filters: {
689
- * 'metadata.content_type': { $ne: 'conversation' }
690
- * }
691
- * });
692
- *
693
- * @example
694
- * // Complex filter with multiple conditions
695
- * const memories = await client.listMemories({
696
- * collection_ids: ['collection-id'],
697
- * metadata_filters: {
698
- * $and: [
699
- * { 'metadata.playground': { $eq: true } },
700
- * { 'metadata.session_id': { $exists: true } }
701
- * ]
702
- * }
703
- * });
704
- */
705
- async listMemories(options) {
706
- const ids = Array.isArray(options.collection_ids) ? options.collection_ids : [options.collection_ids];
707
- if (!ids.length) {
708
- throw new NebulaClientException("collection_ids must be provided to list_memories().");
709
- }
710
- const params = {
711
- limit: options.limit ?? 100,
712
- offset: options.offset ?? 0,
713
- collection_ids: ids
714
- };
715
- if (options.metadata_filters) {
716
- params.metadata_filters = JSON.stringify(options.metadata_filters);
717
- }
718
- const response = await this._makeRequest("GET", "/v1/memories", void 0, params);
719
- let documents;
720
- if (typeof response === "object" && response !== null && "results" in response) {
721
- documents = response.results;
722
- } else if (Array.isArray(response)) {
723
- documents = response;
724
- } else {
725
- documents = [response];
726
- }
727
- return documents.map((doc) => this._memoryResponseFromDict(doc, ids));
728
- }
729
- /** Get a specific memory by engram ID */
730
- async getMemory(memoryId) {
731
- const response = await this._makeRequest("GET", `/v1/memories/${memoryId}`);
732
- const content = response.text || response.content;
733
- const chunks = Array.isArray(response.chunks) ? response.chunks : void 0;
734
- const memoryData = {
735
- id: response.id,
736
- content,
737
- chunks,
738
- metadata: response.metadata || {},
739
- collection_ids: response.collection_ids || []
740
- };
741
- return this._memoryResponseFromDict(memoryData, []);
742
- }
743
- // Search Methods
744
- /**
745
- * Search within specific collections with optional metadata filtering.
746
- *
747
- * @param options - Search configuration
748
- * @param options.query - Search query string
749
- * @param options.collection_ids - One or more collection IDs to search within
750
- * @param options.effort - Compute effort budget (auto/low/medium/high). Controls traversal compute, not MemoryResponse size.
751
- * @param options.filters - Optional filters to apply to the search. Supports comprehensive metadata filtering
752
- * with MongoDB-like operators for both vector/chunk search and graph search.
753
- * @param options.searchSettings - Optional search configuration
754
- *
755
- * @returns Promise resolving to array of SearchResult objects containing both vector/chunk and graph search results
756
- *
757
- * @example
758
- * // Basic equality filter
759
- * await client.search({
760
- * query: "machine learning",
761
- * collection_ids: ["research-collection"],
762
- * filters: {
763
- * "metadata.category": { $eq: "research" },
764
- * "metadata.verified": true // Shorthand for $eq
765
- * }
766
- * });
767
- *
768
- * @example
769
- * // Numeric comparisons
770
- * await client.search({
771
- * query: "high priority",
772
- * collection_ids: ["tasks"],
773
- * filters: {
774
- * "metadata.priority": { $gte: 8 },
775
- * "metadata.score": { $lt: 100 }
776
- * }
777
- * });
778
- *
779
- * @example
780
- * // String matching
781
- * await client.search({
782
- * query: "employees",
783
- * collection_ids: ["team"],
784
- * filters: {
785
- * "metadata.email": { $ilike: "%@company.com" } // Case-insensitive
786
- * }
787
- * });
788
- *
789
- * @example
790
- * // Array operations
791
- * await client.search({
792
- * query: "developers",
793
- * collection_ids: ["team"],
794
- * filters: {
795
- * "metadata.skills": { $overlap: ["python", "typescript"] } // Has any
796
- * }
797
- * });
798
- *
799
- * @example
800
- * // Nested paths
801
- * await client.search({
802
- * query: "users",
803
- * collection_ids: ["profiles"],
804
- * filters: {
805
- * "metadata.user.preferences.theme": { $eq: "dark" }
806
- * }
807
- * });
808
- *
809
- * @example
810
- * // Complex logical combinations
811
- * await client.search({
812
- * query: "candidates",
813
- * collection_ids: ["hiring"],
814
- * filters: {
815
- * $and: [
816
- * { "metadata.verified": true },
817
- * { "metadata.level": { $gte: 5 } },
818
- * {
819
- * $or: [
820
- * { "metadata.skills": { $overlap: ["python", "go"] } },
821
- * { "metadata.years_experience": { $gte: 8 } }
822
- * ]
823
- * }
824
- * ]
825
- * }
826
- * });
827
- *
828
- * @remarks
829
- * Supported Operators:
830
- * - Comparison: $eq, $ne, $lt, $lte, $gt, $gte
831
- * - String: $like (case-sensitive), $ilike (case-insensitive)
832
- * - Array: $in, $nin, $overlap, $contains
833
- * - JSONB: $json_contains
834
- * - Logical: $and, $or
835
- *
836
- * For comprehensive filtering documentation, see the Metadata Filtering Guide:
837
- * https://docs.trynebula.ai/guides/metadata-filtering
838
- */
839
- async search(options) {
840
- if (options.snapshot) {
841
- const snapshotData = {
842
- snapshot: options.snapshot,
843
- query: options.query
844
- };
845
- if (options.effort) {
846
- snapshotData.effort = options.effort;
847
- }
848
- const response2 = await this._makeRequest("POST", "/v1/memories/search", snapshotData);
849
- const memoryResponseData2 = response2.results;
850
- return {
851
- query: memoryResponseData2.query || options.query,
852
- semantics: memoryResponseData2.semantics || memoryResponseData2.knowledge || [],
853
- procedures: memoryResponseData2.procedures || [],
854
- episodes: memoryResponseData2.episodes || [],
855
- sources: memoryResponseData2.sources || [],
856
- total_traversal_time_ms: memoryResponseData2.total_traversal_time_ms,
857
- token_count: memoryResponseData2.token_count,
858
- entities: memoryResponseData2.entities || []
859
- };
860
- }
861
- const data = {
862
- query: options.query
863
- };
864
- if (options.effort) {
865
- data.effort = options.effort;
866
- }
867
- if (options.collection_ids) {
868
- const collectionIds2 = Array.isArray(options.collection_ids) ? options.collection_ids : [options.collection_ids];
869
- const validCollectionIds = collectionIds2.filter((id) => id && id.trim() !== "");
870
- if (validCollectionIds.length) {
871
- data.collection_ids = validCollectionIds;
872
- }
873
- }
874
- if (options.filters) {
875
- data.filters = options.filters;
876
- }
877
- if (options.searchSettings) {
878
- data.search_settings = options.searchSettings;
879
- }
880
- const collectionIds = data.collection_ids;
881
- let extraHeaders;
882
- if (collectionIds && collectionIds.length === 1) {
883
- extraHeaders = { "X-Nebula-Collection-Id": collectionIds[0] };
884
- } else if (collectionIds && collectionIds.length > 1) {
885
- extraHeaders = { "X-Nebula-Collection-Id": [...collectionIds].sort().join(",") };
886
- }
887
- const response = await this._makeRequest("POST", "/v1/memories/search", data, void 0, extraHeaders);
888
- const memoryResponseData = response.results;
889
- const memoryResponse = {
890
- query: memoryResponseData.query || options.query,
891
- semantics: memoryResponseData.semantics || memoryResponseData.knowledge || [],
892
- procedures: memoryResponseData.procedures || [],
893
- episodes: memoryResponseData.episodes || [],
894
- sources: memoryResponseData.sources || [],
895
- total_traversal_time_ms: memoryResponseData.total_traversal_time_ms,
896
- token_count: memoryResponseData.token_count,
897
- entities: memoryResponseData.entities || []
898
- };
899
- return memoryResponse;
900
- }
901
- // Connector Methods
902
- /** List available connector providers */
903
- async listProviders() {
904
- const response = await this._makeRequest("GET", "/v1/connectors/providers");
905
- return this._unwrapResultsArray(response);
906
- }
907
- /** Start an OAuth connection flow */
908
- async connectProvider(provider, collectionId, config) {
909
- const body = { collection_id: collectionId };
910
- if (config !== void 0) body.config = config;
911
- const response = await this._makeRequest("POST", `/v1/connectors/${provider}/connect`, body);
912
- return this._unwrapResults(response);
913
- }
914
- /** List active connections for a collection */
915
- async listConnections(collectionId) {
916
- const response = await this._makeRequest("GET", "/v1/connectors", void 0, { collection_id: collectionId });
917
- return this._unwrapResultsArray(response);
918
- }
919
- /** Browse Google Drive folders for a connection */
920
- async listFolders(connectionId, parentId) {
921
- const params = {};
922
- if (parentId !== void 0) params.parent_id = parentId;
923
- const response = await this._makeRequest("GET", `/v1/connectors/${connectionId}/folders`, void 0, Object.keys(params).length ? params : void 0);
924
- return this._unwrapResultsArray(response);
925
- }
926
- /** List Slack channels for a connection */
927
- async listChannels(connectionId) {
928
- const response = await this._makeRequest("GET", `/v1/connectors/${connectionId}/channels`);
929
- return this._unwrapResultsArray(response);
930
- }
931
- /** Get a single connection by ID */
932
- async getConnection(connectionId) {
933
- const response = await this._makeRequest("GET", `/v1/connectors/${connectionId}`);
934
- return this._unwrapResults(response);
935
- }
936
- /** Manually trigger a sync for a connection */
937
- async triggerSync(connectionId) {
938
- const response = await this._makeRequest("POST", `/v1/connectors/${connectionId}/sync`);
939
- return this._unwrapResults(response);
940
- }
941
- /** Update connection config (e.g., folder/channel selection) */
942
- async updateConnectionConfig(connectionId, config, apply = "full_resync") {
943
- const response = await this._makeRequest("PATCH", `/v1/connectors/${connectionId}/config`, { config, apply });
944
- return this._unwrapResults(response);
945
- }
946
- /** Disconnect an external data source */
947
- async disconnect(connectionId, deleteMemories = false) {
948
- const params = {};
949
- if (deleteMemories) params.delete_memories = "true";
950
- const response = await this._makeRequest("DELETE", `/v1/connectors/${connectionId}`, void 0, Object.keys(params).length ? params : void 0);
951
- return this._unwrapResults(response);
952
- }
953
- // Health Check
954
- async healthCheck() {
955
- return this._makeRequest("GET", "/v1/health");
956
- }
957
- // Helpers
958
- _collectionFromDict(data) {
959
- let createdAt;
960
- if (data.created_at) {
961
- if (typeof data.created_at === "string") {
962
- createdAt = data.created_at;
963
- } else if (data.created_at instanceof Date) {
964
- createdAt = data.created_at.toISOString();
965
- }
966
- }
967
- let updatedAt;
968
- if (data.updated_at) {
969
- if (typeof data.updated_at === "string") {
970
- updatedAt = data.updated_at;
971
- } else if (data.updated_at instanceof Date) {
972
- updatedAt = data.updated_at.toISOString();
973
- }
974
- }
975
- const collectionId = String(data.id || "");
976
- const collectionName = String(data.name || "");
977
- const collectionDescription = typeof data.description === "string" ? data.description : void 0;
978
- const collectionOwnerId = data.owner_id ? String(data.owner_id) : void 0;
979
- const memoryCount = typeof data.memory_count === "number" ? data.memory_count : 0;
980
- const metadata = {
981
- graph_collection_status: String(data.graph_collection_status || ""),
982
- graph_sync_status: String(data.graph_sync_status || ""),
983
- user_count: typeof data.user_count === "number" ? data.user_count : 0
984
- };
985
- return {
986
- id: collectionId,
987
- name: collectionName,
988
- description: collectionDescription,
989
- metadata,
990
- created_at: createdAt,
991
- updated_at: updatedAt,
992
- memory_count: memoryCount,
993
- owner_id: collectionOwnerId
994
- };
995
- }
996
- _memoryResponseFromDict(data, collectionIds) {
997
- let createdAt;
998
- if (data.created_at) {
999
- if (typeof data.created_at === "string") {
1000
- createdAt = data.created_at;
1001
- } else if (data.created_at instanceof Date) {
1002
- createdAt = data.created_at.toISOString();
1003
- }
1004
- }
1005
- let updatedAt;
1006
- if (data.updated_at) {
1007
- if (typeof data.updated_at === "string") {
1008
- updatedAt = data.updated_at;
1009
- } else if (data.updated_at instanceof Date) {
1010
- updatedAt = data.updated_at.toISOString();
1011
- }
1012
- }
1013
- const engramId = String(data.id || "");
1014
- const content = typeof data.content === "string" ? data.content : typeof data.text === "string" ? data.text : void 0;
1015
- let chunks;
1016
- if (data.chunks && Array.isArray(data.chunks)) {
1017
- if (data.chunks.every((x) => typeof x === "string")) {
1018
- chunks = data.chunks.map((text) => ({
1019
- id: "",
1020
- content: text,
1021
- metadata: {}
1022
- }));
1023
- } else {
1024
- chunks = data.chunks.filter((item) => item && typeof item === "object" && ("text" in item || "content" in item)).map((item) => ({
1025
- id: String(item.id || ""),
1026
- content: String(item.text || item.content || ""),
1027
- metadata: typeof item.metadata === "object" && item.metadata !== null ? item.metadata : {},
1028
- role: typeof item.role === "string" ? item.role : void 0
1029
- }));
1030
- }
1031
- }
1032
- const metadata = { ...typeof data.metadata === "object" && data.metadata !== null ? data.metadata : {} };
1033
- if (data.engram_id) {
1034
- metadata.engram_id = data.engram_id;
1035
- }
1036
- let finalId = engramId;
1037
- if (data.engram_id && !engramId) {
1038
- finalId = String(data.engram_id);
1039
- }
1040
- if (data.document_metadata && typeof data.document_metadata === "object") {
1041
- Object.assign(metadata, data.document_metadata);
1042
- }
1043
- return {
1044
- id: finalId,
1045
- memory_id: finalId,
1046
- content,
1047
- chunks,
1048
- metadata,
1049
- collection_ids: Array.isArray(data.collection_ids) ? data.collection_ids : collectionIds,
1050
- created_at: createdAt,
1051
- updated_at: updatedAt
1052
- };
1053
- }
1054
- _searchResultFromDict(data) {
1055
- const content = typeof data.content === "string" ? data.content : typeof data.text === "string" ? data.text : "";
1056
- const resultId = String(data.id || data.chunk_id || "");
1057
- return {
1058
- id: String(resultId),
1059
- content: String(content),
1060
- score: typeof data.score === "number" ? data.score : Number(data.score || 0),
1061
- metadata: typeof data.metadata === "object" && data.metadata !== null ? data.metadata : {},
1062
- source: typeof data.source === "string" ? data.source : void 0
1063
- };
1064
- }
1065
- _searchResultFromGraphDict(data) {
1066
- const rid = data.id ? String(data.id) : "";
1067
- const resultTypeStr = typeof data.result_type === "string" ? data.result_type : "entity";
1068
- const rtype = GraphSearchResultType[resultTypeStr.toUpperCase()] || "entity" /* ENTITY */;
1069
- const content = typeof data.content === "object" && data.content !== null ? data.content : {};
1070
- const score = data.score !== void 0 ? Number(data.score) : 0;
1071
- const metadata = typeof data.metadata === "object" && data.metadata !== null ? data.metadata : {};
1072
- const chunkIds = Array.isArray(data.chunk_ids) ? data.chunk_ids : void 0;
1073
- let timestamp;
1074
- if (data.timestamp) {
1075
- if (typeof data.timestamp === "string") {
1076
- timestamp = data.timestamp;
1077
- } else if (data.timestamp instanceof Date) {
1078
- timestamp = data.timestamp.toISOString();
1079
- } else {
1080
- const parsed = new Date(String(data.timestamp));
1081
- if (!Number.isNaN(parsed.valueOf())) {
1082
- timestamp = parsed.toISOString();
1083
- }
1084
- }
1085
- }
1086
- const displayName = typeof data.display_name === "string" ? data.display_name : void 0;
1087
- const sourceRole = typeof data.source_role === "string" ? data.source_role : void 0;
1088
- const engramId = data.engram_id ? String(data.engram_id) : void 0;
1089
- const ownerId = data.owner_id ? String(data.owner_id) : void 0;
1090
- let entity;
1091
- let rel;
1092
- let comm;
1093
- if (rtype === "entity" /* ENTITY */) {
1094
- entity = {
1095
- id: content.id ? String(content.id) : void 0,
1096
- name: String(content.name || ""),
1097
- description: String(content.description || ""),
1098
- metadata: typeof content.metadata === "object" && content.metadata !== null ? content.metadata : {}
1099
- };
1100
- } else if (rtype === "relationship" /* RELATIONSHIP */) {
1101
- rel = {
1102
- id: content.id ? String(content.id) : void 0,
1103
- subject: String(content.subject || ""),
1104
- predicate: String(content.predicate || ""),
1105
- object: String(content.object || ""),
1106
- subject_id: content.subject_id ? String(content.subject_id) : void 0,
1107
- object_id: content.object_id ? String(content.object_id) : void 0,
1108
- description: typeof content.description === "string" ? content.description : void 0,
1109
- metadata: typeof content.metadata === "object" && content.metadata !== null ? content.metadata : {}
1110
- };
1111
- } else {
1112
- comm = {
1113
- id: content.id ? String(content.id) : void 0,
1114
- name: String(content.name || ""),
1115
- summary: String(content.summary || ""),
1116
- metadata: typeof content.metadata === "object" && content.metadata !== null ? content.metadata : {}
1117
- };
1118
- }
1119
- return {
1120
- id: rid,
1121
- score,
1122
- metadata,
1123
- source: "graph",
1124
- content: void 0,
1125
- graph_result_type: rtype,
1126
- graph_entity: entity,
1127
- graph_relationship: rel,
1128
- graph_community: comm,
1129
- chunk_ids: chunkIds,
1130
- timestamp,
1131
- display_name: displayName,
1132
- source_role: sourceRole,
1133
- engram_id: engramId,
1134
- owner_id: ownerId
1135
- };
1136
- }
1137
- async _sha256(message) {
1138
- const msgBuffer = new TextEncoder().encode(message);
1139
- let crypto;
1140
- if (typeof globalThis.crypto !== "undefined" && globalThis.crypto.subtle) {
1141
- crypto = globalThis.crypto;
1142
- } else {
1143
- const nodeCrypto = await import('crypto');
1144
- crypto = nodeCrypto.webcrypto;
1145
- }
1146
- const hashBuffer = await crypto.subtle.digest("SHA-256", msgBuffer);
1147
- const hashArray = Array.from(new Uint8Array(hashBuffer));
1148
- const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
1149
- return hashHex;
1150
- }
1151
- _formDataFromObject(obj) {
1152
- const formData = new FormData();
1153
- Object.entries(obj).forEach(([key, value]) => {
1154
- formData.append(key, value);
1155
- });
1156
- return formData;
1157
- }
1158
- /**
1159
- * Convert and process multimodal content parts, auto-uploading large base64 files to S3.
1160
- *
1161
- * - Binary parts (`image`/`audio`/`document` with `data`) larger than 5MB are uploaded to S3 and converted to `s3_ref`.
1162
- */
1163
- async _processContentParts(contentParts) {
1164
- const processed = [];
1165
- for (const part of contentParts) {
1166
- if (part.type !== "text" && part.type !== "s3_ref" && "data" in part && part.data) {
1167
- const filePart = part;
1168
- const dataSize = Math.floor(String(filePart.data).length * 3 / 4);
1169
- if (dataSize > _Nebula.MAX_INLINE_SIZE) {
1170
- const filename = filePart.filename || `file.bin`;
1171
- const mediaType = filePart.media_type || "application/octet-stream";
1172
- const uploadInfo = await this.getUploadUrl({
1173
- filename,
1174
- content_type: mediaType,
1175
- file_size: dataSize
1176
- });
1177
- let bytes;
1178
- const atobFn = globalThis.atob;
1179
- if (typeof atobFn === "function") {
1180
- const binaryString = atobFn(String(filePart.data));
1181
- bytes = new Uint8Array(binaryString.length);
1182
- for (let i = 0; i < binaryString.length; i++) {
1183
- bytes[i] = binaryString.charCodeAt(i);
1184
- }
1185
- } else {
1186
- const { Buffer } = await import('buffer');
1187
- bytes = Uint8Array.from(Buffer.from(String(filePart.data), "base64"));
1188
- }
1189
- await fetch(uploadInfo.upload_url, {
1190
- method: "PUT",
1191
- body: bytes,
1192
- headers: { "Content-Type": mediaType }
1193
- });
1194
- processed.push({
1195
- type: "s3_ref",
1196
- s3_key: uploadInfo.s3_key,
1197
- media_type: mediaType,
1198
- filename
1199
- });
1200
- continue;
1201
- }
1202
- }
1203
- processed.push(part);
1204
- }
1205
- return processed;
1206
- }
1207
- /**
1208
- * Get a presigned URL for uploading large files to S3.
1209
- */
1210
- async getUploadUrl(options) {
1211
- const response = await this._makeRequest("POST", "/v1/memories/upload", void 0, {
1212
- filename: options.filename,
1213
- content_type: options.content_type,
1214
- file_size: options.file_size
1215
- });
1216
- if (response.results) {
1217
- return response.results;
1218
- }
1219
- return response;
1220
- }
1221
- // ------------------------------------------------------------------
1222
- // Device Memory
1223
- // ------------------------------------------------------------------
1224
- /**
1225
- * Export a collection's full graph state as a portable snapshot.
1226
- */
1227
- async exportSnapshot(collectionId) {
1228
- const response = await this._makeRequest("POST", "/v1/device-memory/snapshot/export", {
1229
- collection_id: collectionId
1230
- });
1231
- return response.results ?? response;
1232
- }
1233
- /**
1234
- * Import a snapshot into an ephemeral server-side collection.
1235
- * @returns The ephemeral collection ID.
1236
- */
1237
- async importSnapshot(snapshot) {
1238
- const response = await this._makeRequest("POST", "/v1/device-memory/snapshot/import", {
1239
- snapshot
1240
- });
1241
- const result = response.results ?? response;
1242
- return result.ephemeral_collection_id ?? "";
1243
- }
1244
- };
1245
- // Files larger than 5MB are automatically uploaded to S3
1246
- _Nebula.MAX_INLINE_SIZE = 5 * 1024 * 1024;
1247
- var Nebula = _Nebula;
1248
-
1249
- // src/content.ts
1250
- var MIME_TYPES = {
1251
- // Images
1252
- ".jpg": "image/jpeg",
1253
- ".jpeg": "image/jpeg",
1254
- ".png": "image/png",
1255
- ".gif": "image/gif",
1256
- ".webp": "image/webp",
1257
- ".heic": "image/heic",
1258
- ".bmp": "image/bmp",
1259
- ".tiff": "image/tiff",
1260
- // Audio
1261
- ".mp3": "audio/mpeg",
1262
- ".wav": "audio/wav",
1263
- ".m4a": "audio/m4a",
1264
- ".ogg": "audio/ogg",
1265
- ".flac": "audio/flac",
1266
- ".aac": "audio/aac",
1267
- ".webm": "audio/webm",
1268
- // Documents
1269
- ".pdf": "application/pdf",
1270
- ".doc": "application/msword",
1271
- ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1272
- ".xls": "application/vnd.ms-excel",
1273
- ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1274
- ".ppt": "application/vnd.ms-powerpoint",
1275
- ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
1276
- ".txt": "text/plain",
1277
- ".csv": "text/csv",
1278
- ".rtf": "application/rtf",
1279
- ".epub": "application/epub+zip"
1280
- };
1281
- var NebulaContent = class {
1282
- /**
1283
- * Create a FileContentPart from a file path.
1284
- * Automatically deduces media_type and the backend 'type' (image, audio, document).
1285
- */
1286
- static async fromFile(filePath, mediaType) {
1287
- let fs;
1288
- let path;
1289
- try {
1290
- fs = await import('fs/promises');
1291
- path = await import('path');
1292
- } catch (e) {
1293
- throw new Error("File system operations are only supported in Node.js environments.");
1294
- }
1295
- const absolutePath = path.resolve(filePath);
1296
- const fileName = path.basename(absolutePath);
1297
- const ext = path.extname(absolutePath).toLowerCase();
1298
- const detectedMime = mediaType || MIME_TYPES[ext] || "application/octet-stream";
1299
- const buffer = await fs.readFile(absolutePath);
1300
- const data = buffer.toString("base64");
1301
- return {
1302
- data,
1303
- media_type: detectedMime,
1304
- filename: fileName
1305
- };
1306
- }
1307
- };
1308
-
1309
- // src/index.ts
1310
- var MemoryBase = (data) => data;
1311
- var Memory2 = Object.assign(MemoryBase, {
1312
- /**
1313
- * Helper to create a file content part from a file path.
1314
- * Alias for NebulaContent.fromFile().
1315
- */
1316
- File: NebulaContent.fromFile,
1317
- /**
1318
- * Helper to create a complete Memory object from a single file.
1319
- */
1320
- async fromFile(filePath, collection_id, metadata, role) {
1321
- const path = await import('path');
1322
- const filename = path.basename(filePath);
1323
- return {
1324
- collection_id,
1325
- content: [await NebulaContent.fromFile(filePath)],
1326
- metadata: { filename, ...metadata },
1327
- role
1328
- };
1329
- }
1330
- });
1331
-
1332
- exports.GraphSearchResultType = GraphSearchResultType;
1333
- exports.Memory = Memory2;
1334
- exports.Nebula = Nebula;
1335
- exports.NebulaAuthenticationException = NebulaAuthenticationException;
1336
- exports.NebulaClientException = NebulaClientException;
1337
- exports.NebulaCollectionNotFoundException = NebulaCollectionNotFoundException;
1338
- exports.NebulaContent = NebulaContent;
1339
- exports.NebulaException = NebulaException;
1340
- exports.NebulaNotFoundException = NebulaNotFoundException;
1341
- exports.NebulaRateLimitException = NebulaRateLimitException;
1342
- exports.NebulaValidationException = NebulaValidationException;
1343
- exports.default = Nebula;
1344
- //# sourceMappingURL=index.js.map
1345
- //# sourceMappingURL=index.js.map