@loxtep/sdk 0.1.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 (460) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +274 -0
  3. package/dist/auth/index.d.ts +6 -0
  4. package/dist/auth/index.d.ts.map +1 -0
  5. package/dist/auth/index.js +4 -0
  6. package/dist/auth/index.js.map +1 -0
  7. package/dist/auth/jwt.d.ts +10 -0
  8. package/dist/auth/jwt.d.ts.map +1 -0
  9. package/dist/auth/jwt.js +24 -0
  10. package/dist/auth/jwt.js.map +1 -0
  11. package/dist/auth/login.d.ts +49 -0
  12. package/dist/auth/login.d.ts.map +1 -0
  13. package/dist/auth/login.js +131 -0
  14. package/dist/auth/login.js.map +1 -0
  15. package/dist/auth/token-manager.d.ts +30 -0
  16. package/dist/auth/token-manager.d.ts.map +1 -0
  17. package/dist/auth/token-manager.js +61 -0
  18. package/dist/auth/token-manager.js.map +1 -0
  19. package/dist/checkpoint/index.d.ts +6 -0
  20. package/dist/checkpoint/index.d.ts.map +1 -0
  21. package/dist/checkpoint/index.js +5 -0
  22. package/dist/checkpoint/index.js.map +1 -0
  23. package/dist/checkpoint/memory-store.d.ts +6 -0
  24. package/dist/checkpoint/memory-store.d.ts.map +1 -0
  25. package/dist/checkpoint/memory-store.js +16 -0
  26. package/dist/checkpoint/memory-store.js.map +1 -0
  27. package/dist/checkpoint/types.d.ts +14 -0
  28. package/dist/checkpoint/types.d.ts.map +1 -0
  29. package/dist/checkpoint/types.js +5 -0
  30. package/dist/checkpoint/types.js.map +1 -0
  31. package/dist/cli/auth-resolve.d.ts +19 -0
  32. package/dist/cli/auth-resolve.d.ts.map +1 -0
  33. package/dist/cli/auth-resolve.js +25 -0
  34. package/dist/cli/auth-resolve.js.map +1 -0
  35. package/dist/cli/commands/bus-cmd.d.ts +6 -0
  36. package/dist/cli/commands/bus-cmd.d.ts.map +1 -0
  37. package/dist/cli/commands/bus-cmd.js +19 -0
  38. package/dist/cli/commands/bus-cmd.js.map +1 -0
  39. package/dist/cli/commands/config-cmd.d.ts +105 -0
  40. package/dist/cli/commands/config-cmd.d.ts.map +1 -0
  41. package/dist/cli/commands/config-cmd.js +334 -0
  42. package/dist/cli/commands/config-cmd.js.map +1 -0
  43. package/dist/cli/commands/connections-cmd.d.ts +19 -0
  44. package/dist/cli/commands/connections-cmd.d.ts.map +1 -0
  45. package/dist/cli/commands/connections-cmd.js +39 -0
  46. package/dist/cli/commands/connections-cmd.js.map +1 -0
  47. package/dist/cli/commands/data-assets-cmd.d.ts +12 -0
  48. package/dist/cli/commands/data-assets-cmd.d.ts.map +1 -0
  49. package/dist/cli/commands/data-assets-cmd.js +75 -0
  50. package/dist/cli/commands/data-assets-cmd.js.map +1 -0
  51. package/dist/cli/commands/data-contracts-cmd.d.ts +12 -0
  52. package/dist/cli/commands/data-contracts-cmd.d.ts.map +1 -0
  53. package/dist/cli/commands/data-contracts-cmd.js +28 -0
  54. package/dist/cli/commands/data-contracts-cmd.js.map +1 -0
  55. package/dist/cli/commands/data-products-cmd.d.ts +15 -0
  56. package/dist/cli/commands/data-products-cmd.d.ts.map +1 -0
  57. package/dist/cli/commands/data-products-cmd.js +30 -0
  58. package/dist/cli/commands/data-products-cmd.js.map +1 -0
  59. package/dist/cli/commands/domains-cmd.d.ts +12 -0
  60. package/dist/cli/commands/domains-cmd.d.ts.map +1 -0
  61. package/dist/cli/commands/domains-cmd.js +28 -0
  62. package/dist/cli/commands/domains-cmd.js.map +1 -0
  63. package/dist/cli/commands/flows-cmd.d.ts +19 -0
  64. package/dist/cli/commands/flows-cmd.d.ts.map +1 -0
  65. package/dist/cli/commands/flows-cmd.js +37 -0
  66. package/dist/cli/commands/flows-cmd.js.map +1 -0
  67. package/dist/cli/commands/login.d.ts +28 -0
  68. package/dist/cli/commands/login.d.ts.map +1 -0
  69. package/dist/cli/commands/login.js +110 -0
  70. package/dist/cli/commands/login.js.map +1 -0
  71. package/dist/cli/commands/logout.d.ts +5 -0
  72. package/dist/cli/commands/logout.d.ts.map +1 -0
  73. package/dist/cli/commands/logout.js +9 -0
  74. package/dist/cli/commands/logout.js.map +1 -0
  75. package/dist/cli/commands/metrics-cmd.d.ts +15 -0
  76. package/dist/cli/commands/metrics-cmd.d.ts.map +1 -0
  77. package/dist/cli/commands/metrics-cmd.js +21 -0
  78. package/dist/cli/commands/metrics-cmd.js.map +1 -0
  79. package/dist/cli/commands/observe-cmd.d.ts +10 -0
  80. package/dist/cli/commands/observe-cmd.d.ts.map +1 -0
  81. package/dist/cli/commands/observe-cmd.js +10 -0
  82. package/dist/cli/commands/observe-cmd.js.map +1 -0
  83. package/dist/cli/commands/pipelines-cmd.d.ts +17 -0
  84. package/dist/cli/commands/pipelines-cmd.d.ts.map +1 -0
  85. package/dist/cli/commands/pipelines-cmd.js +52 -0
  86. package/dist/cli/commands/pipelines-cmd.js.map +1 -0
  87. package/dist/cli/commands/promises-cmd.d.ts +11 -0
  88. package/dist/cli/commands/promises-cmd.d.ts.map +1 -0
  89. package/dist/cli/commands/promises-cmd.js +53 -0
  90. package/dist/cli/commands/promises-cmd.js.map +1 -0
  91. package/dist/cli/commands/queue-cmd.d.ts +13 -0
  92. package/dist/cli/commands/queue-cmd.d.ts.map +1 -0
  93. package/dist/cli/commands/queue-cmd.js +21 -0
  94. package/dist/cli/commands/queue-cmd.js.map +1 -0
  95. package/dist/cli/commands/standards-cmd.d.ts +12 -0
  96. package/dist/cli/commands/standards-cmd.d.ts.map +1 -0
  97. package/dist/cli/commands/standards-cmd.js +28 -0
  98. package/dist/cli/commands/standards-cmd.js.map +1 -0
  99. package/dist/cli/commands/whoami.d.ts +24 -0
  100. package/dist/cli/commands/whoami.d.ts.map +1 -0
  101. package/dist/cli/commands/whoami.js +46 -0
  102. package/dist/cli/commands/whoami.js.map +1 -0
  103. package/dist/cli/commands/workflows-cmd.d.ts +18 -0
  104. package/dist/cli/commands/workflows-cmd.d.ts.map +1 -0
  105. package/dist/cli/commands/workflows-cmd.js +32 -0
  106. package/dist/cli/commands/workflows-cmd.js.map +1 -0
  107. package/dist/cli/create-cli-client.d.ts +32 -0
  108. package/dist/cli/create-cli-client.d.ts.map +1 -0
  109. package/dist/cli/create-cli-client.js +143 -0
  110. package/dist/cli/create-cli-client.js.map +1 -0
  111. package/dist/cli/credentials.d.ts +25 -0
  112. package/dist/cli/credentials.d.ts.map +1 -0
  113. package/dist/cli/credentials.js +70 -0
  114. package/dist/cli/credentials.js.map +1 -0
  115. package/dist/cli/index.d.ts +8 -0
  116. package/dist/cli/index.d.ts.map +1 -0
  117. package/dist/cli/index.js +424 -0
  118. package/dist/cli/index.js.map +1 -0
  119. package/dist/client/catalog-types.d.ts +22 -0
  120. package/dist/client/catalog-types.d.ts.map +1 -0
  121. package/dist/client/catalog-types.js +5 -0
  122. package/dist/client/catalog-types.js.map +1 -0
  123. package/dist/client/catalog.d.ts +9 -0
  124. package/dist/client/catalog.d.ts.map +1 -0
  125. package/dist/client/catalog.js +29 -0
  126. package/dist/client/catalog.js.map +1 -0
  127. package/dist/client/connection-types.d.ts +98 -0
  128. package/dist/client/connection-types.d.ts.map +1 -0
  129. package/dist/client/connection-types.js +18 -0
  130. package/dist/client/connection-types.js.map +1 -0
  131. package/dist/client/connections.d.ts +18 -0
  132. package/dist/client/connections.d.ts.map +1 -0
  133. package/dist/client/connections.js +66 -0
  134. package/dist/client/connections.js.map +1 -0
  135. package/dist/client/connectors-types.d.ts +61 -0
  136. package/dist/client/connectors-types.d.ts.map +1 -0
  137. package/dist/client/connectors-types.js +6 -0
  138. package/dist/client/connectors-types.js.map +1 -0
  139. package/dist/client/connectors.d.ts +27 -0
  140. package/dist/client/connectors.d.ts.map +1 -0
  141. package/dist/client/connectors.js +71 -0
  142. package/dist/client/connectors.js.map +1 -0
  143. package/dist/client/consumptions-types.d.ts +80 -0
  144. package/dist/client/consumptions-types.d.ts.map +1 -0
  145. package/dist/client/consumptions-types.js +5 -0
  146. package/dist/client/consumptions-types.js.map +1 -0
  147. package/dist/client/consumptions.d.ts +14 -0
  148. package/dist/client/consumptions.d.ts.map +1 -0
  149. package/dist/client/consumptions.js +47 -0
  150. package/dist/client/consumptions.js.map +1 -0
  151. package/dist/client/data-assets-types.d.ts +150 -0
  152. package/dist/client/data-assets-types.d.ts.map +1 -0
  153. package/dist/client/data-assets-types.js +5 -0
  154. package/dist/client/data-assets-types.js.map +1 -0
  155. package/dist/client/data-assets.d.ts +31 -0
  156. package/dist/client/data-assets.d.ts.map +1 -0
  157. package/dist/client/data-assets.js +182 -0
  158. package/dist/client/data-assets.js.map +1 -0
  159. package/dist/client/data-product-resolver.d.ts +92 -0
  160. package/dist/client/data-product-resolver.d.ts.map +1 -0
  161. package/dist/client/data-product-resolver.js +165 -0
  162. package/dist/client/data-product-resolver.js.map +1 -0
  163. package/dist/client/data-products-types.d.ts +182 -0
  164. package/dist/client/data-products-types.d.ts.map +1 -0
  165. package/dist/client/data-products-types.js +5 -0
  166. package/dist/client/data-products-types.js.map +1 -0
  167. package/dist/client/data-products.d.ts +63 -0
  168. package/dist/client/data-products.d.ts.map +1 -0
  169. package/dist/client/data-products.js +461 -0
  170. package/dist/client/data-products.js.map +1 -0
  171. package/dist/client/discovery-types.d.ts +74 -0
  172. package/dist/client/discovery-types.d.ts.map +1 -0
  173. package/dist/client/discovery-types.js +6 -0
  174. package/dist/client/discovery-types.js.map +1 -0
  175. package/dist/client/discovery.d.ts +14 -0
  176. package/dist/client/discovery.d.ts.map +1 -0
  177. package/dist/client/discovery.js +57 -0
  178. package/dist/client/discovery.js.map +1 -0
  179. package/dist/client/domains-types.d.ts +46 -0
  180. package/dist/client/domains-types.d.ts.map +1 -0
  181. package/dist/client/domains-types.js +6 -0
  182. package/dist/client/domains-types.js.map +1 -0
  183. package/dist/client/domains.d.ts +11 -0
  184. package/dist/client/domains.d.ts.map +1 -0
  185. package/dist/client/domains.js +39 -0
  186. package/dist/client/domains.js.map +1 -0
  187. package/dist/client/flow-queue-resolve.d.ts +9 -0
  188. package/dist/client/flow-queue-resolve.d.ts.map +1 -0
  189. package/dist/client/flow-queue-resolve.js +17 -0
  190. package/dist/client/flow-queue-resolve.js.map +1 -0
  191. package/dist/client/flow-types.d.ts +112 -0
  192. package/dist/client/flow-types.d.ts.map +1 -0
  193. package/dist/client/flow-types.js +6 -0
  194. package/dist/client/flow-types.js.map +1 -0
  195. package/dist/client/flows.d.ts +33 -0
  196. package/dist/client/flows.d.ts.map +1 -0
  197. package/dist/client/flows.js +293 -0
  198. package/dist/client/flows.js.map +1 -0
  199. package/dist/client/index.d.ts +28 -0
  200. package/dist/client/index.d.ts.map +1 -0
  201. package/dist/client/index.js +3 -0
  202. package/dist/client/index.js.map +1 -0
  203. package/dist/client/instances-types.d.ts +40 -0
  204. package/dist/client/instances-types.d.ts.map +1 -0
  205. package/dist/client/instances-types.js +6 -0
  206. package/dist/client/instances-types.js.map +1 -0
  207. package/dist/client/instances.d.ts +29 -0
  208. package/dist/client/instances.d.ts.map +1 -0
  209. package/dist/client/instances.js +41 -0
  210. package/dist/client/instances.js.map +1 -0
  211. package/dist/client/loxtep-client.d.ts +111 -0
  212. package/dist/client/loxtep-client.d.ts.map +1 -0
  213. package/dist/client/loxtep-client.js +262 -0
  214. package/dist/client/loxtep-client.js.map +1 -0
  215. package/dist/client/observe-types.d.ts +17 -0
  216. package/dist/client/observe-types.d.ts.map +1 -0
  217. package/dist/client/observe-types.js +5 -0
  218. package/dist/client/observe-types.js.map +1 -0
  219. package/dist/client/observe.d.ts +15 -0
  220. package/dist/client/observe.d.ts.map +1 -0
  221. package/dist/client/observe.js +22 -0
  222. package/dist/client/observe.js.map +1 -0
  223. package/dist/client/pipelines-types.d.ts +3 -0
  224. package/dist/client/pipelines-types.d.ts.map +1 -0
  225. package/dist/client/pipelines-types.js +3 -0
  226. package/dist/client/pipelines-types.js.map +1 -0
  227. package/dist/client/pipelines.d.ts +3 -0
  228. package/dist/client/pipelines.d.ts.map +1 -0
  229. package/dist/client/pipelines.js +3 -0
  230. package/dist/client/pipelines.js.map +1 -0
  231. package/dist/client/procedures-types.d.ts +25 -0
  232. package/dist/client/procedures-types.d.ts.map +1 -0
  233. package/dist/client/procedures-types.js +6 -0
  234. package/dist/client/procedures-types.js.map +1 -0
  235. package/dist/client/procedures.d.ts +19 -0
  236. package/dist/client/procedures.d.ts.map +1 -0
  237. package/dist/client/procedures.js +33 -0
  238. package/dist/client/procedures.js.map +1 -0
  239. package/dist/client/process-intelligence-types.d.ts +45 -0
  240. package/dist/client/process-intelligence-types.d.ts.map +1 -0
  241. package/dist/client/process-intelligence-types.js +6 -0
  242. package/dist/client/process-intelligence-types.js.map +1 -0
  243. package/dist/client/process-intelligence.d.ts +17 -0
  244. package/dist/client/process-intelligence.d.ts.map +1 -0
  245. package/dist/client/process-intelligence.js +50 -0
  246. package/dist/client/process-intelligence.js.map +1 -0
  247. package/dist/client/projects-types.d.ts +79 -0
  248. package/dist/client/projects-types.d.ts.map +1 -0
  249. package/dist/client/projects-types.js +6 -0
  250. package/dist/client/projects-types.js.map +1 -0
  251. package/dist/client/projects.d.ts +19 -0
  252. package/dist/client/projects.d.ts.map +1 -0
  253. package/dist/client/projects.js +53 -0
  254. package/dist/client/projects.js.map +1 -0
  255. package/dist/client/promises-types.d.ts +56 -0
  256. package/dist/client/promises-types.d.ts.map +1 -0
  257. package/dist/client/promises-types.js +6 -0
  258. package/dist/client/promises-types.js.map +1 -0
  259. package/dist/client/promises.d.ts +11 -0
  260. package/dist/client/promises.d.ts.map +1 -0
  261. package/dist/client/promises.js +41 -0
  262. package/dist/client/promises.js.map +1 -0
  263. package/dist/client/quality-types.d.ts +62 -0
  264. package/dist/client/quality-types.d.ts.map +1 -0
  265. package/dist/client/quality-types.js +5 -0
  266. package/dist/client/quality-types.js.map +1 -0
  267. package/dist/client/quality.d.ts +12 -0
  268. package/dist/client/quality.d.ts.map +1 -0
  269. package/dist/client/quality.js +57 -0
  270. package/dist/client/quality.js.map +1 -0
  271. package/dist/client/queue-types.d.ts +84 -0
  272. package/dist/client/queue-types.d.ts.map +1 -0
  273. package/dist/client/queue-types.js +5 -0
  274. package/dist/client/queue-types.js.map +1 -0
  275. package/dist/client/queues.d.ts +61 -0
  276. package/dist/client/queues.d.ts.map +1 -0
  277. package/dist/client/queues.js +138 -0
  278. package/dist/client/queues.js.map +1 -0
  279. package/dist/client/schemas-types.d.ts +27 -0
  280. package/dist/client/schemas-types.d.ts.map +1 -0
  281. package/dist/client/schemas-types.js +5 -0
  282. package/dist/client/schemas-types.js.map +1 -0
  283. package/dist/client/schemas.d.ts +11 -0
  284. package/dist/client/schemas.d.ts.map +1 -0
  285. package/dist/client/schemas.js +22 -0
  286. package/dist/client/schemas.js.map +1 -0
  287. package/dist/client/standards-types.d.ts +45 -0
  288. package/dist/client/standards-types.d.ts.map +1 -0
  289. package/dist/client/standards-types.js +6 -0
  290. package/dist/client/standards-types.js.map +1 -0
  291. package/dist/client/standards.d.ts +11 -0
  292. package/dist/client/standards.d.ts.map +1 -0
  293. package/dist/client/standards.js +41 -0
  294. package/dist/client/standards.js.map +1 -0
  295. package/dist/client/stubs.d.ts +35 -0
  296. package/dist/client/stubs.d.ts.map +1 -0
  297. package/dist/client/stubs.js +30 -0
  298. package/dist/client/stubs.js.map +1 -0
  299. package/dist/client/templates-types.d.ts +70 -0
  300. package/dist/client/templates-types.d.ts.map +1 -0
  301. package/dist/client/templates-types.js +7 -0
  302. package/dist/client/templates-types.js.map +1 -0
  303. package/dist/client/templates.d.ts +12 -0
  304. package/dist/client/templates.d.ts.map +1 -0
  305. package/dist/client/templates.js +38 -0
  306. package/dist/client/templates.js.map +1 -0
  307. package/dist/client/thesaurus-types.d.ts +28 -0
  308. package/dist/client/thesaurus-types.d.ts.map +1 -0
  309. package/dist/client/thesaurus-types.js +5 -0
  310. package/dist/client/thesaurus-types.js.map +1 -0
  311. package/dist/client/thesaurus.d.ts +11 -0
  312. package/dist/client/thesaurus.d.ts.map +1 -0
  313. package/dist/client/thesaurus.js +35 -0
  314. package/dist/client/thesaurus.js.map +1 -0
  315. package/dist/client/types.d.ts +80 -0
  316. package/dist/client/types.d.ts.map +1 -0
  317. package/dist/client/types.js +2 -0
  318. package/dist/client/types.js.map +1 -0
  319. package/dist/client/versions-types.d.ts +47 -0
  320. package/dist/client/versions-types.d.ts.map +1 -0
  321. package/dist/client/versions-types.js +9 -0
  322. package/dist/client/versions-types.js.map +1 -0
  323. package/dist/client/versions.d.ts +14 -0
  324. package/dist/client/versions.d.ts.map +1 -0
  325. package/dist/client/versions.js +14 -0
  326. package/dist/client/versions.js.map +1 -0
  327. package/dist/client/workflows-types.d.ts +56 -0
  328. package/dist/client/workflows-types.d.ts.map +1 -0
  329. package/dist/client/workflows-types.js +6 -0
  330. package/dist/client/workflows-types.js.map +1 -0
  331. package/dist/client/workflows.d.ts +15 -0
  332. package/dist/client/workflows.d.ts.map +1 -0
  333. package/dist/client/workflows.js +50 -0
  334. package/dist/client/workflows.js.map +1 -0
  335. package/dist/config/api-path.d.ts +17 -0
  336. package/dist/config/api-path.d.ts.map +1 -0
  337. package/dist/config/api-path.js +57 -0
  338. package/dist/config/api-path.js.map +1 -0
  339. package/dist/config/index.d.ts +10 -0
  340. package/dist/config/index.d.ts.map +1 -0
  341. package/dist/config/index.js +9 -0
  342. package/dist/config/index.js.map +1 -0
  343. package/dist/config/load.d.ts +12 -0
  344. package/dist/config/load.d.ts.map +1 -0
  345. package/dist/config/load.js +152 -0
  346. package/dist/config/load.js.map +1 -0
  347. package/dist/config/paths.d.ts +5 -0
  348. package/dist/config/paths.d.ts.map +1 -0
  349. package/dist/config/paths.js +11 -0
  350. package/dist/config/paths.js.map +1 -0
  351. package/dist/config/platform-request-url.d.ts +35 -0
  352. package/dist/config/platform-request-url.d.ts.map +1 -0
  353. package/dist/config/platform-request-url.js +100 -0
  354. package/dist/config/platform-request-url.js.map +1 -0
  355. package/dist/config/resolve-sdk-urls.d.ts +39 -0
  356. package/dist/config/resolve-sdk-urls.d.ts.map +1 -0
  357. package/dist/config/resolve-sdk-urls.js +130 -0
  358. package/dist/config/resolve-sdk-urls.js.map +1 -0
  359. package/dist/config/save.d.ts +7 -0
  360. package/dist/config/save.d.ts.map +1 -0
  361. package/dist/config/save.js +26 -0
  362. package/dist/config/save.js.map +1 -0
  363. package/dist/config/streams-partial.d.ts +9 -0
  364. package/dist/config/streams-partial.d.ts.map +1 -0
  365. package/dist/config/streams-partial.js +30 -0
  366. package/dist/config/streams-partial.js.map +1 -0
  367. package/dist/config/types.d.ts +37 -0
  368. package/dist/config/types.d.ts.map +1 -0
  369. package/dist/config/types.js +11 -0
  370. package/dist/config/types.js.map +1 -0
  371. package/dist/errors/auth.d.ts +10 -0
  372. package/dist/errors/auth.d.ts.map +1 -0
  373. package/dist/errors/auth.js +26 -0
  374. package/dist/errors/auth.js.map +1 -0
  375. package/dist/errors/base.d.ts +15 -0
  376. package/dist/errors/base.d.ts.map +1 -0
  377. package/dist/errors/base.js +32 -0
  378. package/dist/errors/base.js.map +1 -0
  379. package/dist/errors/index.d.ts +15 -0
  380. package/dist/errors/index.d.ts.map +1 -0
  381. package/dist/errors/index.js +14 -0
  382. package/dist/errors/index.js.map +1 -0
  383. package/dist/errors/parse-http.d.ts +13 -0
  384. package/dist/errors/parse-http.d.ts.map +1 -0
  385. package/dist/errors/parse-http.js +68 -0
  386. package/dist/errors/parse-http.js.map +1 -0
  387. package/dist/errors/rate-limit.d.ts +17 -0
  388. package/dist/errors/rate-limit.d.ts.map +1 -0
  389. package/dist/errors/rate-limit.js +23 -0
  390. package/dist/errors/rate-limit.js.map +1 -0
  391. package/dist/errors/resource.d.ts +18 -0
  392. package/dist/errors/resource.d.ts.map +1 -0
  393. package/dist/errors/resource.js +32 -0
  394. package/dist/errors/resource.js.map +1 -0
  395. package/dist/errors/streaming.d.ts +19 -0
  396. package/dist/errors/streaming.d.ts.map +1 -0
  397. package/dist/errors/streaming.js +32 -0
  398. package/dist/errors/streaming.js.map +1 -0
  399. package/dist/errors/types.d.ts +44 -0
  400. package/dist/errors/types.d.ts.map +1 -0
  401. package/dist/errors/types.js +2 -0
  402. package/dist/errors/types.js.map +1 -0
  403. package/dist/errors/validation.d.ts +23 -0
  404. package/dist/errors/validation.d.ts.map +1 -0
  405. package/dist/errors/validation.js +37 -0
  406. package/dist/errors/validation.js.map +1 -0
  407. package/dist/http/client.d.ts +51 -0
  408. package/dist/http/client.d.ts.map +1 -0
  409. package/dist/http/client.js +164 -0
  410. package/dist/http/client.js.map +1 -0
  411. package/dist/http/index.d.ts +5 -0
  412. package/dist/http/index.d.ts.map +1 -0
  413. package/dist/http/index.js +3 -0
  414. package/dist/http/index.js.map +1 -0
  415. package/dist/http/signer.d.ts +15 -0
  416. package/dist/http/signer.d.ts.map +1 -0
  417. package/dist/http/signer.js +55 -0
  418. package/dist/http/signer.js.map +1 -0
  419. package/dist/index.d.ts +13 -0
  420. package/dist/index.d.ts.map +1 -0
  421. package/dist/index.js +13 -0
  422. package/dist/index.js.map +1 -0
  423. package/dist/rstreams/configuration.d.ts +11 -0
  424. package/dist/rstreams/configuration.d.ts.map +1 -0
  425. package/dist/rstreams/configuration.js +43 -0
  426. package/dist/rstreams/configuration.js.map +1 -0
  427. package/dist/rstreams/event-bridge.d.ts +16 -0
  428. package/dist/rstreams/event-bridge.d.ts.map +1 -0
  429. package/dist/rstreams/event-bridge.js +45 -0
  430. package/dist/rstreams/event-bridge.js.map +1 -0
  431. package/dist/rstreams/leo-runtime.d.ts +9 -0
  432. package/dist/rstreams/leo-runtime.d.ts.map +1 -0
  433. package/dist/rstreams/leo-runtime.js +14 -0
  434. package/dist/rstreams/leo-runtime.js.map +1 -0
  435. package/dist/streaming/index.d.ts +2 -0
  436. package/dist/streaming/index.d.ts.map +1 -0
  437. package/dist/streaming/index.js +2 -0
  438. package/dist/streaming/index.js.map +1 -0
  439. package/dist/streaming/transformer.d.ts +15 -0
  440. package/dist/streaming/transformer.d.ts.map +1 -0
  441. package/dist/streaming/transformer.js +25 -0
  442. package/dist/streaming/transformer.js.map +1 -0
  443. package/dist/types/generated-api.d.ts +146 -0
  444. package/dist/types/generated-api.d.ts.map +1 -0
  445. package/dist/types/generated-api.js +7 -0
  446. package/dist/types/generated-api.js.map +1 -0
  447. package/dist/types/index.d.ts +5 -0
  448. package/dist/types/index.d.ts.map +1 -0
  449. package/dist/types/index.js +5 -0
  450. package/dist/types/index.js.map +1 -0
  451. package/docs/event-replay-cookbook.md +152 -0
  452. package/docs/getting-started.md +332 -0
  453. package/docs/quick-reference.md +256 -0
  454. package/docs/sdk-bus-rbac-threat-model.md +46 -0
  455. package/docs/sdk-control-vs-data-plane.md +32 -0
  456. package/docs/sdk-ingestion-export-guide.md +480 -0
  457. package/docs/sdk-mcp-mapping.md +20 -0
  458. package/docs/sdk-pairing.md +42 -0
  459. package/docs/sdk-rest-vs-bus.md +131 -0
  460. package/package.json +85 -0
