@de./sdk 1.0.4 → 2.0.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 (383) hide show
  1. package/dist/allend/Access.d.ts +39 -3
  2. package/dist/allend/Access.js +147 -114
  3. package/dist/allend/Access.js.map +1 -1
  4. package/dist/allend/Agent/consolidation.d.ts +16 -0
  5. package/dist/allend/Agent/consolidation.js +38 -0
  6. package/dist/allend/Agent/consolidation.js.map +1 -0
  7. package/dist/allend/Agent/delivery.d.ts +11 -0
  8. package/dist/allend/Agent/delivery.js +43 -0
  9. package/dist/allend/Agent/delivery.js.map +1 -0
  10. package/dist/allend/Agent/dispatch.d.ts +8 -0
  11. package/dist/allend/Agent/dispatch.js +24 -0
  12. package/dist/allend/Agent/dispatch.js.map +1 -0
  13. package/dist/allend/Agent/index.d.ts +49 -0
  14. package/dist/allend/Agent/index.js +74 -0
  15. package/dist/allend/Agent/index.js.map +1 -0
  16. package/dist/allend/Agent/navigation.d.ts +8 -0
  17. package/dist/allend/Agent/navigation.js +25 -0
  18. package/dist/allend/Agent/navigation.js.map +1 -0
  19. package/dist/allend/Agent/origin.d.ts +9 -0
  20. package/dist/allend/Agent/origin.js +31 -0
  21. package/dist/allend/Agent/origin.js.map +1 -0
  22. package/dist/allend/Agent/reallocation.d.ts +7 -0
  23. package/dist/allend/Agent/reallocation.js +17 -0
  24. package/dist/allend/Agent/reallocation.js.map +1 -0
  25. package/dist/allend/Agent/realtime.d.ts +36 -0
  26. package/dist/allend/Agent/realtime.js +111 -0
  27. package/dist/allend/Agent/realtime.js.map +1 -0
  28. package/dist/allend/Agent/rides.d.ts +12 -0
  29. package/dist/allend/Agent/rides.js +51 -0
  30. package/dist/allend/Agent/rides.js.map +1 -0
  31. package/dist/allend/Agent/shipping.d.ts +11 -0
  32. package/dist/allend/Agent/shipping.js +43 -0
  33. package/dist/allend/Agent/shipping.js.map +1 -0
  34. package/dist/allend/CSP/analytics.d.ts +12 -0
  35. package/dist/allend/CSP/analytics.js +51 -0
  36. package/dist/allend/CSP/analytics.js.map +1 -0
  37. package/dist/allend/CSP/index.d.ts +25 -0
  38. package/dist/allend/CSP/index.js +43 -0
  39. package/dist/allend/CSP/index.js.map +1 -0
  40. package/dist/allend/CSP/inventory.d.ts +16 -0
  41. package/dist/allend/CSP/inventory.js +78 -0
  42. package/dist/allend/CSP/inventory.js.map +1 -0
  43. package/dist/allend/CSP/orders.d.ts +19 -0
  44. package/dist/allend/CSP/orders.js +97 -0
  45. package/dist/allend/CSP/orders.js.map +1 -0
  46. package/dist/allend/CSP/webhooks.d.ts +13 -0
  47. package/dist/allend/CSP/webhooks.js +56 -0
  48. package/dist/allend/CSP/webhooks.js.map +1 -0
  49. package/dist/allend/Customer/index.d.ts +27 -0
  50. package/dist/allend/Customer/index.js +39 -0
  51. package/dist/allend/Customer/index.js.map +1 -0
  52. package/dist/allend/Customer/intents.d.ts +12 -0
  53. package/dist/allend/Customer/intents.js +55 -0
  54. package/dist/allend/Customer/intents.js.map +1 -0
  55. package/dist/allend/Customer/orders.d.ts +11 -0
  56. package/dist/allend/Customer/orders.js +43 -0
  57. package/dist/allend/Customer/orders.js.map +1 -0
  58. package/dist/allend/Customer/rides.d.ts +12 -0
  59. package/dist/allend/Customer/rides.js +50 -0
  60. package/dist/allend/Customer/rides.js.map +1 -0
  61. package/dist/allend/DEV/developers.d.ts +11 -0
  62. package/dist/allend/DEV/developers.js +35 -0
  63. package/dist/allend/DEV/developers.js.map +1 -0
  64. package/dist/allend/DEV/index.d.ts +19 -0
  65. package/dist/allend/DEV/index.js +37 -0
  66. package/dist/allend/DEV/index.js.map +1 -0
  67. package/dist/allend/IoTClient.js +29 -35
  68. package/dist/allend/IoTClient.js.map +1 -1
  69. package/dist/allend/IoTSP/backend.d.ts +29 -0
  70. package/dist/allend/IoTSP/backend.js +75 -0
  71. package/dist/allend/IoTSP/backend.js.map +1 -0
  72. package/dist/allend/IoTSP/devices.d.ts +14 -0
  73. package/dist/allend/IoTSP/devices.js +61 -0
  74. package/dist/allend/IoTSP/devices.js.map +1 -0
  75. package/dist/allend/IoTSP/index.d.ts +28 -0
  76. package/dist/allend/IoTSP/index.js +84 -0
  77. package/dist/allend/IoTSP/index.js.map +1 -0
  78. package/dist/allend/IoTSP/rules.d.ts +17 -0
  79. package/dist/allend/IoTSP/rules.js +81 -0
  80. package/dist/allend/IoTSP/rules.js.map +1 -0
  81. package/dist/allend/IoTSP/topics.d.ts +17 -0
  82. package/dist/allend/IoTSP/topics.js +81 -0
  83. package/dist/allend/IoTSP/topics.js.map +1 -0
  84. package/dist/allend/LSP/agents.d.ts +20 -0
  85. package/dist/allend/LSP/agents.js +89 -0
  86. package/dist/allend/LSP/agents.js.map +1 -0
  87. package/dist/allend/LSP/carriers.d.ts +54 -0
  88. package/dist/allend/LSP/carriers.js +315 -0
  89. package/dist/allend/LSP/carriers.js.map +1 -0
  90. package/dist/allend/LSP/coverage.d.ts +44 -0
  91. package/dist/allend/LSP/coverage.js +135 -0
  92. package/dist/allend/LSP/coverage.js.map +1 -0
  93. package/dist/allend/LSP/fleets.d.ts +66 -0
  94. package/dist/allend/LSP/fleets.js +381 -0
  95. package/dist/allend/LSP/fleets.js.map +1 -0
  96. package/dist/allend/LSP/hubs.d.ts +39 -0
  97. package/dist/allend/LSP/hubs.js +186 -0
  98. package/dist/allend/LSP/hubs.js.map +1 -0
  99. package/dist/allend/LSP/index.d.ts +37 -0
  100. package/dist/allend/LSP/index.js +55 -0
  101. package/dist/allend/LSP/index.js.map +1 -0
  102. package/dist/allend/LSP/inventory.d.ts +13 -0
  103. package/dist/allend/LSP/inventory.js +56 -0
  104. package/dist/allend/LSP/inventory.js.map +1 -0
  105. package/dist/allend/LSP/operations.d.ts +47 -0
  106. package/dist/allend/LSP/operations.js +156 -0
  107. package/dist/allend/LSP/operations.js.map +1 -0
  108. package/dist/allend/LSP/orders.d.ts +69 -0
  109. package/dist/allend/LSP/orders.js +303 -0
  110. package/dist/allend/LSP/orders.js.map +1 -0
  111. package/dist/allend/LSP/pods.d.ts +26 -0
  112. package/dist/allend/LSP/pods.js +137 -0
  113. package/dist/allend/LSP/pods.js.map +1 -0
  114. package/dist/allend/LSP/pricing.d.ts +35 -0
  115. package/dist/allend/LSP/pricing.js +151 -0
  116. package/dist/allend/LSP/pricing.js.map +1 -0
  117. package/dist/allend/LSP/psl.d.ts +15 -0
  118. package/dist/allend/LSP/psl.js +68 -0
  119. package/dist/allend/LSP/psl.js.map +1 -0
  120. package/dist/allend/LSP/warehouses.d.ts +23 -0
  121. package/dist/allend/LSP/warehouses.js +94 -0
  122. package/dist/allend/LSP/warehouses.js.map +1 -0
  123. package/dist/allend/MSI/Controls.d.ts +9 -5
  124. package/dist/allend/MSI/Controls.js +269 -297
  125. package/dist/allend/MSI/Controls.js.map +1 -1
  126. package/dist/allend/MSI/Handles.d.ts +5 -4
  127. package/dist/allend/MSI/Handles.js +136 -233
  128. package/dist/allend/MSI/Handles.js.map +1 -1
  129. package/dist/allend/MSI/Plugins.d.ts +2 -2
  130. package/dist/allend/MSI/Plugins.js +12 -15
  131. package/dist/allend/MSI/Plugins.js.map +1 -1
  132. package/dist/allend/MSI/index.d.ts +4 -3
  133. package/dist/allend/MSI/index.js +123 -87
  134. package/dist/allend/MSI/index.js.map +1 -1
  135. package/dist/allend/MSI/native.d.ts +32 -0
  136. package/dist/allend/MSI/native.js +246 -0
  137. package/dist/allend/MSI/native.js.map +1 -0
  138. package/dist/allend/MSI/token.d.ts +12 -0
  139. package/dist/allend/MSI/token.js +21 -0
  140. package/dist/allend/MSI/token.js.map +1 -0
  141. package/dist/allend/OTPAuth/index.d.ts +77 -0
  142. package/dist/allend/OTPAuth/index.js +69 -0
  143. package/dist/allend/OTPAuth/index.js.map +1 -0
  144. package/dist/allend/Pipelines/analytics.d.ts +8 -0
  145. package/dist/allend/Pipelines/analytics.js +24 -0
  146. package/dist/allend/Pipelines/analytics.js.map +1 -0
  147. package/dist/allend/Pipelines/escalations.d.ts +8 -0
  148. package/dist/allend/Pipelines/escalations.js +25 -0
  149. package/dist/allend/Pipelines/escalations.js.map +1 -0
  150. package/dist/allend/Pipelines/executions.d.ts +11 -0
  151. package/dist/allend/Pipelines/executions.js +44 -0
  152. package/dist/allend/Pipelines/executions.js.map +1 -0
  153. package/dist/allend/Pipelines/index.d.ts +42 -0
  154. package/dist/allend/Pipelines/index.js +88 -0
  155. package/dist/allend/Pipelines/index.js.map +1 -0
  156. package/dist/allend/Pipelines/interventions.d.ts +8 -0
  157. package/dist/allend/Pipelines/interventions.js +25 -0
  158. package/dist/allend/Pipelines/interventions.js.map +1 -0
  159. package/dist/allend/Pipelines/monitor.d.ts +9 -0
  160. package/dist/allend/Pipelines/monitor.js +30 -0
  161. package/dist/allend/Pipelines/monitor.js.map +1 -0
  162. package/dist/allend/Pipelines/queries.d.ts +8 -0
  163. package/dist/allend/Pipelines/queries.js +25 -0
  164. package/dist/allend/Pipelines/queries.js.map +1 -0
  165. package/dist/allend/Pipelines/templates.d.ts +11 -0
  166. package/dist/allend/Pipelines/templates.js +46 -0
  167. package/dist/allend/Pipelines/templates.js.map +1 -0
  168. package/dist/allend/Pipelines/utils.d.ts +0 -0
  169. package/dist/allend/Pipelines/utils.js +2 -0
  170. package/dist/allend/Pipelines/utils.js.map +1 -0
  171. package/dist/allend/Pipelines/webhooks.d.ts +9 -0
  172. package/dist/allend/Pipelines/webhooks.js +35 -0
  173. package/dist/allend/Pipelines/webhooks.js.map +1 -0
  174. package/dist/allend/Pipelines/workers.d.ts +11 -0
  175. package/dist/allend/Pipelines/workers.js +45 -0
  176. package/dist/allend/Pipelines/workers.js.map +1 -0
  177. package/dist/allend/Queries/capacity.d.ts +11 -0
  178. package/dist/allend/Queries/capacity.js +44 -0
  179. package/dist/allend/Queries/capacity.js.map +1 -0
  180. package/dist/allend/Queries/discovery.d.ts +11 -0
  181. package/dist/allend/Queries/discovery.js +45 -0
  182. package/dist/allend/Queries/discovery.js.map +1 -0
  183. package/dist/allend/Queries/index.d.ts +27 -0
  184. package/dist/allend/Queries/index.js +40 -0
  185. package/dist/allend/Queries/index.js.map +1 -0
  186. package/dist/allend/Queries/matching.d.ts +7 -0
  187. package/dist/allend/Queries/matching.js +18 -0
  188. package/dist/allend/Queries/matching.js.map +1 -0
  189. package/dist/allend/Queries/performance.d.ts +9 -0
  190. package/dist/allend/Queries/performance.js +31 -0
  191. package/dist/allend/Queries/performance.js.map +1 -0
  192. package/dist/allend/Queries/pricing.d.ts +11 -0
  193. package/dist/allend/Queries/pricing.js +43 -0
  194. package/dist/allend/Queries/pricing.js.map +1 -0
  195. package/dist/allend/{DClient/Event.d.ts → Realtime/index.d.ts} +2 -6
  196. package/dist/allend/Realtime/index.js +62 -0
  197. package/dist/allend/Realtime/index.js.map +1 -0
  198. package/dist/allend/Shared/account.d.ts +10 -0
  199. package/dist/allend/Shared/account.js +22 -0
  200. package/dist/allend/Shared/account.js.map +1 -0
  201. package/dist/allend/Shared/buckets.d.ts +21 -0
  202. package/dist/allend/Shared/buckets.js +95 -0
  203. package/dist/allend/Shared/buckets.js.map +1 -0
  204. package/dist/allend/Shared/context.d.ts +14 -0
  205. package/dist/allend/Shared/context.js +33 -0
  206. package/dist/allend/Shared/context.js.map +1 -0
  207. package/dist/allend/Shared/faqs.d.ts +20 -0
  208. package/dist/allend/Shared/faqs.js +87 -0
  209. package/dist/allend/Shared/faqs.js.map +1 -0
  210. package/dist/allend/Shared/invitation.d.ts +42 -0
  211. package/dist/allend/Shared/invitation.js +40 -0
  212. package/dist/allend/Shared/invitation.js.map +1 -0
  213. package/dist/allend/Shared/operators.d.ts +39 -0
  214. package/dist/allend/Shared/operators.js +37 -0
  215. package/dist/allend/Shared/operators.js.map +1 -0
  216. package/dist/allend/Shared/users.d.ts +11 -0
  217. package/dist/allend/Shared/users.js +29 -0
  218. package/dist/allend/Shared/users.js.map +1 -0
  219. package/dist/allend/Tracking/index.d.ts +17 -0
  220. package/dist/allend/Tracking/index.js +39 -0
  221. package/dist/allend/Tracking/index.js.map +1 -0
  222. package/dist/allend/Utilities/common.d.ts +12 -0
  223. package/dist/allend/Utilities/common.js +53 -0
  224. package/dist/allend/Utilities/common.js.map +1 -0
  225. package/dist/allend/Utilities/fares.d.ts +10 -0
  226. package/dist/allend/Utilities/fares.js +39 -0
  227. package/dist/allend/Utilities/fares.js.map +1 -0
  228. package/dist/allend/Utilities/index.d.ts +23 -0
  229. package/dist/allend/Utilities/index.js +36 -0
  230. package/dist/allend/Utilities/index.js.map +1 -0
  231. package/dist/allend/Utilities/nearby.d.ts +9 -0
  232. package/dist/allend/Utilities/nearby.js +32 -0
  233. package/dist/allend/Utilities/nearby.js.map +1 -0
  234. package/dist/allend/Workflows/Client.d.ts +17 -0
  235. package/dist/allend/Workflows/Client.js +50 -0
  236. package/dist/allend/Workflows/Client.js.map +1 -0
  237. package/dist/allend/Workflows/Delivery.d.ts +36 -0
  238. package/dist/allend/Workflows/Delivery.js +16 -0
  239. package/dist/allend/Workflows/Delivery.js.map +1 -0
  240. package/dist/allend/Workflows/index.d.ts +11 -0
  241. package/dist/allend/Workflows/index.js +25 -0
  242. package/dist/allend/Workflows/index.js.map +1 -0
  243. package/dist/allend/Workspace/index.d.ts +162 -0
  244. package/dist/allend/Workspace/index.js +220 -0
  245. package/dist/allend/Workspace/index.js.map +1 -0
  246. package/dist/allend/index.d.ts +8 -5
  247. package/dist/allend/index.js +15 -8
  248. package/dist/allend/index.js.map +1 -1
  249. package/dist/backend/Auth.d.ts +28 -4
  250. package/dist/backend/Auth.js +125 -245
  251. package/dist/backend/Auth.js.map +1 -1
  252. package/dist/baseUrl.d.ts +56 -0
  253. package/dist/baseUrl.js +72 -4
  254. package/dist/baseUrl.js.map +1 -1
  255. package/dist/core.d.ts +88 -0
  256. package/dist/core.js +121 -0
  257. package/dist/core.js.map +1 -0
  258. package/dist/error.d.ts +17 -0
  259. package/dist/error.js +26 -0
  260. package/dist/error.js.map +1 -0
  261. package/dist/index.d.ts +30 -12
  262. package/dist/index.js +38 -14
  263. package/dist/index.js.map +1 -1
  264. package/dist/react-native.d.ts +30 -0
  265. package/dist/react-native.js +55 -0
  266. package/dist/react-native.js.map +1 -0
  267. package/dist/types/access.d.ts +64 -7
  268. package/dist/types/auth.d.ts +17 -17
  269. package/dist/types/channel.d.ts +45 -0
  270. package/dist/types/index.d.ts +379 -237
  271. package/dist/utils/index.d.ts +25 -0
  272. package/dist/utils/index.js +11 -1
  273. package/dist/utils/index.js.map +1 -1
  274. package/dist/utils/stream.js +25 -26
  275. package/dist/utils/stream.js.map +1 -1
  276. package/package.json +38 -18
  277. package/src/allend/Access.ts +143 -13
  278. package/src/allend/Agent/consolidation.ts +43 -0
  279. package/src/allend/Agent/delivery.ts +51 -0
  280. package/src/allend/Agent/dispatch.ts +27 -0
  281. package/src/allend/Agent/index.ts +113 -0
  282. package/src/allend/Agent/navigation.ts +27 -0
  283. package/src/allend/Agent/origin.ts +36 -0
  284. package/src/allend/Agent/reallocation.ts +16 -0
  285. package/src/allend/Agent/realtime.ts +140 -0
  286. package/src/allend/Agent/rides.ts +61 -0
  287. package/src/allend/Agent/shipping.ts +51 -0
  288. package/src/allend/CSP/analytics.ts +61 -0
  289. package/src/allend/CSP/index.ts +57 -0
  290. package/src/allend/CSP/inventory.ts +96 -0
  291. package/src/allend/CSP/orders.ts +121 -0
  292. package/src/allend/CSP/webhooks.ts +68 -0
  293. package/src/allend/Customer/index.ts +56 -0
  294. package/src/allend/Customer/intents.ts +66 -0
  295. package/src/allend/Customer/orders.ts +51 -0
  296. package/src/allend/Customer/rides.ts +60 -0
  297. package/src/allend/DEV/developers.ts +42 -0
  298. package/src/allend/DEV/index.ts +48 -0
  299. package/src/allend/IoTSP/backend.ts +103 -0
  300. package/src/allend/IoTSP/devices.ts +74 -0
  301. package/src/allend/IoTSP/index.ts +69 -0
  302. package/src/allend/IoTSP/rules.ts +99 -0
  303. package/src/allend/IoTSP/topics.ts +99 -0
  304. package/src/allend/LSP/agents.ts +115 -0
  305. package/src/allend/LSP/carriers.ts +408 -0
  306. package/src/allend/LSP/coverage.ts +212 -0
  307. package/src/allend/LSP/fleets.ts +505 -0
  308. package/src/allend/LSP/hubs.ts +245 -0
  309. package/src/allend/LSP/index.ts +75 -0
  310. package/src/allend/LSP/inventory.ts +65 -0
  311. package/src/allend/LSP/operations.ts +202 -0
  312. package/src/allend/LSP/orders.ts +397 -0
  313. package/src/allend/LSP/pods.ts +176 -0
  314. package/src/allend/LSP/pricing.ts +192 -0
  315. package/src/allend/LSP/psl.ts +81 -0
  316. package/src/allend/LSP/warehouses.ts +118 -0
  317. package/src/allend/MSI/Controls.ts +109 -90
  318. package/src/allend/MSI/Handles.ts +24 -15
  319. package/src/allend/MSI/Plugins.ts +3 -3
  320. package/src/allend/MSI/index.ts +85 -16
  321. package/src/allend/MSI/native.tsx +314 -0
  322. package/src/allend/MSI/token.ts +20 -0
  323. package/src/allend/OTPAuth/index.ts +130 -0
  324. package/src/allend/Pipelines/analytics.ts +25 -0
  325. package/src/allend/Pipelines/escalations.ts +26 -0
  326. package/src/allend/Pipelines/executions.ts +51 -0
  327. package/src/allend/Pipelines/index.ts +125 -0
  328. package/src/allend/Pipelines/interventions.ts +27 -0
  329. package/src/allend/Pipelines/monitor.ts +33 -0
  330. package/src/allend/Pipelines/queries.ts +27 -0
  331. package/src/allend/Pipelines/templates.ts +51 -0
  332. package/src/allend/Pipelines/utils.ts +0 -0
  333. package/src/allend/Pipelines/webhooks.ts +36 -0
  334. package/src/allend/Pipelines/workers.ts +49 -0
  335. package/src/allend/Queries/capacity.ts +51 -0
  336. package/src/allend/Queries/discovery.ts +53 -0
  337. package/src/allend/Queries/index.ts +58 -0
  338. package/src/allend/Queries/matching.ts +16 -0
  339. package/src/allend/Queries/performance.ts +35 -0
  340. package/src/allend/Queries/pricing.ts +51 -0
  341. package/src/allend/{DClient/Event.ts → Realtime/index.ts} +23 -22
  342. package/src/allend/Shared/account.ts +24 -0
  343. package/src/allend/Shared/buckets.ts +117 -0
  344. package/src/allend/Shared/context.ts +36 -0
  345. package/src/allend/Shared/faqs.ts +106 -0
  346. package/src/allend/Shared/invitation.ts +77 -0
  347. package/src/allend/Shared/operators.ts +84 -0
  348. package/src/allend/Shared/users.ts +32 -0
  349. package/src/allend/Tracking/index.ts +48 -0
  350. package/src/allend/Utilities/common.ts +63 -0
  351. package/src/allend/Utilities/fares.ts +45 -0
  352. package/src/allend/Utilities/index.ts +52 -0
  353. package/src/allend/Utilities/nearby.ts +36 -0
  354. package/src/allend/{DClient → Workflows}/Client.ts +12 -22
  355. package/src/allend/Workflows/Delivery.ts +94 -0
  356. package/src/allend/Workflows/index.ts +31 -0
  357. package/src/allend/Workspace/index.ts +302 -0
  358. package/src/allend/index.ts +23 -10
  359. package/src/backend/Auth.ts +68 -35
  360. package/src/baseUrl.ts +81 -7
  361. package/src/core.ts +145 -0
  362. package/src/error.ts +27 -0
  363. package/src/index.ts +25 -17
  364. package/src/react-native.ts +43 -0
  365. package/src/types/access.d.ts +64 -7
  366. package/src/types/auth.d.ts +17 -17
  367. package/src/types/channel.d.ts +45 -0
  368. package/src/types/index.d.ts +379 -237
  369. package/src/utils/index.ts +33 -1
  370. package/dist/allend/DAuth/index.d.ts +0 -20
  371. package/dist/allend/DAuth/index.js +0 -92
  372. package/dist/allend/DAuth/index.js.map +0 -1
  373. package/dist/allend/DClient/Client.d.ts +0 -10
  374. package/dist/allend/DClient/Client.js +0 -144
  375. package/dist/allend/DClient/Client.js.map +0 -1
  376. package/dist/allend/DClient/Event.js +0 -100
  377. package/dist/allend/DClient/Event.js.map +0 -1
  378. package/dist/allend/DClient/Order.d.ts +0 -49
  379. package/dist/allend/DClient/Order.js +0 -601
  380. package/dist/allend/DClient/Order.js.map +0 -1
  381. package/dist/bundle.js +0 -1
  382. package/src/allend/DAuth/index.ts +0 -39
  383. package/src/allend/DClient/Order.ts +0 -452
