@sixb/core 0.1.13 → 0.1.15

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 (236) hide show
  1. package/dist/actions/index.js +22 -22
  2. package/dist/agents/index.js +34 -34
  3. package/dist/agents/index.js.map +1 -1
  4. package/dist/agents/streams/index.js +2 -2
  5. package/dist/agents/streams/internal.js +2 -2
  6. package/dist/auth/errors.d.ts +12 -0
  7. package/dist/auth/errors.d.ts.map +1 -1
  8. package/dist/auth/index.d.ts +1 -1
  9. package/dist/auth/index.d.ts.map +1 -1
  10. package/dist/auth/index.js +7 -5
  11. package/dist/auth/index.js.map +1 -1
  12. package/dist/auth/runtime.d.ts.map +1 -1
  13. package/dist/auth/strategy.d.ts +2 -0
  14. package/dist/auth/strategy.d.ts.map +1 -1
  15. package/dist/auth/strategy.js +4 -2
  16. package/dist/auth/strategy.js.map +1 -1
  17. package/dist/auth/types.d.ts +8 -0
  18. package/dist/auth/types.d.ts.map +1 -1
  19. package/dist/authorization/index.js +2 -2
  20. package/dist/bootstrap/index.js +37 -37
  21. package/dist/{chunk-693f3zn8.js → chunk-1jvq82rp.js} +3 -3
  22. package/dist/{chunk-0321g649.js → chunk-2jntasmh.js} +13 -2
  23. package/dist/{chunk-0321g649.js.map → chunk-2jntasmh.js.map} +3 -3
  24. package/dist/{chunk-cvrbhvtr.js → chunk-2tz5vnvz.js} +28 -28
  25. package/dist/{chunk-cvrbhvtr.js.map → chunk-2tz5vnvz.js.map} +1 -1
  26. package/dist/{chunk-898y24dd.js → chunk-3c90jvfj.js} +2 -2
  27. package/dist/{chunk-vn3yh259.js → chunk-4gmng3vf.js} +1 -1
  28. package/dist/{chunk-91wthfwe.js → chunk-4jph1t3v.js} +7 -7
  29. package/dist/{chunk-znw0zvy4.js → chunk-4wn7bxxa.js} +25 -7
  30. package/dist/chunk-4wn7bxxa.js.map +12 -0
  31. package/dist/{chunk-3qpcrcj8.js → chunk-6aawea28.js} +2 -4
  32. package/dist/chunk-6aawea28.js.map +10 -0
  33. package/dist/{chunk-rzkr70gr.js → chunk-6fsr7y93.js} +5 -1
  34. package/dist/{chunk-rzkr70gr.js.map → chunk-6fsr7y93.js.map} +3 -3
  35. package/dist/{chunk-y487ywrv.js → chunk-6q7c68yx.js} +4 -4
  36. package/dist/{chunk-ypj2wqtj.js → chunk-70jmg2zx.js} +2 -2
  37. package/dist/{chunk-s24qbp32.js → chunk-7jc21943.js} +3 -3
  38. package/dist/{chunk-rzcjp5m2.js → chunk-8fjmqjyx.js} +1 -1
  39. package/dist/{chunk-m8zkvep1.js → chunk-8w27xf9e.js} +1 -1
  40. package/dist/{chunk-z9h698s8.js → chunk-a4g5yjm0.js} +1 -1
  41. package/dist/{chunk-gmt22nxx.js → chunk-adbve9zt.js} +1 -1
  42. package/dist/{chunk-mf6hwpzh.js → chunk-dqkd3kdj.js} +41 -23
  43. package/dist/{chunk-mf6hwpzh.js.map → chunk-dqkd3kdj.js.map} +3 -3
  44. package/dist/{chunk-gbcrz0gr.js → chunk-ex8s8wsk.js} +6 -6
  45. package/dist/{chunk-4tnrzqqh.js → chunk-fj1dvp37.js} +1 -1
  46. package/dist/{chunk-gc226ten.js → chunk-fjw417jf.js} +127 -69
  47. package/dist/{chunk-gc226ten.js.map → chunk-fjw417jf.js.map} +4 -4
  48. package/dist/{chunk-ht4a7mjg.js → chunk-g4rbm4a6.js} +42 -8
  49. package/dist/{chunk-ht4a7mjg.js.map → chunk-g4rbm4a6.js.map} +3 -3
  50. package/dist/{chunk-qma80ych.js → chunk-hn2r7z41.js} +3 -2
  51. package/dist/chunk-hn2r7z41.js.map +11 -0
  52. package/dist/{chunk-bdhfn0ww.js → chunk-kkqwzy6h.js} +1 -1
  53. package/dist/{chunk-bep5rrdq.js → chunk-mmac1mp6.js} +2 -2
  54. package/dist/{chunk-w9bp61e7.js → chunk-n5t4mq6z.js} +5 -5
  55. package/dist/{chunk-n33e8dz8.js → chunk-p0nbkys4.js} +1 -1
  56. package/dist/{chunk-04h4t2b5.js → chunk-py2dw8cw.js} +3 -3
  57. package/dist/{chunk-jhyc777j.js → chunk-q3grgzp1.js} +2 -2
  58. package/dist/{chunk-9pfw47qx.js → chunk-qne45xqq.js} +53 -48
  59. package/dist/{chunk-9pfw47qx.js.map → chunk-qne45xqq.js.map} +7 -7
  60. package/dist/{chunk-cbn96bve.js → chunk-r5sc1d2b.js} +2 -2
  61. package/dist/{chunk-y6vnvayj.js → chunk-vjcd8d27.js} +1 -1
  62. package/dist/{chunk-jmwy25mf.js → chunk-wd34wnsy.js} +6 -6
  63. package/dist/{chunk-63fp9x3q.js → chunk-wem5vqjw.js} +7 -7
  64. package/dist/{chunk-darm7eeg.js → chunk-xr7y35yj.js} +3 -3
  65. package/dist/{chunk-a69fkrtr.js → chunk-y0zmae99.js} +5 -5
  66. package/dist/{chunk-xgptywp0.js → chunk-y2aq6ag9.js} +1 -1
  67. package/dist/{chunk-2hbhn1ff.js → chunk-yfppyaty.js} +1 -1
  68. package/dist/{chunk-rqtdtm43.js → chunk-z708gemf.js} +129 -70
  69. package/dist/{chunk-rqtdtm43.js.map → chunk-z708gemf.js.map} +5 -5
  70. package/dist/deploy/define.d.ts +4 -0
  71. package/dist/deploy/define.d.ts.map +1 -0
  72. package/dist/deploy/index.d.ts +3 -0
  73. package/dist/deploy/index.d.ts.map +1 -0
  74. package/dist/deploy/index.js +10 -0
  75. package/dist/deploy/index.js.map +10 -0
  76. package/dist/deploy/internal.d.ts +3 -0
  77. package/dist/deploy/internal.d.ts.map +1 -0
  78. package/dist/deploy/internal.js +244 -0
  79. package/dist/deploy/internal.js.map +11 -0
  80. package/dist/deploy/services.d.ts +8 -0
  81. package/dist/deploy/services.d.ts.map +1 -0
  82. package/dist/deploy/types.d.ts +309 -0
  83. package/dist/deploy/types.d.ts.map +1 -0
  84. package/dist/deploy/validation.d.ts +7 -0
  85. package/dist/deploy/validation.d.ts.map +1 -0
  86. package/dist/error-reporting/internal.js +3 -3
  87. package/dist/errors/catalog.d.ts +4 -0
  88. package/dist/errors/catalog.d.ts.map +1 -1
  89. package/dist/errors/internal.js +1 -1
  90. package/dist/events/index.js +3 -3
  91. package/dist/execution/agent.js +33 -33
  92. package/dist/execution/primitive.js +29 -29
  93. package/dist/execution/request.js +31 -31
  94. package/dist/execution/request.js.map +1 -1
  95. package/dist/index.js +49 -49
  96. package/dist/index.js.map +1 -1
  97. package/dist/maintenance/ontology-maintenance.d.ts +2 -0
  98. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  99. package/dist/maintenance/types.d.ts +8 -2
  100. package/dist/maintenance/types.d.ts.map +1 -1
  101. package/dist/materialization/dataset-watermark.d.ts +6 -1
  102. package/dist/materialization/dataset-watermark.d.ts.map +1 -1
  103. package/dist/materialization/index.js +1 -1
  104. package/dist/materialization/model.d.ts +6 -0
  105. package/dist/materialization/model.d.ts.map +1 -1
  106. package/dist/materializer/index.js +18 -18
  107. package/dist/materializer/index.js.map +1 -1
  108. package/dist/materializer/projections/finish-run.d.ts.map +1 -1
  109. package/dist/materializer/projections/replace.d.ts.map +1 -1
  110. package/dist/materializer/projections/source-materialization.d.ts +6 -2
  111. package/dist/materializer/projections/source-materialization.d.ts.map +1 -1
  112. package/dist/models/execution/index.js +14 -14
  113. package/dist/objects/index.js +21 -21
  114. package/dist/objects/query/index.js +15 -15
  115. package/dist/pipelines/index.js +19 -19
  116. package/dist/projections/internal.js +16 -16
  117. package/dist/projections/types.d.ts +1 -1
  118. package/dist/projections/types.d.ts.map +1 -1
  119. package/dist/queues/in-memory.d.ts +1 -1
  120. package/dist/queues/in-memory.d.ts.map +1 -1
  121. package/dist/runtime/internal.js +19 -19
  122. package/dist/shares/internal.js +14 -14
  123. package/dist/shares/internal.js.map +1 -1
  124. package/dist/storage/action-runs/failure.js +2 -2
  125. package/dist/storage/ai-limits/enforcement.js +2 -2
  126. package/dist/storage/auth/errors.d.ts +1 -1
  127. package/dist/storage/auth/errors.d.ts.map +1 -1
  128. package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
  129. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
  130. package/dist/storage/auth/types.d.ts +15 -7
  131. package/dist/storage/auth/types.d.ts.map +1 -1
  132. package/dist/storage/connector-connections/provider.js +1 -1
  133. package/dist/storage/file-upload-sessions/provider.js +5 -5
  134. package/dist/storage/index.d.ts +2 -2
  135. package/dist/storage/index.d.ts.map +1 -1
  136. package/dist/storage/index.js +29 -29
  137. package/dist/storage/index.js.map +1 -1
  138. package/dist/storage/internal.js +1 -1
  139. package/dist/storage/ontology/in-memory/sources.d.ts +6 -3
  140. package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -1
  141. package/dist/storage/ontology/index.d.ts +1 -1
  142. package/dist/storage/ontology/index.d.ts.map +1 -1
  143. package/dist/storage/ontology/provider.d.ts +16 -3
  144. package/dist/storage/ontology/provider.d.ts.map +1 -1
  145. package/dist/storage/ontology/provider.js +8 -4
  146. package/dist/storage/ontology/provider.js.map +1 -1
  147. package/dist/storage/ontology/sources.d.ts +36 -8
  148. package/dist/storage/ontology/sources.d.ts.map +1 -1
  149. package/dist/storage/projection-runs/in-memory.d.ts +3 -1
  150. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  151. package/dist/storage/projection-runs/index.d.ts +1 -1
  152. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  153. package/dist/storage/projection-runs/lifecycle.d.ts +12 -0
  154. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  155. package/dist/storage/projection-runs/provider.js +10 -4
  156. package/dist/storage/projection-runs/provider.js.map +1 -1
  157. package/dist/storage/projection-runs/types.d.ts +32 -1
  158. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  159. package/dist/storage/workflow-runs/provider.js +5 -5
  160. package/dist/syncs/index.js +20 -20
  161. package/dist/testing/auth-storage-contract.d.ts.map +1 -1
  162. package/dist/testing/index.js +381 -171
  163. package/dist/testing/index.js.map +5 -5
  164. package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
  165. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  166. package/dist/webhooks/internal.js +15 -15
  167. package/dist/webhooks/internal.js.map +1 -1
  168. package/dist/workers/index.js +1 -1
  169. package/dist/workflows/index.js +34 -34
  170. package/package.json +13 -1
  171. package/src/auth/errors.ts +23 -0
  172. package/src/auth/index.ts +1 -1
  173. package/src/auth/runtime.ts +56 -22
  174. package/src/auth/strategy.ts +2 -0
  175. package/src/auth/types.ts +8 -0
  176. package/src/deploy/define.ts +6 -0
  177. package/src/deploy/index.ts +41 -0
  178. package/src/deploy/internal.ts +7 -0
  179. package/src/deploy/services.ts +51 -0
  180. package/src/deploy/types.ts +338 -0
  181. package/src/deploy/validation.ts +261 -0
  182. package/src/errors/catalog.ts +4 -0
  183. package/src/maintenance/ontology-maintenance.ts +32 -2
  184. package/src/maintenance/types.ts +8 -2
  185. package/src/materialization/dataset-watermark.ts +6 -4
  186. package/src/materialization/model.ts +7 -0
  187. package/src/materializer/README.md +26 -6
  188. package/src/materializer/projections/finish-run.ts +129 -26
  189. package/src/materializer/projections/replace.ts +67 -49
  190. package/src/materializer/projections/source-materialization.ts +11 -6
  191. package/src/projections/types.ts +1 -0
  192. package/src/storage/auth/errors.ts +0 -1
  193. package/src/storage/auth/in-memory/auth-storage.ts +44 -65
  194. package/src/storage/auth/types.ts +15 -7
  195. package/src/storage/index.ts +6 -1
  196. package/src/storage/ontology/in-memory/sources.ts +119 -55
  197. package/src/storage/ontology/index.ts +4 -1
  198. package/src/storage/ontology/provider.ts +64 -7
  199. package/src/storage/ontology/sources.ts +42 -8
  200. package/src/storage/projection-runs/in-memory.ts +41 -2
  201. package/src/storage/projection-runs/index.ts +2 -0
  202. package/src/storage/projection-runs/lifecycle.ts +61 -4
  203. package/src/storage/projection-runs/types.ts +41 -1
  204. package/src/testing/auth-storage-contract.ts +104 -130
  205. package/src/testing/ontology-storage-contract.ts +141 -15
  206. package/src/testing/projection-run-storage-contract.ts +174 -1
  207. package/dist/chunk-3qpcrcj8.js.map +0 -10
  208. package/dist/chunk-qma80ych.js.map +0 -11
  209. package/dist/chunk-znw0zvy4.js.map +0 -12
  210. /package/dist/{chunk-693f3zn8.js.map → chunk-1jvq82rp.js.map} +0 -0
  211. /package/dist/{chunk-898y24dd.js.map → chunk-3c90jvfj.js.map} +0 -0
  212. /package/dist/{chunk-vn3yh259.js.map → chunk-4gmng3vf.js.map} +0 -0
  213. /package/dist/{chunk-91wthfwe.js.map → chunk-4jph1t3v.js.map} +0 -0
  214. /package/dist/{chunk-y487ywrv.js.map → chunk-6q7c68yx.js.map} +0 -0
  215. /package/dist/{chunk-ypj2wqtj.js.map → chunk-70jmg2zx.js.map} +0 -0
  216. /package/dist/{chunk-s24qbp32.js.map → chunk-7jc21943.js.map} +0 -0
  217. /package/dist/{chunk-rzcjp5m2.js.map → chunk-8fjmqjyx.js.map} +0 -0
  218. /package/dist/{chunk-m8zkvep1.js.map → chunk-8w27xf9e.js.map} +0 -0
  219. /package/dist/{chunk-z9h698s8.js.map → chunk-a4g5yjm0.js.map} +0 -0
  220. /package/dist/{chunk-gmt22nxx.js.map → chunk-adbve9zt.js.map} +0 -0
  221. /package/dist/{chunk-gbcrz0gr.js.map → chunk-ex8s8wsk.js.map} +0 -0
  222. /package/dist/{chunk-4tnrzqqh.js.map → chunk-fj1dvp37.js.map} +0 -0
  223. /package/dist/{chunk-bdhfn0ww.js.map → chunk-kkqwzy6h.js.map} +0 -0
  224. /package/dist/{chunk-bep5rrdq.js.map → chunk-mmac1mp6.js.map} +0 -0
  225. /package/dist/{chunk-w9bp61e7.js.map → chunk-n5t4mq6z.js.map} +0 -0
  226. /package/dist/{chunk-n33e8dz8.js.map → chunk-p0nbkys4.js.map} +0 -0
  227. /package/dist/{chunk-04h4t2b5.js.map → chunk-py2dw8cw.js.map} +0 -0
  228. /package/dist/{chunk-jhyc777j.js.map → chunk-q3grgzp1.js.map} +0 -0
  229. /package/dist/{chunk-cbn96bve.js.map → chunk-r5sc1d2b.js.map} +0 -0
  230. /package/dist/{chunk-y6vnvayj.js.map → chunk-vjcd8d27.js.map} +0 -0
  231. /package/dist/{chunk-jmwy25mf.js.map → chunk-wd34wnsy.js.map} +0 -0
  232. /package/dist/{chunk-63fp9x3q.js.map → chunk-wem5vqjw.js.map} +0 -0
  233. /package/dist/{chunk-darm7eeg.js.map → chunk-xr7y35yj.js.map} +0 -0
  234. /package/dist/{chunk-a69fkrtr.js.map → chunk-y0zmae99.js.map} +0 -0
  235. /package/dist/{chunk-xgptywp0.js.map → chunk-y2aq6ag9.js.map} +0 -0
  236. /package/dist/{chunk-2hbhn1ff.js.map → chunk-yfppyaty.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ontology-storage-contract.d.ts","sourceRoot":"","sources":["../../src/testing/ontology-storage-contract.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAA;AAGpC,MAAM,WAAW,8BAA+B,SAAQ,uBAAuB;IAC7E,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAA;CAC9C;AAED,MAAM,WAAW,mCAAmC,CAClD,QAAQ,SAAS,8BAA8B,GAAG,8BAA8B;IAEhF,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1D,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,kFAAkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/D;AAkDD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,SAAS,8BAA8B,EAC7F,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,GACrD,IAAI,CA+vBN"}
1
+ {"version":3,"file":"ontology-storage-contract.d.ts","sourceRoot":"","sources":["../../src/testing/ontology-storage-contract.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAA;AAGpC,MAAM,WAAW,8BAA+B,SAAQ,uBAAuB;IAC7E,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAA;CAC9C;AAED,MAAM,WAAW,mCAAmC,CAClD,QAAQ,SAAS,8BAA8B,GAAG,8BAA8B;IAEhF,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1D,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,kFAAkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/D;AAkDD;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,SAAS,8BAA8B,EAC7F,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,GACrD,IAAI,CA63BN"}
@@ -1 +1 @@
1
- {"version":3,"file":"projection-run-storage-contract.d.ts","sourceRoot":"","sources":["../../src/testing/projection-run-storage-contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAGV,oBAAoB,EAGrB,MAAM,4BAA4B,CAAA;AAEnC,MAA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AAoB;IAE5D,wFAAwF;IACxF,QAAQ,CAAC,aAAa,EAAE,MACpB,mCAAmC,CAAC,QAAQ,CAAC,GAC7C,OAAO,CAAC,mCAAmC,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjG,QAAQ,CAAC,OAAO,CAAC,EAAE,CACjB,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,KACnD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B;AAgDD,mFAAmF;AACnF,wBAAgB,oCAAoC,CAAC,QAAQ,SAAS,oBAAoB,EACxF,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,wCAAwC,CAAC,QAAQ,CAAC,GAC1D,IAAI,CAomBN"}
@@ -1,18 +1,18 @@
1
1
  // @bun
2
- import"../chunk-rzkr70gr.js";
2
+ import"../chunk-6fsr7y93.js";
3
3
  import"../chunk-z3y5kg1x.js";
4
- import"../chunk-rzcjp5m2.js";
4
+ import"../chunk-8fjmqjyx.js";
5
5
  import"../chunk-v4jbb3rs.js";
6
6
  import"../chunk-d8yes9yx.js";
7
7
  import {
8
8
  createConnectorCodedError,
9
9
  getConnectorExecutionSourceResolver
10
- } from "../chunk-cbn96bve.js";
11
- import"../chunk-xgptywp0.js";
10
+ } from "../chunk-r5sc1d2b.js";
11
+ import"../chunk-y2aq6ag9.js";
12
12
  import"../chunk-fc5zfxy1.js";
13
- import"../chunk-9pfw47qx.js";
13
+ import"../chunk-qne45xqq.js";
14
14
  import"../chunk-drz59ve0.js";
15
- import"../chunk-0321g649.js";
15
+ import"../chunk-2jntasmh.js";
16
16
  import"../chunk-pqajwytd.js";
17
17
  import"../chunk-ky7zpbtt.js";
18
18
  import"../chunk-gfdh9kqa.js";
@@ -21,36 +21,36 @@ import"../chunk-69266efg.js";
21
21
  import"../chunk-xnx96gfy.js";
22
22
  import"../chunk-jgwb25gc.js";
23
23
  import"../chunk-h89wz928.js";
24
- import"../chunk-n33e8dz8.js";
24
+ import"../chunk-p0nbkys4.js";
25
25
  import {
26
26
  ExecutionStorageError2
27
27
  } from "../chunk-tw03bsmb.js";
28
28
  import"../chunk-3nx8vj5a.js";
29
- import"../chunk-ht4a7mjg.js";
29
+ import"../chunk-g4rbm4a6.js";
30
30
  import {
31
31
  canRetryWebhookRun2
32
- } from "../chunk-gc226ten.js";
32
+ } from "../chunk-fjw417jf.js";
33
33
  import"../chunk-7ytf06d3.js";
34
34
  import"../chunk-mr60an99.js";
35
35
  import"../chunk-mmagke4x.js";
36
- import"../chunk-qma80ych.js";
37
- import"../chunk-znw0zvy4.js";
36
+ import"../chunk-hn2r7z41.js";
37
+ import"../chunk-4wn7bxxa.js";
38
38
  import"../chunk-jmfet9r4.js";
39
39
  import {
40
40
  WebhookRunError2
41
41
  } from "../chunk-qf954wje.js";
42
- import"../chunk-darm7eeg.js";
42
+ import"../chunk-xr7y35yj.js";
43
43
  import {
44
44
  isOAuthConnectorDefinition2,
45
45
  isStaticConnectorDefinition2
46
46
  } from "../chunk-9x8dybsb.js";
47
47
  import {
48
48
  createPrimitiveExecutionRecord
49
- } from "../chunk-m8zkvep1.js";
49
+ } from "../chunk-8w27xf9e.js";
50
+ import"../chunk-br3k6qbf.js";
50
51
  import {
51
52
  isStorageSerializationFailure2
52
53
  } from "../chunk-zdkcdshk.js";
