@burdenoff/be-sdk 2026.1110.2 → 2026.1110.3

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 (469) 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/ai-credits/index.d.ts +2 -3
  8. package/dist/ai-credits/index.js +3 -4
  9. package/dist/ai-credits/index.js.map +1 -1
  10. package/dist/ai-credits-Ca-NNcVx.js +546 -0
  11. package/dist/ai-credits-Ca-NNcVx.js.map +1 -0
  12. package/dist/{assistant-session-CJZhF4D6.d.ts → assistant-session-DA5ZKJOr.d.ts} +4 -5
  13. package/dist/auth/index.d.ts +2 -77
  14. package/dist/auth/index.js +3 -7
  15. package/dist/auth/index.js.map +1 -1
  16. package/dist/auth-CEuBEBQN.js +228 -0
  17. package/dist/auth-CEuBEBQN.js.map +1 -0
  18. package/dist/cache/index.d.ts +2 -3
  19. package/dist/cache/index.js +3 -7
  20. package/dist/cache/index.js.map +1 -1
  21. package/dist/cache-CU0uLwcS.js +1837 -0
  22. package/dist/cache-CU0uLwcS.js.map +1 -0
  23. package/dist/captcha/index.d.ts +2 -1
  24. package/dist/captcha/index.js +3 -3
  25. package/dist/captcha/index.js.map +1 -1
  26. package/dist/captcha-BT7yh1YS.js +77 -0
  27. package/dist/captcha-BT7yh1YS.js.map +1 -0
  28. package/dist/client/internal-client.d.ts +4 -7
  29. package/dist/client/internal-client.js +172 -4
  30. package/dist/client/internal-client.js.map +1 -1
  31. package/dist/client-BgAEvDC2.d.ts +86 -0
  32. package/dist/client-DcZ3iGES.js +565 -0
  33. package/dist/client-DcZ3iGES.js.map +1 -0
  34. package/dist/collector-endpoint-iyQYeI50.js +50 -0
  35. package/dist/collector-endpoint-iyQYeI50.js.map +1 -0
  36. package/dist/context-CZnXf2yb.js +247 -0
  37. package/dist/context-CZnXf2yb.js.map +1 -0
  38. package/dist/crypto/index.d.ts +2 -1
  39. package/dist/crypto/index.js +3 -3
  40. package/dist/crypto/index.js.map +1 -1
  41. package/dist/crypto-DO9fM0FO.js +145 -0
  42. package/dist/crypto-DO9fM0FO.js.map +1 -0
  43. package/dist/database/index.d.ts +104 -108
  44. package/dist/database/index.js +468 -6
  45. package/dist/database/index.js.map +1 -1
  46. package/dist/dataloader/index.d.ts +2 -1
  47. package/dist/dataloader/index.js +3 -3
  48. package/dist/dataloader/index.js.map +1 -1
  49. package/dist/dataloader-DwpT3YoS.js +294 -0
  50. package/dist/dataloader-DwpT3YoS.js.map +1 -0
  51. package/dist/deployed-environment-p_Tdl3sT.js +38 -0
  52. package/dist/deployed-environment-p_Tdl3sT.js.map +1 -0
  53. package/dist/dist-BGKdXVy3.js +1718 -0
  54. package/dist/dist-BGKdXVy3.js.map +1 -0
  55. package/dist/env-DdaoGjIt.js +74 -0
  56. package/dist/env-DdaoGjIt.js.map +1 -0
  57. package/dist/event-queue/index.d.ts +2 -7
  58. package/dist/event-queue/index.js +7 -9
  59. package/dist/event-queue/index.js.map +1 -1
  60. package/dist/event-queue-Cw-YJPY_.js +1384 -0
  61. package/dist/event-queue-Cw-YJPY_.js.map +1 -0
  62. package/dist/{explicit-activity-scope-CCoxVwAr.d.ts → explicit-activity-scope-D8VeGGpt.d.ts} +1 -2
  63. package/dist/export/index.d.ts +2 -2
  64. package/dist/export/index.js +3 -14
  65. package/dist/export/index.js.map +1 -1
  66. package/dist/export-B6fphx8a.js +642 -0
  67. package/dist/export-B6fphx8a.js.map +1 -0
  68. package/dist/feature-flags/index.d.ts +2 -10
  69. package/dist/feature-flags/index.js +3 -6
  70. package/dist/feature-flags/index.js.map +1 -1
  71. package/dist/feature-flags-71oDkrUe.js +422 -0
  72. package/dist/feature-flags-71oDkrUe.js.map +1 -0
  73. package/dist/files/index.d.ts +2 -3
  74. package/dist/files/index.js +3 -4
  75. package/dist/files/index.js.map +1 -1
  76. package/dist/files-DjH0099H.js +830 -0
  77. package/dist/files-DjH0099H.js.map +1 -0
  78. package/dist/gateway/index.d.ts +4 -6
  79. package/dist/gateway/index.js +7 -13
  80. package/dist/gateway/index.js.map +1 -1
  81. package/dist/gateway/security/index.d.ts +2 -2
  82. package/dist/gateway/security/index.js +3 -5
  83. package/dist/gateway/security/index.js.map +1 -1
  84. package/dist/gateway-DBFmxWks.js +50 -0
  85. package/dist/gateway-DBFmxWks.js.map +1 -0
  86. package/dist/graph/index.d.ts +3 -10
  87. package/dist/graph/index.js +4 -13
  88. package/dist/graph/index.js.map +1 -1
  89. package/dist/graph-DDYgIryR.js +2152 -0
  90. package/dist/graph-DDYgIryR.js.map +1 -0
  91. package/dist/graph-emitter-CdOXP7Tn.js +621 -0
  92. package/dist/graph-emitter-CdOXP7Tn.js.map +1 -0
  93. package/dist/graphql/index.d.ts +3 -2
  94. package/dist/graphql/index.js +4 -6
  95. package/dist/graphql/index.js.map +1 -1
  96. package/dist/graphql/services/index.d.ts +2 -24
  97. package/dist/graphql/services/index.js +3 -4
  98. package/dist/graphql/services/index.js.map +1 -1
  99. package/dist/graphql-DHAHHcww.js +161 -0
  100. package/dist/graphql-DHAHHcww.js.map +1 -0
  101. package/dist/graphql-DNkMkGBZ.d.ts +21 -0
  102. package/dist/i18n/index.d.ts +3 -3
  103. package/dist/i18n/index.js +3 -4
  104. package/dist/i18n/index.js.map +1 -1
  105. package/dist/i18n-BBMYFd0P.js +860 -0
  106. package/dist/i18n-BBMYFd0P.js.map +1 -0
  107. package/dist/import-optional-peer-B82VYxeX.js +18 -0
  108. package/dist/import-optional-peer-B82VYxeX.js.map +1 -0
  109. package/dist/index-3KOZ1zN9.d.ts +233 -0
  110. package/dist/index-BBqooJ52.d.ts +45 -0
  111. package/dist/index-BGzMYJsm.d.ts +209 -0
  112. package/dist/index-BKwHQtHQ.d.ts +63 -0
  113. package/dist/index-BMIMnp6T.d.ts +8 -0
  114. package/dist/index-BQDsNAMR.d.ts +81 -0
  115. package/dist/index-BVOL7458.d.ts +10 -0
  116. package/dist/index-BcqQs-Uq.d.ts +69 -0
  117. package/dist/index-BeVtqGO-.d.ts +208 -0
  118. package/dist/index-BiTzGUZP.d.ts +114 -0
  119. package/dist/index-BqYfCQSP.d.ts +500 -0
  120. package/dist/index-C0qLquY0.d.ts +150 -0
  121. package/dist/index-C5uEKchX.d.ts +60 -0
  122. package/dist/index-CDOqxSIi.d.ts +37 -0
  123. package/dist/index-CG6wj66Y.d.ts +148 -0
  124. package/dist/index-CIgoeobA.d.ts +145 -0
  125. package/dist/index-CPQDMSFS.d.ts +103 -0
  126. package/dist/index-CSRcgkVi.d.ts +23 -0
  127. package/dist/index-CZTnQIRU.d.ts +341 -0
  128. package/dist/index-CaM9JUcc.d.ts +144 -0
  129. package/dist/index-CkT2aUr3.d.ts +704 -0
  130. package/dist/index-CliOgq6L.d.ts +203 -0
  131. package/dist/index-CnzbJZP7.d.ts +999 -0
  132. package/dist/index-D6UeLAye.d.ts +63 -0
  133. package/dist/index-DGgh9DWn.d.ts +59 -0
  134. package/dist/index-DY3dNhMN.d.ts +420 -0
  135. package/dist/index-DZC-2o9R.d.ts +207 -0
  136. package/dist/index-DqbGqfAy.d.ts +127 -0
  137. package/dist/index-Dt1HJPTX.d.ts +12 -0
  138. package/dist/index-DtI6aBtB.d.ts +22 -0
  139. package/dist/index-FKohsiex.d.ts +38 -0
  140. package/dist/index-FbXPfen7.d.ts +132 -0
  141. package/dist/index-MArCb8Aq.d.ts +306 -0
  142. package/dist/index-N-huORcj.d.ts +303 -0
  143. package/dist/index-YOShAwkq.d.ts +45 -0
  144. package/dist/index-bZKZUvBu.d.ts +646 -0
  145. package/dist/index-yBSjMY32.d.ts +24 -0
  146. package/dist/index.d.ts +501 -544
  147. package/dist/index.js +1820 -2171
  148. package/dist/index.js.map +1 -1
  149. package/dist/init/index.d.ts +2 -2
  150. package/dist/init/index.js +3 -16
  151. package/dist/init/index.js.map +1 -1
  152. package/dist/init-Dy3KhT6Y.js +325 -0
  153. package/dist/init-Dy3KhT6Y.js.map +1 -0
  154. package/dist/instrumentation/index.d.ts +3 -4
  155. package/dist/instrumentation/index.js +5 -5
  156. package/dist/instrumentation/index.js.map +1 -1
  157. package/dist/instrumentation-xkkmDgJ0.js +1678 -0
  158. package/dist/instrumentation-xkkmDgJ0.js.map +1 -0
  159. package/dist/lake/index.d.ts +50 -54
  160. package/dist/lake/index.js +169 -193
  161. package/dist/lake/index.js.map +1 -1
  162. package/dist/layer/index.d.ts +3 -2
  163. package/dist/layer/index.js +4 -5
  164. package/dist/layer/index.js.map +1 -1
  165. package/dist/layer-BZBZZWeV.d.ts +69 -0
  166. package/dist/layer-Bcix-WCl.js +105 -0
  167. package/dist/layer-Bcix-WCl.js.map +1 -0
  168. package/dist/layer-CEKy6cm8.js +252 -0
  169. package/dist/layer-CEKy6cm8.js.map +1 -0
  170. package/dist/lifecycle/index.d.ts +2 -1
  171. package/dist/lifecycle/index.js +3 -4
  172. package/dist/lifecycle/index.js.map +1 -1
  173. package/dist/lifecycle-DeoLSX0U.js +76 -0
  174. package/dist/lifecycle-DeoLSX0U.js.map +1 -0
  175. package/dist/logger/index.d.ts +2 -3
  176. package/dist/logger/index.js +3 -3
  177. package/dist/logger/index.js.map +1 -1
  178. package/dist/logger-B6rCpb7D.js +290 -0
  179. package/dist/logger-B6rCpb7D.js.map +1 -0
  180. package/dist/metrics/index.d.ts +13 -14
  181. package/dist/metrics/index.js +3 -4
  182. package/dist/metrics/index.js.map +1 -1
  183. package/dist/metrics-BrLwNUrb.js +52 -0
  184. package/dist/metrics-BrLwNUrb.js.map +1 -0
  185. package/dist/metrics-collector-C2eShrlW.js +922 -0
  186. package/dist/metrics-collector-C2eShrlW.js.map +1 -0
  187. package/dist/middleware/index.d.ts +3 -3
  188. package/dist/middleware/index.js +3 -4
  189. package/dist/middleware/index.js.map +1 -1
  190. package/dist/middleware-CUxJVUpD.js +1243 -0
  191. package/dist/middleware-CUxJVUpD.js.map +1 -0
  192. package/dist/middleware-Cq0zFMGp.js +253 -0
  193. package/dist/middleware-Cq0zFMGp.js.map +1 -0
  194. package/dist/notifications/index.d.ts +2 -5
  195. package/dist/notifications/index.js +3 -6
  196. package/dist/notifications/index.js.map +1 -1
  197. package/dist/notifications-CdETrtFK.js +869 -0
  198. package/dist/notifications-CdETrtFK.js.map +1 -0
  199. package/dist/observability/index.d.ts +2 -3
  200. package/dist/observability/index.js +3 -4
  201. package/dist/observability/index.js.map +1 -1
  202. package/dist/observability-DBDXipTU.js +272 -0
  203. package/dist/observability-DBDXipTU.js.map +1 -0
  204. package/dist/platform/index.d.ts +2 -1
  205. package/dist/platform/index.js +3 -5
  206. package/dist/platform/index.js.map +1 -1
  207. package/dist/platform-DZwczW7v.js +1510 -0
  208. package/dist/platform-DZwczW7v.js.map +1 -0
  209. package/dist/prisma/generator/index.d.ts +1 -1
  210. package/dist/prisma/generator/index.js +97 -84
  211. package/dist/prisma/generator/index.js.map +1 -1
  212. package/dist/prisma/index.d.ts +4 -7
  213. package/dist/prisma/index.js +5 -12
  214. package/dist/prisma/index.js.map +1 -1
  215. package/dist/prisma-BzOOdt79.js +863 -0
  216. package/dist/prisma-BzOOdt79.js.map +1 -0
  217. package/dist/prisma-extension-Cfl09swM.d.ts +172 -0
  218. package/dist/product-alias/index.d.ts +2 -1
  219. package/dist/product-alias/index.js +3 -3
  220. package/dist/product-alias/index.js.map +1 -1
  221. package/dist/product-alias-BPqtskMq.js +273 -0
  222. package/dist/product-alias-BPqtskMq.js.map +1 -0
  223. package/dist/rbac/index.d.ts +2 -122
  224. package/dist/rbac/index.js +3 -6
  225. package/dist/rbac/index.js.map +1 -1
  226. package/dist/rbac-BB9l9Xph.js +1486 -0
  227. package/dist/rbac-BB9l9Xph.js.map +1 -0
  228. package/dist/resource-caps/index.d.ts +66 -72
  229. package/dist/resource-caps/index.js +430 -5
  230. package/dist/resource-caps/index.js.map +1 -1
  231. package/dist/rolldown-runtime-ad2WFvuA.js +17 -0
  232. package/dist/sdk-Dju9o-sq.js +124 -0
  233. package/dist/sdk-Dju9o-sq.js.map +1 -0
  234. package/dist/security-DIG-95Ic.js +1647 -0
  235. package/dist/security-DIG-95Ic.js.map +1 -0
  236. package/dist/server/index.d.ts +7 -164
  237. package/dist/server/index.js +2000 -1507
  238. package/dist/server/index.js.map +1 -1
  239. package/dist/service-jwt-Bu-WNA_-.js +80 -0
  240. package/dist/service-jwt-Bu-WNA_-.js.map +1 -0
  241. package/dist/services-BWzfz7vG.js +102 -0
  242. package/dist/services-BWzfz7vG.js.map +1 -0
  243. package/dist/sharding/index.d.ts +41 -44
  244. package/dist/sharding/index.js +156 -137
  245. package/dist/sharding/index.js.map +1 -1
  246. package/dist/sharing/index.d.ts +2 -1
  247. package/dist/sharing/index.js +3 -4
  248. package/dist/sharing/index.js.map +1 -1
  249. package/dist/sharing-CflDsSJ-.js +911 -0
  250. package/dist/sharing-CflDsSJ-.js.map +1 -0
  251. package/dist/stub-BqwKn4eh.js +630 -0
  252. package/dist/stub-BqwKn4eh.js.map +1 -0
  253. package/dist/tags/index.d.ts +2 -3
  254. package/dist/tags/index.js +3 -4
  255. package/dist/tags/index.js.map +1 -1
  256. package/dist/tags-B5xpbgsk.js +868 -0
  257. package/dist/{chunk-PBZFAAOM.js.map → tags-B5xpbgsk.js.map} +1 -1
  258. package/dist/telemetry/index.d.ts +64 -76
  259. package/dist/telemetry/index.js +369 -201
  260. package/dist/telemetry/index.js.map +1 -1
  261. package/dist/temporal/index.d.ts +2 -148
  262. package/dist/temporal/index.js +3 -5
  263. package/dist/temporal/index.js.map +1 -1
  264. package/dist/temporal-B534uYK8.js +706 -0
  265. package/dist/temporal-B534uYK8.js.map +1 -0
  266. package/dist/tracker/index.d.ts +5 -11
  267. package/dist/tracker/index.js +5 -20
  268. package/dist/tracker/index.js.map +1 -1
  269. package/dist/tracker-BQVoEFUo.js +839 -0
  270. package/dist/tracker-BQVoEFUo.js.map +1 -0
  271. package/dist/types-BYMYND1L.js +44 -0
  272. package/dist/types-BYMYND1L.js.map +1 -0
  273. package/dist/types-C6EKaS3V.d.ts +106 -0
  274. package/dist/types-CWybW61E.d.ts +323 -0
  275. package/dist/types-C_yfu3XK.d.ts +34 -0
  276. package/dist/types-Cj2RWXbz.js +90 -0
  277. package/dist/types-Cj2RWXbz.js.map +1 -0
  278. package/dist/types-DgaQqvxo.d.ts +70 -0
  279. package/dist/usage/index.d.ts +2 -213
  280. package/dist/usage/index.js +3 -15
  281. package/dist/usage/index.js.map +1 -1
  282. package/dist/usage-BKFZiWQn.js +682 -0
  283. package/dist/usage-BKFZiWQn.js.map +1 -0
  284. package/dist/utils/index.d.ts +2 -1
  285. package/dist/utils/index.js +3 -3
  286. package/dist/utils/index.js.map +1 -1
  287. package/dist/utils-DL85Tnbn.js +500 -0
  288. package/dist/utils-DL85Tnbn.js.map +1 -0
  289. package/dist/validation/index.d.ts +2 -2
  290. package/dist/validation/index.js +3 -3
  291. package/dist/validation/index.js.map +1 -1
  292. package/dist/validation-CPUITdMk.js +762 -0
  293. package/dist/validation-CPUITdMk.js.map +1 -0
  294. package/dist/workspace-extension-COrC0dYi.js +979 -0
  295. package/dist/workspace-extension-COrC0dYi.js.map +1 -0
  296. package/dist/{workspace-extension-BGwTOV_r.d.ts → workspace-extension-DTFTdGVF.d.ts} +43 -45
  297. package/package.json +7 -10
  298. package/dist/EventQueueFactory-GXC3A7DH.js +0 -8
  299. package/dist/EventQueueFactory-GXC3A7DH.js.map +0 -1
  300. package/dist/chunk-4XIBXZ6J.js +0 -276
  301. package/dist/chunk-4XIBXZ6J.js.map +0 -1
  302. package/dist/chunk-554Z4C2K.js +0 -1006
  303. package/dist/chunk-554Z4C2K.js.map +0 -1
  304. package/dist/chunk-5CAFHK2Z.js +0 -107
  305. package/dist/chunk-5CAFHK2Z.js.map +0 -1
  306. package/dist/chunk-63ZXJ42X.js +0 -451
  307. package/dist/chunk-63ZXJ42X.js.map +0 -1
  308. package/dist/chunk-6XEXJATV.js +0 -304
  309. package/dist/chunk-6XEXJATV.js.map +0 -1
  310. package/dist/chunk-726AR6Q7.js +0 -1532
  311. package/dist/chunk-726AR6Q7.js.map +0 -1
  312. package/dist/chunk-A5F6Z5UE.js +0 -21
  313. package/dist/chunk-A5F6Z5UE.js.map +0 -1
  314. package/dist/chunk-A6DE32ZS.js +0 -1507
  315. package/dist/chunk-A6DE32ZS.js.map +0 -1
  316. package/dist/chunk-AXJDGQPE.js +0 -690
  317. package/dist/chunk-AXJDGQPE.js.map +0 -1
  318. package/dist/chunk-BJQOGOVW.js +0 -602
  319. package/dist/chunk-BJQOGOVW.js.map +0 -1
  320. package/dist/chunk-CFXWH2IS.js +0 -52
  321. package/dist/chunk-CFXWH2IS.js.map +0 -1
  322. package/dist/chunk-DRWH5XCJ.js +0 -876
  323. package/dist/chunk-DRWH5XCJ.js.map +0 -1
  324. package/dist/chunk-E4QNLVY4.js +0 -909
  325. package/dist/chunk-E4QNLVY4.js.map +0 -1
  326. package/dist/chunk-EBDHIL7V.js +0 -774
  327. package/dist/chunk-EBDHIL7V.js.map +0 -1
  328. package/dist/chunk-ELU7VL3E.js +0 -245
  329. package/dist/chunk-ELU7VL3E.js.map +0 -1
  330. package/dist/chunk-FZRODKIN.js +0 -31
  331. package/dist/chunk-FZRODKIN.js.map +0 -1
  332. package/dist/chunk-GCIB76AJ.js +0 -882
  333. package/dist/chunk-GCIB76AJ.js.map +0 -1
  334. package/dist/chunk-HC6MPUIH.js +0 -1571
  335. package/dist/chunk-HC6MPUIH.js.map +0 -1
  336. package/dist/chunk-HNMHPSAM.js +0 -272
  337. package/dist/chunk-HNMHPSAM.js.map +0 -1
  338. package/dist/chunk-HTLEGD3Q.js +0 -1480
  339. package/dist/chunk-HTLEGD3Q.js.map +0 -1
  340. package/dist/chunk-I3KOWRT3.js +0 -89
  341. package/dist/chunk-I3KOWRT3.js.map +0 -1
  342. package/dist/chunk-ID3WR4JS.js +0 -509
  343. package/dist/chunk-ID3WR4JS.js.map +0 -1
  344. package/dist/chunk-JS52ZHTK.js +0 -1346
  345. package/dist/chunk-JS52ZHTK.js.map +0 -1
  346. package/dist/chunk-JVMAQOA3.js +0 -521
  347. package/dist/chunk-JVMAQOA3.js.map +0 -1
  348. package/dist/chunk-KH4TRQCO.js +0 -1063
  349. package/dist/chunk-KH4TRQCO.js.map +0 -1
  350. package/dist/chunk-KJOSPVB2.js +0 -57
  351. package/dist/chunk-KJOSPVB2.js.map +0 -1
  352. package/dist/chunk-KO2ZXZ7W.js +0 -61
  353. package/dist/chunk-KO2ZXZ7W.js.map +0 -1
  354. package/dist/chunk-KS2HQCJR.js +0 -56
  355. package/dist/chunk-KS2HQCJR.js.map +0 -1
  356. package/dist/chunk-LA5KPWZ2.js +0 -413
  357. package/dist/chunk-LA5KPWZ2.js.map +0 -1
  358. package/dist/chunk-MESLAC5W.js +0 -574
  359. package/dist/chunk-MESLAC5W.js.map +0 -1
  360. package/dist/chunk-MWPYA2HD.js +0 -94
  361. package/dist/chunk-MWPYA2HD.js.map +0 -1
  362. package/dist/chunk-NUB5GQTU.js +0 -270
  363. package/dist/chunk-NUB5GQTU.js.map +0 -1
  364. package/dist/chunk-OBBCR6WY.js +0 -277
  365. package/dist/chunk-OBBCR6WY.js.map +0 -1
  366. package/dist/chunk-OQDSAOG3.js +0 -1908
  367. package/dist/chunk-OQDSAOG3.js.map +0 -1
  368. package/dist/chunk-OXNCBE7P.js +0 -971
  369. package/dist/chunk-OXNCBE7P.js.map +0 -1
  370. package/dist/chunk-PBZFAAOM.js +0 -941
  371. package/dist/chunk-PN6GIF3R.js +0 -1185
  372. package/dist/chunk-PN6GIF3R.js.map +0 -1
  373. package/dist/chunk-PYD44IHJ.js +0 -728
  374. package/dist/chunk-PYD44IHJ.js.map +0 -1
  375. package/dist/chunk-QVPIACWD.js +0 -679
  376. package/dist/chunk-QVPIACWD.js.map +0 -1
  377. package/dist/chunk-QWNNFE4P.js +0 -41
  378. package/dist/chunk-QWNNFE4P.js.map +0 -1
  379. package/dist/chunk-RU266375.js +0 -327
  380. package/dist/chunk-RU266375.js.map +0 -1
  381. package/dist/chunk-RYTSVGGA.js +0 -1624
  382. package/dist/chunk-RYTSVGGA.js.map +0 -1
  383. package/dist/chunk-RZOFS2BQ.js +0 -225
  384. package/dist/chunk-RZOFS2BQ.js.map +0 -1
  385. package/dist/chunk-SBS4S2PJ.js +0 -100
  386. package/dist/chunk-SBS4S2PJ.js.map +0 -1
  387. package/dist/chunk-SPRG6G6G.js +0 -530
  388. package/dist/chunk-SPRG6G6G.js.map +0 -1
  389. package/dist/chunk-STWFX5E2.js +0 -233
  390. package/dist/chunk-STWFX5E2.js.map +0 -1
  391. package/dist/chunk-UNASM5VJ.js +0 -419
  392. package/dist/chunk-UNASM5VJ.js.map +0 -1
  393. package/dist/chunk-VAT66FJA.js +0 -245
  394. package/dist/chunk-VAT66FJA.js.map +0 -1
  395. package/dist/chunk-VFCMR5GX.js +0 -49
  396. package/dist/chunk-VFCMR5GX.js.map +0 -1
  397. package/dist/chunk-VGAHZKNJ.js +0 -66
  398. package/dist/chunk-VGAHZKNJ.js.map +0 -1
  399. package/dist/chunk-VTJTAAXC.js +0 -627
  400. package/dist/chunk-VTJTAAXC.js.map +0 -1
  401. package/dist/chunk-VXVLKRU6.js +0 -758
  402. package/dist/chunk-VXVLKRU6.js.map +0 -1
  403. package/dist/chunk-WWUU5ETI.js +0 -163
  404. package/dist/chunk-WWUU5ETI.js.map +0 -1
  405. package/dist/chunk-XE4OXN2W.js +0 -10
  406. package/dist/chunk-XE4OXN2W.js.map +0 -1
  407. package/dist/chunk-XOJORS75.js +0 -1853
  408. package/dist/chunk-XOJORS75.js.map +0 -1
  409. package/dist/chunk-YMZEUTD2.js +0 -110
  410. package/dist/chunk-YMZEUTD2.js.map +0 -1
  411. package/dist/chunk-Z77BTSOK.js +0 -617
  412. package/dist/chunk-Z77BTSOK.js.map +0 -1
  413. package/dist/chunk-ZZK3WEDI.js +0 -181
  414. package/dist/chunk-ZZK3WEDI.js.map +0 -1
  415. package/dist/client-CCXpAZ2r.d.ts +0 -89
  416. package/dist/client-DSI_760t.d.ts +0 -36
  417. package/dist/client-JU6T3UPB.js +0 -11
  418. package/dist/client-JU6T3UPB.js.map +0 -1
  419. package/dist/dist-2X4Q7PJA.js +0 -1491
  420. package/dist/dist-2X4Q7PJA.js.map +0 -1
  421. package/dist/env-4UWSUS64.js +0 -4
  422. package/dist/env-4UWSUS64.js.map +0 -1
  423. package/dist/graph-emitter-r5TylDBm.d.ts +0 -47
  424. package/dist/graphql-CMHMQjvd.d.ts +0 -23
  425. package/dist/i18n-Qm2AkPC-.d.ts +0 -33
  426. package/dist/index--yvpa6ay.d.ts +0 -83
  427. package/dist/index-4gKQKZ2B.d.ts +0 -71
  428. package/dist/index-5x0XMKXN.d.ts +0 -149
  429. package/dist/index-B70b5mYS.d.ts +0 -33
  430. package/dist/index-B8KrxO4j.d.ts +0 -755
  431. package/dist/index-BOuDKnqD.d.ts +0 -201
  432. package/dist/index-BTMt4OjA.d.ts +0 -201
  433. package/dist/index-BejbszA7.d.ts +0 -39
  434. package/dist/index-BkeOYZye.d.ts +0 -198
  435. package/dist/index-BuAj5nXg.d.ts +0 -83
  436. package/dist/index-BvkVcW8I.d.ts +0 -349
  437. package/dist/index-CWmH_-RZ.d.ts +0 -247
  438. package/dist/index-CbgWNcus.d.ts +0 -258
  439. package/dist/index-CmfPeQza.d.ts +0 -166
  440. package/dist/index-CmpG-zak.d.ts +0 -607
  441. package/dist/index-CoMKgL-p.d.ts +0 -12
  442. package/dist/index-D8HGwglK.d.ts +0 -541
  443. package/dist/index-DCaVm66D.d.ts +0 -1101
  444. package/dist/index-DE2w7E0d.d.ts +0 -83
  445. package/dist/index-DSOpj8DI.d.ts +0 -17
  446. package/dist/index-DW9q22GH.d.ts +0 -75
  447. package/dist/index-DnjJ9CwI.d.ts +0 -347
  448. package/dist/index-DwMJZ8PP.d.ts +0 -317
  449. package/dist/index-PaojfSdd.d.ts +0 -71
  450. package/dist/index-aHtYvc3i.d.ts +0 -284
  451. package/dist/index-e_18DzAg.d.ts +0 -18
  452. package/dist/index-ffmipXSA.d.ts +0 -55
  453. package/dist/index-joONjwLt.d.ts +0 -33
  454. package/dist/index-kssw5ziY.d.ts +0 -250
  455. package/dist/index-lFffh5-G.d.ts +0 -125
  456. package/dist/index-pxYge_6k.d.ts +0 -79
  457. package/dist/layer-Cv9vSwBx.d.ts +0 -70
  458. package/dist/pino-logger-H4HPW5P6.js +0 -5
  459. package/dist/pino-logger-H4HPW5P6.js.map +0 -1
  460. package/dist/prisma-extension-gYhYriA0.d.ts +0 -174
  461. package/dist/sdk-L75WWUP3.js +0 -156
  462. package/dist/sdk-L75WWUP3.js.map +0 -1
  463. package/dist/shutdown-registry-CW9LryO8.d.ts +0 -10
  464. package/dist/types-Bo2wkjSP.d.ts +0 -35
  465. package/dist/types-DVpvrAhd.d.ts +0 -71
  466. package/dist/types-DgJ4lDYA.d.ts +0 -108
  467. package/dist/types-USOv09qy.d.ts +0 -327
  468. package/dist/workspace-guard-NXVYYBVJ.js +0 -5
  469. package/dist/workspace-guard-NXVYYBVJ.js.map +0 -1