@@ -0,0 +1,480 @@
1
+ # SDK Ingestion and Export Architecture Guide
2
+
3
+ This guide explains how the Loxtep SDK enables programmatic data ingestion
4
+ (writing events) and export (reading events) through the platform's data mesh.
5
+ It covers the architecture, data flows, authentication, and error handling you
6
+ need to build reliable SDK-based pipelines.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Architecture Overview](#architecture-overview)
11
+ - [Key Concepts](#key-concepts)
12
+ - [Control Plane vs Data Plane](#control-plane-vs-data-plane)
13
+ - [Data Flow: Write Path (Ingestion)](#data-flow-write-path-ingestion)
14
+ - [Data Flow: Read Path (Export)](#data-flow-read-path-export)
15
+ - [Authentication](#authentication)
16
+ - [Error Handling](#error-handling)
17
+ - [Related Documentation](#related-documentation)
18
+
19
+ ---
20
+
21
+ ## Architecture Overview
22
+
23
+ The SDK connector loop connects five core entities:
24
+
25
+ | Entity | Role |
26
+ |--------|------|
27
+ | **SDK_Connector** | Organization-level connector record (`connector_type: "sdk"`) that provides configuration for the SDK client. No OAuth or API polling — just config. |
28
+ | **Trigger / Export** | Workflow-scoped nodes that reference an SDK_Connector by `connector_id`. A **Trigger** represents inbound data (writing events in), an **Export** represents outbound data (reading events out). |
29
+ | **Workflow** | A project-scoped graph of triggers, transformations, validations, and exports that defines how data moves through the platform. |
30
+ | **Data Product** | The published output of a workflow — a governed, discoverable dataset backed by one or more event queues. |
31
+ | **Stream_Bus** | The RStreams/Leo event bus (Kinesis, Firehose, DynamoDB) used by the SDK data plane for writing and reading events. |
32
+
33
+ ### How They Relate
34
+
35
+ ```mermaid
36
+ graph TB
37
+ subgraph "Control Plane (REST API)"
38
+ UI[Platform Frontend]
39
+ API[Connectors Microservice<br/>POST/GET /connectors]
40
+ MCP[Customer MCP Server<br/>loxtep_connectors]
41
+ DB[(PostgreSQL<br/>connectors table)]
42
+ S3T[(S3 Template Catalog<br/>sdk/connector.json)]
43
+ end
44
+
45
+ subgraph "Data Plane (Stream Bus)"
46
+ SDK_W[SDK Client<br/>FlowWriter]
47
+ SDK_R[SDK Client<br/>QueueReader]
48
+ KIN[Kinesis / Firehose]
49
+ Q[(Event Queue<br/>Data Product)]
50
+ end
51
+
52
+ UI -->|POST /connectors| API
53
+ MCP -->|POST /connectors| API
54
+ API -->|INSERT| DB
55
+ API -->|Load template| S3T
56
+ API -->|Return sdk_config| UI
57
+ API -->|Return sdk_config| MCP
58
+
59
+ SDK_W -->|putEvents via RStreams| KIN
60
+ KIN -->|Ingest| Q
61
+ SDK_R -->|offloadEvents via RStreams| Q
62
+
63
+ UI -.->|Copy config| SDK_W
64
+ MCP -.->|Provide config| SDK_W
65
+ ```
66
+
67
+ The **control plane** (left) handles connector creation, workflow management,
68
+ and configuration. The **data plane** (right) handles the actual event
69
+ read/write through the stream bus. The SDK client bridges both: it uses the
70
+ REST API to fetch configuration, then writes and reads events directly on the
71
+ stream bus.
72
+
73
+ ---
74
+
75
+ ## Key Concepts
76
+
77
+ ### SDK Connector
78
+
79
+ An SDK connector is fundamentally different from OAuth or API-key connectors:
80
+
81
+ - **No external credentials to test** — `POST /connectors/{id}/test` returns
82
+ `{ passed: true }` immediately.
83
+ - **No polling schedule or webhook endpoint** — the SDK client pushes and pulls
84
+ events on demand.
85
+ - **Metadata carries SDK config** — the connector's `metadata.sdk_config`
86
+ contains everything needed to bootstrap `LoxtepClient`:
87
+
88
+ ```json
89
+ {
90
+ "api_url": "https://api.loxtep.io",
91
+ "organization_id": "<uuid>",
92
+ "project_id": "<uuid>",
93
+ "instance_id": "<uuid>",
94
+ "region": "us-east-1"
95
+ }
96
+ ```
97
+
98
+ ### Trigger and Export Nodes
99
+
100
+ Workflow trigger and export nodes store `connector_id` and project-specific
101
+ config like `output_queue_name` and `bot_id`. These nodes live in S3 under
102
+ `workflows/{workflow_id}/triggers/{id}.json` or
103
+ `workflows/{workflow_id}/exports/{id}.json`.
104
+
105
+ **Trigger node** (inbound — writing events into the platform):
106
+
107
+ ```json
108
+ {
109
+ "id": "trigger-001",
110
+ "type": "sdk",
111
+ "connector_id": "<connector_uuid>",
112
+ "configuration": {
113
+ "output_queue_name": "my-ingestion-queue",
114
+ "bot_id": "my-writer-bot",
115
+ "instance_id": "<instance_uuid>",
116
+ "region": "us-east-1"
117
+ }
118
+ }
119
+ ```
120
+
121
+ **Export node** (outbound — reading events out of the platform):
122
+
123
+ ```json
124
+ {
125
+ "id": "export-001",
126
+ "type": "sdk",
127
+ "connector_id": "<connector_uuid>",
128
+ "configuration": {
129
+ "queue_name": "my-output-queue",
130
+ "bot_id": "my-reader-bot"
131
+ }
132
+ }
133
+ ```
134
+
135
+ ### FlowWriter and QueueReader
136
+
137
+ These are the SDK's data plane primitives:
138
+
139
+ - **FlowWriter** — buffers events and writes them in batches to the stream bus
140
+ via `putPayloadsToQueue()`. Supports configurable batch size, flush interval,
141
+ and retry with exponential backoff.
142
+ - **QueueReader** — reads events from a queue via `readQueueBatch()` and yields
143
+ them as an `AsyncIterable<QueueEvent>`.
144
+
145
+ ---
146
+
147
+ ## Control Plane vs Data Plane
148
+
149
+ The Loxtep platform separates concerns into two planes. Understanding this
150
+ distinction is essential for configuring the SDK correctly.
151
+
152
+ ### Control Plane (REST API)
153
+
154
+ The control plane handles all management operations through SigV4-signed HTTP
155
+ requests with a JWT token (`x-jwt-token` header).
156
+
157
+ | Operation | Endpoint | Description |
158
+ |-----------|----------|-------------|
159
+ | Create connector | `POST /connectors` | Create an SDK connector record |
160
+ | Get connector | `GET /connectors/{id}` | Retrieve connector with `sdk_config` |
161
+ | Test connector | `POST /connectors/{id}/test` | Always returns `{ passed: true }` for SDK |
162
+ | List connector types | `GET /connector-types` | Includes `"sdk"` when template is loaded |
163
+ | Deploy workflow | `POST /workflows/{id}/deploy` | Deploy a workflow graph |
164
+ | Query data products | `GET /data-products` | List and search data products |
165
+ | Replay events | `POST /data-products/{id}/replay` | Replay historical events over HTTP |
166
+
167
+ **Auth model:** JWT (org/user scoped) + AWS SigV4 signing. The JWT carries
168
+ organization and user identity; SigV4 authenticates the request to API Gateway.
169
+
170
+ ### Data Plane (Stream Bus)
171
+
172
+ The data plane handles live event read/write through the RStreams/Leo event bus.
173
+ This is a separate infrastructure layer from the REST API.
174
+
175
+ | Operation | SDK Method | Bus Operation |
176
+ |-----------|-----------|---------------|
177
+ | Write events | `flows.get_writer()` → `writer.write()` → `writer.close()` | `putPayloadsToQueue()` via Kinesis/Firehose |
178
+ | Read events | `queues.open_reader()` → `reader.read()` | `readQueueBatch()` via DynamoDB |
179
+ | Stream live | `data_products.stream()` | `offloadEvents()` via bus |
180
+
181
+ **Auth model:** AWS IAM credentials scoped to the stream infrastructure
182
+ (DynamoDB, Kinesis, S3). The platform JWT does **not** grant bus access
183
+ directly — bus access uses AWS principals. See
184
+ [sdk-bus-rbac-threat-model.md](./sdk-bus-rbac-threat-model.md) for the full
185
+ security model.
186
+
187
+ ### When Each Plane Is Used
188
+
189
+ ```
190
+ ┌─────────────────────────────────────────────────────────┐
191
+ │ Your Application │
192
+ │ │
193
+ │ const client = new LoxtepClient({ ... }); │
194
+ │ │
195
+ │ // Control plane (REST API) │
196
+ │ const connector = await client.connectors.get(id); │
197
+ │ const products = await client.data_products.list(); │
198
+ │ await client.data_products.replay(dpId, opts); │
199
+ │ │
200
+ │ // Data plane (Stream Bus) │
201
+ │ const writer = await client.flows.get_writer(flowId, { │
202
+ │ bot_id: 'my-bot', │
203
+ │ output_queue_name: 'my-queue' │
204
+ │ }); │
205
+ │ writer.write({ payload: 'event-data' }); │
206
+ │ await writer.close(); │
207
+ │ │
208
+ │ const reader = await client.queues.open_reader({ │
209
+ │ bot_id: 'my-bot', │
210
+ │ queue_name: 'my-queue' │
211
+ │ }); │
212
+ │ for await (const event of reader.read()) { ... } │
213
+ └─────────────────────────────────────────────────────────┘
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Data Flow: Write Path (Ingestion)
219
+
220
+ When your application writes events through the SDK, data flows through these
221
+ stages:
222
+
223
+ ```mermaid
224
+ sequenceDiagram
225
+ participant App as User Application
226
+ participant SDK as LoxtepClient
227
+ participant FW as FlowWriter
228
+ participant Bus as RStreams SDK
229
+ participant KIN as Kinesis/Firehose
230
+ participant Q as Event Queue
231
+
232
+ App->>SDK: flows.get_writer(flow_id, { bot_id, output_queue_name })
233
+ SDK->>SDK: Resolve stream bus config
234
+ SDK->>FW: Create FlowWriter(rsdk, bot_id, queue)
235
+ App->>FW: writer.write(event)
236
+ FW->>FW: Buffer event
237
+ App->>FW: writer.close()
238
+ FW->>Bus: putPayloadsToQueue(buffered_events)
239
+ Bus->>KIN: Write batch
240
+ KIN->>Q: Deliver to queue
241
+ ```
242
+
243
+ ### Step by Step
244
+
245
+ 1. **Get a writer** — call `client.flows.get_writer(flowId, options)` with a
246
+ `bot_id` (identifies your writer process for checkpointing) and
247
+ `output_queue_name` (the target queue in your data product).
248
+
249
+ 2. **Write events** — call `writer.write(event)` for each event. Events are
250
+ buffered in memory. The buffer flushes automatically when it reaches
251
+ `batch_size` (default: 100) or after `flush_interval_ms` (default: 5000ms).
252
+
253
+ 3. **Close the writer** — call `await writer.close()` to flush all remaining
254
+ buffered events and confirm delivery. Always close the writer when done to
255
+ avoid data loss.
256
+
257
+ 4. **Delivery** — the FlowWriter calls `putPayloadsToQueue()` on the RStreams
258
+ SDK, which writes the batch to Kinesis/Firehose. Events are then delivered
259
+ to the target event queue (data product).
260
+
261
+ ### Write Path Configuration
262
+
263
+ ```typescript
264
+ const writer = await client.flows.get_writer(flowId, {
265
+ bot_id: 'my-ingestion-bot', // Required: identifies this writer
266
+ output_queue_name: 'raw-events', // Required: target queue name
267
+ batch_size: 100, // Optional: events per batch (default: 100)
268
+ flush_interval_ms: 5000, // Optional: auto-flush interval (default: 5000)
269
+ max_retries: 3, // Optional: retry attempts (default: 3)
270
+ });
271
+ ```
272
+
273
+ ### Retry Behavior
274
+
275
+ The FlowWriter retries transient write failures with exponential backoff:
276
+
277
+ | Attempt | Delay | Total Elapsed |
278
+ |---------|-------|---------------|
279
+ | 1 | 0ms | 0ms |
280
+ | 2 | 1000ms | 1000ms |
281
+ | 3 | 2000ms | 3000ms |
282
+ | Fail | — | Throw `StreamingError` |
283
+
284
+ Only transient errors (network timeouts, throttling, 5xx responses) trigger
285
+ retries. Non-transient errors (4xx, auth failures) fail immediately.
286
+
287
+ ---
288
+
289
+ ## Data Flow: Read Path (Export)
290
+
291
+ When your application reads events from a data product queue:
292
+
293
+ ```mermaid
294
+ sequenceDiagram
295
+ participant App as User Application
296
+ participant SDK as LoxtepClient
297
+ participant QR as QueueReader
298
+ participant Bus as RStreams SDK
299
+ participant Q as Event Queue
300
+
301
+ App->>SDK: queues.open_reader({ bot_id, queue_name })
302
+ SDK->>SDK: Resolve stream bus config
303
+ SDK->>QR: Create QueueReader(rsdk, bot_id, queue)
304
+ App->>QR: reader.read()
305
+ QR->>Bus: readQueueBatch(bot_id, queue, batch_size)
306
+ Bus->>Q: Read batch
307
+ Q-->>Bus: Events
308
+ Bus-->>QR: QueueEvent[]
309
+ QR-->>App: AsyncIterable<QueueEvent>
310
+ ```
311
+
312
+ ### Step by Step
313
+
314
+ 1. **Open a reader** — call `client.queues.open_reader({ bot_id, queue_name })`
315
+ with a `bot_id` (identifies your reader for checkpointing) and the
316
+ `queue_name` to read from.
317
+
318
+ 2. **Read events** — call `reader.read()` which returns an
319
+ `AsyncIterable<QueueEvent>`. Events are yielded in the order they were
320
+ written, in batches of `batch_size` (default: 100).
321
+
322
+ 3. **Close the reader** — call `reader.close()` when done to release resources.
323
+
324
+ ### Alternative Read Methods
325
+
326
+ | Method | Use Case |
327
+ |--------|----------|
328
+ | `queues.open_reader()` | Low-level queue access with bot checkpointing |
329
+ | `data_products.stream()` | Stream live events from a data product (requires `bot_id`) |
330
+ | `data_products.replay()` | Replay historical events over the REST API (no bus config needed) |
331
+
332
+ `data_products.replay()` is a control-plane operation — it reads historical
333
+ events via HTTP, not the stream bus. This is useful when you don't have bus
334
+ credentials configured or need to replay a specific time range.
335
+
336
+ ---
337
+
338
+ ## Authentication
339
+
340
+ The SDK uses a layered authentication model. Control plane and data plane have
341
+ separate auth mechanisms.
342
+
343
+ ### Control Plane Auth (JWT)
344
+
345
+ The SDK resolves JWT tokens in this precedence order:
346
+
347
+ 1. **`LOXTEP_AUTH_TOKEN` environment variable** — highest priority. Set this
348
+ for CI/CD pipelines, containers, or any environment where you want explicit
349
+ token control.
350
+
351
+ 2. **`~/.loxtep/credentials.json`** — written by `loxtep login`. Used for
352
+ local development. The SDK's TokenManager handles automatic refresh when
353
+ tokens expire.
354
+
355
+ If neither source provides a token, API calls fail with `AuthenticationError`.
356
+
357
+ ### Setting Up Auth
358
+
359
+ **Option A: Environment variable (recommended for CI/CD)**
360
+
361
+ ```bash
362
+ export LOXTEP_AUTH_TOKEN="your-jwt-token"
363
+ ```
364
+
365
+ **Option B: Interactive login (recommended for local dev)**
366
+
367
+ ```bash
368
+ npx loxtep login
369
+ # Stores credentials at ~/.loxtep/credentials.json
370
+ # Prints confirmation on success
371
+ ```
372
+
373
+ **Option C: Config file**
374
+
375
+ After running `loxtep init`, the SDK reads defaults from
376
+ `~/.loxtep/config.json`:
377
+
378
+ ```json
379
+ {
380
+ "api_url": "https://api.loxtep.io",
381
+ "organization_id": "<uuid>",
382
+ "project_id": "<uuid>",
383
+ "instance_id": "<uuid>",
384
+ "region": "us-east-1"
385
+ }
386
+ ```
387
+
388
+ These values serve as defaults for `LoxtepClient` constructor options that are
389
+ not explicitly provided.
390
+
391
+ ### Data Plane Auth (AWS IAM)
392
+
393
+ Stream bus operations use AWS IAM credentials, not the JWT. The SDK resolves
394
+ stream bus configuration through:
395
+
396
+ 1. **`LoxtepClient({ streams: { ... } })` constructor option** — explicit
397
+ config.
398
+ 2. **`LOXTEP_RSTREAMS_CONFIG_FILE` env var** — path to a JSON file with bus
399
+ resource names.
400
+ 3. **`LEO_*` / `AWS_REGION` env vars** — merged by `resolveStreamsConfiguration`.
401
+ 4. **`client.observe.stream_config()`** — automatic resolution from the
402
+ platform API (calls `GET /observe/stream-config`).
403
+
404
+ See [sdk-rest-vs-bus.md](./sdk-rest-vs-bus.md) for the full configuration
405
+ surface and security model.
406
+
407
+ ### Exporting Config from a Connector
408
+
409
+ After creating an SDK connector, export its configuration to bootstrap the
410
+ client:
411
+
412
+ ```bash
413
+ # Shell format (default) — copy-paste into terminal
414
+ loxtep config export --from-connector <connector_id>
415
+
416
+ # JSON format — for programmatic use
417
+ loxtep config export --from-connector <connector_id> --format json
418
+
419
+ # .env format — for dotenv files
420
+ loxtep config export --from-connector <connector_id> --format env
421
+ ```
422
+
423
+ ---
424
+
425
+ ## Error Handling
426
+
427
+ ### Common Failure Modes
428
+
429
+ | Error Condition | Error Class | Message | Resolution |
430
+ |----------------|-------------|---------|------------|
431
+ | No auth token available | `AuthenticationError` | "No authentication token found. Set LOXTEP_AUTH_TOKEN or run `loxtep login`" | Set the `LOXTEP_AUTH_TOKEN` env var or run `loxtep login` to store credentials. |
432
+ | Token expired | `AuthenticationError` | "Authentication token expired. Run `loxtep login` to refresh" | Run `loxtep login` again. The TokenManager handles auto-refresh for credentials-file tokens, but env-var tokens must be replaced manually. |
433
+ | Stream bus not configured | `StreamingError` | "Stream bus configuration missing. Set LEO_* environment variables or add `streams` to ~/.loxtep/config.json" | Configure stream bus resources via env vars, config file, or `client.observe.stream_config()`. See [sdk-rest-vs-bus.md](./sdk-rest-vs-bus.md). |
434
+ | Queue not found | `NotFoundError` | "Queue '{queue_name}' not found. Verify the queue exists in your data product" | Check the queue name matches a queue in your data product. Verify the workflow is deployed. |
435
+ | Bot unauthorized | `AuthorizationError` | "Bot '{bot_id}' does not have read permission on queue '{queue_name}'" | Ensure the bot has the correct IAM permissions for the stream bus resources. |
436
+ | Write failed after retries | `StreamingError` | "Failed to write events after 3 attempts: {last_error}" | Check network connectivity and stream bus health. Transient errors (throttling, 5xx) are retried automatically; persistent failures indicate an infrastructure issue. |
437
+ | Connector not found (CLI) | `NotFoundError` | "Connector '{connector_id}' not found" | Verify the connector ID is correct and belongs to your organization. |
438
+ | Connector not SDK type (CLI) | `ValidationError` | "Connector '{connector_id}' is type '{type}', not 'sdk'" | Use `--from-data-product` for non-SDK connectors, or create an SDK connector first. |
439
+
440
+ ### Error Hierarchy
441
+
442
+ ```
443
+ LoxtepError (base)
444
+ ├── AuthenticationError — missing or expired tokens
445
+ ├── AuthorizationError — insufficient permissions
446
+ ├── NotFoundError — resource does not exist
447
+ ├── ValidationError — invalid input or configuration
448
+ └── StreamingError — stream bus write/read failures
449
+ ```
450
+
451
+ ### Debugging Tips
452
+
453
+ 1. **Check auth first** — most failures trace back to missing or expired
454
+ tokens. Run `loxtep login` and verify `~/.loxtep/credentials.json` exists.
455
+
456
+ 2. **Verify stream config** — if write/read operations fail with
457
+ `StreamingError`, check that `LEO_*` env vars or `streams` config point to
458
+ the correct instance. Use `client.observe.stream_config()` to auto-resolve.
459
+
460
+ 3. **Match instance and bus** — the stream bus resources (DynamoDB tables,
461
+ Kinesis streams, S3 buckets) are 1:1 with a Loxtep instance. Wrong instance
462
+ config means wrong table names, silent misrouting, or hard failures.
463
+
464
+ 4. **Check bot permissions** — `AuthorizationError` on read/write means the
465
+ `bot_id` lacks IAM permissions for the target queue's underlying AWS
466
+ resources.
467
+
468
+ ---
469
+
470
+ ## Related Documentation
471
+
472
+ | Document | Description |
473
+ |----------|-------------|
474
+ | [SDK Control vs Data Plane](./sdk-control-vs-data-plane.md) | Detailed breakdown of control plane and data plane responsibilities |
475
+ | [SDK REST vs Bus](./sdk-rest-vs-bus.md) | Configuration surfaces, security model, and credential handling |
476
+ | [SDK Bus RBAC Threat Model](./sdk-bus-rbac-threat-model.md) | Security analysis of bus access patterns |
477
+ | [SDK MCP Mapping](./sdk-mcp-mapping.md) | How MCP tools map to SDK and API operations |
478
+ | [Event Replay Cookbook](./event-replay-cookbook.md) | Patterns for replaying historical events |
479
+ | [Getting Started Guide](./getting-started.md) | Step-by-step setup from zero to first event |
480
+ | [Quick Reference Card](./quick-reference.md) | Single-page cheat sheet for common SDK operations |
@@ -0,0 +1,20 @@
1
+ # MCP tools vs SDK (high level)
2
+
3
+ This is a **guide for agents**, not an exhaustive OpenAPI listing. MCP stays on
4
+ **HTTP**; the SDK adds **typed REST** and the **stream data plane** for live
5
+ I/O.
6
+
7
+ | Area | MCP (typical) | SDK |
8
+ | ------------------------ | ----------------------------------------- | ------------------------------------------------------------------------ |
9
+ | Catalog / discovery | `POST /ai/mcp/tools/call` discovery tools | `client.discovery.*`, `client.catalog.search` |
10
+ | Data products | MCP dataproduct tools | `client.data_products` (get, list, create, query, stream, replay, …) |
11
+ | Flows / workflows | MCP / Studio workflows | `client.flows`, `client.workflows`, `client.projects` |
12
+ | Connections / connectors | MCP connectors | `client.connections`, `client.connectors` |
13
+ | Org / instances | MCP org / instances | `client.instances.list()`, config `instance_id` |
14
+ | Live queue I/O | Not a substitute for the stream runtime | `client.queues`, `client.flows.get_writer`, `data_products.stream` + bus |
15
+
16
+ When unsure: **MCP for provisioning and agent tool calls**; **SDK (+ stream bus
17
+ config) for runtime** services running in your VPC or CI.
18
+
19
+ Skills in **loxtep-plugins-skills** (`loxtep-sdk` skill) duplicate bootstrap
20
+ snippets so MCP servers do not need codegen tools.
@@ -0,0 +1,42 @@
1
+ # MCP, CLI, and Node SDK — one pairing story
2
+
3
+ ## Same API host
4
+
5
+ Use one base URL everywhere:
6
+
7
+ - **REST / SDK:** `LOXTEP_API_URL` or `config.json` → `api_url` (SDK
8
+ `LoxtepClient({ api_url })`).
9
+ - **Customer MCP / browser login:** optional `api_base_url` in
10
+ `~/.loxtep/credentials.json` (same value; trailing slash optional).
11
+
12
+ The CLI and SDK resolve tokens in this order: **`LOXTEP_AUTH_TOKEN`** →
13
+ **`~/.loxtep/credentials.json`** (shared: `loxtep login` and
14
+ `npx @loxtep/customer-mcp-server login`). You should not need two logins for the
15
+ same machine if you use one file-based flow.
16
+
17
+ ## When to use what
18
+
19
+ | Job | Tool |
20
+ | --------------------------------------------------------------------------- | -------------------------------------------------------------- |
21
+ | Provision org resources, run catalog/dataproduct MCP tools, IDE agent calls | **Customer MCP** (HTTP tools against the platform) |
22
+ | Typed REST from Node services, scripts, CI | **`@loxtep/sdk`** (`LoxtepClient`) |
23
+ | Quick operator commands, token bootstrap | **`loxtep` CLI** (ships with the SDK) |
24
+ | **Live** queue produce/consume (Loxtep streams) | **SDK** with stream bus config + AWS principal (not JWT alone) |
25
+ | **Historical** replay / trace-style reads where the platform stores history | **SDK** `data_products.replay()` (control-plane HTTP) |
26
+
27
+ There is **no** required joint npm install of MCP and SDK; pair them by
28
+ **config + docs**, not a metapackage.
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ npm install @loxtep/sdk
34
+ # Node.js 22+ recommended (see package engines).
35
+ ```
36
+
37
+ ## See also
38
+
39
+ - [Control vs data plane](./sdk-control-vs-data-plane.md)
40
+ - [REST SigV4 + JWT vs bus](./sdk-rest-vs-bus.md)
41
+ - [MCP → SDK mapping](./sdk-mcp-mapping.md)
42
+ - [Bus RBAC threat model](./sdk-bus-rbac-threat-model.md)
@@ -0,0 +1,131 @@
1
+ # REST (SigV4 + JWT) vs Loxtep stream bus
2
+
3
+ ## Chosen config surfaces (SDK)
4
+
5
+ The Node SDK uses **(B) persisted `LoxtepConfig` + `loadConfig` / CLI** and
6
+ **(C) an optional second JSON file** referenced by
7
+ `LOXTEP_RSTREAMS_CONFIG_FILE`, merged **on top of** the `streams` key from the
8
+ main config file (same PascalCase `ConfigurationResources` shape as in code; see
9
+ `parseStreamsPartial`).
10
+
11
+ - **Main file** (`~/.loxtep/config.json` or path you pass to `loadConfig`):
12
+ `api_url`, `organization_id`, `project_id`, `instance_id`, `region`, optional
13
+ `streams`.
14
+ - **Optional bus-only file**
15
+ (`LOXTEP_RSTREAMS_CONFIG_FILE=/path/to/rstreams.json`): same JSON shape as the
16
+ `streams` object; **wins** over overlapping keys from the main file. Useful
17
+ for copying managed infra JSON without mixing it with `api_url`.
18
+ - **Per-key env** `LEO_*` / `AWS_REGION` (and friends) are still merged inside
19
+ **`resolveStreamsConfiguration`** when the client is constructed — see
20
+ [`configuration.ts`](../src/rstreams/configuration.ts).
21
+ - **Observe-proxied stream config:** `client.observe.stream_config()` calls
22
+ **`GET /observe/stream-config`** on the **app** microservice (JWT + SigV4 like
23
+ other `/observe/*` routes). The control plane **proxies** to the instance’s
24
+ botmon **`GET /botmon/api/stream_config`**, which returns allowlisted resource
25
+ names (same shape as `streams` / `resolveStreamsConfiguration`). Instance
26
+ records should store **`connection_details.observe_api.rstreams_secret_arn`**
27
+ (full Secrets Manager ARN) for provisioning reference; the upstream lambda may
28
+ also read from its deployed `leosdk` env.
29
+ - Instances using Observe transport mode **`direct`** cannot use this proxy path
30
+ today (the proxy returns **409**); use local `streams` / `LEO_*` or call the
31
+ instance observe API directly with your stack’s auth model.
32
+ - You must still align bus settings with the **same** Loxtep instance as your
33
+ workload (see [Instance and bus alignment](#instance-and-bus-alignment)).
34
+
35
+ `LOXTEP_REGION` overrides `region` from the main file (HTTP SigV4 to API
36
+ Gateway). **Do not** put long-lived AWS access keys or JWT refresh material into
37
+ these JSON files.
38
+
39
+ ## REST
40
+
41
+ - Every SDK HTTP call is **AWS SigV4** signed and carries **`x-jwt-token`** when
42
+ `get_token` / `auth` supplies a JWT.
43
+ - In **Node**, if you do not pass `credentials` and have no ambient AWS chain,
44
+ signing fails with `AWS credentials not available`.
45
+ - **CLI** uses a fixed dummy `accessKeyId` / `secretAccessKey` pair where the
46
+ gateway accepts it; **library users** must supply real IAM/user credentials or
47
+ the same dummy pattern only in dev stacks that explicitly allow it.
48
+ - **Never** paste IAM secrets into MCP token files or JWT-only env vars — keep
49
+ API JWT and bus IAM in separate mechanisms.
50
+
51
+ ## Stream bus (data plane)
52
+
53
+ - Configured via `LoxtepClient({ streams: { ... } })`, **`LEO_*` env**, merged
54
+ config + optional `LOXTEP_RSTREAMS_CONFIG_FILE`, and/or **CLI** loading all of
55
+ the above into the client. Merge order for file-backed partials: **main config
56
+ `streams`**, then **optional rstreams file**; **constructor `streams`** and
57
+ `resolveStreamsConfiguration` also fold in `process.env`.
58
+ - **Tests** may inject `streams_sdk` to bypass real AWS / runtime construction.
59
+
60
+ ## File permissions (bus JSON)
61
+
62
+ Treat files that contain `LeoEvent`, `LeoStream`, Kinesis, S3, etc. as
63
+ **sensitive infrastructure identifiers** (not passwords, but still
64
+ opsec-relevant). Prefer:
65
+
66
+ - `chmod 600` (user read/write only) for `rstreams.json` and restrictive
67
+ permissions on `~/.loxtep/`.
68
+ - CI secrets or a server API that RBAC-gates bus metadata — avoid committing
69
+ these values to public repos.
70
+
71
+ ## Security model (what goes where)
72
+
73
+ | Item | Treat as | Recommended handling |
74
+ | ---------------------------------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
75
+ | `LeoEvent`, `LeoStream`, Kinesis, S3, Firehose, `LeoSettings`, `LeoCron`, `Region` | **Sensitive infrastructure identifiers** (not passwords) | Config file with restrictive permissions, env vars in CI, or a server API that RBAC-gates; avoid public repos. |
76
+ | AWS access keys / STS session | **Secrets** | Use HTTP client [`credentials`](../src/client/types.ts) and/or `refresh` **`aws_credentials`**; do not put into `~/.loxtep/config.json`. |
77
+ | `rstreams/auth` / Leo auth | **Secrets / separate concern** | Do not copy bot auth material into the SDK config file; only wire **resources** the way `RStreamsSdk` / `leo-sdk` expect for the **data plane** you use. |
78
+
79
+ `leo-sdk` uses the **default AWS credential provider chain** in the process for
80
+ DynamoDB/Kinesis; the SDK’s `credentials` option is for **SigV4 to the Loxtep
81
+ HTTP API**, not automatically for the stream runtime unless the same process
82
+ exports profiles/env so both paths see the right IAM **in the bus
83
+ account/region**.
84
+
85
+ ## Instance and bus alignment
86
+
87
+ - **`LOXTEP_INSTANCE_ID` / `LoxtepConfig.instance_id`** scope **org/instance
88
+ HTTP** calls. They **do not** auto-select or load `LEO_*` / `streams` for that
89
+ instance.
90
+ - The physical bus (DynamoDB table names, Kinesis, S3) is **1:1 with a Loxtep
91
+ instance deployment** in AWS. You must pass **`ConfigurationResources` that
92
+ match the instance** whose bus hosts the queues you use — wrong instance ⇒
93
+ wrong table names, silent misrouting, or hard failures.
94
+ - Until a **platform** “bus metadata for `instance_id`” API exists, align bus
95
+ config via **per-profile** files, **env**, or **separate** `rstreams.json` per
96
+ instance you work with.
97
+
98
+ ## RBAC vs IAM (read vs write on bus)
99
+
100
+ **Principle:** the **API JWT** and Loxtep **RBAC** apply to **SigV4 REST** only.
101
+ The **stream data plane** (Leo) uses **AWS credentials** to DDB/Kinesis/S3 for
102
+ the configured `ConfigurationResources` — **not** the JWT. See
103
+ [sdk-bus-rbac-threat-model.md](./sdk-bus-rbac-threat-model.md) for the full
104
+ threat discussion.
105
+
106
+ | Path | Write vs read (Leo) | RBAC (Loxtep)? | IAM (AWS)? |
107
+ | ----------------------------------------------- | ------------------- | -------------- | ------------------------------------------------------- |
108
+ | **Bus: `putEvents`** | Write | No | Yes |
109
+ | **Bus: `offloadEvents`** (tail / `open_reader`) | Read | No | Yes (read may differ from write policy) |
110
+ | **HTTP: `data_products.stream` / replay** | “Read” over REST | **Yes** | SigV4 + JWT; bus tables not used by client in that mode |
111
+ | **HTTP: `get_queue_metadata`, checkpoints** | Metadata | **Yes** | SigV4 for those endpoints |
112
+
113
+ **Cognito / session alignment:** when the server returns **`aws_credentials`**
114
+ on refresh, the Node SDK and CLI can update **HTTP** SigV4 credentials. If the
115
+ **same** session is what the process uses for the **default AWS provider
116
+ chain**, Leo and HTTP share a **common TTL**; if only the HTTP `credentials`
117
+ object is updated, Leo’s ambient chain may still differ (documented integration
118
+ risk).
119
+
120
+ ## Refresh
121
+
122
+ - **JWT refresh:** `POST /auth/refresh` with refresh token; CLI wires
123
+ **TokenManager** + **401 retry** when tokens come from the credentials file
124
+ (not for `LOXTEP_AUTH_TOKEN`-only mode).
125
+ - When the server session was created from password login or from
126
+ `POST /auth/cognito-exchange` with `cognito_refresh_token`, the refresh
127
+ response may include **`aws_credentials`** (same snake_case fields as login).
128
+ The Node SDK maps these into **`RefreshResponse.aws_credentials`**; the CLI
129
+ updates its mutable SigV4 credential object after each successful refresh when
130
+ STS is present. **Legacy sessions** without a stored Cognito refresh omit
131
+ `aws_credentials` (JWT-only refresh).