@sixb/core 0.1.7 → 0.1.8
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/delegated-admission.d.ts +24 -0
- package/dist/actions/delegated-admission.d.ts.map +1 -0
- package/dist/actions/descriptor.d.ts +29 -0
- package/dist/actions/descriptor.d.ts.map +1 -0
- package/dist/actions/execution.d.ts +5 -5
- package/dist/actions/execution.d.ts.map +1 -1
- package/dist/actions/index.js +36 -30
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run-authorization.d.ts +20 -0
- package/dist/actions/run-authorization.d.ts.map +1 -0
- package/dist/actions/run-dispatch.d.ts +3 -1
- package/dist/actions/run-dispatch.d.ts.map +1 -1
- package/dist/actions/worker.js +3 -3
- package/dist/actions/worker.js.map +1 -1
- package/dist/agents/adapters.d.ts +5 -122
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/authority.d.ts +1 -1
- package/dist/agents/authority.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/context.js +1 -1
- package/dist/agents/errors.d.ts +0 -9
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/identity.d.ts +3 -0
- package/dist/agents/identity.d.ts.map +1 -0
- package/dist/agents/index.d.ts +3 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +43 -43
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/message.d.ts +4 -5
- package/dist/agents/message.d.ts.map +1 -1
- package/dist/agents/model-loop.d.ts +2 -0
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/tool-definition.d.ts +0 -1
- package/dist/agents/tool-definition.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +0 -4
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/ai-usage/execution.d.ts.map +1 -1
- package/dist/auth/index.js +8 -5
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/decision.d.ts +10 -2
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +2 -1
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.d.ts +1 -1
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +7 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/bootstrap/discovery.d.ts +7 -1
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +46 -39
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -1
- package/dist/chunk-19jp6g9d.js +131 -0
- package/dist/chunk-19jp6g9d.js.map +11 -0
- package/dist/{chunk-x0qhkqje.js → chunk-2dw777qw.js} +50 -5
- package/dist/{chunk-x0qhkqje.js.map → chunk-2dw777qw.js.map} +4 -3
- package/dist/chunk-359jm1jw.js +147 -0
- package/dist/chunk-359jm1jw.js.map +10 -0
- package/dist/{chunk-2b5qtban.js → chunk-3xep5cjx.js} +56 -21
- package/dist/chunk-3xep5cjx.js.map +15 -0
- package/dist/{chunk-qjycjdj6.js → chunk-3z1qec12.js} +6 -8
- package/dist/{chunk-qjycjdj6.js.map → chunk-3z1qec12.js.map} +2 -2
- package/dist/{chunk-5jcdmjam.js → chunk-4jjp5k14.js} +1 -1
- package/dist/{chunk-n2arzn6e.js → chunk-4qfkag59.js} +44 -221
- package/dist/chunk-4qfkag59.js.map +20 -0
- package/dist/{chunk-rre42skh.js → chunk-4sm0aznx.js} +515 -80
- package/dist/{chunk-rre42skh.js.map → chunk-4sm0aznx.js.map} +11 -7
- package/dist/chunk-4yqmp43v.js +159 -0
- package/dist/chunk-4yqmp43v.js.map +11 -0
- package/dist/{chunk-atmkaf60.js → chunk-5e3pq99w.js} +2 -6
- package/dist/{chunk-atmkaf60.js.map → chunk-5e3pq99w.js.map} +3 -3
- package/dist/{chunk-agsvg9ar.js → chunk-5ntny1qx.js} +1 -1
- package/dist/{chunk-z2sery1b.js → chunk-9nbmsvn5.js} +60 -20
- package/dist/chunk-9nbmsvn5.js.map +11 -0
- package/dist/{chunk-e4rvtvpw.js → chunk-aa2pen2v.js} +250 -78
- package/dist/chunk-aa2pen2v.js.map +34 -0
- package/dist/{chunk-64sr682n.js → chunk-ajnan18g.js} +11 -8
- package/dist/chunk-ajnan18g.js.map +12 -0
- package/dist/{chunk-9aehf39w.js → chunk-f26bck4t.js} +4 -4
- package/dist/{chunk-7ds9620f.js → chunk-fvt9rjsa.js} +23 -7
- package/dist/chunk-fvt9rjsa.js.map +10 -0
- package/dist/{chunk-kt81c11h.js → chunk-gbejpkex.js} +5 -5
- package/dist/{chunk-kt81c11h.js.map → chunk-gbejpkex.js.map} +1 -1
- package/dist/{chunk-vjjv9mrb.js → chunk-gzasd5b6.js} +5 -5
- package/dist/{chunk-vjjv9mrb.js.map → chunk-gzasd5b6.js.map} +3 -3
- package/dist/{chunk-d63tybny.js → chunk-h0k55pc7.js} +4 -4
- package/dist/{chunk-d63tybny.js.map → chunk-h0k55pc7.js.map} +1 -1
- package/dist/chunk-h5vqbfmd.js +1537 -0
- package/dist/chunk-h5vqbfmd.js.map +19 -0
- package/dist/{chunk-3kv70xwp.js → chunk-j1sbhm7p.js} +18 -2
- package/dist/chunk-j1sbhm7p.js.map +10 -0
- package/dist/{chunk-hdz94br2.js → chunk-k522z7v6.js} +10 -5
- package/dist/chunk-k522z7v6.js.map +10 -0
- package/dist/{chunk-wjgm6jjt.js → chunk-mth82m8t.js} +128 -94
- package/dist/chunk-mth82m8t.js.map +14 -0
- package/dist/{chunk-qv38twt8.js → chunk-mwsxn98e.js} +46 -25
- package/dist/{chunk-qv38twt8.js.map → chunk-mwsxn98e.js.map} +6 -6
- package/dist/chunk-n4khvw9n.js +111 -0
- package/dist/chunk-n4khvw9n.js.map +11 -0
- package/dist/{chunk-qjzp9xyb.js → chunk-nn0tekr1.js} +6 -8
- package/dist/chunk-nn0tekr1.js.map +12 -0
- package/dist/chunk-nx7k8tpr.js +436 -0
- package/dist/chunk-nx7k8tpr.js.map +12 -0
- package/dist/{chunk-08twe8m6.js → chunk-p1rzczbt.js} +1 -1
- package/dist/{chunk-37wk412q.js → chunk-p1x242ad.js} +587 -70
- package/dist/chunk-p1x242ad.js.map +25 -0
- package/dist/{chunk-tn7xcs2n.js → chunk-pc7ys28c.js} +68 -5
- package/dist/chunk-pc7ys28c.js.map +14 -0
- package/dist/{chunk-3fqt22c4.js → chunk-q0k9nc5a.js} +280 -88
- package/dist/chunk-q0k9nc5a.js.map +14 -0
- package/dist/chunk-r8jrnexe.js +403 -0
- package/dist/chunk-r8jrnexe.js.map +10 -0
- package/dist/{chunk-gbrpsx4m.js → chunk-rafagrwr.js} +30 -2
- package/dist/chunk-rafagrwr.js.map +11 -0
- package/dist/{chunk-xdpwpkha.js → chunk-rv2hkwwa.js} +1 -1
- package/dist/{chunk-6ed5bwnd.js → chunk-sbzzr4kx.js} +1203 -691
- package/dist/{chunk-6ed5bwnd.js.map → chunk-sbzzr4kx.js.map} +15 -9
- package/dist/{chunk-d2ndstdf.js → chunk-v1xppd0y.js} +13 -11
- package/dist/{chunk-d2ndstdf.js.map → chunk-v1xppd0y.js.map} +2 -2
- package/dist/chunk-v4en4jc2.js +252 -0
- package/dist/chunk-v4en4jc2.js.map +10 -0
- package/dist/{chunk-1kamz6j0.js → chunk-w1tvjszy.js} +1 -1
- package/dist/{chunk-rp1mvzb4.js → chunk-w9tg6yyb.js} +11 -6
- package/dist/{chunk-rp1mvzb4.js.map → chunk-w9tg6yyb.js.map} +3 -3
- package/dist/{chunk-4nxeacx7.js → chunk-wdage1eb.js} +1 -1
- package/dist/{chunk-ha58tjtt.js → chunk-wtf06et8.js} +9 -5
- package/dist/{chunk-ha58tjtt.js.map → chunk-wtf06et8.js.map} +3 -3
- package/dist/{chunk-h0knpbz5.js → chunk-xajtptbw.js} +782 -211
- package/dist/chunk-xajtptbw.js.map +40 -0
- package/dist/{chunk-xc7hq65b.js → chunk-yp8ee62z.js} +49 -2
- package/dist/chunk-yp8ee62z.js.map +11 -0
- package/dist/chunk-z4ccwbkz.js +139 -0
- package/dist/chunk-z4ccwbkz.js.map +10 -0
- package/dist/datasets/builders.d.ts +11 -2
- package/dist/datasets/builders.d.ts.map +1 -1
- package/dist/datasets/changes.d.ts +14 -4
- package/dist/datasets/changes.d.ts.map +1 -1
- package/dist/datasets/execution.d.ts +15 -1
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/index.d.ts +1 -0
- package/dist/datasets/index.d.ts.map +1 -1
- package/dist/datasets/sequence.d.ts +7 -0
- package/dist/datasets/sequence.d.ts.map +1 -0
- package/dist/datasets/types.d.ts +1 -0
- package/dist/datasets/types.d.ts.map +1 -1
- package/dist/datasets/validation.d.ts.map +1 -1
- package/dist/datasets/write.d.ts +37 -0
- package/dist/datasets/write.d.ts.map +1 -0
- package/dist/datasets/write.js +17 -0
- package/dist/datasets/write.js.map +9 -0
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/types/datasets.d.ts +2 -6
- package/dist/events/types/datasets.d.ts.map +1 -1
- package/dist/execution/agent.d.ts.map +1 -1
- package/dist/execution/agent.js +39 -32
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +58 -20
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +69 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -0
- package/dist/execution/durable.d.ts.map +1 -1
- package/dist/execution/index.d.ts +1 -1
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/primitive.js +39 -32
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.d.ts +11 -0
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +76 -40
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +16 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/types.d.ts +9 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts +2 -0
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +92 -78
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/definition-updates.d.ts.map +1 -1
- package/dist/lake-storage/errors.d.ts +5 -1
- package/dist/lake-storage/errors.d.ts.map +1 -1
- package/dist/lake-storage/in-memory.d.ts +1 -0
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +6 -1
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +24 -7
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/merge-validation.d.ts.map +1 -1
- package/dist/lake-storage/merge.d.ts +13 -2
- package/dist/lake-storage/merge.d.ts.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +19 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -0
- package/dist/lake-storage/sql-transforms.d.ts +2 -1
- package/dist/lake-storage/sql-transforms.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +10 -5
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/lake-storage/version-inputs.d.ts +4 -0
- package/dist/lake-storage/version-inputs.d.ts.map +1 -0
- package/dist/materializer/index.js +25 -22
- package/dist/materializer/index.js.map +1 -1
- package/dist/objects/authorized-ontology-view.d.ts +25 -0
- package/dist/objects/authorized-ontology-view.d.ts.map +1 -0
- package/dist/objects/execution.d.ts +1 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +29 -26
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/authorization.d.ts +2 -7
- package/dist/objects/link/authorization.d.ts.map +1 -1
- package/dist/objects/query/executor.d.ts +4 -2
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.js +24 -21
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/links.d.ts +22 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/selected-read-admission.d.ts +27 -0
- package/dist/objects/query/selected-read-admission.d.ts.map +1 -0
- package/dist/objects/query/validate.d.ts +60 -2
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +2 -7
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/objects/sdk/telemetry-channel.d.ts.map +1 -1
- package/dist/objects/service/list-service.d.ts +2 -3
- package/dist/objects/service/list-service.d.ts.map +1 -1
- package/dist/objects/telemetry/history.d.ts +8 -6
- package/dist/objects/telemetry/history.d.ts.map +1 -1
- package/dist/objects/telemetry/index.d.ts +2 -2
- package/dist/objects/telemetry/index.d.ts.map +1 -1
- package/dist/objects/telemetry/workload.d.ts +11 -0
- package/dist/objects/telemetry/workload.d.ts.map +1 -0
- package/dist/ontology/index.d.ts +2 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +13 -12
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +2 -1
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.d.ts +0 -1
- package/dist/ontology/internal.d.ts.map +1 -1
- package/dist/ontology/internal.js +5 -10
- package/dist/ontology/internal.js.map +3 -3
- package/dist/ontology/json-schema.d.ts +10 -6
- package/dist/ontology/json-schema.d.ts.map +1 -1
- package/dist/ontology/link-path-selection.d.ts +35 -0
- package/dist/ontology/link-path-selection.d.ts.map +1 -0
- package/dist/ontology/refs.d.ts +2 -0
- package/dist/ontology/refs.d.ts.map +1 -1
- package/dist/ontology/tokens.d.ts +2 -1
- package/dist/ontology/tokens.d.ts.map +1 -1
- package/dist/pipelines/execution.d.ts.map +1 -1
- package/dist/pipelines/index.js +27 -24
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/request.d.ts.map +1 -1
- package/dist/projections/execution.d.ts.map +1 -1
- package/dist/projections/internal.js +25 -22
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/rules/execution.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +4 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +2 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +2 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -0
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts +4 -0
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +3 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/schedules/execution.d.ts +2 -1
- package/dist/schedules/execution.d.ts.map +1 -1
- package/dist/security/every.d.ts +4 -1
- package/dist/security/every.d.ts.map +1 -1
- package/dist/security/grants.d.ts +7 -2
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/registry.d.ts +1 -0
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +7 -1
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +2 -0
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/access-plan.d.ts +22 -0
- package/dist/shares/access-plan.d.ts.map +1 -0
- package/dist/shares/builders.d.ts +14 -0
- package/dist/shares/builders.d.ts.map +1 -0
- package/dist/shares/compiler.d.ts +14 -0
- package/dist/shares/compiler.d.ts.map +1 -0
- package/dist/shares/errors.d.ts +4 -0
- package/dist/shares/errors.d.ts.map +1 -0
- package/dist/shares/execution.d.ts +57 -0
- package/dist/shares/execution.d.ts.map +1 -0
- package/dist/shares/index.d.ts +10 -0
- package/dist/shares/index.d.ts.map +1 -0
- package/dist/shares/internal.d.ts +3 -0
- package/dist/shares/internal.d.ts.map +1 -0
- package/dist/shares/internal.js +239 -0
- package/dist/shares/internal.js.map +10 -0
- package/dist/shares/intersection.d.ts +9 -0
- package/dist/shares/intersection.d.ts.map +1 -0
- package/dist/shares/session-protocol.d.ts +41 -0
- package/dist/shares/session-protocol.d.ts.map +1 -0
- package/dist/shares/types.d.ts +51 -0
- package/dist/shares/types.d.ts.map +1 -0
- package/dist/shares/validation.d.ts +11 -0
- package/dist/shares/validation.d.ts.map +1 -0
- package/dist/storage/action-runs/provider.js +2 -2
- package/dist/storage/agents/provider.js +2 -2
- package/dist/storage/executions/in-memory.d.ts +3 -0
- package/dist/storage/executions/in-memory.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +4 -1
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +23 -3
- package/dist/storage/executions/provider.js.map +3 -3
- package/dist/storage/executions/run-link.d.ts +7 -0
- package/dist/storage/executions/run-link.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts +6 -0
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/in-memory/index.d.ts +8 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +8 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +65 -36
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/objects/execution-limits.d.ts +25 -0
- package/dist/storage/objects/execution-limits.d.ts.map +1 -0
- package/dist/storage/objects/guard.d.ts +16 -0
- package/dist/storage/objects/guard.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/index.d.ts +3 -0
- package/dist/storage/objects/in-memory/index.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/keys.d.ts +10 -0
- package/dist/storage/objects/in-memory/keys.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/query.d.ts +31 -0
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/read-scope.d.ts +18 -0
- package/dist/storage/objects/in-memory/read-scope.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/read-source.d.ts +10 -0
- package/dist/storage/objects/in-memory/read-source.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/selected-reader.d.ts +9 -0
- package/dist/storage/objects/in-memory/selected-reader.d.ts.map +1 -0
- package/dist/storage/objects/{in-memory.d.ts → in-memory/storage.d.ts} +13 -10
- package/dist/storage/objects/in-memory/storage.d.ts.map +1 -0
- package/dist/storage/objects/index.d.ts +4 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/keys.d.ts +1 -1
- package/dist/storage/objects/keys.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts +25 -0
- package/dist/storage/objects/read-scope.d.ts.map +1 -0
- package/dist/storage/objects/types.d.ts +114 -22
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/operation-scope.d.ts +3 -0
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +4 -2
- package/dist/storage/operation-scope.js.map +1 -1
- package/dist/storage/pipeline-runs/provider.js +2 -2
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/share-grants/errors.d.ts +8 -0
- package/dist/storage/share-grants/errors.d.ts.map +1 -0
- package/dist/storage/share-grants/in-memory.d.ts +11 -0
- package/dist/storage/share-grants/in-memory.d.ts.map +1 -0
- package/dist/storage/share-grants/index.d.ts +5 -0
- package/dist/storage/share-grants/index.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.d.ts +4 -0
- package/dist/storage/share-grants/provider.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.js +24 -0
- package/dist/storage/share-grants/provider.js.map +9 -0
- package/dist/storage/share-grants/record.d.ts +11 -0
- package/dist/storage/share-grants/record.d.ts.map +1 -0
- package/dist/storage/share-grants/types.d.ts +97 -0
- package/dist/storage/share-grants/types.d.ts.map +1 -0
- package/dist/storage/share-sessions/errors.d.ts +8 -0
- package/dist/storage/share-sessions/errors.d.ts.map +1 -0
- package/dist/storage/share-sessions/in-memory.d.ts +14 -0
- package/dist/storage/share-sessions/in-memory.d.ts.map +1 -0
- package/dist/storage/share-sessions/index.d.ts +5 -0
- package/dist/storage/share-sessions/index.d.ts.map +1 -0
- package/dist/storage/share-sessions/provider.d.ts +3 -0
- package/dist/storage/share-sessions/provider.d.ts.map +1 -0
- package/dist/storage/share-sessions/provider.js +20 -0
- package/dist/storage/share-sessions/provider.js.map +9 -0
- package/dist/storage/share-sessions/record.d.ts +8 -0
- package/dist/storage/share-sessions/record.d.ts.map +1 -0
- package/dist/storage/share-sessions/types.d.ts +50 -0
- package/dist/storage/share-sessions/types.d.ts.map +1 -0
- package/dist/storage/sync-runs/provider.js +2 -2
- package/dist/storage/transaction.d.ts +2 -1
- package/dist/storage/transaction.d.ts.map +1 -1
- package/dist/storage/types.d.ts +8 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/webhook-runs/provider.js +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -7
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.js +27 -24
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/testing/dataset-sequence-contract.d.ts +4 -0
- package/dist/testing/dataset-sequence-contract.d.ts.map +1 -0
- package/dist/testing/effective-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts +4 -0
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +2555 -908
- package/dist/testing/index.js.map +11 -7
- package/dist/testing/lake-merge-storage-contract.d.ts +1 -0
- package/dist/testing/lake-merge-storage-contract.d.ts.map +1 -1
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-read-scope-contract.d.ts +22 -0
- package/dist/testing/object-read-scope-contract.d.ts.map +1 -0
- package/dist/testing/share-grant-storage-contract.d.ts +10 -0
- package/dist/testing/share-grant-storage-contract.d.ts.map +1 -0
- package/dist/testing/share-session-storage-contract.d.ts +9 -0
- package/dist/testing/share-session-storage-contract.d.ts.map +1 -0
- package/dist/webhooks/internal.js +24 -21
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workflows/execution.d.ts.map +1 -1
- package/dist/workflows/index.js +42 -35
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/request.d.ts.map +1 -1
- package/package.json +25 -1
- package/src/actions/delegated-admission.ts +72 -0
- package/src/actions/descriptor.ts +58 -0
- package/src/actions/execution.ts +99 -24
- package/src/actions/request.ts +136 -19
- package/src/actions/run-authorization.ts +53 -0
- package/src/actions/run-dispatch.ts +8 -1
- package/src/agents/adapters.ts +30 -420
- package/src/agents/authority.ts +3 -4
- package/src/agents/context-resolution.ts +1 -4
- package/src/agents/errors.ts +0 -10
- package/src/agents/execution.ts +13 -5
- package/src/agents/identity.ts +4 -0
- package/src/agents/index.ts +1 -20
- package/src/agents/message.ts +4 -5
- package/src/agents/model-loop.ts +54 -6
- package/src/agents/request.ts +16 -3
- package/src/agents/tool-definition.ts +0 -19
- package/src/agents/validation.ts +6 -65
- package/src/ai-usage/execution.ts +4 -11
- package/src/authorization/decision.ts +29 -14
- package/src/authorization/grant-kinds.ts +10 -0
- package/src/authorization/index.ts +1 -0
- package/src/bootstrap/discovery.ts +3 -0
- package/src/bootstrap/ontology-type-manifest.ts +12 -6
- package/src/datasets/builders.ts +23 -2
- package/src/datasets/changes.ts +16 -4
- package/src/datasets/execution.ts +76 -5
- package/src/datasets/index.ts +1 -0
- package/src/datasets/sequence.ts +77 -0
- package/src/datasets/types.ts +1 -0
- package/src/datasets/validation.ts +26 -0
- package/src/datasets/write.ts +240 -0
- package/src/events/execution.ts +57 -7
- package/src/events/types/datasets.ts +2 -6
- package/src/execution/agent.ts +1 -4
- package/src/execution/authorization.ts +470 -90
- package/src/execution/authorized-object-reader.ts +695 -0
- package/src/execution/durable.ts +10 -2
- package/src/execution/index.ts +1 -0
- package/src/execution/request.ts +63 -13
- package/src/execution/scopes.ts +36 -6
- package/src/execution/types.ts +8 -0
- package/src/http/api-routes.ts +45 -0
- package/src/index.ts +36 -15
- package/src/lake-storage/definition-updates.ts +9 -0
- package/src/lake-storage/errors.ts +6 -1
- package/src/lake-storage/in-memory.ts +53 -17
- package/src/lake-storage/index.ts +10 -1
- package/src/lake-storage/merge-validation.ts +12 -2
- package/src/lake-storage/merge.ts +40 -2
- package/src/lake-storage/source-ordering.ts +95 -0
- package/src/lake-storage/sql-transforms.ts +2 -1
- package/src/lake-storage/types.ts +10 -5
- package/src/lake-storage/version-inputs.ts +14 -0
- package/src/objects/authorized-ontology-view.ts +512 -0
- package/src/objects/execution.ts +98 -143
- package/src/objects/link/authorization.ts +3 -2
- package/src/objects/query/executor.ts +45 -34
- package/src/objects/query/links.ts +84 -25
- package/src/objects/query/selected-read-admission.ts +310 -0
- package/src/objects/query/validate.ts +353 -36
- package/src/objects/sdk/object-handle.ts +2 -8
- package/src/objects/sdk/object-set.ts +10 -11
- package/src/objects/sdk/runtime-query-executor.ts +8 -28
- package/src/objects/sdk/telemetry-channel.ts +11 -7
- package/src/objects/service/list-service.ts +15 -29
- package/src/objects/telemetry/history.ts +297 -17
- package/src/objects/telemetry/index.ts +2 -2
- package/src/objects/telemetry/workload.ts +79 -0
- package/src/ontology/index.ts +7 -1
- package/src/ontology/inference/index.ts +4 -1
- package/src/ontology/internal.ts +0 -1
- package/src/ontology/json-schema.ts +13 -12
- package/src/ontology/link-path-selection.ts +193 -0
- package/src/ontology/refs.ts +19 -0
- package/src/ontology/tokens.ts +15 -8
- package/src/pipelines/execution.ts +30 -7
- package/src/pipelines/request.ts +5 -0
- package/src/projections/execution.ts +72 -11
- package/src/projections/run-dispatch.ts +6 -12
- package/src/rules/execution.ts +20 -8
- package/src/runtime/create.ts +5 -1
- package/src/runtime/definitions.ts +2 -0
- package/src/runtime/host.ts +25 -6
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/resolve-definitions.ts +9 -0
- package/src/runtime/sixb.ts +23 -2
- package/src/runtime/types.ts +3 -0
- package/src/schedules/execution.ts +24 -2
- package/src/security/every.ts +4 -0
- package/src/security/grants.ts +45 -3
- package/src/security/index.ts +1 -0
- package/src/security/registry.ts +3 -0
- package/src/security/types.ts +8 -0
- package/src/security/validation.ts +3 -0
- package/src/shares/access-plan.ts +225 -0
- package/src/shares/builders.ts +381 -0
- package/src/shares/compiler.ts +359 -0
- package/src/shares/errors.ts +3 -0
- package/src/shares/execution.ts +394 -0
- package/src/shares/index.ts +28 -0
- package/src/shares/internal.ts +9 -0
- package/src/shares/intersection.ts +178 -0
- package/src/shares/session-protocol.ts +258 -0
- package/src/shares/types.ts +76 -0
- package/src/shares/validation.ts +40 -0
- package/src/storage/executions/in-memory.ts +9 -1
- package/src/storage/executions/provider.ts +30 -1
- package/src/storage/executions/run-link.ts +29 -0
- package/src/storage/executions/validation.ts +46 -1
- package/src/storage/in-memory/index.ts +21 -2
- package/src/storage/index.ts +51 -0
- package/src/storage/objects/execution-limits.ts +283 -0
- package/src/storage/objects/guard.ts +55 -0
- package/src/storage/objects/in-memory/index.ts +2 -0
- package/src/storage/objects/in-memory/keys.ts +46 -0
- package/src/storage/objects/in-memory/query.ts +754 -0
- package/src/storage/objects/in-memory/read-scope.ts +211 -0
- package/src/storage/objects/in-memory/read-source.ts +10 -0
- package/src/storage/objects/in-memory/selected-reader.ts +252 -0
- package/src/storage/objects/in-memory/storage.ts +589 -0
- package/src/storage/objects/index.ts +21 -0
- package/src/storage/objects/keys.ts +1 -1
- package/src/storage/objects/read-scope.ts +672 -0
- package/src/storage/objects/types.ts +123 -19
- package/src/storage/operation-scope.ts +16 -0
- package/src/storage/share-grants/errors.ts +14 -0
- package/src/storage/share-grants/in-memory.ts +107 -0
- package/src/storage/share-grants/index.ts +14 -0
- package/src/storage/share-grants/provider.ts +11 -0
- package/src/storage/share-grants/record.ts +347 -0
- package/src/storage/share-grants/types.ts +112 -0
- package/src/storage/share-sessions/errors.ts +14 -0
- package/src/storage/share-sessions/in-memory.ts +105 -0
- package/src/storage/share-sessions/index.ts +11 -0
- package/src/storage/share-sessions/provider.ts +9 -0
- package/src/storage/share-sessions/record.ts +176 -0
- package/src/storage/share-sessions/types.ts +57 -0
- package/src/storage/transaction.ts +14 -2
- package/src/storage/types.ts +27 -0
- package/src/syncs/execution.ts +25 -5
- package/src/syncs/request.ts +5 -0
- package/src/testing/dataset-sequence-contract.ts +373 -0
- package/src/testing/effective-storage-contract.ts +34 -0
- package/src/testing/execution-storage-contract.ts +79 -0
- package/src/testing/index.ts +16 -0
- package/src/testing/lake-merge-storage-contract.ts +3 -0
- package/src/testing/lake-storage-contract.ts +58 -0
- package/src/testing/object-read-scope-contract.ts +939 -0
- package/src/testing/share-grant-storage-contract.ts +325 -0
- package/src/testing/share-session-storage-contract.ts +235 -0
- package/src/workflows/execution.ts +53 -14
- package/src/workflows/request.ts +5 -0
- package/dist/chunk-2b5qtban.js.map +0 -14
- package/dist/chunk-37wk412q.js.map +0 -23
- package/dist/chunk-3fqt22c4.js.map +0 -14
- package/dist/chunk-3kv70xwp.js.map +0 -10
- package/dist/chunk-64sr682n.js.map +0 -12
- package/dist/chunk-7ds9620f.js.map +0 -10
- package/dist/chunk-dqn23610.js +0 -72
- package/dist/chunk-dqn23610.js.map +0 -11
- package/dist/chunk-e4rvtvpw.js.map +0 -34
- package/dist/chunk-gbrpsx4m.js.map +0 -11
- package/dist/chunk-h0knpbz5.js.map +0 -38
- package/dist/chunk-hdz94br2.js.map +0 -10
- package/dist/chunk-n2arzn6e.js.map +0 -20
- package/dist/chunk-qjzp9xyb.js.map +0 -12
- package/dist/chunk-tn7xcs2n.js.map +0 -13
- package/dist/chunk-wjgm6jjt.js.map +0 -13
- package/dist/chunk-xc7hq65b.js.map +0 -10
- package/dist/chunk-y35ma3mj.js +0 -551
- package/dist/chunk-y35ma3mj.js.map +0 -15
- package/dist/chunk-z2sery1b.js.map +0 -11
- package/dist/storage/objects/in-memory.d.ts.map +0 -1
- package/src/storage/objects/in-memory.ts +0 -1241
- /package/dist/{chunk-5jcdmjam.js.map → chunk-4jjp5k14.js.map} +0 -0
- /package/dist/{chunk-agsvg9ar.js.map → chunk-5ntny1qx.js.map} +0 -0
- /package/dist/{chunk-9aehf39w.js.map → chunk-f26bck4t.js.map} +0 -0
- /package/dist/{chunk-08twe8m6.js.map → chunk-p1rzczbt.js.map} +0 -0
- /package/dist/{chunk-xdpwpkha.js.map → chunk-rv2hkwwa.js.map} +0 -0
- /package/dist/{chunk-1kamz6j0.js.map → chunk-w1tvjszy.js.map} +0 -0
- /package/dist/{chunk-4nxeacx7.js.map → chunk-wdage1eb.js.map} +0 -0
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
import type { ActionDefinition } from "../../actions"
|
|
8
8
|
import type { AuthorizationContext } from "../../authorization"
|
|
9
|
-
import { assertAuthorized } from "../../authorization"
|
|
10
9
|
import { shareSixbErrorReporter } from "../../error-reporting/capability"
|
|
11
10
|
import type { ExecutionContext } from "../../execution"
|
|
11
|
+
import { assertAuthorizedObjectReaderBinding } from "../../execution/authorized-object-reader"
|
|
12
12
|
import type { ValueType } from "../../ontology"
|
|
13
13
|
import { OntologyValidationError } from "../../ontology/errors"
|
|
14
14
|
import type { ObjectTypeWithPropertyTokens } from "../../ontology/tokens"
|
|
@@ -43,6 +43,10 @@ export function createObjectSet<
|
|
|
43
43
|
readonly authorization?: AuthorizationContext
|
|
44
44
|
}
|
|
45
45
|
): ObjectSet<TObjectType, TValueTypes, TRegisteredObjectTypes> {
|
|
46
|
+
assertAuthorizedObjectReaderBinding({
|
|
47
|
+
reader: params.objectReader,
|
|
48
|
+
scope: { execution: params.execution, authorization: params.runtimeAuthorization },
|
|
49
|
+
})
|
|
46
50
|
const { objectType } = params
|
|
47
51
|
const primaryProp = objectType.properties.find((p) => p.primary)
|
|
48
52
|
if (!primaryProp) {
|
|
@@ -58,16 +62,14 @@ export function createObjectSet<
|
|
|
58
62
|
events,
|
|
59
63
|
storage,
|
|
60
64
|
queues,
|
|
65
|
+
objectReader,
|
|
61
66
|
runtimeAuthorization,
|
|
62
67
|
authorization,
|
|
63
68
|
execution,
|
|
64
69
|
} = params
|
|
65
70
|
const queryExecutor = createRuntimeQueryExecutor({
|
|
66
|
-
projectId,
|
|
67
71
|
ontology,
|
|
68
|
-
|
|
69
|
-
runtimeAuthorization,
|
|
70
|
-
authorization,
|
|
72
|
+
objectReader,
|
|
71
73
|
})
|
|
72
74
|
|
|
73
75
|
const resolvedCtx: ExecutionObjectContext = {
|
|
@@ -78,6 +80,7 @@ export function createObjectSet<
|
|
|
78
80
|
events,
|
|
79
81
|
storage,
|
|
80
82
|
queues,
|
|
83
|
+
objectReader,
|
|
81
84
|
runtimeAuthorization,
|
|
82
85
|
authorization,
|
|
83
86
|
execution,
|
|
@@ -89,9 +92,7 @@ export function createObjectSet<
|
|
|
89
92
|
|
|
90
93
|
const objectSet = {
|
|
91
94
|
get: async (id: string) => {
|
|
92
|
-
|
|
93
|
-
const row = await storage.objects.getByPrimaryId({
|
|
94
|
-
projectId,
|
|
95
|
+
const row = await objectReader.getByPrimaryId({
|
|
95
96
|
objectTypeId: objectType.id,
|
|
96
97
|
primaryId: id,
|
|
97
98
|
})
|
|
@@ -112,9 +113,7 @@ export function createObjectSet<
|
|
|
112
113
|
byId: (id: string) => createObjectByIdHandle<TObjectType, TValueTypes>(resolvedCtx, id),
|
|
113
114
|
|
|
114
115
|
list: async (input?: ObjectSetListInput) => {
|
|
115
|
-
|
|
116
|
-
const result = await storage.objects.list({
|
|
117
|
-
projectId,
|
|
116
|
+
const result = await objectReader.list({
|
|
118
117
|
objectTypeId: objectType.id,
|
|
119
118
|
primaryIdPrefix: input?.idPrefix,
|
|
120
119
|
primaryIdSuffix: input?.idSuffix,
|
|
@@ -4,44 +4,24 @@
|
|
|
4
4
|
* HTTP executor in `@sixb/client` is the remote counterpart.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
import type { RuntimeAuthorization } from "../../execution/types"
|
|
7
|
+
import type { AuthorizedObjectReader } from "../../execution/authorized-object-reader"
|
|
9
8
|
import type { OntologyRegistry } from "../../ontology"
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
countObjects,
|
|
13
|
-
executeObjectQuery,
|
|
14
|
-
existsObjects,
|
|
15
|
-
facetObjects,
|
|
16
|
-
ObjectQueryPlanningError,
|
|
17
|
-
} from "../query"
|
|
9
|
+
import { ObjectQueryPlanningError } from "../query"
|
|
18
10
|
import { explainObjectQuery } from "../query/explain"
|
|
19
11
|
import type { ObjectQuery } from "../query/ir"
|
|
20
12
|
import { validateObjectQuery } from "../query/validate"
|
|
21
13
|
import type { ObjectQueryExecutor, ObjectQueryExecutorFacetRequest } from "./query-executor"
|
|
22
14
|
|
|
23
15
|
export function createRuntimeQueryExecutor(params: {
|
|
24
|
-
projectId: string
|
|
25
16
|
ontology: OntologyRegistry
|
|
26
|
-
|
|
27
|
-
runtimeAuthorization?: RuntimeAuthorization
|
|
28
|
-
authorization?: AuthorizationContext
|
|
17
|
+
objectReader: AuthorizedObjectReader
|
|
29
18
|
}): ObjectQueryExecutor {
|
|
30
|
-
const {
|
|
31
|
-
const executorOptions = {
|
|
32
|
-
ontology,
|
|
33
|
-
storage: storage.objects,
|
|
34
|
-
runtimeAuthorization,
|
|
35
|
-
authorization,
|
|
36
|
-
}
|
|
19
|
+
const { ontology, objectReader } = params
|
|
37
20
|
|
|
38
21
|
return {
|
|
39
22
|
async list(query: ObjectQuery, options?: { includeTotal?: boolean }) {
|
|
40
23
|
try {
|
|
41
|
-
return await
|
|
42
|
-
{ projectId, query, includeTotal: options?.includeTotal },
|
|
43
|
-
executorOptions
|
|
44
|
-
)
|
|
24
|
+
return await objectReader.executeQuery({ query, includeTotal: options?.includeTotal })
|
|
45
25
|
} catch (error) {
|
|
46
26
|
if (error instanceof ObjectQueryPlanningError) {
|
|
47
27
|
throw addSdkPlanningHints(error)
|
|
@@ -51,17 +31,17 @@ export function createRuntimeQueryExecutor(params: {
|
|
|
51
31
|
},
|
|
52
32
|
|
|
53
33
|
async count(query: ObjectQuery) {
|
|
54
|
-
const result = await
|
|
34
|
+
const result = await objectReader.count({ query })
|
|
55
35
|
return result.count
|
|
56
36
|
},
|
|
57
37
|
|
|
58
38
|
async exists(query: ObjectQuery) {
|
|
59
|
-
const result = await
|
|
39
|
+
const result = await objectReader.exists({ query })
|
|
60
40
|
return result.exists
|
|
61
41
|
},
|
|
62
42
|
|
|
63
43
|
async facets(query: ObjectQuery, facets: readonly ObjectQueryExecutorFacetRequest[]) {
|
|
64
|
-
const result = await
|
|
44
|
+
const result = await objectReader.facet({ query, facets })
|
|
65
45
|
return result.facets.map((facet) => ({
|
|
66
46
|
propertyId: facet.propertyId,
|
|
67
47
|
buckets: [...facet.buckets],
|
|
@@ -51,23 +51,27 @@ export function createTelemetryChannel<
|
|
|
51
51
|
|
|
52
52
|
history: async (input: TelemetryHistoryInput = {}) => {
|
|
53
53
|
const timeseries = ctx.storage.timeseries
|
|
54
|
+
const objectReader = ctx.objectReader
|
|
54
55
|
if (!timeseries) {
|
|
55
56
|
throw new RuntimeError("[Sixb] Reading telemetry requires storage.timeseries support.")
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
const from = input.from
|
|
60
|
+
const to = input.to
|
|
61
|
+
const limit = input.limit
|
|
62
|
+
const order = input.order
|
|
63
|
+
|
|
58
64
|
const [result] = await getTelemetryHistoryBatch(
|
|
59
65
|
{
|
|
60
|
-
projectId: ctx.projectId,
|
|
61
66
|
series: [series],
|
|
62
|
-
...(
|
|
63
|
-
...(
|
|
64
|
-
...(
|
|
65
|
-
...(
|
|
67
|
+
...(from !== undefined ? { from } : {}),
|
|
68
|
+
...(to !== undefined ? { to } : {}),
|
|
69
|
+
...(limit !== undefined ? { limitPerSeries: limit } : {}),
|
|
70
|
+
...(order !== undefined ? { order } : {}),
|
|
66
71
|
},
|
|
67
72
|
{
|
|
68
73
|
storage: timeseries,
|
|
69
|
-
|
|
70
|
-
authorization: ctx.authorization,
|
|
74
|
+
objectReader,
|
|
71
75
|
}
|
|
72
76
|
)
|
|
73
77
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cross-type object listing for dashboards and search.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* narrow to the principal's viewable types instead of post-filtering rows.
|
|
4
|
+
* Type hierarchies are expanded before the request reaches the canonical object
|
|
5
|
+
* reader, which owns authorization and provider-scope enforcement.
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
import {
|
|
8
|
+
import { resolveRuntimeAuthorizationForProject } from "../../execution/authorization"
|
|
9
|
+
import { getAuthorizedOntologyView } from "../../execution/authorized-object-reader"
|
|
10
10
|
import type { ListResult, SixbRuntimeContext } from "../../runtime/types"
|
|
11
11
|
import type { ObjectRow } from "../../storage"
|
|
12
12
|
|
|
@@ -28,14 +28,13 @@ export async function listObjects(
|
|
|
28
28
|
runtime: SixbRuntimeContext,
|
|
29
29
|
params: ListObjectsParams
|
|
30
30
|
): Promise<ListResult<ObjectRow>> {
|
|
31
|
-
const objectTypeIds =
|
|
31
|
+
const objectTypeIds = resolveTypeFilter(runtime, params.objectTypeIds)
|
|
32
32
|
|
|
33
|
-
if (
|
|
33
|
+
if (objectTypeIds !== undefined && objectTypeIds.length === 0) {
|
|
34
34
|
return { objects: [], hasMore: false, total: 0 }
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const result = await runtime.
|
|
38
|
-
projectId: runtime.projectId,
|
|
37
|
+
const result = await runtime.objectReader.list({
|
|
39
38
|
objectTypeId: objectTypeIds?.length === 1 ? objectTypeIds[0] : objectTypeIds,
|
|
40
39
|
primaryIdPrefix: params.idPrefix,
|
|
41
40
|
primaryIdSuffix: params.idSuffix,
|
|
@@ -56,34 +55,21 @@ export async function listObjects(
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
function
|
|
58
|
+
function resolveTypeFilter(
|
|
60
59
|
runtime: SixbRuntimeContext,
|
|
61
60
|
requested: readonly string[] | undefined
|
|
62
61
|
): readonly string[] | undefined {
|
|
62
|
+
const ontology =
|
|
63
|
+
resolveRuntimeAuthorizationForProject(runtime).type === "delegated"
|
|
64
|
+
? getAuthorizedOntologyView(runtime.objectReader)
|
|
65
|
+
: runtime.ontology
|
|
63
66
|
if (requested) {
|
|
64
67
|
for (const objectTypeId of requested) {
|
|
65
|
-
|
|
68
|
+
ontology.resolveObjectType(objectTypeId)
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
? [...new Set(requested.flatMap((id) => [id, ...
|
|
72
|
+
return requested
|
|
73
|
+
? [...new Set(requested.flatMap((id) => [id, ...ontology.listSubTypes(id)]))]
|
|
71
74
|
: undefined
|
|
72
|
-
|
|
73
|
-
if (!runtime.authorization) {
|
|
74
|
-
return expanded
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!expanded) {
|
|
78
|
-
// Broad listings narrow to the visible universe rather than failing. The
|
|
79
|
-
// set already contains every registered type when "all" was granted.
|
|
80
|
-
return [...runtime.authorization.grants["view:object"]]
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Explicitly requested types must all be viewable.
|
|
84
|
-
for (const objectTypeId of expanded) {
|
|
85
|
-
assertAuthorized(runtime, { kind: "object.view", objectTypeId })
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return expanded
|
|
89
75
|
}
|
|
@@ -1,37 +1,317 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { createSixbError } from "../../errors/internal"
|
|
2
|
+
import type { AuthorizedObjectReader } from "../../execution/authorized-object-reader"
|
|
3
3
|
import type {
|
|
4
4
|
TimeseriesHistoryBatchInput,
|
|
5
5
|
TimeseriesHistoryBatchResult,
|
|
6
6
|
TimeseriesHistorySeriesInput,
|
|
7
|
+
TimeseriesPoint,
|
|
7
8
|
TimeseriesStorage,
|
|
8
9
|
} from "../../storage"
|
|
9
10
|
|
|
10
11
|
export interface TelemetryHistoryOptions {
|
|
11
12
|
readonly storage: TimeseriesStorage
|
|
12
|
-
readonly
|
|
13
|
-
readonly authorization?: AuthorizationContext | null
|
|
13
|
+
readonly objectReader: AuthorizedObjectReader
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
export type TelemetryHistoryBatchInput = Omit<TimeseriesHistoryBatchInput, "projectId">
|
|
17
|
+
|
|
18
|
+
interface SnapshotTelemetryHistoryRequest extends TelemetryHistoryBatchInput {
|
|
19
|
+
readonly maxPointOccurrences?: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Read only series selected for the exact object occurrence carried by the nominal reader. */
|
|
16
23
|
export async function getTelemetryHistoryBatch(
|
|
17
|
-
input:
|
|
24
|
+
input: TelemetryHistoryBatchInput,
|
|
18
25
|
options: TelemetryHistoryOptions
|
|
19
26
|
): Promise<readonly TimeseriesHistoryBatchResult[]> {
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
// Capture both provider capabilities before reading caller-owned request fields.
|
|
28
|
+
const objectReader = options.objectReader
|
|
29
|
+
const storage = options.storage
|
|
30
|
+
const projectId = objectReader.projectId
|
|
31
|
+
const request = snapshotTelemetryHistoryInput(input, objectReader)
|
|
32
|
+
|
|
33
|
+
const uniqueSeries = deduplicateSeries(request.series)
|
|
34
|
+
const readableSeries = await selectReadableSeries(uniqueSeries, objectReader)
|
|
35
|
+
const resultsBySeries = await readAndValidateHistory({
|
|
36
|
+
storage,
|
|
37
|
+
projectId,
|
|
38
|
+
request,
|
|
39
|
+
series: readableSeries,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// Objects and telemetry do not share a portable read snapshot. Recheck live selection after
|
|
43
|
+
// all provider-owned values have been detached, before deciding which points to return.
|
|
44
|
+
const releasableSeries =
|
|
45
|
+
readableSeries.length === 0 ? [] : await selectReadableSeries(readableSeries, objectReader)
|
|
46
|
+
const result = assembleHistoryResults({ request, resultsBySeries, releasableSeries })
|
|
47
|
+
objectReader.assertVisibleOutputWithinLimit(result)
|
|
48
|
+
return result
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Read the latest point only while its exact object property remains selected. */
|
|
52
|
+
export async function getLatestTelemetryPoint(
|
|
53
|
+
input: TimeseriesHistorySeriesInput,
|
|
54
|
+
options: TelemetryHistoryOptions
|
|
55
|
+
): Promise<TimeseriesPoint | null> {
|
|
56
|
+
const objectReader = options.objectReader
|
|
57
|
+
const storage = options.storage
|
|
58
|
+
const projectId = objectReader.projectId
|
|
59
|
+
const series = snapshotTelemetrySeries(input)
|
|
60
|
+
const readable = await objectReader.canReadObjectProperty(objectPropertySelection(series))
|
|
61
|
+
if (!readable) return visibleLatestResult(null, objectReader)
|
|
62
|
+
|
|
63
|
+
const rawResult = await storage.getLatest({ projectId, ...series })
|
|
64
|
+
const result = rawResult === null ? null : snapshotProviderPoint(rawResult)
|
|
65
|
+
if (result) assertTimeseriesPointMatchesSeries(projectId, series, result)
|
|
66
|
+
|
|
67
|
+
// See the batch release check above. Revocation during the timeseries read hides the result.
|
|
68
|
+
const releaseReadable = await objectReader.canReadObjectProperty(objectPropertySelection(series))
|
|
69
|
+
if (!releaseReadable) return visibleLatestResult(null, objectReader)
|
|
70
|
+
|
|
71
|
+
return visibleLatestResult(result, objectReader)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function deduplicateSeries(
|
|
75
|
+
series: readonly TimeseriesHistorySeriesInput[]
|
|
76
|
+
): TimeseriesHistorySeriesInput[] {
|
|
77
|
+
const uniqueSeries = new Map<string, TimeseriesHistorySeriesInput>()
|
|
78
|
+
for (const item of series) {
|
|
79
|
+
const key = seriesKey(item)
|
|
80
|
+
if (!uniqueSeries.has(key)) uniqueSeries.set(key, item)
|
|
81
|
+
}
|
|
82
|
+
return [...uniqueSeries.values()]
|
|
22
83
|
}
|
|
23
84
|
|
|
24
|
-
function
|
|
85
|
+
async function selectReadableSeries(
|
|
25
86
|
series: readonly TimeseriesHistorySeriesInput[],
|
|
26
|
-
|
|
87
|
+
objectReader: AuthorizedObjectReader
|
|
88
|
+
): Promise<readonly TimeseriesHistorySeriesInput[]> {
|
|
89
|
+
const readable = await objectReader.canReadObjectPropertiesBatch({
|
|
90
|
+
items: series.map(objectPropertySelection),
|
|
91
|
+
})
|
|
92
|
+
return series.filter((_, index) => readable[index] === true)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function readAndValidateHistory(input: {
|
|
96
|
+
readonly storage: TimeseriesStorage
|
|
97
|
+
readonly projectId: string
|
|
98
|
+
readonly request: SnapshotTelemetryHistoryRequest
|
|
99
|
+
readonly series: readonly TimeseriesHistorySeriesInput[]
|
|
100
|
+
}): Promise<ReadonlyMap<string, TimeseriesHistoryBatchResult>> {
|
|
101
|
+
const { storage, projectId, request, series } = input
|
|
102
|
+
|
|
103
|
+
// The provider receives its own detached request. It must never retain or mutate the canonical
|
|
104
|
+
// series snapshot that admission and the final release check rely on.
|
|
105
|
+
const providerRequest = structuredClone({
|
|
106
|
+
projectId,
|
|
107
|
+
series,
|
|
108
|
+
...(request.from === undefined ? {} : { from: request.from }),
|
|
109
|
+
...(request.to === undefined ? {} : { to: request.to }),
|
|
110
|
+
...(request.limitPerSeries === undefined ? {} : { limitPerSeries: request.limitPerSeries }),
|
|
111
|
+
...(request.order === undefined ? {} : { order: request.order }),
|
|
112
|
+
})
|
|
113
|
+
const stored = series.length === 0 ? [] : await storage.getHistoryBatch(providerRequest)
|
|
114
|
+
|
|
115
|
+
// Fully detach and validate provider-owned data before the final live check. A provider result
|
|
116
|
+
// may contain accessors or a custom iterator; none of that code may run after release admission.
|
|
117
|
+
if (!Array.isArray(stored)) throw invalidTimeseriesProviderResult()
|
|
118
|
+
const storedCount = stored.length
|
|
119
|
+
if (!Number.isSafeInteger(storedCount) || storedCount > series.length) {
|
|
120
|
+
throw invalidTimeseriesProviderResult()
|
|
121
|
+
}
|
|
122
|
+
const seriesKeys = new Set(series.map(seriesKey))
|
|
123
|
+
const providerResultBySeries = new Map<string, TimeseriesHistoryBatchResult>()
|
|
124
|
+
for (let index = 0; index < storedCount; index += 1) {
|
|
125
|
+
const providerResult = snapshotProviderResult(stored[index]!, request.limitPerSeries)
|
|
126
|
+
const key = seriesKey(providerResult)
|
|
127
|
+
if (providerResultBySeries.has(key) || !seriesKeys.has(key)) {
|
|
128
|
+
throw invalidTimeseriesProviderResult()
|
|
129
|
+
}
|
|
130
|
+
for (const point of providerResult.points) {
|
|
131
|
+
assertTimeseriesPointMatchesSeries(projectId, providerResult, point)
|
|
132
|
+
}
|
|
133
|
+
providerResultBySeries.set(key, providerResult)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return providerResultBySeries
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Restore request order and duplicates, with independent point copies for every occurrence. */
|
|
140
|
+
function assembleHistoryResults(input: {
|
|
141
|
+
readonly request: SnapshotTelemetryHistoryRequest
|
|
142
|
+
readonly resultsBySeries: ReadonlyMap<string, TimeseriesHistoryBatchResult>
|
|
143
|
+
readonly releasableSeries: readonly TimeseriesHistorySeriesInput[]
|
|
144
|
+
}): readonly TimeseriesHistoryBatchResult[] {
|
|
145
|
+
const { request, resultsBySeries, releasableSeries } = input
|
|
146
|
+
const releasableSeriesKeys = new Set(releasableSeries.map(seriesKey))
|
|
147
|
+
const releasedPoints = request.series.map((series) =>
|
|
148
|
+
releasableSeriesKeys.has(seriesKey(series))
|
|
149
|
+
? (resultsBySeries.get(seriesKey(series))?.points ?? [])
|
|
150
|
+
: []
|
|
151
|
+
)
|
|
152
|
+
const pointOccurrences = releasedPoints.reduce((total, points) => total + points.length, 0)
|
|
153
|
+
if (request.maxPointOccurrences !== undefined && pointOccurrences > request.maxPointOccurrences) {
|
|
154
|
+
throw invalidTimeseriesProviderResult()
|
|
155
|
+
}
|
|
156
|
+
return request.series.map((series, index) => ({
|
|
157
|
+
...series,
|
|
158
|
+
points: releasedPoints[index]!.map((point) => structuredClone(point)),
|
|
159
|
+
}))
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function snapshotTelemetrySeries(
|
|
163
|
+
series: TimeseriesHistorySeriesInput
|
|
164
|
+
): TimeseriesHistorySeriesInput {
|
|
165
|
+
if (typeof series !== "object" || series === null || Array.isArray(series)) {
|
|
166
|
+
throw new Error("[Sixb] Telemetry history series must be an object.")
|
|
167
|
+
}
|
|
168
|
+
const objectTypeId = telemetryIdentifier(series.objectTypeId, "objectTypeId")
|
|
169
|
+
const objectId = telemetryIdentifier(series.objectId, "objectId")
|
|
170
|
+
const propertyId = telemetryIdentifier(series.propertyId, "propertyId")
|
|
171
|
+
return structuredClone({ objectTypeId, objectId, propertyId })
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function assertTimeseriesPointMatchesSeries(
|
|
175
|
+
projectId: string,
|
|
176
|
+
series: TimeseriesHistorySeriesInput,
|
|
177
|
+
point: TimeseriesPoint
|
|
27
178
|
): void {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
179
|
+
if (
|
|
180
|
+
typeof point !== "object" ||
|
|
181
|
+
point === null ||
|
|
182
|
+
point.projectId !== projectId ||
|
|
183
|
+
point.objectTypeId !== series.objectTypeId ||
|
|
184
|
+
point.objectId !== series.objectId ||
|
|
185
|
+
point.propertyId !== series.propertyId
|
|
186
|
+
) {
|
|
187
|
+
throw invalidTimeseriesProviderResult()
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function snapshotTelemetryHistoryInput(
|
|
192
|
+
input: TelemetryHistoryBatchInput,
|
|
193
|
+
objectReader: AuthorizedObjectReader
|
|
194
|
+
): SnapshotTelemetryHistoryRequest {
|
|
195
|
+
const authoredSeries = input.series
|
|
196
|
+
const from = input.from
|
|
197
|
+
const to = input.to
|
|
198
|
+
const limitPerSeries = input.limitPerSeries
|
|
199
|
+
const order = input.order
|
|
200
|
+
if (!Array.isArray(authoredSeries)) {
|
|
201
|
+
throw new Error("[Sixb] Telemetry history series must be an array.")
|
|
202
|
+
}
|
|
203
|
+
if (order !== undefined && order !== "asc" && order !== "desc") {
|
|
204
|
+
throw new Error("[Sixb] Telemetry history order must be 'asc' or 'desc'.")
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Capture length once and walk by index so proxies cannot change the iteration shape halfway.
|
|
208
|
+
const seriesCount = authoredSeries.length
|
|
209
|
+
const admission = objectReader.admitTelemetryHistoryRead({
|
|
210
|
+
seriesCount,
|
|
211
|
+
...(limitPerSeries === undefined ? {} : { limitPerSeries }),
|
|
212
|
+
})
|
|
213
|
+
const series: TimeseriesHistorySeriesInput[] = []
|
|
214
|
+
for (let index = 0; index < seriesCount; index += 1) {
|
|
215
|
+
series.push(snapshotTelemetrySeries(authoredSeries[index]!))
|
|
216
|
+
}
|
|
217
|
+
return structuredClone({
|
|
218
|
+
series,
|
|
219
|
+
...(from === undefined ? {} : { from }),
|
|
220
|
+
...(to === undefined ? {} : { to }),
|
|
221
|
+
...(admission.limitPerSeries === undefined ? {} : { limitPerSeries: admission.limitPerSeries }),
|
|
222
|
+
...(order === undefined ? {} : { order }),
|
|
223
|
+
...(admission.maxPointOccurrences === undefined
|
|
224
|
+
? {}
|
|
225
|
+
: { maxPointOccurrences: admission.maxPointOccurrences }),
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function objectPropertySelection(series: TimeseriesHistorySeriesInput): {
|
|
230
|
+
readonly objectTypeId: string
|
|
231
|
+
readonly primaryId: string
|
|
232
|
+
readonly propertyId: string
|
|
233
|
+
} {
|
|
234
|
+
return {
|
|
235
|
+
objectTypeId: series.objectTypeId,
|
|
236
|
+
primaryId: series.objectId,
|
|
237
|
+
propertyId: series.propertyId,
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function visibleLatestResult<T extends TimeseriesPoint | null>(
|
|
242
|
+
result: T,
|
|
243
|
+
objectReader: AuthorizedObjectReader
|
|
244
|
+
): T {
|
|
245
|
+
objectReader.assertVisibleOutputWithinLimit(result)
|
|
246
|
+
return result
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function snapshotProviderResult(
|
|
250
|
+
result: TimeseriesHistoryBatchResult,
|
|
251
|
+
maxPointsPerSeries: number | undefined
|
|
252
|
+
): TimeseriesHistoryBatchResult {
|
|
253
|
+
try {
|
|
254
|
+
if (typeof result !== "object" || result === null || Array.isArray(result)) {
|
|
255
|
+
throw invalidTimeseriesProviderResult()
|
|
256
|
+
}
|
|
257
|
+
const series = snapshotTelemetrySeries(result)
|
|
258
|
+
const authoredPoints = result.points
|
|
259
|
+
if (!Array.isArray(authoredPoints)) throw invalidTimeseriesProviderResult()
|
|
260
|
+
const pointCount = authoredPoints.length
|
|
261
|
+
if (
|
|
262
|
+
!Number.isSafeInteger(pointCount) ||
|
|
263
|
+
(maxPointsPerSeries !== undefined && pointCount > maxPointsPerSeries)
|
|
264
|
+
) {
|
|
265
|
+
throw invalidTimeseriesProviderResult()
|
|
266
|
+
}
|
|
267
|
+
const points: TimeseriesPoint[] = []
|
|
268
|
+
for (let index = 0; index < pointCount; index += 1) {
|
|
269
|
+
points.push(snapshotProviderPoint(authoredPoints[index]!))
|
|
270
|
+
}
|
|
271
|
+
return { ...series, points }
|
|
272
|
+
} catch (error) {
|
|
273
|
+
if (isInvalidTimeseriesProviderResult(error)) throw error
|
|
274
|
+
throw invalidTimeseriesProviderResult(error)
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function snapshotProviderPoint(point: TimeseriesPoint): TimeseriesPoint {
|
|
279
|
+
try {
|
|
280
|
+
const snapshot = structuredClone(point)
|
|
281
|
+
if (!snapshot || typeof snapshot !== "object") throw invalidTimeseriesProviderResult()
|
|
282
|
+
return snapshot
|
|
283
|
+
} catch (error) {
|
|
284
|
+
if (isInvalidTimeseriesProviderResult(error)) throw error
|
|
285
|
+
throw invalidTimeseriesProviderResult(error)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function invalidTimeseriesProviderResult(cause?: unknown): Error {
|
|
290
|
+
return createSixbError(
|
|
291
|
+
"internal.unexpected",
|
|
292
|
+
"[Sixb] Timeseries storage returned data outside the requested series.",
|
|
293
|
+
cause === undefined ? {} : { cause }
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function isInvalidTimeseriesProviderResult(
|
|
298
|
+
error: unknown
|
|
299
|
+
): error is Error & { readonly code: "internal.unexpected" } {
|
|
300
|
+
return (
|
|
301
|
+
error instanceof Error &&
|
|
302
|
+
"code" in error &&
|
|
303
|
+
error.code === "internal.unexpected" &&
|
|
304
|
+
error.message === "[Sixb] Timeseries storage returned data outside the requested series."
|
|
305
|
+
)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function telemetryIdentifier(value: unknown, field: string): string {
|
|
309
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
310
|
+
throw new Error(`[Sixb] Telemetry history ${field} must be a non-empty string.`)
|
|
36
311
|
}
|
|
312
|
+
return value
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function seriesKey(series: TimeseriesHistorySeriesInput): string {
|
|
316
|
+
return JSON.stringify([series.objectTypeId, series.objectId, series.propertyId])
|
|
37
317
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { appendTelemetryBatch } from "./append-batch"
|
|
2
|
-
export type { TelemetryHistoryOptions } from "./history"
|
|
3
|
-
export { getTelemetryHistoryBatch } from "./history"
|
|
2
|
+
export type { TelemetryHistoryBatchInput, TelemetryHistoryOptions } from "./history"
|
|
3
|
+
export { getLatestTelemetryPoint, getTelemetryHistoryBatch } from "./history"
|
|
4
4
|
export { writeTelemetryBatch } from "./write-batch"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const MAX_DELEGATED_TELEMETRY_HISTORY_SERIES = 100
|
|
2
|
+
const MAX_DELEGATED_TELEMETRY_HISTORY_POINTS = 10_000
|
|
3
|
+
const DEFAULT_DELEGATED_TELEMETRY_HISTORY_LIMIT_PER_SERIES = 100
|
|
4
|
+
|
|
5
|
+
export interface TelemetryHistoryReadWorkloadInput {
|
|
6
|
+
readonly seriesCount: number
|
|
7
|
+
readonly limitPerSeries?: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TelemetryHistoryReadAdmission {
|
|
11
|
+
readonly limitPerSeries?: number
|
|
12
|
+
readonly maxPointOccurrences?: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type TelemetryHistoryWorkloadMetric = "series" | "points"
|
|
16
|
+
|
|
17
|
+
class TelemetryHistoryWorkloadExceededError extends Error {
|
|
18
|
+
readonly name = "TelemetryHistoryWorkloadExceededError"
|
|
19
|
+
readonly code = "telemetry_history_workload_exceeded"
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
readonly metric: TelemetryHistoryWorkloadMetric,
|
|
23
|
+
readonly limit: number
|
|
24
|
+
) {
|
|
25
|
+
super(`[Sixb] Delegated telemetry history exceeded its ${metric} limit (${limit}).`)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Resolve one history request without exposing the authority that selected its policy. */
|
|
30
|
+
export function admitTelemetryHistoryReadWorkload(
|
|
31
|
+
input: TelemetryHistoryReadWorkloadInput,
|
|
32
|
+
delegated: boolean
|
|
33
|
+
): TelemetryHistoryReadAdmission {
|
|
34
|
+
const seriesCount = input.seriesCount
|
|
35
|
+
const limitPerSeries = input.limitPerSeries
|
|
36
|
+
if (!Number.isSafeInteger(seriesCount) || seriesCount < 0) {
|
|
37
|
+
throw new Error("[Sixb] Telemetry history series must have a non-negative safe integer length.")
|
|
38
|
+
}
|
|
39
|
+
if (
|
|
40
|
+
limitPerSeries !== undefined &&
|
|
41
|
+
(!Number.isSafeInteger(limitPerSeries) || limitPerSeries < 0)
|
|
42
|
+
) {
|
|
43
|
+
throw new Error("[Sixb] Telemetry history limit must be a non-negative safe integer.")
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!delegated) {
|
|
47
|
+
const admission: TelemetryHistoryReadAdmission =
|
|
48
|
+
limitPerSeries === undefined ? {} : { limitPerSeries }
|
|
49
|
+
return Object.freeze(admission)
|
|
50
|
+
}
|
|
51
|
+
if (seriesCount > MAX_DELEGATED_TELEMETRY_HISTORY_SERIES) {
|
|
52
|
+
throw new TelemetryHistoryWorkloadExceededError(
|
|
53
|
+
"series",
|
|
54
|
+
MAX_DELEGATED_TELEMETRY_HISTORY_SERIES
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
if (seriesCount === 0) {
|
|
58
|
+
return Object.freeze({
|
|
59
|
+
...(limitPerSeries === undefined ? {} : { limitPerSeries }),
|
|
60
|
+
maxPointOccurrences: MAX_DELEGATED_TELEMETRY_HISTORY_POINTS,
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const maxLimitPerSeries = Math.floor(MAX_DELEGATED_TELEMETRY_HISTORY_POINTS / seriesCount)
|
|
65
|
+
const effectiveLimitPerSeries =
|
|
66
|
+
limitPerSeries ??
|
|
67
|
+
Math.min(DEFAULT_DELEGATED_TELEMETRY_HISTORY_LIMIT_PER_SERIES, maxLimitPerSeries)
|
|
68
|
+
if (effectiveLimitPerSeries > maxLimitPerSeries) {
|
|
69
|
+
throw new TelemetryHistoryWorkloadExceededError(
|
|
70
|
+
"points",
|
|
71
|
+
MAX_DELEGATED_TELEMETRY_HISTORY_POINTS
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return Object.freeze({
|
|
76
|
+
limitPerSeries: effectiveLimitPerSeries,
|
|
77
|
+
maxPointOccurrences: MAX_DELEGATED_TELEMETRY_HISTORY_POINTS,
|
|
78
|
+
})
|
|
79
|
+
}
|