@nebula-ai/sdk 1.3.0 → 1.4.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/LICENSE +18 -4
  2. package/README.md +42 -346
  3. package/dist/index.cjs +1268 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +2824 -0
  6. package/dist/index.d.ts +2824 -0
  7. package/dist/index.js +1244 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +40 -141
  10. package/CHANGELOG.md +0 -35
  11. package/api-promise.d.mts +0 -2
  12. package/api-promise.d.mts.map +0 -1
  13. package/api-promise.d.ts +0 -2
  14. package/api-promise.d.ts.map +0 -1
  15. package/api-promise.js +0 -6
  16. package/api-promise.js.map +0 -1
  17. package/api-promise.mjs +0 -2
  18. package/api-promise.mjs.map +0 -1
  19. package/client.d.mts +0 -205
  20. package/client.d.mts.map +0 -1
  21. package/client.d.ts +0 -205
  22. package/client.d.ts.map +0 -1
  23. package/client.js +0 -505
  24. package/client.js.map +0 -1
  25. package/client.mjs +0 -501
  26. package/client.mjs.map +0 -1
  27. package/core/api-promise.d.mts +0 -46
  28. package/core/api-promise.d.mts.map +0 -1
  29. package/core/api-promise.d.ts +0 -46
  30. package/core/api-promise.d.ts.map +0 -1
  31. package/core/api-promise.js +0 -74
  32. package/core/api-promise.js.map +0 -1
  33. package/core/api-promise.mjs +0 -70
  34. package/core/api-promise.mjs.map +0 -1
  35. package/core/error.d.mts +0 -46
  36. package/core/error.d.mts.map +0 -1
  37. package/core/error.d.ts +0 -46
  38. package/core/error.d.ts.map +0 -1
  39. package/core/error.js +0 -113
  40. package/core/error.js.map +0 -1
  41. package/core/error.mjs +0 -97
  42. package/core/error.mjs.map +0 -1
  43. package/core/resource.d.mts +0 -6
  44. package/core/resource.d.mts.map +0 -1
  45. package/core/resource.d.ts +0 -6
  46. package/core/resource.d.ts.map +0 -1
  47. package/core/resource.js +0 -11
  48. package/core/resource.js.map +0 -1
  49. package/core/resource.mjs +0 -7
  50. package/core/resource.mjs.map +0 -1
  51. package/core/uploads.d.mts +0 -3
  52. package/core/uploads.d.mts.map +0 -1
  53. package/core/uploads.d.ts +0 -3
  54. package/core/uploads.d.ts.map +0 -1
  55. package/core/uploads.js +0 -6
  56. package/core/uploads.js.map +0 -1
  57. package/core/uploads.mjs +0 -2
  58. package/core/uploads.mjs.map +0 -1
  59. package/error.d.mts +0 -2
  60. package/error.d.mts.map +0 -1
  61. package/error.d.ts +0 -2
  62. package/error.d.ts.map +0 -1
  63. package/error.js +0 -6
  64. package/error.js.map +0 -1
  65. package/error.mjs +0 -2
  66. package/error.mjs.map +0 -1
  67. package/index.d.mts +0 -13
  68. package/index.d.mts.map +0 -1
  69. package/index.d.ts +0 -13
  70. package/index.d.ts.map +0 -1
  71. package/index.js +0 -43
  72. package/index.js.map +0 -1
  73. package/index.mjs +0 -13
  74. package/index.mjs.map +0 -1
  75. package/internal/builtin-types.d.mts +0 -73
  76. package/internal/builtin-types.d.mts.map +0 -1
  77. package/internal/builtin-types.d.ts +0 -73
  78. package/internal/builtin-types.d.ts.map +0 -1
  79. package/internal/builtin-types.js +0 -4
  80. package/internal/builtin-types.js.map +0 -1
  81. package/internal/builtin-types.mjs +0 -3
  82. package/internal/builtin-types.mjs.map +0 -1
  83. package/internal/detect-platform.d.mts +0 -15
  84. package/internal/detect-platform.d.mts.map +0 -1
  85. package/internal/detect-platform.d.ts +0 -15
  86. package/internal/detect-platform.d.ts.map +0 -1
  87. package/internal/detect-platform.js +0 -162
  88. package/internal/detect-platform.js.map +0 -1
  89. package/internal/detect-platform.mjs +0 -157
  90. package/internal/detect-platform.mjs.map +0 -1
  91. package/internal/errors.d.mts +0 -3
  92. package/internal/errors.d.mts.map +0 -1
  93. package/internal/errors.d.ts +0 -3
  94. package/internal/errors.d.ts.map +0 -1
  95. package/internal/errors.js +0 -41
  96. package/internal/errors.js.map +0 -1
  97. package/internal/errors.mjs +0 -36
  98. package/internal/errors.mjs.map +0 -1
  99. package/internal/headers.d.mts +0 -20
  100. package/internal/headers.d.mts.map +0 -1
  101. package/internal/headers.d.ts +0 -20
  102. package/internal/headers.d.ts.map +0 -1
  103. package/internal/headers.js +0 -79
  104. package/internal/headers.js.map +0 -1
  105. package/internal/headers.mjs +0 -74
  106. package/internal/headers.mjs.map +0 -1
  107. package/internal/parse.d.mts +0 -12
  108. package/internal/parse.d.mts.map +0 -1
  109. package/internal/parse.d.ts +0 -12
  110. package/internal/parse.d.ts.map +0 -1
  111. package/internal/parse.js +0 -40
  112. package/internal/parse.js.map +0 -1
  113. package/internal/parse.mjs +0 -37
  114. package/internal/parse.mjs.map +0 -1
  115. package/internal/qs/formats.d.mts +0 -7
  116. package/internal/qs/formats.d.mts.map +0 -1
  117. package/internal/qs/formats.d.ts +0 -7
  118. package/internal/qs/formats.d.ts.map +0 -1
  119. package/internal/qs/formats.js +0 -13
  120. package/internal/qs/formats.js.map +0 -1
  121. package/internal/qs/formats.mjs +0 -9
  122. package/internal/qs/formats.mjs.map +0 -1
  123. package/internal/qs/index.d.mts +0 -10
  124. package/internal/qs/index.d.mts.map +0 -1
  125. package/internal/qs/index.d.ts +0 -10
  126. package/internal/qs/index.d.ts.map +0 -1
  127. package/internal/qs/index.js +0 -14
  128. package/internal/qs/index.js.map +0 -1
  129. package/internal/qs/index.mjs +0 -10
  130. package/internal/qs/index.mjs.map +0 -1
  131. package/internal/qs/stringify.d.mts +0 -3
  132. package/internal/qs/stringify.d.mts.map +0 -1
  133. package/internal/qs/stringify.d.ts +0 -3
  134. package/internal/qs/stringify.d.ts.map +0 -1
  135. package/internal/qs/stringify.js +0 -277
  136. package/internal/qs/stringify.js.map +0 -1
  137. package/internal/qs/stringify.mjs +0 -274
  138. package/internal/qs/stringify.mjs.map +0 -1
  139. package/internal/qs/types.d.mts +0 -57
  140. package/internal/qs/types.d.mts.map +0 -1
  141. package/internal/qs/types.d.ts +0 -57
  142. package/internal/qs/types.d.ts.map +0 -1
  143. package/internal/qs/types.js +0 -3
  144. package/internal/qs/types.js.map +0 -1
  145. package/internal/qs/types.mjs +0 -2
  146. package/internal/qs/types.mjs.map +0 -1
  147. package/internal/qs/utils.d.mts +0 -15
  148. package/internal/qs/utils.d.mts.map +0 -1
  149. package/internal/qs/utils.d.ts +0 -15
  150. package/internal/qs/utils.d.ts.map +0 -1
  151. package/internal/qs/utils.js +0 -230
  152. package/internal/qs/utils.js.map +0 -1
  153. package/internal/qs/utils.mjs +0 -217
  154. package/internal/qs/utils.mjs.map +0 -1
  155. package/internal/request-options.d.mts +0 -79
  156. package/internal/request-options.d.mts.map +0 -1
  157. package/internal/request-options.d.ts +0 -79
  158. package/internal/request-options.d.ts.map +0 -1
  159. package/internal/request-options.js +0 -14
  160. package/internal/request-options.js.map +0 -1
  161. package/internal/request-options.mjs +0 -10
  162. package/internal/request-options.mjs.map +0 -1
  163. package/internal/shim-types.d.mts +0 -17
  164. package/internal/shim-types.d.mts.map +0 -1
  165. package/internal/shim-types.d.ts +0 -17
  166. package/internal/shim-types.d.ts.map +0 -1
  167. package/internal/shim-types.js +0 -4
  168. package/internal/shim-types.js.map +0 -1
  169. package/internal/shim-types.mjs +0 -3
  170. package/internal/shim-types.mjs.map +0 -1
  171. package/internal/shims.d.mts +0 -20
  172. package/internal/shims.d.mts.map +0 -1
  173. package/internal/shims.d.ts +0 -20
  174. package/internal/shims.d.ts.map +0 -1
  175. package/internal/shims.js +0 -92
  176. package/internal/shims.js.map +0 -1
  177. package/internal/shims.mjs +0 -85
  178. package/internal/shims.mjs.map +0 -1
  179. package/internal/to-file.d.mts +0 -45
  180. package/internal/to-file.d.mts.map +0 -1
  181. package/internal/to-file.d.ts +0 -45
  182. package/internal/to-file.d.ts.map +0 -1
  183. package/internal/to-file.js +0 -91
  184. package/internal/to-file.js.map +0 -1
  185. package/internal/to-file.mjs +0 -88
  186. package/internal/to-file.mjs.map +0 -1
  187. package/internal/tslib.js +0 -81
  188. package/internal/tslib.mjs +0 -17
  189. package/internal/types.d.mts +0 -69
  190. package/internal/types.d.mts.map +0 -1
  191. package/internal/types.d.ts +0 -69
  192. package/internal/types.d.ts.map +0 -1
  193. package/internal/types.js +0 -4
  194. package/internal/types.js.map +0 -1
  195. package/internal/types.mjs +0 -3
  196. package/internal/types.mjs.map +0 -1
  197. package/internal/uploads.d.mts +0 -42
  198. package/internal/uploads.d.mts.map +0 -1
  199. package/internal/uploads.d.ts +0 -42
  200. package/internal/uploads.d.ts.map +0 -1
  201. package/internal/uploads.js +0 -141
  202. package/internal/uploads.js.map +0 -1
  203. package/internal/uploads.mjs +0 -131
  204. package/internal/uploads.mjs.map +0 -1
  205. package/internal/utils/base64.d.mts +0 -3
  206. package/internal/utils/base64.d.mts.map +0 -1
  207. package/internal/utils/base64.d.ts +0 -3
  208. package/internal/utils/base64.d.ts.map +0 -1
  209. package/internal/utils/base64.js +0 -38
  210. package/internal/utils/base64.js.map +0 -1
  211. package/internal/utils/base64.mjs +0 -33
  212. package/internal/utils/base64.mjs.map +0 -1
  213. package/internal/utils/bytes.d.mts +0 -4
  214. package/internal/utils/bytes.d.mts.map +0 -1
  215. package/internal/utils/bytes.d.ts +0 -4
  216. package/internal/utils/bytes.d.ts.map +0 -1
  217. package/internal/utils/bytes.js +0 -31
  218. package/internal/utils/bytes.js.map +0 -1
  219. package/internal/utils/bytes.mjs +0 -26
  220. package/internal/utils/bytes.mjs.map +0 -1
  221. package/internal/utils/env.d.mts +0 -9
  222. package/internal/utils/env.d.mts.map +0 -1
  223. package/internal/utils/env.d.ts +0 -9
  224. package/internal/utils/env.d.ts.map +0 -1
  225. package/internal/utils/env.js +0 -22
  226. package/internal/utils/env.js.map +0 -1
  227. package/internal/utils/env.mjs +0 -18
  228. package/internal/utils/env.mjs.map +0 -1
  229. package/internal/utils/log.d.mts +0 -37
  230. package/internal/utils/log.d.mts.map +0 -1
  231. package/internal/utils/log.d.ts +0 -37
  232. package/internal/utils/log.d.ts.map +0 -1
  233. package/internal/utils/log.js +0 -86
  234. package/internal/utils/log.js.map +0 -1
  235. package/internal/utils/log.mjs +0 -80
  236. package/internal/utils/log.mjs.map +0 -1
  237. package/internal/utils/path.d.mts +0 -15
  238. package/internal/utils/path.d.mts.map +0 -1
  239. package/internal/utils/path.d.ts +0 -15
  240. package/internal/utils/path.d.ts.map +0 -1
  241. package/internal/utils/path.js +0 -79
  242. package/internal/utils/path.js.map +0 -1
  243. package/internal/utils/path.mjs +0 -74
  244. package/internal/utils/path.mjs.map +0 -1
  245. package/internal/utils/query.d.mts +0 -2
  246. package/internal/utils/query.d.mts.map +0 -1
  247. package/internal/utils/query.d.ts +0 -2
  248. package/internal/utils/query.d.ts.map +0 -1
  249. package/internal/utils/query.js +0 -10
  250. package/internal/utils/query.js.map +0 -1
  251. package/internal/utils/query.mjs +0 -6
  252. package/internal/utils/query.mjs.map +0 -1
  253. package/internal/utils/sleep.d.mts +0 -2
  254. package/internal/utils/sleep.d.mts.map +0 -1
  255. package/internal/utils/sleep.d.ts +0 -2
  256. package/internal/utils/sleep.d.ts.map +0 -1
  257. package/internal/utils/sleep.js +0 -7
  258. package/internal/utils/sleep.js.map +0 -1
  259. package/internal/utils/sleep.mjs +0 -3
  260. package/internal/utils/sleep.mjs.map +0 -1
  261. package/internal/utils/uuid.d.mts +0 -5
  262. package/internal/utils/uuid.d.mts.map +0 -1
  263. package/internal/utils/uuid.d.ts +0 -5
  264. package/internal/utils/uuid.d.ts.map +0 -1
  265. package/internal/utils/uuid.js +0 -19
  266. package/internal/utils/uuid.js.map +0 -1
  267. package/internal/utils/uuid.mjs +0 -15
  268. package/internal/utils/uuid.mjs.map +0 -1
  269. package/internal/utils/values.d.mts +0 -18
  270. package/internal/utils/values.d.mts.map +0 -1
  271. package/internal/utils/values.d.ts +0 -18
  272. package/internal/utils/values.d.ts.map +0 -1
  273. package/internal/utils/values.js +0 -112
  274. package/internal/utils/values.js.map +0 -1
  275. package/internal/utils/values.mjs +0 -94
  276. package/internal/utils/values.mjs.map +0 -1
  277. package/internal/utils.d.mts +0 -8
  278. package/internal/utils.d.mts.map +0 -1
  279. package/internal/utils.d.ts +0 -8
  280. package/internal/utils.d.ts.map +0 -1
  281. package/internal/utils.js +0 -12
  282. package/internal/utils.js.map +0 -1
  283. package/internal/utils.mjs +0 -9
  284. package/internal/utils.mjs.map +0 -1
  285. package/lib/dx.d.mts +0 -96
  286. package/lib/dx.d.mts.map +0 -1
  287. package/lib/dx.d.ts +0 -96
  288. package/lib/dx.d.ts.map +0 -1
  289. package/lib/dx.js +0 -239
  290. package/lib/dx.js.map +0 -1
  291. package/lib/dx.mjs +0 -235
  292. package/lib/dx.mjs.map +0 -1
  293. package/resource.d.mts +0 -2
  294. package/resource.d.mts.map +0 -1
  295. package/resource.d.ts +0 -2
  296. package/resource.d.ts.map +0 -1
  297. package/resource.js +0 -6
  298. package/resource.js.map +0 -1
  299. package/resource.mjs +0 -2
  300. package/resource.mjs.map +0 -1
  301. package/resources/collections.d.mts +0 -289
  302. package/resources/collections.d.mts.map +0 -1
  303. package/resources/collections.d.ts +0 -289
  304. package/resources/collections.d.ts.map +0 -1
  305. package/resources/collections.js +0 -72
  306. package/resources/collections.js.map +0 -1
  307. package/resources/collections.mjs +0 -68
  308. package/resources/collections.mjs.map +0 -1
  309. package/resources/connectors.d.mts +0 -148
  310. package/resources/connectors.d.mts.map +0 -1
  311. package/resources/connectors.d.ts +0 -148
  312. package/resources/connectors.d.ts.map +0 -1
  313. package/resources/connectors.js +0 -50
  314. package/resources/connectors.js.map +0 -1
  315. package/resources/connectors.mjs +0 -46
  316. package/resources/connectors.mjs.map +0 -1
  317. package/resources/index.d.mts +0 -6
  318. package/resources/index.d.mts.map +0 -1
  319. package/resources/index.d.ts +0 -6
  320. package/resources/index.d.ts.map +0 -1
  321. package/resources/index.js +0 -13
  322. package/resources/index.js.map +0 -1
  323. package/resources/index.mjs +0 -6
  324. package/resources/index.mjs.map +0 -1
  325. package/resources/memories.d.mts +0 -1737
  326. package/resources/memories.d.mts.map +0 -1
  327. package/resources/memories.d.ts +0 -1737
  328. package/resources/memories.d.ts.map +0 -1
  329. package/resources/memories.js +0 -157
  330. package/resources/memories.js.map +0 -1
  331. package/resources/memories.mjs +0 -153
  332. package/resources/memories.mjs.map +0 -1
  333. package/resources/snapshots.d.mts +0 -281
  334. package/resources/snapshots.d.mts.map +0 -1
  335. package/resources/snapshots.d.ts +0 -281
  336. package/resources/snapshots.d.ts.map +0 -1
  337. package/resources/snapshots.js +0 -22
  338. package/resources/snapshots.js.map +0 -1
  339. package/resources/snapshots.mjs +0 -18
  340. package/resources/snapshots.mjs.map +0 -1
  341. package/resources/top-level.d.mts +0 -14
  342. package/resources/top-level.d.mts.map +0 -1
  343. package/resources/top-level.d.ts +0 -14
  344. package/resources/top-level.d.ts.map +0 -1
  345. package/resources/top-level.js +0 -4
  346. package/resources/top-level.js.map +0 -1
  347. package/resources/top-level.mjs +0 -3
  348. package/resources/top-level.mjs.map +0 -1
  349. package/resources.d.mts +0 -2
  350. package/resources.d.mts.map +0 -1
  351. package/resources.d.ts +0 -2
  352. package/resources.d.ts.map +0 -1
  353. package/resources.js +0 -5
  354. package/resources.js.map +0 -1
  355. package/resources.mjs +0 -2
  356. package/resources.mjs.map +0 -1
  357. package/src/api-promise.ts +0 -2
  358. package/src/client.ts +0 -892
  359. package/src/core/README.md +0 -3
  360. package/src/core/api-promise.ts +0 -92
  361. package/src/core/error.ts +0 -130
  362. package/src/core/resource.ts +0 -11
  363. package/src/core/uploads.ts +0 -2
  364. package/src/error.ts +0 -2
  365. package/src/index.ts +0 -36
  366. package/src/internal/README.md +0 -3
  367. package/src/internal/builtin-types.ts +0 -93
  368. package/src/internal/detect-platform.ts +0 -196
  369. package/src/internal/errors.ts +0 -33
  370. package/src/internal/headers.ts +0 -97
  371. package/src/internal/parse.ts +0 -56
  372. package/src/internal/qs/LICENSE.md +0 -13
  373. package/src/internal/qs/README.md +0 -3
  374. package/src/internal/qs/formats.ts +0 -10
  375. package/src/internal/qs/index.ts +0 -13
  376. package/src/internal/qs/stringify.ts +0 -385
  377. package/src/internal/qs/types.ts +0 -71
  378. package/src/internal/qs/utils.ts +0 -265
  379. package/src/internal/request-options.ts +0 -93
  380. package/src/internal/shim-types.ts +0 -26
  381. package/src/internal/shims.ts +0 -107
  382. package/src/internal/to-file.ts +0 -154
  383. package/src/internal/types.ts +0 -95
  384. package/src/internal/uploads.ts +0 -187
  385. package/src/internal/utils/base64.ts +0 -40
  386. package/src/internal/utils/bytes.ts +0 -32
  387. package/src/internal/utils/env.ts +0 -18
  388. package/src/internal/utils/log.ts +0 -127
  389. package/src/internal/utils/path.ts +0 -88
  390. package/src/internal/utils/query.ts +0 -7
  391. package/src/internal/utils/sleep.ts +0 -3
  392. package/src/internal/utils/uuid.ts +0 -17
  393. package/src/internal/utils/values.ts +0 -105
  394. package/src/internal/utils.ts +0 -9
  395. package/src/lib/.keep +0 -4
  396. package/src/lib/dx.ts +0 -459
  397. package/src/resource.ts +0 -2
  398. package/src/resources/collections.ts +0 -474
  399. package/src/resources/connectors.ts +0 -236
  400. package/src/resources/index.ts +0 -56
  401. package/src/resources/memories.ts +0 -2409
  402. package/src/resources/snapshots.ts +0 -387
  403. package/src/resources/top-level.ts +0 -19
  404. package/src/resources.ts +0 -1
  405. package/src/tsconfig.json +0 -11
  406. package/src/uploads.ts +0 -2
  407. package/src/version.ts +0 -1
  408. package/uploads.d.mts +0 -2
  409. package/uploads.d.mts.map +0 -1
  410. package/uploads.d.ts +0 -2
  411. package/uploads.d.ts.map +0 -1
  412. package/uploads.js +0 -6
  413. package/uploads.js.map +0 -1
  414. package/uploads.mjs +0 -2
  415. package/uploads.mjs.map +0 -1
  416. package/version.d.mts +0 -2
  417. package/version.d.mts.map +0 -1
  418. package/version.d.ts +0 -2
  419. package/version.d.ts.map +0 -1
  420. package/version.js +0 -5
  421. package/version.js.map +0 -1
  422. package/version.mjs +0 -2
  423. package/version.mjs.map +0 -1
