@burdenoff/be-sdk 2026.1110.2 → 2026.1110.4

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 (497) hide show
  1. package/configs/eslint/index.js +1 -1
  2. package/configs/tsconfig/tsconfig.json +1 -1
  3. package/dist/EventQueueFactory-9NGZV9jl.js +1457 -0
  4. package/dist/EventQueueFactory-9NGZV9jl.js.map +1 -0
  5. package/dist/RedisStreamsConnection-CY8WySJy.js +283 -0
  6. package/dist/RedisStreamsConnection-CY8WySJy.js.map +1 -0
  7. package/dist/activity/index.d.ts +165 -0
  8. package/dist/activity/index.js +389 -0
  9. package/dist/activity/index.js.map +1 -0
  10. package/dist/ai-credits/index.d.ts +2 -3
  11. package/dist/ai-credits/index.js +3 -4
  12. package/dist/ai-credits/index.js.map +1 -1
  13. package/dist/ai-credits-xxfwGpHS.js +546 -0
  14. package/dist/ai-credits-xxfwGpHS.js.map +1 -0
  15. package/dist/{assistant-session-CJZhF4D6.d.ts → assistant-session-DA5ZKJOr.d.ts} +4 -5
  16. package/dist/auth/index.d.ts +2 -77
  17. package/dist/auth/index.js +3 -7
  18. package/dist/auth/index.js.map +1 -1
  19. package/dist/auth-C5ctwSLp.js +228 -0
  20. package/dist/auth-C5ctwSLp.js.map +1 -0
  21. package/dist/bootstrap/index.d.ts +74 -0
  22. package/dist/bootstrap/index.js +282 -0
  23. package/dist/bootstrap/index.js.map +1 -0
  24. package/dist/cache/index.d.ts +2 -3
  25. package/dist/cache/index.js +3 -7
  26. package/dist/cache/index.js.map +1 -1
  27. package/dist/cache-CU0uLwcS.js +1837 -0
  28. package/dist/cache-CU0uLwcS.js.map +1 -0
  29. package/dist/captcha/index.d.ts +2 -1
  30. package/dist/captcha/index.js +3 -3
  31. package/dist/captcha/index.js.map +1 -1
  32. package/dist/captcha-BT7yh1YS.js +77 -0
  33. package/dist/captcha-BT7yh1YS.js.map +1 -0
  34. package/dist/client/internal-client.d.ts +4 -7
  35. package/dist/client/internal-client.js +172 -4
  36. package/dist/client/internal-client.js.map +1 -1
  37. package/dist/client-BgAEvDC2.d.ts +86 -0
  38. package/dist/client-sAJTrb4i.js +565 -0
  39. package/dist/client-sAJTrb4i.js.map +1 -0
  40. package/dist/collector-endpoint-iyQYeI50.js +50 -0
  41. package/dist/collector-endpoint-iyQYeI50.js.map +1 -0
  42. package/dist/context/index.d.ts +35 -0
  43. package/dist/context/index.js +283 -0
  44. package/dist/context/index.js.map +1 -0
  45. package/dist/crypto/index.d.ts +2 -1
  46. package/dist/crypto/index.js +3 -3
  47. package/dist/crypto/index.js.map +1 -1
  48. package/dist/crypto-DO9fM0FO.js +145 -0
  49. package/dist/crypto-DO9fM0FO.js.map +1 -0
  50. package/dist/database/index.d.ts +104 -108
  51. package/dist/database/index.js +468 -6
  52. package/dist/database/index.js.map +1 -1
  53. package/dist/dataloader/index.d.ts +2 -1
  54. package/dist/dataloader/index.js +3 -3
  55. package/dist/dataloader/index.js.map +1 -1
  56. package/dist/dataloader-DwpT3YoS.js +294 -0
  57. package/dist/dataloader-DwpT3YoS.js.map +1 -0
  58. package/dist/deployed-environment-p_Tdl3sT.js +38 -0
  59. package/dist/deployed-environment-p_Tdl3sT.js.map +1 -0
  60. package/dist/dist-BGKdXVy3.js +1718 -0
  61. package/dist/dist-BGKdXVy3.js.map +1 -0
  62. package/dist/env-DdaoGjIt.js +74 -0
  63. package/dist/env-DdaoGjIt.js.map +1 -0
  64. package/dist/event-queue/index.d.ts +2 -7
  65. package/dist/event-queue/index.js +7 -9
  66. package/dist/event-queue/index.js.map +1 -1
  67. package/dist/event-queue-Cw-YJPY_.js +1384 -0
  68. package/dist/event-queue-Cw-YJPY_.js.map +1 -0
  69. package/dist/{explicit-activity-scope-CCoxVwAr.d.ts → explicit-activity-scope-D8VeGGpt.d.ts} +1 -2
  70. package/dist/explicit-activity-scope-DikJ7NAE.js +57 -0
  71. package/dist/explicit-activity-scope-DikJ7NAE.js.map +1 -0
  72. package/dist/export/index.d.ts +2 -2
  73. package/dist/export/index.js +3 -14
  74. package/dist/export/index.js.map +1 -1
  75. package/dist/export-DJXE3Osa.js +642 -0
  76. package/dist/export-DJXE3Osa.js.map +1 -0
  77. package/dist/feature-flags/index.d.ts +2 -10
  78. package/dist/feature-flags/index.js +3 -6
  79. package/dist/feature-flags/index.js.map +1 -1
  80. package/dist/feature-flags-CP1KRgwD.js +422 -0
  81. package/dist/feature-flags-CP1KRgwD.js.map +1 -0
  82. package/dist/files/index.d.ts +2 -3
  83. package/dist/files/index.js +3 -4
  84. package/dist/files/index.js.map +1 -1
  85. package/dist/files-h5U-D2AF.js +830 -0
  86. package/dist/files-h5U-D2AF.js.map +1 -0
  87. package/dist/gateway/index.d.ts +4 -6
  88. package/dist/gateway/index.js +7 -13
  89. package/dist/gateway/index.js.map +1 -1
  90. package/dist/gateway/security/index.d.ts +2 -2
  91. package/dist/gateway/security/index.js +3 -5
  92. package/dist/gateway/security/index.js.map +1 -1
  93. package/dist/gateway-ByVo-n37.js +50 -0
  94. package/dist/gateway-ByVo-n37.js.map +1 -0
  95. package/dist/graph/index.d.ts +3 -10
  96. package/dist/graph/index.js +4 -13
  97. package/dist/graph/index.js.map +1 -1
  98. package/dist/graph-CR7u4lpl.js +2152 -0
  99. package/dist/graph-CR7u4lpl.js.map +1 -0
  100. package/dist/graph-emitter-CdOXP7Tn.js +621 -0
  101. package/dist/graph-emitter-CdOXP7Tn.js.map +1 -0
  102. package/dist/graphql/index.d.ts +3 -2
  103. package/dist/graphql/index.js +4 -6
  104. package/dist/graphql/index.js.map +1 -1
  105. package/dist/graphql/services/index.d.ts +2 -24
  106. package/dist/graphql/services/index.js +3 -4
  107. package/dist/graphql/services/index.js.map +1 -1
  108. package/dist/graphql-CUDyhibV.d.ts +21 -0
  109. package/dist/graphql-DHAHHcww.js +161 -0
  110. package/dist/graphql-DHAHHcww.js.map +1 -0
  111. package/dist/i18n/index.d.ts +3 -3
  112. package/dist/i18n/index.js +3 -4
  113. package/dist/i18n/index.js.map +1 -1
  114. package/dist/i18n-BBMYFd0P.js +860 -0
  115. package/dist/i18n-BBMYFd0P.js.map +1 -0
  116. package/dist/import-optional-peer-B82VYxeX.js +18 -0
  117. package/dist/import-optional-peer-B82VYxeX.js.map +1 -0
  118. package/dist/index-3KOZ1zN9.d.ts +233 -0
  119. package/dist/index-ADmsX0BI.d.ts +646 -0
  120. package/dist/index-B2LCaK0R.d.ts +500 -0
  121. package/dist/index-BBqooJ52.d.ts +45 -0
  122. package/dist/index-BGzMYJsm.d.ts +209 -0
  123. package/dist/index-BMIMnp6T.d.ts +8 -0
  124. package/dist/index-BVOL7458.d.ts +10 -0
  125. package/dist/index-BcqQs-Uq.d.ts +69 -0
  126. package/dist/index-BeVtqGO-.d.ts +208 -0
  127. package/dist/index-BiTzGUZP.d.ts +114 -0
  128. package/dist/index-C0qLquY0.d.ts +150 -0
  129. package/dist/index-C5uEKchX.d.ts +60 -0
  130. package/dist/index-CDOqxSIi.d.ts +37 -0
  131. package/dist/index-CG6wj66Y.d.ts +148 -0
  132. package/dist/index-CHwMhK6v.d.ts +63 -0
  133. package/dist/index-CIgoeobA.d.ts +145 -0
  134. package/dist/index-CPQDMSFS.d.ts +103 -0
  135. package/dist/index-CSRcgkVi.d.ts +23 -0
  136. package/dist/index-CTTwo9av.d.ts +102 -0
  137. package/dist/index-CVCyKzhB.d.ts +207 -0
  138. package/dist/index-C_GXXF32.d.ts +704 -0
  139. package/dist/index-CaM9JUcc.d.ts +144 -0
  140. package/dist/index-CliOgq6L.d.ts +203 -0
  141. package/dist/index-Cot73bdh.d.ts +63 -0
  142. package/dist/index-DGgh9DWn.d.ts +59 -0
  143. package/dist/index-DY3dNhMN.d.ts +420 -0
  144. package/dist/index-DqbGqfAy.d.ts +127 -0
  145. package/dist/index-Dt1HJPTX.d.ts +12 -0
  146. package/dist/index-DtI6aBtB.d.ts +22 -0
  147. package/dist/index-FKohsiex.d.ts +38 -0
  148. package/dist/index-FRRaa6h2.d.ts +999 -0
  149. package/dist/index-FbXPfen7.d.ts +132 -0
  150. package/dist/index-MArCb8Aq.d.ts +306 -0
  151. package/dist/index-U_tu3zUl.d.ts +303 -0
  152. package/dist/index-YOShAwkq.d.ts +45 -0
  153. package/dist/index-cmR9k9ga.d.ts +26 -0
  154. package/dist/index-yBSjMY32.d.ts +24 -0
  155. package/dist/index-zd_NPGJo.d.ts +206 -0
  156. package/dist/index.d.ts +106 -609
  157. package/dist/index.js +769 -2590
  158. package/dist/index.js.map +1 -1
  159. package/dist/init/index.d.ts +2 -2
  160. package/dist/init/index.js +3 -16
  161. package/dist/init/index.js.map +1 -1
  162. package/dist/init-CQPFmOOe.js +325 -0
  163. package/dist/init-CQPFmOOe.js.map +1 -0
  164. package/dist/instrumentation/index.d.ts +3 -4
  165. package/dist/instrumentation/index.js +5 -5
  166. package/dist/instrumentation/index.js.map +1 -1
  167. package/dist/instrumentation-xkkmDgJ0.js +1678 -0
  168. package/dist/instrumentation-xkkmDgJ0.js.map +1 -0
  169. package/dist/lake/index.d.ts +50 -54
  170. package/dist/lake/index.js +169 -193
  171. package/dist/lake/index.js.map +1 -1
  172. package/dist/layer/index.d.ts +3 -2
  173. package/dist/layer/index.js +4 -5
  174. package/dist/layer/index.js.map +1 -1
  175. package/dist/layer-BZBZZWeV.d.ts +69 -0
  176. package/dist/layer-Bcix-WCl.js +105 -0
  177. package/dist/layer-Bcix-WCl.js.map +1 -0
  178. package/dist/layer-CEKy6cm8.js +252 -0
  179. package/dist/layer-CEKy6cm8.js.map +1 -0
  180. package/dist/lifecycle/index.d.ts +2 -1
  181. package/dist/lifecycle/index.js +3 -4
  182. package/dist/lifecycle/index.js.map +1 -1
  183. package/dist/lifecycle-DeoLSX0U.js +76 -0
  184. package/dist/lifecycle-DeoLSX0U.js.map +1 -0
  185. package/dist/logger/index.d.ts +2 -3
  186. package/dist/logger/index.js +3 -3
  187. package/dist/logger/index.js.map +1 -1
  188. package/dist/logger-B6rCpb7D.js +290 -0
  189. package/dist/logger-B6rCpb7D.js.map +1 -0
  190. package/dist/metrics/index.d.ts +13 -14
  191. package/dist/metrics/index.js +3 -4
  192. package/dist/metrics/index.js.map +1 -1
  193. package/dist/metrics-BrLwNUrb.js +52 -0
  194. package/dist/metrics-BrLwNUrb.js.map +1 -0
  195. package/dist/metrics-collector-C2eShrlW.js +922 -0
  196. package/dist/metrics-collector-C2eShrlW.js.map +1 -0
  197. package/dist/middleware/index.d.ts +3 -3
  198. package/dist/middleware/index.js +3 -4
  199. package/dist/middleware/index.js.map +1 -1
  200. package/dist/middleware-CUxJVUpD.js +1243 -0
  201. package/dist/middleware-CUxJVUpD.js.map +1 -0
  202. package/dist/middleware-Cq0zFMGp.js +253 -0
  203. package/dist/middleware-Cq0zFMGp.js.map +1 -0
  204. package/dist/notifications/index.d.ts +2 -5
  205. package/dist/notifications/index.js +3 -6
  206. package/dist/notifications/index.js.map +1 -1
  207. package/dist/notifications-DY_i37WN.js +869 -0
  208. package/dist/notifications-DY_i37WN.js.map +1 -0
  209. package/dist/observability/index.d.ts +2 -3
  210. package/dist/observability/index.js +3 -4
  211. package/dist/observability/index.js.map +1 -1
  212. package/dist/observability-DBDXipTU.js +272 -0
  213. package/dist/observability-DBDXipTU.js.map +1 -0
  214. package/dist/payments/index.d.ts +144 -0
  215. package/dist/payments/index.js +404 -0
  216. package/dist/payments/index.js.map +1 -0
  217. package/dist/platform/index.d.ts +2 -1
  218. package/dist/platform/index.js +3 -5
  219. package/dist/platform/index.js.map +1 -1
  220. package/dist/platform-DZwczW7v.js +1510 -0
  221. package/dist/platform-DZwczW7v.js.map +1 -0
  222. package/dist/prisma/generator/index.d.ts +1 -1
  223. package/dist/prisma/generator/index.js +97 -84
  224. package/dist/prisma/generator/index.js.map +1 -1
  225. package/dist/prisma/index.d.ts +4 -7
  226. package/dist/prisma/index.js +5 -12
  227. package/dist/prisma/index.js.map +1 -1
  228. package/dist/prisma-BzOOdt79.js +863 -0
  229. package/dist/prisma-BzOOdt79.js.map +1 -0
  230. package/dist/prisma-extension-Cfl09swM.d.ts +172 -0
  231. package/dist/product-alias/index.d.ts +2 -1
  232. package/dist/product-alias/index.js +3 -3
  233. package/dist/product-alias/index.js.map +1 -1
  234. package/dist/product-alias-BPqtskMq.js +273 -0
  235. package/dist/product-alias-BPqtskMq.js.map +1 -0
  236. package/dist/rate-limit-CBrK_U5H.js +142 -0
  237. package/dist/rate-limit-CBrK_U5H.js.map +1 -0
  238. package/dist/rbac/index.d.ts +2 -122
  239. package/dist/rbac/index.js +3 -6
  240. package/dist/rbac/index.js.map +1 -1
  241. package/dist/rbac-Dvz0YzEt.js +1486 -0
  242. package/dist/rbac-Dvz0YzEt.js.map +1 -0
  243. package/dist/resource-caps/index.d.ts +66 -72
  244. package/dist/resource-caps/index.js +430 -5
  245. package/dist/resource-caps/index.js.map +1 -1
  246. package/dist/rolldown-runtime-ad2WFvuA.js +17 -0
  247. package/dist/sdk-Dju9o-sq.js +124 -0
  248. package/dist/sdk-Dju9o-sq.js.map +1 -0
  249. package/dist/search/index.d.ts +112 -0
  250. package/dist/search/index.js +266 -0
  251. package/dist/search/index.js.map +1 -0
  252. package/dist/security/index.d.ts +2 -0
  253. package/dist/security/index.js +4 -0
  254. package/dist/security/index.js.map +1 -0
  255. package/dist/security/rate-limit/index.d.ts +2 -0
  256. package/dist/security/rate-limit/index.js +4 -0
  257. package/dist/security/rate-limit/index.js.map +1 -0
  258. package/dist/security-DIG-95Ic.js +1647 -0
  259. package/dist/security-DIG-95Ic.js.map +1 -0
  260. package/dist/server/index.d.ts +7 -164
  261. package/dist/server/index.js +2001 -1507
  262. package/dist/server/index.js.map +1 -1
  263. package/dist/service-jwt-Bu-WNA_-.js +80 -0
  264. package/dist/service-jwt-Bu-WNA_-.js.map +1 -0
  265. package/dist/services-BWzfz7vG.js +102 -0
  266. package/dist/services-BWzfz7vG.js.map +1 -0
  267. package/dist/sharding/index.d.ts +41 -44
  268. package/dist/sharding/index.js +156 -137
  269. package/dist/sharding/index.js.map +1 -1
  270. package/dist/sharing/index.d.ts +2 -1
  271. package/dist/sharing/index.js +3 -4
  272. package/dist/sharing/index.js.map +1 -1
  273. package/dist/sharing-CflDsSJ-.js +911 -0
  274. package/dist/sharing-CflDsSJ-.js.map +1 -0
  275. package/dist/stub-BUnfMiAS.js +577 -0
  276. package/dist/stub-BUnfMiAS.js.map +1 -0
  277. package/dist/tags/index.d.ts +2 -3
  278. package/dist/tags/index.js +3 -4
  279. package/dist/tags/index.js.map +1 -1
  280. package/dist/tags-CbijgoqR.js +868 -0
  281. package/dist/{chunk-PBZFAAOM.js.map → tags-CbijgoqR.js.map} +1 -1
  282. package/dist/telemetry/index.d.ts +64 -76
  283. package/dist/telemetry/index.js +369 -201
  284. package/dist/telemetry/index.js.map +1 -1
  285. package/dist/temporal/index.d.ts +2 -148
  286. package/dist/temporal/index.js +3 -5
  287. package/dist/temporal/index.js.map +1 -1
  288. package/dist/temporal-B534uYK8.js +706 -0
  289. package/dist/temporal-B534uYK8.js.map +1 -0
  290. package/dist/tracker/index.d.ts +5 -11
  291. package/dist/tracker/index.js +7 -20
  292. package/dist/tracker/index.js.map +1 -1
  293. package/dist/tracker-PQztSlhJ.js +458 -0
  294. package/dist/tracker-PQztSlhJ.js.map +1 -0
  295. package/dist/translation/index.d.ts +120 -0
  296. package/dist/translation/index.js +573 -0
  297. package/dist/translation/index.js.map +1 -0
  298. package/dist/types/index.d.ts +3 -0
  299. package/dist/types/index.js +90 -0
  300. package/dist/types/index.js.map +1 -0
  301. package/dist/types-BYMYND1L.js +44 -0
  302. package/dist/types-BYMYND1L.js.map +1 -0
  303. package/dist/types-C6EKaS3V.d.ts +106 -0
  304. package/dist/types-CWybW61E.d.ts +323 -0
  305. package/dist/types-C_yfu3XK.d.ts +34 -0
  306. package/dist/types-DgaQqvxo.d.ts +70 -0
  307. package/dist/usage/index.d.ts +2 -213
  308. package/dist/usage/index.js +3 -15
  309. package/dist/usage/index.js.map +1 -1
  310. package/dist/usage-BRqVP3CJ.js +682 -0
  311. package/dist/usage-BRqVP3CJ.js.map +1 -0
  312. package/dist/utils/index.d.ts +2 -1
  313. package/dist/utils/index.js +3 -3
  314. package/dist/utils/index.js.map +1 -1
  315. package/dist/utils-DL85Tnbn.js +500 -0
  316. package/dist/utils-DL85Tnbn.js.map +1 -0
  317. package/dist/validation/index.d.ts +2 -2
  318. package/dist/validation/index.js +3 -3
  319. package/dist/validation/index.js.map +1 -1
  320. package/dist/validation-CPUITdMk.js +762 -0
  321. package/dist/validation-CPUITdMk.js.map +1 -0
  322. package/dist/workspace-extension-COrC0dYi.js +979 -0
  323. package/dist/workspace-extension-COrC0dYi.js.map +1 -0
  324. package/dist/{workspace-extension-BGwTOV_r.d.ts → workspace-extension-DTFTdGVF.d.ts} +43 -45
  325. package/package.json +7 -10
  326. package/dist/EventQueueFactory-GXC3A7DH.js +0 -8
  327. package/dist/EventQueueFactory-GXC3A7DH.js.map +0 -1
  328. package/dist/chunk-4XIBXZ6J.js +0 -276
  329. package/dist/chunk-4XIBXZ6J.js.map +0 -1
  330. package/dist/chunk-554Z4C2K.js +0 -1006
  331. package/dist/chunk-554Z4C2K.js.map +0 -1
  332. package/dist/chunk-5CAFHK2Z.js +0 -107
  333. package/dist/chunk-5CAFHK2Z.js.map +0 -1
  334. package/dist/chunk-63ZXJ42X.js +0 -451
  335. package/dist/chunk-63ZXJ42X.js.map +0 -1
  336. package/dist/chunk-6XEXJATV.js +0 -304
  337. package/dist/chunk-6XEXJATV.js.map +0 -1
  338. package/dist/chunk-726AR6Q7.js +0 -1532
  339. package/dist/chunk-726AR6Q7.js.map +0 -1
  340. package/dist/chunk-A5F6Z5UE.js +0 -21
  341. package/dist/chunk-A5F6Z5UE.js.map +0 -1
  342. package/dist/chunk-A6DE32ZS.js +0 -1507
  343. package/dist/chunk-A6DE32ZS.js.map +0 -1
  344. package/dist/chunk-AXJDGQPE.js +0 -690
  345. package/dist/chunk-AXJDGQPE.js.map +0 -1
  346. package/dist/chunk-BJQOGOVW.js +0 -602
  347. package/dist/chunk-BJQOGOVW.js.map +0 -1
  348. package/dist/chunk-CFXWH2IS.js +0 -52
  349. package/dist/chunk-CFXWH2IS.js.map +0 -1
  350. package/dist/chunk-DRWH5XCJ.js +0 -876
  351. package/dist/chunk-DRWH5XCJ.js.map +0 -1
  352. package/dist/chunk-E4QNLVY4.js +0 -909
  353. package/dist/chunk-E4QNLVY4.js.map +0 -1
  354. package/dist/chunk-EBDHIL7V.js +0 -774
  355. package/dist/chunk-EBDHIL7V.js.map +0 -1
  356. package/dist/chunk-ELU7VL3E.js +0 -245
  357. package/dist/chunk-ELU7VL3E.js.map +0 -1
  358. package/dist/chunk-FZRODKIN.js +0 -31
  359. package/dist/chunk-FZRODKIN.js.map +0 -1
  360. package/dist/chunk-GCIB76AJ.js +0 -882
  361. package/dist/chunk-GCIB76AJ.js.map +0 -1
  362. package/dist/chunk-HC6MPUIH.js +0 -1571
  363. package/dist/chunk-HC6MPUIH.js.map +0 -1
  364. package/dist/chunk-HNMHPSAM.js +0 -272
  365. package/dist/chunk-HNMHPSAM.js.map +0 -1
  366. package/dist/chunk-HTLEGD3Q.js +0 -1480
  367. package/dist/chunk-HTLEGD3Q.js.map +0 -1
  368. package/dist/chunk-I3KOWRT3.js +0 -89
  369. package/dist/chunk-I3KOWRT3.js.map +0 -1
  370. package/dist/chunk-ID3WR4JS.js +0 -509
  371. package/dist/chunk-ID3WR4JS.js.map +0 -1
  372. package/dist/chunk-JS52ZHTK.js +0 -1346
  373. package/dist/chunk-JS52ZHTK.js.map +0 -1
  374. package/dist/chunk-JVMAQOA3.js +0 -521
  375. package/dist/chunk-JVMAQOA3.js.map +0 -1
  376. package/dist/chunk-KH4TRQCO.js +0 -1063
  377. package/dist/chunk-KH4TRQCO.js.map +0 -1
  378. package/dist/chunk-KJOSPVB2.js +0 -57
  379. package/dist/chunk-KJOSPVB2.js.map +0 -1
  380. package/dist/chunk-KO2ZXZ7W.js +0 -61
  381. package/dist/chunk-KO2ZXZ7W.js.map +0 -1
  382. package/dist/chunk-KS2HQCJR.js +0 -56
  383. package/dist/chunk-KS2HQCJR.js.map +0 -1
  384. package/dist/chunk-LA5KPWZ2.js +0 -413
  385. package/dist/chunk-LA5KPWZ2.js.map +0 -1
  386. package/dist/chunk-MESLAC5W.js +0 -574
  387. package/dist/chunk-MESLAC5W.js.map +0 -1
  388. package/dist/chunk-MWPYA2HD.js +0 -94
  389. package/dist/chunk-MWPYA2HD.js.map +0 -1
  390. package/dist/chunk-NUB5GQTU.js +0 -270
  391. package/dist/chunk-NUB5GQTU.js.map +0 -1
  392. package/dist/chunk-OBBCR6WY.js +0 -277
  393. package/dist/chunk-OBBCR6WY.js.map +0 -1
  394. package/dist/chunk-OQDSAOG3.js +0 -1908
  395. package/dist/chunk-OQDSAOG3.js.map +0 -1
  396. package/dist/chunk-OXNCBE7P.js +0 -971
  397. package/dist/chunk-OXNCBE7P.js.map +0 -1
  398. package/dist/chunk-PBZFAAOM.js +0 -941
  399. package/dist/chunk-PN6GIF3R.js +0 -1185
  400. package/dist/chunk-PN6GIF3R.js.map +0 -1
  401. package/dist/chunk-PYD44IHJ.js +0 -728
  402. package/dist/chunk-PYD44IHJ.js.map +0 -1
  403. package/dist/chunk-QVPIACWD.js +0 -679
  404. package/dist/chunk-QVPIACWD.js.map +0 -1
  405. package/dist/chunk-QWNNFE4P.js +0 -41
  406. package/dist/chunk-QWNNFE4P.js.map +0 -1
  407. package/dist/chunk-RU266375.js +0 -327
  408. package/dist/chunk-RU266375.js.map +0 -1
  409. package/dist/chunk-RYTSVGGA.js +0 -1624
  410. package/dist/chunk-RYTSVGGA.js.map +0 -1
  411. package/dist/chunk-RZOFS2BQ.js +0 -225
  412. package/dist/chunk-RZOFS2BQ.js.map +0 -1
  413. package/dist/chunk-SBS4S2PJ.js +0 -100
  414. package/dist/chunk-SBS4S2PJ.js.map +0 -1
  415. package/dist/chunk-SPRG6G6G.js +0 -530
  416. package/dist/chunk-SPRG6G6G.js.map +0 -1
  417. package/dist/chunk-STWFX5E2.js +0 -233
  418. package/dist/chunk-STWFX5E2.js.map +0 -1
  419. package/dist/chunk-UNASM5VJ.js +0 -419
  420. package/dist/chunk-UNASM5VJ.js.map +0 -1
  421. package/dist/chunk-VAT66FJA.js +0 -245
  422. package/dist/chunk-VAT66FJA.js.map +0 -1
  423. package/dist/chunk-VFCMR5GX.js +0 -49
  424. package/dist/chunk-VFCMR5GX.js.map +0 -1
  425. package/dist/chunk-VGAHZKNJ.js +0 -66
  426. package/dist/chunk-VGAHZKNJ.js.map +0 -1
  427. package/dist/chunk-VTJTAAXC.js +0 -627
  428. package/dist/chunk-VTJTAAXC.js.map +0 -1
  429. package/dist/chunk-VXVLKRU6.js +0 -758
  430. package/dist/chunk-VXVLKRU6.js.map +0 -1
  431. package/dist/chunk-WWUU5ETI.js +0 -163
  432. package/dist/chunk-WWUU5ETI.js.map +0 -1
  433. package/dist/chunk-XE4OXN2W.js +0 -10
  434. package/dist/chunk-XE4OXN2W.js.map +0 -1
  435. package/dist/chunk-XOJORS75.js +0 -1853
  436. package/dist/chunk-XOJORS75.js.map +0 -1
  437. package/dist/chunk-YMZEUTD2.js +0 -110
  438. package/dist/chunk-YMZEUTD2.js.map +0 -1
  439. package/dist/chunk-Z77BTSOK.js +0 -617
  440. package/dist/chunk-Z77BTSOK.js.map +0 -1
  441. package/dist/chunk-ZZK3WEDI.js +0 -181
  442. package/dist/chunk-ZZK3WEDI.js.map +0 -1
  443. package/dist/client-CCXpAZ2r.d.ts +0 -89
  444. package/dist/client-DSI_760t.d.ts +0 -36
  445. package/dist/client-JU6T3UPB.js +0 -11
  446. package/dist/client-JU6T3UPB.js.map +0 -1
  447. package/dist/dist-2X4Q7PJA.js +0 -1491
  448. package/dist/dist-2X4Q7PJA.js.map +0 -1
  449. package/dist/env-4UWSUS64.js +0 -4
  450. package/dist/env-4UWSUS64.js.map +0 -1
  451. package/dist/graph-emitter-r5TylDBm.d.ts +0 -47
  452. package/dist/graphql-CMHMQjvd.d.ts +0 -23
  453. package/dist/i18n-Qm2AkPC-.d.ts +0 -33
  454. package/dist/index--yvpa6ay.d.ts +0 -83
  455. package/dist/index-4gKQKZ2B.d.ts +0 -71
  456. package/dist/index-5x0XMKXN.d.ts +0 -149
  457. package/dist/index-B70b5mYS.d.ts +0 -33
  458. package/dist/index-B8KrxO4j.d.ts +0 -755
  459. package/dist/index-BOuDKnqD.d.ts +0 -201
  460. package/dist/index-BTMt4OjA.d.ts +0 -201
  461. package/dist/index-BejbszA7.d.ts +0 -39
  462. package/dist/index-BkeOYZye.d.ts +0 -198
  463. package/dist/index-BuAj5nXg.d.ts +0 -83
  464. package/dist/index-BvkVcW8I.d.ts +0 -349
  465. package/dist/index-CWmH_-RZ.d.ts +0 -247
  466. package/dist/index-CbgWNcus.d.ts +0 -258
  467. package/dist/index-CmfPeQza.d.ts +0 -166
  468. package/dist/index-CmpG-zak.d.ts +0 -607
  469. package/dist/index-CoMKgL-p.d.ts +0 -12
  470. package/dist/index-D8HGwglK.d.ts +0 -541
  471. package/dist/index-DCaVm66D.d.ts +0 -1101
  472. package/dist/index-DE2w7E0d.d.ts +0 -83
  473. package/dist/index-DSOpj8DI.d.ts +0 -17
  474. package/dist/index-DW9q22GH.d.ts +0 -75
  475. package/dist/index-DnjJ9CwI.d.ts +0 -347
  476. package/dist/index-DwMJZ8PP.d.ts +0 -317
  477. package/dist/index-PaojfSdd.d.ts +0 -71
  478. package/dist/index-aHtYvc3i.d.ts +0 -284
  479. package/dist/index-e_18DzAg.d.ts +0 -18
  480. package/dist/index-ffmipXSA.d.ts +0 -55
  481. package/dist/index-joONjwLt.d.ts +0 -33
  482. package/dist/index-kssw5ziY.d.ts +0 -250
  483. package/dist/index-lFffh5-G.d.ts +0 -125
  484. package/dist/index-pxYge_6k.d.ts +0 -79
  485. package/dist/layer-Cv9vSwBx.d.ts +0 -70
  486. package/dist/pino-logger-H4HPW5P6.js +0 -5
  487. package/dist/pino-logger-H4HPW5P6.js.map +0 -1
  488. package/dist/prisma-extension-gYhYriA0.d.ts +0 -174
  489. package/dist/sdk-L75WWUP3.js +0 -156
  490. package/dist/sdk-L75WWUP3.js.map +0 -1
  491. package/dist/shutdown-registry-CW9LryO8.d.ts +0 -10
  492. package/dist/types-Bo2wkjSP.d.ts +0 -35
  493. package/dist/types-DVpvrAhd.d.ts +0 -71
  494. package/dist/types-DgJ4lDYA.d.ts +0 -108
  495. package/dist/types-USOv09qy.d.ts +0 -327
  496. package/dist/workspace-guard-NXVYYBVJ.js +0 -5
  497. package/dist/workspace-guard-NXVYYBVJ.js.map +0 -1