53
- import"../chunk-br3k6qbf.js";
54
54
  import"../chunk-s3csryxe.js";
55
55
  import"../chunk-2fv8sajb.js";
56
56
  // src/webhooks/connections.ts
@@ -195,4 +195,4 @@ export {
195
195
  isStaticConnectorDefinition2 as isStaticConnectorDefinition
196
196
  };
197
197
 
198
- //# debugId=527D07AF48367BAF64756E2164756E21
198
+ //# debugId=1B87474FA26986F164756E2164756E21
@@ -6,6 +6,6 @@
6
6
  "import { randomUUID } from \"node:crypto\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { ExecutionRecord, Storage, WebhookRunRecord } from \"../storage\"\nimport {\n canRetryWebhookRun,\n ExecutionStorageError,\n isStorageSerializationFailure,\n WebhookRunError,\n} from \"../storage\"\n\nconst MAX_ADMISSION_ATTEMPTS = 3\n\nexport interface AdmitWebhookRunInput {\n readonly projectId: string\n readonly storage: Storage\n readonly runId: string\n readonly connectorId: string\n readonly webhookId: string\n readonly method: string\n readonly route: string\n readonly requestBodyBytes: number\n readonly requestBodySha256: string\n readonly idempotencyKey?: string\n}\n\nexport type AdmitWebhookRunResult =\n | {\n readonly status: \"admitted\"\n readonly run: WebhookRunRecord\n readonly execution: ExecutionRecord\n readonly retried: boolean\n }\n | {\n readonly status: \"duplicate\" | \"in_progress\"\n readonly run: WebhookRunRecord\n }\n\n/** Persist or reclaim one verified Webhook delivery before its protected handler executes. */\nexport async function admitWebhookRun(input: AdmitWebhookRunInput): Promise<AdmitWebhookRunResult> {\n assertAdmissionInput(input)\n let attempt = 0\n\n // Concurrent deliveries may both observe no run before one transaction commits. Retry only\n // serialization and uniqueness races so the loser can reload the winning run; every other error\n // fails immediately, and repeated contention remains bounded by MAX_ADMISSION_ATTEMPTS.\n while (true) {\n attempt += 1\n try {\n return await input.storage.transaction((tx) => admitWebhookRunTransaction(tx, input), {\n isolation: \"serializable\",\n })\n } catch (error) {\n if (attempt >= MAX_ADMISSION_ATTEMPTS || !isConcurrentAdmissionConflict(error)) {\n throw error\n }\n }\n }\n}\n\nasync function admitWebhookRunTransaction(\n storage: Storage,\n input: AdmitWebhookRunInput\n): Promise<AdmitWebhookRunResult> {\n const runs = requireWebhookRunStorage(storage)\n const existing = input.idempotencyKey\n ? await runs.getByDelivery({\n projectId: input.projectId,\n connectorId: input.connectorId,\n webhookId: input.webhookId,\n idempotencyKey: input.idempotencyKey,\n })\n : null\n\n if (existing) {\n assertSameDelivery(existing, input)\n if (existing.status === \"running\") return { status: \"in_progress\", run: existing }\n if (!canRetryWebhookRun(existing)) return { status: \"duplicate\", run: existing }\n\n const execution = await requireWebhookExecution(storage, existing)\n const run = await runs.restart({\n projectId: input.projectId,\n id: existing.id,\n })\n return { status: \"admitted\", run, execution, retried: true }\n }\n\n const executionInput = createPrimitiveExecutionRecord({\n id: `exec_${randomUUID()}`,\n primitive: { kind: \"webhook\", id: input.route, runId: input.runId },\n origin: {\n type: \"automatic\",\n projectId: input.projectId,\n source: { type: \"webhook\", deliveryId: input.runId },\n correlationId: input.runId,\n },\n })\n const execution = await storage.executions.create(executionInput)\n const run = await runs.start({\n id: input.runId,\n projectId: input.projectId,\n executionId: execution.id,\n connectorId: input.connectorId,\n webhookId: input.webhookId,\n method: input.method,\n route: input.route,\n requestBodyBytes: input.requestBodyBytes,\n requestBodySha256: input.requestBodySha256,\n idempotencyKey: input.idempotencyKey,\n })\n return { status: \"admitted\", run, execution, retried: false }\n}\n\nfunction assertSameDelivery(existing: WebhookRunRecord, input: AdmitWebhookRunInput): void {\n if (\n existing.connectorId !== input.connectorId ||\n existing.webhookId !== input.webhookId ||\n existing.method !== input.method ||\n existing.route !== input.route ||\n existing.requestBodyBytes !== input.requestBodyBytes ||\n existing.requestBodySha256 !== input.requestBodySha256\n ) {\n throw new WebhookRunError(\n `[Sixb] Webhook delivery '${input.idempotencyKey}' conflicts with run '${existing.id}'.`,\n \"delivery_conflict\"\n )\n }\n}\n\nasync function requireWebhookExecution(\n storage: Storage,\n run: WebhookRunRecord\n): Promise<ExecutionRecord> {\n const execution = await storage.executions.getById({\n projectId: run.projectId,\n id: run.executionId,\n })\n if (!execution) {\n throw new WebhookRunError(\n `[Sixb] Execution '${run.executionId}' for Webhook run '${run.id}' was not found.`,\n \"invalid_execution\"\n )\n }\n return execution\n}\n\nfunction requireWebhookRunStorage(storage: Storage): NonNullable<Storage[\"webhookRuns\"]> {\n if (!storage.webhookRuns) {\n throw new WebhookRunError(\"[Sixb] Webhook run storage is not configured.\")\n }\n return storage.webhookRuns\n}\n\nfunction assertAdmissionInput(input: AdmitWebhookRunInput): void {\n if (input.idempotencyKey !== undefined && !input.idempotencyKey.trim()) {\n throw new WebhookRunError(\"[Sixb] Webhook idempotency key must not be empty.\")\n }\n if (!Number.isSafeInteger(input.requestBodyBytes) || input.requestBodyBytes < 0) {\n throw new WebhookRunError(\"[Sixb] Webhook request body bytes must be a non-negative integer.\")\n }\n if (!/^[a-f0-9]{64}$/.test(input.requestBodySha256)) {\n throw new WebhookRunError(\"[Sixb] Webhook request body SHA-256 must be lowercase hexadecimal.\")\n }\n}\n\nfunction isConcurrentAdmissionConflict(error: unknown): boolean {\n return (\n isStorageSerializationFailure(error) ||\n (error instanceof ExecutionStorageError && error.code === \"duplicate_execution\") ||\n (error instanceof WebhookRunError &&\n (error.code === \"duplicate_run\" || error.code === \"invalid_transition\"))\n )\n}\n"