package/LICENSE CHANGED
@@ -1,7 +1,21 @@
1
- Copyright 2026 nebula
1
+ MIT License
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Copyright (c) 2026 Nebula
4
4
 
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
6
11
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,371 +1,67 @@
1
- # Nebula TypeScript API Library
1
+ # @nebula-ai/sdk
2
2
 
3
- [![NPM version](<https://img.shields.io/npm/v/@nebula-ai/sdk.svg?label=npm%20(stable)>)](https://npmjs.org/package/@nebula-ai/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@nebula-ai/sdk)
3
+ Official Nebula API SDK for TypeScript. Provides typed access to the public
4
+ Nebula REST API: collections, memories, connectors, snapshots, and system
5
+ health.
4
6
 
5
- This library provides convenient access to the Nebula REST API from server-side TypeScript or JavaScript.
7
+ ## Install
6
8
 
7
- The REST API documentation can be found on [docs.trynebula.ai](https://docs.trynebula.ai). The full API of this library can be found in [api.md](api.md).
8
-
9
- It is generated with [Stainless](https://www.stainless.com/).
10
-
11
- ## Installation
12
-
13
- ```sh
9
+ ```bash
14
10
  npm install @nebula-ai/sdk
11
+ # or
12
+ bun add @nebula-ai/sdk
15
13
  ```
16
14
 
17
- ## Usage
18
-
19
- The full API of this library can be found in [api.md](api.md).
20
-
21
- <!-- prettier-ignore -->
22
- ```js
23
- import Nebula from '@nebula-ai/sdk';
24
-
25
- const client = new Nebula({
26
- accessToken: process.env['NEBULA_BEARER_TOKEN'], // This is the default and can be omitted
27
- });
28
-
29
- const collection = await client.collections.create({
30
- name: 'Example collection',
31
- description: 'Memory store for my app',
32
- });
33
-
34
- console.log(collection.results);
35
- ```
36
-
37
- ### Request & Response types
38
-
39
- This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
40
-
41
- <!-- prettier-ignore -->
42
- ```ts
43
- import Nebula from '@nebula-ai/sdk';
44
-
45
- const client = new Nebula({
46
- accessToken: process.env['NEBULA_BEARER_TOKEN'], // This is the default and can be omitted
47
- });
48
-
49
- const params: Nebula.CollectionCreateParams = {
50
- name: 'Example collection',
51
- description: 'Memory store for my app',
52
- };
53
- const collection: Nebula.CollectionCreateResponse = await client.collections.create(params);
54
- ```
55
-
56
- Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
57
-
58
- ## Handling errors
59
-
60
- When the library is unable to connect to the API,
61
- or if the API returns a non-success status code (i.e., 4xx or 5xx response),
62
- a subclass of `APIError` will be thrown:
63
-
64
- <!-- prettier-ignore -->
65
- ```ts
66
- const collection = await client.collections
67
- .create({ name: 'Example collection', description: 'Memory store for my app' })
68
- .catch(async (err) => {
69
- if (err instanceof Nebula.APIError) {
70
- console.log(err.status); // 400
71
- console.log(err.name); // BadRequestError
72
- console.log(err.headers); // {server: 'nginx', ...}
73
- } else {
74
- throw err;
75
- }
76
- });
77
- ```
78
-
79
- Error codes are as follows:
80
-
81
- | Status Code | Error Type |
82
- | ----------- | -------------------------- |
83
- | 400 | `BadRequestError` |
84
- | 401 | `AuthenticationError` |
85
- | 403 | `PermissionDeniedError` |
86
- | 404 | `NotFoundError` |
87
- | 422 | `UnprocessableEntityError` |
88
- | 429 | `RateLimitError` |
89
- | >=500 | `InternalServerError` |
90
- | N/A | `APIConnectionError` |
91
-
92
- ### Retries
93
-
94
- Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
95
- Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
96
- 429 Rate Limit, and >=500 Internal errors will all be retried by default.
97
-
98
- You can use the `maxRetries` option to configure or disable this:
99
-
100
- <!-- prettier-ignore -->
101
- ```js
102
- // Configure the default for all requests:
103
- const client = new Nebula({
104
- maxRetries: 0, // default is 2
105
- });
106
-
107
- // Or, configure per-request:
108
- await client.collections.create({ name: 'Example collection', description: 'Memory store for my app' }, {
109
- maxRetries: 5,
110
- });
111
- ```
112
-
113
- ### Timeouts
114
-
115
- Requests time out after 1 minute by default. You can configure this with a `timeout` option:
116
-
117
- <!-- prettier-ignore -->
118
- ```ts
119
- // Configure the default for all requests:
120
- const client = new Nebula({
121
- timeout: 20 * 1000, // 20 seconds (default is 1 minute)
122
- });
123
-
124
- // Override per-request:
125
- await client.collections.create({ name: 'Example collection', description: 'Memory store for my app' }, {
126
- timeout: 5 * 1000,
127
- });
128
- ```
129
-
130
- On timeout, an `APIConnectionTimeoutError` is thrown.
131
-
132
- Note that requests which time out will be [retried twice by default](#retries).
133
-
134
- ## Advanced Usage
135
-
136
- ### Accessing raw Response data (e.g., headers)
137
-
138
- The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
139
- This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
140
-
141
- You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
142
- Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
143
-
144
- <!-- prettier-ignore -->
145
- ```ts
146
- const client = new Nebula();
147
-
148
- const response = await client.collections
149
- .create({ name: 'Example collection', description: 'Memory store for my app' })
150
- .asResponse();
151
- console.log(response.headers.get('X-My-Header'));
152
- console.log(response.statusText); // access the underlying Response object
153
-
154
- const { data: collection, response: raw } = await client.collections
155
- .create({ name: 'Example collection', description: 'Memory store for my app' })
156
- .withResponse();
157
- console.log(raw.headers.get('X-My-Header'));
158
- console.log(collection.results);
159
- ```
160
-
161
- ### Logging
162
-
163
- > [!IMPORTANT]
164
- > All log messages are intended for debugging only. The format and content of log messages
165
- > may change between releases.
166
-
167
- #### Log levels
168
-
169
- The log level can be configured in two ways:
170
-
171
- 1. Via the `NEBULA_LOG` environment variable
172
- 2. Using the `logLevel` client option (overrides the environment variable if set)
173
-
174
- ```ts
175
- import Nebula from '@nebula-ai/sdk';
176
-
177
- const client = new Nebula({
178
- logLevel: 'debug', // Show all log messages
179
- });
180
- ```
181
-
182
- Available log levels, from most to least verbose:
183
-
184
- - `'debug'` - Show debug messages, info, warnings, and errors
185
- - `'info'` - Show info messages, warnings, and errors
186
- - `'warn'` - Show warnings and errors (default)
187
- - `'error'` - Show only errors
188
- - `'off'` - Disable all logging
189
-
190
- At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
191
- Some authentication-related headers are redacted, but sensitive data in request and response bodies
192
- may still be visible.
193
-
194
- #### Custom logger
195
-
196
- By default, this library logs to `globalThis.console`. You can also provide a custom logger.
197
- Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
198
-
199
- When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
200
- below the configured level will not be sent to your logger.
15
+ ## Quick start
201
16
 
202
17
  ```ts
203
- import Nebula from '@nebula-ai/sdk';
204
- import pino from 'pino';
205
-
206
- const logger = pino();
18
+ import { Nebula } from "@nebula-ai/sdk";
207
19
 
208
20
  const client = new Nebula({
209
- logger: logger.child({ name: 'Nebula' }),
210
- logLevel: 'debug', // Send all messages to pino, allowing it to filter
21
+ apiKey: process.env.NEBULA_API_KEY,
22
+ // or: bearerToken: process.env.NEBULA_BEARER_TOKEN,
211
23
  });
212
- ```
213
-
214
- ### Making custom/undocumented requests
215
24
 
216
- This library is typed for convenient access to the documented API. If you need to access undocumented
217
- endpoints, params, or response properties, the library can still be used.
218
-
219
- #### Undocumented endpoints
220
-
221
- To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
222
- Options on the client, such as retries, will be respected when making these requests.
223
-
224
- ```ts
225
- await client.post('/some/path', {
226
- body: { some_prop: 'foo' },
227
- query: { some_query_arg: 'bar' },
25
+ const id = await client.storeMemory({
26
+ collection_id: "01234567-...",
27
+ raw_text: "hello, world",
228
28
  });
229
- ```
230
29
 
231
- #### Undocumented request params
232
-
233
- To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
234
- parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
235
- send will be sent as-is.
236
-
237
- ```ts
238
- client.collections.create({
239
- // ...
240
- // @ts-expect-error baz is not yet public
241
- baz: 'undocumented option',
242
- });
30
+ const results = await client.search({ query: "hello" });
243
31
  ```
244
32
 
245
- For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
246
- extra param in the body.
247
-
248
- If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
249
- options.
250
-
251
- #### Undocumented response properties
252
-
253
- To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
254
- the response object, or cast the response object to the requisite type. Like the request params, we do not
255
- validate or strip extra properties from the response from the API.
256
-
257
- ### Customizing the fetch client
258
-
259
- By default, this library expects a global `fetch` function is defined.
260
-
261
- If you want to use a different `fetch` function, you can either polyfill the global:
262
-
263
- ```ts
264
- import fetch from 'my-fetch';
265
-
266
- globalThis.fetch = fetch;
267
- ```
268
-
269
- Or pass it to the client:
270
-
271
- ```ts
272
- import Nebula from '@nebula-ai/sdk';
273
- import fetch from 'my-fetch';
274
-
275
- const client = new Nebula({ fetch });
276
- ```
277
-
278
- ### Fetch options
279
-
280
- If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
281
-
282
- ```ts
283
- import Nebula from '@nebula-ai/sdk';
284
-
285
- const client = new Nebula({
286
- fetchOptions: {
287
- // `RequestInit` options
288
- },
289
- });
290
- ```
291
-
292
- #### Configuring proxies
293
-
294
- To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
295
- options to requests:
296
-
297
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
298
-
299
- ```ts
300
- import Nebula from '@nebula-ai/sdk';
301
- import * as undici from 'undici';
302
-
303
- const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
304
- const client = new Nebula({
305
- fetchOptions: {
306
- dispatcher: proxyAgent,
307
- },
308
- });
309
- ```
310
-
311
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
312
-
313
- ```ts
314
- import Nebula from '@nebula-ai/sdk';
315
-
316
- const client = new Nebula({
317
- fetchOptions: {
318
- proxy: 'http://localhost:8888',
319
- },
320
- });
321
- ```
322
-
323
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
324
-
325
- ```ts
326
- import Nebula from 'npm:@nebula-ai/sdk';
327
-
328
- const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
329
- const client = new Nebula({
330
- fetchOptions: {
331
- client: httpClient,
332
- },
333
- });
334
- ```
335
-
336
- ## Frequently Asked Questions
337
-
338
- ## Semantic versioning
339
-
340
- This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
341
-
342
- 1. Changes that only affect static types, without breaking runtime behavior.
343
- 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
344
- 3. Changes that we do not expect to impact the vast majority of users in practice.
345
-
346
- We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
33
+ The high-level methods (`storeMemory`, `search`, `deleteMemory`, ...) come
34
+ from the handwritten DX layer at `src/lib/dx.ts`. The low-level resource
35
+ clients (`client.memories.*`, `client.collections.*`, ...) are generated
36
+ directly from the OpenAPI spec and remain available as
37
+ `client.memories.create(...)`, `client.memories.search(...)`, etc.
347
38
 
348
- We are keen for your feedback; please open an [issue](https://www.github.com/nebula-agi/nebula-typescript/issues) with questions, bugs, or suggestions.
39
+ ## Auth
349
40
 
350
- ## Requirements
41
+ The constructor accepts both `apiKey` / `bearerToken` (camelCase) and the
42
+ snake_case aliases `api_key` / `access_token`. If you pass an API key that
43
+ doesn't look like a Nebula key (not prefixed with `key_` or `neb_`), the
44
+ DX layer automatically routes it through the bearer-token header instead.
351
45
 
352
- TypeScript >= 4.9 is supported.
46
+ ## Errors
353
47
 
354
- The following runtimes are supported:
48
+ All HTTP errors map to a typed exception hierarchy:
355
49
 
356
- - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
357
- - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
358
- - Deno v1.28.0 or higher.
359
- - Bun 1.0 or later.
360
- - Cloudflare Workers.
361
- - Vercel Edge Runtime.
362
- - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
363
- - Nitro v2.6 or greater.
50
+ - `NebulaBadRequestError` (400)
51
+ - `NebulaUnauthorizedError` (401)
52
+ - `NebulaForbiddenError` (403)
53
+ - `NebulaNotFoundError` (404)
54
+ - `NebulaConflictError` (409)
55
+ - `NebulaValidationError` (422)
56
+ - `NebulaRateLimitError` (429) carries `retryAfter` when the server returns `Retry-After`
57
+ - `NebulaServerError` (5xx)
58
+ - `NebulaConnectionError` / `NebulaTimeoutError` — transport-level
364
59
 
365
- Note that React Native is not supported at this time.
60
+ ## Docs
366
61
 
367
- If you are interested in other runtime environments, please open or upvote an issue on GitHub.
62
+ - API reference: https://docs.zeroset.com
63
+ - Migration notes: see `MIGRATION.md` in the source repo
368
64
 
369
- ## Contributing
65
+ ## License
370
66
 
371
- See [the contributing documentation](./CONTRIBUTING.md).
67
+ MIT