@sixb/core 0.1.10 → 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 +5 -5
- package/dist/agents/index.js +10 -10
- package/dist/blob-storage/types.d.ts +4 -1
- package/dist/blob-storage/types.d.ts.map +1 -1
- package/dist/bootstrap/index.js +14 -14
- package/dist/{chunk-nmbxcaqx.js → chunk-01kj2pbh.js} +1 -1
- package/dist/{chunk-rtk71jzp.js → chunk-1yefycb1.js} +1 -1
- package/dist/chunk-2c4j899j.js.map +1 -1
- package/dist/{chunk-t1f4f1ve.js → chunk-3ckk0xfj.js} +2 -2
- package/dist/{chunk-r7fj830t.js → chunk-4zhmdsx6.js} +48 -15
- package/dist/{chunk-r7fj830t.js.map → chunk-4zhmdsx6.js.map} +6 -6
- package/dist/{chunk-g7knyczr.js → chunk-a0e6x5hd.js} +1 -1
- package/dist/{chunk-5c7ga8zz.js → chunk-cfvakeax.js} +1 -1
- package/dist/chunk-d62kjtbg.js.map +1 -1
- package/dist/{chunk-28ja2cjs.js → chunk-d63nnr5b.js} +2 -2
- package/dist/{chunk-agbbygvh.js → chunk-fh8kgex1.js} +4 -4
- package/dist/{chunk-b0ec55a1.js → chunk-g91qxjj0.js} +1 -1
- package/dist/{chunk-5p1v802y.js → chunk-gq8vhakp.js} +12 -8
- package/dist/{chunk-5p1v802y.js.map → chunk-gq8vhakp.js.map} +4 -4
- package/dist/{chunk-p6a4npdx.js → chunk-gqm76kse.js} +21 -20
- package/dist/{chunk-p6a4npdx.js.map → chunk-gqm76kse.js.map} +4 -4
- package/dist/{chunk-e0d1rzef.js → chunk-jsy70480.js} +16 -3
- package/dist/chunk-jsy70480.js.map +15 -0
- package/dist/{chunk-p5vcsw9c.js → chunk-sepyxgpc.js} +2 -2
- package/dist/{chunk-nt99sxd6.js → chunk-wf88w4kp.js} +16 -22
- package/dist/chunk-wf88w4kp.js.map +14 -0
- package/dist/{chunk-bn138h9w.js → chunk-x9m9x2eq.js} +1 -1
- package/dist/{chunk-qyeptdyv.js → chunk-z0271qkp.js} +3 -1
- package/dist/{chunk-qyeptdyv.js.map → chunk-z0271qkp.js.map} +3 -3
- package/dist/{chunk-976rxdpx.js → chunk-z0s4axeh.js} +4 -4
- 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 +1 -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/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/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/execution/agent.js +10 -10
- package/dist/execution/primitive.js +10 -10
- package/dist/execution/request.js +10 -10
- package/dist/index.js +17 -17
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.js +1 -1
- package/dist/lake-storage/types.d.ts +2 -0
- package/dist/lake-storage/types.d.ts.map +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/materializer/index.js +2 -2
- package/dist/models/definitions.d.ts +7 -0
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/execution/index.js +3 -3
- package/dist/models/index.js +1 -1
- package/dist/objects/index.js +5 -5
- package/dist/objects/query/index.js +3 -3
- package/dist/pipelines/index.js +4 -4
- package/dist/projections/internal.js +2 -2
- package/dist/shares/internal.js +2 -2
- 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 +10 -16
- package/dist/storage/connector-connections/provider.js.map +6 -6
- package/dist/storage/connector-connections/types.d.ts +3 -1
- package/dist/storage/connector-connections/types.d.ts.map +1 -1
- package/dist/storage/index.js +2 -2
- package/dist/storage/ontology/in-memory/shared-state.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/syncs/index.js +4 -4
- package/dist/testing/index.js +58 -30
- package/dist/testing/index.js.map +5 -5
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +2 -2
- package/dist/workflows/index.js +11 -11
- package/package.json +1 -1
- package/src/agents/model-loop.ts +7 -0
- package/src/blob-storage/types.ts +4 -1
- package/src/connectors/connections/command-context.ts +21 -4
- package/src/connectors/connections/contracts.ts +4 -1
- package/src/connectors/connections/execution.ts +3 -0
- package/src/connectors/connections/runs.ts +38 -1
- package/src/connectors/connections/service.ts +6 -0
- package/src/events/outbox-dispatcher.ts +20 -26
- package/src/lake-storage/in-memory.ts +2 -0
- package/src/lake-storage/types.ts +2 -0
- package/src/maintenance/ontology-maintenance.ts +6 -2
- package/src/maintenance/types.ts +1 -1
- package/src/materializer/README.md +1 -1
- package/src/models/definitions.ts +19 -0
- package/src/models/pricing.ts +6 -2
- package/src/storage/connector-connections/in-memory.ts +16 -18
- package/src/storage/connector-connections/provider/connections.ts +1 -15
- package/src/storage/connector-connections/provider/runs.ts +6 -0
- 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 +5 -1
- package/src/storage/ontology/in-memory/shared-state.ts +10 -3
- package/src/storage/ontology/outbox.ts +1 -0
- package/src/testing/connector-connection-storage-contract.ts +11 -11
- package/src/testing/lake-storage-contract.ts +29 -0
- package/src/testing/ontology-storage-contract.ts +8 -3
- package/dist/chunk-e0d1rzef.js.map +0 -15
- package/dist/chunk-nt99sxd6.js.map +0 -14
- /package/dist/{chunk-nmbxcaqx.js.map → chunk-01kj2pbh.js.map} +0 -0
- /package/dist/{chunk-rtk71jzp.js.map → chunk-1yefycb1.js.map} +0 -0
- /package/dist/{chunk-t1f4f1ve.js.map → chunk-3ckk0xfj.js.map} +0 -0
- /package/dist/{chunk-g7knyczr.js.map → chunk-a0e6x5hd.js.map} +0 -0
- /package/dist/{chunk-5c7ga8zz.js.map → chunk-cfvakeax.js.map} +0 -0
- /package/dist/{chunk-28ja2cjs.js.map → chunk-d63nnr5b.js.map} +0 -0
- /package/dist/{chunk-agbbygvh.js.map → chunk-fh8kgex1.js.map} +0 -0
- /package/dist/{chunk-b0ec55a1.js.map → chunk-g91qxjj0.js.map} +0 -0
- /package/dist/{chunk-p5vcsw9c.js.map → chunk-sepyxgpc.js.map} +0 -0
- /package/dist/{chunk-bn138h9w.js.map → chunk-x9m9x2eq.js.map} +0 -0
- /package/dist/{chunk-976rxdpx.js.map → chunk-z0s4axeh.js.map} +0 -0
package/dist/actions/index.js
CHANGED
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
createActionReadFacade2,
|
|
10
10
|
ActionRegistry2,
|
|
11
11
|
runActionValidators2
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-sepyxgpc.js";
|
|
13
13
|
import {
|
|
14
14
|
requestAction3,
|
|
15
15
|
requestActionAndWait2,
|
|
16
16
|
waitForActionRun2
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import"../chunk-
|
|
17
|
+
} from "../chunk-01kj2pbh.js";
|
|
18
|
+
import"../chunk-a0e6x5hd.js";
|
|
19
19
|
import"../chunk-ftv470j8.js";
|
|
20
20
|
import"../chunk-17kfctj6.js";
|
|
21
|
-
import"../chunk-
|
|
21
|
+
import"../chunk-gqm76kse.js";
|
|
22
22
|
import"../chunk-qf954wje.js";
|
|
23
23
|
import"../chunk-pr2h4bv4.js";
|
|
24
24
|
import"../chunk-8vj0rjgs.js";
|
|
@@ -36,7 +36,7 @@ import"../chunk-s3csryxe.js";
|
|
|
36
36
|
import"../chunk-jgwb25gc.js";
|
|
37
37
|
import"../chunk-93csa55g.js";
|
|
38
38
|
import"../chunk-b19g04jk.js";
|
|
39
|
-
import"../chunk-
|
|
39
|
+
import"../chunk-jsy70480.js";
|
|
40
40
|
import"../chunk-pqajwytd.js";
|
|
41
41
|
import"../chunk-ap0g1g74.js";
|
|
42
42
|
import"../chunk-653vwrzr.js";
|
package/dist/agents/index.js
CHANGED
|
@@ -39,28 +39,28 @@ import {
|
|
|
39
39
|
runModelLoop2,
|
|
40
40
|
requestAgentRun2,
|
|
41
41
|
retryAgentRun2
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import"../chunk-
|
|
42
|
+
} from "../chunk-gq8vhakp.js";
|
|
43
|
+
import"../chunk-cfvakeax.js";
|
|
44
44
|
import"../chunk-v2vcg0w6.js";
|
|
45
45
|
import"../chunk-awbhdqyc.js";
|
|
46
|
-
import"../chunk-
|
|
46
|
+
import"../chunk-z0s4axeh.js";
|
|
47
47
|
import"../chunk-85cd7e8c.js";
|
|
48
|
-
import"../chunk-
|
|
49
|
-
import"../chunk-
|
|
48
|
+
import"../chunk-g91qxjj0.js";
|
|
49
|
+
import"../chunk-d63nnr5b.js";
|
|
50
50
|
import"../chunk-g6cke204.js";
|
|
51
51
|
import"../chunk-0y39rgsb.js";
|
|
52
52
|
import"../chunk-5a4a52tq.js";
|
|
53
53
|
import"../chunk-mrp7k0pw.js";
|
|
54
54
|
import"../chunk-9qsh3p5y.js";
|
|
55
55
|
import"../chunk-860dwwy0.js";
|
|
56
|
-
import"../chunk-
|
|
57
|
-
import"../chunk-
|
|
58
|
-
import"../chunk-
|
|
56
|
+
import"../chunk-sepyxgpc.js";
|
|
57
|
+
import"../chunk-01kj2pbh.js";
|
|
58
|
+
import"../chunk-a0e6x5hd.js";
|
|
59
59
|
import"../chunk-ftv470j8.js";
|
|
60
60
|
import"../chunk-17kfctj6.js";
|
|
61
61
|
import {
|
|
62
62
|
AGENT_MESSAGE_CONTENT_VERSION2
|
|
63
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-gqm76kse.js";
|
|
64
64
|
import"../chunk-qf954wje.js";
|
|
65
65
|
import {
|
|
66
66
|
ensureManagedAgentExecutionIdentity2,
|
|
@@ -84,7 +84,7 @@ import"../chunk-s3csryxe.js";
|
|
|
84
84
|
import"../chunk-jgwb25gc.js";
|
|
85
85
|
import"../chunk-93csa55g.js";
|
|
86
86
|
import"../chunk-b19g04jk.js";
|
|
87
|
-
import"../chunk-
|
|
87
|
+
import"../chunk-jsy70480.js";
|
|
88
88
|
import"../chunk-pqajwytd.js";
|
|
89
89
|
import"../chunk-ap0g1g74.js";
|
|
90
90
|
import"../chunk-653vwrzr.js";
|
|
@@ -76,6 +76,8 @@ export interface DirectPutBlobUploadSession {
|
|
|
76
76
|
}
|
|
77
77
|
export interface MultipartBlobUploadSession {
|
|
78
78
|
readonly strategy: "multipart";
|
|
79
|
+
/** Required upload-response receipt. Omission defaults to "etag" for compatibility. */
|
|
80
|
+
readonly partReceipt?: "etag" | "none";
|
|
79
81
|
readonly uploadId: string;
|
|
80
82
|
readonly partSizeBytes: number;
|
|
81
83
|
readonly expiresAt: Date;
|
|
@@ -99,7 +101,8 @@ export interface SignedBlobUploadPart {
|
|
|
99
101
|
}
|
|
100
102
|
export interface BlobUploadPart {
|
|
101
103
|
readonly partNumber: number;
|
|
102
|
-
|
|
104
|
+
/** Required when the multipart session's partReceipt is "etag" or omitted. */
|
|
105
|
+
readonly etag?: string;
|
|
103
106
|
}
|
|
104
107
|
export interface CompleteBlobUploadInput {
|
|
105
108
|
readonly uploadId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/blob-storage/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,UAAU,MAAM,EAAE,CAAA;AAE3C;;;;;;;;GAQG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAEnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,6EAA6E;IAC7E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED;;;GA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AAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,CAAA;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACtE,cAAc,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAC7E,cAAc,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAChE,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACxD"}
|
package/dist/bootstrap/index.js
CHANGED
|
@@ -6,37 +6,37 @@ import {
|
|
|
6
6
|
discoverProjectDefinitions2,
|
|
7
7
|
discoverOntologyTypeManifest2,
|
|
8
8
|
generateOntologyTypeManifest2
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import"../chunk-
|
|
11
|
-
import"../chunk-
|
|
9
|
+
} from "../chunk-fh8kgex1.js";
|
|
10
|
+
import"../chunk-x9m9x2eq.js";
|
|
11
|
+
import"../chunk-3ckk0xfj.js";
|
|
12
12
|
import"../chunk-x9v4cx1d.js";
|
|
13
|
-
import"../chunk-
|
|
13
|
+
import"../chunk-1yefycb1.js";
|
|
14
14
|
import"../chunk-e1c18xjx.js";
|
|
15
15
|
import"../chunk-fb3feg1e.js";
|
|
16
16
|
import"../chunk-dfm066qg.js";
|
|
17
17
|
import"../chunk-r2y23egw.js";
|
|
18
18
|
import"../chunk-skz0hst3.js";
|
|
19
19
|
import"../chunk-9vx5e9g1.js";
|
|
20
|
-
import"../chunk-
|
|
21
|
-
import"../chunk-
|
|
20
|
+
import"../chunk-gq8vhakp.js";
|
|
21
|
+
import"../chunk-cfvakeax.js";
|
|
22
22
|
import"../chunk-v2vcg0w6.js";
|
|
23
23
|
import"../chunk-awbhdqyc.js";
|
|
24
|
-
import"../chunk-
|
|
24
|
+
import"../chunk-z0s4axeh.js";
|
|
25
25
|
import"../chunk-85cd7e8c.js";
|
|
26
|
-
import"../chunk-
|
|
27
|
-
import"../chunk-
|
|
26
|
+
import"../chunk-g91qxjj0.js";
|
|
27
|
+
import"../chunk-d63nnr5b.js";
|
|
28
28
|
import"../chunk-g6cke204.js";
|
|
29
29
|
import"../chunk-0y39rgsb.js";
|
|
30
30
|
import"../chunk-5a4a52tq.js";
|
|
31
31
|
import"../chunk-mrp7k0pw.js";
|
|
32
32
|
import"../chunk-9qsh3p5y.js";
|
|
33
33
|
import"../chunk-860dwwy0.js";
|
|
34
|
-
import"../chunk-
|
|
35
|
-
import"../chunk-
|
|
36
|
-
import"../chunk-
|
|
34
|
+
import"../chunk-sepyxgpc.js";
|
|
35
|
+
import"../chunk-01kj2pbh.js";
|
|
36
|
+
import"../chunk-a0e6x5hd.js";
|
|
37
37
|
import"../chunk-ftv470j8.js";
|
|
38
38
|
import"../chunk-17kfctj6.js";
|
|
39
|
-
import"../chunk-
|
|
39
|
+
import"../chunk-gqm76kse.js";
|
|
40
40
|
import"../chunk-qf954wje.js";
|
|
41
41
|
import"../chunk-pr2h4bv4.js";
|
|
42
42
|
import"../chunk-8vj0rjgs.js";
|
|
@@ -54,7 +54,7 @@ import"../chunk-s3csryxe.js";
|
|
|
54
54
|
import"../chunk-jgwb25gc.js";
|
|
55
55
|
import"../chunk-93csa55g.js";
|
|
56
56
|
import"../chunk-b19g04jk.js";
|
|
57
|
-
import"../chunk-
|
|
57
|
+
import"../chunk-jsy70480.js";
|
|
58
58
|
import"../chunk-pqajwytd.js";
|
|
59
59
|
import"../chunk-ap0g1g74.js";
|
|
60
60
|
import"../chunk-653vwrzr.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sources": ["../src/storage/connector-connections/errors.ts", "../src/storage/connector-connections/types.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"export type ConnectorConnectionStorageErrorCode =\n | \"attempt_conflict\"\n | \"attempt_invalid\"\n | \"run_conflict\"\n | \"run_invalid\"\n | \"authorization_conflict\"\n | \"connection_conflict\"\n | \"invalid_input\"\n\n/**\n * Storage-provider control signal for atomic conflicts and invalid calls.\n *\n * These codes belong to the provider contract, not `SixbErrorCode`; Core translates errors that\n * cross the connector lifecycle boundary into documented `connector.*` failures.\n */\nexport class ConnectorConnectionStorageError extends Error {\n readonly code: ConnectorConnectionStorageErrorCode\n\n constructor(code: ConnectorConnectionStorageErrorCode, message: string) {\n super(message)\n this.name = \"ConnectorConnectionStorageError\"\n this.code = code\n }\n}\n",
|
|
6
|
-
"import type { ConnectorAccountCandidate, ConnectorConnectionSelector } from \"../../connectors\"\nimport type { SealedConnectorCredential } from \"../../connectors/credentials\"\nimport type { SixbErrorCode, SixbFailure } from \"../../errors/types\"\nimport type { AuthorizablePrincipal } from \"../../execution\"\n\nexport type {\n ConnectorConnectionOwner,\n ConnectorConnectionSelector,\n ProjectConnectorConnectionOwner,\n} from \"../../connectors\"\n\nexport const CONNECTOR_CONNECTION_RUN_FAILURE_CODES = [\n \"internal.unexpected\",\n \"connector.adapter_invalid\",\n \"connector.authorization_invalid\",\n \"connector.authorization_required\",\n \"connector.credentials_unavailable\",\n \"connector.not_found\",\n \"connector.operation_conflict\",\n \"connector.operation_in_progress\",\n \"connector.provider_failed\",\n \"connector.provider_unavailable\",\n] as const satisfies readonly [SixbErrorCode, ...SixbErrorCode[]]\n\nexport type ConnectorConnectionRunFailureCode =\n (typeof CONNECTOR_CONNECTION_RUN_FAILURE_CODES)[number]\nexport type ConnectorConnectionRunFailure = SixbFailure<ConnectorConnectionRunFailureCode>\nexport type ConnectorConnectionRunKind = \"connect\" | \"reauthorize\"\n\ninterface ConnectorConnectionRunBase extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly kind: ConnectorConnectionRunKind\n /** Durable request execution that initiated and is allowed to manage this run. */\n readonly initiatedByExecutionId: string\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface ConnectorConnectionRunAwaitingProviderRecord extends ConnectorConnectionRunBase {\n readonly status: \"waiting\"\n readonly waitingFor: \"provider_authorization\"\n readonly expiresAt: Date\n}\n\nexport interface ConnectorConnectionRunProcessingRecord extends ConnectorConnectionRunBase {\n readonly status: \"running\"\n /** Fences every callback-side write after the one-shot OAuth attempt was consumed. */\n readonly processingId: string\n readonly callbackStartedAt: Date\n readonly expiresAt: Date\n /** Internal grant handle, attached as soon as a new authorization is durably persisted. */\n readonly authorizationId?: string\n}\n\nexport interface ConnectorConnectionRunAwaitingSelectionRecord extends ConnectorConnectionRunBase {\n readonly status: \"waiting\"\n readonly waitingFor: \"account_selection\"\n readonly authorizationId: string\n readonly expiresAt: Date\n}\n\nexport interface ConnectorConnectionRunSucceededRecord extends ConnectorConnectionRunBase {\n readonly status: \"succeeded\"\n readonly authorizationId: string\n /** Internal handle for a replaced grant whose provider cleanup is still retryable. */\n readonly cleanupAuthorizationId?: string\n readonly connections: readonly ConnectorConnectionRecord[]\n readonly finishedAt: Date\n}\n\nexport interface ConnectorConnectionRunFailedRecord extends ConnectorConnectionRunBase {\n readonly status: \"failed\"\n readonly error: ConnectorConnectionRunFailure\n /** Internal cleanup handle; never serialized by the Headless API. */\n readonly authorizationId?: string\n readonly finishedAt: Date\n}\n\nexport interface ConnectorConnectionRunCancelledRecord extends ConnectorConnectionRunBase {\n readonly status: \"cancelled\"\n readonly authorizationId?: string\n readonly finishedAt: Date\n}\n\nexport interface ConnectorConnectionRunExpiredRecord extends ConnectorConnectionRunBase {\n readonly status: \"expired\"\n readonly authorizationId?: string\n readonly finishedAt: Date\n}\n\nexport type ConnectorConnectionRunRecord =\n | ConnectorConnectionRunAwaitingProviderRecord\n | ConnectorConnectionRunProcessingRecord\n | ConnectorConnectionRunAwaitingSelectionRecord\n | ConnectorConnectionRunSucceededRecord\n | ConnectorConnectionRunFailedRecord\n | ConnectorConnectionRunCancelledRecord\n | ConnectorConnectionRunExpiredRecord\n\nexport interface CreateConnectorConnectionRunInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly kind: ConnectorConnectionRunKind\n readonly initiatedByExecutionId: string\n readonly ttlMs: number\n}\n\nexport interface CreateConnectorConnectionSelectionRunInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly initiatedByExecutionId: string\n readonly authorizationId: string\n readonly ttlMs: number\n}\n\nexport interface ClaimConnectorConnectionRunCallbackInput {\n readonly projectId: string\n readonly attemptId: string\n readonly stateHash: string\n readonly callbackBindingHash: string\n readonly redirectUri: string\n readonly processingId: string\n readonly processingTtlMs: number\n}\n\nexport type ClaimConnectorConnectionRunCallbackResult =\n | {\n readonly type: \"claimed\"\n readonly run: ConnectorConnectionRunProcessingRecord\n readonly attempt: ConnectorAuthorizationAttemptRecord\n readonly returnTo: string\n }\n | {\n readonly type: \"expired\"\n readonly run: ConnectorConnectionRunExpiredRecord\n readonly returnTo: string\n }\n\nexport interface WaitForConnectorConnectionRunSelectionInput {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly authorizationId: string\n readonly expiresAt: Date\n}\n\nexport interface AttachConnectorConnectionRunAuthorizationInput {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly authorizationId: string\n}\n\nexport type FinishConnectorConnectionRunInput =\n | {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly status: \"succeeded\"\n readonly authorizationId: string\n readonly cleanupAuthorizationId?: string\n readonly connections: readonly ConnectorConnectionRecord[]\n }\n | {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly status: \"failed\"\n readonly error: ConnectorConnectionRunFailure\n readonly authorizationId?: string\n }\n | {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly status: \"cancelled\"\n }\n\nexport interface GetConnectorConnectionRunInput {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n}\n\nexport interface ConnectorAuthorizationAttemptRecord extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n /** Durable execution that initiated and authorizes completion of this OAuth attempt. */\n readonly initiatedByExecutionId: string\n readonly stateHash: string\n /** Absent when the authorization attempt explicitly disabled PKCE. */\n readonly codeVerifier?: SealedConnectorCredential\n readonly redirectUri: string\n /** Present only for attempts created by the headless connection-run API. */\n readonly connectionRunId?: string\n /** Fixed, allowlisted continuation consumed with a headless callback. */\n readonly returnTo?: string\n /** Hash of the one-shot browser callback binding secret. */\n readonly callbackBindingHash?: string\n readonly reauthorizationId?: string\n readonly reauthorizationRevision?: number\n readonly reauthorizationConnectionIds?: readonly string[]\n readonly createdAt: Date\n readonly expiresAt: Date\n}\n\nexport interface CreateConnectorAuthorizationAttemptInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly initiatedByExecutionId: string\n readonly stateHash: string\n readonly codeVerifier?: SealedConnectorCredential\n readonly redirectUri: string\n readonly connectionRunId?: string\n readonly returnTo?: string\n readonly callbackBindingHash?: string\n readonly reauthorizationId?: string\n readonly reauthorizationRevision?: number\n readonly reauthorizationConnectionIds?: readonly string[]\n readonly ttlMs: number\n}\n\n/** Callback proof. The orchestration layer authorizes the returned initiating execution. */\nexport interface ConsumeConnectorAuthorizationAttemptInput {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly stateHash: string\n readonly redirectUri: string\n}\n\nexport type ConnectorAuthorizationStatus =\n | \"pending_selection\"\n | \"active\"\n | \"needs_reauthorization\"\n | \"revocation_pending\"\n | \"revoked\"\n\nexport type ConnectorCredentialMutationKind = \"refresh\" | \"reauthorization\" | \"revocation\"\nexport type ConnectorCredentialMutationPhase = \"prepared\" | \"executing\" | \"result_staged\"\n\nexport interface ConnectorStagedCredentials {\n readonly credentials: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n}\n\n/** Durable fencing record for one provider-side OAuth credential mutation. */\nexport interface ConnectorCredentialMutation {\n readonly id: string\n readonly kind: ConnectorCredentialMutationKind\n readonly phase: ConnectorCredentialMutationPhase\n readonly holderId: string\n readonly expiresAt: Date\n readonly deadlineAt: Date\n readonly expectedConnectionIds?: readonly string[]\n readonly stagedCredentials?: ConnectorStagedCredentials\n}\n\nexport interface ConnectorAuthorizationRecord {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizedBy: AuthorizablePrincipal\n /** Removed after provider revocation is confirmed. */\n readonly credentials?: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n readonly accounts: readonly ConnectorAccountCandidate[]\n readonly status: ConnectorAuthorizationStatus\n /** Storage-authoritative deadline for the first account selection. */\n readonly selectionExpiresAt?: Date\n readonly revision: number\n readonly credentialMutation?: ConnectorCredentialMutation\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface CreateConnectorAuthorizationInput {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizedBy: AuthorizablePrincipal\n readonly credentials: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n readonly accounts: readonly ConnectorAccountCandidate[]\n readonly selectionTtlMs: number\n}\n\nexport interface InitializeConnectorAuthorizationAccountsInput {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly expectedRevision: number\n readonly accounts: readonly ConnectorAccountCandidate[]\n}\n\nexport interface ClaimConnectorCredentialMutationInput {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly expectedRevision: number\n readonly mutation: {\n readonly id: string\n readonly kind: ConnectorCredentialMutationKind\n readonly holderId: string\n }\n readonly expectedConnectionIds?: readonly string[]\n readonly leaseDurationMs: number\n readonly operationTimeoutMs: number\n}\n\nexport interface ClaimConnectorCredentialMutationResult {\n readonly authorization: ConnectorAuthorizationRecord\n readonly disconnected: readonly ConnectorConnectionRecord[]\n}\n\nexport interface ConnectorCredentialMutationFence {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly expectedRevision: number\n readonly mutationId: string\n}\n\nexport interface MarkConnectorCredentialMutationExecutingInput\n extends ConnectorCredentialMutationFence {\n readonly holderId: string\n}\n\nexport interface RenewConnectorCredentialMutationInput extends ConnectorCredentialMutationFence {\n readonly holderId: string\n readonly leaseDurationMs: number\n}\n\nexport interface StageConnectorCredentialMutationCredentialsInput\n extends ConnectorCredentialMutationFence {\n readonly holderId: string\n readonly credentials: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n}\n\nexport interface StageConnectorCredentialMutationRevocationInput\n extends ConnectorCredentialMutationFence {\n readonly holderId: string\n}\n\nexport interface ReleaseConnectorCredentialMutationInput extends ConnectorCredentialMutationFence {\n readonly holderId: string\n}\n\nexport interface RecoverExpiredConnectorCredentialMutationInput {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n}\n\nexport interface MarkConnectorAuthorizationNeedsReauthorizationInput\n extends ConnectorCredentialMutationFence {}\n\nexport interface FinalizeConnectorReauthorizationInput extends ConnectorCredentialMutationFence {\n readonly accounts: readonly ConnectorAccountCandidate[]\n}\n\nexport type ConnectorConnectionStatus = \"connected\" | \"disconnected\"\n\nexport interface ConnectorConnectionRecord extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly account: ConnectorAccountCandidate\n readonly status: ConnectorConnectionStatus\n readonly disconnectedAt?: Date\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface PutConnectorConnectionInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly account: ConnectorAccountCandidate\n readonly replace: boolean\n}\n\nexport interface PutConnectorConnectionResult {\n readonly connection: ConnectorConnectionRecord\n readonly authorization: ConnectorAuthorizationRecord\n readonly revocationPendingAuthorizationId?: string\n readonly created: boolean\n readonly replaced: boolean\n}\n\nexport interface DisconnectConnectorConnectionResult {\n readonly connection: ConnectorConnectionRecord\n readonly authorization: ConnectorAuthorizationRecord\n readonly revocationPendingAuthorizationId?: string\n}\n\nexport interface PutConnectorConnectionFromRunInput {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly account: ConnectorAccountCandidate\n readonly replace: boolean\n}\n\nexport interface PutConnectorConnectionFromRunResult extends PutConnectorConnectionResult {\n readonly run: ConnectorConnectionRunSucceededRecord\n}\n\nexport interface GetConnectorConnectionInput extends ConnectorConnectionSelector {\n readonly projectId: string\n readonly connectorId: string\n}\n\nexport interface ListConnectorConnectionsInput {\n readonly projectId: string\n readonly connectorId: string\n}\n\n/** Tenant-scoped identity for one connector authorization. */\nexport interface ConnectorAuthorizationKey {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n}\n\n/** Tenant-scoped identity for one selected connector connection. */\nexport interface ConnectorConnectionKey {\n readonly projectId: string\n readonly connectorId: string\n readonly connectionId: string\n}\n\n/** Persistent contract. Implementations must make every individual mutation atomic. */\nexport interface ConnectorConnectionStorage {\n readonly durability: \"ephemeral\" | \"durable\"\n\n createAuthorizationAttempt(\n input: CreateConnectorAuthorizationAttemptInput\n ): Promise<ConnectorAuthorizationAttemptRecord>\n consumeAuthorizationAttempt(\n input: ConsumeConnectorAuthorizationAttemptInput\n ): Promise<ConnectorAuthorizationAttemptRecord>\n\n createConnectionRun(\n input: CreateConnectorConnectionRunInput\n ): Promise<ConnectorConnectionRunRecord>\n createConnectionSelectionRun(\n input: CreateConnectorConnectionSelectionRunInput\n ): Promise<ConnectorConnectionRunAwaitingSelectionRecord>\n claimConnectionRunCallback(\n input: ClaimConnectorConnectionRunCallbackInput\n ): Promise<ClaimConnectorConnectionRunCallbackResult | null>\n attachConnectionRunAuthorization(\n input: AttachConnectorConnectionRunAuthorizationInput\n ): Promise<ConnectorConnectionRunProcessingRecord | null>\n waitForConnectionRunSelection(\n input: WaitForConnectorConnectionRunSelectionInput\n ): Promise<ConnectorConnectionRunAwaitingSelectionRecord | null>\n finishConnectionRun(\n input: FinishConnectorConnectionRunInput\n ): Promise<ConnectorConnectionRunRecord | null>\n getConnectionRun(\n input: GetConnectorConnectionRunInput\n ): Promise<ConnectorConnectionRunRecord | null>\n\n createAuthorization(\n input: CreateConnectorAuthorizationInput\n ): Promise<ConnectorAuthorizationRecord>\n initializeAuthorizationAccounts(\n input: InitializeConnectorAuthorizationAccountsInput\n ): Promise<ConnectorAuthorizationRecord | null>\n getAuthorization(input: ConnectorAuthorizationKey): Promise<ConnectorAuthorizationRecord | null>\n getAuthorizationByConnectionId(\n input: ConnectorConnectionKey\n ): Promise<ConnectorAuthorizationRecord | null>\n claimCredentialMutation(\n input: ClaimConnectorCredentialMutationInput\n ): Promise<ClaimConnectorCredentialMutationResult | null>\n markCredentialMutationExecuting(\n input: MarkConnectorCredentialMutationExecutingInput\n ): Promise<ConnectorAuthorizationRecord | null>\n renewCredentialMutation(\n input: RenewConnectorCredentialMutationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n stageCredentialMutationCredentials(\n input: StageConnectorCredentialMutationCredentialsInput\n ): Promise<ConnectorAuthorizationRecord | null>\n stageCredentialMutationRevocation(\n input: StageConnectorCredentialMutationRevocationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n releaseCredentialMutation(input: ReleaseConnectorCredentialMutationInput): Promise<boolean>\n /**\n * Recovers an expired mutation without replaying an unknown provider effect. Prepared work is\n * released, executing refresh/reauthorization fails closed, revocation stays retryable, and a\n * staged result remains available for finalization.\n */\n recoverExpiredCredentialMutation(\n input: RecoverExpiredConnectorCredentialMutationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n markNeedsReauthorization(\n input: MarkConnectorAuthorizationNeedsReauthorizationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n finalizeRefresh(\n input: ConnectorCredentialMutationFence\n ): Promise<ConnectorAuthorizationRecord | null>\n finalizeReauthorization(\n input: FinalizeConnectorReauthorizationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n finalizeRevocation(\n input: ConnectorCredentialMutationFence\n ): Promise<ConnectorAuthorizationRecord | null>\n\n putConnection(input: PutConnectorConnectionInput): Promise<PutConnectorConnectionResult>\n putConnectionFromRun(\n input: PutConnectorConnectionFromRunInput\n ): Promise<PutConnectorConnectionFromRunResult>\n getConnection(input: GetConnectorConnectionInput): Promise<ConnectorConnectionRecord | null>\n getConnectionById(input: ConnectorConnectionKey): Promise<ConnectorConnectionRecord | null>\n listConnections(\n input: ListConnectorConnectionsInput\n ): Promise<readonly ConnectorConnectionRecord[]>\n listConnectionsByAuthorization(\n input: ConnectorAuthorizationKey\n ): Promise<readonly ConnectorConnectionRecord[]>\n disconnectConnection(\n input: ConnectorConnectionKey\n ): Promise<DisconnectConnectorConnectionResult | null>\n}\n"
|
|
6
|
+
"import type { ConnectorAccountCandidate, ConnectorConnectionSelector } from \"../../connectors\"\nimport type { SealedConnectorCredential } from \"../../connectors/credentials\"\nimport type { SixbErrorCode, SixbFailure } from \"../../errors/types\"\nimport type { AuthorizablePrincipal } from \"../../execution\"\n\nexport type {\n ConnectorConnectionOwner,\n ConnectorConnectionSelector,\n ProjectConnectorConnectionOwner,\n} from \"../../connectors\"\n\nexport const CONNECTOR_CONNECTION_RUN_FAILURE_CODES = [\n \"internal.unexpected\",\n \"connector.adapter_invalid\",\n \"connector.authorization_invalid\",\n \"connector.authorization_required\",\n \"connector.credentials_unavailable\",\n \"connector.not_found\",\n \"connector.operation_conflict\",\n \"connector.operation_in_progress\",\n \"connector.provider_failed\",\n \"connector.provider_unavailable\",\n] as const satisfies readonly [SixbErrorCode, ...SixbErrorCode[]]\n\nexport type ConnectorConnectionRunFailureCode =\n (typeof CONNECTOR_CONNECTION_RUN_FAILURE_CODES)[number]\nexport type ConnectorConnectionRunFailure = SixbFailure<ConnectorConnectionRunFailureCode>\nexport type ConnectorConnectionRunKind = \"connect\" | \"reauthorize\"\n\ninterface ConnectorConnectionRunBase extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly kind: ConnectorConnectionRunKind\n /** Durable request execution that initiated and is allowed to manage this run. */\n readonly initiatedByExecutionId: string\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface ConnectorConnectionRunAwaitingProviderRecord extends ConnectorConnectionRunBase {\n readonly status: \"waiting\"\n readonly waitingFor: \"provider_authorization\"\n readonly expiresAt: Date\n}\n\nexport interface ConnectorConnectionRunProcessingRecord extends ConnectorConnectionRunBase {\n readonly status: \"running\"\n /** Fences every callback-side write after the one-shot OAuth attempt was consumed. */\n readonly processingId: string\n readonly callbackStartedAt: Date\n readonly expiresAt: Date\n /** Internal grant handle, attached as soon as a new authorization is durably persisted. */\n readonly authorizationId?: string\n}\n\nexport interface ConnectorConnectionRunAwaitingSelectionRecord extends ConnectorConnectionRunBase {\n readonly status: \"waiting\"\n readonly waitingFor: \"account_selection\"\n readonly authorizationId: string\n /** Legacy persistence field; account selection no longer expires. */\n readonly expiresAt: Date\n}\n\nexport interface ConnectorConnectionRunSucceededRecord extends ConnectorConnectionRunBase {\n readonly status: \"succeeded\"\n readonly authorizationId: string\n /** Internal handle for a replaced grant whose provider cleanup is still retryable. */\n readonly cleanupAuthorizationId?: string\n readonly connections: readonly ConnectorConnectionRecord[]\n readonly finishedAt: Date\n}\n\nexport interface ConnectorConnectionRunFailedRecord extends ConnectorConnectionRunBase {\n readonly status: \"failed\"\n readonly error: ConnectorConnectionRunFailure\n /** Internal cleanup handle; never serialized by the Headless API. */\n readonly authorizationId?: string\n readonly finishedAt: Date\n}\n\nexport interface ConnectorConnectionRunCancelledRecord extends ConnectorConnectionRunBase {\n readonly status: \"cancelled\"\n readonly authorizationId?: string\n readonly finishedAt: Date\n}\n\nexport interface ConnectorConnectionRunExpiredRecord extends ConnectorConnectionRunBase {\n readonly status: \"expired\"\n readonly authorizationId?: string\n readonly finishedAt: Date\n}\n\nexport type ConnectorConnectionRunRecord =\n | ConnectorConnectionRunAwaitingProviderRecord\n | ConnectorConnectionRunProcessingRecord\n | ConnectorConnectionRunAwaitingSelectionRecord\n | ConnectorConnectionRunSucceededRecord\n | ConnectorConnectionRunFailedRecord\n | ConnectorConnectionRunCancelledRecord\n | ConnectorConnectionRunExpiredRecord\n\nexport interface CreateConnectorConnectionRunInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly kind: ConnectorConnectionRunKind\n readonly initiatedByExecutionId: string\n readonly ttlMs: number\n}\n\nexport interface CreateConnectorConnectionSelectionRunInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly initiatedByExecutionId: string\n readonly authorizationId: string\n readonly ttlMs: number\n}\n\nexport interface ClaimConnectorConnectionRunCallbackInput {\n readonly projectId: string\n readonly attemptId: string\n readonly stateHash: string\n readonly callbackBindingHash: string\n readonly redirectUri: string\n readonly processingId: string\n readonly processingTtlMs: number\n}\n\nexport type ClaimConnectorConnectionRunCallbackResult =\n | {\n readonly type: \"claimed\"\n readonly run: ConnectorConnectionRunProcessingRecord\n readonly attempt: ConnectorAuthorizationAttemptRecord\n readonly returnTo: string\n }\n | {\n readonly type: \"expired\"\n readonly run: ConnectorConnectionRunExpiredRecord\n readonly returnTo: string\n }\n\nexport interface WaitForConnectorConnectionRunSelectionInput {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly authorizationId: string\n readonly expiresAt: Date\n}\n\nexport interface AttachConnectorConnectionRunAuthorizationInput {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly authorizationId: string\n}\n\nexport type FinishConnectorConnectionRunInput =\n | {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly status: \"succeeded\"\n readonly authorizationId: string\n readonly cleanupAuthorizationId?: string\n readonly connections: readonly ConnectorConnectionRecord[]\n }\n | {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly status: \"failed\"\n readonly error: ConnectorConnectionRunFailure\n readonly authorizationId?: string\n }\n | {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly processingId: string\n readonly status: \"cancelled\"\n }\n\nexport interface GetConnectorConnectionRunInput {\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n}\n\nexport interface ConnectorAuthorizationAttemptRecord extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n /** Durable execution that initiated and authorizes completion of this OAuth attempt. */\n readonly initiatedByExecutionId: string\n readonly stateHash: string\n /** Absent when the authorization attempt explicitly disabled PKCE. */\n readonly codeVerifier?: SealedConnectorCredential\n readonly redirectUri: string\n /** Present only for attempts created by the headless connection-run API. */\n readonly connectionRunId?: string\n /** Fixed, allowlisted continuation consumed with a headless callback. */\n readonly returnTo?: string\n /** Hash of the one-shot browser callback binding secret. */\n readonly callbackBindingHash?: string\n readonly reauthorizationId?: string\n readonly reauthorizationRevision?: number\n readonly reauthorizationConnectionIds?: readonly string[]\n readonly createdAt: Date\n readonly expiresAt: Date\n}\n\nexport interface CreateConnectorAuthorizationAttemptInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly initiatedByExecutionId: string\n readonly stateHash: string\n readonly codeVerifier?: SealedConnectorCredential\n readonly redirectUri: string\n readonly connectionRunId?: string\n readonly returnTo?: string\n readonly callbackBindingHash?: string\n readonly reauthorizationId?: string\n readonly reauthorizationRevision?: number\n readonly reauthorizationConnectionIds?: readonly string[]\n readonly ttlMs: number\n}\n\n/** Callback proof. The orchestration layer authorizes the returned initiating execution. */\nexport interface ConsumeConnectorAuthorizationAttemptInput {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly stateHash: string\n readonly redirectUri: string\n}\n\nexport type ConnectorAuthorizationStatus =\n | \"pending_selection\"\n | \"active\"\n | \"needs_reauthorization\"\n | \"revocation_pending\"\n | \"revoked\"\n\nexport type ConnectorCredentialMutationKind = \"refresh\" | \"reauthorization\" | \"revocation\"\nexport type ConnectorCredentialMutationPhase = \"prepared\" | \"executing\" | \"result_staged\"\n\nexport interface ConnectorStagedCredentials {\n readonly credentials: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n}\n\n/** Durable fencing record for one provider-side OAuth credential mutation. */\nexport interface ConnectorCredentialMutation {\n readonly id: string\n readonly kind: ConnectorCredentialMutationKind\n readonly phase: ConnectorCredentialMutationPhase\n readonly holderId: string\n readonly expiresAt: Date\n readonly deadlineAt: Date\n readonly expectedConnectionIds?: readonly string[]\n readonly stagedCredentials?: ConnectorStagedCredentials\n}\n\nexport interface ConnectorAuthorizationRecord {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizedBy: AuthorizablePrincipal\n /** Removed after provider revocation is confirmed. */\n readonly credentials?: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n readonly accounts: readonly ConnectorAccountCandidate[]\n readonly status: ConnectorAuthorizationStatus\n /** Legacy persistence field; no longer enforced as a selection deadline. */\n readonly selectionExpiresAt?: Date\n readonly revision: number\n readonly credentialMutation?: ConnectorCredentialMutation\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface CreateConnectorAuthorizationInput {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizedBy: AuthorizablePrincipal\n readonly credentials: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n readonly accounts: readonly ConnectorAccountCandidate[]\n readonly selectionTtlMs: number\n}\n\nexport interface InitializeConnectorAuthorizationAccountsInput {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly expectedRevision: number\n readonly accounts: readonly ConnectorAccountCandidate[]\n}\n\nexport interface ClaimConnectorCredentialMutationInput {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly expectedRevision: number\n readonly mutation: {\n readonly id: string\n readonly kind: ConnectorCredentialMutationKind\n readonly holderId: string\n }\n readonly expectedConnectionIds?: readonly string[]\n readonly leaseDurationMs: number\n readonly operationTimeoutMs: number\n}\n\nexport interface ClaimConnectorCredentialMutationResult {\n readonly authorization: ConnectorAuthorizationRecord\n readonly disconnected: readonly ConnectorConnectionRecord[]\n}\n\nexport interface ConnectorCredentialMutationFence {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly expectedRevision: number\n readonly mutationId: string\n}\n\nexport interface MarkConnectorCredentialMutationExecutingInput\n extends ConnectorCredentialMutationFence {\n readonly holderId: string\n}\n\nexport interface RenewConnectorCredentialMutationInput extends ConnectorCredentialMutationFence {\n readonly holderId: string\n readonly leaseDurationMs: number\n}\n\nexport interface StageConnectorCredentialMutationCredentialsInput\n extends ConnectorCredentialMutationFence {\n readonly holderId: string\n readonly credentials: SealedConnectorCredential\n readonly credentialExpiresAt?: Date\n readonly scopes: readonly string[]\n}\n\nexport interface StageConnectorCredentialMutationRevocationInput\n extends ConnectorCredentialMutationFence {\n readonly holderId: string\n}\n\nexport interface ReleaseConnectorCredentialMutationInput extends ConnectorCredentialMutationFence {\n readonly holderId: string\n}\n\nexport interface RecoverExpiredConnectorCredentialMutationInput {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n}\n\nexport interface MarkConnectorAuthorizationNeedsReauthorizationInput\n extends ConnectorCredentialMutationFence {}\n\nexport interface FinalizeConnectorReauthorizationInput extends ConnectorCredentialMutationFence {\n readonly accounts: readonly ConnectorAccountCandidate[]\n}\n\nexport type ConnectorConnectionStatus = \"connected\" | \"disconnected\"\n\nexport interface ConnectorConnectionRecord extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly account: ConnectorAccountCandidate\n readonly status: ConnectorConnectionStatus\n readonly disconnectedAt?: Date\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface PutConnectorConnectionInput extends ConnectorConnectionSelector {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n readonly account: ConnectorAccountCandidate\n readonly replace: boolean\n}\n\nexport interface PutConnectorConnectionResult {\n readonly connection: ConnectorConnectionRecord\n readonly authorization: ConnectorAuthorizationRecord\n readonly revocationPendingAuthorizationId?: string\n readonly created: boolean\n readonly replaced: boolean\n}\n\nexport interface DisconnectConnectorConnectionResult {\n readonly connection: ConnectorConnectionRecord\n readonly authorization: ConnectorAuthorizationRecord\n readonly revocationPendingAuthorizationId?: string\n}\n\nexport interface PutConnectorConnectionFromRunInput {\n readonly id: string\n readonly projectId: string\n readonly connectorId: string\n readonly runId: string\n readonly account: ConnectorAccountCandidate\n readonly replace: boolean\n}\n\nexport interface PutConnectorConnectionFromRunResult extends PutConnectorConnectionResult {\n readonly run: ConnectorConnectionRunSucceededRecord\n}\n\nexport interface GetConnectorConnectionInput extends ConnectorConnectionSelector {\n readonly projectId: string\n readonly connectorId: string\n}\n\nexport interface ListConnectorConnectionsInput {\n readonly projectId: string\n readonly connectorId: string\n}\n\n/** Tenant-scoped identity for one connector authorization. */\nexport interface ConnectorAuthorizationKey {\n readonly projectId: string\n readonly connectorId: string\n readonly authorizationId: string\n}\n\n/** Tenant-scoped identity for one selected connector connection. */\nexport interface ConnectorConnectionKey {\n readonly projectId: string\n readonly connectorId: string\n readonly connectionId: string\n}\n\n/** Persistent contract. Implementations must make every individual mutation atomic. */\nexport interface ConnectorConnectionStorage {\n readonly durability: \"ephemeral\" | \"durable\"\n\n createAuthorizationAttempt(\n input: CreateConnectorAuthorizationAttemptInput\n ): Promise<ConnectorAuthorizationAttemptRecord>\n consumeAuthorizationAttempt(\n input: ConsumeConnectorAuthorizationAttemptInput\n ): Promise<ConnectorAuthorizationAttemptRecord>\n\n createConnectionRun(\n input: CreateConnectorConnectionRunInput\n ): Promise<ConnectorConnectionRunRecord>\n createConnectionSelectionRun(\n input: CreateConnectorConnectionSelectionRunInput\n ): Promise<ConnectorConnectionRunAwaitingSelectionRecord>\n claimConnectionRunCallback(\n input: ClaimConnectorConnectionRunCallbackInput\n ): Promise<ClaimConnectorConnectionRunCallbackResult | null>\n attachConnectionRunAuthorization(\n input: AttachConnectorConnectionRunAuthorizationInput\n ): Promise<ConnectorConnectionRunProcessingRecord | null>\n waitForConnectionRunSelection(\n input: WaitForConnectorConnectionRunSelectionInput\n ): Promise<ConnectorConnectionRunAwaitingSelectionRecord | null>\n finishConnectionRun(\n input: FinishConnectorConnectionRunInput\n ): Promise<ConnectorConnectionRunRecord | null>\n listPendingConnectionRuns(\n input: ListConnectorConnectionsInput\n ): Promise<readonly ConnectorConnectionRunRecord[]>\n getConnectionRun(\n input: GetConnectorConnectionRunInput\n ): Promise<ConnectorConnectionRunRecord | null>\n\n createAuthorization(\n input: CreateConnectorAuthorizationInput\n ): Promise<ConnectorAuthorizationRecord>\n initializeAuthorizationAccounts(\n input: InitializeConnectorAuthorizationAccountsInput\n ): Promise<ConnectorAuthorizationRecord | null>\n getAuthorization(input: ConnectorAuthorizationKey): Promise<ConnectorAuthorizationRecord | null>\n getAuthorizationByConnectionId(\n input: ConnectorConnectionKey\n ): Promise<ConnectorAuthorizationRecord | null>\n claimCredentialMutation(\n input: ClaimConnectorCredentialMutationInput\n ): Promise<ClaimConnectorCredentialMutationResult | null>\n markCredentialMutationExecuting(\n input: MarkConnectorCredentialMutationExecutingInput\n ): Promise<ConnectorAuthorizationRecord | null>\n renewCredentialMutation(\n input: RenewConnectorCredentialMutationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n stageCredentialMutationCredentials(\n input: StageConnectorCredentialMutationCredentialsInput\n ): Promise<ConnectorAuthorizationRecord | null>\n stageCredentialMutationRevocation(\n input: StageConnectorCredentialMutationRevocationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n releaseCredentialMutation(input: ReleaseConnectorCredentialMutationInput): Promise<boolean>\n /**\n * Recovers an expired mutation without replaying an unknown provider effect. Prepared work is\n * released, executing refresh/reauthorization fails closed, revocation stays retryable, and a\n * staged result remains available for finalization.\n */\n recoverExpiredCredentialMutation(\n input: RecoverExpiredConnectorCredentialMutationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n markNeedsReauthorization(\n input: MarkConnectorAuthorizationNeedsReauthorizationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n finalizeRefresh(\n input: ConnectorCredentialMutationFence\n ): Promise<ConnectorAuthorizationRecord | null>\n finalizeReauthorization(\n input: FinalizeConnectorReauthorizationInput\n ): Promise<ConnectorAuthorizationRecord | null>\n finalizeRevocation(\n input: ConnectorCredentialMutationFence\n ): Promise<ConnectorAuthorizationRecord | null>\n\n putConnection(input: PutConnectorConnectionInput): Promise<PutConnectorConnectionResult>\n putConnectionFromRun(\n input: PutConnectorConnectionFromRunInput\n ): Promise<PutConnectorConnectionFromRunResult>\n getConnection(input: GetConnectorConnectionInput): Promise<ConnectorConnectionRecord | null>\n getConnectionById(input: ConnectorConnectionKey): Promise<ConnectorConnectionRecord | null>\n listConnections(\n input: ListConnectorConnectionsInput\n ): Promise<readonly ConnectorConnectionRecord[]>\n listConnectionsByAuthorization(\n input: ConnectorAuthorizationKey\n ): Promise<readonly ConnectorConnectionRecord[]>\n disconnectConnection(\n input: ConnectorConnectionKey\n ): Promise<DisconnectConnectorConnectionResult | null>\n}\n"
|
|
7
7
|
],
|
|
8
8
|
"mappings": ";;AAeO,MAAM,yCAAwC,MAAM;AAAA,EAChD;AAAA,EAET,WAAW,CAAC,MAA2C,SAAiB;AAAA,IACtE,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,KAAK,OAAO;AAAA;AAEhB;;;ACZO,IAAM,0CAAyC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
9
9
|
"debugId": "B4781D37D7AB95BB64756E2164756E21",
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
ModelProviderError2,
|
|
16
16
|
UnsupportedModelFeatureError2,
|
|
17
17
|
StructuredOutputError2
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-jsy70480.js";
|
|
19
19
|
import {
|
|
20
20
|
AGENT_REASONING_LEVELS2
|
|
21
21
|
} from "./chunk-7bs40fe1.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isStepDefinition2,
|
|
29
29
|
isAgentStepDefinition2,
|
|
30
30
|
isInterventionDefinition2
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-gq8vhakp.js";
|
|
32
32
|
import {
|
|
33
33
|
isScheduleDefinition2
|
|
34
34
|
} from "./chunk-e1c18xjx.js";
|
|
@@ -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";
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
validateWorkflowsAtStartup2,
|
|
73
73
|
validateWorkflowAgentStepGroupReferences2,
|
|
74
74
|
createBoundSixb
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-gq8vhakp.js";
|
|
76
76
|
import {
|
|
77
77
|
registerConnectorConnectionCallbackProcess
|
|
78
78
|
} from "./chunk-5a4a52tq.js";
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
validateSharesAtStartup,
|
|
89
89
|
discoverOntologySources2,
|
|
90
90
|
discoverProjectDefinitions2
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-fh8kgex1.js";
|
|
92
92
|
import {
|
|
93
93
|
LoggingService2
|
|
94
94
|
} from "./chunk-3qms4nax.js";
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
} from "./chunk-1824gssz.js";
|
|
98
98
|
import {
|
|
99
99
|
SyncValidationError2
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-cfvakeax.js";
|
|
101
101
|
import {
|
|
102
102
|
isOAuthConnectorDefinition2
|
|
103
103
|
} from "./chunk-9x8dybsb.js";
|
|
@@ -1486,11 +1486,19 @@ function assertConnectorAuthorizationAttemptInitiator(execution, current) {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
function assertConnectorConnectionRunInitiator(execution, current, connectorId) {
|
|
1489
|
-
|
|
1490
|
-
if (!initiating || !sameConnectorConnectionCommandActor(initiating, current)) {
|
|
1489
|
+
if (!isConnectorConnectionRunInitiator(execution, current)) {
|
|
1491
1490
|
throw new AuthorizationError2(`connection-run:connector:${connectorId}`, "[Sixb] This connector connection run can only be accessed by its initiating actor.");
|
|
1492
1491
|
}
|
|
1493
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
|
+
}
|
|
1494
1502
|
function connectorConnectionActorFromExecution(execution, projectId) {
|
|
1495
1503
|
const authorization = execution.authorizationRef;
|
|
1496
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) {
|
|
@@ -1893,6 +1901,23 @@ class ConnectorConnectionRunService {
|
|
|
1893
1901
|
return { runId: failed.id, connectorId: failed.connectorId, returnTo };
|
|
1894
1902
|
}
|
|
1895
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
|
+
}
|
|
1896
1921
|
async get(command, connectorId, runId) {
|
|
1897
1922
|
const id = nonblank(runId, "connection run id");
|
|
1898
1923
|
const run = await this.readRun(connectorId, id);
|
|
@@ -2115,8 +2140,7 @@ class ConnectorConnectionRunService {
|
|
|
2115
2140
|
...base,
|
|
2116
2141
|
status: "waiting",
|
|
2117
2142
|
waitingFor: "account_selection",
|
|
2118
|
-
accounts: authorization.accounts
|
|
2119
|
-
expiresAt: run.expiresAt
|
|
2143
|
+
accounts: authorization.accounts
|
|
2120
2144
|
};
|
|
2121
2145
|
}
|
|
2122
2146
|
if (run.status === "succeeded") {
|
|
@@ -2160,6 +2184,8 @@ class ConnectorConnectionRunService {
|
|
|
2160
2184
|
}
|
|
2161
2185
|
scheduleRunMaintenance(run, delayMs = run.status === "waiting" || run.status === "running" ? Math.max(1000, run.expiresAt.getTime() - this.now().getTime()) : CLEANUP_RETRY_DELAY_MS) {
|
|
2162
2186
|
this.cancelRunMaintenance(run.id);
|
|
2187
|
+
if (run.status === "waiting" && run.waitingFor === "account_selection")
|
|
2188
|
+
return;
|
|
2163
2189
|
const timer = setTimeout(() => void this.maintainRun(run.connectorId, run.id), Math.min(delayMs, MAX_TIMER_DELAY_MS));
|
|
2164
2190
|
timer.unref?.();
|
|
2165
2191
|
this.maintenanceTimers.set(run.id, timer);
|
|
@@ -2366,6 +2392,10 @@ class ConnectorConnectionService {
|
|
|
2366
2392
|
authorizationId: authorization.id
|
|
2367
2393
|
});
|
|
2368
2394
|
}
|
|
2395
|
+
listPendingConnectionRuns(command, connectorId) {
|
|
2396
|
+
this.requireOAuthDefinition(connectorId);
|
|
2397
|
+
return this.runs.listPending(command, connectorId);
|
|
2398
|
+
}
|
|
2369
2399
|
getConnectionRun(command, connectorId, runId) {
|
|
2370
2400
|
this.requireOAuthDefinition(connectorId);
|
|
2371
2401
|
return this.runs.get(command, connectorId, runId);
|
|
@@ -2699,6 +2729,8 @@ class OntologyMaintenance {
|
|
|
2699
2729
|
};
|
|
2700
2730
|
}
|
|
2701
2731
|
runNow() {
|
|
2732
|
+
if (this.stopping)
|
|
2733
|
+
return this.stopping;
|
|
2702
2734
|
this.pass ??= this.runPass().finally(() => {
|
|
2703
2735
|
this.pass = null;
|
|
2704
2736
|
});
|
|
@@ -2792,10 +2824,11 @@ class OntologyMaintenance {
|
|
|
2792
2824
|
this.timer = null;
|
|
2793
2825
|
}
|
|
2794
2826
|
const activePass = this.pass ?? Promise.resolve();
|
|
2795
|
-
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then((settled) => {
|
|
2827
|
+
const stopping = settlesWithin(activePass, this.shutdownTimeoutMs).then(async (settled) => {
|
|
2796
2828
|
if (!settled) {
|
|
2797
|
-
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.`));
|
|
2798
2830
|
}
|
|
2831
|
+
await activePass;
|
|
2799
2832
|
});
|
|
2800
2833
|
this.stopping = stopping.finally(() => {
|
|
2801
2834
|
this.stopping = null;
|
|
@@ -3383,4 +3416,4 @@ async function createSixb2(options) {
|
|
|
3383
3416
|
}
|
|
3384
3417
|
export { WebhookValidationError2, defineWebhook2, webhookConnector2, UnverifiedWebhookError2, resolveWebhookVerification2, warnUnverifiedWebhook2, SixbHost2, createSixb2 };
|
|
3385
3418
|
|
|
3386
|
-
//# debugId=
|
|
3419
|
+
//# debugId=D39CD002806200FC64756E2164756E21
|