@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.
- package/dist/actions/index.js +22 -22
- package/dist/agents/index.js +34 -34
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/streams/index.js +2 -2
- package/dist/agents/streams/internal.js +2 -2
- package/dist/auth/errors.d.ts +12 -0
- package/dist/auth/errors.d.ts.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +7 -5
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/strategy.d.ts +2 -0
- package/dist/auth/strategy.d.ts.map +1 -1
- package/dist/auth/strategy.js +4 -2
- package/dist/auth/strategy.js.map +1 -1
- package/dist/auth/types.d.ts +8 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/authorization/index.js +2 -2
- package/dist/bootstrap/index.js +37 -37
- package/dist/{chunk-693f3zn8.js → chunk-1jvq82rp.js} +3 -3
- package/dist/{chunk-0321g649.js → chunk-2jntasmh.js} +13 -2
- package/dist/{chunk-0321g649.js.map → chunk-2jntasmh.js.map} +3 -3
- package/dist/{chunk-cvrbhvtr.js → chunk-2tz5vnvz.js} +28 -28
- package/dist/{chunk-cvrbhvtr.js.map → chunk-2tz5vnvz.js.map} +1 -1
- package/dist/{chunk-898y24dd.js → chunk-3c90jvfj.js} +2 -2
- package/dist/{chunk-vn3yh259.js → chunk-4gmng3vf.js} +1 -1
- package/dist/{chunk-91wthfwe.js → chunk-4jph1t3v.js} +7 -7
- package/dist/{chunk-znw0zvy4.js → chunk-4wn7bxxa.js} +25 -7
- package/dist/chunk-4wn7bxxa.js.map +12 -0
- package/dist/{chunk-3qpcrcj8.js → chunk-6aawea28.js} +2 -4
- package/dist/chunk-6aawea28.js.map +10 -0
- package/dist/{chunk-rzkr70gr.js → chunk-6fsr7y93.js} +5 -1
- package/dist/{chunk-rzkr70gr.js.map → chunk-6fsr7y93.js.map} +3 -3
- package/dist/{chunk-y487ywrv.js → chunk-6q7c68yx.js} +4 -4
- package/dist/{chunk-ypj2wqtj.js → chunk-70jmg2zx.js} +2 -2
- package/dist/{chunk-s24qbp32.js → chunk-7jc21943.js} +3 -3
- package/dist/{chunk-rzcjp5m2.js → chunk-8fjmqjyx.js} +1 -1
- package/dist/{chunk-m8zkvep1.js → chunk-8w27xf9e.js} +1 -1
- package/dist/{chunk-z9h698s8.js → chunk-a4g5yjm0.js} +1 -1
- package/dist/{chunk-gmt22nxx.js → chunk-adbve9zt.js} +1 -1
- package/dist/{chunk-mf6hwpzh.js → chunk-dqkd3kdj.js} +41 -23
- package/dist/{chunk-mf6hwpzh.js.map → chunk-dqkd3kdj.js.map} +3 -3
- package/dist/{chunk-gbcrz0gr.js → chunk-ex8s8wsk.js} +6 -6
- package/dist/{chunk-4tnrzqqh.js → chunk-fj1dvp37.js} +1 -1
- package/dist/{chunk-gc226ten.js → chunk-fjw417jf.js} +127 -69
- package/dist/{chunk-gc226ten.js.map → chunk-fjw417jf.js.map} +4 -4
- package/dist/{chunk-ht4a7mjg.js → chunk-g4rbm4a6.js} +42 -8
- package/dist/{chunk-ht4a7mjg.js.map → chunk-g4rbm4a6.js.map} +3 -3
- package/dist/{chunk-qma80ych.js → chunk-hn2r7z41.js} +3 -2
- package/dist/chunk-hn2r7z41.js.map +11 -0
- package/dist/{chunk-bdhfn0ww.js → chunk-kkqwzy6h.js} +1 -1
- package/dist/{chunk-bep5rrdq.js → chunk-mmac1mp6.js} +2 -2
- package/dist/{chunk-w9bp61e7.js → chunk-n5t4mq6z.js} +5 -5
- package/dist/{chunk-n33e8dz8.js → chunk-p0nbkys4.js} +1 -1
- package/dist/{chunk-04h4t2b5.js → chunk-py2dw8cw.js} +3 -3
- package/dist/{chunk-jhyc777j.js → chunk-q3grgzp1.js} +2 -2
- package/dist/{chunk-9pfw47qx.js → chunk-qne45xqq.js} +53 -48
- package/dist/{chunk-9pfw47qx.js.map → chunk-qne45xqq.js.map} +7 -7
- package/dist/{chunk-cbn96bve.js → chunk-r5sc1d2b.js} +2 -2
- package/dist/{chunk-y6vnvayj.js → chunk-vjcd8d27.js} +1 -1
- package/dist/{chunk-jmwy25mf.js → chunk-wd34wnsy.js} +6 -6
- package/dist/{chunk-63fp9x3q.js → chunk-wem5vqjw.js} +7 -7
- package/dist/{chunk-darm7eeg.js → chunk-xr7y35yj.js} +3 -3
- package/dist/{chunk-a69fkrtr.js → chunk-y0zmae99.js} +5 -5
- package/dist/{chunk-xgptywp0.js → chunk-y2aq6ag9.js} +1 -1
- package/dist/{chunk-2hbhn1ff.js → chunk-yfppyaty.js} +1 -1
- package/dist/{chunk-rqtdtm43.js → chunk-z708gemf.js} +129 -70
- package/dist/{chunk-rqtdtm43.js.map → chunk-z708gemf.js.map} +5 -5
- package/dist/deploy/define.d.ts +4 -0
- package/dist/deploy/define.d.ts.map +1 -0
- package/dist/deploy/index.d.ts +3 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +10 -0
- package/dist/deploy/index.js.map +10 -0
- package/dist/deploy/internal.d.ts +3 -0
- package/dist/deploy/internal.d.ts.map +1 -0
- package/dist/deploy/internal.js +244 -0
- package/dist/deploy/internal.js.map +11 -0
- package/dist/deploy/services.d.ts +8 -0
- package/dist/deploy/services.d.ts.map +1 -0
- package/dist/deploy/types.d.ts +309 -0
- package/dist/deploy/types.d.ts.map +1 -0
- package/dist/deploy/validation.d.ts +7 -0
- package/dist/deploy/validation.d.ts.map +1 -0
- package/dist/error-reporting/internal.js +3 -3
- package/dist/errors/catalog.d.ts +4 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +1 -1
- package/dist/events/index.js +3 -3
- package/dist/execution/agent.js +33 -33
- package/dist/execution/primitive.js +29 -29
- package/dist/execution/request.js +31 -31
- package/dist/execution/request.js.map +1 -1
- package/dist/index.js +49 -49
- package/dist/index.js.map +1 -1
- package/dist/maintenance/ontology-maintenance.d.ts +2 -0
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/maintenance/types.d.ts +8 -2
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/materialization/dataset-watermark.d.ts +6 -1
- package/dist/materialization/dataset-watermark.d.ts.map +1 -1
- package/dist/materialization/index.js +1 -1
- package/dist/materialization/model.d.ts +6 -0
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +18 -18
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/projections/finish-run.d.ts.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/source-materialization.d.ts +6 -2
- package/dist/materializer/projections/source-materialization.d.ts.map +1 -1
- package/dist/models/execution/index.js +14 -14
- package/dist/objects/index.js +21 -21
- package/dist/objects/query/index.js +15 -15
- package/dist/pipelines/index.js +19 -19
- package/dist/projections/internal.js +16 -16
- package/dist/projections/types.d.ts +1 -1
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +1 -1
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/runtime/internal.js +19 -19
- package/dist/shares/internal.js +14 -14
- package/dist/shares/internal.js.map +1 -1
- package/dist/storage/action-runs/failure.js +2 -2
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/auth/errors.d.ts +1 -1
- package/dist/storage/auth/errors.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +15 -7
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +1 -1
- package/dist/storage/file-upload-sessions/provider.js +5 -5
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +29 -29
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.js +1 -1
- package/dist/storage/ontology/in-memory/sources.d.ts +6 -3
- package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -1
- package/dist/storage/ontology/index.d.ts +1 -1
- package/dist/storage/ontology/index.d.ts.map +1 -1
- package/dist/storage/ontology/provider.d.ts +16 -3
- package/dist/storage/ontology/provider.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +8 -4
- package/dist/storage/ontology/provider.js.map +1 -1
- package/dist/storage/ontology/sources.d.ts +36 -8
- package/dist/storage/ontology/sources.d.ts.map +1 -1
- package/dist/storage/projection-runs/in-memory.d.ts +3 -1
- package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/projection-runs/index.d.ts +1 -1
- package/dist/storage/projection-runs/index.d.ts.map +1 -1
- package/dist/storage/projection-runs/lifecycle.d.ts +12 -0
- package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
- package/dist/storage/projection-runs/provider.js +10 -4
- package/dist/storage/projection-runs/provider.js.map +1 -1
- package/dist/storage/projection-runs/types.d.ts +32 -1
- package/dist/storage/projection-runs/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +5 -5
- package/dist/syncs/index.js +20 -20
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +381 -171
- package/dist/testing/index.js.map +5 -5
- package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
- package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +15 -15
- package/dist/webhooks/internal.js.map +1 -1
- package/dist/workers/index.js +1 -1
- package/dist/workflows/index.js +34 -34
- package/package.json +13 -1
- package/src/auth/errors.ts +23 -0
- package/src/auth/index.ts +1 -1
- package/src/auth/runtime.ts +56 -22
- package/src/auth/strategy.ts +2 -0
- package/src/auth/types.ts +8 -0
- package/src/deploy/define.ts +6 -0
- package/src/deploy/index.ts +41 -0
- package/src/deploy/internal.ts +7 -0
- package/src/deploy/services.ts +51 -0
- package/src/deploy/types.ts +338 -0
- package/src/deploy/validation.ts +261 -0
- package/src/errors/catalog.ts +4 -0
- package/src/maintenance/ontology-maintenance.ts +32 -2
- package/src/maintenance/types.ts +8 -2
- package/src/materialization/dataset-watermark.ts +6 -4
- package/src/materialization/model.ts +7 -0
- package/src/materializer/README.md +26 -6
- package/src/materializer/projections/finish-run.ts +129 -26
- package/src/materializer/projections/replace.ts +67 -49
- package/src/materializer/projections/source-materialization.ts +11 -6
- package/src/projections/types.ts +1 -0
- package/src/storage/auth/errors.ts +0 -1
- package/src/storage/auth/in-memory/auth-storage.ts +44 -65
- package/src/storage/auth/types.ts +15 -7
- package/src/storage/index.ts +6 -1
- package/src/storage/ontology/in-memory/sources.ts +119 -55
- package/src/storage/ontology/index.ts +4 -1
- package/src/storage/ontology/provider.ts +64 -7
- package/src/storage/ontology/sources.ts +42 -8
- package/src/storage/projection-runs/in-memory.ts +41 -2
- package/src/storage/projection-runs/index.ts +2 -0
- package/src/storage/projection-runs/lifecycle.ts +61 -4
- package/src/storage/projection-runs/types.ts +41 -1
- package/src/testing/auth-storage-contract.ts +104 -130
- package/src/testing/ontology-storage-contract.ts +141 -15
- package/src/testing/projection-run-storage-contract.ts +174 -1
- package/dist/chunk-3qpcrcj8.js.map +0 -10
- package/dist/chunk-qma80ych.js.map +0 -11
- package/dist/chunk-znw0zvy4.js.map +0 -12
- /package/dist/{chunk-693f3zn8.js.map → chunk-1jvq82rp.js.map} +0 -0
- /package/dist/{chunk-898y24dd.js.map → chunk-3c90jvfj.js.map} +0 -0
- /package/dist/{chunk-vn3yh259.js.map → chunk-4gmng3vf.js.map} +0 -0
- /package/dist/{chunk-91wthfwe.js.map → chunk-4jph1t3v.js.map} +0 -0
- /package/dist/{chunk-y487ywrv.js.map → chunk-6q7c68yx.js.map} +0 -0
- /package/dist/{chunk-ypj2wqtj.js.map → chunk-70jmg2zx.js.map} +0 -0
- /package/dist/{chunk-s24qbp32.js.map → chunk-7jc21943.js.map} +0 -0
- /package/dist/{chunk-rzcjp5m2.js.map → chunk-8fjmqjyx.js.map} +0 -0
- /package/dist/{chunk-m8zkvep1.js.map → chunk-8w27xf9e.js.map} +0 -0
- /package/dist/{chunk-z9h698s8.js.map → chunk-a4g5yjm0.js.map} +0 -0
- /package/dist/{chunk-gmt22nxx.js.map → chunk-adbve9zt.js.map} +0 -0
- /package/dist/{chunk-gbcrz0gr.js.map → chunk-ex8s8wsk.js.map} +0 -0
- /package/dist/{chunk-4tnrzqqh.js.map → chunk-fj1dvp37.js.map} +0 -0
- /package/dist/{chunk-bdhfn0ww.js.map → chunk-kkqwzy6h.js.map} +0 -0
- /package/dist/{chunk-bep5rrdq.js.map → chunk-mmac1mp6.js.map} +0 -0
- /package/dist/{chunk-w9bp61e7.js.map → chunk-n5t4mq6z.js.map} +0 -0
- /package/dist/{chunk-n33e8dz8.js.map → chunk-p0nbkys4.js.map} +0 -0
- /package/dist/{chunk-04h4t2b5.js.map → chunk-py2dw8cw.js.map} +0 -0
- /package/dist/{chunk-jhyc777j.js.map → chunk-q3grgzp1.js.map} +0 -0
- /package/dist/{chunk-cbn96bve.js.map → chunk-r5sc1d2b.js.map} +0 -0
- /package/dist/{chunk-y6vnvayj.js.map → chunk-vjcd8d27.js.map} +0 -0
- /package/dist/{chunk-jmwy25mf.js.map → chunk-wd34wnsy.js.map} +0 -0
- /package/dist/{chunk-63fp9x3q.js.map → chunk-wem5vqjw.js.map} +0 -0
- /package/dist/{chunk-darm7eeg.js.map → chunk-xr7y35yj.js.map} +0 -0
- /package/dist/{chunk-a69fkrtr.js.map → chunk-y0zmae99.js.map} +0 -0
- /package/dist/{chunk-xgptywp0.js.map → chunk-y2aq6ag9.js.map} +0 -0
- /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,EA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AmC,CAAC,QAAQ,CAAC,KACnD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B;
|
|
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,MAAM,WAAW,mCAAmC,CAClD,QAAQ,SAAS,oBAAoB,GAAG,oBAAoB;IAE5D,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAA;IACjC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAA;CACtC;AAED,MAAM,WAAW,wCAAwC,CACvD,QAAQ,SAAS,oBAAoB,GAAG,oBAAoB;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-
|
|
2
|
+
import"../chunk-6fsr7y93.js";
|
|
3
3
|
import"../chunk-z3y5kg1x.js";
|
|
4
|
-
import"../chunk-
|
|
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-
|
|
11
|
-
import"../chunk-
|
|
10
|
+
} from "../chunk-r5sc1d2b.js";
|
|
11
|
+
import"../chunk-y2aq6ag9.js";
|
|
12
12
|
import"../chunk-fc5zfxy1.js";
|
|
13
|
-
import"../chunk-
|
|
13
|
+
import"../chunk-qne45xqq.js";
|
|
14
14
|
import"../chunk-drz59ve0.js";
|
|
15
|
-
import"../chunk-
|
|
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-
|
|
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-
|
|
29
|
+
import"../chunk-g4rbm4a6.js";
|
|
30
30
|
import {
|
|
31
31
|
canRetryWebhookRun2
|
|
32
|
-
} from "../chunk-
|
|
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-
|
|
37
|
-
import"../chunk-
|
|
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-
|
|
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-
|
|
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=
|
|
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;AAAA,cACP,mBAAmB,YAAY;AAAA,gBAC7B,MAAM,WAAW,MAAM,SAAS,KAAK,UAAU,GAAG,KAChD,CAAC,cACC,UAAU,YAAY,OAAO,gBAC7B,UAAU,WAAW,QAAQ,OAAO,SACxC;AAAA,gBACA,IAAI,CAAC;AAAA,kBACH,MAAM,0BACJ,uBACA,0DACF;AAAA,gBACF,OAAO,QAAQ,QAAQ,IAAI,gBAAgB,EAAE,MAAM;AAAA,iBAClD;AAAA,cACH,OAAO;AAAA;AAAA,UAEX;AAAA,QAC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BACF;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAGT,SAAS,wBAAwB,CAAC,SAAuD;AAAA,EACvF,IAAI,CAAC,QAAQ,aAAa;AAAA,IACxB,MAAM,IAAI,iBAAgB,+CAA+C;AAAA,EAC3E;AAAA,EACA,OAAO,QAAQ;AAAA;AAGjB,SAAS,oBAAoB,CAAC,OAAmC;AAAA,EAC/D,IAAI,MAAM,mBAAmB,aAAa,CAAC,MAAM,eAAe,KAAK,GAAG;AAAA,IACtE,MAAM,IAAI,iBAAgB,mDAAmD;AAAA,EAC/E;AAAA,EACA,IAAI,CAAC,OAAO,cAAc,MAAM,gBAAgB,KAAK,MAAM,mBAAmB,GAAG;AAAA,IAC/E,MAAM,IAAI,iBAAgB,mEAAmE;AAAA,EAC/F;AAAA,EACA,IAAI,CAAC,iBAAiB,KAAK,MAAM,iBAAiB,GAAG;AAAA,IACnD,MAAM,IAAI,iBAAgB,oEAAoE;AAAA,EAChG;AAAA;AAGF,SAAS,6BAA6B,CAAC,OAAyB;AAAA,EAC9D,OACE,+BAA8B,KAAK,KAClC,iBAAiB,0BAAyB,MAAM,SAAS,yBACzD,iBAAiB,qBACf,MAAM,SAAS,mBAAmB,MAAM,SAAS;AAAA;",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "1B87474FA26986F164756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/workers/index.js
CHANGED
package/dist/workflows/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
defineWorkflow2,
|
|
9
9
|
createWorkflowNodeFailure2,
|
|
10
10
|
unwrapWorkflowNodeFailure2
|
|
11
|
-
} from "../chunk-
|
|
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-
|
|
49
|
-
import"../chunk-
|
|
50
|
-
import"../chunk-
|
|
51
|
-
import"../chunk-
|
|
52
|
-
import"../chunk-
|
|
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-
|
|
54
|
+
import"../chunk-py2dw8cw.js";
|
|
58
55
|
import"../chunk-f85hpqnm.js";
|
|
59
|
-
import"../chunk-
|
|
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-
|
|
65
|
-
import"../chunk-
|
|
66
|
-
import"../chunk-
|
|
67
|
-
import"../chunk-
|
|
68
|
-
import"../chunk-
|
|
69
|
-
import"../chunk-
|
|
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-
|
|
73
|
+
import"../chunk-xr7y35yj.js";
|
|
74
|
+
import"../chunk-tw03bsmb.js";
|
|
75
|
+
import"../chunk-p0nbkys4.js";
|
|
73
76
|
import"../chunk-zdkcdshk.js";
|
|
74
|
-
import"../chunk-
|
|
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-
|
|
78
|
-
import"../chunk-
|
|
79
|
-
import"../chunk-
|
|
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-
|
|
94
|
-
import"../chunk-
|
|
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-
|
|
100
|
-
import"../chunk-
|
|
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-
|
|
103
|
+
import"../chunk-8fjmqjyx.js";
|
|
104
104
|
import"../chunk-v4jbb3rs.js";
|
|
105
105
|
import"../chunk-d8yes9yx.js";
|
|
106
|
-
import"../chunk-
|
|
106
|
+
import"../chunk-6fsr7y93.js";
|
|
107
107
|
import"../chunk-z3y5kg1x.js";
|
|
108
|
-
import"../chunk-
|
|
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.
|
|
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",
|
package/src/auth/errors.ts
CHANGED
|
@@ -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,
|
package/src/auth/runtime.ts
CHANGED
|
@@ -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
|
-
)
|
|
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 {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
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
|
-
)
|
|
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(
|
|
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(
|
|
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<{
|
|
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 =
|
|
1216
|
-
?
|
|
1217
|
-
|
|
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
|
package/src/auth/strategy.ts
CHANGED
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,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,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
|
+
}
|