@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,94 @@
|
|
|
1
|
+
import { HavingExpression } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The builders of a `having` expression, `aggregation.having.*`: conditions on
|
|
4
|
+
* the metric columns of the grouped rows, and their `and`/`or`. Mirrors
|
|
5
|
+
* Kotlin's `HavingDsl` (`wow-query`, `AggregationQueryDsl.kt`).
|
|
6
|
+
*
|
|
7
|
+
* Each builder checks its own numbers and throws a `TypeError` with the
|
|
8
|
+
* message Wow answers; `aggregation.query()` checks what spans the query:
|
|
9
|
+
* that `metric` names a declared, non-ANY metric, and that the query groups.
|
|
10
|
+
*/
|
|
11
|
+
export interface HavingDsl {
|
|
12
|
+
/**
|
|
13
|
+
* `metric = value`. `{ type: 'CONDITION', metric, operator: 'EQ', value }`.
|
|
14
|
+
*
|
|
15
|
+
* @param metric - The alias of a metric of the same query.
|
|
16
|
+
* @throws TypeError when `value` is not finite.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* aggregation.having.eq('orders', 1);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
eq(metric: string, value: number): HavingExpression;
|
|
23
|
+
/** `metric ≠ value`. `{ type: 'CONDITION', operator: 'NE', … }`. */
|
|
24
|
+
ne(metric: string, value: number): HavingExpression;
|
|
25
|
+
/**
|
|
26
|
+
* `metric > value`. `{ type: 'CONDITION', operator: 'GT', … }`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* aggregation.having.gt('revenue', 100);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
gt(metric: string, value: number): HavingExpression;
|
|
34
|
+
/** `metric ≥ value`. `{ type: 'CONDITION', operator: 'GTE', … }`. */
|
|
35
|
+
gte(metric: string, value: number): HavingExpression;
|
|
36
|
+
/** `metric < value`. `{ type: 'CONDITION', operator: 'LT', … }`. */
|
|
37
|
+
lt(metric: string, value: number): HavingExpression;
|
|
38
|
+
/** `metric ≤ value`. `{ type: 'CONDITION', operator: 'LTE', … }`. */
|
|
39
|
+
lte(metric: string, value: number): HavingExpression;
|
|
40
|
+
/**
|
|
41
|
+
* `lower ≤ metric ≤ upper`. `{ type: 'BETWEEN', metric, lower, upper }`.
|
|
42
|
+
*
|
|
43
|
+
* @throws TypeError when a bound is not finite, or `lower` exceeds `upper`.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* aggregation.having.between('revenue', 10, 1000);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
between(metric: string, lower: number, upper: number): HavingExpression;
|
|
50
|
+
/**
|
|
51
|
+
* `metric` is one of `values`. `{ type: 'IN', metric, values }` with a
|
|
52
|
+
* copy of `values`.
|
|
53
|
+
*
|
|
54
|
+
* @throws TypeError when `values` is empty or holds a non-finite number.
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* aggregation.having.isIn('orders', [2, 3]);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
isIn(metric: string, values: readonly number[]): HavingExpression;
|
|
61
|
+
/**
|
|
62
|
+
* `metric` has no value in the row. `{ type: 'IS_NULL', metric }`.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* aggregation.having.isNull('averageOrder');
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
isNull(metric: string): HavingExpression;
|
|
70
|
+
/** `metric` has a value. `{ type: 'IS_NULL', metric, negated: true }`. */
|
|
71
|
+
isNotNull(metric: string): HavingExpression;
|
|
72
|
+
/**
|
|
73
|
+
* All of `operands` hold. `{ type: 'AND', operands }` with a copy of
|
|
74
|
+
* `operands`.
|
|
75
|
+
*
|
|
76
|
+
* @throws TypeError when `operands` is empty.
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* aggregation.having.and([
|
|
80
|
+
* aggregation.having.gt('orders', 1),
|
|
81
|
+
* aggregation.having.isNotNull('revenue'),
|
|
82
|
+
* ]);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
and(operands: readonly HavingExpression[]): HavingExpression;
|
|
86
|
+
/**
|
|
87
|
+
* At least one of `operands` holds. `{ type: 'OR', operands }` with a copy
|
|
88
|
+
* of `operands`.
|
|
89
|
+
*
|
|
90
|
+
* @throws TypeError when `operands` is empty.
|
|
91
|
+
*/
|
|
92
|
+
or(operands: readonly HavingExpression[]): HavingExpression;
|
|
93
|
+
}
|
|
94
|
+
export declare const havingDsl: HavingDsl;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ComparisonOperator as e, HavingExpressionType as t } from "./types.es.js";
|
|
2
|
+
//#region src/dsl/aggregation/having.ts
|
|
3
|
+
function n(e, n, r) {
|
|
4
|
+
if (!Number.isFinite(r)) throw TypeError(`having condition [${n}] value must be finite.`);
|
|
5
|
+
return {
|
|
6
|
+
type: t.CONDITION,
|
|
7
|
+
metric: n,
|
|
8
|
+
operator: e,
|
|
9
|
+
value: r
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function r(e, t) {
|
|
13
|
+
let [n, ...r] = t;
|
|
14
|
+
if (n === void 0) throw TypeError(`having ${e} operands must not be empty.`);
|
|
15
|
+
return {
|
|
16
|
+
type: e,
|
|
17
|
+
operands: [n, ...r]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var i = {
|
|
21
|
+
eq: (t, r) => n(e.EQ, t, r),
|
|
22
|
+
ne: (t, r) => n(e.NE, t, r),
|
|
23
|
+
gt: (t, r) => n(e.GT, t, r),
|
|
24
|
+
gte: (t, r) => n(e.GTE, t, r),
|
|
25
|
+
lt: (t, r) => n(e.LT, t, r),
|
|
26
|
+
lte: (t, r) => n(e.LTE, t, r),
|
|
27
|
+
between(e, n, r) {
|
|
28
|
+
if (!Number.isFinite(n) || !Number.isFinite(r)) throw TypeError(`having between [${e}] bounds must be finite.`);
|
|
29
|
+
if (n > r) throw TypeError(`having between [${e}] lower bound must not exceed upper bound.`);
|
|
30
|
+
return {
|
|
31
|
+
type: t.BETWEEN,
|
|
32
|
+
metric: e,
|
|
33
|
+
lower: n,
|
|
34
|
+
upper: r
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
isIn(e, n) {
|
|
38
|
+
let [r, ...i] = n;
|
|
39
|
+
if (r === void 0) throw TypeError(`having in [${e}] values must not be empty.`);
|
|
40
|
+
if (!n.every(Number.isFinite)) throw TypeError(`having in [${e}] values must be finite.`);
|
|
41
|
+
return {
|
|
42
|
+
type: t.IN,
|
|
43
|
+
metric: e,
|
|
44
|
+
values: [r, ...i]
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
isNull: (e) => ({
|
|
48
|
+
type: t.IS_NULL,
|
|
49
|
+
metric: e
|
|
50
|
+
}),
|
|
51
|
+
isNotNull: (e) => ({
|
|
52
|
+
type: t.IS_NULL,
|
|
53
|
+
metric: e,
|
|
54
|
+
negated: !0
|
|
55
|
+
}),
|
|
56
|
+
and: (e) => r(t.AND, e),
|
|
57
|
+
or: (e) => r(t.OR, e)
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { i as havingDsl };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=having.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"having.es.js","names":["condition","value","metric","HavingExpressionType","logical","first","rest","operands","type","havingDsl","ComparisonOperator","lower","upper","values"],"sources":["../../../src/dsl/aggregation/having.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 {\n ComparisonOperator,\n HavingExpressionType,\n type HavingExpression,\n} from './types.js';\n\n/**\n * The builders of a `having` expression, `aggregation.having.*`: conditions on\n * the metric columns of the grouped rows, and their `and`/`or`. Mirrors\n * Kotlin's `HavingDsl` (`wow-query`, `AggregationQueryDsl.kt`).\n *\n * Each builder checks its own numbers and throws a `TypeError` with the\n * message Wow answers; `aggregation.query()` checks what spans the query:\n * that `metric` names a declared, non-ANY metric, and that the query groups.\n */\nexport interface HavingDsl {\n /**\n * `metric = value`. `{ type: 'CONDITION', metric, operator: 'EQ', value }`.\n *\n * @param metric - The alias of a metric of the same query.\n * @throws TypeError when `value` is not finite.\n * @example\n * ```typescript\n * aggregation.having.eq('orders', 1);\n * ```\n */\n eq(metric: string, value: number): HavingExpression;\n /** `metric ≠ value`. `{ type: 'CONDITION', operator: 'NE', … }`. */\n ne(metric: string, value: number): HavingExpression;\n /**\n * `metric > value`. `{ type: 'CONDITION', operator: 'GT', … }`.\n *\n * @example\n * ```typescript\n * aggregation.having.gt('revenue', 100);\n * ```\n */\n gt(metric: string, value: number): HavingExpression;\n /** `metric ≥ value`. `{ type: 'CONDITION', operator: 'GTE', … }`. */\n gte(metric: string, value: number): HavingExpression;\n /** `metric < value`. `{ type: 'CONDITION', operator: 'LT', … }`. */\n lt(metric: string, value: number): HavingExpression;\n /** `metric ≤ value`. `{ type: 'CONDITION', operator: 'LTE', … }`. */\n lte(metric: string, value: number): HavingExpression;\n /**\n * `lower ≤ metric ≤ upper`. `{ type: 'BETWEEN', metric, lower, upper }`.\n *\n * @throws TypeError when a bound is not finite, or `lower` exceeds `upper`.\n * @example\n * ```typescript\n * aggregation.having.between('revenue', 10, 1000);\n * ```\n */\n between(metric: string, lower: number, upper: number): HavingExpression;\n /**\n * `metric` is one of `values`. `{ type: 'IN', metric, values }` with a\n * copy of `values`.\n *\n * @throws TypeError when `values` is empty or holds a non-finite number.\n * @example\n * ```typescript\n * aggregation.having.isIn('orders', [2, 3]);\n * ```\n */\n isIn(metric: string, values: readonly number[]): HavingExpression;\n /**\n * `metric` has no value in the row. `{ type: 'IS_NULL', metric }`.\n *\n * @example\n * ```typescript\n * aggregation.having.isNull('averageOrder');\n * ```\n */\n isNull(metric: string): HavingExpression;\n /** `metric` has a value. `{ type: 'IS_NULL', metric, negated: true }`. */\n isNotNull(metric: string): HavingExpression;\n /**\n * All of `operands` hold. `{ type: 'AND', operands }` with a copy of\n * `operands`.\n *\n * @throws TypeError when `operands` is empty.\n * @example\n * ```typescript\n * aggregation.having.and([\n * aggregation.having.gt('orders', 1),\n * aggregation.having.isNotNull('revenue'),\n * ]);\n * ```\n */\n and(operands: readonly HavingExpression[]): HavingExpression;\n /**\n * At least one of `operands` holds. `{ type: 'OR', operands }` with a copy\n * of `operands`.\n *\n * @throws TypeError when `operands` is empty.\n */\n or(operands: readonly HavingExpression[]): HavingExpression;\n}\n\nfunction condition(\n operator: ComparisonOperator,\n metric: string,\n value: number,\n): HavingExpression {\n if (!Number.isFinite(value)) {\n throw new TypeError(`having condition [${metric}] value must be finite.`);\n }\n return { type: HavingExpressionType.CONDITION, metric, operator, value };\n}\n\nfunction logical(\n type: HavingExpressionType.AND | HavingExpressionType.OR,\n operands: readonly HavingExpression[],\n): HavingExpression {\n const [first, ...rest] = operands;\n if (first === undefined) {\n throw new TypeError(`having ${type} operands must not be empty.`);\n }\n return { type, operands: [first, ...rest] };\n}\n\nexport const havingDsl: HavingDsl = {\n eq: (metric, value) => condition(ComparisonOperator.EQ, metric, value),\n ne: (metric, value) => condition(ComparisonOperator.NE, metric, value),\n gt: (metric, value) => condition(ComparisonOperator.GT, metric, value),\n gte: (metric, value) => condition(ComparisonOperator.GTE, metric, value),\n lt: (metric, value) => condition(ComparisonOperator.LT, metric, value),\n lte: (metric, value) => condition(ComparisonOperator.LTE, metric, value),\n between(metric, lower, upper) {\n if (!Number.isFinite(lower) || !Number.isFinite(upper)) {\n throw new TypeError(`having between [${metric}] bounds must be finite.`);\n }\n if (lower > upper) {\n throw new TypeError(\n `having between [${metric}] lower bound must not exceed upper bound.`,\n );\n }\n return { type: HavingExpressionType.BETWEEN, metric, lower, upper };\n },\n isIn(metric, values) {\n const [first, ...rest] = values;\n if (first === undefined) {\n throw new TypeError(`having in [${metric}] values must not be empty.`);\n }\n if (!values.every(Number.isFinite)) {\n throw new TypeError(`having in [${metric}] values must be finite.`);\n }\n return { type: HavingExpressionType.IN, metric, values: [first, ...rest] };\n },\n isNull: metric => ({ type: HavingExpressionType.IS_NULL, metric }),\n isNotNull: metric => ({\n type: HavingExpressionType.IS_NULL,\n metric,\n negated: true,\n }),\n and: operands => logical(HavingExpressionType.AND, operands),\n or: operands => logical(HavingExpressionType.OR, operands),\n};\n"],"mappings":";;AAgHA,SAASA,EACP,GACA,GACA,GACkB;CAClB,IAAI,CAAC,OAAO,SAASC,CAAK,GACxB,MAAU,UAAU,qBAAqBC,EAAO,wBAAwB;CAE1E,OAAO;EAAE,MAAMC,EAAqB;EAAW;EAAQ;EAAU;CAAM;AACzE;AAEA,SAASC,EACP,GACA,GACkB;CAClB,IAAM,CAACC,GAAO,GAAGC,KAAQC;CACzB,IAAIF,MAAU,KAAA,GACZ,MAAU,UAAU,UAAUG,EAAK,6BAA6B;CAElE,OAAO;EAAE;EAAM,UAAU,CAACH,GAAO,GAAGC,CAAI;CAAE;AAC5C;AAEA,IAAaG,IAAuB;CAClC,KAAK,GAAQ,MAAUT,EAAUU,EAAmB,IAAIR,GAAQD,CAAK;CACrE,KAAK,GAAQ,MAAUD,EAAUU,EAAmB,IAAIR,GAAQD,CAAK;CACrE,KAAK,GAAQ,MAAUD,EAAUU,EAAmB,IAAIR,GAAQD,CAAK;CACrE,MAAM,GAAQ,MAAUD,EAAUU,EAAmB,KAAKR,GAAQD,CAAK;CACvE,KAAK,GAAQ,MAAUD,EAAUU,EAAmB,IAAIR,GAAQD,CAAK;CACrE,MAAM,GAAQ,MAAUD,EAAUU,EAAmB,KAAKR,GAAQD,CAAK;CACvE,QAAQ,GAAQ,GAAO,GAAO;EAC5B,IAAI,CAAC,OAAO,SAASU,CAAK,KAAK,CAAC,OAAO,SAASC,CAAK,GACnD,MAAU,UAAU,mBAAmBV,EAAO,yBAAyB;EAEzE,IAAIS,IAAQC,GACV,MAAU,UACR,mBAAmBV,EAAO,2CAC5B;EAEF,OAAO;GAAE,MAAMC,EAAqB;GAAS;GAAQ;GAAO;EAAM;CACpE;CACA,KAAK,GAAQ,GAAQ;EACnB,IAAM,CAACE,GAAO,GAAGC,KAAQO;EACzB,IAAIR,MAAU,KAAA,GACZ,MAAU,UAAU,cAAcH,EAAO,4BAA4B;EAEvE,IAAI,CAACW,EAAO,MAAM,OAAO,QAAQ,GAC/B,MAAU,UAAU,cAAcX,EAAO,yBAAyB;EAEpE,OAAO;GAAE,MAAMC,EAAqB;GAAI;GAAQ,QAAQ,CAACE,GAAO,GAAGC,CAAI;EAAE;CAC3E;CACA,SAAQ,OAAW;EAAE,MAAMH,EAAqB;EAAS;CAAO;CAChE,YAAW,OAAW;EACpB,MAAMA,EAAqB;EAC3B;EACA,SAAS;CACX;CACA,MAAK,MAAYC,EAAQD,EAAqB,KAAKI,CAAQ;CAC3D,KAAI,MAAYH,EAAQD,EAAqB,IAAII,CAAQ;AAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort.cjs","names":["asc","require_sort","effectiveSort","sort","query","sorted","entry","group","alias"],"sources":["../../../src/dsl/aggregation/sort.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// Internal: not re-exported by dsl/aggregation/index.ts.\nimport type { AggregationQuery } from './types.js';\nimport { asc, type FieldSort } from '../sort.js';\n\n/**\n * The sort Wow actually applies: what the query asked for, then each remaining\n * group ascending, so a page of grouped rows has one stable order.\n */\nexport function effectiveSort<FIELDS extends string = string>(\n query: Pick<AggregationQuery<string, FIELDS>, 'groupBy' | 'sort'>,\n): FieldSort[] {\n const sort = [...(query.sort ?? [])];\n const sorted = new Set(sort.map(entry => entry.field));\n return [\n ...sort,\n ...(query.groupBy ?? [])\n .map(group => group.alias)\n .filter(alias => !sorted.has(alias))\n .map(asc),\n ];\n}\n"],"mappings":"+BAqBA,SAAgBE,EACd,EACa,CACb,IAAMC,EAAO,CAAC,GAAIC,EAAM,MAAQ,CAAC,CAAE,EAC7BC,EAAS,IAAI,IAAIF,EAAK,IAAI,GAASG,EAAM,KAAK,CAAC,EACrD,MAAO,CACL,GAAGH,EACH,IAAIC,EAAM,SAAW,CAAC,EAAA,CACnB,IAAI,GAASG,EAAM,KAAK,CAAC,CACzB,OAAO,GAAS,CAACF,EAAO,IAAIG,CAAK,CAAC,CAAC,CACnC,IAAIR,EAAAA,GAAG,CACZ,CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AggregationQuery } from './types.cjs';
|
|
2
|
+
import { FieldSort } from '../sort.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* The sort Wow actually applies: what the query asked for, then each remaining
|
|
5
|
+
* group ascending, so a page of grouped rows has one stable order.
|
|
6
|
+
*/
|
|
7
|
+
export declare function effectiveSort<FIELDS extends string = string>(query: Pick<AggregationQuery<string, FIELDS>, 'groupBy' | 'sort'>): FieldSort[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AggregationQuery } from './types.js';
|
|
2
|
+
import { FieldSort } from '../sort.js';
|
|
3
|
+
/**
|
|
4
|
+
* The sort Wow actually applies: what the query asked for, then each remaining
|
|
5
|
+
* group ascending, so a page of grouped rows has one stable order.
|
|
6
|
+
*/
|
|
7
|
+
export declare function effectiveSort<FIELDS extends string = string>(query: Pick<AggregationQuery<string, FIELDS>, 'groupBy' | 'sort'>): FieldSort[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { asc as e } from "../sort.es.js";
|
|
2
|
+
//#region src/dsl/aggregation/sort.ts
|
|
3
|
+
function t(t) {
|
|
4
|
+
let n = [...t.sort ?? []], r = new Set(n.map((e) => e.field));
|
|
5
|
+
return [...n, ...(t.groupBy ?? []).map((e) => e.alias).filter((e) => !r.has(e)).map(e)];
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as effectiveSort };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=sort.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort.es.js","names":["effectiveSort","sort","query","sorted","entry","group","alias","asc"],"sources":["../../../src/dsl/aggregation/sort.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// Internal: not re-exported by dsl/aggregation/index.ts.\nimport type { AggregationQuery } from './types.js';\nimport { asc, type FieldSort } from '../sort.js';\n\n/**\n * The sort Wow actually applies: what the query asked for, then each remaining\n * group ascending, so a page of grouped rows has one stable order.\n */\nexport function effectiveSort<FIELDS extends string = string>(\n query: Pick<AggregationQuery<string, FIELDS>, 'groupBy' | 'sort'>,\n): FieldSort[] {\n const sort = [...(query.sort ?? [])];\n const sorted = new Set(sort.map(entry => entry.field));\n return [\n ...sort,\n ...(query.groupBy ?? [])\n .map(group => group.alias)\n .filter(alias => !sorted.has(alias))\n .map(asc),\n ];\n}\n"],"mappings":";;AAqBA,SAAgBA,EACd,GACa;CACb,IAAMC,IAAO,CAAC,GAAIC,EAAM,QAAQ,CAAC,CAAE,GAC7BC,IAAS,IAAI,IAAIF,EAAK,KAAI,MAASG,EAAM,KAAK,CAAC;CACrD,OAAO,CACL,GAAGH,GACH,IAAIC,EAAM,WAAW,CAAC,EAAA,CACnB,KAAI,MAASG,EAAM,KAAK,CAAC,CACzB,QAAO,MAAS,CAACF,EAAO,IAAIG,CAAK,CAAC,CAAC,CACnC,IAAIC,CAAG,CACZ;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=function(e){return e.TERMS=`TERMS`,e.HISTOGRAM=`HISTOGRAM`,e.DATE_HISTOGRAM=`DATE_HISTOGRAM`,e.DATE_PART=`DATE_PART`,e}({}),t=function(e){return e.COUNT=`COUNT`,e.NUMERIC=`NUMERIC`,e.ANY=`ANY`,e.DISTINCT_COUNT=`DISTINCT_COUNT`,e.PERCENTILE=`PERCENTILE`,e.DERIVED=`DERIVED`,e.FIRST=`FIRST`,e.LAST=`LAST`,e}({}),n=function(e){return e.FIELD=`FIELD`,e.CONSTANT=`CONSTANT`,e.BINARY=`BINARY`,e.DATE_DIFF=`DATE_DIFF`,e}({}),r=function(e){return e.SECOND=`SECOND`,e.MINUTE=`MINUTE`,e.HOUR=`HOUR`,e.DAY=`DAY`,e}({}),i=function(e){return e.ADD=`ADD`,e.SUBTRACT=`SUBTRACT`,e.MULTIPLY=`MULTIPLY`,e.DIVIDE=`DIVIDE`,e}({}),a=function(e){return e.YEAR=`YEAR`,e.QUARTER=`QUARTER`,e.MONTH=`MONTH`,e.WEEK=`WEEK`,e.DAY=`DAY`,e.HOUR=`HOUR`,e.MINUTE=`MINUTE`,e.SECOND=`SECOND`,e}({}),o=function(e){return e.DAY_OF_WEEK=`DAY_OF_WEEK`,e.DAY_OF_MONTH=`DAY_OF_MONTH`,e.HOUR_OF_DAY=`HOUR_OF_DAY`,e.MONTH_OF_YEAR=`MONTH_OF_YEAR`,e}({}),s=function(e){return e.SUM=`SUM`,e.AVG=`AVG`,e.MIN=`MIN`,e.MAX=`MAX`,e.STDDEV=`STDDEV`,e.VARIANCE=`VARIANCE`,e}({}),c=function(e){return e.METRIC_REF=`METRIC_REF`,e.CONSTANT=`CONSTANT`,e.BINARY=`BINARY`,e}({}),l=function(e){return e.CONDITION=`CONDITION`,e.BETWEEN=`BETWEEN`,e.IN=`IN`,e.IS_NULL=`IS_NULL`,e.AND=`AND`,e.OR=`OR`,e}({}),u=function(e){return e.EQ=`EQ`,e.NE=`NE`,e.GT=`GT`,e.GTE=`GTE`,e.LT=`LT`,e.LTE=`LTE`,e}({}),d=Object.freeze({DEFAULT_LIMIT:100,MAX_LIMIT:1e4,MAX_ELEMENTS:5,MAX_GROUPS:32,MAX_METRICS:64,MAX_SORT_FIELDS:32,MAX_EXPRESSION_DEPTH:8,MAX_EXPRESSION_NODES:256});exports.AGGREGATION_LIMITS=d,exports.AggregationDatePart=o,exports.AggregationDateUnit=a,exports.AggregationExpressionOperator=i,exports.AggregationExpressionType=n,exports.AggregationFunction=s,exports.AggregationGroupType=e,exports.AggregationMetricType=t,exports.ComparisonOperator=u,exports.DateDiffUnit=r,exports.DerivedExpressionType=c,exports.HavingExpressionType=l;
|
|
2
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","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,EAAL,SAAA,EAAA,OAEL,GAAAC,MAAA,QAEA,EAAAC,UAAA,YAEA,EAAAC,eAAA,iBAKA,EAAAC,UAAA,aACF,EAAA,CAAA,CAAA,EAOYC,EAAL,SAAA,EAAA,OAEL,GAAAC,MAAA,QAKA,EAAAC,QAAA,UAEA,EAAAC,IAAA,MAKA,EAAAC,eAAA,iBAKA,EAAAC,WAAA,aAKA,EAAAC,QAAA,UAKA,EAAAC,MAAA,QAKA,EAAAC,KAAA,QACF,EAAA,CAAA,CAAA,EAGYC,EAAL,SAAA,EAAA,OAEL,GAAAC,MAAA,QAEA,EAAAC,SAAA,WAEA,EAAAC,OAAA,SAKA,EAAAC,UAAA,aACF,EAAA,CAAA,CAAA,EAOYC,EAAL,SAAA,EAAA,OACL,GAAAC,OAAA,SACA,EAAAC,OAAA,SACA,EAAAC,KAAA,OACA,EAAAC,IAAA,OACF,EAAA,CAAA,CAAA,EAMYC,EAAL,SAAA,EAAA,OAEL,GAAAC,IAAA,MAEA,EAAAC,SAAA,WAEA,EAAAC,SAAA,WAEA,EAAAC,OAAA,UACF,EAAA,CAAA,CAAA,EAMYC,EAAL,SAAA,EAAA,OACL,GAAAC,KAAA,OACA,EAAAC,QAAA,UACA,EAAAC,MAAA,QACA,EAAAC,KAAA,OACA,EAAAV,IAAA,MACA,EAAAD,KAAA,OACA,EAAAD,OAAA,SACA,EAAAD,OAAA,UACF,EAAA,CAAA,CAAA,EAOYc,EAAL,SAAA,EAAA,OAEL,GAAAC,YAAA,cAKA,EAAAC,aAAA,eAEA,EAAAC,YAAA,cAEA,EAAAC,cAAA,iBACF,EAAA,CAAA,CAAA,EAMYC,EAAL,SAAA,EAAA,OAEL,GAAAC,IAAA,MAEA,EAAAC,IAAA,MAEA,EAAAC,IAAA,MAEA,EAAAC,IAAA,MAEA,EAAAC,OAAA,SAEA,EAAAC,SAAA,YACF,EAAA,CAAA,CAAA,EAqRYC,EAAL,SAAA,EAAA,OAEL,GAAAC,WAAA,aAEA,EAAA/B,SAAA,WAEA,EAAAC,OAAA,UACF,EAAA,CAAA,CAAA,EA6BY+B,EAAL,SAAA,EAAA,OAEL,GAAAC,UAAA,YAEA,EAAAC,QAAA,UAEA,EAAAC,GAAA,KAKA,EAAAC,QAAA,UAEA,EAAAC,IAAA,MAEA,EAAAC,GAAA,MACF,EAAA,CAAA,CAAA,EAGYC,EAAL,SAAA,EAAA,OAEL,GAAAC,GAAA,KAEA,EAAAC,GAAA,KAEA,EAAAC,GAAA,KAEA,EAAAC,IAAA,MAEA,EAAAC,GAAA,KAEA,EAAAC,IAAA,OACF,EAAA,CAAA,CAAA,EAkKaC,EAAqB,OAAO,OAAO,CAE9C,cAAe,IAEf,UAAW,IAEX,aAAc,EAEd,WAAY,GAEZ,YAAa,GAEb,gBAAiB,GAEjB,qBAAsB,EAEtB,qBAAsB,GACxB,CAAC"}
|