7
7
  ],
8
8
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,SAAS,wBAAwB,CACtC,SACA,YACoB;AAAA,EACpB,OAAO;AAAA,SACC,WAAU,CAAC,WAAW;AAAA,MAC1B,IAAI,CAAC,4BAA2B,UAAU,GAAG;AAAA,QAC3C,MAAM,0BACJ,mCACA,sEACF;AAAA,MACF;AAAA,MACA,IAAI,OAAO,cAAc,YAAY,CAAC,UAAU,KAAK,GAAG;AAAA,QACtD,MAAM,0BACJ,mCACA,gDACF;AAAA,MACF;AAAA,MACA,MAAM,WAAW,oCAAoC,OAAO;AAAA,MAC5D,MAAM,UAAU,MAAM,SAAS,KAAK,UAAU;AAAA,MAC9C,OAAO,QAAQ,QAAQ,CAAC,WAAW;AAAA,QACjC,MAAM,aAAa,OAAO;AAAA,QAC1B,IAAI,CAAC,cAAc,WAAW,QAAQ,OAAO;AAAA,UAAW,OAAO,CAAC;AAAA,QAChE,MAAM,eAAe,WAAW;AAAA,QAChC,IAAI;AAAA,QACJ,OAAO;AAAA,UACL;AAAA,YACE;AAAA,YACA,MAAM,GAAG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3
  captureSixbFailure2
