@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,309 @@
|
|
|
1
|
+
import { ElementFilterExpression, ExpressionFilter } from '../filter/index.cjs';
|
|
2
|
+
import { DerivedExpressionDsl } from './derived.cjs';
|
|
3
|
+
import { DateDiffUnit, AggregationElement, AggregationExpression, DateDiffAggregationExpression, AggregationMetricOptions, AggregationQuery, AnyAggregationMetric, EdgeAggregationMetric, EdgeAggregationOptions, BinaryAggregationExpression, ConstantAggregationExpression, CountAggregationMetric, DateHistogramAggregationGroup, DateHistogramAggregationOptions, DatePartAggregationGroup, DatePartAggregationOptions, DerivedAggregationMetric, DerivedExpression, DistinctCountAggregationMetric, FieldAggregationExpression, HistogramAggregationGroup, HistogramAggregationOptions, NumericAggregationMetric, PercentileAggregationMetric, PercentileAggregationOptions, TermsAggregationGroup, TermsAggregationOptions } from './types.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* Builders of an `AggregationQuery`: its elements, groups, metrics and the
|
|
6
|
+
* arithmetic expressions metrics compute over. Each builder checks its own
|
|
7
|
+
* part and throws a `TypeError` naming what is wrong; {@link aggregation.query}
|
|
8
|
+
* checks the parts against each other.
|
|
9
|
+
*
|
|
10
|
+
* Every group and metric takes its target first, its alias second, and any
|
|
11
|
+
* further options as a trailing object.
|
|
12
|
+
*/
|
|
13
|
+
export declare const aggregation: {
|
|
14
|
+
/**
|
|
15
|
+
* Aggregates over the elements of an array field instead of the root
|
|
16
|
+
* documents. `{ path, filter? }`.
|
|
17
|
+
*
|
|
18
|
+
* @param path - The array field, a query field path.
|
|
19
|
+
* @param predicate - Keeps only the elements that match; may not contain
|
|
20
|
+
* root filters (id, owner, tenant, space, deletion) or any search, even
|
|
21
|
+
* one that names its fields. An `EXPRESSION` filter is allowed.
|
|
22
|
+
* @throws TypeError when `path` is not a valid field path or `predicate`
|
|
23
|
+
* contains a root filter.
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* aggregation.element('items', filter.gt('quantity', 0));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
element(path: string, predicate?: ElementFilterExpression | ExpressionFilter): AggregationElement;
|
|
30
|
+
/**
|
|
31
|
+
* The value of a field, as an operand. `{ type: 'FIELD', field }`.
|
|
32
|
+
*
|
|
33
|
+
* @throws TypeError when `field` is not a valid field path.
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* aggregation.sum(aggregation.field('state.amount'), 'amount');
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
field<FIELDS extends string>(field: FIELDS): FieldAggregationExpression<FIELDS>;
|
|
40
|
+
/**
|
|
41
|
+
* A number, as an operand. `{ type: 'CONSTANT', value }`.
|
|
42
|
+
*
|
|
43
|
+
* @throws TypeError when `value` is not finite.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* aggregation.multiply(aggregation.field('price'), aggregation.constant(100));
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
constant(value: number): ConstantAggregationExpression;
|
|
50
|
+
/**
|
|
51
|
+
* The time from the instant in `from` to the instant in `to`, `to − from`,
|
|
52
|
+
* in `unit`, as a signed decimal: negative when `to` is earlier, and no
|
|
53
|
+
* value when either instant is absent. A `DAY` is exactly 24 hours.
|
|
54
|
+
* `{ type: 'DATE_DIFF', from, to, unit }`. Both fields must be
|
|
55
|
+
* single-valued time fields, those whose `aggregate.groups` list
|
|
56
|
+
* `DATE_HISTOGRAM` in the descriptor, and `unit` one of its
|
|
57
|
+
* `analysis.dateDiffUnits`. Wow 9.2 and later.
|
|
58
|
+
*
|
|
59
|
+
* @throws TypeError when `from` or `to` is not a valid field path, or
|
|
60
|
+
* `unit` is not a {@link DateDiffUnit}.
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* // Hours from payment to shipping, averaged per warehouse.
|
|
64
|
+
* aggregation.avg(
|
|
65
|
+
* aggregation.dateDiff('state.paidAt', 'state.shippedAt', DateDiffUnit.HOUR),
|
|
66
|
+
* 'hoursToShip',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
dateDiff<FIELDS extends string>(from: FIELDS, to: FIELDS, unit: DateDiffUnit): DateDiffAggregationExpression<FIELDS>;
|
|
71
|
+
/** `left + right`. `{ type: 'BINARY', operator: 'ADD', left, right }`. */
|
|
72
|
+
add: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
73
|
+
/** `left - right`. `{ type: 'BINARY', operator: 'SUBTRACT', left, right }`. */
|
|
74
|
+
subtract: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
75
|
+
/** `left * right`. `{ type: 'BINARY', operator: 'MULTIPLY', left, right }`. */
|
|
76
|
+
multiply: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
77
|
+
/** `left / right`. `{ type: 'BINARY', operator: 'DIVIDE', left, right }`. */
|
|
78
|
+
divide: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
79
|
+
/**
|
|
80
|
+
* Groups by each distinct value of a field, or of a computed expression.
|
|
81
|
+
* `{ type: 'TERMS', field, alias, missingKey? }`, or
|
|
82
|
+
* `{ type: 'TERMS', expression, alias }`.
|
|
83
|
+
*
|
|
84
|
+
* @param input - The field to group by, or an expression in its place
|
|
85
|
+
* (Wow 9.2 and later, an expensive computation).
|
|
86
|
+
* @param alias - The name of the group column in the result rows.
|
|
87
|
+
* @param options.missingKey - The key of the rows without a value; only
|
|
88
|
+
* with a field.
|
|
89
|
+
* @throws TypeError when `input` or `alias` is invalid, `missingKey` is
|
|
90
|
+
* blank, or `missingKey` is given with an expression.
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* aggregation.terms('state.status', 'status', { missingKey: 'NONE' });
|
|
94
|
+
* aggregation.terms(
|
|
95
|
+
* aggregation.dateDiff('state.paidAt', 'state.shippedAt', DateDiffUnit.DAY),
|
|
96
|
+
* 'daysToShip',
|
|
97
|
+
* );
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
terms<FIELDS extends string>(input: FIELDS | AggregationExpression<FIELDS>, alias: string, { missingKey }?: TermsAggregationOptions): TermsAggregationGroup<FIELDS>;
|
|
101
|
+
/**
|
|
102
|
+
* Groups a number field, or a computed expression, into buckets of equal
|
|
103
|
+
* width. `{ type: 'HISTOGRAM', field | expression, interval, alias }`.
|
|
104
|
+
*
|
|
105
|
+
* @param input - The number field to bucket, or an expression in its
|
|
106
|
+
* place (Wow 9.2 and later, an expensive computation).
|
|
107
|
+
* @param alias - The name of the bucket column in the result rows.
|
|
108
|
+
* @param options.interval - The bucket width.
|
|
109
|
+
* @throws TypeError when `interval` is not finite and greater than 0, or
|
|
110
|
+
* `field` or `alias` is invalid.
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* aggregation.histogram('state.amount', 'amountBand', { interval: 100 });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
histogram<FIELDS extends string>(input: FIELDS | AggregationExpression<FIELDS>, alias: string, { interval }: HistogramAggregationOptions): HistogramAggregationGroup<FIELDS>;
|
|
117
|
+
/**
|
|
118
|
+
* Groups a time field into calendar buckets.
|
|
119
|
+
* `{ type: 'DATE_HISTOGRAM', field, unit, alias, timeZone, dense? }`.
|
|
120
|
+
*
|
|
121
|
+
* @param field - The time field (epoch milliseconds) to bucket.
|
|
122
|
+
* @param alias - The name of the bucket column in the result rows.
|
|
123
|
+
* @param options.unit - The calendar unit of a bucket.
|
|
124
|
+
* @param options.timeZone - The zone buckets are cut in. Defaults to `UTC`.
|
|
125
|
+
* @param options.dense - Whether the empty buckets of the range are filled
|
|
126
|
+
* in.
|
|
127
|
+
* @throws TypeError when `unit` is not an `AggregationDateUnit`,
|
|
128
|
+
* `timeZone` is blank, `dense` is not a boolean, or `field` or `alias` is
|
|
129
|
+
* invalid.
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* aggregation.dateHistogram('createTime', 'day', {
|
|
133
|
+
* unit: AggregationDateUnit.DAY,
|
|
134
|
+
* timeZone: 'Asia/Shanghai',
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
dateHistogram<FIELDS extends string>(field: FIELDS, alias: string, { unit, timeZone, dense }: DateHistogramAggregationOptions): DateHistogramAggregationGroup<FIELDS>;
|
|
139
|
+
/**
|
|
140
|
+
* Groups a time field by one calendar part of each instant, such as the
|
|
141
|
+
* weekday or the hour, so records from different days share a bucket.
|
|
142
|
+
* `{ type: 'DATE_PART', field, part, alias, timeZone, dense? }`.
|
|
143
|
+
*
|
|
144
|
+
* The group's keys in the result rows are integers: `DAY_OF_WEEK` is the
|
|
145
|
+
* ISO weekday, 1 (Monday) to 7 (Sunday); `DAY_OF_MONTH` 1 to 31;
|
|
146
|
+
* `HOUR_OF_DAY` 0 to 23 on the wall clock of `timeZone`; `MONTH_OF_YEAR`
|
|
147
|
+
* 1 to 12. With `dense`, every key of that domain comes back, those
|
|
148
|
+
* without records carrying each metric's empty value; `dense` needs the
|
|
149
|
+
* group to be the query's only one. Wow 9.2 and later.
|
|
150
|
+
*
|
|
151
|
+
* @param field - The time field (epoch milliseconds) to read the part of.
|
|
152
|
+
* @param alias - The name of the part column in the result rows.
|
|
153
|
+
* @param options.part - The calendar part to group by.
|
|
154
|
+
* @param options.timeZone - The zone the part is read in. Defaults to
|
|
155
|
+
* `UTC`.
|
|
156
|
+
* @param options.dense - Whether every key of the part's domain is
|
|
157
|
+
* returned.
|
|
158
|
+
* @throws TypeError when `part` is not an `AggregationDatePart`,
|
|
159
|
+
* `timeZone` is blank, `dense` is not a boolean, or `field` or `alias` is
|
|
160
|
+
* invalid.
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* aggregation.datePart('createTime', 'weekday', {
|
|
164
|
+
* part: AggregationDatePart.DAY_OF_WEEK,
|
|
165
|
+
* timeZone: 'Asia/Shanghai',
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
datePart<FIELDS extends string>(field: FIELDS, alias: string, { part, timeZone, dense }: DatePartAggregationOptions): DatePartAggregationGroup<FIELDS>;
|
|
170
|
+
/**
|
|
171
|
+
* Any one value of a field within each group, of any type.
|
|
172
|
+
* `{ type: 'ANY', field, alias, filter? }`.
|
|
173
|
+
*
|
|
174
|
+
* @throws TypeError when `field` or `alias` is invalid.
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* aggregation.any('state.customerName', 'customer');
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
any<FIELDS extends string>(field: FIELDS, alias: string, { filter: predicate }?: AggregationMetricOptions<FIELDS>): AnyAggregationMetric<FIELDS>;
|
|
181
|
+
/**
|
|
182
|
+
* The value of `field` on each group's earliest record by `orderBy`.
|
|
183
|
+
* `{ type: 'FIRST', field, alias, orderBy?, filter? }`.
|
|
184
|
+
*
|
|
185
|
+
* The value comes back in the field's own type, or `null` when no record
|
|
186
|
+
* of the group has both a value and an `orderBy` position. Without
|
|
187
|
+
* `orderBy` the server orders by the model's event time, which the
|
|
188
|
+
* descriptor names as `analysis.firstLastOrderBy`. Neither a derived
|
|
189
|
+
* metric nor `having` may refer to it. Wow 9.2 and later.
|
|
190
|
+
*
|
|
191
|
+
* @throws TypeError when `field`, `orderBy` or `alias` is invalid.
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* aggregation.first('state.price', 'open', { orderBy: 'createTime' });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
first<FIELDS extends string>(field: FIELDS, alias: string, options?: EdgeAggregationOptions<FIELDS>): EdgeAggregationMetric<FIELDS>;
|
|
198
|
+
/**
|
|
199
|
+
* The value of `field` on each group's latest record by `orderBy`.
|
|
200
|
+
* `{ type: 'LAST', field, alias, orderBy?, filter? }`. As
|
|
201
|
+
* {@link aggregation.first}, from the other end.
|
|
202
|
+
*
|
|
203
|
+
* @throws TypeError when `field`, `orderBy` or `alias` is invalid.
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* aggregation.last('state.price', 'close', { orderBy: 'createTime' });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
last<FIELDS extends string>(field: FIELDS, alias: string, options?: EdgeAggregationOptions<FIELDS>): EdgeAggregationMetric<FIELDS>;
|
|
210
|
+
/**
|
|
211
|
+
* The number of rows in each group. `{ type: 'COUNT', alias, filter? }`.
|
|
212
|
+
*
|
|
213
|
+
* @param alias - The name of the metric column in the result rows.
|
|
214
|
+
* @param options.filter - Counts only the rows that match.
|
|
215
|
+
* @throws TypeError when `alias` is invalid.
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* aggregation.count('paid', { filter: filter.eq('state.status', 'PAID') });
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
count<FIELDS extends string = string>(alias: string, { filter: predicate }?: AggregationMetricOptions<FIELDS>): CountAggregationMetric<FIELDS>;
|
|
222
|
+
/**
|
|
223
|
+
* The sum of an expression. `{ type: 'NUMERIC', function: 'SUM',
|
|
224
|
+
* expression, alias, filter? }`.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* aggregation.sum(aggregation.field('state.amount'), 'revenue');
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
sum: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
232
|
+
/** The average of an expression; see {@link aggregation.sum}. */
|
|
233
|
+
avg: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
234
|
+
/** The least value of an expression; see {@link aggregation.sum}. */
|
|
235
|
+
min: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
236
|
+
/** The greatest value of an expression; see {@link aggregation.sum}. */
|
|
237
|
+
max: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
238
|
+
/** The standard deviation of an expression; see {@link aggregation.sum}. */
|
|
239
|
+
stddev: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
240
|
+
/** The variance of an expression; see {@link aggregation.sum}. */
|
|
241
|
+
variance: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
242
|
+
/**
|
|
243
|
+
* The number of distinct values of an expression.
|
|
244
|
+
* `{ type: 'DISTINCT_COUNT', expression, alias, filter? }`.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* aggregation.distinctCount(aggregation.field('ownerId'), 'customers');
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
distinctCount<FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, { filter: predicate }?: AggregationMetricOptions<FIELDS>): DistinctCountAggregationMetric<FIELDS>;
|
|
252
|
+
/**
|
|
253
|
+
* A percentile of an expression.
|
|
254
|
+
* `{ type: 'PERCENTILE', expression, percentile, alias, filter? }`.
|
|
255
|
+
*
|
|
256
|
+
* @param options.percentile - Which percentile, within (0, 100).
|
|
257
|
+
* @throws TypeError when `percentile` is not finite and within (0, 100), or
|
|
258
|
+
* `alias` is invalid.
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* aggregation.percentile(aggregation.field('latency'), 'p95', { percentile: 95 });
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
percentile<FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, { percentile, filter: predicate }: PercentileAggregationOptions<FIELDS>): PercentileAggregationMetric<FIELDS>;
|
|
265
|
+
/**
|
|
266
|
+
* A metric computed from other metrics of the same row, by their aliases.
|
|
267
|
+
* `{ type: 'DERIVED', expression, alias }`. `aggregation.query()` checks
|
|
268
|
+
* that it refers only to metrics declared before it.
|
|
269
|
+
*
|
|
270
|
+
* @param expression - The arithmetic: a callback that builds it from the
|
|
271
|
+
* {@link DerivedExpressionDsl} it is handed (`ref`, `constant`, `add`,
|
|
272
|
+
* `subtract`, `multiply`, `divide`), or an already-built tree.
|
|
273
|
+
* @throws TypeError when `alias` is invalid, or a `constant` is not finite.
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* aggregation.derived(
|
|
277
|
+
* d => d.divide(d.ref('revenue'), d.ref('orders')),
|
|
278
|
+
* 'averageOrder',
|
|
279
|
+
* );
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
derived(expression: DerivedExpression | ((d: DerivedExpressionDsl) => DerivedExpression), alias: string): DerivedAggregationMetric;
|
|
283
|
+
/**
|
|
284
|
+
* The builders of the query's `having`: conditions on the metric columns of
|
|
285
|
+
* the grouped rows (`eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `between`, `isIn`,
|
|
286
|
+
* `isNull`, `isNotNull`) and their `and`/`or`. See `HavingDsl`.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* aggregation.query({
|
|
291
|
+
* groupBy: [aggregation.terms('state.status', 'status')],
|
|
292
|
+
* metrics: [aggregation.count('orders')],
|
|
293
|
+
* having: aggregation.having.gt('orders', 10),
|
|
294
|
+
* });
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
having: import('./having.cjs').HavingDsl;
|
|
298
|
+
/**
|
|
299
|
+
* Admits a whole aggregation query against the rules Wow enforces on arrival.
|
|
300
|
+
*
|
|
301
|
+
* The factories above each check their own part; only the assembled query
|
|
302
|
+
* can answer the questions that span parts — whether two aliases collide,
|
|
303
|
+
* whether a sort names one of them, whether `having` has rows to filter.
|
|
304
|
+
* Wow checks all of it in `AggregationQuery`'s constructor and answers a
|
|
305
|
+
* query that fails with a 400, so the same rules run here against the object
|
|
306
|
+
* about to be sent.
|
|
307
|
+
*/
|
|
308
|
+
query<ROOT_FIELDS extends string = string, AGGREGATION_FIELDS extends string = ROOT_FIELDS>(query: AggregationQuery<ROOT_FIELDS, AGGREGATION_FIELDS>): AggregationQuery<ROOT_FIELDS, AGGREGATION_FIELDS>;
|
|
309
|
+
};
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { ElementFilterExpression, ExpressionFilter } from '../filter/index.js';
|
|
2
|
+
import { DerivedExpressionDsl } from './derived.js';
|
|
3
|
+
import { DateDiffUnit, AggregationElement, AggregationExpression, DateDiffAggregationExpression, AggregationMetricOptions, AggregationQuery, AnyAggregationMetric, EdgeAggregationMetric, EdgeAggregationOptions, BinaryAggregationExpression, ConstantAggregationExpression, CountAggregationMetric, DateHistogramAggregationGroup, DateHistogramAggregationOptions, DatePartAggregationGroup, DatePartAggregationOptions, DerivedAggregationMetric, DerivedExpression, DistinctCountAggregationMetric, FieldAggregationExpression, HistogramAggregationGroup, HistogramAggregationOptions, NumericAggregationMetric, PercentileAggregationMetric, PercentileAggregationOptions, TermsAggregationGroup, TermsAggregationOptions } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builders of an `AggregationQuery`: its elements, groups, metrics and the
|
|
6
|
+
* arithmetic expressions metrics compute over. Each builder checks its own
|
|
7
|
+
* part and throws a `TypeError` naming what is wrong; {@link aggregation.query}
|
|
8
|
+
* checks the parts against each other.
|
|
9
|
+
*
|
|
10
|
+
* Every group and metric takes its target first, its alias second, and any
|
|
11
|
+
* further options as a trailing object.
|
|
12
|
+
*/
|
|
13
|
+
export declare const aggregation: {
|
|
14
|
+
/**
|
|
15
|
+
* Aggregates over the elements of an array field instead of the root
|
|
16
|
+
* documents. `{ path, filter? }`.
|
|
17
|
+
*
|
|
18
|
+
* @param path - The array field, a query field path.
|
|
19
|
+
* @param predicate - Keeps only the elements that match; may not contain
|
|
20
|
+
* root filters (id, owner, tenant, space, deletion) or any search, even
|
|
21
|
+
* one that names its fields. An `EXPRESSION` filter is allowed.
|
|
22
|
+
* @throws TypeError when `path` is not a valid field path or `predicate`
|
|
23
|
+
* contains a root filter.
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* aggregation.element('items', filter.gt('quantity', 0));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
element(path: string, predicate?: ElementFilterExpression | ExpressionFilter): AggregationElement;
|
|
30
|
+
/**
|
|
31
|
+
* The value of a field, as an operand. `{ type: 'FIELD', field }`.
|
|
32
|
+
*
|
|
33
|
+
* @throws TypeError when `field` is not a valid field path.
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* aggregation.sum(aggregation.field('state.amount'), 'amount');
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
field<FIELDS extends string>(field: FIELDS): FieldAggregationExpression<FIELDS>;
|
|
40
|
+
/**
|
|
41
|
+
* A number, as an operand. `{ type: 'CONSTANT', value }`.
|
|
42
|
+
*
|
|
43
|
+
* @throws TypeError when `value` is not finite.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* aggregation.multiply(aggregation.field('price'), aggregation.constant(100));
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
constant(value: number): ConstantAggregationExpression;
|
|
50
|
+
/**
|
|
51
|
+
* The time from the instant in `from` to the instant in `to`, `to − from`,
|
|
52
|
+
* in `unit`, as a signed decimal: negative when `to` is earlier, and no
|
|
53
|
+
* value when either instant is absent. A `DAY` is exactly 24 hours.
|
|
54
|
+
* `{ type: 'DATE_DIFF', from, to, unit }`. Both fields must be
|
|
55
|
+
* single-valued time fields, those whose `aggregate.groups` list
|
|
56
|
+
* `DATE_HISTOGRAM` in the descriptor, and `unit` one of its
|
|
57
|
+
* `analysis.dateDiffUnits`. Wow 9.2 and later.
|
|
58
|
+
*
|
|
59
|
+
* @throws TypeError when `from` or `to` is not a valid field path, or
|
|
60
|
+
* `unit` is not a {@link DateDiffUnit}.
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* // Hours from payment to shipping, averaged per warehouse.
|
|
64
|
+
* aggregation.avg(
|
|
65
|
+
* aggregation.dateDiff('state.paidAt', 'state.shippedAt', DateDiffUnit.HOUR),
|
|
66
|
+
* 'hoursToShip',
|
|
67
|
+
* );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
dateDiff<FIELDS extends string>(from: FIELDS, to: FIELDS, unit: DateDiffUnit): DateDiffAggregationExpression<FIELDS>;
|
|
71
|
+
/** `left + right`. `{ type: 'BINARY', operator: 'ADD', left, right }`. */
|
|
72
|
+
add: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
73
|
+
/** `left - right`. `{ type: 'BINARY', operator: 'SUBTRACT', left, right }`. */
|
|
74
|
+
subtract: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
75
|
+
/** `left * right`. `{ type: 'BINARY', operator: 'MULTIPLY', left, right }`. */
|
|
76
|
+
multiply: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
77
|
+
/** `left / right`. `{ type: 'BINARY', operator: 'DIVIDE', left, right }`. */
|
|
78
|
+
divide: <FIELDS extends string>(left: AggregationExpression<FIELDS>, right: AggregationExpression<FIELDS>) => BinaryAggregationExpression<FIELDS>;
|
|
79
|
+
/**
|
|
80
|
+
* Groups by each distinct value of a field, or of a computed expression.
|
|
81
|
+
* `{ type: 'TERMS', field, alias, missingKey? }`, or
|
|
82
|
+
* `{ type: 'TERMS', expression, alias }`.
|
|
83
|
+
*
|
|
84
|
+
* @param input - The field to group by, or an expression in its place
|
|
85
|
+
* (Wow 9.2 and later, an expensive computation).
|
|
86
|
+
* @param alias - The name of the group column in the result rows.
|
|
87
|
+
* @param options.missingKey - The key of the rows without a value; only
|
|
88
|
+
* with a field.
|
|
89
|
+
* @throws TypeError when `input` or `alias` is invalid, `missingKey` is
|
|
90
|
+
* blank, or `missingKey` is given with an expression.
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* aggregation.terms('state.status', 'status', { missingKey: 'NONE' });
|
|
94
|
+
* aggregation.terms(
|
|
95
|
+
* aggregation.dateDiff('state.paidAt', 'state.shippedAt', DateDiffUnit.DAY),
|
|
96
|
+
* 'daysToShip',
|
|
97
|
+
* );
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
terms<FIELDS extends string>(input: FIELDS | AggregationExpression<FIELDS>, alias: string, { missingKey }?: TermsAggregationOptions): TermsAggregationGroup<FIELDS>;
|
|
101
|
+
/**
|
|
102
|
+
* Groups a number field, or a computed expression, into buckets of equal
|
|
103
|
+
* width. `{ type: 'HISTOGRAM', field | expression, interval, alias }`.
|
|
104
|
+
*
|
|
105
|
+
* @param input - The number field to bucket, or an expression in its
|
|
106
|
+
* place (Wow 9.2 and later, an expensive computation).
|
|
107
|
+
* @param alias - The name of the bucket column in the result rows.
|
|
108
|
+
* @param options.interval - The bucket width.
|
|
109
|
+
* @throws TypeError when `interval` is not finite and greater than 0, or
|
|
110
|
+
* `field` or `alias` is invalid.
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* aggregation.histogram('state.amount', 'amountBand', { interval: 100 });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
histogram<FIELDS extends string>(input: FIELDS | AggregationExpression<FIELDS>, alias: string, { interval }: HistogramAggregationOptions): HistogramAggregationGroup<FIELDS>;
|
|
117
|
+
/**
|
|
118
|
+
* Groups a time field into calendar buckets.
|
|
119
|
+
* `{ type: 'DATE_HISTOGRAM', field, unit, alias, timeZone, dense? }`.
|
|
120
|
+
*
|
|
121
|
+
* @param field - The time field (epoch milliseconds) to bucket.
|
|
122
|
+
* @param alias - The name of the bucket column in the result rows.
|
|
123
|
+
* @param options.unit - The calendar unit of a bucket.
|
|
124
|
+
* @param options.timeZone - The zone buckets are cut in. Defaults to `UTC`.
|
|
125
|
+
* @param options.dense - Whether the empty buckets of the range are filled
|
|
126
|
+
* in.
|
|
127
|
+
* @throws TypeError when `unit` is not an `AggregationDateUnit`,
|
|
128
|
+
* `timeZone` is blank, `dense` is not a boolean, or `field` or `alias` is
|
|
129
|
+
* invalid.
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* aggregation.dateHistogram('createTime', 'day', {
|
|
133
|
+
* unit: AggregationDateUnit.DAY,
|
|
134
|
+
* timeZone: 'Asia/Shanghai',
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
dateHistogram<FIELDS extends string>(field: FIELDS, alias: string, { unit, timeZone, dense }: DateHistogramAggregationOptions): DateHistogramAggregationGroup<FIELDS>;
|
|
139
|
+
/**
|
|
140
|
+
* Groups a time field by one calendar part of each instant, such as the
|
|
141
|
+
* weekday or the hour, so records from different days share a bucket.
|
|
142
|
+
* `{ type: 'DATE_PART', field, part, alias, timeZone, dense? }`.
|
|
143
|
+
*
|
|
144
|
+
* The group's keys in the result rows are integers: `DAY_OF_WEEK` is the
|
|
145
|
+
* ISO weekday, 1 (Monday) to 7 (Sunday); `DAY_OF_MONTH` 1 to 31;
|
|
146
|
+
* `HOUR_OF_DAY` 0 to 23 on the wall clock of `timeZone`; `MONTH_OF_YEAR`
|
|
147
|
+
* 1 to 12. With `dense`, every key of that domain comes back, those
|
|
148
|
+
* without records carrying each metric's empty value; `dense` needs the
|
|
149
|
+
* group to be the query's only one. Wow 9.2 and later.
|
|
150
|
+
*
|
|
151
|
+
* @param field - The time field (epoch milliseconds) to read the part of.
|
|
152
|
+
* @param alias - The name of the part column in the result rows.
|
|
153
|
+
* @param options.part - The calendar part to group by.
|
|
154
|
+
* @param options.timeZone - The zone the part is read in. Defaults to
|
|
155
|
+
* `UTC`.
|
|
156
|
+
* @param options.dense - Whether every key of the part's domain is
|
|
157
|
+
* returned.
|
|
158
|
+
* @throws TypeError when `part` is not an `AggregationDatePart`,
|
|
159
|
+
* `timeZone` is blank, `dense` is not a boolean, or `field` or `alias` is
|
|
160
|
+
* invalid.
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* aggregation.datePart('createTime', 'weekday', {
|
|
164
|
+
* part: AggregationDatePart.DAY_OF_WEEK,
|
|
165
|
+
* timeZone: 'Asia/Shanghai',
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
datePart<FIELDS extends string>(field: FIELDS, alias: string, { part, timeZone, dense }: DatePartAggregationOptions): DatePartAggregationGroup<FIELDS>;
|
|
170
|
+
/**
|
|
171
|
+
* Any one value of a field within each group, of any type.
|
|
172
|
+
* `{ type: 'ANY', field, alias, filter? }`.
|
|
173
|
+
*
|
|
174
|
+
* @throws TypeError when `field` or `alias` is invalid.
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* aggregation.any('state.customerName', 'customer');
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
any<FIELDS extends string>(field: FIELDS, alias: string, { filter: predicate }?: AggregationMetricOptions<FIELDS>): AnyAggregationMetric<FIELDS>;
|
|
181
|
+
/**
|
|
182
|
+
* The value of `field` on each group's earliest record by `orderBy`.
|
|
183
|
+
* `{ type: 'FIRST', field, alias, orderBy?, filter? }`.
|
|
184
|
+
*
|
|
185
|
+
* The value comes back in the field's own type, or `null` when no record
|
|
186
|
+
* of the group has both a value and an `orderBy` position. Without
|
|
187
|
+
* `orderBy` the server orders by the model's event time, which the
|
|
188
|
+
* descriptor names as `analysis.firstLastOrderBy`. Neither a derived
|
|
189
|
+
* metric nor `having` may refer to it. Wow 9.2 and later.
|
|
190
|
+
*
|
|
191
|
+
* @throws TypeError when `field`, `orderBy` or `alias` is invalid.
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* aggregation.first('state.price', 'open', { orderBy: 'createTime' });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
first<FIELDS extends string>(field: FIELDS, alias: string, options?: EdgeAggregationOptions<FIELDS>): EdgeAggregationMetric<FIELDS>;
|
|
198
|
+
/**
|
|
199
|
+
* The value of `field` on each group's latest record by `orderBy`.
|
|
200
|
+
* `{ type: 'LAST', field, alias, orderBy?, filter? }`. As
|
|
201
|
+
* {@link aggregation.first}, from the other end.
|
|
202
|
+
*
|
|
203
|
+
* @throws TypeError when `field`, `orderBy` or `alias` is invalid.
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* aggregation.last('state.price', 'close', { orderBy: 'createTime' });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
last<FIELDS extends string>(field: FIELDS, alias: string, options?: EdgeAggregationOptions<FIELDS>): EdgeAggregationMetric<FIELDS>;
|
|
210
|
+
/**
|
|
211
|
+
* The number of rows in each group. `{ type: 'COUNT', alias, filter? }`.
|
|
212
|
+
*
|
|
213
|
+
* @param alias - The name of the metric column in the result rows.
|
|
214
|
+
* @param options.filter - Counts only the rows that match.
|
|
215
|
+
* @throws TypeError when `alias` is invalid.
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* aggregation.count('paid', { filter: filter.eq('state.status', 'PAID') });
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
count<FIELDS extends string = string>(alias: string, { filter: predicate }?: AggregationMetricOptions<FIELDS>): CountAggregationMetric<FIELDS>;
|
|
222
|
+
/**
|
|
223
|
+
* The sum of an expression. `{ type: 'NUMERIC', function: 'SUM',
|
|
224
|
+
* expression, alias, filter? }`.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* aggregation.sum(aggregation.field('state.amount'), 'revenue');
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
sum: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
232
|
+
/** The average of an expression; see {@link aggregation.sum}. */
|
|
233
|
+
avg: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
234
|
+
/** The least value of an expression; see {@link aggregation.sum}. */
|
|
235
|
+
min: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
236
|
+
/** The greatest value of an expression; see {@link aggregation.sum}. */
|
|
237
|
+
max: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
238
|
+
/** The standard deviation of an expression; see {@link aggregation.sum}. */
|
|
239
|
+
stddev: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
240
|
+
/** The variance of an expression; see {@link aggregation.sum}. */
|
|
241
|
+
variance: <FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, options?: AggregationMetricOptions<FIELDS>) => NumericAggregationMetric<FIELDS>;
|
|
242
|
+
/**
|
|
243
|
+
* The number of distinct values of an expression.
|
|
244
|
+
* `{ type: 'DISTINCT_COUNT', expression, alias, filter? }`.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* aggregation.distinctCount(aggregation.field('ownerId'), 'customers');
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
distinctCount<FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, { filter: predicate }?: AggregationMetricOptions<FIELDS>): DistinctCountAggregationMetric<FIELDS>;
|
|
252
|
+
/**
|
|
253
|
+
* A percentile of an expression.
|
|
254
|
+
* `{ type: 'PERCENTILE', expression, percentile, alias, filter? }`.
|
|
255
|
+
*
|
|
256
|
+
* @param options.percentile - Which percentile, within (0, 100).
|
|
257
|
+
* @throws TypeError when `percentile` is not finite and within (0, 100), or
|
|
258
|
+
* `alias` is invalid.
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* aggregation.percentile(aggregation.field('latency'), 'p95', { percentile: 95 });
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
percentile<FIELDS extends string>(expression: AggregationExpression<FIELDS>, alias: string, { percentile, filter: predicate }: PercentileAggregationOptions<FIELDS>): PercentileAggregationMetric<FIELDS>;
|
|
265
|
+
/**
|
|
266
|
+
* A metric computed from other metrics of the same row, by their aliases.
|
|
267
|
+
* `{ type: 'DERIVED', expression, alias }`. `aggregation.query()` checks
|
|
268
|
+
* that it refers only to metrics declared before it.
|
|
269
|
+
*
|
|
270
|
+
* @param expression - The arithmetic: a callback that builds it from the
|
|
271
|
+
* {@link DerivedExpressionDsl} it is handed (`ref`, `constant`, `add`,
|
|
272
|
+
* `subtract`, `multiply`, `divide`), or an already-built tree.
|
|
273
|
+
* @throws TypeError when `alias` is invalid, or a `constant` is not finite.
|
|
274
|
+
* @example
|
|
275
|
+
* ```typescript
|
|
276
|
+
* aggregation.derived(
|
|
277
|
+
* d => d.divide(d.ref('revenue'), d.ref('orders')),
|
|
278
|
+
* 'averageOrder',
|
|
279
|
+
* );
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
derived(expression: DerivedExpression | ((d: DerivedExpressionDsl) => DerivedExpression), alias: string): DerivedAggregationMetric;
|
|
283
|
+
/**
|
|
284
|
+
* The builders of the query's `having`: conditions on the metric columns of
|
|
285
|
+
* the grouped rows (`eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `between`, `isIn`,
|
|
286
|
+
* `isNull`, `isNotNull`) and their `and`/`or`. See `HavingDsl`.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* aggregation.query({
|
|
291
|
+
* groupBy: [aggregation.terms('state.status', 'status')],
|
|
292
|
+
* metrics: [aggregation.count('orders')],
|
|
293
|
+
* having: aggregation.having.gt('orders', 10),
|
|
294
|
+
* });
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
having: import('./having.js').HavingDsl;
|
|
298
|
+
/**
|
|
299
|
+
* Admits a whole aggregation query against the rules Wow enforces on arrival.
|
|
300
|
+
*
|
|
301
|
+
* The factories above each check their own part; only the assembled query
|
|
302
|
+
* can answer the questions that span parts — whether two aliases collide,
|
|
303
|
+
* whether a sort names one of them, whether `having` has rows to filter.
|
|
304
|
+
* Wow checks all of it in `AggregationQuery`'s constructor and answers a
|
|
305
|
+
* query that fails with a 400, so the same rules run here against the object
|
|
306
|
+
* about to be sent.
|
|
307
|
+
*/
|
|
308
|
+
query<ROOT_FIELDS extends string = string, AGGREGATION_FIELDS extends string = ROOT_FIELDS>(query: AggregationQuery<ROOT_FIELDS, AGGREGATION_FIELDS>): AggregationQuery<ROOT_FIELDS, AGGREGATION_FIELDS>;
|
|
309
|
+
};
|