@vertesia/common 1.5.0-dev.20260807.073259Z → 1.5.0-dev.20260901.005903Z
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/lib/access-control.d.ts +0 -14
- package/lib/access-control.d.ts.map +1 -1
- package/lib/access-control.js +0 -23
- package/lib/access-control.js.map +1 -1
- package/lib/account-values.d.ts +0 -10
- package/lib/account-values.d.ts.map +1 -1
- package/lib/account-values.js +0 -44
- package/lib/account-values.js.map +1 -1
- package/lib/api-contract/components.generated.json +40405 -0
- package/lib/api-contract/index.d.ts +186 -0
- package/lib/api-contract/index.d.ts.map +1 -0
- package/lib/api-contract/index.js +554 -0
- package/lib/api-contract/index.js.map +1 -0
- package/lib/api-schemas/agent-communication.d.ts +199 -0
- package/lib/api-schemas/agent-communication.d.ts.map +1 -0
- package/lib/api-schemas/agent-communication.js +150 -0
- package/lib/api-schemas/agent-communication.js.map +1 -0
- package/lib/api-schemas/agent-runs.d.ts +593 -0
- package/lib/api-schemas/agent-runs.d.ts.map +1 -1
- package/lib/api-schemas/agent-runs.js +44 -2
- package/lib/api-schemas/agent-runs.js.map +1 -1
- package/lib/api-schemas/app-lifecycle.d.ts +19 -0
- package/lib/api-schemas/app-lifecycle.d.ts.map +1 -1
- package/lib/api-schemas/app-lifecycle.js +34 -4
- package/lib/api-schemas/app-lifecycle.js.map +1 -1
- package/lib/api-schemas/app-runtime.d.ts +9871 -9257
- package/lib/api-schemas/app-runtime.d.ts.map +1 -1
- package/lib/api-schemas/app-runtime.js +7 -0
- package/lib/api-schemas/app-runtime.js.map +1 -1
- package/lib/api-schemas/apps.d.ts +1 -0
- package/lib/api-schemas/apps.d.ts.map +1 -1
- package/lib/api-schemas/apps.js +4 -3
- package/lib/api-schemas/apps.js.map +1 -1
- package/lib/api-schemas/content-query.d.ts +39 -0
- package/lib/api-schemas/content-query.d.ts.map +1 -0
- package/lib/api-schemas/content-query.js +30 -0
- package/lib/api-schemas/content-query.js.map +1 -0
- package/lib/api-schemas/content.d.ts +835 -29
- package/lib/api-schemas/content.d.ts.map +1 -1
- package/lib/api-schemas/content.js +82 -15
- package/lib/api-schemas/content.js.map +1 -1
- package/lib/api-schemas/dashboard.d.ts +4 -0
- package/lib/api-schemas/dashboard.d.ts.map +1 -1
- package/lib/api-schemas/dashboard.js +3 -0
- package/lib/api-schemas/dashboard.js.map +1 -1
- package/lib/api-schemas/document-processing.d.ts +333 -0
- package/lib/api-schemas/document-processing.d.ts.map +1 -1
- package/lib/api-schemas/events.d.ts +1007 -4
- package/lib/api-schemas/events.d.ts.map +1 -1
- package/lib/api-schemas/events.js +4 -1
- package/lib/api-schemas/events.js.map +1 -1
- package/lib/api-schemas/files.d.ts +17 -0
- package/lib/api-schemas/files.d.ts.map +1 -1
- package/lib/api-schemas/files.js +23 -0
- package/lib/api-schemas/files.js.map +1 -1
- package/lib/api-schemas/group.d.ts +7 -0
- package/lib/api-schemas/group.d.ts.map +1 -1
- package/lib/api-schemas/group.js +9 -0
- package/lib/api-schemas/group.js.map +1 -1
- package/lib/api-schemas/index.d.ts +4 -0
- package/lib/api-schemas/index.d.ts.map +1 -1
- package/lib/api-schemas/index.js +4 -0
- package/lib/api-schemas/index.js.map +1 -1
- package/lib/api-schemas/integrations.d.ts +19 -5
- package/lib/api-schemas/integrations.d.ts.map +1 -1
- package/lib/api-schemas/integrations.js +25 -2
- package/lib/api-schemas/integrations.js.map +1 -1
- package/lib/api-schemas/interaction.d.ts +8399 -1076
- package/lib/api-schemas/interaction.d.ts.map +1 -1
- package/lib/api-schemas/interaction.js +161 -9
- package/lib/api-schemas/interaction.js.map +1 -1
- package/lib/api-schemas/oauth-server.d.ts +131 -3
- package/lib/api-schemas/oauth-server.d.ts.map +1 -1
- package/lib/api-schemas/oauth-server.js +137 -3
- package/lib/api-schemas/oauth-server.js.map +1 -1
- package/lib/api-schemas/process.d.ts +1295 -0
- package/lib/api-schemas/process.d.ts.map +1 -1
- package/lib/api-schemas/process.js +318 -2
- package/lib/api-schemas/process.js.map +1 -1
- package/lib/api-schemas/project-configuration.d.ts +1118 -1
- package/lib/api-schemas/project-configuration.d.ts.map +1 -1
- package/lib/api-schemas/project-configuration.js +6 -2
- package/lib/api-schemas/project-configuration.js.map +1 -1
- package/lib/api-schemas/project.d.ts +1680 -6
- package/lib/api-schemas/project.d.ts.map +1 -1
- package/lib/api-schemas/registry.d.ts +87529 -69142
- package/lib/api-schemas/registry.d.ts.map +1 -1
- package/lib/api-schemas/registry.js +234 -413
- package/lib/api-schemas/registry.js.map +1 -1
- package/lib/api-schemas/schema-primitives.d.ts +4 -0
- package/lib/api-schemas/schema-primitives.d.ts.map +1 -1
- package/lib/api-schemas/schema-primitives.js +10 -0
- package/lib/api-schemas/schema-primitives.js.map +1 -1
- package/lib/api-schemas/store.d.ts +5596 -37
- package/lib/api-schemas/store.d.ts.map +1 -1
- package/lib/api-schemas/store.js +53 -8
- package/lib/api-schemas/store.js.map +1 -1
- package/lib/api-schemas/tools.d.ts +115 -0
- package/lib/api-schemas/tools.d.ts.map +1 -1
- package/lib/api-schemas/tools.js +55 -0
- package/lib/api-schemas/tools.js.map +1 -1
- package/lib/api-schemas/view-execution.d.ts +330 -854
- package/lib/api-schemas/view-execution.d.ts.map +1 -1
- package/lib/api-schemas/view-execution.js +26 -2
- package/lib/api-schemas/view-execution.js.map +1 -1
- package/lib/api-schemas/views.d.ts +452 -2562
- package/lib/api-schemas/views.d.ts.map +1 -1
- package/lib/api-schemas/views.js +119 -3
- package/lib/api-schemas/views.js.map +1 -1
- package/lib/api-schemas/workflow-runs.d.ts +344 -5
- package/lib/api-schemas/workflow-runs.d.ts.map +1 -1
- package/lib/api-schemas/workflow-runs.js +9 -7
- package/lib/api-schemas/workflow-runs.js.map +1 -1
- package/lib/apps.d.ts +8 -145
- package/lib/apps.d.ts.map +1 -1
- package/lib/apps.js +1 -54
- package/lib/apps.js.map +1 -1
- package/lib/ask-user.d.ts +2 -1
- package/lib/ask-user.d.ts.map +1 -1
- package/lib/audit-trail.d.ts +2 -2
- package/lib/audit-trail.d.ts.map +1 -1
- package/lib/audit-trail.js +2 -2
- package/lib/audit-trail.js.map +1 -1
- package/lib/browser-credentials.d.ts +2 -7
- package/lib/browser-credentials.d.ts.map +1 -1
- package/lib/common.d.ts +4 -1
- package/lib/common.d.ts.map +1 -1
- package/lib/content-query.d.ts +5 -0
- package/lib/content-query.d.ts.map +1 -0
- package/lib/content-query.js +2 -0
- package/lib/content-query.js.map +1 -0
- package/lib/data-platform.d.ts +4 -46
- package/lib/data-platform.d.ts.map +1 -1
- package/lib/data-platform.js.map +1 -1
- package/lib/email.d.ts +12 -18
- package/lib/email.d.ts.map +1 -1
- package/lib/email.js.map +1 -1
- package/lib/environment.d.ts +0 -10
- package/lib/environment.d.ts.map +1 -1
- package/lib/environment.js +1 -12
- package/lib/environment.js.map +1 -1
- package/lib/facets.d.ts +0 -4
- package/lib/facets.d.ts.map +1 -1
- package/lib/group.d.ts +2 -12
- package/lib/group.d.ts.map +1 -1
- package/lib/group.js.map +1 -1
- package/lib/index.d.ts +3 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -10
- package/lib/index.js.map +1 -1
- package/lib/integrations.d.ts +1 -27
- package/lib/integrations.d.ts.map +1 -1
- package/lib/integrations.js +0 -6
- package/lib/integrations.js.map +1 -1
- package/lib/interaction.d.ts +10 -222
- package/lib/interaction.d.ts.map +1 -1
- package/lib/interaction.js +0 -31
- package/lib/interaction.js.map +1 -1
- package/lib/meters.d.ts +5 -10
- package/lib/meters.d.ts.map +1 -1
- package/lib/meters.js +1 -9
- package/lib/meters.js.map +1 -1
- package/lib/oauth-scopes.d.ts +2 -16
- package/lib/oauth-scopes.d.ts.map +1 -1
- package/lib/oauth-scopes.js +9 -49
- package/lib/oauth-scopes.js.map +1 -1
- package/lib/oauth-server.d.ts +16 -195
- package/lib/oauth-server.d.ts.map +1 -1
- package/lib/payload.d.ts +2 -5
- package/lib/payload.d.ts.map +1 -1
- package/lib/pending-asks.d.ts +9 -41
- package/lib/pending-asks.d.ts.map +1 -1
- package/lib/platform-event.d.ts +4 -142
- package/lib/platform-event.d.ts.map +1 -1
- package/lib/platform-event.js.map +1 -1
- package/lib/project.d.ts +7 -46
- package/lib/project.d.ts.map +1 -1
- package/lib/project.js +2 -132
- package/lib/project.js.map +1 -1
- package/lib/prompt.d.ts +4 -7
- package/lib/prompt.d.ts.map +1 -1
- package/lib/prompt.js.map +1 -1
- package/lib/query.d.ts +0 -8
- package/lib/query.d.ts.map +1 -1
- package/lib/rate-limiter.d.ts +4 -3
- package/lib/rate-limiter.d.ts.map +1 -1
- package/lib/runs.d.ts +5 -1
- package/lib/runs.d.ts.map +1 -1
- package/lib/schema-for-extraction.d.ts +0 -1
- package/lib/schema-for-extraction.d.ts.map +1 -1
- package/lib/schema-for-extraction.js +1 -1
- package/lib/schema-for-extraction.js.map +1 -1
- package/lib/secrets.d.ts +2 -1
- package/lib/secrets.d.ts.map +1 -1
- package/lib/skill.d.ts +0 -13
- package/lib/skill.d.ts.map +1 -1
- package/lib/store/activity-catalog.d.ts +2 -0
- package/lib/store/activity-catalog.d.ts.map +1 -1
- package/lib/store/agent-approval.d.ts +0 -1
- package/lib/store/agent-approval.d.ts.map +1 -1
- package/lib/store/agent-approval.js +0 -3
- package/lib/store/agent-approval.js.map +1 -1
- package/lib/store/agent-run.d.ts +32 -69
- package/lib/store/agent-run.d.ts.map +1 -1
- package/lib/store/collections.d.ts +2 -6
- package/lib/store/collections.d.ts.map +1 -1
- package/lib/store/collections.js.map +1 -1
- package/lib/store/conversation-state.d.ts +11 -12
- package/lib/store/conversation-state.d.ts.map +1 -1
- package/lib/store/conversation-state.js +0 -18
- package/lib/store/conversation-state.js.map +1 -1
- package/lib/store/doc-analyzer.d.ts +0 -22
- package/lib/store/doc-analyzer.d.ts.map +1 -1
- package/lib/store/dsl-workflow.d.ts +22 -5
- package/lib/store/dsl-workflow.d.ts.map +1 -1
- package/lib/store/dsl-workflow.js.map +1 -1
- package/lib/store/grounded-extraction.d.ts +0 -14
- package/lib/store/grounded-extraction.d.ts.map +1 -1
- package/lib/store/grounded-extraction.js +1 -7
- package/lib/store/grounded-extraction.js.map +1 -1
- package/lib/store/index.d.ts +0 -5
- package/lib/store/index.d.ts.map +1 -1
- package/lib/store/index.js +0 -6
- package/lib/store/index.js.map +1 -1
- package/lib/store/intake-policy-schema.generated.d.ts.map +1 -1
- package/lib/store/intake-policy-schema.generated.js +279 -1
- package/lib/store/intake-policy-schema.generated.js.map +1 -1
- package/lib/store/process.d.ts +43 -1
- package/lib/store/process.d.ts.map +1 -1
- package/lib/store/process.js.map +1 -1
- package/lib/store/rendering.d.ts +3 -5
- package/lib/store/rendering.d.ts.map +1 -1
- package/lib/store/rendering.js +0 -4
- package/lib/store/rendering.js.map +1 -1
- package/lib/store/schedule.d.ts +0 -16
- package/lib/store/schedule.d.ts.map +1 -1
- package/lib/store/schedule.js.map +1 -1
- package/lib/store/signals.d.ts +12 -0
- package/lib/store/signals.d.ts.map +1 -1
- package/lib/store/store.d.ts +80 -94
- package/lib/store/store.d.ts.map +1 -1
- package/lib/store/store.js +5 -25
- package/lib/store/store.js.map +1 -1
- package/lib/store/workflow.d.ts +35 -86
- package/lib/store/workflow.d.ts.map +1 -1
- package/lib/store/workflow.js +0 -47
- package/lib/store/workflow.js.map +1 -1
- package/lib/sts-errors.d.ts +0 -1
- package/lib/sts-errors.d.ts.map +1 -1
- package/lib/sts-token-types.d.ts +2 -8
- package/lib/sts-token-types.d.ts.map +1 -1
- package/lib/sts-token-types.js +1 -19
- package/lib/sts-token-types.js.map +1 -1
- package/lib/tools.d.ts +6 -1
- package/lib/tools.d.ts.map +1 -1
- package/lib/transient-tokens.d.ts +0 -2
- package/lib/transient-tokens.d.ts.map +1 -1
- package/lib/user.d.ts +0 -17
- package/lib/user.d.ts.map +1 -1
- package/lib/user.js.map +1 -1
- package/lib/utils/schemas.d.ts +2 -24
- package/lib/utils/schemas.d.ts.map +1 -1
- package/lib/utils/schemas.js +0 -151
- package/lib/utils/schemas.js.map +1 -1
- package/lib/vertesia-common.js +3 -4
- package/lib/vertesia-common.js.map +1 -1
- package/lib/views.d.ts +23 -27
- package/lib/views.d.ts.map +1 -1
- package/lib/views.js +5 -26
- package/lib/views.js.map +1 -1
- package/lib/workflow-analytics.d.ts +12 -34
- package/lib/workflow-analytics.d.ts.map +1 -1
- package/package.json +12 -6
- package/src/access-control.ts +0 -26
- package/src/account-values.ts +0 -49
- package/src/agent-resources.test.ts +1 -12
- package/src/api-contract/components.contract.test.ts +99 -0
- package/src/api-contract/components.generated.json +40405 -0
- package/src/api-contract/index.ts +664 -0
- package/src/api-schemas/agent-communication.contract.test.ts +90 -0
- package/src/api-schemas/agent-communication.ts +169 -0
- package/src/api-schemas/agent-runs.ts +46 -1
- package/src/api-schemas/api-discriminators.test.ts +101 -0
- package/src/api-schemas/app-lifecycle.ts +39 -4
- package/src/api-schemas/app-runtime.ts +8 -0
- package/src/api-schemas/apps.ts +4 -3
- package/src/api-schemas/content-query.ts +31 -0
- package/src/api-schemas/content.ts +88 -15
- package/src/api-schemas/dashboard.contract.test.ts +16 -5
- package/src/api-schemas/dashboard.ts +3 -0
- package/src/api-schemas/events.ts +9 -1
- package/src/api-schemas/files.ts +27 -0
- package/src/api-schemas/group.ts +10 -0
- package/src/api-schemas/index.ts +4 -0
- package/src/api-schemas/integrations.ts +27 -2
- package/src/api-schemas/interaction.contract.test.ts +204 -1
- package/src/api-schemas/interaction.ts +176 -8
- package/src/api-schemas/llumiverse.contract.test.ts +33 -2
- package/src/api-schemas/oauth-server.ts +152 -3
- package/src/api-schemas/oauth.contract.test.ts +64 -1
- package/src/api-schemas/process.ts +352 -2
- package/src/api-schemas/project-configuration.ts +11 -7
- package/src/api-schemas/project.contract.test.ts +83 -6
- package/src/api-schemas/registry.ts +290 -457
- package/src/api-schemas/schema-primitives.ts +13 -0
- package/src/api-schemas/store.contract.test.ts +30 -1
- package/src/api-schemas/store.ts +58 -11
- package/src/api-schemas/tools.ts +62 -0
- package/src/api-schemas/view-execution.ts +28 -2
- package/src/api-schemas/views.contract.test.ts +119 -0
- package/src/api-schemas/views.ts +142 -3
- package/src/api-schemas/workflow-runs.ts +9 -7
- package/src/api-schemas/zeno-response-contracts.test.ts +344 -0
- package/src/apps.test.ts +2 -40
- package/src/apps.ts +14 -181
- package/src/ask-user.ts +1 -1
- package/src/audit-trail.ts +3 -3
- package/src/browser-credentials.ts +3 -7
- package/src/common.ts +13 -1
- package/src/content-query.ts +5 -0
- package/src/data-platform.ts +4 -51
- package/src/email.ts +24 -18
- package/src/environment.ts +1 -14
- package/src/facets.ts +0 -6
- package/src/group.ts +2 -12
- package/src/index.ts +3 -15
- package/src/integrations.ts +1 -52
- package/src/interaction.ts +12 -271
- package/src/meters.ts +10 -11
- package/src/oauth-scopes.test.ts +15 -0
- package/src/oauth-scopes.ts +10 -64
- package/src/oauth-server.ts +28 -215
- package/src/payload.ts +1 -6
- package/src/pending-asks.ts +17 -42
- package/src/platform-event.ts +3 -156
- package/src/project.ts +12 -160
- package/src/prompt.ts +9 -8
- package/src/query.ts +0 -9
- package/src/rate-limiter.ts +3 -3
- package/src/runs.ts +8 -0
- package/src/schema-for-extraction.ts +1 -1
- package/src/secrets.ts +3 -0
- package/src/skill.ts +0 -15
- package/src/store/activity-catalog.ts +3 -0
- package/src/store/agent-approval.ts +0 -4
- package/src/store/agent-run.ts +39 -93
- package/src/store/collections.ts +3 -6
- package/src/store/conversation-state.ts +12 -25
- package/src/store/doc-analyzer.ts +0 -26
- package/src/store/dsl-workflow.ts +28 -5
- package/src/store/grounded-extraction.ts +0 -18
- package/src/store/index.ts +0 -6
- package/src/store/intake-policy-schema.generated.ts +293 -1
- package/src/store/process.ts +84 -0
- package/src/store/rendering.ts +3 -8
- package/src/store/schedule.ts +0 -19
- package/src/store/signals.ts +14 -0
- package/src/store/store.ts +118 -127
- package/src/store/workflow.ts +32 -120
- package/src/sts-errors.ts +0 -2
- package/src/sts-token-types.ts +3 -28
- package/src/tools.ts +15 -0
- package/src/transient-tokens.ts +0 -2
- package/src/user.ts +0 -20
- package/src/utils/schemas.ts +2 -159
- package/src/views.ts +50 -47
- package/src/workflow-analytics.ts +12 -40
- package/tsconfig.dist.json +4 -1
- package/lib/Progress.d.ts +0 -22
- package/lib/Progress.d.ts.map +0 -1
- package/lib/Progress.js +0 -57
- package/lib/Progress.js.map +0 -1
- package/lib/agent-request-template.d.ts +0 -4
- package/lib/agent-request-template.d.ts.map +0 -1
- package/lib/agent-request-template.js +0 -46
- package/lib/agent-request-template.js.map +0 -1
- package/lib/channels.d.ts +0 -22
- package/lib/channels.d.ts.map +0 -1
- package/lib/channels.js +0 -57
- package/lib/channels.js.map +0 -1
- package/lib/host-utils.d.ts +0 -8
- package/lib/host-utils.d.ts.map +0 -1
- package/lib/host-utils.js +0 -84
- package/lib/host-utils.js.map +0 -1
- package/lib/platform-event-validation.d.ts +0 -45
- package/lib/platform-event-validation.d.ts.map +0 -1
- package/lib/platform-event-validation.js +0 -336
- package/lib/platform-event-validation.js.map +0 -1
- package/lib/store/hive-memory.d.ts +0 -117
- package/lib/store/hive-memory.d.ts.map +0 -1
- package/lib/store/hive-memory.js +0 -2
- package/lib/store/hive-memory.js.map +0 -1
- package/lib/store/object-types.d.ts +0 -24
- package/lib/store/object-types.d.ts.map +0 -1
- package/lib/store/object-types.js +0 -95
- package/lib/store/object-types.js.map +0 -1
- package/lib/store/process-schema.d.ts +0 -561
- package/lib/store/process-schema.d.ts.map +0 -1
- package/lib/store/process-schema.js +0 -561
- package/lib/store/process-schema.js.map +0 -1
- package/lib/store/process-validation.d.ts +0 -17
- package/lib/store/process-validation.d.ts.map +0 -1
- package/lib/store/process-validation.js +0 -515
- package/lib/store/process-validation.js.map +0 -1
- package/lib/store/temporalio.d.ts +0 -17
- package/lib/store/temporalio.d.ts.map +0 -1
- package/lib/store/temporalio.js +0 -41
- package/lib/store/temporalio.js.map +0 -1
- package/lib/view-configuration-validation.d.ts +0 -15
- package/lib/view-configuration-validation.d.ts.map +0 -1
- package/lib/view-configuration-validation.js +0 -63
- package/lib/view-configuration-validation.js.map +0 -1
- package/lib/view-query-validation.d.ts +0 -13
- package/lib/view-query-validation.d.ts.map +0 -1
- package/lib/view-query-validation.js +0 -266
- package/lib/view-query-validation.js.map +0 -1
- package/lib/view-validation-helpers.d.ts +0 -15
- package/lib/view-validation-helpers.d.ts.map +0 -1
- package/lib/view-validation-helpers.js +0 -25
- package/lib/view-validation-helpers.js.map +0 -1
- package/lib/views-schema.d.ts +0 -1992
- package/lib/views-schema.d.ts.map +0 -1
- package/lib/views-schema.js +0 -674
- package/lib/views-schema.js.map +0 -1
- package/lib/views-validation.d.ts +0 -21
- package/lib/views-validation.d.ts.map +0 -1
- package/lib/views-validation.js +0 -164
- package/lib/views-validation.js.map +0 -1
- package/src/Progress.ts +0 -59
- package/src/agent-request-template.test.ts +0 -40
- package/src/agent-request-template.ts +0 -45
- package/src/channels.ts +0 -70
- package/src/host-utils.test.ts +0 -61
- package/src/host-utils.ts +0 -93
- package/src/platform-event-validation.test.ts +0 -251
- package/src/platform-event-validation.ts +0 -372
- package/src/project.test.ts +0 -44
- package/src/store/hive-memory.ts +0 -167
- package/src/store/object-types.ts +0 -123
- package/src/store/process-schema.test.ts +0 -149
- package/src/store/process-schema.ts +0 -564
- package/src/store/process-validation.test.ts +0 -635
- package/src/store/process-validation.ts +0 -646
- package/src/store/temporalio.ts +0 -54
- package/src/view-configuration-validation.ts +0 -74
- package/src/view-query-validation.test.ts +0 -21
- package/src/view-query-validation.ts +0 -319
- package/src/view-validation-helpers.ts +0 -28
- package/src/views-schema.test.ts +0 -372
- package/src/views-schema.ts +0 -689
- package/src/views-validation.ts +0 -234
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import Ajv, { type ErrorObject } from 'ajv';
|
|
2
|
-
import type { ViewExperienceConfiguration } from './views.js';
|
|
3
|
-
import {
|
|
4
|
-
PersistedViewExperienceConfigurationJsonSchema,
|
|
5
|
-
ViewExperienceConfigurationJsonSchema,
|
|
6
|
-
} from './views-schema.js';
|
|
7
|
-
import { type ViewValidationIssue, validateViewExperienceSemantics } from './views-validation.js';
|
|
8
|
-
|
|
9
|
-
export type ViewConfigurationValidationMode = 'draft' | 'persisted';
|
|
10
|
-
|
|
11
|
-
const ajv = new Ajv.default({ allErrors: true, strict: false });
|
|
12
|
-
const validateDraftStructure = ajv.compile(ViewExperienceConfigurationJsonSchema);
|
|
13
|
-
const validatePersistedStructure = ajv.compile(PersistedViewExperienceConfigurationJsonSchema);
|
|
14
|
-
|
|
15
|
-
function jsonPointerPath(instancePath: string): string {
|
|
16
|
-
if (instancePath === '') return 'configuration';
|
|
17
|
-
return instancePath
|
|
18
|
-
.slice(1)
|
|
19
|
-
.split('/')
|
|
20
|
-
.map((segment) => segment.replaceAll('~1', '/').replaceAll('~0', '~'))
|
|
21
|
-
.reduce((path, segment) => {
|
|
22
|
-
if (/^\d+$/.test(segment)) return `${path}[${segment}]`;
|
|
23
|
-
return path.length === 0 ? segment : `${path}.${segment}`;
|
|
24
|
-
}, '');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function errorPath(error: ErrorObject): string {
|
|
28
|
-
const base = jsonPointerPath(error.instancePath);
|
|
29
|
-
if (error.keyword === 'required' && 'missingProperty' in error.params) {
|
|
30
|
-
const missingProperty = String(error.params.missingProperty);
|
|
31
|
-
return base === 'configuration' ? missingProperty : `${base}.${missingProperty}`;
|
|
32
|
-
}
|
|
33
|
-
if (error.keyword === 'additionalProperties' && 'additionalProperty' in error.params) {
|
|
34
|
-
const additionalProperty = String(error.params.additionalProperty);
|
|
35
|
-
return base === 'configuration' ? additionalProperty : `${base}.${additionalProperty}`;
|
|
36
|
-
}
|
|
37
|
-
return base;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function structuralIssues(value: unknown, mode: ViewConfigurationValidationMode): ViewValidationIssue[] {
|
|
41
|
-
const validateStructure = mode === 'persisted' ? validatePersistedStructure : validateDraftStructure;
|
|
42
|
-
if (validateStructure(value)) return [];
|
|
43
|
-
const issues = (validateStructure.errors ?? []).map((error: ErrorObject) => ({
|
|
44
|
-
path: errorPath(error),
|
|
45
|
-
message: error.message ?? 'is invalid',
|
|
46
|
-
}));
|
|
47
|
-
return [...new Map(issues.map((issue) => [`${issue.path}\u0000${issue.message}`, issue])).values()];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Validate both the canonical JSON structure and semantic cross-reference rules.
|
|
52
|
-
*
|
|
53
|
-
* Persisted mode adds the documentation requirement structurally. Blank
|
|
54
|
-
* descriptions pass the shape check and are rejected by semantic validation,
|
|
55
|
-
* while structure-first short-circuiting prevents duplicate errors.
|
|
56
|
-
*/
|
|
57
|
-
export function validateViewConfiguration(
|
|
58
|
-
value: unknown,
|
|
59
|
-
mode: ViewConfigurationValidationMode = 'draft',
|
|
60
|
-
): ViewValidationIssue[] {
|
|
61
|
-
const issues = structuralIssues(value, mode);
|
|
62
|
-
if (issues.length > 0) return issues;
|
|
63
|
-
return validateViewExperienceSemantics(value as ViewExperienceConfiguration, mode);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** @deprecated Use validateViewConfiguration(value, 'draft'). */
|
|
67
|
-
export function validateViewExperienceConfiguration(value: unknown): ViewValidationIssue[] {
|
|
68
|
-
return validateViewConfiguration(value, 'draft');
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** @deprecated Use validateViewConfiguration(value, 'persisted'). */
|
|
72
|
-
export function validatePersistedViewExperienceConfiguration(value: unknown): ViewValidationIssue[] {
|
|
73
|
-
return validateViewConfiguration(value, 'persisted');
|
|
74
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { validateSupportedViewQuery } from './view-query-validation.js';
|
|
3
|
-
|
|
4
|
-
function deeplyNestedFilter(depth: number): unknown {
|
|
5
|
-
let query: unknown = { term: { status: 'active' } };
|
|
6
|
-
for (let index = 0; index < depth; index++) {
|
|
7
|
-
query = { bool: { filter: query } };
|
|
8
|
-
}
|
|
9
|
-
return query;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
describe('View query validation', () => {
|
|
13
|
-
it('rejects deeply nested queries without overflowing the call stack', () => {
|
|
14
|
-
expect(() => validateSupportedViewQuery(deeplyNestedFilter(6_000))).not.toThrow();
|
|
15
|
-
expect(validateSupportedViewQuery(deeplyNestedFilter(6_000))).toContainEqual(
|
|
16
|
-
expect.objectContaining({
|
|
17
|
-
message: 'exceeds the maximum of 100 query clauses',
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ELASTICSEARCH_FIELD_PATH_PATTERN as FIELD_PATTERN,
|
|
3
|
-
isViewValidationRecord as isRecord,
|
|
4
|
-
SERVER_CONTROLLED_VIEW_FIELD_ROOTS,
|
|
5
|
-
} from './view-validation-helpers.js';
|
|
6
|
-
import type { ViewElasticsearchQuery } from './views.js';
|
|
7
|
-
|
|
8
|
-
export interface ViewQueryValidationIssue {
|
|
9
|
-
path: string;
|
|
10
|
-
message: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ViewQueryValidationOptions {
|
|
14
|
-
allowedFields?: ReadonlySet<string>;
|
|
15
|
-
allowedOperators?: ReadonlyMap<string, ReadonlySet<string>>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const ALLOWED_QUERY_TYPES = new Set([
|
|
19
|
-
'bool',
|
|
20
|
-
'match',
|
|
21
|
-
'multi_match',
|
|
22
|
-
'simple_query_string',
|
|
23
|
-
'term',
|
|
24
|
-
'terms',
|
|
25
|
-
'range',
|
|
26
|
-
'exists',
|
|
27
|
-
'ids',
|
|
28
|
-
'prefix',
|
|
29
|
-
'match_all',
|
|
30
|
-
]);
|
|
31
|
-
const MAX_QUERY_CLAUSES = 100;
|
|
32
|
-
const FORBIDDEN_FIELD_ROOTS = new Set<string>(SERVER_CONTROLLED_VIEW_FIELD_ROOTS);
|
|
33
|
-
|
|
34
|
-
function addFieldIssue(
|
|
35
|
-
issues: ViewQueryValidationIssue[],
|
|
36
|
-
field: unknown,
|
|
37
|
-
path: string,
|
|
38
|
-
options: ViewQueryValidationOptions,
|
|
39
|
-
): void {
|
|
40
|
-
if (typeof field !== 'string' || !FIELD_PATTERN.test(field)) {
|
|
41
|
-
issues.push({ path, message: 'must be a dot-separated field name' });
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (FORBIDDEN_FIELD_ROOTS.has(field.split('.')[0])) {
|
|
45
|
-
issues.push({ path, message: `field '${field}' is server-controlled` });
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (options.allowedFields && !options.allowedFields.has(field)) {
|
|
49
|
-
issues.push({ path, message: `field '${field}' is not available to this View` });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function addOperatorIssue(
|
|
54
|
-
issues: ViewQueryValidationIssue[],
|
|
55
|
-
field: string,
|
|
56
|
-
operator: string,
|
|
57
|
-
path: string,
|
|
58
|
-
options: ViewQueryValidationOptions,
|
|
59
|
-
): void {
|
|
60
|
-
const allowed = options.allowedOperators?.get(field);
|
|
61
|
-
if (allowed && !allowed.has(operator)) {
|
|
62
|
-
issues.push({
|
|
63
|
-
path,
|
|
64
|
-
message: `operator '${operator}' is not available for field '${field}'`,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function validateSingleFieldClause(
|
|
70
|
-
issues: ViewQueryValidationIssue[],
|
|
71
|
-
value: unknown,
|
|
72
|
-
path: string,
|
|
73
|
-
validateValue: (fieldValue: unknown, valuePath: string, field: string) => void,
|
|
74
|
-
options: ViewQueryValidationOptions,
|
|
75
|
-
): void {
|
|
76
|
-
if (!isRecord(value)) {
|
|
77
|
-
issues.push({ path, message: 'must be an object keyed by field name' });
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const entries = Object.entries(value);
|
|
81
|
-
if (entries.length !== 1) {
|
|
82
|
-
issues.push({ path, message: 'must reference exactly one field' });
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const [field, fieldValue] = entries[0];
|
|
86
|
-
addFieldIssue(issues, field, `${path}.${field}`, options);
|
|
87
|
-
validateValue(fieldValue, `${path}.${field}`, field);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function validateQueryNode(
|
|
91
|
-
issues: ViewQueryValidationIssue[],
|
|
92
|
-
value: unknown,
|
|
93
|
-
path: string,
|
|
94
|
-
state: { clauses: number },
|
|
95
|
-
options: ViewQueryValidationOptions,
|
|
96
|
-
): void {
|
|
97
|
-
state.clauses++;
|
|
98
|
-
if (state.clauses > MAX_QUERY_CLAUSES) {
|
|
99
|
-
issues.push({ path, message: `exceeds the maximum of ${MAX_QUERY_CLAUSES} query clauses` });
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (!isRecord(value)) {
|
|
103
|
-
issues.push({ path, message: 'must be an Elasticsearch query object' });
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const entries = Object.entries(value);
|
|
107
|
-
if (entries.length !== 1) {
|
|
108
|
-
issues.push({ path, message: 'must contain exactly one query clause' });
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const [type, body] = entries[0];
|
|
112
|
-
if (!ALLOWED_QUERY_TYPES.has(type)) {
|
|
113
|
-
issues.push({ path: `${path}.${type}`, message: `query type '${type}' is not supported` });
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (type === 'match_all') {
|
|
118
|
-
if (!isRecord(body)) {
|
|
119
|
-
issues.push({ path: `${path}.match_all`, message: 'must be an object' });
|
|
120
|
-
}
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (type === 'bool') {
|
|
124
|
-
if (!isRecord(body)) {
|
|
125
|
-
issues.push({ path: `${path}.bool`, message: 'must be an object' });
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const allowed = new Set(['must', 'filter', 'should', 'must_not', 'minimum_should_match']);
|
|
129
|
-
for (const key of Object.keys(body)) {
|
|
130
|
-
if (!allowed.has(key)) {
|
|
131
|
-
issues.push({ path: `${path}.bool.${key}`, message: 'is not supported' });
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
for (const key of ['must', 'filter', 'should', 'must_not'] as const) {
|
|
135
|
-
const child = body[key];
|
|
136
|
-
if (child === undefined) continue;
|
|
137
|
-
const children = Array.isArray(child) ? child : [child];
|
|
138
|
-
if (children.length > 50) {
|
|
139
|
-
issues.push({ path: `${path}.bool.${key}`, message: 'must contain at most 50 clauses' });
|
|
140
|
-
}
|
|
141
|
-
children.forEach((item, index) => {
|
|
142
|
-
validateQueryNode(issues, item, `${path}.bool.${key}[${index}]`, state, options);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
const minimumShouldMatch = body.minimum_should_match;
|
|
146
|
-
if (
|
|
147
|
-
minimumShouldMatch !== undefined &&
|
|
148
|
-
typeof minimumShouldMatch !== 'number' &&
|
|
149
|
-
typeof minimumShouldMatch !== 'string'
|
|
150
|
-
) {
|
|
151
|
-
issues.push({ path: `${path}.bool.minimum_should_match`, message: 'must be a number or string' });
|
|
152
|
-
}
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (type === 'exists') {
|
|
156
|
-
if (!isRecord(body)) {
|
|
157
|
-
issues.push({ path: `${path}.exists`, message: 'must be an object' });
|
|
158
|
-
} else {
|
|
159
|
-
addFieldIssue(issues, body.field, `${path}.exists.field`, options);
|
|
160
|
-
if (typeof body.field === 'string') {
|
|
161
|
-
addOperatorIssue(issues, body.field, 'exists', `${path}.exists.field`, options);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (type === 'ids') {
|
|
167
|
-
if (!isRecord(body) || !Array.isArray(body.values) || body.values.length > 1_000) {
|
|
168
|
-
issues.push({ path: `${path}.ids.values`, message: 'must be an array containing at most 1000 IDs' });
|
|
169
|
-
} else if (body.values.some((id) => typeof id !== 'string')) {
|
|
170
|
-
issues.push({ path: `${path}.ids.values`, message: 'must contain only strings' });
|
|
171
|
-
}
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (type === 'multi_match' || type === 'simple_query_string') {
|
|
175
|
-
if (!isRecord(body) || typeof body.query !== 'string') {
|
|
176
|
-
issues.push({ path: `${path}.${type}.query`, message: 'must be a string' });
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
if (!Array.isArray(body.fields) || body.fields.length === 0 || body.fields.length > 20) {
|
|
180
|
-
issues.push({ path: `${path}.${type}.fields`, message: 'must contain between 1 and 20 fields' });
|
|
181
|
-
} else {
|
|
182
|
-
body.fields.forEach((rawField, index) => {
|
|
183
|
-
const field = typeof rawField === 'string' ? rawField.split('^')[0] : rawField;
|
|
184
|
-
addFieldIssue(issues, field, `${path}.${type}.fields[${index}]`, options);
|
|
185
|
-
if (typeof field === 'string') {
|
|
186
|
-
addOperatorIssue(issues, field, type, `${path}.${type}.fields[${index}]`, options);
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (isRecord(body)) {
|
|
194
|
-
const fieldEntries = Object.entries(body);
|
|
195
|
-
if (fieldEntries.length === 1) {
|
|
196
|
-
addOperatorIssue(issues, fieldEntries[0][0], type, `${path}.${type}.${fieldEntries[0][0]}`, options);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
validateSingleFieldClause(
|
|
200
|
-
issues,
|
|
201
|
-
body,
|
|
202
|
-
`${path}.${type}`,
|
|
203
|
-
(fieldValue, valuePath, field) => {
|
|
204
|
-
if (type === 'terms') {
|
|
205
|
-
if (!Array.isArray(fieldValue) || fieldValue.length > 1_000) {
|
|
206
|
-
issues.push({ path: valuePath, message: 'must be an array containing at most 1000 values' });
|
|
207
|
-
}
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (type === 'range') {
|
|
211
|
-
if (!isRecord(fieldValue)) {
|
|
212
|
-
issues.push({ path: valuePath, message: 'must be a range object' });
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
const allowed = new Set(['gt', 'gte', 'lt', 'lte']);
|
|
216
|
-
if (Object.keys(fieldValue).length === 0 || Object.keys(fieldValue).some((key) => !allowed.has(key))) {
|
|
217
|
-
issues.push({ path: valuePath, message: 'supports only gt, gte, lt, and lte' });
|
|
218
|
-
}
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
if (type === 'prefix') {
|
|
222
|
-
if (field !== 'location') {
|
|
223
|
-
issues.push({ path: valuePath, message: 'prefix queries are supported only for location' });
|
|
224
|
-
}
|
|
225
|
-
const prefix = isRecord(fieldValue) ? fieldValue.value : fieldValue;
|
|
226
|
-
if (typeof prefix !== 'string' || !prefix.startsWith('/') || !prefix.endsWith('/')) {
|
|
227
|
-
issues.push({ path: valuePath, message: 'must be a boundary-aware absolute location prefix' });
|
|
228
|
-
}
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
if (type === 'match') {
|
|
232
|
-
const query = isRecord(fieldValue) ? fieldValue.query : fieldValue;
|
|
233
|
-
if (typeof query !== 'string') {
|
|
234
|
-
issues.push({ path: valuePath, message: 'must contain a string query' });
|
|
235
|
-
}
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (type === 'term' && isRecord(fieldValue)) {
|
|
239
|
-
const allowed = new Set(['value', 'boost', 'case_insensitive']);
|
|
240
|
-
if (!('value' in fieldValue) || Object.keys(fieldValue).some((key) => !allowed.has(key))) {
|
|
241
|
-
issues.push({
|
|
242
|
-
path: valuePath,
|
|
243
|
-
message: 'supports only value, boost, and case_insensitive options',
|
|
244
|
-
});
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (isRecord(fieldValue.value) || Array.isArray(fieldValue.value)) {
|
|
248
|
-
issues.push({ path: `${valuePath}.value`, message: 'must be a scalar value' });
|
|
249
|
-
}
|
|
250
|
-
if (fieldValue.boost !== undefined && typeof fieldValue.boost !== 'number') {
|
|
251
|
-
issues.push({ path: `${valuePath}.boost`, message: 'must be a number' });
|
|
252
|
-
}
|
|
253
|
-
if (fieldValue.case_insensitive !== undefined && typeof fieldValue.case_insensitive !== 'boolean') {
|
|
254
|
-
issues.push({ path: `${valuePath}.case_insensitive`, message: 'must be a boolean' });
|
|
255
|
-
}
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
if (isRecord(fieldValue) || Array.isArray(fieldValue)) {
|
|
259
|
-
issues.push({ path: valuePath, message: 'must be a scalar value' });
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
options,
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function normalizeViewQueryNode(value: unknown, state: { clauses: number }): unknown {
|
|
267
|
-
state.clauses++;
|
|
268
|
-
if (state.clauses > MAX_QUERY_CLAUSES) return value;
|
|
269
|
-
if (!isRecord(value)) return value;
|
|
270
|
-
const entries = Object.entries(value);
|
|
271
|
-
if (entries.length !== 1) return value;
|
|
272
|
-
const [type, body] = entries[0];
|
|
273
|
-
if (type === 'bool' && isRecord(body)) {
|
|
274
|
-
const normalizedBody: Record<string, unknown> = { ...body };
|
|
275
|
-
for (const key of ['must', 'filter', 'should', 'must_not'] as const) {
|
|
276
|
-
const child = body[key];
|
|
277
|
-
if (Array.isArray(child)) {
|
|
278
|
-
normalizedBody[key] = child.map((item) => normalizeViewQueryNode(item, state));
|
|
279
|
-
} else if (child !== undefined) {
|
|
280
|
-
normalizedBody[key] = normalizeViewQueryNode(child, state);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return { bool: normalizedBody };
|
|
284
|
-
}
|
|
285
|
-
if (type !== 'term' || !isRecord(body)) return value;
|
|
286
|
-
const fieldEntries = Object.entries(body);
|
|
287
|
-
if (fieldEntries.length !== 1) return value;
|
|
288
|
-
const [field, fieldValue] = fieldEntries[0];
|
|
289
|
-
if (!isRecord(fieldValue) || Object.keys(fieldValue).length !== 1 || !('value' in fieldValue)) return value;
|
|
290
|
-
return { term: { [field]: fieldValue.value } };
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
export function normalizeViewQuery(value: unknown): unknown {
|
|
294
|
-
return normalizeViewQueryNode(value, { clauses: 0 });
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
export function validateSupportedViewQuery(
|
|
298
|
-
value: unknown,
|
|
299
|
-
path = 'query',
|
|
300
|
-
options: ViewQueryValidationOptions = {},
|
|
301
|
-
): ViewQueryValidationIssue[] {
|
|
302
|
-
const issues: ViewQueryValidationIssue[] = [];
|
|
303
|
-
validateQueryNode(issues, normalizeViewQuery(value), path, { clauses: 0 }, options);
|
|
304
|
-
return issues;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export function asSupportedViewQuery(
|
|
308
|
-
value: unknown,
|
|
309
|
-
path = 'query',
|
|
310
|
-
options: ViewQueryValidationOptions = {},
|
|
311
|
-
): ViewElasticsearchQuery {
|
|
312
|
-
const normalized = normalizeViewQuery(value);
|
|
313
|
-
const issues: ViewQueryValidationIssue[] = [];
|
|
314
|
-
validateQueryNode(issues, normalized, path, { clauses: 0 }, options);
|
|
315
|
-
if (issues.length > 0) {
|
|
316
|
-
throw new Error(issues.map((issue) => `${issue.path} ${issue.message}`).join('; '));
|
|
317
|
-
}
|
|
318
|
-
return normalized as ViewElasticsearchQuery;
|
|
319
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const VIEW_CONFIGURATION_ID_PATTERN_SOURCE = '^[a-z][a-z0-9_-]*$';
|
|
2
|
-
export const ELASTICSEARCH_FIELD_PATH_PATTERN_SOURCE = '^[A-Za-z0-9_]+(?:\\.[A-Za-z0-9_]+)*$';
|
|
3
|
-
|
|
4
|
-
export const VIEW_CONFIGURATION_ID_PATTERN = new RegExp(VIEW_CONFIGURATION_ID_PATTERN_SOURCE);
|
|
5
|
-
export const ELASTICSEARCH_FIELD_PATH_PATTERN = new RegExp(ELASTICSEARCH_FIELD_PATH_PATTERN_SOURCE);
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Elasticsearch roots owned by the server and unavailable to View-authored
|
|
9
|
-
* queries or dynamic collection filters.
|
|
10
|
-
*/
|
|
11
|
-
export const SERVER_CONTROLLED_VIEW_FIELD_ROOTS = [
|
|
12
|
-
'security',
|
|
13
|
-
'revision',
|
|
14
|
-
'is_deleted',
|
|
15
|
-
'embeddings_text',
|
|
16
|
-
'embeddings_image',
|
|
17
|
-
'embeddings_properties',
|
|
18
|
-
'_indexing_metadata',
|
|
19
|
-
] as const;
|
|
20
|
-
|
|
21
|
-
/** @deprecated Use ELASTICSEARCH_FIELD_PATH_PATTERN_SOURCE. */
|
|
22
|
-
export const VIEW_FIELD_PATTERN_SOURCE = ELASTICSEARCH_FIELD_PATH_PATTERN_SOURCE;
|
|
23
|
-
/** @deprecated Use ELASTICSEARCH_FIELD_PATH_PATTERN. */
|
|
24
|
-
export const VIEW_FIELD_PATTERN = ELASTICSEARCH_FIELD_PATH_PATTERN;
|
|
25
|
-
|
|
26
|
-
export function isViewValidationRecord(value: unknown): value is Record<string, unknown> {
|
|
27
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
28
|
-
}
|