4
- } from "../chunk-rzkr70gr.js";
4
+ } from "../chunk-6fsr7y93.js";
5
5
  import"../chunk-z3y5kg1x.js";
6
6
 
7
7
  // src/workers/errors.ts
@@ -8,7 +8,7 @@ import {
8
8
  defineWorkflow2,
9
9
  createWorkflowNodeFailure2,
10
10
  unwrapWorkflowNodeFailure2
11
- } from "../chunk-s24qbp32.js";
11
+ } from "../chunk-7jc21943.js";
12
12
  import"../chunk-e1c18xjx.js";
13
13
  import"../chunk-fb3feg1e.js";
14
14
  import"../chunk-dfm066qg.js";
@@ -45,67 +45,67 @@ import {
45
45
  snapshotWorkflowActionInput2,
46
46
  WorkflowRunDispatcher2,
47
47
  requestWorkflowRun2
48
- } from "../chunk-cvrbhvtr.js";
49
- import"../chunk-a69fkrtr.js";
50
- import"../chunk-cbn96bve.js";
51
- import"../chunk-bep5rrdq.js";
52
- import"../chunk-gmt22nxx.js";
53
- import"../chunk-91wthfwe.js";
54
- import"../chunk-85cd7e8c.js";
55
- import"../chunk-w9bp61e7.js";
48
+ } from "../chunk-2tz5vnvz.js";
49
+ import"../chunk-y0zmae99.js";
50
+ import"../chunk-r5sc1d2b.js";
51
+ import"../chunk-adbve9zt.js";
52
+ import"../chunk-mmac1mp6.js";
56
53
  import"../chunk-bxx3ms5t.js";
