@ahoo-wang/wow-client 9.2.0-rc.0
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/LICENSE +201 -0
- package/README.md +291 -0
- package/README.zh-CN.md +267 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js +6 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js +8 -0
- package/dist/client/bindMethods.cjs +2 -0
- package/dist/client/bindMethods.cjs.map +1 -0
- package/dist/client/bindMethods.d.cts +13 -0
- package/dist/client/bindMethods.d.ts +13 -0
- package/dist/client/bindMethods.es.js +19 -0
- package/dist/client/bindMethods.es.js.map +1 -0
- package/dist/client/command/commandClient.cjs +2 -0
- package/dist/client/command/commandClient.cjs.map +1 -0
- package/dist/client/command/commandClient.d.cts +67 -0
- package/dist/client/command/commandClient.d.ts +67 -0
- package/dist/client/command/commandClient.es.js +38 -0
- package/dist/client/command/commandClient.es.js.map +1 -0
- package/dist/client/command/commandHeaders.cjs +2 -0
- package/dist/client/command/commandHeaders.cjs.map +1 -0
- package/dist/client/command/commandHeaders.d.cts +75 -0
- package/dist/client/command/commandHeaders.d.ts +75 -0
- package/dist/client/command/commandHeaders.es.js +31 -0
- package/dist/client/command/commandHeaders.es.js.map +1 -0
- package/dist/client/command/commandRequest.cjs +2 -0
- package/dist/client/command/commandRequest.cjs.map +1 -0
- package/dist/client/command/commandRequest.d.cts +180 -0
- package/dist/client/command/commandRequest.d.ts +180 -0
- package/dist/client/command/commandRequest.es.js +31 -0
- package/dist/client/command/commandRequest.es.js.map +1 -0
- package/dist/client/command/commandResult.d.cts +15 -0
- package/dist/client/command/commandResult.d.ts +15 -0
- package/dist/client/command/index.d.cts +5 -0
- package/dist/client/command/index.d.ts +5 -0
- package/dist/client/command/types.d.cts +71 -0
- package/dist/client/command/types.d.ts +71 -0
- package/dist/client/metadata/index.d.cts +2 -0
- package/dist/client/metadata/index.d.ts +2 -0
- package/dist/client/metadata/wowMetadata.d.cts +48 -0
- package/dist/client/metadata/wowMetadata.d.ts +48 -0
- package/dist/client/metadata/wowMetadataClient.cjs +2 -0
- package/dist/client/metadata/wowMetadataClient.cjs.map +1 -0
- package/dist/client/metadata/wowMetadataClient.d.cts +23 -0
- package/dist/client/metadata/wowMetadataClient.d.ts +23 -0
- package/dist/client/metadata/wowMetadataClient.es.js +25 -0
- package/dist/client/metadata/wowMetadataClient.es.js.map +1 -0
- package/dist/client/query/descriptor/descriptorEndpoints.cjs +2 -0
- package/dist/client/query/descriptor/descriptorEndpoints.cjs.map +1 -0
- package/dist/client/query/descriptor/descriptorEndpoints.d.cts +29 -0
- package/dist/client/query/descriptor/descriptorEndpoints.d.ts +29 -0
- package/dist/client/query/descriptor/descriptorEndpoints.es.js +69 -0
- package/dist/client/query/descriptor/descriptorEndpoints.es.js.map +1 -0
- package/dist/client/query/descriptor/endpointPaths.cjs +2 -0
- package/dist/client/query/descriptor/endpointPaths.cjs.map +1 -0
- package/dist/client/query/descriptor/endpointPaths.d.cts +4 -0
- package/dist/client/query/descriptor/endpointPaths.d.ts +4 -0
- package/dist/client/query/descriptor/endpointPaths.es.js +9 -0
- package/dist/client/query/descriptor/endpointPaths.es.js.map +1 -0
- package/dist/client/query/descriptor/index.d.cts +2 -0
- package/dist/client/query/descriptor/index.d.ts +2 -0
- package/dist/client/query/descriptor/queryDescriptorApi.d.cts +58 -0
- package/dist/client/query/descriptor/queryDescriptorApi.d.ts +58 -0
- package/dist/client/query/descriptor/queryDescriptorClient.cjs +2 -0
- package/dist/client/query/descriptor/queryDescriptorClient.cjs.map +1 -0
- package/dist/client/query/descriptor/queryDescriptorClient.d.cts +61 -0
- package/dist/client/query/descriptor/queryDescriptorClient.d.ts +61 -0
- package/dist/client/query/descriptor/queryDescriptorClient.es.js +20 -0
- package/dist/client/query/descriptor/queryDescriptorClient.es.js.map +1 -0
- package/dist/client/query/event/domainEventStream.cjs +2 -0
- package/dist/client/query/event/domainEventStream.cjs.map +1 -0
- package/dist/client/query/event/domainEventStream.d.cts +105 -0
- package/dist/client/query/event/domainEventStream.d.ts +105 -0
- package/dist/client/query/event/domainEventStream.es.js +23 -0
- package/dist/client/query/event/domainEventStream.es.js.map +1 -0
- package/dist/client/query/event/endpointPaths.cjs +2 -0
- package/dist/client/query/event/endpointPaths.cjs.map +1 -0
- package/dist/client/query/event/endpointPaths.d.cts +8 -0
- package/dist/client/query/event/endpointPaths.d.ts +8 -0
- package/dist/client/query/event/endpointPaths.es.js +13 -0
- package/dist/client/query/event/endpointPaths.es.js.map +1 -0
- package/dist/client/query/event/eventStreamQueryApi.d.cts +29 -0
- package/dist/client/query/event/eventStreamQueryApi.d.ts +29 -0
- package/dist/client/query/event/eventStreamQueryClient.cjs +2 -0
- package/dist/client/query/event/eventStreamQueryClient.cjs.map +1 -0
- package/dist/client/query/event/eventStreamQueryClient.d.cts +190 -0
- package/dist/client/query/event/eventStreamQueryClient.d.ts +190 -0
- package/dist/client/query/event/eventStreamQueryClient.es.js +160 -0
- package/dist/client/query/event/eventStreamQueryClient.es.js.map +1 -0
- package/dist/client/query/event/index.d.cts +3 -0
- package/dist/client/query/event/index.d.ts +3 -0
- package/dist/client/query/factory.cjs +2 -0
- package/dist/client/query/factory.cjs.map +1 -0
- package/dist/client/query/factory.d.cts +165 -0
- package/dist/client/query/factory.d.ts +165 -0
- package/dist/client/query/factory.es.js +45 -0
- package/dist/client/query/factory.es.js.map +1 -0
- package/dist/client/query/index.d.cts +6 -0
- package/dist/client/query/index.d.ts +6 -0
- package/dist/client/query/queryApi.d.cts +68 -0
- package/dist/client/query/queryApi.d.ts +68 -0
- package/dist/client/query/requests.d.cts +24 -0
- package/dist/client/query/requests.d.ts +24 -0
- package/dist/client/query/snapshot/endpointPaths.cjs +2 -0
- package/dist/client/query/snapshot/endpointPaths.cjs.map +1 -0
- package/dist/client/query/snapshot/endpointPaths.d.cts +12 -0
- package/dist/client/query/snapshot/endpointPaths.d.ts +12 -0
- package/dist/client/query/snapshot/endpointPaths.es.js +17 -0
- package/dist/client/query/snapshot/endpointPaths.es.js.map +1 -0
- package/dist/client/query/snapshot/index.d.cts +3 -0
- package/dist/client/query/snapshot/index.d.ts +3 -0
- package/dist/client/query/snapshot/snapshot.cjs +2 -0
- package/dist/client/query/snapshot/snapshot.cjs.map +1 -0
- package/dist/client/query/snapshot/snapshot.d.cts +51 -0
- package/dist/client/query/snapshot/snapshot.d.ts +51 -0
- package/dist/client/query/snapshot/snapshot.es.js +20 -0
- package/dist/client/query/snapshot/snapshot.es.js.map +1 -0
- package/dist/client/query/snapshot/snapshotQueryApi.d.cts +101 -0
- package/dist/client/query/snapshot/snapshotQueryApi.d.ts +101 -0
- package/dist/client/query/snapshot/snapshotQueryClient.cjs +2 -0
- package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +1 -0
- package/dist/client/query/snapshot/snapshotQueryClient.d.cts +369 -0
- package/dist/client/query/snapshot/snapshotQueryClient.d.ts +369 -0
- package/dist/client/query/snapshot/snapshotQueryClient.es.js +239 -0
- package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +1 -0
- package/dist/client/query/state/endpointPaths.cjs +2 -0
- package/dist/client/query/state/endpointPaths.cjs.map +1 -0
- package/dist/client/query/state/endpointPaths.d.cts +10 -0
- package/dist/client/query/state/endpointPaths.d.ts +10 -0
- package/dist/client/query/state/endpointPaths.es.js +14 -0
- package/dist/client/query/state/endpointPaths.es.js.map +1 -0
- package/dist/client/query/state/index.d.cts +4 -0
- package/dist/client/query/state/index.d.ts +4 -0
- package/dist/client/query/state/loadOwnerStateAggregateApi.d.cts +36 -0
- package/dist/client/query/state/loadOwnerStateAggregateApi.d.ts +36 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +2 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.cjs.map +1 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.d.cts +58 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.d.ts +58 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +56 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.es.js.map +1 -0
- package/dist/client/query/state/loadStateAggregateApi.d.cts +37 -0
- package/dist/client/query/state/loadStateAggregateApi.d.ts +37 -0
- package/dist/client/query/state/loadStateAggregateClient.cjs +2 -0
- package/dist/client/query/state/loadStateAggregateClient.cjs.map +1 -0
- package/dist/client/query/state/loadStateAggregateClient.d.cts +62 -0
- package/dist/client/query/state/loadStateAggregateClient.d.ts +62 -0
- package/dist/client/query/state/loadStateAggregateClient.es.js +65 -0
- package/dist/client/query/state/loadStateAggregateClient.es.js.map +1 -0
- package/dist/client/routing.cjs +2 -0
- package/dist/client/routing.cjs.map +1 -0
- package/dist/client/routing.d.cts +47 -0
- package/dist/client/routing.d.ts +47 -0
- package/dist/client/routing.es.js +8 -0
- package/dist/client/routing.es.js.map +1 -0
- package/dist/dsl/aggregation/admit.cjs +2 -0
- package/dist/dsl/aggregation/admit.cjs.map +1 -0
- package/dist/dsl/aggregation/admit.d.cts +6 -0
- package/dist/dsl/aggregation/admit.d.ts +6 -0
- package/dist/dsl/aggregation/admit.es.js +142 -0
- package/dist/dsl/aggregation/admit.es.js.map +1 -0
- package/dist/dsl/aggregation/builders.cjs +2 -0
- package/dist/dsl/aggregation/builders.cjs.map +1 -0
- package/dist/dsl/aggregation/builders.d.cts +309 -0
- package/dist/dsl/aggregation/builders.d.ts +309 -0
- package/dist/dsl/aggregation/builders.es.js +188 -0
- package/dist/dsl/aggregation/builders.es.js.map +1 -0
- package/dist/dsl/aggregation/derived.cjs +2 -0
- package/dist/dsl/aggregation/derived.cjs.map +1 -0
- package/dist/dsl/aggregation/derived.d.cts +33 -0
- package/dist/dsl/aggregation/derived.d.ts +33 -0
- package/dist/dsl/aggregation/derived.es.js +31 -0
- package/dist/dsl/aggregation/derived.es.js.map +1 -0
- package/dist/dsl/aggregation/expressionTrees.cjs +2 -0
- package/dist/dsl/aggregation/expressionTrees.cjs.map +1 -0
- package/dist/dsl/aggregation/expressionTrees.d.cts +10 -0
- package/dist/dsl/aggregation/expressionTrees.d.ts +10 -0
- package/dist/dsl/aggregation/expressionTrees.es.js +44 -0
- package/dist/dsl/aggregation/expressionTrees.es.js.map +1 -0
- package/dist/dsl/aggregation/having.cjs +2 -0
- package/dist/dsl/aggregation/having.cjs.map +1 -0
- package/dist/dsl/aggregation/having.d.cts +94 -0
- package/dist/dsl/aggregation/having.d.ts +94 -0
- package/dist/dsl/aggregation/having.es.js +62 -0
- package/dist/dsl/aggregation/having.es.js.map +1 -0
- package/dist/dsl/aggregation/index.d.cts +4 -0
- package/dist/dsl/aggregation/index.d.ts +4 -0
- package/dist/dsl/aggregation/sort.cjs +2 -0
- package/dist/dsl/aggregation/sort.cjs.map +1 -0
- package/dist/dsl/aggregation/sort.d.cts +7 -0
- package/dist/dsl/aggregation/sort.d.ts +7 -0
- package/dist/dsl/aggregation/sort.es.js +10 -0
- package/dist/dsl/aggregation/sort.es.js.map +1 -0
- package/dist/dsl/aggregation/types.cjs +2 -0
- package/dist/dsl/aggregation/types.cjs.map +1 -0
- package/dist/dsl/aggregation/types.d.cts +608 -0
- package/dist/dsl/aggregation/types.d.ts +608 -0
- package/dist/dsl/aggregation/types.es.js +37 -0
- package/dist/dsl/aggregation/types.es.js.map +1 -0
- package/dist/dsl/cursorQuery.cjs +2 -0
- package/dist/dsl/cursorQuery.cjs.map +1 -0
- package/dist/dsl/cursorQuery.d.cts +69 -0
- package/dist/dsl/cursorQuery.d.ts +69 -0
- package/dist/dsl/cursorQuery.es.js +19 -0
- package/dist/dsl/cursorQuery.es.js.map +1 -0
- package/dist/dsl/deletionState.cjs +2 -0
- package/dist/dsl/deletionState.cjs.map +1 -0
- package/dist/dsl/deletionState.d.cts +19 -0
- package/dist/dsl/deletionState.d.ts +19 -0
- package/dist/dsl/deletionState.es.js +8 -0
- package/dist/dsl/deletionState.es.js.map +1 -0
- package/dist/dsl/descriptor.cjs +2 -0
- package/dist/dsl/descriptor.cjs.map +1 -0
- package/dist/dsl/descriptor.d.cts +629 -0
- package/dist/dsl/descriptor.d.ts +629 -0
- package/dist/dsl/descriptor.es.js +37 -0
- package/dist/dsl/descriptor.es.js.map +1 -0
- package/dist/dsl/documents.d.cts +8 -0
- package/dist/dsl/documents.d.ts +8 -0
- package/dist/dsl/field.cjs +2 -0
- package/dist/dsl/field.cjs.map +1 -0
- package/dist/dsl/field.d.cts +2 -0
- package/dist/dsl/field.d.ts +2 -0
- package/dist/dsl/field.es.js +10 -0
- package/dist/dsl/field.es.js.map +1 -0
- package/dist/dsl/filter/builders.cjs +2 -0
- package/dist/dsl/filter/builders.cjs.map +1 -0
- package/dist/dsl/filter/builders.d.cts +962 -0
- package/dist/dsl/filter/builders.d.ts +962 -0
- package/dist/dsl/filter/builders.es.js +289 -0
- package/dist/dsl/filter/builders.es.js.map +1 -0
- package/dist/dsl/filter/datePattern.cjs +2 -0
- package/dist/dsl/filter/datePattern.cjs.map +1 -0
- package/dist/dsl/filter/datePattern.d.cts +8 -0
- package/dist/dsl/filter/datePattern.d.ts +8 -0
- package/dist/dsl/filter/datePattern.es.js +100 -0
- package/dist/dsl/filter/datePattern.es.js.map +1 -0
- package/dist/dsl/filter/index.d.cts +3 -0
- package/dist/dsl/filter/index.d.ts +3 -0
- package/dist/dsl/filter/operator.cjs +2 -0
- package/dist/dsl/filter/operator.cjs.map +1 -0
- package/dist/dsl/filter/operator.d.cts +113 -0
- package/dist/dsl/filter/operator.d.ts +113 -0
- package/dist/dsl/filter/operator.es.js +14 -0
- package/dist/dsl/filter/operator.es.js.map +1 -0
- package/dist/dsl/filter/scope.cjs +2 -0
- package/dist/dsl/filter/scope.cjs.map +1 -0
- package/dist/dsl/filter/scope.d.cts +15 -0
- package/dist/dsl/filter/scope.d.ts +15 -0
- package/dist/dsl/filter/scope.es.js +32 -0
- package/dist/dsl/filter/scope.es.js.map +1 -0
- package/dist/dsl/filter/types.d.cts +274 -0
- package/dist/dsl/filter/types.d.ts +274 -0
- package/dist/dsl/filter/validate.cjs +2 -0
- package/dist/dsl/filter/validate.cjs.map +1 -0
- package/dist/dsl/filter/validate.d.cts +18 -0
- package/dist/dsl/filter/validate.d.ts +18 -0
- package/dist/dsl/filter/validate.es.js +56 -0
- package/dist/dsl/filter/validate.es.js.map +1 -0
- package/dist/dsl/pagination.cjs +2 -0
- package/dist/dsl/pagination.cjs.map +1 -0
- package/dist/dsl/pagination.d.cts +28 -0
- package/dist/dsl/pagination.d.ts +28 -0
- package/dist/dsl/pagination.es.js +15 -0
- package/dist/dsl/pagination.es.js.map +1 -0
- package/dist/dsl/projection.cjs +2 -0
- package/dist/dsl/projection.cjs.map +1 -0
- package/dist/dsl/projection.d.cts +27 -0
- package/dist/dsl/projection.d.ts +27 -0
- package/dist/dsl/projection.es.js +12 -0
- package/dist/dsl/projection.es.js.map +1 -0
- package/dist/dsl/queryable.cjs +2 -0
- package/dist/dsl/queryable.cjs.map +1 -0
- package/dist/dsl/queryable.d.cts +101 -0
- package/dist/dsl/queryable.d.ts +101 -0
- package/dist/dsl/queryable.es.js +40 -0
- package/dist/dsl/queryable.es.js.map +1 -0
- package/dist/dsl/sort.cjs +2 -0
- package/dist/dsl/sort.cjs.map +1 -0
- package/dist/dsl/sort.d.cts +33 -0
- package/dist/dsl/sort.d.ts +33 -0
- package/dist/dsl/sort.es.js +21 -0
- package/dist/dsl/sort.es.js.map +1 -0
- package/dist/dsl.cjs +1 -0
- package/dist/dsl.d.cts +23 -0
- package/dist/dsl.d.ts +23 -0
- package/dist/dsl.es.js +14 -0
- package/dist/error/errorInfo.cjs +2 -0
- package/dist/error/errorInfo.cjs.map +1 -0
- package/dist/error/errorInfo.d.cts +139 -0
- package/dist/error/errorInfo.d.ts +139 -0
- package/dist/error/errorInfo.es.js +32 -0
- package/dist/error/errorInfo.es.js.map +1 -0
- package/dist/error/headers.cjs +2 -0
- package/dist/error/headers.cjs.map +1 -0
- package/dist/error/headers.d.cts +38 -0
- package/dist/error/headers.d.ts +38 -0
- package/dist/error/headers.es.js +10 -0
- package/dist/error/headers.es.js.map +1 -0
- package/dist/error/index.d.cts +21 -0
- package/dist/error/index.d.ts +21 -0
- package/dist/error/queryErrorCodes.cjs +2 -0
- package/dist/error/queryErrorCodes.cjs.map +1 -0
- package/dist/error/queryErrorCodes.d.cts +199 -0
- package/dist/error/queryErrorCodes.d.ts +199 -0
- package/dist/error/queryErrorCodes.es.js +53 -0
- package/dist/error/queryErrorCodes.es.js.map +1 -0
- package/dist/error/wowError.cjs +2 -0
- package/dist/error/wowError.cjs.map +1 -0
- package/dist/error/wowError.d.cts +99 -0
- package/dist/error/wowError.d.ts +99 -0
- package/dist/error/wowError.es.js +53 -0
- package/dist/error/wowError.es.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.es.js +34 -0
- package/dist/legacy/condition.cjs +2 -0
- package/dist/legacy/condition.cjs.map +1 -0
- package/dist/legacy/condition.d.cts +517 -0
- package/dist/legacy/condition.d.ts +517 -0
- package/dist/legacy/condition.es.js +338 -0
- package/dist/legacy/condition.es.js.map +1 -0
- package/dist/legacy/index.d.cts +16 -0
- package/dist/legacy/index.d.ts +16 -0
- package/dist/legacy/locale/en_US.cjs +2 -0
- package/dist/legacy/locale/en_US.cjs.map +1 -0
- package/dist/legacy/locale/en_US.d.cts +7 -0
- package/dist/legacy/locale/en_US.d.ts +7 -0
- package/dist/legacy/locale/en_US.es.js +50 -0
- package/dist/legacy/locale/en_US.es.js.map +1 -0
- package/dist/legacy/locale/operatorLocale.d.cts +10 -0
- package/dist/legacy/locale/operatorLocale.d.ts +10 -0
- package/dist/legacy/locale/zh_CN.cjs +2 -0
- package/dist/legacy/locale/zh_CN.cjs.map +1 -0
- package/dist/legacy/locale/zh_CN.d.cts +7 -0
- package/dist/legacy/locale/zh_CN.d.ts +7 -0
- package/dist/legacy/locale/zh_CN.es.js +50 -0
- package/dist/legacy/locale/zh_CN.es.js.map +1 -0
- package/dist/legacy/operator.cjs +2 -0
- package/dist/legacy/operator.cjs.map +1 -0
- package/dist/legacy/operator.d.cts +218 -0
- package/dist/legacy/operator.d.ts +218 -0
- package/dist/legacy/operator.es.js +25 -0
- package/dist/legacy/operator.es.js.map +1 -0
- package/dist/legacy/queryable.cjs +2 -0
- package/dist/legacy/queryable.cjs.map +1 -0
- package/dist/legacy/queryable.d.cts +61 -0
- package/dist/legacy/queryable.d.ts +61 -0
- package/dist/legacy/queryable.es.js +34 -0
- package/dist/legacy/queryable.es.js.map +1 -0
- package/dist/legacy.cjs +1 -0
- package/dist/legacy.es.js +6 -0
- package/dist/model/abac.cjs +2 -0
- package/dist/model/abac.cjs.map +1 -0
- package/dist/model/abac.d.cts +33 -0
- package/dist/model/abac.d.ts +33 -0
- package/dist/model/abac.es.js +6 -0
- package/dist/model/abac.es.js.map +1 -0
- package/dist/model/bi.cjs +2 -0
- package/dist/model/bi.cjs.map +1 -0
- package/dist/model/bi.d.cts +12 -0
- package/dist/model/bi.d.ts +12 -0
- package/dist/model/bi.es.js +8 -0
- package/dist/model/bi.es.js.map +1 -0
- package/dist/model/command.cjs +2 -0
- package/dist/model/command.cjs.map +1 -0
- package/dist/model/command.d.cts +137 -0
- package/dist/model/command.d.ts +137 -0
- package/dist/model/command.es.js +8 -0
- package/dist/model/command.es.js.map +1 -0
- package/dist/model/common.d.cts +19 -0
- package/dist/model/common.d.ts +19 -0
- package/dist/model/function.cjs +2 -0
- package/dist/model/function.cjs.map +1 -0
- package/dist/model/function.d.cts +41 -0
- package/dist/model/function.d.ts +41 -0
- package/dist/model/function.es.js +8 -0
- package/dist/model/function.es.js.map +1 -0
- package/dist/model/index.d.cts +22 -0
- package/dist/model/index.d.ts +22 -0
- package/dist/model/messaging.d.cts +5 -0
- package/dist/model/messaging.d.ts +5 -0
- package/dist/model/modeling.d.cts +145 -0
- package/dist/model/modeling.d.ts +145 -0
- package/dist/model/naming.d.cts +27 -0
- package/dist/model/naming.d.ts +27 -0
- package/dist/transport/endpoints.cjs +2 -0
- package/dist/transport/endpoints.cjs.map +1 -0
- package/dist/transport/endpoints.d.cts +79 -0
- package/dist/transport/endpoints.d.ts +79 -0
- package/dist/transport/endpoints.es.js +14 -0
- package/dist/transport/endpoints.es.js.map +1 -0
- package/dist/transport/eventStreams.cjs +2 -0
- package/dist/transport/eventStreams.cjs.map +1 -0
- package/dist/transport/eventStreams.d.cts +23 -0
- package/dist/transport/eventStreams.d.ts +23 -0
- package/dist/transport/eventStreams.es.js +22 -0
- package/dist/transport/eventStreams.es.js.map +1 -0
- package/dist/transport/index.d.cts +1 -0
- package/dist/transport/index.d.ts +1 -0
- package/package.json +110 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.es.js","names":["AggregationGroupType","\"TERMS\"","\"HISTOGRAM\"","\"DATE_HISTOGRAM\"","\"DATE_PART\"","AggregationMetricType","\"COUNT\"","\"NUMERIC\"","\"ANY\"","\"DISTINCT_COUNT\"","\"PERCENTILE\"","\"DERIVED\"","\"FIRST\"","\"LAST\"","AggregationExpressionType","\"FIELD\"","\"CONSTANT\"","\"BINARY\"","\"DATE_DIFF\"","DateDiffUnit","\"SECOND\"","\"MINUTE\"","\"HOUR\"","\"DAY\"","AggregationExpressionOperator","\"ADD\"","\"SUBTRACT\"","\"MULTIPLY\"","\"DIVIDE\"","AggregationDateUnit","\"YEAR\"","\"QUARTER\"","\"MONTH\"","\"WEEK\"","AggregationDatePart","\"DAY_OF_WEEK\"","\"DAY_OF_MONTH\"","\"HOUR_OF_DAY\"","\"MONTH_OF_YEAR\"","AggregationFunction","\"SUM\"","\"AVG\"","\"MIN\"","\"MAX\"","\"STDDEV\"","\"VARIANCE\"","DerivedExpressionType","\"METRIC_REF\"","HavingExpressionType","\"CONDITION\"","\"BETWEEN\"","\"IN\"","\"IS_NULL\"","\"AND\"","\"OR\"","ComparisonOperator","\"EQ\"","\"NE\"","\"GT\"","\"GTE\"","\"LT\"","\"LTE\"","AGGREGATION_LIMITS"],"sources":["../../../src/dsl/aggregation/types.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ElementFilterExpression,\n FilterExpression,\n QueryField,\n ExpressionFilter,\n} from '../filter/index.js';\nimport type { FieldSort } from '../sort.js';\n\n/** The kind of an {@link AggregationGroup}, sent as its `type`. */\nexport enum AggregationGroupType {\n /** One group per distinct value; {@link aggregation.terms}. */\n TERMS = 'TERMS',\n /** Number buckets of equal width; {@link aggregation.histogram}. */\n HISTOGRAM = 'HISTOGRAM',\n /** Calendar buckets of a time field; {@link aggregation.dateHistogram}. */\n DATE_HISTOGRAM = 'DATE_HISTOGRAM',\n /**\n * One calendar part of a time field, such as the weekday or the hour;\n * {@link aggregation.datePart}. Wow 9.2 and later.\n */\n DATE_PART = 'DATE_PART',\n}\n\n/**\n * The kind of an {@link AggregationMetric}, sent as its `type`. Wow 8.12\n * knows `COUNT` and `NUMERIC`, Wow 9.0 adds `ANY`, and the other three need\n * Wow 9.1.\n */\nexport enum AggregationMetricType {\n /** The number of rows; {@link aggregation.count}. */\n COUNT = 'COUNT',\n /**\n * An {@link AggregationFunction} of an expression; {@link aggregation.sum}\n * and its siblings.\n */\n NUMERIC = 'NUMERIC',\n /** Any one value of a field; {@link aggregation.any}. Wow 9.0 and later. */\n ANY = 'ANY',\n /**\n * The number of distinct values; {@link aggregation.distinctCount}. Wow 9.1\n * and later.\n */\n DISTINCT_COUNT = 'DISTINCT_COUNT',\n /**\n * A percentile of an expression; {@link aggregation.percentile}. Wow 9.1\n * and later.\n */\n PERCENTILE = 'PERCENTILE',\n /**\n * Arithmetic over other metrics; {@link aggregation.derived}. Wow 9.1 and\n * later.\n */\n DERIVED = 'DERIVED',\n /**\n * A field's value on the group's earliest record; {@link aggregation.first}.\n * Wow 9.2 and later.\n */\n FIRST = 'FIRST',\n /**\n * A field's value on the group's latest record; {@link aggregation.last}.\n * Wow 9.2 and later.\n */\n LAST = 'LAST',\n}\n\n/** The kind of an {@link AggregationExpression} node, sent as its `type`. */\nexport enum AggregationExpressionType {\n /** The value of a field; {@link aggregation.field}. */\n FIELD = 'FIELD',\n /** A number; {@link aggregation.constant}. */\n CONSTANT = 'CONSTANT',\n /** Two operands and an {@link AggregationExpressionOperator}. */\n BINARY = 'BINARY',\n /**\n * The time elapsed between two time fields; {@link aggregation.dateDiff}.\n * Wow 9.2 and later.\n */\n DATE_DIFF = 'DATE_DIFF',\n}\n\n/**\n * The unit a `DATE_DIFF` measures elapsed time in. Each has a fixed length:\n * a `DAY` is exactly 24 hours, and months and years, whose length depends on\n * a calendar and a time zone, are not offered.\n */\nexport enum DateDiffUnit {\n SECOND = 'SECOND',\n MINUTE = 'MINUTE',\n HOUR = 'HOUR',\n DAY = 'DAY',\n}\n\n/**\n * The arithmetic of a `BINARY` node, in an {@link AggregationExpression} or a\n * {@link DerivedExpression}.\n */\nexport enum AggregationExpressionOperator {\n /** `left + right` */\n ADD = 'ADD',\n /** `left - right` */\n SUBTRACT = 'SUBTRACT',\n /** `left * right` */\n MULTIPLY = 'MULTIPLY',\n /** `left / right` */\n DIVIDE = 'DIVIDE',\n}\n\n/**\n * The calendar unit of a `DATE_HISTOGRAM` bucket, cut in the group's\n * `timeZone`.\n */\nexport enum AggregationDateUnit {\n YEAR = 'YEAR',\n QUARTER = 'QUARTER',\n MONTH = 'MONTH',\n WEEK = 'WEEK',\n DAY = 'DAY',\n HOUR = 'HOUR',\n MINUTE = 'MINUTE',\n SECOND = 'SECOND',\n}\n\n/**\n * The calendar part a `DATE_PART` group takes of each instant, read in the\n * group's `timeZone`. Its keys are integers from a fixed domain, so records\n * from different days, weeks or years fall into one bucket.\n */\nexport enum AggregationDatePart {\n /** The ISO weekday: 1 is Monday, 7 is Sunday. */\n DAY_OF_WEEK = 'DAY_OF_WEEK',\n /**\n * The day of the month, 1 to 31; days 29 to 31 exist only in the months\n * that have them.\n */\n DAY_OF_MONTH = 'DAY_OF_MONTH',\n /** The hour on the wall clock of the group's `timeZone`, 0 to 23. */\n HOUR_OF_DAY = 'HOUR_OF_DAY',\n /** The month of the year, 1 (January) to 12. */\n MONTH_OF_YEAR = 'MONTH_OF_YEAR',\n}\n\n/**\n * What a `NUMERIC` metric computes over its expression; each has a builder,\n * {@link aggregation.sum} through {@link aggregation.variance}.\n */\nexport enum AggregationFunction {\n /** The sum */\n SUM = 'SUM',\n /** The average */\n AVG = 'AVG',\n /** The least value */\n MIN = 'MIN',\n /** The greatest value */\n MAX = 'MAX',\n /** The standard deviation */\n STDDEV = 'STDDEV',\n /** The variance */\n VARIANCE = 'VARIANCE',\n}\n\n/**\n * An array field whose elements the query aggregates over instead of the\n * root documents; build it with {@link aggregation.element}. A query takes at\n * most `AGGREGATION_LIMITS.MAX_ELEMENTS` of them.\n */\nexport interface AggregationElement {\n /** The array field, a query field path. */\n path: QueryField;\n /**\n * Keeps only the elements that match; no root filters and no search, but\n * an `EXPRESSION` filter may compare an element's computed value.\n */\n filter?: ElementFilterExpression | ExpressionFilter;\n}\n\n/** What every {@link AggregationGroup} has. */\ninterface AggregationGroupBase<FIELDS extends string = string> {\n /** The field the rows are grouped by. */\n field: QueryField<FIELDS>;\n /** The name of the group's column in the result rows. */\n alias: string;\n}\n\n/**\n * What a TERMS or HISTOGRAM group groups by: a field, or a computed\n * expression in its place (Wow 9.2 and later), never both. An expression\n * input is an expensive computation the server admits only where\n * `analysis.expressions` is `true`.\n */\nexport type AggregationGroupInput<FIELDS extends string = string> =\n | {\n /** The field the rows are grouped by. */\n field: QueryField<FIELDS>;\n expression?: undefined;\n }\n | {\n field?: undefined;\n /** The per-row value the rows are grouped by, such as a `DATE_DIFF`. */\n expression: AggregationExpression<FIELDS>;\n };\n\n/**\n * One group per distinct value of a field, or of an expression;\n * {@link aggregation.terms}. `missingKey` needs a field.\n */\nexport type TermsAggregationGroup<FIELDS extends string = string> = {\n type: AggregationGroupType.TERMS;\n /** The name of the group's column in the result rows. */\n alias: string;\n /** The key the rows without a value are grouped under. Wow 9.1 and later. */\n missingKey?: string;\n} & AggregationGroupInput<FIELDS>;\n\n/**\n * Buckets of equal width over a number field, or over an expression;\n * {@link aggregation.histogram}.\n */\nexport type HistogramAggregationGroup<FIELDS extends string = string> = {\n type: AggregationGroupType.HISTOGRAM;\n /** The name of the group's column in the result rows. */\n alias: string;\n /** The width of each bucket, greater than 0. */\n interval: number;\n} & AggregationGroupInput<FIELDS>;\n\n/**\n * Calendar buckets over a time field in epoch milliseconds;\n * {@link aggregation.dateHistogram}.\n */\nexport interface DateHistogramAggregationGroup<\n FIELDS extends string = string,\n> extends AggregationGroupBase<FIELDS> {\n type: AggregationGroupType.DATE_HISTOGRAM;\n /** The calendar unit of each bucket. */\n unit: AggregationDateUnit;\n /** The IANA zone the buckets are cut in; `UTC` when absent. */\n timeZone?: string;\n /**\n * Whether the server fills in the empty buckets of the range. Wow 9.1 and\n * later, and only when this is the query's only group.\n */\n dense?: boolean;\n}\n\n/**\n * One calendar part of a time field in epoch milliseconds, such as the\n * weekday or the hour; {@link aggregation.datePart}. Its keys in the result\n * rows are integers from the part's domain, such as 1 (Monday) to 7 (Sunday)\n * for `DAY_OF_WEEK`. Wow 9.2 and later.\n */\nexport interface DatePartAggregationGroup<\n FIELDS extends string = string,\n> extends AggregationGroupBase<FIELDS> {\n type: AggregationGroupType.DATE_PART;\n /** The calendar part each row is grouped by. */\n part: AggregationDatePart;\n /** The IANA zone the part is read in; `UTC` when absent. */\n timeZone?: string;\n /**\n * Whether the server returns every key of the part's domain, filling a\n * key with no records with each metric's empty value. Only when this is\n * the query's only group.\n */\n dense?: boolean;\n}\n\n/**\n * One dimension of an {@link AggregationQuery}'s `groupBy`: each result row\n * is one combination of the groups' keys.\n */\nexport type AggregationGroup<FIELDS extends string = string> =\n | TermsAggregationGroup<FIELDS>\n | HistogramAggregationGroup<FIELDS>\n | DateHistogramAggregationGroup<FIELDS>\n | DatePartAggregationGroup<FIELDS>;\n\n/** The value of a field, as an operand; {@link aggregation.field}. */\nexport interface FieldAggregationExpression<FIELDS extends string = string> {\n type: AggregationExpressionType.FIELD;\n /** The field, a query field path. */\n field: QueryField<FIELDS>;\n}\n\n/** A number, as an operand; {@link aggregation.constant}. */\nexport interface ConstantAggregationExpression {\n type: AggregationExpressionType.CONSTANT;\n /** A finite number. */\n value: number;\n}\n\n/**\n * `left operator right`; {@link aggregation.add}, {@link aggregation.subtract},\n * {@link aggregation.multiply}, {@link aggregation.divide}.\n */\nexport interface BinaryAggregationExpression<FIELDS extends string = string> {\n type: AggregationExpressionType.BINARY;\n /** The arithmetic. */\n operator: AggregationExpressionOperator;\n /** The left operand. */\n left: AggregationExpression<FIELDS>;\n /** The right operand. */\n right: AggregationExpression<FIELDS>;\n}\n\n/**\n * The time from the instant in `from` to the instant in `to`, `to − from`,\n * in `unit`, as a signed decimal: negative when `to` is earlier, and no\n * value when either is absent. Both are single-valued time fields (their\n * `aggregate.groups` list `DATE_HISTOGRAM`), each read in its own encoding;\n * {@link aggregation.dateDiff}. Wow 9.2 and later.\n */\nexport interface DateDiffAggregationExpression<FIELDS extends string = string> {\n type: AggregationExpressionType.DATE_DIFF;\n /** The earlier instant, when the difference is positive. */\n from: QueryField<FIELDS>;\n /** The later instant, when the difference is positive. */\n to: QueryField<FIELDS>;\n /** The unit the difference is measured in. */\n unit: DateDiffUnit;\n}\n\n/**\n * Per-row arithmetic over fields, time differences and numbers, which a\n * metric aggregates, a TERMS or HISTOGRAM group groups by, and an\n * `EXPRESSION` filter compares. A tree at most\n * `AGGREGATION_LIMITS.MAX_EXPRESSION_DEPTH` deep and `MAX_EXPRESSION_NODES`\n * large, counted over a query's metrics together and over each group or\n * filter on its own.\n */\nexport type AggregationExpression<FIELDS extends string = string> =\n | FieldAggregationExpression<FIELDS>\n | ConstantAggregationExpression\n | BinaryAggregationExpression<FIELDS>\n | DateDiffAggregationExpression<FIELDS>;\n\n/** The number of rows in each group; {@link aggregation.count}. */\nexport interface CountAggregationMetric<FIELDS extends string = string> {\n /** Counts only the rows that match. Wow 9.1 and later. */\n filter?: FilterExpression<FIELDS>;\n type: AggregationMetricType.COUNT;\n /** The name of the metric's column in the result rows. */\n alias: string;\n}\n\n/**\n * An {@link AggregationFunction} of an expression; {@link aggregation.sum},\n * `avg`, `min`, `max`, `stddev`, `variance`.\n */\nexport interface NumericAggregationMetric<FIELDS extends string = string> {\n /** Aggregates only the rows that match. Wow 9.1 and later. */\n filter?: FilterExpression<FIELDS>;\n type: AggregationMetricType.NUMERIC;\n /** What is computed. */\n function: AggregationFunction;\n /** The per-row value it is computed over. */\n expression: AggregationExpression<FIELDS>;\n /** The name of the metric's column in the result rows. */\n alias: string;\n}\n\n/**\n * Any one value of a field within each group, of any type;\n * {@link aggregation.any}. Wow 9.0 and later. Neither a derived metric nor\n * `having` may refer to it.\n */\nexport interface AnyAggregationMetric<FIELDS extends string = string> {\n /** Aggregates only the rows that match. Wow 9.1 and later. */\n filter?: FilterExpression<FIELDS>;\n type: AggregationMetricType.ANY;\n /** The field whose value is taken. */\n field: QueryField<FIELDS>;\n /** The name of the metric's column in the result rows. */\n alias: string;\n}\n\n/**\n * A field's value on the earliest (`FIRST`) or latest (`LAST`) record of\n * each group, ordered by `orderBy`; {@link aggregation.first} and\n * {@link aggregation.last}. Wow 9.2 and later.\n *\n * The value comes back in the field's own type, not as a number, and is\n * `null` when no record of the group has both a value and an `orderBy`\n * position. Without `orderBy` the server orders by the model's event time,\n * the field the descriptor names as `analysis.firstLastOrderBy`. Records\n * tied on `orderBy` may yield any one of their values. Like `ANY`, neither a\n * derived metric nor `having` may refer to it.\n */\nexport interface EdgeAggregationMetric<FIELDS extends string = string> {\n type: AggregationMetricType.FIRST | AggregationMetricType.LAST;\n /** The single-valued field whose value is taken. */\n field: QueryField<FIELDS>;\n /**\n * The single-valued, sortable field that orders the records; the model's\n * event time when absent.\n */\n orderBy?: QueryField<FIELDS>;\n /** The name of the metric's column in the result rows. */\n alias: string;\n /** Aggregates only the rows that match. */\n filter?: FilterExpression<FIELDS>;\n}\n\n/**\n * The number of distinct values of an expression;\n * {@link aggregation.distinctCount}. Wow 9.1 and later.\n */\nexport interface DistinctCountAggregationMetric<\n FIELDS extends string = string,\n> {\n type: AggregationMetricType.DISTINCT_COUNT;\n /** The per-row value whose distinct values are counted. */\n expression: AggregationExpression<FIELDS>;\n /** The name of the metric's column in the result rows. */\n alias: string;\n /** Aggregates only the rows that match. */\n filter?: FilterExpression<FIELDS>;\n}\n\n/**\n * A percentile of an expression; {@link aggregation.percentile}. Wow 9.1 and\n * later.\n */\nexport interface PercentileAggregationMetric<FIELDS extends string = string> {\n type: AggregationMetricType.PERCENTILE;\n /** The per-row value the percentile is taken over. */\n expression: AggregationExpression<FIELDS>;\n /** Which percentile, within (0, 100). */\n percentile: number;\n /** The name of the metric's column in the result rows. */\n alias: string;\n /** Aggregates only the rows that match. */\n filter?: FilterExpression<FIELDS>;\n}\n\n/** The kind of a {@link DerivedExpression} node, sent as its `type`. */\nexport enum DerivedExpressionType {\n /** The value of another metric of the row, by its alias. */\n METRIC_REF = 'METRIC_REF',\n /** A number. */\n CONSTANT = 'CONSTANT',\n /** Two operands and an {@link AggregationExpressionOperator}. */\n BINARY = 'BINARY',\n}\n\n/**\n * Post-aggregation arithmetic; references must name earlier metrics that are\n * not `ANY`, `FIRST` or `LAST`.\n */\nexport type DerivedExpression =\n | { type: DerivedExpressionType.METRIC_REF; metric: string }\n | { type: DerivedExpressionType.CONSTANT; value: number }\n | {\n type: DerivedExpressionType.BINARY;\n operator: AggregationExpressionOperator;\n left: DerivedExpression;\n right: DerivedExpression;\n };\n\n/**\n * A metric computed from metrics declared before it in the same query, after\n * aggregation; {@link aggregation.derived}. Wow 9.1 and later.\n */\nexport interface DerivedAggregationMetric {\n type: AggregationMetricType.DERIVED;\n /** The arithmetic over the other metrics. */\n expression: DerivedExpression;\n /** The name of the metric's column in the result rows. */\n alias: string;\n}\n\n/** The kind of a {@link HavingExpression} node, sent as its `type`. */\nexport enum HavingExpressionType {\n /** A metric compared with a number; `aggregation.having.eq` … `lte`. */\n CONDITION = 'CONDITION',\n /** A metric within bounds, inclusive; `aggregation.having.between`. */\n BETWEEN = 'BETWEEN',\n /** A metric equal to one of the numbers; `aggregation.having.isIn`. */\n IN = 'IN',\n /**\n * A metric without a value, or with one when `negated`;\n * `aggregation.having.isNull`, `isNotNull`.\n */\n IS_NULL = 'IS_NULL',\n /** All operands hold; `aggregation.having.and`. */\n AND = 'AND',\n /** At least one operand holds; `aggregation.having.or`. */\n OR = 'OR',\n}\n\n/** The comparison of a `CONDITION` in a {@link HavingExpression}. */\nexport enum ComparisonOperator {\n /** `=` */\n EQ = 'EQ',\n /** `≠` */\n NE = 'NE',\n /** `>` */\n GT = 'GT',\n /** `≥` */\n GTE = 'GTE',\n /** `<` */\n LT = 'LT',\n /** `≤` */\n LTE = 'LTE',\n}\n\n/**\n * Filters grouped results by metric aliases, before sorting/limit; never an\n * `ANY`, `FIRST` or `LAST` metric.\n */\nexport type HavingExpression =\n | {\n type: HavingExpressionType.CONDITION;\n metric: string;\n operator: ComparisonOperator;\n value: number;\n }\n | {\n type: HavingExpressionType.BETWEEN;\n metric: string;\n lower: number;\n upper: number;\n }\n | {\n type: HavingExpressionType.IN;\n metric: string;\n values: [number, ...number[]];\n }\n | { type: HavingExpressionType.IS_NULL; metric: string; negated?: boolean }\n | {\n type: HavingExpressionType.AND | HavingExpressionType.OR;\n operands: [HavingExpression, ...HavingExpression[]];\n };\n\n/**\n * One column an {@link AggregationQuery} computes for each group; a query\n * takes 1 to `AGGREGATION_LIMITS.MAX_METRICS` of them.\n */\nexport type AggregationMetric<FIELDS extends string = string> =\n | CountAggregationMetric<FIELDS>\n | NumericAggregationMetric<FIELDS>\n | AnyAggregationMetric<FIELDS>\n | DistinctCountAggregationMetric<FIELDS>\n | PercentileAggregationMetric<FIELDS>\n | DerivedAggregationMetric\n | EdgeAggregationMetric<FIELDS>;\n\n/**\n * An aggregation request: which documents, grouped how, computing which\n * metrics. `QueryApi.aggregate` and `aggregateStream` send it, and each\n * result row holds the groups' and metrics' columns by alias. Assemble it\n * with {@link aggregation.query}, which checks the rules Wow enforces across\n * its parts before anything is sent.\n *\n * Wow 8.11 has no aggregation endpoint; Wow 8.12 added it with `COUNT` and\n * `NUMERIC` metrics, and Wow 9.0 added `ANY`. `having`, the `DISTINCT_COUNT`,\n * `PERCENTILE` and `DERIVED` metrics, metric filters, `missingKey` and `dense`\n * need Wow 9.1.\n *\n * @template ROOT_FIELDS - The fields `filter` may name\n * @template AGGREGATION_FIELDS - The fields groups and metrics may name\n */\nexport interface AggregationQuery<\n ROOT_FIELDS extends string = string,\n AGGREGATION_FIELDS extends string = ROOT_FIELDS,\n> {\n /** Which documents are aggregated; all of them when absent. */\n filter?: FilterExpression<ROOT_FIELDS>;\n /** Array fields to aggregate the elements of, instead of the documents. */\n elements?: AggregationElement[];\n /** The dimensions of the result; one row in total when absent or empty. */\n groupBy?: AggregationGroup<AGGREGATION_FIELDS>[];\n /** The columns computed for each group. */\n metrics: [\n AggregationMetric<AGGREGATION_FIELDS>,\n ...AggregationMetric<AGGREGATION_FIELDS>[],\n ];\n /**\n * The order of the rows, by group or metric alias; needs a `groupBy`. Wow\n * then sorts by each remaining group ascending.\n */\n sort?: FieldSort[];\n /**\n * The most rows returned, 1 to `AGGREGATION_LIMITS.MAX_LIMIT`; the\n * server returns `DEFAULT_LIMIT` (100) when absent.\n */\n limit?: number;\n /**\n * Keeps only the grouped rows whose metrics match, before `sort` and\n * `limit`; built with {@link aggregation.having}. Needs a `groupBy`.\n */\n having?: HavingExpression;\n}\n\n/**\n * The options every metric builder takes after its target and alias.\n */\nexport interface AggregationMetricOptions<FIELDS extends string = string> {\n /** Counts only the rows that match; sent as the metric's `filter`. */\n filter?: FilterExpression<FIELDS>;\n}\n\n/** The options of {@link aggregation.terms}. */\nexport interface TermsAggregationOptions {\n /** The key rows without a value are grouped under; must not be blank. */\n missingKey?: string;\n}\n\n/** The options of {@link aggregation.histogram}. */\nexport interface HistogramAggregationOptions {\n /** The width of each bucket: finite and greater than 0. */\n interval: number;\n}\n\n/** The options of {@link aggregation.dateHistogram}. */\nexport interface DateHistogramAggregationOptions {\n /** The calendar unit of each bucket. */\n unit: AggregationDateUnit;\n /** The zone the buckets are cut in, an IANA id. Defaults to `UTC`. */\n timeZone?: string;\n /**\n * Whether the server fills in the empty buckets of the range. Only when\n * this is the only group.\n */\n dense?: boolean;\n}\n\n/** The options of {@link aggregation.datePart}. */\nexport interface DatePartAggregationOptions {\n /** The calendar part each row is grouped by. */\n part: AggregationDatePart;\n /** The zone the part is read in, an IANA id. Defaults to `UTC`. */\n timeZone?: string;\n /**\n * Whether the server returns every key of the part's domain, the empty\n * ones filled in. Only when this is the only group.\n */\n dense?: boolean;\n}\n\n/** The options of {@link aggregation.first} and {@link aggregation.last}. */\nexport interface EdgeAggregationOptions<\n FIELDS extends string = string,\n> extends AggregationMetricOptions<FIELDS> {\n /**\n * The single-valued, sortable field that orders the records. Defaults to\n * the model's event time, `analysis.firstLastOrderBy` in the descriptor.\n */\n orderBy?: FIELDS;\n}\n\n/** The options of {@link aggregation.percentile}. */\nexport interface PercentileAggregationOptions<\n FIELDS extends string = string,\n> extends AggregationMetricOptions<FIELDS> {\n /** Which percentile: finite and within (0, 100). */\n percentile: number;\n}\n\n/**\n * The sizes Wow's own `AggregationQuery` enforces by throwing.\n *\n * A query that breaks one of them is refused by the server, which says what\n * was wrong but not which metric or group said it. Checking here keeps the\n * complaint next to the call that built the query.\n */\nexport const AGGREGATION_LIMITS = Object.freeze({\n /** Rows returned when a query names no limit of its own. */\n DEFAULT_LIMIT: 100,\n /** The largest `limit`. */\n MAX_LIMIT: 10_000,\n /** The most `elements`. */\n MAX_ELEMENTS: 5,\n /** The most `groupBy` entries. */\n MAX_GROUPS: 32,\n /** The most `metrics`. */\n MAX_METRICS: 64,\n /** The most `sort` fields, including those Wow appends for the groups. */\n MAX_SORT_FIELDS: 32,\n /** The deepest expression tree. */\n MAX_EXPRESSION_DEPTH: 8,\n /** The most expression nodes in the whole query. */\n MAX_EXPRESSION_NODES: 256,\n});\n"],"mappings":";AAsBA,IAAYA,IAAL,yBAAA,GAAA;QAEL,EAAAC,QAAA,SAEA,EAAAC,YAAA,aAEA,EAAAC,iBAAA,kBAKA,EAAAC,YAAA;AACF,EAAA,CAAA,CAAA,GAOYC,IAAL,yBAAA,GAAA;QAEL,EAAAC,QAAA,SAKA,EAAAC,UAAA,WAEA,EAAAC,MAAA,OAKA,EAAAC,iBAAA,kBAKA,EAAAC,aAAA,cAKA,EAAAC,UAAA,WAKA,EAAAC,QAAA,SAKA,EAAAC,OAAA;AACF,EAAA,CAAA,CAAA,GAGYC,IAAL,yBAAA,GAAA;QAEL,EAAAC,QAAA,SAEA,EAAAC,WAAA,YAEA,EAAAC,SAAA,UAKA,EAAAC,YAAA;AACF,EAAA,CAAA,CAAA,GAOYC,IAAL,yBAAA,GAAA;QACL,EAAAC,SAAA,UACA,EAAAC,SAAA,UACA,EAAAC,OAAA,QACA,EAAAC,MAAA;AACF,EAAA,CAAA,CAAA,GAMYC,IAAL,yBAAA,GAAA;QAEL,EAAAC,MAAA,OAEA,EAAAC,WAAA,YAEA,EAAAC,WAAA,YAEA,EAAAC,SAAA;AACF,EAAA,CAAA,CAAA,GAMYC,IAAL,yBAAA,GAAA;QACL,EAAAC,OAAA,QACA,EAAAC,UAAA,WACA,EAAAC,QAAA,SACA,EAAAC,OAAA,QACA,EAAAV,MAAA,OACA,EAAAD,OAAA,QACA,EAAAD,SAAA,UACA,EAAAD,SAAA;AACF,EAAA,CAAA,CAAA,GAOYc,IAAL,yBAAA,GAAA;QAEL,EAAAC,cAAA,eAKA,EAAAC,eAAA,gBAEA,EAAAC,cAAA,eAEA,EAAAC,gBAAA;AACF,EAAA,CAAA,CAAA,GAMYC,IAAL,yBAAA,GAAA;QAEL,EAAAC,MAAA,OAEA,EAAAC,MAAA,OAEA,EAAAC,MAAA,OAEA,EAAAC,MAAA,OAEA,EAAAC,SAAA,UAEA,EAAAC,WAAA;AACF,EAAA,CAAA,CAAA,GAqRYC,IAAL,yBAAA,GAAA;QAEL,EAAAC,aAAA,cAEA,EAAA/B,WAAA,YAEA,EAAAC,SAAA;AACF,EAAA,CAAA,CAAA,GA6BY+B,IAAL,yBAAA,GAAA;QAEL,EAAAC,YAAA,aAEA,EAAAC,UAAA,WAEA,EAAAC,KAAA,MAKA,EAAAC,UAAA,WAEA,EAAAC,MAAA,OAEA,EAAAC,KAAA;AACF,EAAA,CAAA,CAAA,GAGYC,IAAL,yBAAA,GAAA;QAEL,EAAAC,KAAA,MAEA,EAAAC,KAAA,MAEA,EAAAC,KAAA,MAEA,EAAAC,MAAA,OAEA,EAAAC,KAAA,MAEA,EAAAC,MAAA;AACF,EAAA,CAAA,CAAA,GAkKaC,IAAqB,OAAO,OAAO;CAE9C,eAAe;CAEf,WAAW;CAEX,cAAc;CAEd,YAAY;CAEZ,aAAa;CAEb,iBAAiB;CAEjB,sBAAsB;CAEtB,sBAAsB;AACxB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=10,t=2147483646,n=32;function r({filter:e,projection:n={},sort:r=[],size:i=10,cursor:a=null}){if(!Number.isInteger(i)||i<1||i>2147483646)throw TypeError(`size must be between 1 and ${t}.`);if(r.length>32)throw TypeError(`sort must contain at most 32 fields.`);let o=r.map(e=>e.field);if(new Set(o).size!==o.length)throw TypeError(`Cursor sort fields must be unique.`);return{filter:e,projection:n,sort:r,size:i,cursor:a}}exports.DEFAULT_CURSOR_SIZE=e,exports.MAX_CURSOR_SIZE=t,exports.MAX_CURSOR_SORT_FIELDS=n,exports.cursorQuery=r;
|
|
2
|
+
//# sourceMappingURL=cursorQuery.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursorQuery.cjs","names":["DEFAULT_CURSOR_SIZE","MAX_CURSOR_SIZE","MAX_CURSOR_SORT_FIELDS","cursorQuery","size","sort","fields","entry"],"sources":["../../src/dsl/cursorQuery.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FilterExpression } from './filter/index.js';\nimport type { Projection } from './projection.js';\nimport type { FieldSort } from './sort.js';\n\n/** The page size `cursorQuery()` uses when none is given. */\nexport const DEFAULT_CURSOR_SIZE = 10;\n/**\n * The largest page size the cursor model admits (`CursorQuery` in Wow).\n * Over HTTP the server enforces a smaller, configurable page limit — 100 by\n * default — and answers a larger size with a 400.\n */\nexport const MAX_CURSOR_SIZE = 2_147_483_646;\n/** The most sort fields a cursor query may name. */\nexport const MAX_CURSOR_SORT_FIELDS = 32;\n\n/**\n * The body of a forward-only cursor query, which `QueryApi.cursor` and\n * `SnapshotQueryApi.cursorState` send; build it with {@link cursorQuery}.\n * Unlike a paged query it returns no total, and each page starts where the\n * one before ended. Wow 9.0 and later; Wow 8.11 has no cursor endpoints.\n */\nexport interface CursorQuery<FIELDS extends string = string> {\n /** What to match. */\n filter: FilterExpression<FIELDS>;\n /** Which fields to return; all of them when absent. */\n projection?: Projection<FIELDS>;\n /**\n * The order of the rows. The server appends a unique field, so each field\n * may appear once.\n */\n sort?: FieldSort<FIELDS>[];\n /** The rows of one page; the server uses 10 when absent. */\n size?: number;\n /**\n * Where the page starts: `null` or absent for the first page, then the\n * `nextCursor` of the page before, with the same filter and sort.\n */\n cursor?: string | null;\n}\n\n/** One page of a cursor query. */\nexport interface CursorPage<T> {\n /** The rows of this page. */\n list: T[];\n /** The `cursor` of the next page, or `null` after the last page. */\n nextCursor: string | null;\n}\n\n/**\n * Builds the body of a cursor query, with the defaults filled in: all fields,\n * no sort, a page of {@link DEFAULT_CURSOR_SIZE}, from the start.\n *\n * @throws TypeError when `size` is not an integer from 1 to\n * {@link MAX_CURSOR_SIZE}, or `sort` names more than\n * {@link MAX_CURSOR_SORT_FIELDS} fields or a field twice.\n *\n * @example\n * ```typescript\n * const first = await snapshotClient.cursorState(\n * cursorQuery({ filter: filter.eq('status', 'ACTIVE'), size: 50 }),\n * );\n * if (first.nextCursor !== null) {\n * await snapshotClient.cursorState(\n * cursorQuery({\n * filter: filter.eq('status', 'ACTIVE'),\n * size: 50,\n * cursor: first.nextCursor,\n * }),\n * );\n * }\n * ```\n */\nexport function cursorQuery<FIELDS extends string = string>({\n filter,\n projection = {},\n sort = [],\n size = DEFAULT_CURSOR_SIZE,\n cursor = null,\n}: CursorQuery<FIELDS>): CursorQuery<FIELDS> {\n if (!Number.isInteger(size) || size < 1 || size > MAX_CURSOR_SIZE) {\n throw new TypeError(`size must be between 1 and ${MAX_CURSOR_SIZE}.`);\n }\n if (sort.length > MAX_CURSOR_SORT_FIELDS) {\n throw new TypeError(\n `sort must contain at most ${MAX_CURSOR_SORT_FIELDS} fields.`,\n );\n }\n // A cursor is a position in one total order, so the gateway appends a unique\n // field and then refuses a repeated one: two directions for the same field\n // would leave the position ambiguous and a page could repeat or skip rows.\n const fields = sort.map(entry => entry.field);\n if (new Set(fields).size !== fields.length) {\n throw new TypeError('Cursor sort fields must be unique.');\n }\n return { filter, projection, sort, size, cursor };\n}\n"],"mappings":"AAkBA,IAAaA,EAAsB,GAMtBC,EAAkB,WAElBC,EAAyB,GA2DtC,SAAgBC,EAA4C,CAC1D,SACA,aAAa,CAAC,EACd,OAAO,CAAC,EACR,OAAA,GACA,SAAS,MACkC,CAC3C,GAAI,CAAC,OAAO,UAAUC,CAAI,GAAKA,EAAO,GAAKA,EAAA,WACzC,MAAU,UAAU,8BAA8BH,EAAgB,EAAE,EAEtE,GAAII,EAAK,OAAA,GACP,MAAU,UACR,sCACF,EAKF,IAAMC,EAASD,EAAK,IAAI,GAASE,EAAM,KAAK,EAC5C,GAAI,IAAI,IAAID,CAAM,CAAC,CAAC,OAASA,EAAO,OAClC,MAAU,UAAU,oCAAoC,EAE1D,MAAO,CAAE,SAAQ,aAAY,OAAM,OAAM,QAAO,CAClD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FilterExpression } from './filter/index.cjs';
|
|
2
|
+
import { Projection } from './projection.cjs';
|
|
3
|
+
import { FieldSort } from './sort.cjs';
|
|
4
|
+
/** The page size `cursorQuery()` uses when none is given. */
|
|
5
|
+
export declare const DEFAULT_CURSOR_SIZE = 10;
|
|
6
|
+
/**
|
|
7
|
+
* The largest page size the cursor model admits (`CursorQuery` in Wow).
|
|
8
|
+
* Over HTTP the server enforces a smaller, configurable page limit — 100 by
|
|
9
|
+
* default — and answers a larger size with a 400.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MAX_CURSOR_SIZE = 2147483646;
|
|
12
|
+
/** The most sort fields a cursor query may name. */
|
|
13
|
+
export declare const MAX_CURSOR_SORT_FIELDS = 32;
|
|
14
|
+
/**
|
|
15
|
+
* The body of a forward-only cursor query, which `QueryApi.cursor` and
|
|
16
|
+
* `SnapshotQueryApi.cursorState` send; build it with {@link cursorQuery}.
|
|
17
|
+
* Unlike a paged query it returns no total, and each page starts where the
|
|
18
|
+
* one before ended. Wow 9.0 and later; Wow 8.11 has no cursor endpoints.
|
|
19
|
+
*/
|
|
20
|
+
export interface CursorQuery<FIELDS extends string = string> {
|
|
21
|
+
/** What to match. */
|
|
22
|
+
filter: FilterExpression<FIELDS>;
|
|
23
|
+
/** Which fields to return; all of them when absent. */
|
|
24
|
+
projection?: Projection<FIELDS>;
|
|
25
|
+
/**
|
|
26
|
+
* The order of the rows. The server appends a unique field, so each field
|
|
27
|
+
* may appear once.
|
|
28
|
+
*/
|
|
29
|
+
sort?: FieldSort<FIELDS>[];
|
|
30
|
+
/** The rows of one page; the server uses 10 when absent. */
|
|
31
|
+
size?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Where the page starts: `null` or absent for the first page, then the
|
|
34
|
+
* `nextCursor` of the page before, with the same filter and sort.
|
|
35
|
+
*/
|
|
36
|
+
cursor?: string | null;
|
|
37
|
+
}
|
|
38
|
+
/** One page of a cursor query. */
|
|
39
|
+
export interface CursorPage<T> {
|
|
40
|
+
/** The rows of this page. */
|
|
41
|
+
list: T[];
|
|
42
|
+
/** The `cursor` of the next page, or `null` after the last page. */
|
|
43
|
+
nextCursor: string | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Builds the body of a cursor query, with the defaults filled in: all fields,
|
|
47
|
+
* no sort, a page of {@link DEFAULT_CURSOR_SIZE}, from the start.
|
|
48
|
+
*
|
|
49
|
+
* @throws TypeError when `size` is not an integer from 1 to
|
|
50
|
+
* {@link MAX_CURSOR_SIZE}, or `sort` names more than
|
|
51
|
+
* {@link MAX_CURSOR_SORT_FIELDS} fields or a field twice.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const first = await snapshotClient.cursorState(
|
|
56
|
+
* cursorQuery({ filter: filter.eq('status', 'ACTIVE'), size: 50 }),
|
|
57
|
+
* );
|
|
58
|
+
* if (first.nextCursor !== null) {
|
|
59
|
+
* await snapshotClient.cursorState(
|
|
60
|
+
* cursorQuery({
|
|
61
|
+
* filter: filter.eq('status', 'ACTIVE'),
|
|
62
|
+
* size: 50,
|
|
63
|
+
* cursor: first.nextCursor,
|
|
64
|
+
* }),
|
|
65
|
+
* );
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function cursorQuery<FIELDS extends string = string>({ filter, projection, sort, size, cursor, }: CursorQuery<FIELDS>): CursorQuery<FIELDS>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FilterExpression } from './filter/index.js';
|
|
2
|
+
import { Projection } from './projection.js';
|
|
3
|
+
import { FieldSort } from './sort.js';
|
|
4
|
+
/** The page size `cursorQuery()` uses when none is given. */
|
|
5
|
+
export declare const DEFAULT_CURSOR_SIZE = 10;
|
|
6
|
+
/**
|
|
7
|
+
* The largest page size the cursor model admits (`CursorQuery` in Wow).
|
|
8
|
+
* Over HTTP the server enforces a smaller, configurable page limit — 100 by
|
|
9
|
+
* default — and answers a larger size with a 400.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MAX_CURSOR_SIZE = 2147483646;
|
|
12
|
+
/** The most sort fields a cursor query may name. */
|
|
13
|
+
export declare const MAX_CURSOR_SORT_FIELDS = 32;
|
|
14
|
+
/**
|
|
15
|
+
* The body of a forward-only cursor query, which `QueryApi.cursor` and
|
|
16
|
+
* `SnapshotQueryApi.cursorState` send; build it with {@link cursorQuery}.
|
|
17
|
+
* Unlike a paged query it returns no total, and each page starts where the
|
|
18
|
+
* one before ended. Wow 9.0 and later; Wow 8.11 has no cursor endpoints.
|
|
19
|
+
*/
|
|
20
|
+
export interface CursorQuery<FIELDS extends string = string> {
|
|
21
|
+
/** What to match. */
|
|
22
|
+
filter: FilterExpression<FIELDS>;
|
|
23
|
+
/** Which fields to return; all of them when absent. */
|
|
24
|
+
projection?: Projection<FIELDS>;
|
|
25
|
+
/**
|
|
26
|
+
* The order of the rows. The server appends a unique field, so each field
|
|
27
|
+
* may appear once.
|
|
28
|
+
*/
|
|
29
|
+
sort?: FieldSort<FIELDS>[];
|
|
30
|
+
/** The rows of one page; the server uses 10 when absent. */
|
|
31
|
+
size?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Where the page starts: `null` or absent for the first page, then the
|
|
34
|
+
* `nextCursor` of the page before, with the same filter and sort.
|
|
35
|
+
*/
|
|
36
|
+
cursor?: string | null;
|
|
37
|
+
}
|
|
38
|
+
/** One page of a cursor query. */
|
|
39
|
+
export interface CursorPage<T> {
|
|
40
|
+
/** The rows of this page. */
|
|
41
|
+
list: T[];
|
|
42
|
+
/** The `cursor` of the next page, or `null` after the last page. */
|
|
43
|
+
nextCursor: string | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Builds the body of a cursor query, with the defaults filled in: all fields,
|
|
47
|
+
* no sort, a page of {@link DEFAULT_CURSOR_SIZE}, from the start.
|
|
48
|
+
*
|
|
49
|
+
* @throws TypeError when `size` is not an integer from 1 to
|
|
50
|
+
* {@link MAX_CURSOR_SIZE}, or `sort` names more than
|
|
51
|
+
* {@link MAX_CURSOR_SORT_FIELDS} fields or a field twice.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const first = await snapshotClient.cursorState(
|
|
56
|
+
* cursorQuery({ filter: filter.eq('status', 'ACTIVE'), size: 50 }),
|
|
57
|
+
* );
|
|
58
|
+
* if (first.nextCursor !== null) {
|
|
59
|
+
* await snapshotClient.cursorState(
|
|
60
|
+
* cursorQuery({
|
|
61
|
+
* filter: filter.eq('status', 'ACTIVE'),
|
|
62
|
+
* size: 50,
|
|
63
|
+
* cursor: first.nextCursor,
|
|
64
|
+
* }),
|
|
65
|
+
* );
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function cursorQuery<FIELDS extends string = string>({ filter, projection, sort, size, cursor, }: CursorQuery<FIELDS>): CursorQuery<FIELDS>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/dsl/cursorQuery.ts
|
|
2
|
+
var e = 10, t = 2147483646, n = 32;
|
|
3
|
+
function r({ filter: e, projection: n = {}, sort: r = [], size: i = 10, cursor: a = null }) {
|
|
4
|
+
if (!Number.isInteger(i) || i < 1 || i > 2147483646) throw TypeError(`size must be between 1 and ${t}.`);
|
|
5
|
+
if (r.length > 32) throw TypeError("sort must contain at most 32 fields.");
|
|
6
|
+
let o = r.map((e) => e.field);
|
|
7
|
+
if (new Set(o).size !== o.length) throw TypeError("Cursor sort fields must be unique.");
|
|
8
|
+
return {
|
|
9
|
+
filter: e,
|
|
10
|
+
projection: n,
|
|
11
|
+
sort: r,
|
|
12
|
+
size: i,
|
|
13
|
+
cursor: a
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as DEFAULT_CURSOR_SIZE, t as MAX_CURSOR_SIZE, n as MAX_CURSOR_SORT_FIELDS, r as cursorQuery };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=cursorQuery.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursorQuery.es.js","names":["DEFAULT_CURSOR_SIZE","MAX_CURSOR_SIZE","MAX_CURSOR_SORT_FIELDS","cursorQuery","size","sort","fields","entry"],"sources":["../../src/dsl/cursorQuery.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FilterExpression } from './filter/index.js';\nimport type { Projection } from './projection.js';\nimport type { FieldSort } from './sort.js';\n\n/** The page size `cursorQuery()` uses when none is given. */\nexport const DEFAULT_CURSOR_SIZE = 10;\n/**\n * The largest page size the cursor model admits (`CursorQuery` in Wow).\n * Over HTTP the server enforces a smaller, configurable page limit — 100 by\n * default — and answers a larger size with a 400.\n */\nexport const MAX_CURSOR_SIZE = 2_147_483_646;\n/** The most sort fields a cursor query may name. */\nexport const MAX_CURSOR_SORT_FIELDS = 32;\n\n/**\n * The body of a forward-only cursor query, which `QueryApi.cursor` and\n * `SnapshotQueryApi.cursorState` send; build it with {@link cursorQuery}.\n * Unlike a paged query it returns no total, and each page starts where the\n * one before ended. Wow 9.0 and later; Wow 8.11 has no cursor endpoints.\n */\nexport interface CursorQuery<FIELDS extends string = string> {\n /** What to match. */\n filter: FilterExpression<FIELDS>;\n /** Which fields to return; all of them when absent. */\n projection?: Projection<FIELDS>;\n /**\n * The order of the rows. The server appends a unique field, so each field\n * may appear once.\n */\n sort?: FieldSort<FIELDS>[];\n /** The rows of one page; the server uses 10 when absent. */\n size?: number;\n /**\n * Where the page starts: `null` or absent for the first page, then the\n * `nextCursor` of the page before, with the same filter and sort.\n */\n cursor?: string | null;\n}\n\n/** One page of a cursor query. */\nexport interface CursorPage<T> {\n /** The rows of this page. */\n list: T[];\n /** The `cursor` of the next page, or `null` after the last page. */\n nextCursor: string | null;\n}\n\n/**\n * Builds the body of a cursor query, with the defaults filled in: all fields,\n * no sort, a page of {@link DEFAULT_CURSOR_SIZE}, from the start.\n *\n * @throws TypeError when `size` is not an integer from 1 to\n * {@link MAX_CURSOR_SIZE}, or `sort` names more than\n * {@link MAX_CURSOR_SORT_FIELDS} fields or a field twice.\n *\n * @example\n * ```typescript\n * const first = await snapshotClient.cursorState(\n * cursorQuery({ filter: filter.eq('status', 'ACTIVE'), size: 50 }),\n * );\n * if (first.nextCursor !== null) {\n * await snapshotClient.cursorState(\n * cursorQuery({\n * filter: filter.eq('status', 'ACTIVE'),\n * size: 50,\n * cursor: first.nextCursor,\n * }),\n * );\n * }\n * ```\n */\nexport function cursorQuery<FIELDS extends string = string>({\n filter,\n projection = {},\n sort = [],\n size = DEFAULT_CURSOR_SIZE,\n cursor = null,\n}: CursorQuery<FIELDS>): CursorQuery<FIELDS> {\n if (!Number.isInteger(size) || size < 1 || size > MAX_CURSOR_SIZE) {\n throw new TypeError(`size must be between 1 and ${MAX_CURSOR_SIZE}.`);\n }\n if (sort.length > MAX_CURSOR_SORT_FIELDS) {\n throw new TypeError(\n `sort must contain at most ${MAX_CURSOR_SORT_FIELDS} fields.`,\n );\n }\n // A cursor is a position in one total order, so the gateway appends a unique\n // field and then refuses a repeated one: two directions for the same field\n // would leave the position ambiguous and a page could repeat or skip rows.\n const fields = sort.map(entry => entry.field);\n if (new Set(fields).size !== fields.length) {\n throw new TypeError('Cursor sort fields must be unique.');\n }\n return { filter, projection, sort, size, cursor };\n}\n"],"mappings":";AAkBA,IAAaA,IAAsB,IAMtBC,IAAkB,YAElBC,IAAyB;AA2DtC,SAAgBC,EAA4C,EAC1D,WACA,gBAAa,CAAC,GACd,UAAO,CAAC,GACR,UAAA,IACA,YAAS,QACkC;CAC3C,IAAI,CAAC,OAAO,UAAUC,CAAI,KAAKA,IAAO,KAAKA,IAAA,YACzC,MAAU,UAAU,8BAA8BH,EAAgB,EAAE;CAEtE,IAAII,EAAK,SAAA,IACP,MAAU,UACR,sCACF;CAKF,IAAMC,IAASD,EAAK,KAAI,MAASE,EAAM,KAAK;CAC5C,IAAI,IAAI,IAAID,CAAM,CAAC,CAAC,SAASA,EAAO,QAClC,MAAU,UAAU,oCAAoC;CAE1D,OAAO;EAAE;EAAQ;EAAY;EAAM;EAAM;CAAO;AAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletionState.cjs","names":["DeletionState","\"ACTIVE\"","\"DELETED\"","\"ALL\""],"sources":["../../src/dsl/deletionState.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Deletion state enumeration\n *\n * Represents the different states of deletion for entities.\n */\nexport enum DeletionState {\n /**\n * Active state - entity is not deleted\n */\n ACTIVE = 'ACTIVE',\n\n /**\n * Deleted state - entity is deleted\n */\n DELETED = 'DELETED',\n\n /**\n * All state - includes both active and deleted entities\n */\n ALL = 'ALL',\n}\n"],"mappings":"AAkBA,IAAYA,EAAL,SAAA,EAAA,OAIL,GAAAC,OAAA,SAKA,EAAAC,QAAA,UAKA,EAAAC,IAAA,OACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deletion state enumeration
|
|
3
|
+
*
|
|
4
|
+
* Represents the different states of deletion for entities.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DeletionState {
|
|
7
|
+
/**
|
|
8
|
+
* Active state - entity is not deleted
|
|
9
|
+
*/
|
|
10
|
+
ACTIVE = "ACTIVE",
|
|
11
|
+
/**
|
|
12
|
+
* Deleted state - entity is deleted
|
|
13
|
+
*/
|
|
14
|
+
DELETED = "DELETED",
|
|
15
|
+
/**
|
|
16
|
+
* All state - includes both active and deleted entities
|
|
17
|
+
*/
|
|
18
|
+
ALL = "ALL"
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deletion state enumeration
|
|
3
|
+
*
|
|
4
|
+
* Represents the different states of deletion for entities.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DeletionState {
|
|
7
|
+
/**
|
|
8
|
+
* Active state - entity is not deleted
|
|
9
|
+
*/
|
|
10
|
+
ACTIVE = "ACTIVE",
|
|
11
|
+
/**
|
|
12
|
+
* Deleted state - entity is deleted
|
|
13
|
+
*/
|
|
14
|
+
DELETED = "DELETED",
|
|
15
|
+
/**
|
|
16
|
+
* All state - includes both active and deleted entities
|
|
17
|
+
*/
|
|
18
|
+
ALL = "ALL"
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletionState.es.js","names":["DeletionState","\"ACTIVE\"","\"DELETED\"","\"ALL\""],"sources":["../../src/dsl/deletionState.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Deletion state enumeration\n *\n * Represents the different states of deletion for entities.\n */\nexport enum DeletionState {\n /**\n * Active state - entity is not deleted\n */\n ACTIVE = 'ACTIVE',\n\n /**\n * Deleted state - entity is deleted\n */\n DELETED = 'DELETED',\n\n /**\n * All state - includes both active and deleted entities\n */\n ALL = 'ALL',\n}\n"],"mappings":";AAkBA,IAAYA,IAAL,yBAAA,GAAA;QAIL,EAAAC,SAAA,UAKA,EAAAC,UAAA,WAKA,EAAAC,MAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=Object.freeze({SNAPSHOT:`SNAPSHOT`,EVENT_STREAM:`EVENT_STREAM`}),t=Object.freeze({STRING:`STRING`,INTEGER:`INTEGER`,DECIMAL:`DECIMAL`,BOOLEAN:`BOOLEAN`,OBJECT:`OBJECT`}),n=function(e){return e.UNKNOWN=`UNKNOWN`,e.NULL=`NULL`,e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.ARRAY=`ARRAY`,e.UNION=`UNION`,e}({}),r=function(e){return e.LIST=`LIST`,e.PAGED=`PAGED`,e.CURSOR=`CURSOR`,e}({}),i=Object.freeze({IDENTITY:`IDENTITY`,AGGREGATE_ID:`AGGREGATE_ID`,TENANT_ID:`TENANT_ID`,OWNER_ID:`OWNER_ID`,SPACE_ID:`SPACE_ID`,DELETED:`DELETED`,EVENT_TIME:`EVENT_TIME`,FIRST_EVENT_TIME:`FIRST_EVENT_TIME`}),a=Object.freeze({CURSOR_UNIQUE_SORT:`CURSOR_UNIQUE_SORT`,COUNT_REQUIRES_FILTER:`COUNT_REQUIRES_FILTER`,STARTS_WITH_REQUIRES_PREFIX:`STARTS_WITH_REQUIRES_PREFIX`,PARALLEL_ARRAY_SORT:`PARALLEL_ARRAY_SORT`,NULL_OR_EMPTY_AS_MISSING:`NULL_OR_EMPTY_AS_MISSING`,ARRAY_EQUALITY:`ARRAY_EQUALITY`}),o=function(e){return e.DISPLAY=`DISPLAY`,e.CONFIDENTIAL=`CONFIDENTIAL`,e}({});exports.PagingMode=r,exports.QueryConstraintTypes=a,exports.QueryFieldRoles=i,exports.QueryModels=e,exports.QueryValueKind=n,exports.QueryValueTypes=t,exports.SensitivityLevel=o;
|
|
2
|
+
//# sourceMappingURL=descriptor.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor.cjs","names":["QueryModels","QueryValueTypes","QueryValueKind","\"UNKNOWN\"","\"NULL\"","\"SCALAR\"","\"OBJECT\"","\"ARRAY\"","\"UNION\"","PagingMode","\"LIST\"","\"PAGED\"","\"CURSOR\"","QueryFieldRoles","QueryConstraintTypes","SensitivityLevel","\"DISPLAY\"","\"CONFIDENTIAL\""],"sources":["../../src/dsl/descriptor.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// The capability descriptor `GET {aggregate}/{snapshot|event}/schema`\n// answers with: `wow.api.query.QueryModelDescriptor` of Wow 9.2, mirrored\n// from `wow-api/src/main/kotlin/me/ahoo/wow/api/query/descriptor/`.\n//\n// Kotlin leaves a null out of the JSON of every descriptor class annotated\n// `@JsonInclude(NON_NULL)`, so those properties are optional here; the\n// limits are not annotated and send `null`. A set the OpenAPI document\n// describes as a plain string is open: a known union plus `string & {}`.\n\nimport type {\n AggregationDatePart,\n AggregationDateUnit,\n DateDiffUnit,\n AggregationFunction,\n AggregationGroupType,\n AggregationMetricType,\n} from './aggregation/types.js';\nimport type { DeletionState } from './deletionState.js';\nimport type { FilterOperator, SearchMode, TimeUnit } from './filter/index.js';\n\n/**\n * The query models Wow names in a descriptor's `model`. The set is open: a\n * server may register a model of its own, so a descriptor's `model` is a\n * {@link QueryModel}.\n */\nexport const QueryModels = Object.freeze({\n /** The snapshot query model: `{aggregate}/snapshot/*`. */\n SNAPSHOT: 'SNAPSHOT',\n /** The event stream query model: `{aggregate}/event/*`. */\n EVENT_STREAM: 'EVENT_STREAM',\n} as const);\n\n/** A query model's name: one of {@link QueryModels}, or one a server added. */\nexport type QueryModel =\n (typeof QueryModels)[keyof typeof QueryModels] | (string & {});\n\n/**\n * The value types Wow names in a field's `types`. The set is open, like\n * {@link QueryModels}.\n */\nexport const QueryValueTypes = Object.freeze({\n /** A JSON string. */\n STRING: 'STRING',\n /** A whole number. */\n INTEGER: 'INTEGER',\n /** A number with a fraction. */\n DECIMAL: 'DECIMAL',\n /** `true` or `false`. */\n BOOLEAN: 'BOOLEAN',\n /** A JSON object. */\n OBJECT: 'OBJECT',\n} as const);\n\n/** A field's value type: one of {@link QueryValueTypes}, or one a server added. */\nexport type QueryValueType =\n (typeof QueryValueTypes)[keyof typeof QueryValueTypes] | (string & {});\n\n/** The structural shape of a field's value, sent as its `kind`. */\nexport enum QueryValueKind {\n /** Wow could not tell. */\n UNKNOWN = 'UNKNOWN',\n /** Always `null`. */\n NULL = 'NULL',\n /** A single string, number or boolean. */\n SCALAR = 'SCALAR',\n /** An object. */\n OBJECT = 'OBJECT',\n /** An array. */\n ARRAY = 'ARRAY',\n /** One of several of the above. */\n UNION = 'UNION',\n}\n\n/** The ways a model can be read page by page, listed in `record.paging`. */\nexport enum PagingMode {\n /** `list` and `listStream`: the first `limit` rows. */\n LIST = 'LIST',\n /** `paged`: numbered pages with a total. */\n PAGED = 'PAGED',\n /** `cursor`: forward-only pages after the last row seen. */\n CURSOR = 'CURSOR',\n}\n\n/**\n * The system roles Wow names in a field's `role`: the system fields a root\n * operator targets, and the model's times. The set is open, like\n * {@link QueryModels}.\n */\nexport const QueryFieldRoles = Object.freeze({\n /** The record's own identity, `record.identity`. */\n IDENTITY: 'IDENTITY',\n /** The aggregate id. */\n AGGREGATE_ID: 'AGGREGATE_ID',\n /** The tenant id. */\n TENANT_ID: 'TENANT_ID',\n /** The owner id. */\n OWNER_ID: 'OWNER_ID',\n /** The space id. */\n SPACE_ID: 'SPACE_ID',\n /** Whether the aggregate is deleted. */\n DELETED: 'DELETED',\n /**\n * When the record's events happened: a snapshot's last event\n * (`eventTime`), an event stream's events (`createTime`). `FIRST` and\n * `LAST` order by it when they name no `orderBy`. Wow 9.2 and later.\n */\n EVENT_TIME: 'EVENT_TIME',\n /**\n * When a snapshot's aggregate got its first event, i.e. was created\n * (`firstEventTime`). Wow 9.2 and later.\n */\n FIRST_EVENT_TIME: 'FIRST_EVENT_TIME',\n} as const);\n\n/** A system field's role: one of {@link QueryFieldRoles}, or one a server added. */\nexport type QueryFieldRole =\n (typeof QueryFieldRoles)[keyof typeof QueryFieldRoles] | (string & {});\n\n/**\n * The combination rules Wow names in a descriptor's `constraints`: rules\n * that no single capability shows. The set is open, like {@link QueryModels}.\n */\nexport const QueryConstraintTypes = Object.freeze({\n /**\n * A cursor's sort always ends with the identity field; the server appends\n * it (the constraint's `appended`) when the sort does not.\n */\n CURSOR_UNIQUE_SORT: 'CURSOR_UNIQUE_SORT',\n /** A count or paged query must not match every record. */\n COUNT_REQUIRES_FILTER: 'COUNT_REQUIRES_FILTER',\n /** `STARTS_WITH` needs a non-empty, case-sensitive prefix. */\n STARTS_WITH_REQUIRES_PREFIX: 'STARTS_WITH_REQUIRES_PREFIX',\n /**\n * A sort names at most one of the constraint's `fields`: they are\n * array-valued and the storage cannot order by two independent arrays.\n * Fields on one array path, one nested in the other, may still combine.\n * A sort that breaks it is refused with `PARALLEL_ARRAY_SORT`.\n */\n PARALLEL_ARRAY_SORT: 'PARALLEL_ARRAY_SORT',\n /**\n * On the constraint's `fields`, a stored `null` or empty array cannot be\n * told from a missing field: `EXISTS` does not match it, `NOT_EXISTS` and\n * `IS_NULL` do, and `IS_EMPTY` also matches a missing or `null` field. A\n * presence filter on such a field answers \"has a non-empty value\", not\n * \"has the key\"; say so to a user who writes one.\n */\n NULL_OR_EMPTY_AS_MISSING: 'NULL_OR_EMPTY_AS_MISSING',\n /**\n * Model-wide, without `fields`: `EQ` and `NE` take only a scalar operand,\n * because the storage cannot compare a whole array. Match an array\n * field's elements instead (`IN`, `CONTAINS_ALL`, `ELEMENT_MATCH`); an `EQ` or\n * `NE` with an array operand is refused with `ARRAY_EQUALITY`.\n */\n ARRAY_EQUALITY: 'ARRAY_EQUALITY',\n} as const);\n\n/** A constraint's type: one of {@link QueryConstraintTypes}, or one a server added. */\nexport type QueryConstraintType =\n | (typeof QueryConstraintTypes)[keyof typeof QueryConstraintTypes]\n | (string & {});\n\n/** A field that holds a calendar date. */\nexport interface TemporalDate {\n /** The discriminator. */\n type: 'TEMPORAL_DATE';\n}\n\n/** A field that holds a number of time units since the epoch. */\nexport interface TemporalEpoch {\n /** The discriminator. */\n type: 'TEMPORAL_EPOCH';\n /** The unit the number counts; milliseconds when absent. */\n timeUnit?: TimeUnit;\n}\n\n/** A field that holds a time written as text in a `java.time` pattern. */\nexport interface TemporalFormatted {\n /** The discriminator. */\n type: 'TEMPORAL_FORMATTED';\n /** The `java.time` pattern, such as `yyyy-MM-dd`. */\n pattern: string;\n}\n\n/**\n * A number field meant as a fixed-point decimal with `scale` fraction\n * digits: format and total it at that precision. Declared on the model\n * (`@QueryDecimal`), never inferred. Wow 9.2 and later.\n */\nexport interface NumericDecimal {\n /** The discriminator. */\n type: 'DECIMAL';\n /** The number of digits after the decimal point, 0 or more. */\n scale: number;\n}\n\n/**\n * A number field meant as an amount of money, in exactly one of a fixed\n * ISO 4217 `currency` or the currency held by the sibling string field\n * `currencyField` (a property of the same object or element). `scale` is\n * always sent: with a fixed currency the server resolves an omitted one to\n * that currency's standard fraction digits (2 for CNY, 0 for JPY).\n * Amounts in different currencies must not be totalled together. Declared\n * on the model (`@QueryMoney`), never inferred. Wow 9.2 and later.\n */\nexport type NumericMoney = {\n /** The discriminator. */\n type: 'MONEY';\n /** The number of digits after the decimal point, 0 or more. */\n scale: number;\n} & (\n | {\n /** The fixed ISO 4217 currency code, such as `CNY`. */\n currency: string;\n currencyField?: undefined;\n }\n | {\n currency?: undefined;\n /** The sibling property that holds each value's currency code. */\n currencyField: string;\n }\n);\n\n/**\n * A number field that is a length of time counted in `timeUnit`, such as a\n * timeout in seconds: format it as a duration. Declared on the model\n * (`@QueryDuration`), never inferred. Wow 9.2 and later.\n */\nexport interface DurationSemantic {\n /** The discriminator. */\n type: 'DURATION';\n /** The unit the number counts; always sent. */\n timeUnit: TimeUnit;\n}\n\n/**\n * A field whose value is the id of an aggregate, to look it up and link to\n * it: either a fixed aggregate, `contextName` and `aggregateName`, or per\n * record the aggregate the sibling string fields `contextNameField` and\n * `aggregateNameField` name (as in an `AggregateId`). The id is always the\n * aggregate's own. Declared on the model (`@QueryReference`), or inferred\n * for an `AggregateId`. Wow 9.2 and later.\n */\nexport type ReferenceSemantic = {\n /** The discriminator. */\n type: 'REFERENCE';\n} & (\n | {\n /** The referenced aggregate's bounded context. */\n contextName: string;\n /** The referenced aggregate's name. */\n aggregateName: string;\n contextNameField?: undefined;\n aggregateNameField?: undefined;\n }\n | {\n contextName?: undefined;\n aggregateName?: undefined;\n /** The sibling property that holds each value's bounded context. */\n contextNameField: string;\n /** The sibling property that holds each value's aggregate name. */\n aggregateNameField: string;\n }\n);\n\n/**\n * What a field's value means beyond its type, sent as its `semantic`: one\n * of the three temporal kinds, which the relative time filters (`TODAY`,\n * `RECENT_DAYS`, …) and date histograms need; one of the two numeric\n * formats, which say how a number is read and displayed; a duration; or a\n * reference to an aggregate. A field has one; an array field's is its\n * items'.\n *\n * The union grows in minor releases, as the server learns a semantic, and a\n * server newer than this client may send a `type` not listed here. The\n * descriptor is read as JSON, not parsed, so it arrives as it is: keep a\n * `default` branch in a `switch` over `type`, and treat a `type` you do not\n * know as no semantic at all. The union stays closed so that narrowing on\n * `type` still works.\n */\nexport type QuerySemanticType =\n | TemporalDate\n | TemporalEpoch\n | TemporalFormatted\n | NumericDecimal\n | NumericMoney\n | DurationSemantic\n | ReferenceSemantic;\n\n/** One declared value of an enum field, with its description when it has one. */\nexport interface EnumValueDescriptor {\n /** The value as it is stored and filtered by. */\n value: unknown;\n /**\n * What the value means, when the model describes it: set by the `enum`\n * entry of the model's declaration file.\n */\n description?: string;\n}\n\n/**\n * How much Wow protects a sensitive field's raw value, sent as its\n * `sensitivity.level`. Both levels mask the value in every query result;\n * they differ in what a query may do with the raw value.\n */\nexport enum SensitivityLevel {\n /**\n * Masked in results. Filters and paged sorts still compare the raw value,\n * unless the server turned that off; grouping, `ANY`, field metrics,\n * arithmetic references and cursor sorts are refused.\n */\n DISPLAY = 'DISPLAY',\n /**\n * Masked in results and never compared: no filter, sort, search, grouping\n * or metric may name it.\n */\n CONFIDENTIAL = 'CONFIDENTIAL',\n}\n\n/**\n * Why a field is deprecated. The field can still be queried, but new\n * queries and view definitions should avoid it.\n */\nexport interface QueryDeprecation {\n /** Why, or what to use instead; absent when the declaration gave no reason. */\n message?: string;\n}\n\n/** How a sensitive field is protected. */\nexport interface SensitivityDescriptor {\n /** How much its raw value is protected. */\n level: SensitivityLevel;\n /**\n * Whether filters and paged sorts may still compare its raw value: `false`\n * for {@link SensitivityLevel.CONFIDENTIAL}, and for\n * {@link SensitivityLevel.DISPLAY} when the server turned comparison off.\n * A field that is not comparable lists no filter operators, has\n * `sort.paged` `false` and is left out of `record.search`; naming it in a\n * filter, sort or search is refused with `PROTECTED_COMPARISON`.\n */\n comparable: boolean;\n}\n\n/** The filter operators a field admits. */\nexport interface FieldFilterDescriptor {\n /**\n * Each operator admitted on this field when used alone; empty when none,\n * as for a sensitive field that is not comparable.\n */\n operators: FilterOperator[];\n}\n\n/** Where a field may appear in a sort. */\nexport interface FieldSortDescriptor {\n /** In the sort of a list or paged query; never for a field that is not comparable. */\n paged: boolean;\n /** In the sort of a cursor query. */\n cursor: boolean;\n}\n\n/** How a field may be used in an aggregation. */\nexport interface FieldAggregateDescriptor {\n /**\n * The group types it may be grouped by; a time field lists both\n * `DATE_HISTOGRAM` and `DATE_PART`.\n */\n groups: (AggregationGroupType | (string & {}))[];\n /** Whether a terms group on it may set `missingKey`. */\n missingKey: boolean;\n /** The numeric functions (`SUM`, `AVG`, …) it may feed. */\n functions: (AggregationFunction | (string & {}))[];\n /** Whether it may feed a `DISTINCT_COUNT` metric. */\n distinctCount: boolean;\n /** Whether it may feed a `PERCENTILE` metric. */\n percentile: boolean;\n /** Whether it may feed an `ANY` metric. */\n any: boolean;\n /** Whether a `FIRST` or `LAST` metric may read its value. */\n firstLast: boolean;\n /** Whether it may appear in an arithmetic expression. */\n expressionInput: boolean;\n /** Whether a metric's filter may name it. */\n inMetricFilter: boolean;\n}\n\n/** One queryable field, by the logical path a query names it with. */\nexport interface FieldDescriptor {\n /** The logical path, such as `state.items.productId`. */\n path: string;\n /** The system role of a system field; absent on ordinary fields. */\n role?: QueryFieldRole;\n /** The value types it holds. */\n types: QueryValueType[];\n /** The structural shape of its value. */\n kind: QueryValueKind;\n /** Whether it may be `null`. */\n nullable: boolean;\n /** What its value means beyond its type; absent when nothing more. */\n semantic?: QuerySemanticType;\n /** Its declared values; never listed for a protected field. */\n enum?: EnumValueDescriptor[];\n /** Its description, when the model gives one. */\n description?: string;\n /** How it is protected; absent when it is not sensitive. */\n sensitivity?: SensitivityDescriptor;\n /** Whether a projection may select it. */\n project: boolean;\n /** The filter operators it admits. */\n filter: FieldFilterDescriptor;\n /** Where it may be sorted by. */\n sort: FieldSortDescriptor;\n /** How it may be aggregated; absent when it cannot be at all. */\n aggregate?: FieldAggregateDescriptor;\n /**\n * The element (array field) it lives in, by path; absent at the record\n * level. A filter on it goes inside `ELEMENT_MATCH` on that element.\n */\n scope?: string;\n /**\n * Set when the field is deprecated: still queryable, but new queries\n * should avoid it. An object, so it is truthy even without a message.\n */\n deprecated?: QueryDeprecation;\n /**\n * Other paths a query may name this field by, sorted; empty when none.\n * The server replaces an alias with `path` before it checks and runs a\n * query, so results, projections and errors use `path`, and an alias is\n * never listed as a field of its own. A variant's field lists them\n * relative to the element, like its `path`.\n */\n aliases: string[];\n}\n\n/** An array field whose elements can be filtered or aggregated one by one. */\nexport interface ElementDescriptor {\n /** The array field's logical path. */\n path: string;\n /** Whether `ELEMENT_MATCH` may filter its elements. */\n filter: boolean;\n /** Whether an aggregation may run over its elements. */\n aggregate: boolean;\n /**\n * Full-text search on its fields: a `SEARCH` that names them, relative\n * to the element, inside an `ELEMENT_MATCH` on it. Absent when the\n * storage can search none of them, as on MongoDB.\n */\n search?: SearchDescriptor;\n}\n\n/**\n * The fields under a map's dynamic keys, written with `{key}` in place of\n * the key: any key matches, except those in `excludedKeys`. Each pattern\n * has one entry, resolved as the server resolves a concrete key: a pattern\n * whose values are arrays is one `ARRAY` entry, its items implicit.\n */\nexport interface DynamicFieldDescriptor {\n /** The path pattern, such as `state.attributes.{key}`. */\n pattern: string;\n /** The value types they hold. */\n types: QueryValueType[];\n /** The structural shape of their values. */\n kind: QueryValueKind;\n /** The filter operators they admit. */\n filter: FieldFilterDescriptor;\n /**\n * The map's keys that are declared as fields of their own and so are not\n * covered by this pattern; absent when there are none. For\n * `state.attributes.{key}` with `state.attributes.color` declared, it is\n * `['color']`: a filter on `state.attributes.color` takes that field's\n * entry in `fields`, with its own operators, not this pattern's.\n */\n excludedKeys?: string[];\n}\n\n/**\n * Full-text search in one scope: the record's (`record.search`) or an\n * element's (`elements[].search`).\n */\nexport interface SearchDescriptor {\n /**\n * For the record, the modes of a model-wide `SEARCH` (without fields);\n * empty when one of its fields is not comparable, since a search across\n * the model would match that field. For an element, the modes every\n * listed field accepts.\n */\n modes: SearchMode[];\n /**\n * The fields a `SEARCH` may name, by full logical path; never one that is\n * not comparable. For the record, only record-level fields, never one\n * inside an element; for an element, its own fields, which the query\n * writes relative to the element.\n */\n fields: string[];\n}\n\n/** What holds for the model's records as a whole. */\nexport interface RecordDescriptor {\n /** The logical path of the field that identifies a record. */\n identity: string;\n /** The ways the model can be read page by page. */\n paging: PagingMode[];\n /** The deletion scope a query without one gets; absent when the model has none. */\n defaultScope?: DeletionState;\n /**\n * Operators that name no field of their own: the system-field ones, such\n * as `ID` or `TENANT_ID`, and `EXPRESSION`, whose expression names its\n * fields, where the server allows expensive operators.\n */\n rootOperators: FilterOperator[];\n /** Model-wide full-text search; absent when the model offers none. */\n search?: SearchDescriptor;\n}\n\n/** The fixed limits of an aggregation query. */\nexport interface AggregationLimitsDescriptor {\n /** Most groups in `groupBy`. */\n maxGroups: number;\n /** Most metrics. */\n maxMetrics: number;\n /** Most elements an aggregation runs over. */\n maxElements: number;\n /** Largest `limit` on the result rows. */\n maxLimit: number;\n /** Deepest arithmetic expression. */\n maxExpressionDepth: number;\n /** Most nodes in one arithmetic expression. */\n maxExpressionNodes: number;\n}\n\n/**\n * The effective limits of the entry the descriptor was read from: the\n * protocol's and the entry's budget, whichever is smaller. `null` is\n * unlimited.\n */\nexport interface LimitsDescriptor {\n /** Largest `limit` of a list query. */\n maxListSize: number | null;\n /** The `limit` a list query without one gets. */\n defaultListSize: number | null;\n /** Largest page `size` of a paged or cursor query. */\n maxPageSize: number | null;\n /** How far a paged query may reach: page index times size. */\n maxPageWindow: number | null;\n /** Most nodes in one filter. */\n maxFilterNodes: number | null;\n /** Most values in one filter, `IN` lists included. */\n maxFilterValues: number | null;\n /** Most fields in one sort. */\n maxSortFields: number;\n /** The limits of an aggregation query. */\n aggregation: AggregationLimitsDescriptor;\n}\n\n/** The metrics a `having` clause may test. */\nexport interface HavingDescriptor {\n /** The metric types it may name; never `ANY`, `FIRST` or `LAST`. */\n metrics: (AggregationMetricType | (string & {}))[];\n}\n\n/** What an aggregation's result rows may be sorted by. */\nexport interface AnalysisSortDescriptor {\n /** By a group. */\n groups: boolean;\n /** By a metric. */\n metrics: boolean;\n}\n\n/** The aggregation features the model offers. */\nexport interface AnalysisDescriptor {\n /** The metric types it admits. */\n metrics: (AggregationMetricType | (string & {}))[];\n /**\n * The metric types among `metrics` whose results this backend estimates\n * rather than computes exactly, such as `PERCENTILE` on MongoDB, or\n * `DISTINCT_COUNT` and `PERCENTILE` on Elasticsearch; empty when every\n * result is exact. The set is open, like `metrics`: label a result of a\n * listed type as approximate.\n */\n approximate: (AggregationMetricType | (string & {}))[];\n /**\n * Whether computed expressions (arithmetic and `DATE_DIFF`) may feed\n * metrics and TERMS / HISTOGRAM groups, and be compared by an `EXPRESSION`\n * filter. A `DATE_DIFF` operand is any field whose `aggregate.groups`\n * lists `DATE_HISTOGRAM`.\n */\n expressions: boolean;\n /** What `having` may test. */\n having: HavingDescriptor;\n /** What result rows may be sorted by. */\n sort: AnalysisSortDescriptor;\n /**\n * Whether a date histogram or a date part group may fill its empty\n * buckets (`dense`).\n */\n dense: boolean;\n /** The calendar units a `DATE_HISTOGRAM` group may bucket by. */\n dateUnits: AggregationDateUnit[];\n /** The calendar parts a `DATE_PART` group may group by. */\n dateParts: AggregationDatePart[];\n /** The units a `DATE_DIFF` may measure in; empty when `expressions` is `false`. */\n dateDiffUnits: DateDiffUnit[];\n /**\n * The field `FIRST` and `LAST` order by when they name no `orderBy`, at\n * the record level: the model's event time. Absent when the model has no\n * event time or the storage offers no `FIRST` / `LAST`. An explicit\n * `orderBy` may be any single-valued field whose `sort.paged` is `true` in\n * the metric's scope.\n */\n firstLastOrderBy?: string;\n}\n\n/** A rule about combinations that no single capability shows. */\nexport interface ConstraintDescriptor {\n /** Which rule; see {@link QueryConstraintTypes}. */\n type: QueryConstraintType;\n /** For `CURSOR_UNIQUE_SORT`, the field the server appends to the sort. */\n appended?: string;\n /**\n * The fields the rule is about, when it names several: for\n * `PARALLEL_ARRAY_SORT`, the array fields a sort may name only one of;\n * for `NULL_OR_EMPTY_AS_MISSING`, the fields whose `null` or empty value\n * reads as missing.\n */\n fields?: string[];\n}\n\n/**\n * One variant of an element: the value of its discriminator and the fields\n * that variant has. For an event stream, one event type and its payload\n * fields.\n */\nexport interface VariantDescriptor {\n /** The discriminator's value, such as the event's `bodyType`. */\n value: string;\n /**\n * The variant's fields, by paths relative to the element, such as\n * `body.added.productId` inside `body`. Each field states the variant's\n * own types; its operators, sorts and aggregation are those of the shared\n * logical path, which admission checks. A field's `scope` is relative to\n * the element too, and absent for a field directly in it.\n */\n fields: FieldDescriptor[];\n /** What the variant means, when the model describes it. */\n description?: string;\n}\n\n/**\n * An element of every record whose fields differ by variant: an event\n * stream record's `body` holds events whose payload fields depend on\n * `bodyType`. A condition on one variant's field goes inside an\n * `ELEMENT_MATCH` on `element`, together with a condition on the\n * `discriminator`, so both hold for the same element.\n */\nexport interface VariantsDescriptor {\n /** The element's logical path, such as `body`. */\n element: string;\n /** The element-relative field that names each element's variant, such as `bodyType`. */\n discriminator: string;\n /** Each variant, sorted by `value`. */\n values: VariantDescriptor[];\n}\n\n/**\n * How a query model can be queried over HTTP: the answer\n * `GET {aggregate}/snapshot/schema` and `GET {aggregate}/event/schema` give.\n * Read it with `QueryDescriptorClient`.\n *\n * The contract: every operator, sort, paging mode, group and function it\n * lists is admitted when used on its own, and anything it does not list is\n * rejected; `constraints` names the rules about combinations. A value, a\n * scope or a policy can still reject a query, with a\n * `QueryViolation`. It exposes no storage names and does not depend on\n * the caller, so it can be cached: `version` is a hash of its content and is\n * also the response's ETag.\n */\nexport interface QueryModelDescriptor {\n /** The query model it describes. */\n model: QueryModel;\n /** `sha256:` and the hash of its content; also the ETag, quoted. */\n version: string;\n /** The server's default time zone, used when a request names none. */\n timeZone: string;\n /** What holds for the records as a whole. */\n record: RecordDescriptor;\n /** The entry's effective limits. */\n limits: LimitsDescriptor;\n /** The aggregation features. */\n analysis: AnalysisDescriptor;\n /** Every queryable field, those inside elements included (see `scope`). */\n fields: FieldDescriptor[];\n /** The array fields whose elements can be queried one by one. */\n elements: ElementDescriptor[];\n /** Fields under dynamic map keys. */\n dynamic: DynamicFieldDescriptor[];\n /** The rules about combinations. */\n constraints: ConstraintDescriptor[];\n /**\n * The variants of an element whose fields differ by a discriminator, such\n * as an event stream's event types; absent when the model has none, as a\n * snapshot model never does.\n */\n variants?: VariantsDescriptor;\n}\n"],"mappings":"AAsCA,IAAaA,EAAc,OAAO,OAAO,CAEvC,SAAU,WAEV,aAAc,cAChB,CAAU,EAUGC,EAAkB,OAAO,OAAO,CAE3C,OAAQ,SAER,QAAS,UAET,QAAS,UAET,QAAS,UAET,OAAQ,QACV,CAAU,EAOEC,EAAL,SAAA,EAAA,OAEL,GAAAC,QAAA,UAEA,EAAAC,KAAA,OAEA,EAAAC,OAAA,SAEA,EAAAC,OAAA,SAEA,EAAAC,MAAA,QAEA,EAAAC,MAAA,SACF,EAAA,CAAA,CAAA,EAGYC,EAAL,SAAA,EAAA,OAEL,GAAAC,KAAA,OAEA,EAAAC,MAAA,QAEA,EAAAC,OAAA,UACF,EAAA,CAAA,CAAA,EAOaC,EAAkB,OAAO,OAAO,CAE3C,SAAU,WAEV,aAAc,eAEd,UAAW,YAEX,SAAU,WAEV,SAAU,WAEV,QAAS,UAMT,WAAY,aAKZ,iBAAkB,kBACpB,CAAU,EAUGC,EAAuB,OAAO,OAAO,CAKhD,mBAAoB,qBAEpB,sBAAuB,wBAEvB,4BAA6B,8BAO7B,oBAAqB,sBAQrB,yBAA0B,2BAO1B,eAAgB,gBAClB,CAAU,EAsJEC,EAAL,SAAA,EAAA,OAML,GAAAC,QAAA,UAKA,EAAAC,aAAA,gBACF,EAAA,CAAA,CAAA"}
|