@sixb/core 0.1.9 → 0.1.11
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 +9 -9
- package/dist/agents/index.js +17 -16
- package/dist/agents/index.js.map +1 -1
- package/dist/blob-storage/types.d.ts +4 -1
- package/dist/blob-storage/types.d.ts.map +1 -1
- package/dist/bootstrap/index.js +21 -20
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/broker/in-memory.d.ts +8 -2
- package/dist/broker/in-memory.d.ts.map +1 -1
- package/dist/broker/index.d.ts +4 -2
- package/dist/broker/index.d.ts.map +1 -1
- package/dist/broker/index.js +7 -3
- package/dist/broker/index.js.map +1 -1
- package/dist/broker/retention.d.ts +4 -0
- package/dist/broker/retention.d.ts.map +1 -0
- package/dist/broker/subscriber.d.ts +10 -0
- package/dist/broker/subscriber.d.ts.map +1 -0
- package/dist/broker/types.d.ts +14 -1
- package/dist/broker/types.d.ts.map +1 -1
- package/dist/{chunk-ypbtykv6.js → chunk-01kj2pbh.js} +1 -1
- package/dist/{chunk-k3cqkkn2.js → chunk-1824gssz.js} +30 -65
- package/dist/chunk-1824gssz.js.map +12 -0
- package/dist/{chunk-xyr8kppc.js → chunk-1yefycb1.js} +1 -1
- package/dist/chunk-2c4j899j.js.map +1 -1
- package/dist/{chunk-ppytyr6w.js → chunk-358caqf5.js} +4 -4
- package/dist/chunk-358caqf5.js.map +12 -0
- package/dist/{chunk-m3z3x9v0.js → chunk-3ckk0xfj.js} +2 -2
- package/dist/{chunk-kxwa347f.js → chunk-3qms4nax.js} +2 -2
- package/dist/{chunk-kxwa347f.js.map → chunk-3qms4nax.js.map} +3 -3
- package/dist/{chunk-52hbv0ak.js → chunk-4zhmdsx6.js} +141 -55
- package/dist/chunk-4zhmdsx6.js.map +36 -0
- package/dist/{chunk-zcnq6105.js → chunk-85cd7e8c.js} +2 -1
- package/dist/chunk-85cd7e8c.js.map +10 -0
- package/dist/{chunk-3f7veca0.js → chunk-9x8dybsb.js} +3 -3
- package/dist/chunk-9x8dybsb.js.map +10 -0
- package/dist/{chunk-0w35wavj.js → chunk-a0e6x5hd.js} +1 -1
- package/dist/{chunk-r29fxdhn.js → chunk-aa6z4a19.js} +160 -44
- package/dist/chunk-aa6z4a19.js.map +12 -0
- package/dist/{chunk-emyyk7dx.js → chunk-cfvakeax.js} +22 -145
- package/dist/chunk-cfvakeax.js.map +12 -0
- package/dist/chunk-d62kjtbg.js.map +1 -1
- package/dist/{chunk-h1gfhhbh.js → chunk-d63nnr5b.js} +2 -2
- package/dist/{chunk-r4tfx1sf.js → chunk-fh8kgex1.js} +5 -5
- package/dist/{chunk-an5tt9y0.js → chunk-ftv470j8.js} +42 -4
- package/dist/{chunk-an5tt9y0.js.map → chunk-ftv470j8.js.map} +7 -7
- package/dist/{chunk-jjy0fhrn.js → chunk-g91qxjj0.js} +20 -3
- package/dist/chunk-g91qxjj0.js.map +12 -0
- package/dist/{chunk-hpr1r6av.js → chunk-gq8vhakp.js} +51 -40
- package/dist/{chunk-hpr1r6av.js.map → chunk-gq8vhakp.js.map} +6 -6
- package/dist/{chunk-x57ycxq0.js → chunk-gqh45d2n.js} +42 -3
- package/dist/{chunk-x57ycxq0.js.map → chunk-gqh45d2n.js.map} +3 -3
- package/dist/{chunk-mjbk2djy.js → chunk-gqm76kse.js} +231 -125
- package/dist/{chunk-mjbk2djy.js.map → chunk-gqm76kse.js.map} +9 -8
- package/dist/{chunk-e0d1rzef.js → chunk-jsy70480.js} +16 -3
- package/dist/chunk-jsy70480.js.map +15 -0
- package/dist/{chunk-0rdrecsb.js → chunk-kfee1h52.js} +116 -32
- package/dist/chunk-kfee1h52.js.map +13 -0
- package/dist/{chunk-3frsnm7x.js → chunk-qma80ych.js} +4 -6
- package/dist/chunk-qma80ych.js.map +11 -0
- package/dist/{chunk-vf691g1r.js → chunk-sepyxgpc.js} +3 -3
- package/dist/chunk-v2vcg0w6.js +151 -0
- package/dist/chunk-v2vcg0w6.js.map +11 -0
- package/dist/{chunk-3tgwrcyh.js → chunk-wf88w4kp.js} +17 -23
- package/dist/chunk-wf88w4kp.js.map +14 -0
- package/dist/{chunk-xfbydgzy.js → chunk-x9m9x2eq.js} +7 -8
- package/dist/{chunk-xfbydgzy.js.map → chunk-x9m9x2eq.js.map} +3 -3
- package/dist/{chunk-qhcpj9wc.js → chunk-z0271qkp.js} +98 -2
- package/dist/chunk-z0271qkp.js.map +15 -0
- package/dist/{chunk-1enhpacz.js → chunk-z0s4axeh.js} +6 -6
- package/dist/connectors/connections/authorizations.d.ts.map +1 -1
- package/dist/connectors/connections/command-context.d.ts +2 -0
- package/dist/connectors/connections/command-context.d.ts.map +1 -1
- package/dist/connectors/connections/contracts.d.ts +4 -1
- package/dist/connectors/connections/contracts.d.ts.map +1 -1
- package/dist/connectors/connections/execution.d.ts +1 -0
- package/dist/connectors/connections/execution.d.ts.map +1 -1
- package/dist/connectors/connections/internal.js +1 -1
- package/dist/connectors/connections/request.d.ts +3 -1
- package/dist/connectors/connections/request.d.ts.map +1 -1
- package/dist/connectors/connections/runs.d.ts +1 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/connectors/connections/service.d.ts +2 -0
- package/dist/connectors/connections/service.d.ts.map +1 -1
- package/dist/connectors/connections/tokens.d.ts.map +1 -1
- package/dist/connectors/connections/validation.d.ts +5 -1
- package/dist/connectors/connections/validation.d.ts.map +1 -1
- package/dist/connectors/types.d.ts +19 -4
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/events/execution.d.ts +1 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/outbox-dispatcher.d.ts +2 -2
- package/dist/events/outbox-dispatcher.d.ts.map +1 -1
- package/dist/events/service.d.ts +2 -2
- package/dist/events/service.d.ts.map +1 -1
- package/dist/execution/agent.js +17 -16
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/primitive.js +17 -16
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +17 -16
- package/dist/execution/request.js.map +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -29
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/changes.d.ts +5 -0
- package/dist/lake-storage/changes.d.ts.map +1 -0
- package/dist/lake-storage/in-memory.d.ts +2 -1
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +2 -1
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +4 -2
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/types.d.ts +38 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/logging/internal.js +1 -1
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/maintenance/types.d.ts +1 -1
- package/dist/maintenance/types.d.ts.map +1 -1
- package/dist/materialization/index.d.ts +1 -1
- package/dist/materialization/index.d.ts.map +1 -1
- package/dist/materialization/model.d.ts +12 -1
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.d.ts +1 -1
- package/dist/materializer/index.d.ts.map +1 -1
- package/dist/materializer/index.js +6 -6
- package/dist/materializer/materializer.d.ts +5 -1
- package/dist/materializer/materializer.d.ts.map +1 -1
- package/dist/materializer/projections/entry-validator.d.ts +2 -1
- package/dist/materializer/projections/entry-validator.d.ts.map +1 -1
- package/dist/materializer/projections/replace.d.ts.map +1 -1
- package/dist/materializer/projections/source-materialization.d.ts +4 -3
- package/dist/materializer/projections/source-materialization.d.ts.map +1 -1
- package/dist/materializer/shared/normalize.d.ts +2 -1
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +7 -0
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/execution/index.js +6 -6
- package/dist/models/index.js +1 -1
- package/dist/objects/index.js +10 -10
- package/dist/objects/query/index.js +6 -6
- package/dist/pipelines/index.js +7 -7
- package/dist/pipelines/run-dispatch.d.ts.map +1 -1
- package/dist/projections/internal.js +7 -9
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/queues/in-memory.d.ts +7 -3
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/indexed-heap.d.ts +15 -0
- package/dist/queues/indexed-heap.d.ts.map +1 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.js +1 -1
- package/dist/runtime/ontology-mutations.d.ts +3 -1
- package/dist/runtime/ontology-mutations.d.ts.map +1 -1
- package/dist/shares/internal.js +5 -5
- package/dist/storage/agents/provider.js +1 -1
- package/dist/storage/connector-connections/in-memory.d.ts +1 -0
- package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/connections.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/runs.d.ts +1 -0
- package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider/shared.d.ts +1 -0
- package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.d.ts +1 -0
- package/dist/storage/connector-connections/provider.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +11 -17
- package/dist/storage/connector-connections/provider.js.map +6 -6
- package/dist/storage/connector-connections/types.d.ts +6 -3
- package/dist/storage/connector-connections/types.d.ts.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +5 -5
- package/dist/storage/internal.js +1 -1
- package/dist/storage/ontology/in-memory/materializations-state.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts +1 -1
- package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/shared-state.d.ts +15 -2
- package/dist/storage/ontology/in-memory/shared-state.d.ts.map +1 -1
- package/dist/storage/ontology/in-memory/source-roots.d.ts +6 -0
- package/dist/storage/ontology/in-memory/source-roots.d.ts.map +1 -0
- 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/outbox.d.ts +1 -0
- package/dist/storage/ontology/outbox.d.ts.map +1 -1
- package/dist/storage/ontology/provider.d.ts +16 -0
- package/dist/storage/ontology/provider.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +4 -2
- package/dist/storage/ontology/provider.js.map +1 -1
- package/dist/storage/ontology/sources.d.ts +13 -4
- package/dist/storage/ontology/sources.d.ts.map +1 -1
- package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/projection-runs/types.d.ts +2 -0
- package/dist/storage/projection-runs/types.d.ts.map +1 -1
- package/dist/syncs/index.js +9 -8
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- package/dist/testing/broker-contract.d.ts.map +1 -1
- package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1499 -963
- package/dist/testing/index.js.map +10 -9
- package/dist/testing/lake-changes-contract.d.ts +6 -0
- package/dist/testing/lake-changes-contract.d.ts.map +1 -0
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- 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/connections.d.ts +6 -0
- package/dist/webhooks/connections.d.ts.map +1 -0
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.d.ts.map +1 -1
- package/dist/webhooks/internal.d.ts +2 -0
- package/dist/webhooks/internal.d.ts.map +1 -1
- package/dist/webhooks/internal.js +55 -10
- package/dist/webhooks/internal.js.map +4 -3
- package/dist/webhooks/registry.d.ts +1 -1
- package/dist/webhooks/registry.d.ts.map +1 -1
- package/dist/webhooks/types.d.ts +15 -4
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/workflows/index.js +18 -17
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/run-dispatch.d.ts +3 -1
- package/dist/workflows/run-dispatch.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agents/model-loop.ts +7 -0
- package/src/blob-storage/types.ts +4 -1
- package/src/broker/in-memory.ts +104 -39
- package/src/broker/index.ts +4 -1
- package/src/broker/retention.ts +28 -0
- package/src/broker/subscriber.ts +21 -0
- package/src/broker/types.ts +15 -1
- package/src/connectors/builders.ts +0 -6
- package/src/connectors/connections/authorizations.ts +11 -5
- package/src/connectors/connections/command-context.ts +21 -4
- package/src/connectors/connections/contracts.ts +7 -1
- package/src/connectors/connections/execution.ts +3 -0
- package/src/connectors/connections/request.ts +56 -22
- package/src/connectors/connections/runs.ts +39 -1
- package/src/connectors/connections/service.ts +6 -0
- package/src/connectors/connections/tokens.ts +4 -0
- package/src/connectors/connections/validation.ts +91 -5
- package/src/connectors/types.ts +19 -4
- package/src/events/execution.ts +2 -2
- package/src/events/outbox-dispatcher.ts +20 -26
- package/src/events/service.ts +3 -3
- package/src/index.ts +10 -2
- package/src/lake-storage/changes.ts +43 -0
- package/src/lake-storage/in-memory.ts +75 -0
- package/src/lake-storage/index.ts +4 -0
- package/src/lake-storage/types.ts +42 -0
- package/src/logging/service.ts +1 -1
- package/src/maintenance/ontology-maintenance.ts +6 -2
- package/src/maintenance/types.ts +1 -1
- package/src/materialization/index.ts +2 -0
- package/src/materialization/model.ts +14 -1
- package/src/materializer/README.md +1 -1
- package/src/materializer/index.ts +2 -0
- package/src/materializer/materializer.ts +10 -0
- package/src/materializer/projections/entry-validator.ts +19 -1
- package/src/materializer/projections/replace.ts +36 -1
- package/src/materializer/projections/source-materialization.ts +26 -6
- package/src/materializer/shared/normalize.ts +1 -1
- package/src/models/definitions.ts +19 -0
- package/src/models/pricing.ts +6 -2
- package/src/pipelines/run-dispatch.ts +21 -1
- package/src/projections/run-dispatch.ts +30 -68
- package/src/queues/in-memory.ts +105 -62
- package/src/queues/indexed-heap.ts +74 -0
- package/src/runtime/host.ts +0 -14
- package/src/runtime/ontology-mutations.ts +4 -0
- package/src/storage/connector-connections/in-memory.ts +19 -19
- package/src/storage/connector-connections/provider/connections.ts +1 -15
- package/src/storage/connector-connections/provider/runs.ts +9 -1
- package/src/storage/connector-connections/provider/shared.ts +2 -3
- package/src/storage/connector-connections/provider.ts +6 -0
- package/src/storage/connector-connections/types.ts +8 -3
- package/src/storage/index.ts +1 -0
- package/src/storage/ontology/in-memory/materializations-state.ts +5 -18
- package/src/storage/ontology/in-memory/materializations.ts +73 -92
- package/src/storage/ontology/in-memory/shared-state.ts +36 -4
- package/src/storage/ontology/in-memory/source-roots.ts +123 -0
- package/src/storage/ontology/in-memory/sources.ts +78 -23
- package/src/storage/ontology/index.ts +1 -0
- package/src/storage/ontology/outbox.ts +1 -0
- package/src/storage/ontology/provider.ts +70 -0
- package/src/storage/ontology/sources.ts +14 -3
- package/src/storage/projection-runs/lifecycle.ts +5 -2
- package/src/storage/projection-runs/types.ts +4 -3
- package/src/syncs/run-dispatch.ts +19 -1
- package/src/testing/broker-contract.ts +95 -0
- package/src/testing/connector-connection-storage-contract.ts +29 -12
- package/src/testing/index.ts +1 -0
- package/src/testing/lake-changes-contract.ts +240 -0
- package/src/testing/lake-storage-contract.ts +29 -0
- package/src/testing/materializer-storage-contract.ts +172 -1
- package/src/testing/ontology-storage-contract.ts +15 -3
- package/src/testing/projection-run-storage-contract.ts +34 -0
- package/src/webhooks/connections.ts +56 -0
- package/src/webhooks/index.ts +2 -0
- package/src/webhooks/internal.ts +2 -0
- package/src/webhooks/registry.ts +3 -4
- package/src/webhooks/types.ts +17 -4
- package/src/workflows/run-dispatch.ts +42 -29
- package/dist/chunk-0rdrecsb.js.map +0 -11
- package/dist/chunk-3f7veca0.js.map +0 -10
- package/dist/chunk-3frsnm7x.js.map +0 -11
- package/dist/chunk-3tgwrcyh.js.map +0 -14
- package/dist/chunk-52hbv0ak.js.map +0 -36
- package/dist/chunk-e0d1rzef.js.map +0 -15
- package/dist/chunk-emyyk7dx.js.map +0 -14
- package/dist/chunk-jjy0fhrn.js.map +0 -12
- package/dist/chunk-k3cqkkn2.js.map +0 -12
- package/dist/chunk-ppytyr6w.js.map +0 -12
- package/dist/chunk-qhcpj9wc.js.map +0 -14
- package/dist/chunk-r29fxdhn.js.map +0 -11
- package/dist/chunk-zcnq6105.js.map +0 -10
- /package/dist/{chunk-ypbtykv6.js.map → chunk-01kj2pbh.js.map} +0 -0
- /package/dist/{chunk-xyr8kppc.js.map → chunk-1yefycb1.js.map} +0 -0
- /package/dist/{chunk-m3z3x9v0.js.map → chunk-3ckk0xfj.js.map} +0 -0
- /package/dist/{chunk-0w35wavj.js.map → chunk-a0e6x5hd.js.map} +0 -0
- /package/dist/{chunk-h1gfhhbh.js.map → chunk-d63nnr5b.js.map} +0 -0
- /package/dist/{chunk-r4tfx1sf.js.map → chunk-fh8kgex1.js.map} +0 -0
- /package/dist/{chunk-vf691g1r.js.map → chunk-sepyxgpc.js.map} +0 -0
- /package/dist/{chunk-1enhpacz.js.map → chunk-z0s4axeh.js.map} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ProjectionRegistry2,
|
|
7
7
|
createOntologyMaterializer2
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ftv470j8.js";
|
|
9
9
|
import {
|
|
10
10
|
captureSixbFailure2,
|
|
11
11
|
isSixbError2
|
|
@@ -27,28 +27,28 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
RuntimeError2,
|
|
29
29
|
createModelCatalog2
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-jsy70480.js";
|
|
31
31
|
import {
|
|
32
32
|
isMigrationCapableStorage2,
|
|
33
33
|
checkStorageSchema2
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-gqm76kse.js";
|
|
35
35
|
import {
|
|
36
36
|
createAuthorizedObjectReader
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-01kj2pbh.js";
|
|
38
38
|
import {
|
|
39
39
|
attachSixbErrorReporter2,
|
|
40
40
|
shareSixbErrorReporter2
|
|
41
41
|
} from "./chunk-7apz6hg4.js";
|
|
42
42
|
import {
|
|
43
43
|
ActionRegistry2
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-sepyxgpc.js";
|
|
45
45
|
import {
|
|
46
46
|
assertDatasetDefinition2
|
|
47
47
|
} from "./chunk-860dwwy0.js";
|
|
48
48
|
import {
|
|
49
49
|
OntologyOutboxDispatcher2,
|
|
50
50
|
createDomainEventService2
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-wf88w4kp.js";
|
|
52
52
|
import {
|
|
53
53
|
validateSchedulesAtStartup2
|
|
54
54
|
} from "./chunk-e1c18xjx.js";
|
|
@@ -62,9 +62,8 @@ import {
|
|
|
62
62
|
providerBoundaryError,
|
|
63
63
|
isConnectorStorageError,
|
|
64
64
|
storageBoundaryError,
|
|
65
|
-
recoverConnectorFailure
|
|
66
|
-
|
|
67
|
-
} from "./chunk-emyyk7dx.js";
|
|
65
|
+
recoverConnectorFailure
|
|
66
|
+
} from "./chunk-v2vcg0w6.js";
|
|
68
67
|
import {
|
|
69
68
|
toolsFromProjectConfig
|
|
70
69
|
} from "./chunk-skz0hst3.js";
|
|
@@ -73,14 +72,14 @@ import {
|
|
|
73
72
|
validateWorkflowsAtStartup2,
|
|
74
73
|
validateWorkflowAgentStepGroupReferences2,
|
|
75
74
|
createBoundSixb
|
|
76
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-gq8vhakp.js";
|
|
77
76
|
import {
|
|
78
77
|
registerConnectorConnectionCallbackProcess
|
|
79
78
|
} from "./chunk-5a4a52tq.js";
|
|
80
79
|
import {
|
|
81
80
|
registerOntologyMutationRuntime2,
|
|
82
81
|
createOntologyMutationRuntime2
|
|
83
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-85cd7e8c.js";
|
|
84
83
|
import {
|
|
85
84
|
SchedulerRuntime2
|
|
86
85
|
} from "./chunk-z5rnrmz1.js";
|
|
@@ -89,17 +88,19 @@ import {
|
|
|
89
88
|
validateSharesAtStartup,
|
|
90
89
|
discoverOntologySources2,
|
|
91
90
|
discoverProjectDefinitions2
|
|
92
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-fh8kgex1.js";
|
|
93
92
|
import {
|
|
94
93
|
LoggingService2
|
|
95
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-3qms4nax.js";
|
|
96
95
|
import {
|
|
97
96
|
registerProjectionRegistry2
|
|
98
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-1824gssz.js";
|
|
98
|
+
import {
|
|
99
|
+
SyncValidationError2
|
|
100
|
+
} from "./chunk-cfvakeax.js";
|
|
99
101
|
import {
|
|
100
|
-
isOAuthConnectorDefinition2
|
|
101
|
-
|
|
102
|
-
} from "./chunk-3f7veca0.js";
|
|
102
|
+
isOAuthConnectorDefinition2
|
|
103
|
+
} from "./chunk-9x8dybsb.js";
|
|
103
104
|
import {
|
|
104
105
|
ensureExecutionRecord2
|
|
105
106
|
} from "./chunk-17kfctj6.js";
|
|
@@ -110,6 +111,9 @@ import {
|
|
|
110
111
|
import {
|
|
111
112
|
reportEventDeliveryFailure3
|
|
112
113
|
} from "./chunk-72w2pxk7.js";
|
|
114
|
+
import {
|
|
115
|
+
isJsonObject2
|
|
116
|
+
} from "./chunk-wy0qdqfm.js";
|
|
113
117
|
// src/webhooks/errors.ts
|
|
114
118
|
class WebhookValidationError2 extends Error {
|
|
115
119
|
name = "WebhookValidationError";
|
|
@@ -245,8 +249,6 @@ class WebhookRegistry {
|
|
|
245
249
|
constructor(options) {
|
|
246
250
|
const registered = [];
|
|
247
251
|
for (const connector of options.connectors) {
|
|
248
|
-
if (!isStaticConnectorDefinition(connector))
|
|
249
|
-
continue;
|
|
250
252
|
const webhooks = connector.adapter.webhooks ?? [];
|
|
251
253
|
if (!Array.isArray(webhooks)) {
|
|
252
254
|
throw new WebhookValidationError2(`[Sixb] Connector '${connector.id}' webhooks must be an array when provided.`);
|
|
@@ -467,6 +469,12 @@ function validateCredentials(credentials) {
|
|
|
467
469
|
}
|
|
468
470
|
normalized.expiresAt = new Date(credentials.expiresAt);
|
|
469
471
|
}
|
|
472
|
+
if (credentials.authorizationContext !== undefined) {
|
|
473
|
+
if (!isJsonObject2(credentials.authorizationContext)) {
|
|
474
|
+
throw createConnectorCodedError("connector.adapter_invalid", "OAuth connector adapter returned invalid authorization context; expected a JSON object.");
|
|
475
|
+
}
|
|
476
|
+
normalized.authorizationContext = structuredClone(credentials.authorizationContext);
|
|
477
|
+
}
|
|
470
478
|
return normalized;
|
|
471
479
|
}
|
|
472
480
|
function validateAccounts(accounts) {
|
|
@@ -500,7 +508,8 @@ function serializeCredentials(credentials) {
|
|
|
500
508
|
...credentials.refreshToken === undefined ? {} : { refreshToken: credentials.refreshToken },
|
|
501
509
|
...credentials.tokenType === undefined ? {} : { tokenType: credentials.tokenType },
|
|
502
510
|
...credentials.scopes === undefined ? {} : { scopes: credentials.scopes },
|
|
503
|
-
...credentials.expiresAt === undefined ? {} : { expiresAt: credentials.expiresAt.toISOString() }
|
|
511
|
+
...credentials.expiresAt === undefined ? {} : { expiresAt: credentials.expiresAt.toISOString() },
|
|
512
|
+
...credentials.authorizationContext === undefined ? {} : { authorizationContext: credentials.authorizationContext }
|
|
504
513
|
});
|
|
505
514
|
}
|
|
506
515
|
function parseCredentials(serialized) {
|
|
@@ -513,7 +522,7 @@ function parseCredentials(serialized) {
|
|
|
513
522
|
if (!isRecord2(value) || value.version !== 1 || typeof value.accessToken !== "string") {
|
|
514
523
|
throw createConnectorCodedError("connector.credentials_unavailable", "Stored connector credentials are invalid.");
|
|
515
524
|
}
|
|
516
|
-
if (value.refreshToken !== undefined && typeof value.refreshToken !== "string" || value.tokenType !== undefined && typeof value.tokenType !== "string" || value.scopes !== undefined && (!Array.isArray(value.scopes) || value.scopes.some((scope) => typeof scope !== "string")) || value.expiresAt !== undefined && typeof value.expiresAt !== "string") {
|
|
525
|
+
if (value.refreshToken !== undefined && typeof value.refreshToken !== "string" || value.tokenType !== undefined && typeof value.tokenType !== "string" || value.scopes !== undefined && (!Array.isArray(value.scopes) || value.scopes.some((scope) => typeof scope !== "string")) || value.expiresAt !== undefined && typeof value.expiresAt !== "string" || value.authorizationContext !== undefined && !isJsonObject2(value.authorizationContext)) {
|
|
517
526
|
throw createConnectorCodedError("connector.credentials_unavailable", "Stored connector credentials are invalid.");
|
|
518
527
|
}
|
|
519
528
|
const expiresAt = value.expiresAt === undefined ? undefined : new Date(value.expiresAt);
|
|
@@ -523,7 +532,8 @@ function parseCredentials(serialized) {
|
|
|
523
532
|
...value.refreshToken === undefined ? {} : { refreshToken: value.refreshToken },
|
|
524
533
|
...value.tokenType === undefined ? {} : { tokenType: value.tokenType },
|
|
525
534
|
...value.scopes === undefined ? {} : { scopes: value.scopes },
|
|
526
|
-
...expiresAt === undefined ? {} : { expiresAt }
|
|
535
|
+
...expiresAt === undefined ? {} : { expiresAt },
|
|
536
|
+
...value.authorizationContext === undefined ? {} : { authorizationContext: value.authorizationContext }
|
|
527
537
|
});
|
|
528
538
|
} catch (error) {
|
|
529
539
|
throw createConnectorCodedError("connector.credentials_unavailable", "Stored connector credentials are invalid.", { cause: error });
|
|
@@ -567,9 +577,44 @@ function normalizedHttpUrl(value, field, code = "connector.configuration_invalid
|
|
|
567
577
|
}
|
|
568
578
|
function assertAuthorizationUrlParameters(authorizationUrl, expected) {
|
|
569
579
|
const parameters = new URL(authorizationUrl).searchParams;
|
|
570
|
-
if (!sameSingleParameter(parameters, "state", expected.state) || !sameSingleParameter(parameters, "code_challenge", expected.codeChallenge) || !sameSingleParameter(parameters, "code_challenge_method", "S256")) {
|
|
571
|
-
throw createConnectorCodedError("connector.adapter_invalid", "OAuth connector authorization URL must preserve the framework-provided state and PKCE S256 parameters.");
|
|
572
|
-
}
|
|
580
|
+
if (!sameSingleParameter(parameters, "state", expected.state) || (expected.codeChallenge === undefined ? parameters.has("code_challenge") || parameters.has("code_challenge_method") : !sameSingleParameter(parameters, "code_challenge", expected.codeChallenge) || !sameSingleParameter(parameters, "code_challenge_method", "S256"))) {
|
|
581
|
+
throw createConnectorCodedError("connector.adapter_invalid", expected.codeChallenge === undefined ? "OAuth connector authorization URL must preserve the framework-provided state and omit disabled PKCE parameters." : "OAuth connector authorization URL must preserve the framework-provided state and PKCE S256 parameters.");
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function connectorPkceEnabled(pkce) {
|
|
585
|
+
if (pkce === undefined || pkce === "S256")
|
|
586
|
+
return true;
|
|
587
|
+
if (pkce === "disabled")
|
|
588
|
+
return false;
|
|
589
|
+
throw createConnectorCodedError("connector.adapter_invalid", "OAuth connector PKCE must be S256 or disabled.");
|
|
590
|
+
}
|
|
591
|
+
var reservedCallbackParameters = new Set([
|
|
592
|
+
"state",
|
|
593
|
+
"code",
|
|
594
|
+
"auth_code",
|
|
595
|
+
"error",
|
|
596
|
+
"error_description",
|
|
597
|
+
"error_uri"
|
|
598
|
+
]);
|
|
599
|
+
function validateCallbackParameterNames(names = []) {
|
|
600
|
+
if (!Array.isArray(names) || names.some((name) => typeof name !== "string" || !/^[A-Za-z_][A-Za-z0-9_.-]*$/.test(name) || reservedCallbackParameters.has(name)) || new Set(names).size !== names.length) {
|
|
601
|
+
throw createConnectorCodedError("connector.adapter_invalid", "OAuth callback parameter names must be unique, non-reserved parameter names.");
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function selectCallbackParameters(names = [], parameters = {}) {
|
|
605
|
+
validateCallbackParameterNames(names);
|
|
606
|
+
if (!isRecord2(parameters)) {
|
|
607
|
+
throw createConnectorCodedError("connector.authorization_invalid", "OAuth provider callback parameters must be an object.");
|
|
608
|
+
}
|
|
609
|
+
return Object.fromEntries(names.flatMap((name) => {
|
|
610
|
+
if (!Object.hasOwn(parameters, name))
|
|
611
|
+
return [];
|
|
612
|
+
const value = parameters[name];
|
|
613
|
+
if (typeof value !== "string") {
|
|
614
|
+
throw createConnectorCodedError("connector.authorization_invalid", "OAuth provider callback parameters must have a single string value.");
|
|
615
|
+
}
|
|
616
|
+
return [[name, value]];
|
|
617
|
+
}));
|
|
573
618
|
}
|
|
574
619
|
function nonblank(value, field, code = "connector.configuration_invalid") {
|
|
575
620
|
if (typeof value !== "string" || !value.trim()) {
|
|
@@ -1069,7 +1114,8 @@ class ConnectorTokenAccess {
|
|
|
1069
1114
|
...refreshed,
|
|
1070
1115
|
...refreshed.refreshToken === undefined ? { refreshToken: current.refreshToken } : {},
|
|
1071
1116
|
...refreshed.tokenType === undefined && current.tokenType !== undefined ? { tokenType: current.tokenType } : {},
|
|
1072
|
-
scopes: refreshed.scopes ?? current.scopes ?? authorization.scopes
|
|
1117
|
+
scopes: refreshed.scopes ?? current.scopes ?? authorization.scopes,
|
|
1118
|
+
...refreshed.authorizationContext === undefined && current.authorizationContext !== undefined ? { authorizationContext: current.authorizationContext } : {}
|
|
1073
1119
|
};
|
|
1074
1120
|
const envelope = await this.credentials.seal(definition.id, authorization.id, normalized);
|
|
1075
1121
|
return this.mutations.stageCredentialMutationCredentials(executing, signal, {
|
|
@@ -1200,7 +1246,7 @@ class DefaultConnectorAuthorizationLifecycle {
|
|
|
1200
1246
|
async completeNewAuthorization(input) {
|
|
1201
1247
|
this.assertRegistered(input.definition);
|
|
1202
1248
|
const authorizationId = `cau_${randomUUID2()}`;
|
|
1203
|
-
const credentials = await this.exchangeAuthorizationCode(input.definition, input.code, input.codeVerifier, input.redirectUri);
|
|
1249
|
+
const credentials = await this.exchangeAuthorizationCode(input.definition, input.code, input.codeVerifier, input.redirectUri, input.callbackParameters);
|
|
1204
1250
|
const credentialsEnvelope = await this.credentials.seal(input.definition.id, authorizationId, credentials);
|
|
1205
1251
|
let pending;
|
|
1206
1252
|
try {
|
|
@@ -1358,7 +1404,11 @@ class DefaultConnectorAuthorizationLifecycle {
|
|
|
1358
1404
|
const { claim } = claimOutcome;
|
|
1359
1405
|
try {
|
|
1360
1406
|
await this.mutations.executeCredentialMutation(claim.authorization, async (executing, signal) => {
|
|
1361
|
-
const credentials = validateCredentials(await input.definition.adapter.authentication.exchangeCode(this.authorizationAdapterContext(input.definition.id, input.redirectUri, signal), {
|
|
1407
|
+
const credentials = validateCredentials(await input.definition.adapter.authentication.exchangeCode(this.authorizationAdapterContext(input.definition.id, input.redirectUri, signal), {
|
|
1408
|
+
code: input.code,
|
|
1409
|
+
...input.codeVerifier === undefined ? {} : { codeVerifier: input.codeVerifier },
|
|
1410
|
+
callbackParameters: input.callbackParameters
|
|
1411
|
+
}));
|
|
1362
1412
|
assertCredentialMutationOperationActive(signal);
|
|
1363
1413
|
const envelope = await this.credentials.seal(input.definition.id, input.authorizationId, credentials);
|
|
1364
1414
|
return this.mutations.stageCredentialMutationCredentials(executing, signal, {
|
|
@@ -1382,9 +1432,9 @@ class DefaultConnectorAuthorizationLifecycle {
|
|
|
1382
1432
|
const staged = await this.requireAuthorization(input.definition.id, input.authorizationId);
|
|
1383
1433
|
return this.mutations.finalizeStagedMutation(staged);
|
|
1384
1434
|
}
|
|
1385
|
-
async exchangeAuthorizationCode(definition, code, codeVerifier, redirectUri) {
|
|
1435
|
+
async exchangeAuthorizationCode(definition, code, codeVerifier, redirectUri, callbackParameters) {
|
|
1386
1436
|
try {
|
|
1387
|
-
return validateCredentials(await this.mutations.withBoundedProviderSignal((signal) => definition.adapter.authentication.exchangeCode(this.authorizationAdapterContext(definition.id, redirectUri, signal), { code, codeVerifier })));
|
|
1437
|
+
return validateCredentials(await this.mutations.withBoundedProviderSignal((signal) => definition.adapter.authentication.exchangeCode(this.authorizationAdapterContext(definition.id, redirectUri, signal), { code, ...codeVerifier === undefined ? {} : { codeVerifier }, callbackParameters })));
|
|
1388
1438
|
} catch (error) {
|
|
1389
1439
|
throw providerBoundaryError(error, "connector.provider_failed", "Connector authorization code exchange failed.");
|
|
1390
1440
|
}
|
|
@@ -1436,11 +1486,19 @@ function assertConnectorAuthorizationAttemptInitiator(execution, current) {
|
|
|
1436
1486
|
}
|
|
1437
1487
|
}
|
|
1438
1488
|
function assertConnectorConnectionRunInitiator(execution, current, connectorId) {
|
|
1439
|
-
|
|
1440
|
-
if (!initiating || !sameConnectorConnectionCommandActor(initiating, current)) {
|
|
1489
|
+
if (!isConnectorConnectionRunInitiator(execution, current)) {
|
|
1441
1490
|
throw new AuthorizationError2(`connection-run:connector:${connectorId}`, "[Sixb] This connector connection run can only be accessed by its initiating actor.");
|
|
1442
1491
|
}
|
|
1443
1492
|
}
|
|
1493
|
+
function isConnectorConnectionRunInitiator(execution, current) {
|
|
1494
|
+
const initiating = execution ? connectorConnectionActorFromExecution(execution, execution.projectId) : null;
|
|
1495
|
+
if (!initiating)
|
|
1496
|
+
return false;
|
|
1497
|
+
if (initiating.principal.type === "user" && current.principal.type === "user" && initiating.credential.type === "session" && current.credential.type === "session") {
|
|
1498
|
+
return initiating.principal.id === current.principal.id;
|
|
1499
|
+
}
|
|
1500
|
+
return sameConnectorConnectionCommandActor(initiating, current);
|
|
1501
|
+
}
|
|
1444
1502
|
function connectorConnectionActorFromExecution(execution, projectId) {
|
|
1445
1503
|
const authorization = execution.authorizationRef;
|
|
1446
1504
|
if (execution.projectId !== projectId || execution.executor.type !== "request" || execution.source.type !== "http" || execution.executor.requestId !== execution.source.requestId || authorization.type !== "principal" || authorization.credential === undefined || execution.requestedBy?.type !== authorization.principal.type || execution.requestedBy.id !== authorization.principal.id) {
|
|
@@ -1518,12 +1576,13 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1518
1576
|
const definition = this.resolveDefinition(nonblank(connectorId, "connector id"));
|
|
1519
1577
|
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
1520
1578
|
assertConnectorConnectionSelector(input);
|
|
1579
|
+
validateCallbackParameterNames(definition.adapter.authentication.callbackParameters);
|
|
1521
1580
|
const redirectUri = normalizedHttpUrl(input.redirectUri, "OAuth callback URL");
|
|
1522
1581
|
const reauthorization = await this.prepareReauthorization(definition, actor, input.reauthorizationId);
|
|
1523
1582
|
const attemptId = `cat_${randomUUID3()}`;
|
|
1524
1583
|
const state = `${attemptId}.${randomBytes2(32).toString("base64url")}`;
|
|
1525
|
-
const codeVerifier = randomBytes2(32).toString("base64url");
|
|
1526
|
-
const codeChallenge = createHash2("sha256").update(codeVerifier).digest("base64url");
|
|
1584
|
+
const codeVerifier = connectorPkceEnabled(definition.adapter.authentication.pkce) ? randomBytes2(32).toString("base64url") : undefined;
|
|
1585
|
+
const codeChallenge = codeVerifier === undefined ? undefined : createHash2("sha256").update(codeVerifier).digest("base64url");
|
|
1527
1586
|
let authorizationUrlInput;
|
|
1528
1587
|
try {
|
|
1529
1588
|
authorizationUrlInput = await runBoundedConnectorProviderOperation({
|
|
@@ -1534,13 +1593,16 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1534
1593
|
connectorId: definition.id,
|
|
1535
1594
|
redirectUri,
|
|
1536
1595
|
signal
|
|
1537
|
-
}, {
|
|
1596
|
+
}, {
|
|
1597
|
+
state,
|
|
1598
|
+
...codeChallenge === undefined ? {} : { codeChallenge, codeChallengeMethod: "S256" }
|
|
1599
|
+
}), () => createConnectorCodedError("connector.provider_unavailable", "Connector authorization URL generation did not complete."));
|
|
1538
1600
|
} catch (error) {
|
|
1539
1601
|
throw providerBoundaryError(error, providerFailureCode(error), "Connector authorization could not be started.");
|
|
1540
1602
|
}
|
|
1541
1603
|
const authorizationUrl = normalizedHttpUrl(authorizationUrlInput, "provider authorization URL", "connector.adapter_invalid");
|
|
1542
1604
|
assertAuthorizationUrlParameters(authorizationUrl, { state, codeChallenge });
|
|
1543
|
-
const codeVerifierEnvelope = await this.credentialProtector.seal(textEncoder2.encode(codeVerifier), {
|
|
1605
|
+
const codeVerifierEnvelope = codeVerifier === undefined ? undefined : await this.credentialProtector.seal(textEncoder2.encode(codeVerifier), {
|
|
1544
1606
|
projectId: this.projectId,
|
|
1545
1607
|
connectorId: definition.id,
|
|
1546
1608
|
recordId: attemptId,
|
|
@@ -1559,7 +1621,7 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1559
1621
|
slot: input.slot,
|
|
1560
1622
|
initiatedByExecutionId: command.execution.id,
|
|
1561
1623
|
stateHash: hashSecret(state),
|
|
1562
|
-
codeVerifier: codeVerifierEnvelope,
|
|
1624
|
+
...codeVerifierEnvelope === undefined ? {} : { codeVerifier: codeVerifierEnvelope },
|
|
1563
1625
|
redirectUri,
|
|
1564
1626
|
...reauthorization === undefined ? {} : {
|
|
1565
1627
|
reauthorizationId: reauthorization.authorization.id,
|
|
@@ -1583,7 +1645,8 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1583
1645
|
attempt,
|
|
1584
1646
|
principal: actor.principal,
|
|
1585
1647
|
code,
|
|
1586
|
-
redirectUri
|
|
1648
|
+
redirectUri,
|
|
1649
|
+
callbackParameters: input.callbackParameters
|
|
1587
1650
|
});
|
|
1588
1651
|
return {
|
|
1589
1652
|
authorizationId: completed.id,
|
|
@@ -1593,7 +1656,11 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1593
1656
|
};
|
|
1594
1657
|
}
|
|
1595
1658
|
async completeAuthorizationAttempt(input) {
|
|
1596
|
-
const
|
|
1659
|
+
const enabled = connectorPkceEnabled(input.definition.adapter.authentication.pkce);
|
|
1660
|
+
if (enabled !== (input.attempt.codeVerifier !== undefined)) {
|
|
1661
|
+
throw createConnectorCodedError("connector.authorization_invalid", "OAuth connector PKCE configuration changed; restart authorization.");
|
|
1662
|
+
}
|
|
1663
|
+
const verifierBytes = input.attempt.codeVerifier === undefined ? undefined : await this.credentialProtector.open(input.attempt.codeVerifier, {
|
|
1597
1664
|
projectId: this.projectId,
|
|
1598
1665
|
connectorId: input.definition.id,
|
|
1599
1666
|
recordId: input.attempt.id,
|
|
@@ -1601,7 +1668,8 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1601
1668
|
});
|
|
1602
1669
|
return this.completeGrant({
|
|
1603
1670
|
...input,
|
|
1604
|
-
|
|
1671
|
+
callbackParameters: selectCallbackParameters(input.definition.adapter.authentication.callbackParameters, input.callbackParameters),
|
|
1672
|
+
...verifierBytes === undefined ? {} : { codeVerifier: textDecoder2.decode(verifierBytes) }
|
|
1605
1673
|
});
|
|
1606
1674
|
}
|
|
1607
1675
|
async prepareReauthorization(definition, actor, reauthorizationId) {
|
|
@@ -1664,6 +1732,7 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1664
1732
|
principal: input.principal,
|
|
1665
1733
|
code: input.code,
|
|
1666
1734
|
codeVerifier: input.codeVerifier,
|
|
1735
|
+
callbackParameters: input.callbackParameters,
|
|
1667
1736
|
redirectUri: input.redirectUri,
|
|
1668
1737
|
...input.onAuthorizationPersisted === undefined ? {} : { onAuthorizationPersisted: input.onAuthorizationPersisted }
|
|
1669
1738
|
});
|
|
@@ -1680,6 +1749,7 @@ class ConnectorAuthorizationRequestHandler {
|
|
|
1680
1749
|
principal: input.principal,
|
|
1681
1750
|
code: input.code,
|
|
1682
1751
|
codeVerifier: input.codeVerifier,
|
|
1752
|
+
callbackParameters: input.callbackParameters,
|
|
1683
1753
|
redirectUri: input.redirectUri
|
|
1684
1754
|
});
|
|
1685
1755
|
}
|
|
@@ -1808,6 +1878,7 @@ class ConnectorConnectionRunService {
|
|
|
1808
1878
|
attempt,
|
|
1809
1879
|
principal,
|
|
1810
1880
|
code: nonblank(input.code, "OAuth authorization code", "connector.authorization_invalid"),
|
|
1881
|
+
callbackParameters: input.callbackParameters,
|
|
1811
1882
|
redirectUri,
|
|
1812
1883
|
onAuthorizationPersisted: async (persisted) => {
|
|
1813
1884
|
authorizationId = persisted.id;
|
|
@@ -1830,6 +1901,23 @@ class ConnectorConnectionRunService {
|
|
|
1830
1901
|
return { runId: failed.id, connectorId: failed.connectorId, returnTo };
|
|
1831
1902
|
}
|
|
1832
1903
|
}
|
|
1904
|
+
async listPending(command, connectorId) {
|
|
1905
|
+
const actor = requireConnectorConnectionCommandActor(command.execution, this.projectId);
|
|
1906
|
+
const candidates = await withConnectorStorageBoundary("Pending connector connection runs could not be read.", () => this.connectionStorage.listPendingConnectionRuns({ projectId: this.projectId, connectorId }));
|
|
1907
|
+
const runs = [];
|
|
1908
|
+
for (const candidate of candidates) {
|
|
1909
|
+
const initiating = await withConnectorStorageBoundary("Connector connection run initiating execution could not be read.", () => this.storage.executions.getById({
|
|
1910
|
+
projectId: this.projectId,
|
|
1911
|
+
id: candidate.initiatedByExecutionId
|
|
1912
|
+
}));
|
|
1913
|
+
if (!isConnectorConnectionRunInitiator(initiating, actor))
|
|
1914
|
+
continue;
|
|
1915
|
+
const run = await this.get(command, connectorId, candidate.id);
|
|
1916
|
+
if (run && (run.status === "running" || run.status === "waiting" && run.waitingFor === "account_selection"))
|
|
1917
|
+
runs.push(run);
|
|
1918
|
+
}
|
|
1919
|
+
return runs.sort((left, right) => right.createdAt.getTime() - left.createdAt.getTime() || left.id.localeCompare(right.id));
|
|
1920
|
+
}
|
|
1833
1921
|
async get(command, connectorId, runId) {
|
|
1834
1922
|
const id = nonblank(runId, "connection run id");
|
|
1835
1923
|
const run = await this.readRun(connectorId, id);
|
|
@@ -2052,8 +2140,7 @@ class ConnectorConnectionRunService {
|
|
|
2052
2140
|
...base,
|
|
2053
2141
|
status: "waiting",
|
|
2054
2142
|
waitingFor: "account_selection",
|
|
2055
|
-
accounts: authorization.accounts
|
|
2056
|
-
expiresAt: run.expiresAt
|
|
2143
|
+
accounts: authorization.accounts
|
|
2057
2144
|
};
|
|
2058
2145
|
}
|
|
2059
2146
|
if (run.status === "succeeded") {
|
|
@@ -2097,6 +2184,8 @@ class ConnectorConnectionRunService {
|
|
|
2097
2184
|
}
|
|
2098
2185
|
scheduleRunMaintenance(run, delayMs = run.status === "waiting" || run.status === "running" ? Math.max(1000, run.expiresAt.getTime() - this.now().getTime()) : CLEANUP_RETRY_DELAY_MS) {
|
|
2099
2186
|
this.cancelRunMaintenance(run.id);
|
|
2187
|
+
if (run.status === "waiting" && run.waitingFor === "account_selection")
|
|
2188
|
+
return;
|
|
2100
2189
|
const timer = setTimeout(() => void this.maintainRun(run.connectorId, run.id), Math.min(delayMs, MAX_TIMER_DELAY_MS));
|
|
2101
2190
|
timer.unref?.();
|
|
2102
2191
|
this.maintenanceTimers.set(run.id, timer);
|
|
@@ -2303,6 +2392,10 @@ class ConnectorConnectionService {
|
|
|
2303
2392
|
authorizationId: authorization.id
|
|
2304
2393
|
});
|
|
2305
2394
|
}
|
|
2395
|
+
listPendingConnectionRuns(command, connectorId) {
|
|
2396
|
+
this.requireOAuthDefinition(connectorId);
|
|
2397
|
+
return this.runs.listPending(command, connectorId);
|
|
2398
|
+
}
|
|
2306
2399
|
getConnectionRun(command, connectorId, runId) {
|
|
2307
2400
|
this.requireOAuthDefinition(connectorId);
|
|
2308
2401
|
return this.runs.get(command, connectorId, runId);
|
|
@@ -2636,6 +2729,8 @@ class OntologyMaintenance {
|
|
|
2636
2729
|
};
|
|
2637
2730
|
}
|
|
2638
2731
|
runNow() {
|
|
2732
|
+
if (this.stopping)
|
|
2733
|
+
return this.stopping;
|
|
2639
2734
|
this.pass ??= this.runPass().finally(() => {
|
|
2640
2735
|
this.pass = null;
|
|
2641
2736
|
});
|
|
@@ -2729,10 +2824,11 @@ class OntologyMaintenance {
|
|
|
2729
2824
|
this.timer = null;
|
|
2730
2825
|
}
|
|
2731
2826
|
const activePass = this.pass ?? Promise.resolve();
|
|
2732
|
-
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then((settled) => {
|
|
2827
|
+
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then(async (settled) => {
|
|
2733
2828
|
if (!settled) {
|
|
2734
|
-
this.reportError(new Error(`[Sixb] Ontology maintenance
|
|
2829
|
+
this.reportError(new Error(`[Sixb] Ontology maintenance is still stopping after ${this.shutdownTimeoutMs}ms; waiting for active storage operations.`));
|
|
2735
2830
|
}
|
|
2831
|
+
await activePass;
|
|
2736
2832
|
});
|
|
2737
2833
|
this.stopping = stopping.finally(() => {
|
|
2738
2834
|
this.stopping = null;
|
|
@@ -3138,7 +3234,6 @@ class SixbHost2 {
|
|
|
3138
3234
|
});
|
|
3139
3235
|
validateAuthStrategySecurityReferences(this.auth.getStrategy(), definitions.security);
|
|
3140
3236
|
const connectors = definitions.connectors.list();
|
|
3141
|
-
assertConnectorConnectionSurfaces(connectors);
|
|
3142
3237
|
const hasOAuthConnectors = connectors.some(isOAuthConnectorDefinition2);
|
|
3143
3238
|
const credentialProtector = hasOAuthConnectors && options.connectorConnections?.encryptionKey !== undefined ? createConnectorCredentialProtectorFromKey(options.connectorConnections.encryptionKey) : undefined;
|
|
3144
3239
|
this.connectorService = new ConnectorService(this.projectId, connectors, {
|
|
@@ -3275,15 +3370,6 @@ function assertWebhookRunStorage(connectors, storage) {
|
|
|
3275
3370
|
}
|
|
3276
3371
|
}
|
|
3277
3372
|
}
|
|
3278
|
-
function assertConnectorConnectionSurfaces(connectors) {
|
|
3279
|
-
for (const connector of connectors) {
|
|
3280
|
-
if (!isOAuthConnectorDefinition2(connector))
|
|
3281
|
-
continue;
|
|
3282
|
-
if (connector.adapter.webhooks !== undefined) {
|
|
3283
|
-
throw createConnectorCodedError("connector.configuration_invalid", `OAuth connector '${connector.id}' cannot register webhooks until connection routing is defined.`);
|
|
3284
|
-
}
|
|
3285
|
-
}
|
|
3286
|
-
}
|
|
3287
3373
|
|
|
3288
3374
|
// src/runtime/create.ts
|
|
3289
3375
|
async function createSixb2(options) {
|
|
@@ -3330,4 +3416,4 @@ async function createSixb2(options) {
|
|
|
3330
3416
|
}
|
|
3331
3417
|
export { WebhookValidationError2, defineWebhook2, webhookConnector2, UnverifiedWebhookError2, resolveWebhookVerification2, warnUnverifiedWebhook2, SixbHost2, createSixb2 };
|
|
3332
3418
|
|
|
3333
|
-
//# debugId=
|
|
3419
|
+
//# debugId=D39CD002806200FC64756E2164756E21
|