57
- import"../chunk-04h4t2b5.js";
54
+ import"../chunk-py2dw8cw.js";
58
55
  import"../chunk-f85hpqnm.js";
59
- import"../chunk-4tnrzqqh.js";
56
+ import"../chunk-fj1dvp37.js";
57
+ import"../chunk-4jph1t3v.js";
58
+ import"../chunk-85cd7e8c.js";
59
+ import"../chunk-n5t4mq6z.js";
60
60
  import"../chunk-5a4a52tq.js";
61
61
  import"../chunk-91kcnbf0.js";
62
62
  import"../chunk-rb143ggb.js";
63
63
  import"../chunk-cd234ba4.js";
64
- import"../chunk-693f3zn8.js";
65
- import"../chunk-63fp9x3q.js";
66
- import"../chunk-898y24dd.js";
67
- import"../chunk-rqtdtm43.js";
68
- import"../chunk-m8zkvep1.js";
69
- import"../chunk-gc226ten.js";
64
+ import"../chunk-1jvq82rp.js";
65
+ import"../chunk-wem5vqjw.js";
66
+ import"../chunk-z708gemf.js";
67
+ import"../chunk-3c90jvfj.js";
68
+ import"../chunk-8w27xf9e.js";
69
+ import"../chunk-fjw417jf.js";
70
+ import"../chunk-br3k6qbf.js";
70
71
  import"../chunk-jmfet9r4.js";
71
72
  import"../chunk-qf954wje.js";
72
- import"../chunk-darm7eeg.js";
73
+ import"../chunk-xr7y35yj.js";
74
+ import"../chunk-tw03bsmb.js";
75
+ import"../chunk-p0nbkys4.js";
73
76
  import"../chunk-zdkcdshk.js";