@@ -0,0 +1,162 @@
1
+ import type { UserSession } from '../../types/access';
2
+ import type { Workspace as WorkspaceRecord } from '@de./types/workspace';
3
+ import type { Admin, AdminUpdate } from '@de./types/workspace/admin';
4
+ import type { Connector, ConnectorType } from '@de./types/workspace/connector';
5
+ import AccessManager from '../Access';
6
+ import { type Res } from '../../utils';
7
+ export type WorkspaceConfig = {
8
+ context: string;
9
+ accessToken: string;
10
+ env?: 'dev' | 'staging' | 'prod';
11
+ platform?: 'web' | 'mobile' | 'server' | 'proxy';
12
+ remoteOrigin?: string;
13
+ /** Per-request deadline in ms. See `AccessOptions.timeout`. */
14
+ timeout?: number;
15
+ /** Explicit service origin, overriding the env table. See `AccessOptions.baseUrl`. */
16
+ baseUrl?: string;
17
+ /**
18
+ * The signed-in operator.
19
+ *
20
+ * Required in practice. de.workspace authenticates a *person*, not an
21
+ * integration — its routes read `de-auth-token` / `de-auth-device` — so a
22
+ * client carrying only a bearer token cannot reach any of them.
23
+ */
24
+ session?: UserSession;
25
+ };
26
+ /** The four provider kinds a workspace can register, as they appear in a path. */
27
+ export type ProviderKind = 'lsp' | 'csp' | 'dev' | 'iotsp';
28
+ /** Context type as the connector routes spell it. */
29
+ export type ContextType = 'LSP' | 'CSP' | 'DEV' | 'IoTSP';
30
+ export type ProviderRecord = {
31
+ xcode: string;
32
+ name: string;
33
+ type: string;
34
+ };
35
+ export default class Workspace extends AccessManager {
36
+ constructor(config: WorkspaceConfig);
37
+ /**
38
+ * Returns the envelope, like every other client here.
39
+ *
40
+ * de.workspace answers `{ error, status, message, data }` too, and its
41
+ * `status` names a refusal precisely — WORKSPACE::EXISTS on a second
42
+ * setup, "already enabled" on a redundant enable. Both are outcomes a
43
+ * caller acts on rather than failures.
44
+ */
45
+ private call;
46
+ /**
47
+ * A person may own exactly one workspace; a second call answers
48
+ * WORKSPACE::EXISTS rather than creating another.
49
+ */
50
+ create(body?: {
51
+ settings?: {
52
+ theme?: string;
53
+ };
54
+ }): Promise<Res<{
55
+ wid: string;
56
+ }>>;
57
+ retrieve(wid: string): Promise<Res<WorkspaceRecord>>;
58
+ update(wid: string, body: Partial<Pick<WorkspaceRecord, 'settings'>>): Promise<Res<WorkspaceRecord>>;
59
+ /** Deletion is two-step: an intent, then the delete that quotes it. */
60
+ requestDeletion(wid: string): Promise<Res<{
61
+ intent: string;
62
+ }>>;
63
+ remove(wid: string, querystring?: {
64
+ intent?: string;
65
+ }): Promise<Res<void>>;
66
+ createProvider(wid: string, kind: ProviderKind, body: Record<string, any>): Promise<Res<{
67
+ xcode: string;
68
+ context: string;
69
+ }>>;
70
+ listProviders(wid: string, kind: ProviderKind): Promise<Res<Record<string, ProviderRecord[]>>>;
71
+ retrieveProvider(wid: string, kind: ProviderKind, xcode: string): Promise<Res<ProviderRecord>>;
72
+ updateProvider(wid: string, kind: ProviderKind, xcode: string, body: Record<string, any>): Promise<Res<ProviderRecord>>;
73
+ /**
74
+ * Base64 of `wid:TYPE:xcode` — the context string every other client in
75
+ * this SDK is constructed with.
76
+ */
77
+ getProviderContext(wid: string, kind: ProviderKind, xcode: string): Promise<Res<{
78
+ context: string;
79
+ }>>;
80
+ requestProviderDeletion(wid: string, kind: ProviderKind, xcode: string): Promise<Res<{
81
+ intent: string;
82
+ }>>;
83
+ removeProvider(wid: string, kind: ProviderKind, xcode: string, querystring?: {
84
+ intent?: string;
85
+ }): Promise<Res<void>>;
86
+ /**
87
+ * Created disabled, and the reply carries only the id — the secret has to
88
+ * be read back with `getConnector`.
89
+ */
90
+ createConnector(wid: string, ctype: ContextType, xcode: string, body: {
91
+ name: string;
92
+ type: ConnectorType;
93
+ description?: string;
94
+ config?: Record<string, any>;
95
+ }): Promise<Res<{
96
+ connectorId: string;
97
+ }>>;
98
+ listConnectors(wid: string, ctype: ContextType, xcode: string, querystring?: Record<string, any>): Promise<Res<{
99
+ connectors?: Connector[];
100
+ }>>;
101
+ getConnector(wid: string, ctype: ContextType, xcode: string, id: string): Promise<Res<{
102
+ connector: Connector;
103
+ }>>;
104
+ updateConnector(wid: string, ctype: ContextType, xcode: string, id: string, body: Record<string, any>): Promise<Res<Connector>>;
105
+ /**
106
+ * Enable or disable. Both are bodiless — Fastify rejects a JSON
107
+ * content-type with no body, and the transport sends one only when there
108
+ * is a body to send.
109
+ */
110
+ setConnectorEnabled(wid: string, ctype: ContextType, xcode: string, id: string, enabled: boolean): Promise<Res<void>>;
111
+ /** Replaces the config wholesale; `patchConnectorConfig` merges instead. */
112
+ setConnectorConfig(wid: string, ctype: ContextType, xcode: string, id: string, config: Record<string, any>): Promise<Res<void>>;
113
+ patchConnectorConfig(wid: string, ctype: ContextType, xcode: string, id: string, config: Record<string, any>): Promise<Res<void>>;
114
+ /**
115
+ * Origin allow-list and maintainers.
116
+ *
117
+ * An empty `origins` means no origin check at all, which is what a client
118
+ * that must not pin itself to one hostname wants.
119
+ */
120
+ setConnectorAccess(wid: string, ctype: ContextType, xcode: string, id: string, body: {
121
+ origins?: string[];
122
+ maintainers?: string[];
123
+ }): Promise<Res<void>>;
124
+ rotateConnectorSecret(wid: string, ctype: ContextType, xcode: string, id: string): Promise<Res<{
125
+ secret: string;
126
+ }>>;
127
+ requestConnectorDeletion(wid: string, ctype: ContextType, xcode: string, id: string): Promise<Res<{
128
+ intent: string;
129
+ }>>;
130
+ removeConnector(wid: string, ctype: ContextType, xcode: string, id: string, querystring?: {
131
+ intent?: string;
132
+ }): Promise<Res<void>>;
133
+ listAdmins(wid: string, querystring?: Record<string, any>): Promise<Res<{
134
+ admins?: Admin[];
135
+ }>>;
136
+ getAdmin(wid: string, id: string): Promise<Res<Admin>>;
137
+ updateAdmin(wid: string, id: string, body: AdminUpdate): Promise<Res<Admin>>;
138
+ removeAdmin(wid: string, id: string): Promise<Res<void>>;
139
+ getBilling(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
140
+ getBillingUsage(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
141
+ listBillingNotifications(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
142
+ acknowledgeBillingNotification(wid: string, id: string): Promise<Res<void>>;
143
+ listInvoices(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
144
+ listConnectorBilling(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
145
+ getConnectorBilling(wid: string, cid: string): Promise<Res<any>>;
146
+ getConnectorBillingHistory(wid: string, cid: string, querystring?: Record<string, any>): Promise<Res<any>>;
147
+ estimateConnectorBilling(wid: string, cid: string, body: Record<string, any>): Promise<Res<any>>;
148
+ changeConnectorTier(wid: string, cid: string, body: Record<string, any>): Promise<Res<any>>;
149
+ listUsers(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
150
+ getUser(wid: string, uid: string): Promise<Res<any>>;
151
+ removeUser(wid: string, uid: string): Promise<Res<void>>;
152
+ getAccount(wid: string): Promise<Res<any>>;
153
+ /** Who this account already knows in the workspace. */
154
+ getAccountKnows(wid: string, querystring?: Record<string, any>): Promise<Res<any>>;
155
+ invite(wid: string, as: string, body: Record<string, any>): Promise<Res<{
156
+ vcode: string;
157
+ }>>;
158
+ cancelInvitation(wid: string, body: Record<string, any>): Promise<Res<void>>;
159
+ acceptInvitation(wid: string, body: {
160
+ vcode: string;
161
+ }): Promise<Res<any>>;
162
+ }
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Access_1 = __importDefault(require("../Access"));
7
+ const utils_1 = require("../../utils");
8
+ // ─────────────────────────────────────────────────────────────────────────────
9
+ //
10
+ // Workspace: the control plane — de.workspace routes.
11
+ //
12
+ // A separate service from de.arch, which serves no `/workspace` routes at all.
13
+ // This client previously addressed `/workspace/admins`, `/workspace/connectors`
14
+ // and `/workspace/providers/lsps` against the API host; none of those exist
15
+ // anywhere, so every method 404'd. The real surface is workspace-id scoped:
16
+ // `/v1/:wid/admins`, `/v1/:wid/:ctype/:xcode/connectors`, `/v1/:wid/lsps`.
17
+ //
18
+ // Route shapes are taken from de.workspace/src/api/index.ts.
19
+ //
20
+ // ─────────────────────────────────────────────────────────────────────────────
21
+ class Workspace extends Access_1.default {
22
+ constructor(config) {
23
+ if (!config.context)
24
+ throw new Error('Undefined context. See https://doc.dedot.io/sdk/workspace');
25
+ if (!config.accessToken)
26
+ throw new Error('Undefined accessToken. See https://doc.dedot.io/sdk/auth');
27
+ const access = {
28
+ context: config.context,
29
+ accessToken: config.accessToken,
30
+ env: config.env || 'dev',
31
+ platform: config.platform || 'proxy',
32
+ remoteOrigin: config.remoteOrigin,
33
+ timeout: config.timeout,
34
+ baseUrl: config.baseUrl,
35
+ session: config.session
36
+ };
37
+ super(access, 'WSP');
38
+ }
39
+ /**
40
+ * Returns the envelope, like every other client here.
41
+ *
42
+ * de.workspace answers `{ error, status, message, data }` too, and its
43
+ * `status` names a refusal precisely — WORKSPACE::EXISTS on a second
44
+ * setup, "already enabled" on a redundant enable. Both are outcomes a
45
+ * caller acts on rather than failures.
46
+ */
47
+ call(method, url, body) {
48
+ return this.request({ url, method, ...(body !== undefined ? { body } : {}) });
49
+ }
50
+ // ── Workspace ─────────────────────────────────────────────────────────────
51
+ /**
52
+ * A person may own exactly one workspace; a second call answers
53
+ * WORKSPACE::EXISTS rather than creating another.
54
+ */
55
+ async create(body = {}) {
56
+ return this.call('POST', '/workspace/setup', body);
57
+ }
58
+ async retrieve(wid) {
59
+ return this.call('GET', `/workspace/${wid}`);
60
+ }
61
+ async update(wid, body) {
62
+ return this.call('PATCH', `/workspace/${wid}`, body);
63
+ }
64
+ /** Deletion is two-step: an intent, then the delete that quotes it. */
65
+ async requestDeletion(wid) {
66
+ return this.call('POST', `/workspace/${wid}/deletion/intent`, {});
67
+ }
68
+ async remove(wid, querystring) {
69
+ return this.call('DELETE', `/workspace/${wid}${(0, utils_1.qs)(querystring)}`);
70
+ }
71
+ // ── Providers ─────────────────────────────────────────────────────────────
72
+ async createProvider(wid, kind, body) {
73
+ return this.call('POST', `/${wid}/${kind}/setup`, body);
74
+ }
75
+ async listProviders(wid, kind) {
76
+ return this.call('GET', `/${wid}/${kind}s`);
77
+ }
78
+ async retrieveProvider(wid, kind, xcode) {
79
+ return this.call('GET', `/${wid}/${kind}/${xcode}`);
80
+ }
81
+ async updateProvider(wid, kind, xcode, body) {
82
+ return this.call('PATCH', `/${wid}/${kind}/${xcode}`, body);
83
+ }
84
+ /**
85
+ * Base64 of `wid:TYPE:xcode` — the context string every other client in
86
+ * this SDK is constructed with.
87
+ */
88
+ async getProviderContext(wid, kind, xcode) {
89
+ return this.call('GET', `/${wid}/${kind}/${xcode}/context`);
90
+ }
91
+ async requestProviderDeletion(wid, kind, xcode) {
92
+ return this.call('POST', `/${wid}/${kind}/${xcode}/deletion/intent`, {});
93
+ }
94
+ async removeProvider(wid, kind, xcode, querystring) {
95
+ return this.call('DELETE', `/${wid}/${kind}/${xcode}${(0, utils_1.qs)(querystring)}`);
96
+ }
97
+ // ── Connectors ────────────────────────────────────────────────────────────
98
+ /**
99
+ * Created disabled, and the reply carries only the id — the secret has to
100
+ * be read back with `getConnector`.
101
+ */
102
+ async createConnector(wid, ctype, xcode, body) {
103
+ return this.call('POST', `/${wid}/${ctype}/${xcode}/connectors`, body);
104
+ }
105
+ async listConnectors(wid, ctype, xcode, querystring) {
106
+ return this.call('GET', `/${wid}/${ctype}/${xcode}/connectors${(0, utils_1.qs)(querystring)}`);
107
+ }
108
+ async getConnector(wid, ctype, xcode, id) {
109
+ return this.call('GET', `/${wid}/${ctype}/${xcode}/connectors/${id}`);
110
+ }
111
+ async updateConnector(wid, ctype, xcode, id, body) {
112
+ return this.call('PATCH', `/${wid}/${ctype}/${xcode}/connectors/${id}`, body);
113
+ }
114
+ /**
115
+ * Enable or disable. Both are bodiless — Fastify rejects a JSON
116
+ * content-type with no body, and the transport sends one only when there
117
+ * is a body to send.
118
+ */
119
+ async setConnectorEnabled(wid, ctype, xcode, id, enabled) {
120
+ return this.call('PATCH', `/${wid}/${ctype}/${xcode}/connectors/${id}/${enabled ? 'enable' : 'disable'}`);
121
+ }
122
+ /** Replaces the config wholesale; `patchConnectorConfig` merges instead. */
123
+ async setConnectorConfig(wid, ctype, xcode, id, config) {
124
+ return this.call('PUT', `/${wid}/${ctype}/${xcode}/connectors/${id}/config`, config);
125
+ }
126
+ async patchConnectorConfig(wid, ctype, xcode, id, config) {
127
+ return this.call('PATCH', `/${wid}/${ctype}/${xcode}/connectors/${id}/config`, config);
128
+ }
129
+ /**
130
+ * Origin allow-list and maintainers.
131
+ *
132
+ * An empty `origins` means no origin check at all, which is what a client
133
+ * that must not pin itself to one hostname wants.
134
+ */
135
+ async setConnectorAccess(wid, ctype, xcode, id, body) {
136
+ return this.call('PATCH', `/${wid}/${ctype}/${xcode}/connectors/${id}/access`, body);
137
+ }
138
+ async rotateConnectorSecret(wid, ctype, xcode, id) {
139
+ return this.call('PATCH', `/${wid}/${ctype}/${xcode}/connectors/${id}/secret/rotate`);
140
+ }
141
+ async requestConnectorDeletion(wid, ctype, xcode, id) {
142
+ return this.call('POST', `/${wid}/${ctype}/${xcode}/connectors/${id}/deletion/intent`, {});
143
+ }
144
+ async removeConnector(wid, ctype, xcode, id, querystring) {
145
+ return this.call('DELETE', `/${wid}/${ctype}/${xcode}/connectors/${id}${(0, utils_1.qs)(querystring)}`);
146
+ }
147
+ // ── Admins ────────────────────────────────────────────────────────────────
148
+ async listAdmins(wid, querystring) {
149
+ return this.call('GET', `/${wid}/admins${(0, utils_1.qs)(querystring)}`);
150
+ }
151
+ async getAdmin(wid, id) {
152
+ return this.call('GET', `/${wid}/admins/${id}`);
153
+ }
154
+ async updateAdmin(wid, id, body) {
155
+ return this.call('PATCH', `/${wid}/admins/${id}`, body);
156
+ }
157
+ async removeAdmin(wid, id) {
158
+ return this.call('DELETE', `/${wid}/admins/${id}`);
159
+ }
160
+ // ── Billing ───────────────────────────────────────────────────────────────
161
+ async getBilling(wid, querystring) {
162
+ return this.call('GET', `/${wid}/billings${(0, utils_1.qs)(querystring)}`);
163
+ }
164
+ async getBillingUsage(wid, querystring) {
165
+ return this.call('GET', `/${wid}/billings/usage${(0, utils_1.qs)(querystring)}`);
166
+ }
167
+ async listBillingNotifications(wid, querystring) {
168
+ return this.call('GET', `/${wid}/billings/notifications${(0, utils_1.qs)(querystring)}`);
169
+ }
170
+ async acknowledgeBillingNotification(wid, id) {
171
+ return this.call('POST', `/${wid}/billings/notifications/${id}/acknowledge`, {});
172
+ }
173
+ async listInvoices(wid, querystring) {
174
+ return this.call('GET', `/${wid}/billings/invoices${(0, utils_1.qs)(querystring)}`);
175
+ }
176
+ async listConnectorBilling(wid, querystring) {
177
+ return this.call('GET', `/${wid}/billings/connectors${(0, utils_1.qs)(querystring)}`);
178
+ }
179
+ async getConnectorBilling(wid, cid) {
180
+ return this.call('GET', `/${wid}/billings/connectors/${cid}`);
181
+ }
182
+ async getConnectorBillingHistory(wid, cid, querystring) {
183
+ return this.call('GET', `/${wid}/billings/connectors/${cid}/history${(0, utils_1.qs)(querystring)}`);
184
+ }
185
+ async estimateConnectorBilling(wid, cid, body) {
186
+ return this.call('POST', `/${wid}/billings/connectors/${cid}/estimate`, body);
187
+ }
188
+ async changeConnectorTier(wid, cid, body) {
189
+ return this.call('POST', `/${wid}/billings/connectors/${cid}/tier/change`, body);
190
+ }
191
+ // ── Users & account ───────────────────────────────────────────────────────
192
+ async listUsers(wid, querystring) {
193
+ return this.call('GET', `/${wid}/users${(0, utils_1.qs)(querystring)}`);
194
+ }
195
+ async getUser(wid, uid) {
196
+ return this.call('GET', `/${wid}/users/${uid}`);
197
+ }
198
+ async removeUser(wid, uid) {
199
+ return this.call('DELETE', `/${wid}/users/${uid}`);
200
+ }
201
+ async getAccount(wid) {
202
+ return this.call('GET', `/${wid}/account`);
203
+ }
204
+ /** Who this account already knows in the workspace. */
205
+ async getAccountKnows(wid, querystring) {
206
+ return this.call('GET', `/${wid}/account/knows${(0, utils_1.qs)(querystring)}`);
207
+ }
208
+ // ── Invitation ────────────────────────────────────────────────────────────
209
+ async invite(wid, as, body) {
210
+ return this.call('POST', `/${wid}/invitation/${as}`, body);
211
+ }
212
+ async cancelInvitation(wid, body) {
213
+ return this.call('DELETE', `/${wid}/invitation`, body);
214
+ }
215
+ async acceptInvitation(wid, body) {
216
+ return this.call('POST', `/${wid}/invitation/accept`, body);
217
+ }
218
+ }
219
+ exports.default = Workspace;
220
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/allend/Workspace/index.ts"],"names":[],"mappings":";;;;;AAIA,uDAAqC;AACrC,uCAA0C;AA8B1C,gFAAgF;AAChF,EAAE;AACF,sDAAsD;AACtD,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,gFAAgF;AAEhF,MAAqB,SAAU,SAAQ,gBAAa;IACnD,YAAa,MAAuB;QACnC,IAAI,CAAC,MAAM,CAAC,OAAO;YAAO,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;QACtG,IAAI,CAAC,MAAM,CAAC,WAAW;YAAG,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;QAErG,MAAM,MAAM,GAAkB;YAC7B,OAAO,EAAO,MAAM,CAAC,OAAO;YAC5B,WAAW,EAAG,MAAM,CAAC,WAAW;YAChC,GAAG,EAAW,MAAM,CAAC,GAAG,IAAS,KAAK;YACtC,QAAQ,EAAM,MAAM,CAAC,QAAQ,IAAI,OAAO;YACxC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,OAAO,EAAO,MAAM,CAAC,OAAO;YAC5B,OAAO,EAAO,MAAM,CAAC,OAAO;YAC5B,OAAO,EAAO,MAAM,CAAC,OAAO;SAC5B,CAAA;QACD,KAAK,CAAE,MAAM,EAAE,KAAK,CAAE,CAAA;IACvB,CAAC;IAED;;;;;;;OAOG;IACK,IAAI,CAAK,MAAmD,EAAE,GAAW,EAAE,IAAU;QAC5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,CAAC;CACD;AA5PD,4BA4PC"}
@@ -1,12 +1,15 @@
1
1
  import MSI, { type MSIInterface } from './MSI';
2
2
  import Utils from '../utils';
3
3
  import IoTClient, { type IoTClientOptions } from './IoTClient';
4
- import Order from './DClient/Order';
5
- import Event from './DClient/Event';
6
- import Client from './DClient/Client';
4
+ import Event from './Realtime';
5
+ import Client from './Workflows/Client';
6
+ import Customer, { type CustomerConfig } from './Customer';
7
+ import Agent, { type AgentConfig } from './Agent';
8
+ import { type AgentRealtimeContext } from './Agent/realtime';
9
+ import Queries, { type QueriesConfig } from './Queries';
10
+ import Utilities, { type UtilitiesConfig } from './Utilities';
7
11
  declare const DClient: {
8
12
  Client: typeof Client;
9
- Order: typeof Order;
10
13
  Event: typeof Event;
11
14
  };
12
- export { type MSIInterface, MSI, Utils, DClient, IoTClient, type IoTClientOptions };
15
+ export { type MSIInterface, MSI, Utils, DClient, IoTClient, type IoTClientOptions, Customer, type CustomerConfig, Agent, type AgentConfig, type AgentRealtimeContext, Queries, type QueriesConfig, Utilities, type UtilitiesConfig };
@@ -3,16 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.IoTClient = exports.DClient = exports.Utils = exports.MSI = void 0;
7
- var MSI_1 = __importDefault(require("./MSI"));
6
+ exports.Utilities = exports.Queries = exports.Agent = exports.Customer = exports.IoTClient = exports.DClient = exports.Utils = exports.MSI = void 0;
7
+ const MSI_1 = __importDefault(require("./MSI"));
8
8
  exports.MSI = MSI_1.default;
9
- var utils_1 = __importDefault(require("../utils"));
9
+ const utils_1 = __importDefault(require("../utils"));
10
10
  exports.Utils = utils_1.default;
11
- var IoTClient_1 = __importDefault(require("./IoTClient"));
11
+ const IoTClient_1 = __importDefault(require("./IoTClient"));
12
12
  exports.IoTClient = IoTClient_1.default;
13
- var Order_1 = __importDefault(require("./DClient/Order"));
14
- var Event_1 = __importDefault(require("./DClient/Event"));
15
- var Client_1 = __importDefault(require("./DClient/Client"));
16
- var DClient = { Client: Client_1.default, Order: Order_1.default, Event: Event_1.default };
13
+ const Realtime_1 = __importDefault(require("./Realtime"));
14
+ const Client_1 = __importDefault(require("./Workflows/Client"));
15
+ const Customer_1 = __importDefault(require("./Customer"));
16
+ exports.Customer = Customer_1.default;
17
+ const Agent_1 = __importDefault(require("./Agent"));
18
+ exports.Agent = Agent_1.default;
19
+ const Queries_1 = __importDefault(require("./Queries"));
20
+ exports.Queries = Queries_1.default;
21
+ const Utilities_1 = __importDefault(require("./Utilities"));
22
+ exports.Utilities = Utilities_1.default;
23
+ const DClient = { Client: Client_1.default, Event: Realtime_1.default };
17
24
  exports.DClient = DClient;
18
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/allend/index.ts"],"names":[],"mappings":";;;;;;AAAA,8CAA8C;AAY5C,cAZK,aAAG,CAYL;AAXL,mDAA4B;AAY1B,gBAZK,eAAK,CAYL;AAVP,0DAA8D;AAY5D,oBAZK,mBAAS,CAYL;AAXX,0DAAmC;AACnC,0DAAmC;AACnC,4DAAqC;AAErC,IAAM,OAAO,GAAG,EAAE,MAAM,kBAAA,EAAE,KAAK,iBAAA,EAAE,KAAK,iBAAA,EAAE,CAAA;AAMtC,0BAAO"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/allend/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA8C;AAgB7C,cAhBM,aAAG,CAgBN;AAfJ,qDAA4B;AAgB3B,gBAhBM,eAAK,CAgBN;AAdN,4DAA8D;AAgB7D,oBAhBM,mBAAS,CAgBN;AAfV,0DAA8B;AAC9B,gEAAuC;AACvC,0DAA0D;AAezD,mBAfM,kBAAQ,CAeN;AAdT,oDAAiD;AAgBhD,gBAhBM,eAAK,CAgBN;AAdN,wDAAuD;AAiBtD,kBAjBM,iBAAO,CAiBN;AAhBR,4DAA6D;AAkB5D,oBAlBM,mBAAS,CAkBN;AAhBV,MAAM,OAAO,GAAG,EAAE,MAAM,EAAN,gBAAM,EAAE,KAAK,EAAL,kBAAK,EAAE,CAAA;AAMhC,0BAAO"}
@@ -1,15 +1,39 @@
1
- import type { AuthCredentials, AuthOptions } from '../types/auth';
1
+ export type AuthConfig = {
2
+ context: string;
3
+ cid: string;
4
+ secret: string;
5
+ remoteOrigin?: string;
6
+ env?: 'dev' | 'staging' | 'prod';
7
+ version?: number;
8
+ /**
9
+ * Operator uid to embed in the minted token's scope.
10
+ *
11
+ * Routes behind `isAllowed` look the caller up in the `operators`
12
+ * collection by uid, so a token minted without one is rejected with
13
+ * "Require <uid> generated accessToken" no matter how valid the connector
14
+ * credentials are. Omit it for pure machine-to-machine access.
15
+ */
16
+ uid?: string;
17
+ autorefresh?: boolean;
18
+ onNewToken?: (token: string) => void;
19
+ /** Host to substitute for `localhost` in `dev` (Eg. a native emulator) */
20
+ devHostname?: string;
21
+ };
2
22
  export default class Auth {
3
23
  private version;
4
- private options;
5
- protected creds: AuthCredentials;
24
+ private env;
25
+ private cid;
26
+ private secret;
27
+ private context;
28
+ private uid?;
29
+ private remoteOrigin?;
6
30
  private refreshTimer?;
7
31
  private autorefresh?;
8
32
  private onNewToken?;
9
33
  private baseURL;
10
34
  private isRotating;
11
35
  accessToken?: string;
12
- constructor(creds: AuthCredentials, options?: AuthOptions);
36
+ constructor(config: AuthConfig);
13
37
  private request;
14
38
  private debug;
15
39
  private error;