@@ -0,0 +1,706 @@
1
+ import { a as logger } from "./logger-B6rCpb7D.js";
2
+ import { i as DEFAULT_LAYER_RESOURCES } from "./layer-Bcix-WCl.js";
3
+
4
+ // src/temporal/client.ts
5
+ let temporalClientModule = null;
6
+ /**
7
+ * Lazily load the @temporalio/client module
8
+ */
9
+ async function getTemporalClientModule() {
10
+ if (!temporalClientModule) temporalClientModule = await import("@temporalio/client");
11
+ return temporalClientModule;
12
+ }
13
+ /**
14
+ * Temporal Client wrapper for Burdenoff microservices
15
+ */
16
+ var TemporalClient = class {
17
+ client = null;
18
+ connection = null;
19
+ config;
20
+ isConnected = false;
21
+ constructor(config) {
22
+ this.config = {
23
+ connectionTimeout: 1e4,
24
+ tls: false,
25
+ ...config
26
+ };
27
+ }
28
+ /**
29
+ * Connect to Temporal server
30
+ */
31
+ async connect() {
32
+ if (this.client && this.isConnected) return this.client;
33
+ try {
34
+ logger.info("Connecting to Temporal server", {
35
+ address: this.config.address,
36
+ namespace: this.config.namespace
37
+ });
38
+ const { Connection, Client } = await getTemporalClientModule();
39
+ this.connection = await Connection.connect({
40
+ address: this.config.address,
41
+ tls: this.config.tls ? this.config.tlsOptions : void 0
42
+ });
43
+ this.client = new Client({
44
+ connection: this.connection,
45
+ namespace: this.config.namespace
46
+ });
47
+ this.isConnected = true;
48
+ logger.info("Successfully connected to Temporal", {
49
+ address: this.config.address,
50
+ namespace: this.config.namespace
51
+ });
52
+ return this.client;
53
+ } catch (error) {
54
+ logger.error("Failed to connect to Temporal", {
55
+ error: error instanceof Error ? error.message : String(error),
56
+ address: this.config.address
57
+ });
58
+ throw error;
59
+ }
60
+ }
61
+ /**
62
+ * Disconnect from Temporal server
63
+ */
64
+ async disconnect() {
65
+ if (this.connection) {
66
+ await this.connection.close();
67
+ this.connection = null;
68
+ this.client = null;
69
+ this.isConnected = false;
70
+ logger.info("Disconnected from Temporal", { address: this.config.address });
71
+ }
72
+ }
73
+ /**
74
+ * Get the underlying Temporal client
75
+ */
76
+ async getClient() {
77
+ return this.connect();
78
+ }
79
+ /**
80
+ * Start a workflow execution using string workflow name
81
+ * Note: Since workflow is specified as string (not function reference),
82
+ * return type is WorkflowHandle without type parameter
83
+ */
84
+ async startWorkflow(workflowType, options) {
85
+ const client = await this.connect();
86
+ try {
87
+ logger.debug("Starting workflow", {
88
+ workflowType,
89
+ workflowId: options.workflowId,
90
+ taskQueue: options.taskQueue
91
+ });
92
+ const handle = await client.workflow.start(workflowType, {
93
+ workflowId: options.workflowId,
94
+ taskQueue: options.taskQueue,
95
+ args: options.args ?? [],
96
+ workflowExecutionTimeout: options.workflowExecutionTimeout,
97
+ workflowRunTimeout: options.workflowRunTimeout,
98
+ workflowTaskTimeout: options.workflowTaskTimeout,
99
+ cronSchedule: options.cronSchedule,
100
+ memo: options.memo,
101
+ searchAttributes: options.searchAttributes
102
+ });
103
+ logger.info("Workflow started successfully", {
104
+ workflowType,
105
+ workflowId: options.workflowId
106
+ });
107
+ return handle;
108
+ } catch (error) {
109
+ logger.error("Failed to start workflow", {
110
+ workflowType,
111
+ workflowId: options.workflowId,
112
+ error: error instanceof Error ? error.message : String(error)
113
+ });
114
+ throw error;
115
+ }
116
+ }
117
+ /**
118
+ * Execute a workflow and wait for result using string workflow name
119
+ * Note: Since workflow is specified as string (not function reference),
120
+ * return type is unknown (caller must assert type if needed)
121
+ */
122
+ async executeWorkflow(workflowType, options) {
123
+ const client = await this.connect();
124
+ try {
125
+ logger.debug("Executing workflow", {
126
+ workflowType,
127
+ workflowId: options.workflowId,
128
+ taskQueue: options.taskQueue
129
+ });
130
+ const result = await client.workflow.execute(workflowType, {
131
+ workflowId: options.workflowId,
132
+ taskQueue: options.taskQueue,
133
+ args: options.args ?? [],
134
+ workflowExecutionTimeout: options.workflowExecutionTimeout,
135
+ workflowRunTimeout: options.workflowRunTimeout,
136
+ workflowTaskTimeout: options.workflowTaskTimeout,
137
+ memo: options.memo,
138
+ searchAttributes: options.searchAttributes
139
+ });
140
+ logger.info("Workflow executed successfully", {
141
+ workflowType,
142
+ workflowId: options.workflowId
143
+ });
144
+ return result;
145
+ } catch (error) {
146
+ logger.error("Failed to execute workflow", {
147
+ workflowType,
148
+ workflowId: options.workflowId,
149
+ error: error instanceof Error ? error.message : String(error)
150
+ });
151
+ throw error;
152
+ }
153
+ }
154
+ /**
155
+ * Get workflow handle by ID
156
+ */
157
+ async getWorkflowHandle(workflowId, runId) {
158
+ return (await this.connect()).workflow.getHandle(workflowId, runId);
159
+ }
160
+ /**
161
+ * Signal a running workflow
162
+ */
163
+ async signalWorkflow(workflowId, signalName, args) {
164
+ const handle = await this.getWorkflowHandle(workflowId);
165
+ try {
166
+ await handle.signal(signalName, args);
167
+ logger.info("Workflow signal sent", {
168
+ workflowId,
169
+ signalName
170
+ });
171
+ } catch (error) {
172
+ logger.error("Failed to signal workflow", {
173
+ workflowId,
174
+ signalName,
175
+ error: error instanceof Error ? error.message : String(error)
176
+ });
177
+ throw error;
178
+ }
179
+ }
180
+ /**
181
+ * Query a running workflow
182
+ */
183
+ async queryWorkflow(workflowId, queryName, args) {
184
+ const handle = await this.getWorkflowHandle(workflowId);
185
+ try {
186
+ const result = await handle.query(queryName, args);
187
+ logger.debug("Workflow query executed", {
188
+ workflowId,
189
+ queryName
190
+ });
191
+ return result;
192
+ } catch (error) {
193
+ logger.error("Failed to query workflow", {
194
+ workflowId,
195
+ queryName,
196
+ error: error instanceof Error ? error.message : String(error)
197
+ });
198
+ throw error;
199
+ }
200
+ }
201
+ /**
202
+ * Cancel a running workflow
203
+ */
204
+ async cancelWorkflow(workflowId) {
205
+ const handle = await this.getWorkflowHandle(workflowId);
206
+ try {
207
+ await handle.cancel();
208
+ logger.info("Workflow cancelled", { workflowId });
209
+ } catch (error) {
210
+ logger.error("Failed to cancel workflow", {
211
+ workflowId,
212
+ error: error instanceof Error ? error.message : String(error)
213
+ });
214
+ throw error;
215
+ }
216
+ }
217
+ /**
218
+ * Terminate a running workflow
219
+ */
220
+ async terminateWorkflow(workflowId, reason) {
221
+ const handle = await this.getWorkflowHandle(workflowId);
222
+ try {
223
+ await handle.terminate(reason);
224
+ logger.info("Workflow terminated", {
225
+ workflowId,
226
+ reason
227
+ });
228
+ } catch (error) {
229
+ logger.error("Failed to terminate workflow", {
230
+ workflowId,
231
+ error: error instanceof Error ? error.message : String(error)
232
+ });
233
+ throw error;
234
+ }
235
+ }
236
+ /**
237
+ * Describe a workflow execution
238
+ */
239
+ async describeWorkflow(workflowId) {
240
+ const handle = await this.getWorkflowHandle(workflowId);
241
+ try {
242
+ const description = await handle.describe();
243
+ logger.debug("Workflow described", {
244
+ workflowId,
245
+ status: description.status.name
246
+ });
247
+ return description;
248
+ } catch (error) {
249
+ logger.error("Failed to describe workflow", {
250
+ workflowId,
251
+ error: error instanceof Error ? error.message : String(error)
252
+ });
253
+ throw error;
254
+ }
255
+ }
256
+ /**
257
+ * Get workflow result
258
+ */
259
+ async getWorkflowResult(workflowId) {
260
+ const handle = await this.getWorkflowHandle(workflowId);
261
+ try {
262
+ const result = await handle.result();
263
+ logger.info("Workflow result retrieved", { workflowId });
264
+ return result;
265
+ } catch (error) {
266
+ logger.error("Failed to get workflow result", {
267
+ workflowId,
268
+ error: error instanceof Error ? error.message : String(error)
269
+ });
270
+ throw error;
271
+ }
272
+ }
273
+ /**
274
+ * Check if client is connected
275
+ */
276
+ isClientConnected() {
277
+ return this.isConnected;
278
+ }
279
+ /**
280
+ * Get configuration
281
+ */
282
+ getConfig() {
283
+ return { ...this.config };
284
+ }
285
+ };
286
+ /**
287
+ * Factory for creating Temporal clients based on module type
288
+ */
289
+ var TemporalClientFactory = class {
290
+ /**
291
+ * Create a Temporal client for workspace modules
292
+ */
293
+ static createWorkspaceClient(config) {
294
+ const address = config?.address || process.env["TEMPORAL_WORKSPACE_URL"] || "localhost:7233";
295
+ const namespace = config?.namespace || process.env["TEMPORAL_NAMESPACE"] || "workspace-default";
296
+ const taskQueue = config?.taskQueue || process.env["TEMPORAL_TASK_QUEUE"];
297
+ return new TemporalClient({
298
+ address,
299
+ namespace,
300
+ taskQueue,
301
+ ...config
302
+ });
303
+ }
304
+ /**
305
+ * Create a Temporal client for tenant modules
306
+ */
307
+ static createTenantClient(config) {
308
+ const address = config?.address || process.env["TEMPORAL_TENANT_URL"] || "localhost:7233";
309
+ const namespace = config?.namespace || process.env["TEMPORAL_NAMESPACE"] || "tenant-default";
310
+ const taskQueue = config?.taskQueue || process.env["TEMPORAL_TASK_QUEUE"];
311
+ return new TemporalClient({
312
+ address,
313
+ namespace,
314
+ taskQueue,
315
+ ...config
316
+ });
317
+ }
318
+ /**
319
+ * Create a Temporal client from environment variables
320
+ * Automatically detects workspace vs tenant based on TEMPORAL_MODULE_TYPE
321
+ */
322
+ static createFromEnv() {
323
+ if ((process.env["TEMPORAL_MODULE_TYPE"] || "workspace") === "tenant") return this.createTenantClient();
324
+ return this.createWorkspaceClient();
325
+ }
326
+ /**
327
+ * Create a Temporal client for a specific layer
328
+ *
329
+ * @param layer - Service layer ('wspace' or 'global')
330
+ * @param serviceName - Service name for identification
331
+ * @param config - Optional configuration overrides
332
+ * @returns Temporal client configured for the layer
333
+ *
334
+ * @example
335
+ * ```typescript
336
+ * const client = TemporalClientFactory.createClientForLayer('wspace', 'wspace-tags-svc');
337
+ * await client.connect();
338
+ * await client.startWorkflow('processTagUpdate', {
339
+ * workflowId: 'tag-update-123',
340
+ * taskQueue: 'wspace-tags-queue',
341
+ * });
342
+ * ```
343
+ */
344
+ static createClientForLayer(layer, serviceName, config) {
345
+ const envPrefix = layer.toUpperCase();
346
+ const defaults = DEFAULT_LAYER_RESOURCES[layer];
347
+ const address = config?.address || process.env[`${envPrefix}_TEMPORAL_ADDRESS`] || process.env["TEMPORAL_ADDRESS"] || defaults.temporalAddress;
348
+ const layerPrefix = `${layer}-`;
349
+ const derivedNamespace = `${layer}-${serviceName.replace(layerPrefix, "").replace("-svc", "")}`;
350
+ const namespace = config?.namespace || process.env[`${envPrefix}_TEMPORAL_NAMESPACE`] || process.env["TEMPORAL_NAMESPACE"] || derivedNamespace;
351
+ const taskQueue = config?.taskQueue || process.env[`${envPrefix}_TEMPORAL_TASK_QUEUE`] || process.env["TEMPORAL_TASK_QUEUE"] || `${serviceName}-queue`;
352
+ logger.info("[TemporalClientFactory] Creating layer client", {
353
+ layer,
354
+ serviceName,
355
+ address,
356
+ namespace,
357
+ taskQueue
358
+ });
359
+ return new TemporalClient({
360
+ address,
361
+ namespace,
362
+ taskQueue,
363
+ ...config
364
+ });
365
+ }
366
+ /**
367
+ * Create a Temporal client from layer environment detection
368
+ *
369
+ * @param serviceName - Service name for identification
370
+ * @returns Temporal client configured based on detected layer
371
+ */
372
+ static createFromLayerEnv(serviceName) {
373
+ const layer = process.env["SERVICE_LAYER"] || (serviceName.startsWith("global-") ? "global" : "wspace");
374
+ return this.createClientForLayer(layer, serviceName);
375
+ }
376
+ };
377
+
378
+ // src/temporal/worker.ts
379
+ let temporalWorkerModule = null;
380
+ /**
381
+ * Lazily load the @temporalio/worker module
382
+ */
383
+ async function getTemporalWorkerModule() {
384
+ if (!temporalWorkerModule) temporalWorkerModule = await import("@temporalio/worker");
385
+ return temporalWorkerModule;
386
+ }
387
+ /**
388
+ * Temporal Worker wrapper for Burdenoff microservices
389
+ */
390
+ var TemporalWorker = class {
391
+ worker = null;
392
+ connection = null;
393
+ config;
394
+ isRunning = false;
395
+ constructor(config) {
396
+ this.config = {
397
+ maxConcurrentWorkflowTaskExecutions: 100,
398
+ maxConcurrentActivityTaskExecutions: 100,
399
+ debugMode: false,
400
+ ...config
401
+ };
402
+ }
403
+ /**
404
+ * Start the worker
405
+ */
406
+ async start() {
407
+ if (this.isRunning) {
408
+ logger.warn("Worker already running", { taskQueue: this.config.taskQueue });
409
+ return;
410
+ }
411
+ try {
412
+ logger.info("Starting Temporal worker", {
413
+ address: this.config.address,
414
+ namespace: this.config.namespace,
415
+ taskQueue: this.config.taskQueue
416
+ });
417
+ const { Worker, NativeConnection } = await getTemporalWorkerModule();
418
+ this.connection = await NativeConnection.connect({
419
+ address: this.config.address,
420
+ tls: this.config.tls
421
+ });
422
+ this.worker = await Worker.create({
423
+ connection: this.connection,
424
+ namespace: this.config.namespace,
425
+ taskQueue: this.config.taskQueue,
426
+ workflowsPath: this.config.workflowsPath,
427
+ activities: this.config.activities,
428
+ maxConcurrentWorkflowTaskExecutions: this.config.maxConcurrentWorkflowTaskExecutions,
429
+ maxConcurrentActivityTaskExecutions: this.config.maxConcurrentActivityTaskExecutions
430
+ });
431
+ this.isRunning = true;
432
+ logger.info("Temporal worker started successfully", {
433
+ taskQueue: this.config.taskQueue,
434
+ workflowsPath: this.config.workflowsPath
435
+ });
436
+ await this.worker.run();
437
+ } catch (error) {
438
+ logger.error("Failed to start Temporal worker", {
439
+ error: error instanceof Error ? error.message : String(error),
440
+ taskQueue: this.config.taskQueue
441
+ });
442
+ throw error;
443
+ }
444
+ }
445
+ /**
446
+ * Stop the worker
447
+ */
448
+ async stop() {
449
+ if (!this.isRunning || !this.worker) {
450
+ logger.warn("Worker not running", { taskQueue: this.config.taskQueue });
451
+ return;
452
+ }
453
+ try {
454
+ logger.info("Stopping Temporal worker", { taskQueue: this.config.taskQueue });
455
+ this.worker.shutdown();
456
+ this.isRunning = false;
457
+ if (this.connection) {
458
+ await this.connection.close();
459
+ this.connection = null;
460
+ }
461
+ this.worker = null;
462
+ logger.info("Temporal worker stopped successfully", { taskQueue: this.config.taskQueue });
463
+ } catch (error) {
464
+ logger.error("Failed to stop Temporal worker", {
465
+ error: error instanceof Error ? error.message : String(error),
466
+ taskQueue: this.config.taskQueue
467
+ });
468
+ throw error;
469
+ }
470
+ }
471
+ /**
472
+ * Check if worker is running
473
+ */
474
+ isWorkerRunning() {
475
+ return this.isRunning;
476
+ }
477
+ /**
478
+ * Get worker configuration
479
+ */
480
+ getConfig() {
481
+ return { ...this.config };
482
+ }
483
+ };
484
+ /**
485
+ * Factory for creating Temporal workers based on module type
486
+ */
487
+ var TemporalWorkerFactory = class {
488
+ /**
489
+ * Create a Temporal worker for workspace modules
490
+ */
491
+ static createWorkspaceWorker(config) {
492
+ const address = config.address || process.env["TEMPORAL_WORKSPACE_URL"] || "localhost:7233";
493
+ const namespace = config.namespace || process.env["TEMPORAL_NAMESPACE"] || "workspace-default";
494
+ const taskQueue = config.taskQueue || process.env["TEMPORAL_TASK_QUEUE"] || "workspace-default-tasks";
495
+ return new TemporalWorker({
496
+ address,
497
+ namespace,
498
+ taskQueue,
499
+ workflowsPath: config.workflowsPath,
500
+ activities: config.activities
501
+ });
502
+ }
503
+ /**
504
+ * Create a Temporal worker for tenant modules
505
+ */
506
+ static createTenantWorker(config) {
507
+ const address = config.address || process.env["TEMPORAL_TENANT_URL"] || "localhost:7233";
508
+ const namespace = config.namespace || process.env["TEMPORAL_NAMESPACE"] || "tenant-default";
509
+ const taskQueue = config.taskQueue || process.env["TEMPORAL_TASK_QUEUE"] || "tenant-default-tasks";
510
+ return new TemporalWorker({
511
+ address,
512
+ namespace,
513
+ taskQueue,
514
+ workflowsPath: config.workflowsPath,
515
+ activities: config.activities
516
+ });
517
+ }
518
+ /**
519
+ * Create a Temporal worker from environment variables
520
+ * Automatically detects workspace vs tenant based on TEMPORAL_MODULE_TYPE
521
+ */
522
+ static createFromEnv(config) {
523
+ if ((process.env["TEMPORAL_MODULE_TYPE"] || "workspace") === "tenant") return this.createTenantWorker(config);
524
+ return this.createWorkspaceWorker(config);
525
+ }
526
+ };
527
+ /**
528
+ * Worker manager for handling worker lifecycle
529
+ */
530
+ var TemporalWorkerManager = class {
531
+ workers = /* @__PURE__ */ new Map();
532
+ /**
533
+ * Register a worker
534
+ */
535
+ registerWorker(name, worker) {
536
+ if (this.workers.has(name)) logger.warn("Worker already registered, replacing", { name });
537
+ this.workers.set(name, worker);
538
+ }
539
+ /**
540
+ * Start all registered workers
541
+ */
542
+ async startAll() {
543
+ logger.info("Starting all Temporal workers", { count: this.workers.size });
544
+ const startPromises = Array.from(this.workers.entries()).map(async ([name, worker]) => {
545
+ try {
546
+ await worker.start();
547
+ logger.info("Worker started", { name });
548
+ } catch (error) {
549
+ logger.error("Failed to start worker", {
550
+ name,
551
+ error: error instanceof Error ? error.message : String(error)
552
+ });
553
+ throw error;
554
+ }
555
+ });
556
+ await Promise.all(startPromises);
557
+ }
558
+ /**
559
+ * Stop all registered workers
560
+ */
561
+ async stopAll() {
562
+ logger.info("Stopping all Temporal workers", { count: this.workers.size });
563
+ const stopPromises = Array.from(this.workers.entries()).map(async ([name, worker]) => {
564
+ try {
565
+ await worker.stop();
566
+ logger.info("Worker stopped", { name });
567
+ } catch (error) {
568
+ logger.error("Failed to stop worker", {
569
+ name,
570
+ error: error instanceof Error ? error.message : String(error)
571
+ });
572
+ }
573
+ });
574
+ await Promise.all(stopPromises);
575
+ }
576
+ /**
577
+ * Get a worker by name
578
+ */
579
+ getWorker(name) {
580
+ return this.workers.get(name);
581
+ }
582
+ /**
583
+ * Remove a worker
584
+ */
585
+ removeWorker(name) {
586
+ return this.workers.delete(name);
587
+ }
588
+ /**
589
+ * Get all registered worker names
590
+ */
591
+ getWorkerNames() {
592
+ return Array.from(this.workers.keys());
593
+ }
594
+ };
595
+
596
+ // src/temporal/module.ts
597
+ /**
598
+ * Temporal Module
599
+ * Main entry point for Temporal functionality in the SDK
600
+ */
601
+ var TemporalModule = class TemporalModule {
602
+ client;
603
+ workerManager;
604
+ config;
605
+ constructor(config) {
606
+ this.config = {
607
+ autoConnect: true,
608
+ ...config
609
+ };
610
+ if (config.moduleType === "tenant") this.client = TemporalClientFactory.createTenantClient({
611
+ address: config.address,
612
+ namespace: config.namespace,
613
+ taskQueue: config.taskQueue
614
+ });
615
+ else this.client = TemporalClientFactory.createWorkspaceClient({
616
+ address: config.address,
617
+ namespace: config.namespace,
618
+ taskQueue: config.taskQueue
619
+ });
620
+ this.workerManager = new TemporalWorkerManager();
621
+ if (this.config.autoConnect) this.initialize();
622
+ }
623
+ /**
624
+ * Initialize the Temporal module (connect client)
625
+ * This is called automatically if autoConnect is true
626
+ */
627
+ initialize() {
628
+ this.client.connect().catch((error) => {
629
+ logger.error("Failed to auto-connect to Temporal", { error: error instanceof Error ? error.message : String(error) });
630
+ });
631
+ }
632
+ /**
633
+ * Get the Temporal client
634
+ */
635
+ getClient() {
636
+ return this.client;
637
+ }
638
+ /**
639
+ * Get the worker manager
640
+ */
641
+ getWorkerManager() {
642
+ return this.workerManager;
643
+ }
644
+ /**
645
+ * Create and register a worker
646
+ */
647
+ createWorker(config) {
648
+ const worker = this.config.moduleType === "tenant" ? TemporalWorkerFactory.createTenantWorker({
649
+ workflowsPath: config.workflowsPath,
650
+ activities: config.activities,
651
+ taskQueue: config.taskQueue,
652
+ namespace: this.config.namespace,
653
+ address: this.config.address
654
+ }) : TemporalWorkerFactory.createWorkspaceWorker({
655
+ workflowsPath: config.workflowsPath,
656
+ activities: config.activities,
657
+ taskQueue: config.taskQueue,
658
+ namespace: this.config.namespace,
659
+ address: this.config.address
660
+ });
661
+ this.workerManager.registerWorker(config.name, worker);
662
+ return worker;
663
+ }
664
+ /**
665
+ * Start all registered workers
666
+ */
667
+ async startWorkers() {
668
+ await this.workerManager.startAll();
669
+ }
670
+ /**
671
+ * Stop all registered workers
672
+ */
673
+ async stopWorkers() {
674
+ await this.workerManager.stopAll();
675
+ }
676
+ /**
677
+ * Disconnect from Temporal
678
+ */
679
+ async disconnect() {
680
+ await this.client.disconnect();
681
+ }
682
+ /**
683
+ * Get module configuration
684
+ */
685
+ getConfig() {
686
+ return { ...this.config };
687
+ }
688
+ /**
689
+ * Create a Temporal module from environment variables
690
+ */
691
+ static fromEnv() {
692
+ const moduleType = process.env["TEMPORAL_MODULE_TYPE"] || "workspace";
693
+ const address = moduleType === "tenant" ? process.env["TEMPORAL_TENANT_URL"] || "localhost:7233" : process.env["TEMPORAL_WORKSPACE_URL"] || "localhost:7233";
694
+ const namespace = process.env["TEMPORAL_NAMESPACE"];
695
+ const taskQueue = process.env["TEMPORAL_TASK_QUEUE"];
696
+ return new TemporalModule({
697
+ moduleType,
698
+ address,
699
+ namespace,
700
+ taskQueue
701
+ });
702
+ }
703
+ };
704
+
705
+ export { TemporalClient as a, TemporalWorkerManager as i, TemporalWorker as n, TemporalClientFactory as o, TemporalWorkerFactory as r, TemporalModule as t };
706
+ //# sourceMappingURL=temporal-B534uYK8.js.map