74
- import"../chunk-ht4a7mjg.js";
77
+ import"../chunk-h89wz928.js";
78
+ import"../chunk-g4rbm4a6.js";
75
79
  import"../chunk-mr60an99.js";
76
80
  import"../chunk-mmagke4x.js";
77
- import"../chunk-znw0zvy4.js";
78
- import"../chunk-qma80ych.js";
79
- import"../chunk-br3k6qbf.js";
81
+ import"../chunk-4wn7bxxa.js";
82
+ import"../chunk-hn2r7z41.js";
83
+ import"../chunk-y2aq6ag9.js";
80
84
  import"../chunk-fc5zfxy1.js";
81
85
  import"../chunk-69266efg.js";
82
86
  import"../chunk-xnx96gfy.js";
83
87
  import"../chunk-s3csryxe.js";
84
88
  import"../chunk-jgwb25gc.js";
85
- import"../chunk-tw03bsmb.js";
86
- import"../chunk-n33e8dz8.js";
87
- import"../chunk-h89wz928.js";
88
- import"../chunk-xgptywp0.js";
89
89
  import"../chunk-ky7zpbtt.js";
90
90
  import"../chunk-pqajwytd.js";
91
91
  import"../chunk-3nx8vj5a.js";
92
92
  import"../chunk-7ytf06d3.js";
93
- import"../chunk-y6vnvayj.js";
94
- import"../chunk-bdhfn0ww.js";
93
+ import"../chunk-wr8qp979.js";
94
+ import"../chunk-vjcd8d27.js";
95
+ import"../chunk-kkqwzy6h.js";
95
96
  import"../chunk-39tqv9hz.js";
96
97
  import"../chunk-gfdh9kqa.js";
97
- import"../chunk-wr8qp979.js";
98
98
  import"../chunk-dmn70ztd.js";
99
- import"../chunk-vn3yh259.js";
100
- import"../chunk-9pfw47qx.js";
99
+ import"../chunk-4gmng3vf.js";
100
+ import"../chunk-qne45xqq.js";
101
101
  import"../chunk-2fv8sajb.js";
102
102
  import"../chunk-drz59ve0.js";
103
- import"../chunk-rzcjp5m2.js";
103
+ import"../chunk-8fjmqjyx.js";
104
104
  import"../chunk-v4jbb3rs.js";
105
105
  import"../chunk-d8yes9yx.js";
106
- import"../chunk-rzkr70gr.js";
106
+ import"../chunk-6fsr7y93.js";
107
107
  import"../chunk-z3y5kg1x.js";