@@ -0,0 +1,762 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-ad2WFvuA.js";
2
+ import { Kind, parse } from "graphql";
3
+ import { readFileSync, readdirSync, statSync } from "node:fs";
4
+ import { extname, join } from "node:path";
5
+
6
+ // src/validation/name.ts
7
+ const NAME_MIN_LENGTH = 1;
8
+ const NAME_MAX_LENGTH = 100;
9
+ /**
10
+ * Allowed characters for a name. Every character must be a letter,
11
+ * mark, literal space, hyphen, apostrophe, period, middle-dot, or join
12
+ * control. Must contain at least one letter.
13
+ *
14
+ * Note: a literal space, not `\s` — `\s` matches tabs/newlines/other
15
+ * Unicode whitespace which has no business being inside a person's name.
16
+ *
17
+ * Middle-dot codepoints U+00B7 and U+30FB are allowed as-is, NOT folded
18
+ * to `.` — they're orthographically distinct and silently rewriting the
19
+ * user's name would corrupt their identity.
20
+ */
21
+ const NAME_ALLOWED_CHARS = /^[\p{L}\p{M} '.\-\u00B7\u30FB\u200C\u200D]+$/u;
22
+ const TYPOGRAPHIC_APOSTROPHES = /[\u2018\u2019\u02BC]/g;
23
+ const TYPOGRAPHIC_HYPHENS = /[\u2010\u2011]/g;
24
+ /**
25
+ * Count Unicode code points in `s` instead of UTF-16 code units. Names
26
+ * written in scripts that live in the supplementary plane (Adlam 𞤁𞤔𞤣,
27
+ * many CJK extensions, etc.) have each letter encoded as two UTF-16 units,
28
+ * so a 51-letter Adlam name would otherwise be miscounted as 102 and
29
+ * rejected as too long.
30
+ *
31
+ * Code-point counting is sufficient for the name validator — grapheme-
32
+ * cluster counting would also handle emoji ZWJ sequences, but the name
33
+ * regex already disallows emoji.
34
+ */
35
+ function lengthInCodePoints(s) {
36
+ return [...s].length;
37
+ }
38
+ function validateName(name) {
39
+ const trimmed = (name ?? "").normalize("NFC").replace(TYPOGRAPHIC_APOSTROPHES, "'").replace(TYPOGRAPHIC_HYPHENS, "-").trim();
40
+ if (lengthInCodePoints(trimmed) < 1) return {
41
+ valid: false,
42
+ code: "required",
43
+ message: "Name is required"
44
+ };
45
+ if (lengthInCodePoints(trimmed) > 100) return {
46
+ valid: false,
47
+ code: "too_long",
48
+ message: `Name must be ${100} characters or fewer`
49
+ };
50
+ if (!NAME_ALLOWED_CHARS.test(trimmed) || !/\p{L}/u.test(trimmed)) {
51
+ if (!/\p{L}/u.test(trimmed)) return {
52
+ valid: false,
53
+ code: "no_letter",
54
+ message: "Name must contain at least one letter"
55
+ };
56
+ return {
57
+ valid: false,
58
+ code: "invalid_chars",
59
+ message: "Name can only contain letters, spaces, periods, hyphens, and apostrophes"
60
+ };
61
+ }
62
+ return {
63
+ valid: true,
64
+ value: trimmed
65
+ };
66
+ }
67
+
68
+ // src/validation/username.ts
69
+ /**
70
+ * Validate a username.
71
+ *
72
+ * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateUsername`
73
+ * from the BOFF-7214 client-side PR (#59). Do not edit one without
74
+ * editing the other.
75
+ *
76
+ * Rules:
77
+ * - 3–30 Unicode code points (NOT JavaScript `.length`)
78
+ * - allow-list `[a-zA-Z0-9_-]`
79
+ * - must contain at least one letter (so `12345` fails — this is the
80
+ * specific BOFF-7214 invariant; a pure-numeric username used to
81
+ * pass the character allow-list alone)
82
+ * - surrounding whitespace is trimmed before validation so a pasted
83
+ * `" alice_01 "` doesn't fail with a misleading "invalid chars"
84
+ * error
85
+ *
86
+ * On success the result carries the trimmed `value` so the caller
87
+ * persists the same string the validator approved.
88
+ *
89
+ * Returns a structured result with a list of errors so the caller can
90
+ * render every failing rule at once.
91
+ */
92
+ const USERNAME_MIN_LENGTH = 3;
93
+ const USERNAME_MAX_LENGTH = 30;
94
+ const USERNAME_ALLOWED_CHARS = /^[a-zA-Z0-9_-]+$/;
95
+ function validateUsername(username) {
96
+ const errors = [];
97
+ const value = (username ?? "").trim();
98
+ if (lengthInCodePoints(value) === 0) {
99
+ errors.push({
100
+ code: "required",
101
+ message: "Username is required"
102
+ });
103
+ return {
104
+ valid: false,
105
+ errors
106
+ };
107
+ }
108
+ if (lengthInCodePoints(value) < 3) errors.push({
109
+ code: "too_short",
110
+ message: `Username must be at least ${3} characters`
111
+ });
112
+ if (lengthInCodePoints(value) > 30) errors.push({
113
+ code: "too_long",
114
+ message: `Username must be ${30} characters or fewer`
115
+ });
116
+ if (!USERNAME_ALLOWED_CHARS.test(value)) errors.push({
117
+ code: "invalid_chars",
118
+ message: "Username can only contain letters, numbers, underscores, and hyphens"
119
+ });
120
+ if (lengthInCodePoints(value) >= 3 && lengthInCodePoints(value) <= 30 && !/[a-zA-Z]/.test(value)) errors.push({
121
+ code: "no_letter",
122
+ message: "Username must contain at least one letter"
123
+ });
124
+ return errors.length === 0 ? {
125
+ valid: true,
126
+ value
127
+ } : {
128
+ valid: false,
129
+ errors
130
+ };
131
+ }
132
+
133
+ // src/validation/userFields.ts
134
+ /**
135
+ * Bundle validation across all three user-identity fields.
136
+ *
137
+ * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateUserFields`
138
+ * from the BOFF-7214 client-side PR (#59). Do not edit one without
139
+ * editing the other.
140
+ *
141
+ * Use this on the server in `signUp`, `updateCurrentUserProfile`, and
142
+ * `updateUser` so the BOFF-7214 invariant — `firstName` / `lastName`
143
+ * contain a letter, `username` contains a letter — holds at every
144
+ * mutation surface, not just signup (BOFF-7261).
145
+ *
146
+ * `requireAll` controls how blank fields are treated:
147
+ * - `true` (default): used by `signUp` — every field must validate.
148
+ * An empty field fails with `code: "required"`.
149
+ * - `false`: used by `updateCurrentUserProfile` / `updateUser` — an
150
+ * existing user whose optional `firstName` / `lastName` is unset
151
+ * (e.g. provisioned via an identity provider) can still update
152
+ * unrelated fields like phone or role. Blank fields are skipped.
153
+ *
154
+ * On success, the result carries the canonicalised values from each
155
+ * individual validator (NFC, typographic apostrophes folded to ASCII,
156
+ * trimmed) so the caller writes the same strings the validators approved
157
+ * — no validate/submit divergence.
158
+ */
159
+ function validateUserFields(input, options = {}) {
160
+ const requireAll = options.requireAll ?? true;
161
+ const errors = [];
162
+ const isBlank = (v) => !v || v.trim().length === 0;
163
+ const firstName = !isBlank(input.firstName) || requireAll ? validateName(input.firstName) : null;
164
+ if (firstName && !firstName.valid) errors.push({
165
+ field: "firstName",
166
+ code: firstName.code,
167
+ message: firstName.message
168
+ });
169
+ const lastName = !isBlank(input.lastName) || requireAll ? validateName(input.lastName) : null;
170
+ if (lastName && !lastName.valid) errors.push({
171
+ field: "lastName",
172
+ code: lastName.code,
173
+ message: lastName.message
174
+ });
175
+ const username = !isBlank(input.username) || requireAll ? validateUsername(input.username) : null;
176
+ if (username && !username.valid) for (const e of username.errors) errors.push({
177
+ field: "username",
178
+ code: e.code,
179
+ message: e.message
180
+ });
181
+ if (errors.length > 0) return {
182
+ valid: false,
183
+ errors
184
+ };
185
+ const valueOr = (result, fallback) => result ? result.value : (fallback ?? "").trim();
186
+ return {
187
+ valid: true,
188
+ values: {
189
+ firstName: valueOr(firstName, input.firstName),
190
+ lastName: valueOr(lastName, input.lastName),
191
+ username: valueOr(username, input.username)
192
+ }
193
+ };
194
+ }
195
+
196
+ // src/validation/rbac-coverage.ts
197
+ /**
198
+ * Whole-schema `@rbac` coverage guard for subgraph services.
199
+ *
200
+ * Authorization on the platform is enforced at the API gateway, driven entirely by the
201
+ * `@rbac` directive on each root-operation field (see
202
+ * `~/products/dev/platform/context/identity/rbac/`). The gateway's rbac-middleware
203
+ * fails CLOSED for HTTP Query/Mutation traffic, so a field without a usable `@rbac`
204
+ * is denied for every caller ("Field X is missing @rbac directive"): an outage.
205
+ * Subscriptions over the WebSocket transport are let through with only a warning,
206
+ * so a missing `@rbac` there is a silent authorization hole.
207
+ *
208
+ * `assertRbacCoverage` is meant to be called from one unit test per svc. It parses
209
+ * the svc's real SDL into a GraphQL AST (no regex) and checks, for every
210
+ * Query/Mutation/Subscription field:
211
+ *
212
+ * 1. it carries an `@rbac` directive;
213
+ * 2. the directive is well-formed the way the gateway reads it: `public: true`,
214
+ * `scopeType: "self"`, an `actorTypes`-only gate, or `action` + `resource` +
215
+ * a known `scopeType` (`entity` additionally needs `scopeArg`);
216
+ * 3. `resourceIdArg` (and the `scopeArg` of `entity`/`billing` scopes) resolves to a
217
+ * single ID/String through the field's arguments and input objects, at most two
218
+ * segments deep — anything else silently degrades to a type-wide check or a deny;
219
+ * 4. optionally, the set of `scopeType: "self"` fields equals a pinned, reviewed list,
220
+ * because "self" is an authentication gate only and the resolver alone must scope
221
+ * the data to the caller.
222
+ *
223
+ * Lifted from wspace-healthybowl-svc `src/__tests__/rbac-coverage.test.ts`
224
+ * (BOFF-6052, BOFF-7476) so every svc runs one implementation.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * import { assertRbacCoverage } from '@burdenoff/be-sdk/validation';
229
+ *
230
+ * it('gates every root field with a well-formed @rbac', () => {
231
+ * const report = assertRbacCoverage(join(__dirname, '../modules'), {
232
+ * selfScopedFields: { myAgents: 'resolver filters by ctx.actorId' },
233
+ * minRootFields: 200,
234
+ * });
235
+ * expect(report.rootFields.length).toBeGreaterThan(200);
236
+ * });
237
+ * ```
238
+ */
239
+ /** Scope types the gateway rbac-middleware understands for an action+resource check. */
240
+ const RBAC_GATED_SCOPE_TYPES = [
241
+ "wspace",
242
+ "global",
243
+ "entity",
244
+ "billing",
245
+ "organization"
246
+ ];
247
+ /** Every `scopeType` value the gateway accepts (the gated ones plus the `self` authentication gate). */
248
+ const RBAC_SCOPE_TYPES = [...RBAC_GATED_SCOPE_TYPES, "self"];
249
+ /** Default root operation types whose every field must be RBAC-gated. */
250
+ const DEFAULT_RBAC_ROOT_TYPES = [
251
+ "Query",
252
+ "Mutation",
253
+ "Subscription"
254
+ ];
255
+ /**
256
+ * The most segments a `resourceIdArg`/`scopeArg` path can have and still resolve however
257
+ * the client writes the request. The gateway's `extractFieldArguments` copies an inline
258
+ * object argument one level deep and skips a nested object literal inside it, so
259
+ * `input.nested.id` resolves only when `input` arrives as a variable.
260
+ */
261
+ const DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS = 2;
262
+ /** The billing scope reads this argument when the directive sets no `scopeArg`. */
263
+ const DEFAULT_BILLING_SCOPE_ARG = "billingAccountId";
264
+ const DEFAULT_ID_SCALARS = ["ID", "String"];
265
+ const SCHEMA_EXTENSIONS = /* @__PURE__ */ new Set([".gql", ".graphql"]);
266
+ const SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set([
267
+ "node_modules",
268
+ "dist",
269
+ "build",
270
+ "coverage"
271
+ ]);
272
+ /**
273
+ * Placeholder root fields (`_empty`, `_emptyVibecontrols`, …) keep an otherwise-empty
274
+ * root type valid SDL. They expose no data and need no gate.
275
+ */
276
+ const PLACEHOLDER_FIELD = /^_empty[A-Za-z0-9]*$/;
277
+ /** Thrown by {@link assertRbacCoverage}; carries the full report. */
278
+ var RbacCoverageError = class extends Error {
279
+ report;
280
+ constructor(report) {
281
+ super(`RBAC coverage check failed (${report.problems.length} problem(s)):\n - ${report.problems.join("\n - ")}`);
282
+ this.name = "RbacCoverageError";
283
+ this.report = report;
284
+ }
285
+ };
286
+ function collectSchemaFiles(path) {
287
+ if (!statSync(path).isDirectory()) return [path];
288
+ const out = [];
289
+ const entries = readdirSync(path, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, "en"));
290
+ for (const entry of entries) {
291
+ const full = join(path, entry.name);
292
+ if (entry.isDirectory()) {
293
+ if (!SKIPPED_DIRECTORIES.has(entry.name) && !entry.name.startsWith(".")) out.push(...collectSchemaFiles(full));
294
+ } else if (SCHEMA_EXTENSIONS.has(extname(entry.name))) out.push(full);
295
+ }
296
+ return out;
297
+ }
298
+ /**
299
+ * Parse every `.gql`/`.graphql` file under the given paths. A path may be a single SDL file
300
+ * (e.g. `.hive-schema.graphql`) or a directory, which is walked recursively (skipping
301
+ * dot-directories, `node_modules`, `dist`, `build` and `coverage`).
302
+ */
303
+ function loadRbacSchemaDocuments(paths) {
304
+ return (typeof paths === "string" ? [paths] : paths).flatMap(collectSchemaFiles).map((file) => {
305
+ try {
306
+ return {
307
+ file,
308
+ document: parse(readFileSync(file, "utf8"))
309
+ };
310
+ } catch (error) {
311
+ const message = error instanceof Error ? error.message : String(error);
312
+ throw new Error(`Failed to parse GraphQL schema ${file}: ${message}`, { cause: error });
313
+ }
314
+ });
315
+ }
316
+ function isDocumentNode(value) {
317
+ return typeof value === "object" && value !== null && value.kind === Kind.DOCUMENT;
318
+ }
319
+ function toSchemaDocuments(source) {
320
+ if (typeof source === "string") return loadRbacSchemaDocuments(source);
321
+ if (isDocumentNode(source)) return [{ document: source }];
322
+ const items = source;
323
+ if (items.every((item) => typeof item === "string")) return loadRbacSchemaDocuments(items);
324
+ return items.map((item) => {
325
+ if (isDocumentNode(item)) return { document: item };
326
+ if (typeof item === "object" && item !== null && isDocumentNode(item.document)) return item;
327
+ throw new TypeError("RbacCoverageSource arrays must contain only paths, DocumentNodes or RbacSchemaDocuments");
328
+ });
329
+ }
330
+ function rbacDirective(field) {
331
+ return (field.directives ?? []).find((d) => d.name.value === "rbac");
332
+ }
333
+ /** Read the `@rbac` arguments of a field definition the way the gateway does (literal values only). */
334
+ function readRbacDirectiveArgs(field) {
335
+ const directive = rbacDirective(field);
336
+ if (!directive) return null;
337
+ const args = {};
338
+ for (const arg of directive.arguments ?? []) {
339
+ const name = arg.name.value;
340
+ const value = arg.value;
341
+ if (name === "public") {
342
+ if (value.kind === Kind.BOOLEAN) args.public = value.value;
343
+ } else if (name === "actorTypes") {
344
+ if (value.kind === Kind.LIST) args.actorTypes = value.values.flatMap((v) => v.kind === Kind.STRING ? [v.value] : []);
345
+ else if (value.kind === Kind.STRING) args.actorTypes = [value.value];
346
+ } else if (value.kind === Kind.STRING && (name === "action" || name === "resource" || name === "resourceIdArg" || name === "scopeType" || name === "scopeArg")) args[name] = value.value;
347
+ }
348
+ return args;
349
+ }
350
+ function rootTypeNames(docs, configured) {
351
+ if (configured) return new Set(configured);
352
+ const names = new Set(DEFAULT_RBAC_ROOT_TYPES);
353
+ for (const { document } of docs) for (const def of document.definitions) if (def.kind === Kind.SCHEMA_DEFINITION || def.kind === Kind.SCHEMA_EXTENSION) for (const op of def.operationTypes ?? []) names.add(op.type.name.value);
354
+ return names;
355
+ }
356
+ function inputFieldsByType(docs) {
357
+ const out = /* @__PURE__ */ new Map();
358
+ for (const { document } of docs) for (const def of document.definitions) if (def.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION || def.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION) {
359
+ const input = def;
360
+ const existing = out.get(input.name.value) ?? [];
361
+ existing.push(...input.fields ?? []);
362
+ out.set(input.name.value, existing);
363
+ }
364
+ return out;
365
+ }
366
+ /** The named type under any NonNull wrappers, or null when a List sits anywhere in between. */
367
+ function unwrapSingular(type) {
368
+ if (type.kind === Kind.NON_NULL_TYPE) return unwrapSingular(type.type);
369
+ if (type.kind === Kind.LIST_TYPE) return null;
370
+ return type.name.value;
371
+ }
372
+ /**
373
+ * Mirrors the gateway's `extractFieldArguments` + `getValueAtPath`: the path is split on '.',
374
+ * walked from the field's arguments through input objects, and used only when it lands on a
375
+ * string. Returns why the path cannot resolve for every request shape, or null when it does.
376
+ */
377
+ function rbacArgPathProblem(field, path, inputs, options = {}) {
378
+ const maxSegments = options.maxSegments ?? 2;
379
+ const idScalars = new Set(options.idScalars ?? DEFAULT_ID_SCALARS);
380
+ const segments = path.split(".");
381
+ if (segments.some((s) => s.length === 0)) return `"${path}" has an empty segment`;
382
+ if (segments.length > maxSegments) return `"${path}" has ${segments.length} segments; the gateway reads at most ${maxSegments} (it drops nested object literals)`;
383
+ const [head, ...rest] = segments;
384
+ const arg = (field.arguments ?? []).find((a) => a.name.value === head);
385
+ if (!arg) return `no argument "${head}"`;
386
+ let typeName = unwrapSingular(arg.type);
387
+ let walked = head;
388
+ for (const segment of rest) {
389
+ if (typeName === null) return `"${walked}" is a list`;
390
+ const fields = inputs.get(typeName);
391
+ if (!fields) return `"${walked}" is ${typeName}, not an input object`;
392
+ const next = fields.find((f) => f.name.value === segment);
393
+ if (!next) return `${typeName} has no field "${segment}"`;
394
+ typeName = unwrapSingular(next.type);
395
+ walked = `${walked}.${segment}`;
396
+ }
397
+ if (typeName === null) return `"${walked}" is a list`;
398
+ if (!idScalars.has(typeName)) return `"${walked}" is ${typeName}, not ${[...idScalars].join("/")}`;
399
+ return null;
400
+ }
401
+ /** Why the gateway would deny this directive as invalid, or null when it is well-formed. */
402
+ function malformedReason(rbac) {
403
+ if (rbac.public === true) return null;
404
+ if (rbac.scopeType === "self") return null;
405
+ const hasActionResource = Boolean(rbac.action) && Boolean(rbac.resource);
406
+ if (!hasActionResource && rbac.actorTypes && rbac.actorTypes.length > 0) {
407
+ if (rbac.action || rbac.resource) return "actorTypes gate sets only one of action/resource";
408
+ return null;
409
+ }
410
+ if (!hasActionResource) return "missing action or resource (and not public, self or actorTypes-only)";
411
+ if (!rbac.scopeType) return "missing scopeType";
412
+ if (!RBAC_GATED_SCOPE_TYPES.includes(rbac.scopeType)) return `unknown scopeType "${rbac.scopeType}"`;
413
+ if (rbac.scopeType === "entity" && !rbac.scopeArg) return "entity scope requires scopeArg";
414
+ return null;
415
+ }
416
+ function pinEntries(pin) {
417
+ return Array.isArray(pin) ? [...pin] : Object.keys(pin);
418
+ }
419
+ function matchesEntry(field, entry) {
420
+ return entry === field.name || entry === field.coordinate;
421
+ }
422
+ /** Deterministic, locale-independent ordering for report lines. */
423
+ function sortLines(lines) {
424
+ return lines.sort((a, b) => a.localeCompare(b, "en"));
425
+ }
426
+ function collectRootFields(docs, roots, exempt) {
427
+ const out = [];
428
+ for (const { document, file } of docs) for (const def of document.definitions) {
429
+ if (def.kind !== Kind.OBJECT_TYPE_DEFINITION && def.kind !== Kind.OBJECT_TYPE_EXTENSION) continue;
430
+ const type = def.name.value;
431
+ if (!roots.has(type)) continue;
432
+ for (const definition of def.fields ?? []) {
433
+ const name = definition.name.value;
434
+ const coordinate = `${type}.${name}`;
435
+ if (PLACEHOLDER_FIELD.test(name) || exempt.has(name) || exempt.has(coordinate)) continue;
436
+ const root = {
437
+ type,
438
+ name,
439
+ coordinate,
440
+ rbac: readRbacDirectiveArgs(definition)
441
+ };
442
+ if (file) root.file = file;
443
+ out.push({
444
+ root,
445
+ definition
446
+ });
447
+ }
448
+ }
449
+ return out;
450
+ }
451
+ /** The argument path a gated scope reads its scope id from; only `entity` and `billing` read one. */
452
+ function scopeArgPath(rbac) {
453
+ if (rbac.public === true) return void 0;
454
+ if (rbac.scopeType === "entity") return rbac.scopeArg;
455
+ if (rbac.scopeType === "billing") return rbac.scopeArg ?? DEFAULT_BILLING_SCOPE_ARG;
456
+ }
457
+ function argPathProblems(definition, rbac, context) {
458
+ const options = {
459
+ maxSegments: context.maxSegments,
460
+ idScalars: [...context.idScalars]
461
+ };
462
+ return [{
463
+ label: "resourceIdArg",
464
+ path: rbac.resourceIdArg
465
+ }, {
466
+ label: "scopeArg",
467
+ path: scopeArgPath(rbac)
468
+ }].flatMap(({ label, path }) => {
469
+ if (path === void 0) return [];
470
+ const problem = rbacArgPathProblem(definition, path, context.inputs, options);
471
+ return problem ? [{
472
+ label,
473
+ problem
474
+ }] : [];
475
+ });
476
+ }
477
+ function selfScopedPinProblems(rootFields, pin) {
478
+ if (!pin) return {
479
+ unreviewed: [],
480
+ stale: []
481
+ };
482
+ const entries = pinEntries(pin);
483
+ const selfScoped = rootFields.filter((f) => f.rbac?.scopeType === "self" && f.rbac.public !== true);
484
+ return {
485
+ unreviewed: selfScoped.filter((field) => !entries.some((entry) => matchesEntry(field, entry))).map((field) => field.coordinate),
486
+ stale: entries.filter((entry) => !selfScoped.some((field) => matchesEntry(field, entry)))
487
+ };
488
+ }
489
+ /** Analyse the schema and return every coverage problem without throwing. */
490
+ function analyzeRbacCoverage(source, options = {}) {
491
+ const docs = toSchemaDocuments(source);
492
+ const collected = collectRootFields(docs, rootTypeNames(docs, options.rootTypes), new Set(options.exemptFields));
493
+ const pathContext = {
494
+ inputs: inputFieldsByType(docs),
495
+ maxSegments: options.maxArgPathSegments ?? 2,
496
+ idScalars: new Set(options.idScalars ?? DEFAULT_ID_SCALARS)
497
+ };
498
+ const missing = [];
499
+ const malformed = [];
500
+ const unresolvedArgPaths = [];
501
+ for (const { root, definition } of collected) {
502
+ const { rbac, coordinate } = root;
503
+ if (!rbac) {
504
+ missing.push(coordinate);
505
+ continue;
506
+ }
507
+ const reason = malformedReason(rbac);
508
+ if (reason) malformed.push(`${coordinate}: ${reason}`);
509
+ for (const { label, problem } of argPathProblems(definition, rbac, pathContext)) unresolvedArgPaths.push(`${coordinate}: ${label} ${problem}`);
510
+ }
511
+ const rootFields = collected.map(({ root }) => root);
512
+ const pins = selfScopedPinProblems(rootFields, options.selfScopedFields);
513
+ const unreviewedSelfScoped = sortLines(pins.unreviewed);
514
+ const staleSelfScoped = sortLines(pins.stale);
515
+ sortLines(missing);
516
+ sortLines(malformed);
517
+ sortLines(unresolvedArgPaths);
518
+ const minRootFields = options.minRootFields ?? 1;
519
+ const problems = [
520
+ ...rootFields.length < minRootFields ? [`found ${rootFields.length} root field(s), expected at least ${minRootFields} (wrong schema path?)`] : [],
521
+ ...missing.map((c) => `${c}: missing @rbac directive`),
522
+ ...malformed.map((m) => `malformed @rbac on ${m}`),
523
+ ...unresolvedArgPaths.map((p) => `unresolvable @rbac path on ${p}`),
524
+ ...unreviewedSelfScoped.map((c) => `${c}: scopeType "self" is not in the reviewed selfScopedFields list`),
525
+ ...staleSelfScoped.map((e) => `selfScopedFields entry "${e}" matches no self-scoped root field (stale)`)
526
+ ];
527
+ return {
528
+ rootFields,
529
+ missing,
530
+ malformed,
531
+ unresolvedArgPaths,
532
+ unreviewedSelfScoped,
533
+ staleSelfScoped,
534
+ problems,
535
+ ok: problems.length === 0
536
+ };
537
+ }
538
+ /**
539
+ * Assert full `@rbac` coverage. Throws {@link RbacCoverageError} listing every problem;
540
+ * returns the report on success so callers can make further assertions on `rootFields`.
541
+ */
542
+ function assertRbacCoverage(source, options = {}) {
543
+ const report = analyzeRbacCoverage(source, options);
544
+ if (!report.ok) throw new RbacCoverageError(report);
545
+ return report;
546
+ }
547
+
548
+ // src/validation/billing.ts
549
+ /** Canonical billing policy extracted from global-billing input validation (BOFF-10764).
550
+ * Currency support and the existing 1e9 ceiling are unchanged. This validates
551
+ * major-unit values only; it does not round, convert FX or authorize payment.
552
+ */
553
+ const SUPPORTED_BILLING_CURRENCIES = Object.freeze([
554
+ "USD",
555
+ "EUR",
556
+ "GBP",
557
+ "INR",
558
+ "AUD",
559
+ "CAD",
560
+ "SGD",
561
+ "JPY",
562
+ "CNY",
563
+ "BRL",
564
+ "MXN",
565
+ "KRW",
566
+ "HKD",
567
+ "NOK",
568
+ "SEK",
569
+ "DKK",
570
+ "CHF",
571
+ "NZD",
572
+ "ZAR",
573
+ "AED",
574
+ "SAR",
575
+ "QAR",
576
+ "OMR",
577
+ "BHD",
578
+ "KWD",
579
+ "JOD",
580
+ "EGP",
581
+ "PKR",
582
+ "BDT",
583
+ "LKR",
584
+ "THB",
585
+ "MYR",
586
+ "IDR",
587
+ "PHP",
588
+ "VND",
589
+ "TWD",
590
+ "CZK",
591
+ "HUF",
592
+ "PLN",
593
+ "RON",
594
+ "RUB",
595
+ "TRY",
596
+ "ILS",
597
+ "NGN",
598
+ "GHS",
599
+ "KES",
600
+ "TZS",
601
+ "UGX",
602
+ "ETB",
603
+ "MAD",
604
+ "DZD",
605
+ "TND",
606
+ "BWP",
607
+ "MUR",
608
+ "MVR",
609
+ "BND",
610
+ "KHR",
611
+ "MMK",
612
+ "KZT",
613
+ "UZS",
614
+ "AZN",
615
+ "GEL",
616
+ "AMD",
617
+ "UAH",
618
+ "BGN",
619
+ "HRK",
620
+ "MKD",
621
+ "ALL",
622
+ "RSD",
623
+ "CLP",
624
+ "COP",
625
+ "PEN",
626
+ "ARS",
627
+ "BOB",
628
+ "PYG",
629
+ "UYU",
630
+ "GTQ",
631
+ "HNL",
632
+ "NIO",
633
+ "CRC",
634
+ "DOP",
635
+ "TTD",
636
+ "JMD",
637
+ "BBD",
638
+ "HTG",
639
+ "BZD",
640
+ "GYD",
641
+ "SRD",
642
+ "XCD",
643
+ "PAB"
644
+ ]);
645
+ const supportedCurrencies = new Set(SUPPORTED_BILLING_CURRENCIES);
646
+ const MAX_BILLING_AMOUNT = 1e9;
647
+ /** Case-insensitive, as in billing. Whitespace is not silently accepted. */
648
+ function isSupportedBillingCurrency(currency) {
649
+ return typeof currency === "string" && supportedCurrencies.has(currency.toUpperCase());
650
+ }
651
+ /** Zero is rejected by default. Callers may explicitly permit unpaid amounts. */
652
+ function validateBillingAmount(amount, options = {}) {
653
+ if (typeof amount !== "number" || !Number.isFinite(amount)) return {
654
+ valid: false,
655
+ code: "not_finite"
656
+ };
657
+ if (options.allowZero === true ? amount < 0 : amount <= 0) return {
658
+ valid: false,
659
+ code: options.allowZero === true ? "negative" : "not_positive"
660
+ };
661
+ if (amount > 1e9) return {
662
+ valid: false,
663
+ code: "exceeds_maximum"
664
+ };
665
+ return {
666
+ valid: true,
667
+ value: amount
668
+ };
669
+ }
670
+ /** Existing global billing provider-conversion policy, not an ISO currency registry.
671
+ * Other legacy converter callers may use codes outside the supported billing set.
672
+ */
673
+ const ZERO_DECIMAL_PROVIDER_CURRENCIES = /* @__PURE__ */ new Set([
674
+ "BIF",
675
+ "CLP",
676
+ "DJF",
677
+ "GNF",
678
+ "JPY",
679
+ "KMF",
680
+ "KRW",
681
+ "MGA",
682
+ "PYG",
683
+ "RWF",
684
+ "UGX",
685
+ "VND",
686
+ "VUV",
687
+ "XAF",
688
+ "XOF",
689
+ "XPF"
690
+ ]);
691
+ function providerUnitScale(currency) {
692
+ return ZERO_DECIMAL_PROVIDER_CURRENCIES.has(currency.toUpperCase()) ? 1 : 100;
693
+ }
694
+ /** Preserve global billing's existing rounding conversion exactly. This does not
695
+ * validate amount/currency or imply that a provider supports a particular code.
696
+ * New financial terms should use validateBillingMoney before converting them.
697
+ */
698
+ function convertBillingToMinorUnits(amount, currency) {
699
+ return Math.round(amount * providerUnitScale(currency));
700
+ }
701
+ /** Validate terms that must survive current provider conversion without rounding.
702
+ * It deliberately does not tighten validateBillingAmount's legacy major-unit API.
703
+ * No tolerance is used: accepting a changed amount would alter agreed terms.
704
+ */
705
+ function validateBillingMoney(amount, currency, options = {}) {
706
+ const validated = validateBillingAmount(amount, options);
707
+ if (!validated.valid) return validated;
708
+ if (typeof currency !== "string") return {
709
+ valid: false,
710
+ code: "unsupported_currency"
711
+ };
712
+ const normalized = currency.toUpperCase();
713
+ const supported = SUPPORTED_BILLING_CURRENCIES.find((code) => code === normalized);
714
+ if (!supported) return {
715
+ valid: false,
716
+ code: "unsupported_currency"
717
+ };
718
+ const minorUnits = convertBillingToMinorUnits(validated.value, supported);
719
+ if (!Number.isSafeInteger(minorUnits) || minorUnits / providerUnitScale(supported) !== validated.value) return {
720
+ valid: false,
721
+ code: "minor_unit_precision"
722
+ };
723
+ return {
724
+ valid: true,
725
+ value: {
726
+ amount: validated.value,
727
+ currency: supported,
728
+ minorUnits
729
+ }
730
+ };
731
+ }
732
+
733
+ // src/validation/index.ts
734
+ var validation_exports = /* @__PURE__ */ __exportAll({
735
+ DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS: () => 2,
736
+ DEFAULT_RBAC_ROOT_TYPES: () => DEFAULT_RBAC_ROOT_TYPES,
737
+ MAX_BILLING_AMOUNT: () => MAX_BILLING_AMOUNT,
738
+ NAME_MAX_LENGTH: () => 100,
739
+ NAME_MIN_LENGTH: () => 1,
740
+ RBAC_GATED_SCOPE_TYPES: () => RBAC_GATED_SCOPE_TYPES,
741
+ RBAC_SCOPE_TYPES: () => RBAC_SCOPE_TYPES,
742
+ RbacCoverageError: () => RbacCoverageError,
743
+ SUPPORTED_BILLING_CURRENCIES: () => SUPPORTED_BILLING_CURRENCIES,
744
+ USERNAME_MAX_LENGTH: () => 30,
745
+ USERNAME_MIN_LENGTH: () => 3,
746
+ analyzeRbacCoverage: () => analyzeRbacCoverage,
747
+ assertRbacCoverage: () => assertRbacCoverage,
748
+ convertBillingToMinorUnits: () => convertBillingToMinorUnits,
749
+ isSupportedBillingCurrency: () => isSupportedBillingCurrency,
750
+ lengthInCodePoints: () => lengthInCodePoints,
751
+ loadRbacSchemaDocuments: () => loadRbacSchemaDocuments,
752
+ rbacArgPathProblem: () => rbacArgPathProblem,
753
+ readRbacDirectiveArgs: () => readRbacDirectiveArgs,
754
+ validateBillingAmount: () => validateBillingAmount,
755
+ validateBillingMoney: () => validateBillingMoney,
756
+ validateName: () => validateName,
757
+ validateUserFields: () => validateUserFields,
758
+ validateUsername: () => validateUsername
759
+ });
760
+
761
+ export { NAME_MIN_LENGTH as C, NAME_MAX_LENGTH as S, validateName as T, readRbacDirectiveArgs as _, isSupportedBillingCurrency as a, USERNAME_MIN_LENGTH as b, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as c, RBAC_SCOPE_TYPES as d, RbacCoverageError as f, rbacArgPathProblem as g, loadRbacSchemaDocuments as h, convertBillingToMinorUnits as i, DEFAULT_RBAC_ROOT_TYPES as l, assertRbacCoverage as m, MAX_BILLING_AMOUNT as n, validateBillingAmount as o, analyzeRbacCoverage as p, SUPPORTED_BILLING_CURRENCIES as r, validateBillingMoney as s, validation_exports as t, RBAC_GATED_SCOPE_TYPES as u, validateUserFields as v, lengthInCodePoints as w, validateUsername as x, USERNAME_MAX_LENGTH as y };
762
+ //# sourceMappingURL=validation-CPUITdMk.js.map