108
- import"../chunk-0321g649.js";
108
+ import"../chunk-2jntasmh.js";
109
109
  export {
110
110
  WorkflowDefinitionError2 as WorkflowDefinitionError,
111
111
  WorkflowRunDispatcher2 as WorkflowRunDispatcher,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/core",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "The ontology-first runtime for Sixb — objects, links, telemetry, actions, and provider contracts",
5
5
  "keywords": [
6
6
  "sixb",
@@ -65,6 +65,12 @@
65
65
  "import": "./dist/broker/index.js",
66
66
  "default": "./dist/broker/index.js"
67
67
  },
68
+ "./deploy": {
69
+ "types": "./dist/deploy/index.d.ts",
70
+ "bun": "./src/deploy/index.ts",
71
+ "import": "./dist/deploy/index.js",
72
+ "default": "./dist/deploy/index.js"
73
+ },
68
74
  "./events/selectors": {
69
75
  "types": "./dist/events/selectors/index.d.ts",
70
76
  "bun": "./src/events/selectors/index.ts",
@@ -185,6 +191,12 @@
185
191
  "import": "./dist/datasets/write.js",
186
192
  "default": "./dist/datasets/write.js"
187
193
  },
194
+ "./internal/deploy": {
195
+ "types": "./dist/deploy/internal.d.ts",
196
+ "bun": "./src/deploy/internal.ts",
197
+ "import": "./dist/deploy/internal.js",
198
+ "default": "./dist/deploy/internal.js"
199
+ },
188
200
  "./internal/edits": {
189
201
  "types": "./dist/edits/index.d.ts",
190
202
  "bun": "./src/edits/index.ts",
@@ -17,3 +17,26 @@ export class AuthRuntimeError extends Error {
17
17
  super(message)
18
18
  }
19
19
  }
20
+
21
+ /** Why a strategy refused someone who authenticated. Each is something a person can act on. */
22
+ export type SignInRefusalReason =
23
+ | "not_invited"
24
+ | "suspended"
25
+ | "domain_not_allowed"
26
+ | "no_trusted_address"
27
+
28
+ /**
29
+ * Thrown by a strategy that refuses a sign-in for a known reason. The sign-in page tells the
30
+ * person which reason, naming `email` when there is one; `message` is for the server log.
31
+ */
32
+ export class SignInRefusedError extends Error {
33
+ readonly name = "SignInRefusedError"
34
+
35
+ constructor(
36
+ readonly reason: SignInRefusalReason,
37
+ message: string,
38
+ readonly email?: string
39
+ ) {
40
+ super(message)
41
+ }
42
+ }
package/src/auth/index.ts CHANGED
@@ -37,7 +37,7 @@ export {
37
37
  verifyDoubleSubmitCsrf,
38
38
  } from "./csrf"
39
39
  export type { AuthRuntimeErrorCode } from "./errors"
40
- export { AuthRuntimeError } from "./errors"
40
+ export { AuthRuntimeError, SignInRefusedError } from "./errors"
41
41
  export type { AuthRuntimeOptions } from "./runtime"
42
42
  export {
43
43
  AuthRuntime,
@@ -19,6 +19,7 @@ import {
19
19
  type AuthStorage,
20
20
  AuthStorageError,
21
21
  type CompleteDeviceAuthorizationInput,
22
+ type GroupMembershipRecord,
22
23
  type InvitationRecord,
23
24
  type ServiceAccountGroupMembershipRecord,
24
25
  type ServiceAccountRecord,
@@ -991,9 +992,9 @@ export class AuthRuntime {
991
992
 
992
993
  const members: MemberSummary[] = []
993
994
  for (const user of result.users) {
994
- const groupIds = (
995
+ const { groupIds, managedGroupIds } = memberGroups(
995
996
  await storage.groupMemberships.listForUser({ projectId: this.projectId, userId: user.id })
996
- ).map((membership) => membership.groupId)
997
+ )
997
998
 
998
999
  // Visibility is scope-based: a member is listed when the caller can assign
999
1000
  // groups or suspend over the member's current groups. This keeps out-of-scope
@@ -1008,6 +1009,7 @@ export class AuthRuntime {
1008
1009
  members.push({
1009
1010
  user,
1010
1011
  groupIds,
1012
+ managedGroupIds,
1011
1013
  capabilities: {
1012
1014
  assignGroups: canAssignGroups,
1013
1015
  // A caller cannot suspend themselves; reactivation only applies to a
@@ -1033,12 +1035,11 @@ export class AuthRuntime {
1033
1035
  // The target must exist and every group it currently holds must be assignable
1034
1036
  // by the caller. Missing and out-of-scope targets raise the same error so a
1035
1037
  // caller cannot probe which users exist.
1036
- const { user, groupIds: currentGroupIds } = await this.requireManageableMember(
1037
- storage,
1038
- scope,
1039
- "assignGroups",
1040
- userId
1041
- )
1038
+ const {
1039
+ user,
1040
+ groupIds: currentGroupIds,
1041
+ managedGroupIds: currentManagedGroupIds,
1042
+ } = await this.requireManageableMember(storage, scope, "assignGroups", userId)
1042
1043
 
1043
1044
  const requestedGroupIds = this.resolveMemberGroupIds(input.groupIds)
1044
1045
  // Every requested group must fall within the caller's assign scope.
@@ -1055,6 +1056,15 @@ export class AuthRuntime {
1055
1056
  const additions = requestedGroupIds.filter((groupId) => !current.has(groupId))
1056
1057
  const removals = currentGroupIds.filter((groupId) => !requested.has(groupId))
1057
1058
 
1059
+ // The identity provider would restore these at the user's next sign-in.
1060
+ const managedRemovals = removals.filter((groupId) => currentManagedGroupIds.includes(groupId))
1061
+ if (managedRemovals.length > 0) {
1062
+ throw new AuthRuntimeError(
1063
+ "invalid_auth_input",
1064
+ `[Sixb] Group(s) ${managedRemovals.join(", ")} are managed by the identity provider. Change them there; they sync at the user's next sign-in.`
1065
+ )
1066
+ }
1067
+
1058
1068
  // Self-protection: a caller may add in-scope groups to themselves but may not
1059
1069
  // remove any of their own current groups, so they cannot lock themselves out.
1060
1070
  if (user.id === caller.user.id && removals.length > 0) {
@@ -1086,11 +1096,11 @@ export class AuthRuntime {
1086
1096
  // request resolves the updated membership.
1087
1097
  this.sessionCache?.invalidateUser(user.id)
1088
1098
 
1089
- const groupIds = (
1099
+ const { groupIds, managedGroupIds } = memberGroups(
1090
1100
  await storage.groupMemberships.listForUser({ projectId: this.projectId, userId: user.id })
1091
- ).map((membership) => membership.groupId)
1101
+ )
1092
1102
 
1093
- return { user, groupIds }
1103
+ return { user, groupIds, managedGroupIds }
1094
1104
  }
1095
1105
 
1096
1106
  async suspendMember(
@@ -1100,7 +1110,12 @@ export class AuthRuntime {
1100
1110
  const storage = this.requireAuthStorage()
1101
1111
  const scope = this.resolveMembershipPolicyScopeForUser(caller.groupIds)
1102
1112
  const userId = assertNonEmpty(input.userId, "User id")
1103
- const { user, groupIds } = await this.requireManageableMember(storage, scope, "suspend", userId)
1113
+ const { user, groupIds, managedGroupIds } = await this.requireManageableMember(
1114
+ storage,
1115
+ scope,
1116
+ "suspend",
1117
+ userId
1118
+ )
1104
1119
 
1105
1120
  if (user.id === caller.user.id) {
1106
1121
  throw new AuthRuntimeError(
@@ -1118,7 +1133,7 @@ export class AuthRuntime {
1118
1133
  // user stops authenticating immediately.
1119
1134
  this.sessionCache?.invalidateUser(user.id)
1120
1135
 
1121
- return { user: suspended, groupIds }
1136
+ return { user: suspended, groupIds, managedGroupIds }
1122
1137
  }
1123
1138
 
1124
1139
  async reactivateMember(
@@ -1128,7 +1143,12 @@ export class AuthRuntime {
1128
1143
  const storage = this.requireAuthStorage()
1129
1144
  const scope = this.resolveMembershipPolicyScopeForUser(caller.groupIds)
1130
1145
  const userId = assertNonEmpty(input.userId, "User id")
1131
- const { user, groupIds } = await this.requireManageableMember(storage, scope, "suspend", userId)
1146
+ const { user, groupIds, managedGroupIds } = await this.requireManageableMember(
1147
+ storage,
1148
+ scope,
1149
+ "suspend",
1150
+ userId
1151
+ )
1132
1152
 
1133
1153
  // Reactivation restores access but not sessions; the user signs in again.
1134
1154
  const reactivated = await storage.users.updateStatus({
@@ -1138,7 +1158,7 @@ export class AuthRuntime {
1138
1158
  updatedAt: new Date(),
1139
1159
  })
1140
1160
 
1141
- return { user: reactivated, groupIds }
1161
+ return { user: reactivated, groupIds, managedGroupIds }
1142
1162
  }
1143
1163
 
1144
1164
  /** The caller's active sessions across every audience, most recently active first. */
@@ -1210,13 +1230,15 @@ export class AuthRuntime {
1210
1230
  scope: MembershipPolicyScope,
1211
1231
  operation: MembershipOperation,
1212
1232
  userId: string
1213
- ): Promise<{ readonly user: UserRecord; readonly groupIds: readonly string[] }> {
1233
+ ): Promise<{
1234
+ readonly user: UserRecord
1235
+ readonly groupIds: readonly string[]
1236
+ readonly managedGroupIds: readonly string[]
1237
+ }> {
1214
1238
  const user = await storage.users.getById({ projectId: this.projectId, id: userId })
1215
- const groupIds = user
1216
- ? (await storage.groupMemberships.listForUser({ projectId: this.projectId, userId })).map(
1217
- (membership) => membership.groupId
1218
- )
1219
- : []
1239
+ const { groupIds, managedGroupIds } = memberGroups(
1240
+ user ? await storage.groupMemberships.listForUser({ projectId: this.projectId, userId }) : []
1241
+ )
1220
1242
 
1221
1243
  if (!user || !canPerformMembershipOperation(scope, operation, groupIds)) {
1222
1244
  throw new AuthStorageError(
@@ -1225,7 +1247,7 @@ export class AuthRuntime {
1225
1247
  )
1226
1248
  }
1227
1249
 
1228
- return { user, groupIds }
1250
+ return { user, groupIds, managedGroupIds }
1229
1251
  }
1230
1252
 
1231
1253
  private resolveMemberGroupIds(input: readonly string[]): readonly string[] {
@@ -1525,6 +1547,18 @@ export class AuthRuntime {
1525
1547
  }
1526
1548
  }
1527
1549
 
1550
+ function memberGroups(memberships: readonly GroupMembershipRecord[]): {
1551
+ readonly groupIds: readonly string[]
1552
+ readonly managedGroupIds: readonly string[]
1553
+ } {
1554
+ return {
1555
+ groupIds: memberships.map((membership) => membership.groupId),
1556
+ managedGroupIds: memberships
1557
+ .filter((membership) => membership.source === "directory")
1558
+ .map((membership) => membership.groupId),
1559
+ }
1560
+ }
1561
+
1528
1562
  /** The interactive session a caller authenticated with, when it used one. */
1529
1563
  function callerSessionId(caller: AuthenticatedRequestAuthSession): string | undefined {
1530
1564
  return caller.credentialSource === "session" ? caller.session.id : undefined
@@ -7,6 +7,8 @@
7
7
  * entry plus the storage contracts from `@sixb/core/storage`.
8
8
  */
9
9
 
10
+ export type { SignInRefusalReason } from "./errors"
11
+ export { SignInRefusedError } from "./errors"
10
12
  export type {
11
13
  AuthEmailDeliveryStatus,
12
14
  AuthInvitationRecipientInput,
package/src/auth/types.ts CHANGED
@@ -322,6 +322,11 @@ export interface MemberCapabilities {
322
322
  export interface MemberSummary {
323
323
  readonly user: UserRecord
324
324
  readonly groupIds: readonly string[]
325
+ /**
326
+ * The groups among `groupIds` that the identity provider manages. They sync at the user's next
327
+ * sign-in, so they cannot be removed here.
328
+ */
329
+ readonly managedGroupIds: readonly string[]
325
330
  readonly capabilities: MemberCapabilities
326
331
  }
327
332
 
@@ -340,6 +345,7 @@ export interface UpdateMemberGroupsInput {
340
345
  export interface UpdateMemberGroupsResult {
341
346
  readonly user: UserRecord
342
347
  readonly groupIds: readonly string[]
348
+ readonly managedGroupIds: readonly string[]
343
349
  }
344
350
 
345
351
  export interface SuspendMemberInput {
@@ -349,6 +355,7 @@ export interface SuspendMemberInput {
349
355
  export interface SuspendMemberResult {
350
356
  readonly user: UserRecord
351
357
  readonly groupIds: readonly string[]
358
+ readonly managedGroupIds: readonly string[]
352
359
  }
353
360
 
354
361
  export interface ReactivateMemberInput {
@@ -358,6 +365,7 @@ export interface ReactivateMemberInput {
358
365
  export interface ReactivateMemberResult {
359
366
  readonly user: UserRecord
360
367
  readonly groupIds: readonly string[]
368
+ readonly managedGroupIds: readonly string[]
361
369
  }
362
370
 
363
371
  /** `"session"` reads only the cookie; `"any"` reads a bearer access token, else the cookie. */
@@ -0,0 +1,6 @@
1
+ import type { DeployConfig } from "./types"
2
+
3
+ /** Declares a deployment in `sixb.deploy.ts`. `sixb deploy` validates it when it loads the file. */
4
+ export function defineDeploy<const TConfig extends DeployConfig>(config: TConfig): TConfig {
5
+ return config
6
+ }
@@ -0,0 +1,41 @@
1
+ export { defineDeploy } from "./define"
2
+ export type {
3
+ DeployAccess,
4
+ DeployAccessKey,
5
+ DeployCheck,
6
+ DeployCheckContext,
7
+ DeployCi,
8
+ DeployCiCredential,
9
+ DeployCommand,
10
+ DeployConfig,
11
+ DeployConfigurableWorkerType,
12
+ DeployContext,
13
+ DeployControlAction,
14
+ DeployEnv,
15
+ DeployEvent,
16
+ DeployHttpServiceConfig,
17
+ DeployHttpServiceName,
18
+ DeployListenAddress,
19
+ DeployLogsOptions,
20
+ DeployOperationContext,
21
+ DeployProcessDefinition,
22
+ DeployProcessOptions,
23
+ DeployProcessStatus,
24
+ DeployRecord,
25
+ DeployRelease,
26
+ DeployReleaseHttp,
27
+ DeployReleaseProcess,
28
+ DeployReleaseService,
29
+ DeployScalableProcessOptions,
30
+ DeployServiceName,
31
+ DeployServicesConfig,
32
+ DeploySetupContext,
33
+ DeploySingletonServiceConfig,
34
+ DeploySingletonServiceName,
35
+ DeploySource,
36
+ DeploySourceArchive,
37
+ DeployStatus,
38
+ DeployTarget,
39
+ DeployWorkersConfig,
40
+ DeployWorkerType,
41
+ } from "./types"
@@ -0,0 +1,7 @@
1
+ export {
2
+ DEPLOY_SERVICES,
3
+ DEPLOY_WORKER_TYPES,
4
+ isDeployHttpService,
5
+ isDeploySingletonService,
6
+ } from "./services"
7
+ export { validateDeployConfig } from "./validation"
@@ -0,0 +1,51 @@
1
+ import type {
2
+ DeployConfigurableWorkerType,
3
+ DeployHttpServiceName,
4
+ DeployServiceName,
5
+ DeploySingletonServiceName,
6
+ DeployWorkerType,
7
+ } from "./types"
8
+
9
+ // Records rather than arrays so that each list is total over its union: a service or worker type
10
+ // added to the types does not compile until it is listed here, and validation accepts it.
11
+
12
+ const SERVICES = {
13
+ api: "http",
14
+ atlas: "http",
15
+ app: "http",
16
+ orchestrator: "singleton",
17
+ scheduler: "singleton",
18
+ rules: "singleton",
19
+ workers: "workers",
20
+ } as const satisfies Record<DeployServiceName, "http" | "singleton" | "workers">
21
+
22
+ /** Whether each worker type's concurrency can be configured. */
23
+ const WORKER_TYPES: {
24
+ readonly [Type in DeployWorkerType]: Type extends DeployConfigurableWorkerType ? true : false
25
+ } = {
26
+ sync: true,
27
+ action: false,
28
+ agent: true,
29
+ pipeline: true,
30
+ projection: true,
31
+ workflow: true,
32
+ }
33
+
34
+ /** Every service, in the order a deployment lists them. */
35
+ export const DEPLOY_SERVICES = Object.keys(SERVICES) as DeployServiceName[]
36
+
37
+ export const DEPLOY_WORKER_TYPES = Object.keys(WORKER_TYPES) as DeployWorkerType[]
38
+
39
+ export const DEPLOY_CONFIGURABLE_WORKER_TYPES = DEPLOY_WORKER_TYPES.filter(
40
+ (workerType): workerType is DeployConfigurableWorkerType => WORKER_TYPES[workerType]
41
+ )
42
+
43
+ export function isDeployHttpService(service: DeployServiceName): service is DeployHttpServiceName {
44
+ return SERVICES[service] === "http"
45
+ }
46
+
47
+ export function isDeploySingletonService(
48
+ service: DeployServiceName
49
+ ): service is DeploySingletonServiceName {
50
+ return SERVICES[service] === "singleton"
51
+ }