@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,369 @@
|
|
|
1
|
+
import { SnapshotQueryApi } from './snapshotQueryApi.js';
|
|
2
|
+
import { AggregationQuery } from '../../../dsl/aggregation/index.js';
|
|
3
|
+
import { FilterExpression } from '../../../dsl/filter/index.js';
|
|
4
|
+
import { Condition, ListQueryRequest, PagedQueryRequest, SingleQueryRequest } from '../requests.js';
|
|
5
|
+
import { PagedList } from '../../../dsl/queryable.js';
|
|
6
|
+
import { MaterializedSnapshot } from './snapshot.js';
|
|
7
|
+
import { DynamicDocument } from '../../../dsl/documents.js';
|
|
8
|
+
import { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.js';
|
|
9
|
+
import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
|
|
10
|
+
/**
|
|
11
|
+
* A client for querying snapshot data through HTTP endpoints.
|
|
12
|
+
* Provides methods for various query operations such as counting, listing, paging, and retrieving single snapshots.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Define the state interface
|
|
17
|
+
* interface CartItem {
|
|
18
|
+
* productId: string;
|
|
19
|
+
* quantity: number;
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* interface CartState {
|
|
23
|
+
* items: CartItem[];
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // Create client options configuration
|
|
27
|
+
* const clientOptions: ApiMetadata = {
|
|
28
|
+
* fetcher: new Fetcher({ baseURL: 'http://localhost:8080/' }),
|
|
29
|
+
* basePath: 'owner/{ownerId}/cart'
|
|
30
|
+
* };
|
|
31
|
+
*
|
|
32
|
+
* // Create a snapshot query client instance
|
|
33
|
+
* const snapshotQueryClient = new SnapshotQueryClient<CartState>(clientOptions);
|
|
34
|
+
*
|
|
35
|
+
* // Count snapshots
|
|
36
|
+
* const count = await snapshotQueryClient.count(filter.matchAll());
|
|
37
|
+
*
|
|
38
|
+
* // List snapshots
|
|
39
|
+
* const listQuery: FilterListQuery = {
|
|
40
|
+
* filter: filter.matchAll()
|
|
41
|
+
* };
|
|
42
|
+
* const list = await snapshotQueryClient.list(listQuery);
|
|
43
|
+
*
|
|
44
|
+
* // List snapshots as stream
|
|
45
|
+
* const listStream = await snapshotQueryClient.listStream(listQuery);
|
|
46
|
+
* for await (const snapshot of listStream) {
|
|
47
|
+
* console.log('Received:', snapshot);
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* // List snapshot states
|
|
51
|
+
* const stateList = await snapshotQueryClient.listState(listQuery);
|
|
52
|
+
*
|
|
53
|
+
* // List snapshot states as stream
|
|
54
|
+
* const stateListStream = await snapshotQueryClient.listStateStream(listQuery);
|
|
55
|
+
* for await (const state of stateListStream) {
|
|
56
|
+
* console.log('Received state:', state);
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* // Paged snapshots
|
|
60
|
+
* const pagedQuery: FilterPagedQuery = {
|
|
61
|
+
* filter: filter.matchAll(),
|
|
62
|
+
* pagination: { index: 1, size: 10 }
|
|
63
|
+
* };
|
|
64
|
+
* const paged = await snapshotQueryClient.paged(pagedQuery);
|
|
65
|
+
*
|
|
66
|
+
* // Paged snapshot states
|
|
67
|
+
* const pagedState = await snapshotQueryClient.pagedState(pagedQuery);
|
|
68
|
+
*
|
|
69
|
+
* // Single snapshot
|
|
70
|
+
* const singleQuery: FilterSingleQuery = {
|
|
71
|
+
* filter: filter.matchAll()
|
|
72
|
+
* };
|
|
73
|
+
* const single = await snapshotQueryClient.single(singleQuery);
|
|
74
|
+
*
|
|
75
|
+
* // Single snapshot state
|
|
76
|
+
* const singleState = await snapshotQueryClient.singleState(singleQuery);
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @template S The type of the snapshot state
|
|
80
|
+
*/
|
|
81
|
+
export declare class SnapshotQueryClient<S, FIELDS extends string = string> implements SnapshotQueryApi<S, FIELDS>, ApiMetadataCapable {
|
|
82
|
+
readonly apiMetadata?: ApiMetadata | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new SnapshotQueryClient instance.
|
|
85
|
+
*/
|
|
86
|
+
constructor(apiMetadata?: ApiMetadata | undefined);
|
|
87
|
+
/** Runs a snapshot aggregation and returns all result rows. */
|
|
88
|
+
aggregate<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<Row[]>;
|
|
89
|
+
/** Runs a snapshot aggregation and streams the result rows, one per server-sent event. */
|
|
90
|
+
aggregateStream<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<Row>>;
|
|
91
|
+
/** Retrieves the next cursor page of materialized snapshots. */
|
|
92
|
+
cursor<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(query: CursorQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<CursorPage<T>>;
|
|
93
|
+
/** Retrieves the next cursor page of snapshot states. */
|
|
94
|
+
cursorState<T extends Partial<S> = S>(query: CursorQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<CursorPage<T>>;
|
|
95
|
+
/**
|
|
96
|
+
* Counts the number of snapshots that match the given filter.
|
|
97
|
+
*
|
|
98
|
+
* @param filter - The filter expression or legacy condition
|
|
99
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
100
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
101
|
+
* custom data between different interceptors.
|
|
102
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
103
|
+
* @returns A promise that resolves to the count of matching snapshots
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* const count = await snapshotQueryClient.count(filter.matchAll());
|
|
108
|
+
* console.log('Total snapshots:', count);
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
count(filter: FilterExpression<FIELDS> | Condition<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<number>;
|
|
112
|
+
/**
|
|
113
|
+
* Retrieves a list of materialized snapshots based on the provided query parameters.
|
|
114
|
+
*
|
|
115
|
+
* @param listQuery - The query parameters for listing snapshots
|
|
116
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
117
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
118
|
+
* custom data between different interceptors.
|
|
119
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
120
|
+
* @returns A promise that resolves to an array of partial materialized snapshots
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const listQuery: FilterListQuery = {
|
|
125
|
+
* filter: filter.matchAll()
|
|
126
|
+
* };
|
|
127
|
+
* const list = await snapshotQueryClient.list(listQuery);
|
|
128
|
+
* for (const snapshot of list) {
|
|
129
|
+
* console.log('Snapshot:', snapshot);
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
list<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(listQuery: ListQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves a stream of materialized snapshots based on the provided query parameters.
|
|
136
|
+
*
|
|
137
|
+
* @param listQuery - The query parameters for listing snapshots
|
|
138
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
139
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
140
|
+
* custom data between different interceptors.
|
|
141
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
142
|
+
* @returns A promise that resolves to a readable stream of partial materialized snapshots
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* const listQuery: FilterListQuery = {
|
|
147
|
+
* filter: filter.matchAll()
|
|
148
|
+
* };
|
|
149
|
+
* const listStream = await snapshotQueryClient.listStream(listQuery);
|
|
150
|
+
* for await (const snapshot of listStream) {
|
|
151
|
+
* console.log('Received snapshot:', snapshot);
|
|
152
|
+
* }
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
listStream<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(listQuery: ListQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<T>>;
|
|
156
|
+
/**
|
|
157
|
+
* Retrieves a list of snapshot states based on the provided query parameters.
|
|
158
|
+
*
|
|
159
|
+
* @param listQuery - The query parameters for listing snapshot states
|
|
160
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
161
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
162
|
+
* custom data between different interceptors.
|
|
163
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
164
|
+
* @returns A promise that resolves to an array of partial snapshot states
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* const listQuery: FilterListQuery = {
|
|
169
|
+
* filter: filter.matchAll()
|
|
170
|
+
* };
|
|
171
|
+
* const list = await snapshotQueryClient.listState(listQuery);
|
|
172
|
+
* for (const state of list) {
|
|
173
|
+
* console.log('State:', state);
|
|
174
|
+
* }
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
listState<T extends Partial<S> = S>(listQuery: ListQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T[]>;
|
|
178
|
+
/**
|
|
179
|
+
* Retrieves a stream of snapshot states based on the provided query parameters.
|
|
180
|
+
*
|
|
181
|
+
* @param listQuery - The query parameters for listing snapshot states
|
|
182
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
183
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
184
|
+
* custom data between different interceptors.
|
|
185
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
186
|
+
* @returns A promise that resolves to a readable stream of partial snapshot states
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* ```typescript
|
|
190
|
+
* const listQuery: FilterListQuery = {
|
|
191
|
+
* filter: filter.matchAll()
|
|
192
|
+
* };
|
|
193
|
+
* const listStream = await snapshotQueryClient.listStateStream(listQuery);
|
|
194
|
+
* for await (const state of listStream) {
|
|
195
|
+
* console.log('Received state:', state);
|
|
196
|
+
* }
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
listStateStream<T extends Partial<S> = S>(listQuery: ListQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<T>>;
|
|
200
|
+
/**
|
|
201
|
+
* Retrieves a paged list of materialized snapshots based on the provided query parameters.
|
|
202
|
+
*
|
|
203
|
+
* @param pagedQuery - The query parameters for paging snapshots
|
|
204
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
205
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
206
|
+
* custom data between different interceptors.
|
|
207
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
208
|
+
* @returns A promise that resolves to a paged list of partial materialized snapshots
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```typescript
|
|
212
|
+
* const pagedQuery: FilterPagedQuery = {
|
|
213
|
+
* filter: filter.matchAll(),
|
|
214
|
+
* pagination: { index: 1, size: 10 }
|
|
215
|
+
* };
|
|
216
|
+
* const paged = await snapshotQueryClient.paged(pagedQuery);
|
|
217
|
+
* console.log('Total:', paged.total);
|
|
218
|
+
* for (const snapshot of paged.list) {
|
|
219
|
+
* console.log('Snapshot:', snapshot);
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
paged<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(pagedQuery: PagedQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<PagedList<T>>;
|
|
224
|
+
/**
|
|
225
|
+
* Retrieves a paged list of snapshot states based on the provided query parameters.
|
|
226
|
+
*
|
|
227
|
+
* @param pagedQuery - The query parameters for paging snapshot states
|
|
228
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
229
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
230
|
+
* custom data between different interceptors.
|
|
231
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
232
|
+
* @returns A promise that resolves to a paged list of partial snapshot states
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* ```typescript
|
|
236
|
+
* const pagedQuery: FilterPagedQuery = {
|
|
237
|
+
* filter: filter.matchAll(),
|
|
238
|
+
* pagination: { index: 1, size: 10 }
|
|
239
|
+
* };
|
|
240
|
+
* const pagedState = await snapshotQueryClient.pagedState(pagedQuery);
|
|
241
|
+
* for (const state of pagedState.list) {
|
|
242
|
+
* console.log('State:', state);
|
|
243
|
+
* }
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
pagedState<T extends Partial<S> = S>(pagedQuery: PagedQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<PagedList<T>>;
|
|
247
|
+
/**
|
|
248
|
+
* Retrieves a single materialized snapshot based on the provided query parameters.
|
|
249
|
+
*
|
|
250
|
+
* @param singleQuery - The query parameters for retrieving a single snapshot
|
|
251
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
252
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
253
|
+
* custom data between different interceptors.
|
|
254
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
255
|
+
* @returns A promise that resolves to a partial materialized snapshot
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* const singleQuery: FilterSingleQuery = {
|
|
260
|
+
* filter: filter.matchAll()
|
|
261
|
+
* };
|
|
262
|
+
* const single = await snapshotQueryClient.single(singleQuery);
|
|
263
|
+
* console.log('Snapshot:', single);
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
single<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(singleQuery: SingleQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T>;
|
|
267
|
+
/**
|
|
268
|
+
* Retrieves a single snapshot state based on the provided query parameters.
|
|
269
|
+
*
|
|
270
|
+
* @param singleQuery - The query parameters for retrieving a single snapshot state
|
|
271
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
272
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
273
|
+
* custom data between different interceptors.
|
|
274
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
275
|
+
* @returns A promise that resolves to a partial snapshot state
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```typescript
|
|
279
|
+
* const singleQuery: FilterSingleQuery = {
|
|
280
|
+
* filter: filter.matchAll()
|
|
281
|
+
* };
|
|
282
|
+
* const singleState = await snapshotQueryClient.singleState(singleQuery);
|
|
283
|
+
* console.log('State:', singleState);
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
singleState<T extends Partial<S> = S>(singleQuery: SingleQueryRequest<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T>;
|
|
287
|
+
/**
|
|
288
|
+
* Retrieves a single materialized snapshot by its ID.
|
|
289
|
+
*
|
|
290
|
+
* @param id - The unique identifier of the snapshot to retrieve
|
|
291
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
292
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
293
|
+
* custom data between different interceptors.
|
|
294
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
295
|
+
* @returns A promise that resolves to the materialized snapshot with the specified ID
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* const snapshot = await snapshotQueryClient.getById('snapshot-123');
|
|
300
|
+
* console.log('Snapshot:', snapshot);
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
303
|
+
getById(id: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<MaterializedSnapshot<S>>;
|
|
304
|
+
/**
|
|
305
|
+
* Retrieves a single snapshot state by its ID.
|
|
306
|
+
*
|
|
307
|
+
* @param id - The unique identifier of the snapshot whose state to retrieve
|
|
308
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
309
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
310
|
+
* custom data between different interceptors.
|
|
311
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
312
|
+
* @returns A promise that resolves to the snapshot state with the specified ID
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* const state = await snapshotQueryClient.getStateById('snapshot-123');
|
|
317
|
+
* console.log('State:', state);
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
getStateById(id: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<S>;
|
|
321
|
+
/**
|
|
322
|
+
* Retrieves multiple materialized snapshots by their IDs.
|
|
323
|
+
*
|
|
324
|
+
* One request, filtered by `filter.aggregateIds(ids)` with `limit` set to
|
|
325
|
+
* the number of ids; an empty `ids` sends nothing and resolves to `[]`. The
|
|
326
|
+
* server refuses more ids than its filter value limit and its maximum list
|
|
327
|
+
* size (1000 each by default), so split a larger set into batches.
|
|
328
|
+
*
|
|
329
|
+
* @param ids - An array of unique identifiers of the snapshots to retrieve
|
|
330
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
331
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
332
|
+
* custom data between different interceptors.
|
|
333
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
334
|
+
* @returns A promise that resolves to an array of materialized snapshots with the specified IDs
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```typescript
|
|
338
|
+
* const snapshots = await snapshotQueryClient.getByIds(['snapshot-123', 'snapshot-456']);
|
|
339
|
+
* for (const snapshot of snapshots) {
|
|
340
|
+
* console.log('Snapshot:', snapshot);
|
|
341
|
+
* }
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
getByIds(ids: string[], attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<MaterializedSnapshot<S>[]>;
|
|
345
|
+
/**
|
|
346
|
+
* Retrieves multiple snapshot states by their IDs.
|
|
347
|
+
*
|
|
348
|
+
* One request, filtered by `filter.aggregateIds(ids)` with `limit` set to
|
|
349
|
+
* the number of ids; an empty `ids` sends nothing and resolves to `[]`. The
|
|
350
|
+
* server refuses more ids than its filter value limit and its maximum list
|
|
351
|
+
* size (1000 each by default), so split a larger set into batches.
|
|
352
|
+
*
|
|
353
|
+
* @param ids - An array of unique identifiers of the snapshots whose states to retrieve
|
|
354
|
+
* @param attributes - Optional shared attributes that can be accessed by interceptors
|
|
355
|
+
* throughout the request lifecycle. These attributes allow passing
|
|
356
|
+
* custom data between different interceptors.
|
|
357
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
358
|
+
* @returns A promise that resolves to an array of snapshot states with the specified IDs
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```typescript
|
|
362
|
+
* const states = await snapshotQueryClient.getStateByIds(['snapshot-123', 'snapshot-456']);
|
|
363
|
+
* for (const state of states) {
|
|
364
|
+
* console.log('State:', state);
|
|
365
|
+
* }
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
getStateByIds(ids: string[], attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<S[]>;
|
|
369
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { filter as e } from "../../../dsl/filter/builders.es.js";
|
|
2
|
+
import { listQuery as t, singleQuery as n } from "../../../dsl/queryable.es.js";
|
|
3
|
+
import { QUERY_STREAM_ENDPOINT as r } from "../../../transport/endpoints.es.js";
|
|
4
|
+
import { bindMethods as i } from "../../bindMethods.es.js";
|
|
5
|
+
import a from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js";
|
|
6
|
+
import o from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js";
|
|
7
|
+
import s from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js";
|
|
8
|
+
import { SnapshotQueryEndpointPaths as c } from "./endpointPaths.es.js";
|
|
9
|
+
import { api as l, attribute as u, autoGeneratedError as d, body as f, post as p } from "@ahoo-wang/fetcher-decorator";
|
|
10
|
+
//#region src/client/query/snapshot/snapshotQueryClient.ts
|
|
11
|
+
var m = class {
|
|
12
|
+
constructor(e) {
|
|
13
|
+
this.apiMetadata = e, i(this);
|
|
14
|
+
}
|
|
15
|
+
aggregate(e, t, n) {
|
|
16
|
+
throw d(e, t, n);
|
|
17
|
+
}
|
|
18
|
+
/* v8 ignore stop */
|
|
19
|
+
aggregateStream(e, t, n) {
|
|
20
|
+
throw d(e, t, n);
|
|
21
|
+
}
|
|
22
|
+
/* v8 ignore stop */
|
|
23
|
+
cursor(e, t, n) {
|
|
24
|
+
throw d(e, t, n);
|
|
25
|
+
}
|
|
26
|
+
/* v8 ignore stop */
|
|
27
|
+
cursorState(e, t, n) {
|
|
28
|
+
throw d(e, t, n);
|
|
29
|
+
}
|
|
30
|
+
/* v8 ignore stop */
|
|
31
|
+
count(e, t, n) {
|
|
32
|
+
throw d(e, t, n);
|
|
33
|
+
}
|
|
34
|
+
/* v8 ignore stop */
|
|
35
|
+
list(e, t, n) {
|
|
36
|
+
throw d(e, t, n);
|
|
37
|
+
}
|
|
38
|
+
/* v8 ignore stop */
|
|
39
|
+
listStream(e, t, n) {
|
|
40
|
+
throw d(e, t, n);
|
|
41
|
+
}
|
|
42
|
+
/* v8 ignore stop */
|
|
43
|
+
listState(e, t, n) {
|
|
44
|
+
throw d(e, t, n);
|
|
45
|
+
}
|
|
46
|
+
/* v8 ignore stop */
|
|
47
|
+
listStateStream(e, t, n) {
|
|
48
|
+
throw d(e, t, n);
|
|
49
|
+
}
|
|
50
|
+
/* v8 ignore stop */
|
|
51
|
+
paged(e, t, n) {
|
|
52
|
+
throw d(e, t, n);
|
|
53
|
+
}
|
|
54
|
+
/* v8 ignore stop */
|
|
55
|
+
pagedState(e, t, n) {
|
|
56
|
+
throw d(e, t, n);
|
|
57
|
+
}
|
|
58
|
+
/* v8 ignore stop */
|
|
59
|
+
single(e, t, n) {
|
|
60
|
+
throw d(e, t, n);
|
|
61
|
+
}
|
|
62
|
+
/* v8 ignore stop */
|
|
63
|
+
singleState(e, t, n) {
|
|
64
|
+
throw d(e, t, n);
|
|
65
|
+
}
|
|
66
|
+
/* v8 ignore stop */
|
|
67
|
+
getById(t, r, i) {
|
|
68
|
+
let a = n({ filter: e.aggregateId(t) });
|
|
69
|
+
return this.single(a, r, i);
|
|
70
|
+
}
|
|
71
|
+
getStateById(t, r, i) {
|
|
72
|
+
let a = n({ filter: e.aggregateId(t) });
|
|
73
|
+
return this.singleState(a, r, i);
|
|
74
|
+
}
|
|
75
|
+
getByIds(n, r, i) {
|
|
76
|
+
if (n.length === 0) return Promise.resolve([]);
|
|
77
|
+
let a = t({
|
|
78
|
+
filter: e.aggregateIds(n),
|
|
79
|
+
limit: n.length
|
|
80
|
+
});
|
|
81
|
+
return this.list(a, r, i);
|
|
82
|
+
}
|
|
83
|
+
getStateByIds(n, r, i) {
|
|
84
|
+
if (n.length === 0) return Promise.resolve([]);
|
|
85
|
+
let a = t({
|
|
86
|
+
filter: e.aggregateIds(n),
|
|
87
|
+
limit: n.length
|
|
88
|
+
});
|
|
89
|
+
return this.listState(a, r, i);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
s([
|
|
93
|
+
p(c.AGGREGATION),
|
|
94
|
+
o(0, f()),
|
|
95
|
+
o(1, u()),
|
|
96
|
+
a("design:type", Function),
|
|
97
|
+
a("design:paramtypes", [
|
|
98
|
+
Object,
|
|
99
|
+
typeof Record > "u" ? Object : Record,
|
|
100
|
+
Object
|
|
101
|
+
]),
|
|
102
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
103
|
+
], m.prototype, "aggregate", null), s([
|
|
104
|
+
p(c.AGGREGATION, r),
|
|
105
|
+
o(0, f()),
|
|
106
|
+
o(1, u()),
|
|
107
|
+
a("design:type", Function),
|
|
108
|
+
a("design:paramtypes", [
|
|
109
|
+
Object,
|
|
110
|
+
typeof Record > "u" ? Object : Record,
|
|
111
|
+
Object
|
|
112
|
+
]),
|
|
113
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
114
|
+
], m.prototype, "aggregateStream", null), s([
|
|
115
|
+
p(c.CURSOR),
|
|
116
|
+
o(0, f()),
|
|
117
|
+
o(1, u()),
|
|
118
|
+
a("design:type", Function),
|
|
119
|
+
a("design:paramtypes", [
|
|
120
|
+
Object,
|
|
121
|
+
typeof Record > "u" ? Object : Record,
|
|
122
|
+
Object
|
|
123
|
+
]),
|
|
124
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
125
|
+
], m.prototype, "cursor", null), s([
|
|
126
|
+
p(c.CURSOR_STATE),
|
|
127
|
+
o(0, f()),
|
|
128
|
+
o(1, u()),
|
|
129
|
+
a("design:type", Function),
|
|
130
|
+
a("design:paramtypes", [
|
|
131
|
+
Object,
|
|
132
|
+
typeof Record > "u" ? Object : Record,
|
|
133
|
+
Object
|
|
134
|
+
]),
|
|
135
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
136
|
+
], m.prototype, "cursorState", null), s([
|
|
137
|
+
p(c.COUNT),
|
|
138
|
+
o(0, f()),
|
|
139
|
+
o(1, u()),
|
|
140
|
+
a("design:type", Function),
|
|
141
|
+
a("design:paramtypes", [
|
|
142
|
+
Object,
|
|
143
|
+
typeof Record > "u" ? Object : Record,
|
|
144
|
+
Object
|
|
145
|
+
]),
|
|
146
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
147
|
+
], m.prototype, "count", null), s([
|
|
148
|
+
p(c.LIST),
|
|
149
|
+
o(0, f()),
|
|
150
|
+
o(1, u()),
|
|
151
|
+
a("design:type", Function),
|
|
152
|
+
a("design:paramtypes", [
|
|
153
|
+
Object,
|
|
154
|
+
typeof Record > "u" ? Object : Record,
|
|
155
|
+
Object
|
|
156
|
+
]),
|
|
157
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
158
|
+
], m.prototype, "list", null), s([
|
|
159
|
+
p(c.LIST, r),
|
|
160
|
+
o(0, f()),
|
|
161
|
+
o(1, u()),
|
|
162
|
+
a("design:type", Function),
|
|
163
|
+
a("design:paramtypes", [
|
|
164
|
+
Object,
|
|
165
|
+
typeof Record > "u" ? Object : Record,
|
|
166
|
+
Object
|
|
167
|
+
]),
|
|
168
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
169
|
+
], m.prototype, "listStream", null), s([
|
|
170
|
+
p(c.LIST_STATE),
|
|
171
|
+
o(0, f()),
|
|
172
|
+
o(1, u()),
|
|
173
|
+
a("design:type", Function),
|
|
174
|
+
a("design:paramtypes", [
|
|
175
|
+
Object,
|
|
176
|
+
typeof Record > "u" ? Object : Record,
|
|
177
|
+
Object
|
|
178
|
+
]),
|
|
179
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
180
|
+
], m.prototype, "listState", null), s([
|
|
181
|
+
p(c.LIST_STATE, r),
|
|
182
|
+
o(0, f()),
|
|
183
|
+
o(1, u()),
|
|
184
|
+
a("design:type", Function),
|
|
185
|
+
a("design:paramtypes", [
|
|
186
|
+
Object,
|
|
187
|
+
typeof Record > "u" ? Object : Record,
|
|
188
|
+
Object
|
|
189
|
+
]),
|
|
190
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
191
|
+
], m.prototype, "listStateStream", null), s([
|
|
192
|
+
p(c.PAGED),
|
|
193
|
+
o(0, f()),
|
|
194
|
+
o(1, u()),
|
|
195
|
+
a("design:type", Function),
|
|
196
|
+
a("design:paramtypes", [
|
|
197
|
+
Object,
|
|
198
|
+
typeof Record > "u" ? Object : Record,
|
|
199
|
+
Object
|
|
200
|
+
]),
|
|
201
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
202
|
+
], m.prototype, "paged", null), s([
|
|
203
|
+
p(c.PAGED_STATE),
|
|
204
|
+
o(0, f()),
|
|
205
|
+
o(1, u()),
|
|
206
|
+
a("design:type", Function),
|
|
207
|
+
a("design:paramtypes", [
|
|
208
|
+
Object,
|
|
209
|
+
typeof Record > "u" ? Object : Record,
|
|
210
|
+
Object
|
|
211
|
+
]),
|
|
212
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
213
|
+
], m.prototype, "pagedState", null), s([
|
|
214
|
+
p(c.SINGLE),
|
|
215
|
+
o(0, f()),
|
|
216
|
+
o(1, u()),
|
|
217
|
+
a("design:type", Function),
|
|
218
|
+
a("design:paramtypes", [
|
|
219
|
+
Object,
|
|
220
|
+
typeof Record > "u" ? Object : Record,
|
|
221
|
+
Object
|
|
222
|
+
]),
|
|
223
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
224
|
+
], m.prototype, "single", null), s([
|
|
225
|
+
p(c.SINGLE_STATE),
|
|
226
|
+
o(0, f()),
|
|
227
|
+
o(1, u()),
|
|
228
|
+
a("design:type", Function),
|
|
229
|
+
a("design:paramtypes", [
|
|
230
|
+
Object,
|
|
231
|
+
typeof Record > "u" ? Object : Record,
|
|
232
|
+
Object
|
|
233
|
+
]),
|
|
234
|
+
a("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
235
|
+
], m.prototype, "singleState", null), m = s([l(), a("design:paramtypes", [Object])], m);
|
|
236
|
+
//#endregion
|
|
237
|
+
export { m as SnapshotQueryClient };
|
|
238
|
+
|
|
239
|
+
//# sourceMappingURL=snapshotQueryClient.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotQueryClient.es.js","names":["_decorate","_decorateParam","_decorateMetadata","__decorateMetadata","__decorateParam","__decorate","SnapshotQueryClient","apiMetadata","bindMethods","autoGeneratedError","query","attributes","abort","filter","listQuery","pagedQuery","singleQuery","id","ids","post","SnapshotQueryEndpointPaths","body","attribute","QUERY_STREAM_ENDPOINT","api"],"sources":["../../../../src/client/query/snapshot/snapshotQueryClient.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 { SnapshotQueryApi } from './snapshotQueryApi.js';\nimport { SnapshotQueryEndpointPaths } from './endpointPaths.js';\nimport type { AggregationQuery } from '../../../dsl/aggregation/index.js';\nimport { filter, type FilterExpression } from '../../../dsl/filter/index.js';\nimport type {\n Condition,\n ListQueryRequest,\n PagedQueryRequest,\n SingleQueryRequest,\n} from '../requests.js';\nimport {\n listQuery,\n type PagedList,\n singleQuery,\n} from '../../../dsl/queryable.js';\nimport type { MaterializedSnapshot } from './snapshot.js';\nimport type { DynamicDocument } from '../../../dsl/documents.js';\nimport type { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.js';\nimport { QUERY_STREAM_ENDPOINT } from '../../../transport/endpoints.js';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n body,\n post,\n} from '@ahoo-wang/fetcher-decorator';\nimport { bindMethods } from '../../bindMethods.js';\n\n/**\n * A client for querying snapshot data through HTTP endpoints.\n * Provides methods for various query operations such as counting, listing, paging, and retrieving single snapshots.\n *\n * @example\n * ```typescript\n * // Define the state interface\n * interface CartItem {\n * productId: string;\n * quantity: number;\n * }\n *\n * interface CartState {\n * items: CartItem[];\n * }\n *\n * // Create client options configuration\n * const clientOptions: ApiMetadata = {\n * fetcher: new Fetcher({ baseURL: 'http://localhost:8080/' }),\n * basePath: 'owner/{ownerId}/cart'\n * };\n *\n * // Create a snapshot query client instance\n * const snapshotQueryClient = new SnapshotQueryClient<CartState>(clientOptions);\n *\n * // Count snapshots\n * const count = await snapshotQueryClient.count(filter.matchAll());\n *\n * // List snapshots\n * const listQuery: FilterListQuery = {\n * filter: filter.matchAll()\n * };\n * const list = await snapshotQueryClient.list(listQuery);\n *\n * // List snapshots as stream\n * const listStream = await snapshotQueryClient.listStream(listQuery);\n * for await (const snapshot of listStream) {\n * console.log('Received:', snapshot);\n * }\n *\n * // List snapshot states\n * const stateList = await snapshotQueryClient.listState(listQuery);\n *\n * // List snapshot states as stream\n * const stateListStream = await snapshotQueryClient.listStateStream(listQuery);\n * for await (const state of stateListStream) {\n * console.log('Received state:', state);\n * }\n *\n * // Paged snapshots\n * const pagedQuery: FilterPagedQuery = {\n * filter: filter.matchAll(),\n * pagination: { index: 1, size: 10 }\n * };\n * const paged = await snapshotQueryClient.paged(pagedQuery);\n *\n * // Paged snapshot states\n * const pagedState = await snapshotQueryClient.pagedState(pagedQuery);\n *\n * // Single snapshot\n * const singleQuery: FilterSingleQuery = {\n * filter: filter.matchAll()\n * };\n * const single = await snapshotQueryClient.single(singleQuery);\n *\n * // Single snapshot state\n * const singleState = await snapshotQueryClient.singleState(singleQuery);\n * ```\n *\n * @template S The type of the snapshot state\n */\n@api()\nexport class SnapshotQueryClient<S, FIELDS extends string = string>\n implements SnapshotQueryApi<S, FIELDS>, ApiMetadataCapable\n{\n /**\n * Creates a new SnapshotQueryClient instance.\n */\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n /** Runs a snapshot aggregation and returns all result rows. */\n @post(SnapshotQueryEndpointPaths.AGGREGATION)\n /* v8 ignore start */\n aggregate<\n Row extends object = DynamicDocument,\n AGGREGATION_FIELDS extends string = string,\n >(\n @body() query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<Row[]> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n /** Runs a snapshot aggregation and streams the result rows, one per server-sent event. */\n @post(SnapshotQueryEndpointPaths.AGGREGATION, QUERY_STREAM_ENDPOINT)\n /* v8 ignore start */\n aggregateStream<\n Row extends object = DynamicDocument,\n AGGREGATION_FIELDS extends string = string,\n >(\n @body() query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<ReadableStream<Row>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n /** Retrieves the next cursor page of materialized snapshots. */\n @post(SnapshotQueryEndpointPaths.CURSOR)\n /* v8 ignore start */\n cursor<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(\n @body() query: CursorQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<CursorPage<T>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n /** Retrieves the next cursor page of snapshot states. */\n @post(SnapshotQueryEndpointPaths.CURSOR_STATE)\n /* v8 ignore start */\n cursorState<T extends Partial<S> = S>(\n @body() query: CursorQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<CursorPage<T>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Counts the number of snapshots that match the given filter.\n *\n * @param filter - The filter expression or legacy condition\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to the count of matching snapshots\n *\n * @example\n * ```typescript\n * const count = await snapshotQueryClient.count(filter.matchAll());\n * console.log('Total snapshots:', count);\n * ```\n */\n @post(SnapshotQueryEndpointPaths.COUNT)\n /* v8 ignore start */\n count(\n // compat(wow<9): accepts the deprecated Condition, which Wow < 8.11 needs; narrow to FilterExpression in v10.\n @body() filter: FilterExpression<FIELDS> | Condition<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<number> {\n throw autoGeneratedError(filter, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a list of materialized snapshots based on the provided query parameters.\n *\n * @param listQuery - The query parameters for listing snapshots\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to an array of partial materialized snapshots\n *\n * @example\n * ```typescript\n * const listQuery: FilterListQuery = {\n * filter: filter.matchAll()\n * };\n * const list = await snapshotQueryClient.list(listQuery);\n * for (const snapshot of list) {\n * console.log('Snapshot:', snapshot);\n * }\n * ```\n */\n @post(SnapshotQueryEndpointPaths.LIST)\n /* v8 ignore start */\n list<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(\n @body() listQuery: ListQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<T[]> {\n throw autoGeneratedError(listQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a stream of materialized snapshots based on the provided query parameters.\n *\n * @param listQuery - The query parameters for listing snapshots\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to a readable stream of partial materialized snapshots\n *\n * @example\n * ```typescript\n * const listQuery: FilterListQuery = {\n * filter: filter.matchAll()\n * };\n * const listStream = await snapshotQueryClient.listStream(listQuery);\n * for await (const snapshot of listStream) {\n * console.log('Received snapshot:', snapshot);\n * }\n * ```\n */\n @post(SnapshotQueryEndpointPaths.LIST, QUERY_STREAM_ENDPOINT)\n /* v8 ignore start */\n listStream<\n T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>,\n >(\n @body() listQuery: ListQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<ReadableStream<T>> {\n throw autoGeneratedError(listQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a list of snapshot states based on the provided query parameters.\n *\n * @param listQuery - The query parameters for listing snapshot states\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to an array of partial snapshot states\n *\n * @example\n * ```typescript\n * const listQuery: FilterListQuery = {\n * filter: filter.matchAll()\n * };\n * const list = await snapshotQueryClient.listState(listQuery);\n * for (const state of list) {\n * console.log('State:', state);\n * }\n * ```\n */\n @post(SnapshotQueryEndpointPaths.LIST_STATE)\n /* v8 ignore start */\n listState<T extends Partial<S> = S>(\n @body() listQuery: ListQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<T[]> {\n throw autoGeneratedError(listQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a stream of snapshot states based on the provided query parameters.\n *\n * @param listQuery - The query parameters for listing snapshot states\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to a readable stream of partial snapshot states\n *\n * @example\n * ```typescript\n * const listQuery: FilterListQuery = {\n * filter: filter.matchAll()\n * };\n * const listStream = await snapshotQueryClient.listStateStream(listQuery);\n * for await (const state of listStream) {\n * console.log('Received state:', state);\n * }\n * ```\n */\n @post(SnapshotQueryEndpointPaths.LIST_STATE, QUERY_STREAM_ENDPOINT)\n /* v8 ignore start */\n listStateStream<T extends Partial<S> = S>(\n @body() listQuery: ListQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<ReadableStream<T>> {\n throw autoGeneratedError(listQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a paged list of materialized snapshots based on the provided query parameters.\n *\n * @param pagedQuery - The query parameters for paging snapshots\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to a paged list of partial materialized snapshots\n *\n * @example\n * ```typescript\n * const pagedQuery: FilterPagedQuery = {\n * filter: filter.matchAll(),\n * pagination: { index: 1, size: 10 }\n * };\n * const paged = await snapshotQueryClient.paged(pagedQuery);\n * console.log('Total:', paged.total);\n * for (const snapshot of paged.list) {\n * console.log('Snapshot:', snapshot);\n * }\n * ```\n */\n @post(SnapshotQueryEndpointPaths.PAGED)\n /* v8 ignore start */\n paged<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(\n @body() pagedQuery: PagedQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<PagedList<T>> {\n throw autoGeneratedError(pagedQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a paged list of snapshot states based on the provided query parameters.\n *\n * @param pagedQuery - The query parameters for paging snapshot states\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to a paged list of partial snapshot states\n *\n * @example\n * ```typescript\n * const pagedQuery: FilterPagedQuery = {\n * filter: filter.matchAll(),\n * pagination: { index: 1, size: 10 }\n * };\n * const pagedState = await snapshotQueryClient.pagedState(pagedQuery);\n * for (const state of pagedState.list) {\n * console.log('State:', state);\n * }\n * ```\n */\n @post(SnapshotQueryEndpointPaths.PAGED_STATE)\n /* v8 ignore start */\n pagedState<T extends Partial<S> = S>(\n @body() pagedQuery: PagedQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<PagedList<T>> {\n throw autoGeneratedError(pagedQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a single materialized snapshot based on the provided query parameters.\n *\n * @param singleQuery - The query parameters for retrieving a single snapshot\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to a partial materialized snapshot\n *\n * @example\n * ```typescript\n * const singleQuery: FilterSingleQuery = {\n * filter: filter.matchAll()\n * };\n * const single = await snapshotQueryClient.single(singleQuery);\n * console.log('Snapshot:', single);\n * ```\n */\n @post(SnapshotQueryEndpointPaths.SINGLE)\n /* v8 ignore start */\n single<T extends Partial<MaterializedSnapshot<S>> = MaterializedSnapshot<S>>(\n @body() singleQuery: SingleQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<T> {\n throw autoGeneratedError(singleQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a single snapshot state based on the provided query parameters.\n *\n * @param singleQuery - The query parameters for retrieving a single snapshot state\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to a partial snapshot state\n *\n * @example\n * ```typescript\n * const singleQuery: FilterSingleQuery = {\n * filter: filter.matchAll()\n * };\n * const singleState = await snapshotQueryClient.singleState(singleQuery);\n * console.log('State:', singleState);\n * ```\n */\n @post(SnapshotQueryEndpointPaths.SINGLE_STATE)\n /* v8 ignore start */\n singleState<T extends Partial<S> = S>(\n @body() singleQuery: SingleQueryRequest<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<T> {\n throw autoGeneratedError(singleQuery, attributes, abort);\n }\n /* v8 ignore stop */\n\n /**\n * Retrieves a single materialized snapshot by its ID.\n *\n * @param id - The unique identifier of the snapshot to retrieve\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to the materialized snapshot with the specified ID\n *\n * @example\n * ```typescript\n * const snapshot = await snapshotQueryClient.getById('snapshot-123');\n * console.log('Snapshot:', snapshot);\n * ```\n */\n getById(\n id: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<MaterializedSnapshot<S>> {\n const query = singleQuery<FIELDS>({ filter: filter.aggregateId(id) });\n return this.single(query, attributes, abort);\n }\n\n /**\n * Retrieves a single snapshot state by its ID.\n *\n * @param id - The unique identifier of the snapshot whose state to retrieve\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to the snapshot state with the specified ID\n *\n * @example\n * ```typescript\n * const state = await snapshotQueryClient.getStateById('snapshot-123');\n * console.log('State:', state);\n * ```\n */\n getStateById(\n id: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<S> {\n const query = singleQuery<FIELDS>({ filter: filter.aggregateId(id) });\n return this.singleState(query, attributes, abort);\n }\n\n /**\n * Retrieves multiple materialized snapshots by their IDs.\n *\n * One request, filtered by `filter.aggregateIds(ids)` with `limit` set to\n * the number of ids; an empty `ids` sends nothing and resolves to `[]`. The\n * server refuses more ids than its filter value limit and its maximum list\n * size (1000 each by default), so split a larger set into batches.\n *\n * @param ids - An array of unique identifiers of the snapshots to retrieve\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to an array of materialized snapshots with the specified IDs\n *\n * @example\n * ```typescript\n * const snapshots = await snapshotQueryClient.getByIds(['snapshot-123', 'snapshot-456']);\n * for (const snapshot of snapshots) {\n * console.log('Snapshot:', snapshot);\n * }\n * ```\n */\n getByIds(\n ids: string[],\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<MaterializedSnapshot<S>[]> {\n if (ids.length === 0) return Promise.resolve([]);\n const query = listQuery<FIELDS>({\n filter: filter.aggregateIds(ids),\n limit: ids.length,\n });\n return this.list(query, attributes, abort);\n }\n\n /**\n * Retrieves multiple snapshot states by their IDs.\n *\n * One request, filtered by `filter.aggregateIds(ids)` with `limit` set to\n * the number of ids; an empty `ids` sends nothing and resolves to `[]`. The\n * server refuses more ids than its filter value limit and its maximum list\n * size (1000 each by default), so split a larger set into batches.\n *\n * @param ids - An array of unique identifiers of the snapshots whose states to retrieve\n * @param attributes - Optional shared attributes that can be accessed by interceptors\n * throughout the request lifecycle. These attributes allow passing\n * custom data between different interceptors.\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns A promise that resolves to an array of snapshot states with the specified IDs\n *\n * @example\n * ```typescript\n * const states = await snapshotQueryClient.getStateByIds(['snapshot-123', 'snapshot-456']);\n * for (const state of states) {\n * console.log('State:', state);\n * }\n * ```\n */\n getStateByIds(\n ids: string[],\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<S[]> {\n if (ids.length === 0) return Promise.resolve([]);\n const query = listQuery<FIELDS>({\n filter: filter.aggregateIds(ids),\n limit: ids.length,\n });\n return this.listState(query, attributes, abort);\n }\n}\n"],"mappings":";;;;;;;;;;AAqHO,IAAMM,IAAN,MAEP;CAIE,YAAY,GAA2C;EACrD,AAD0B,KAAA,cAAAC,GAC1BC,EAAY,IAAI;CAClB;CAGA,UAME,GACA,GACA,GACgB;EAChB,MAAMC,EAAmBC,GAAOC,GAAYC,CAAK;CACnD;;CAIA,gBAME,GACA,GACA,GAC8B;EAC9B,MAAMH,EAAmBC,GAAOC,GAAYC,CAAK;CACnD;;CAIA,OAGE,GACA,GACA,GACwB;EACxB,MAAMH,EAAmBC,GAAOC,GAAYC,CAAK;CACnD;;CAIA,YAGE,GACA,GACA,GACwB;EACxB,MAAMH,EAAmBC,GAAOC,GAAYC,CAAK;CACnD;;CAmBA,MAIE,GACA,GACA,GACiB;EACjB,MAAMH,EAAmBI,GAAQF,GAAYC,CAAK;CACpD;;CAwBA,KAGE,GACA,GACA,GACc;EACd,MAAMH,EAAmBK,GAAWH,GAAYC,CAAK;CACvD;;CAwBA,WAKE,GACA,GACA,GAC4B;EAC5B,MAAMH,EAAmBK,GAAWH,GAAYC,CAAK;CACvD;;CAwBA,UAGE,GACA,GACA,GACc;EACd,MAAMH,EAAmBK,GAAWH,GAAYC,CAAK;CACvD;;CAwBA,gBAGE,GACA,GACA,GAC4B;EAC5B,MAAMH,EAAmBK,GAAWH,GAAYC,CAAK;CACvD;;CA0BA,MAGE,GACA,GACA,GACuB;EACvB,MAAMH,EAAmBM,GAAYJ,GAAYC,CAAK;CACxD;;CAyBA,WAGE,GACA,GACA,GACuB;EACvB,MAAMH,EAAmBM,GAAYJ,GAAYC,CAAK;CACxD;;CAsBA,OAGE,GACA,GACA,GACY;EACZ,MAAMH,EAAmBO,GAAaL,GAAYC,CAAK;CACzD;;CAsBA,YAGE,GACA,GACA,GACY;EACZ,MAAMH,EAAmBO,GAAaL,GAAYC,CAAK;CACzD;;CAmBA,QACE,GACA,GACA,GACkC;EAClC,IAAMF,IAAQM,EAAoB,EAAE,QAAQH,EAAO,YAAYI,CAAE,EAAE,CAAC;EACpE,OAAO,KAAK,OAAOP,GAAOC,GAAYC,CAAK;CAC7C;CAkBA,aACE,GACA,GACA,GACY;EACZ,IAAMF,IAAQM,EAAoB,EAAE,QAAQH,EAAO,YAAYI,CAAE,EAAE,CAAC;EACpE,OAAO,KAAK,YAAYP,GAAOC,GAAYC,CAAK;CAClD;CAyBA,SACE,GACA,GACA,GACoC;EACpC,IAAIM,EAAI,WAAW,GAAG,OAAO,QAAQ,QAAQ,CAAC,CAAC;EAC/C,IAAMR,IAAQI,EAAkB;GAC9B,QAAQD,EAAO,aAAaK,CAAG;GAC/B,OAAOA,EAAI;EACb,CAAC;EACD,OAAO,KAAK,KAAKR,GAAOC,GAAYC,CAAK;CAC3C;CAyBA,cACE,GACA,GACA,GACc;EACd,IAAIM,EAAI,WAAW,GAAG,OAAO,QAAQ,QAAQ,CAAC,CAAC;EAC/C,IAAMR,IAAQI,EAAkB;GAC9B,QAAQD,EAAO,aAAaK,CAAG;GAC/B,OAAOA,EAAI;EACb,CAAC;EACD,OAAO,KAAK,UAAUR,GAAOC,GAAYC,CAAK;CAChD;AACF;;CA3cGO,EAAKC,EAA2B,WAAW;CAMzCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CAQZH,EAAKC,EAA2B,aAAaG,CAAqB;CAMhEtB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CAQZH,EAAKC,EAA2B,MAAM;CAGpCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CAQZH,EAAKC,EAA2B,YAAY;CAG1CnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CAuBZH,EAAKC,EAA2B,KAAK;CAInCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA4BZH,EAAKC,EAA2B,IAAI;CAGlCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA4BZH,EAAKC,EAA2B,MAAMG,CAAqB;CAKzDtB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA4BZH,EAAKC,EAA2B,UAAU;CAGxCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA4BZH,EAAKC,EAA2B,YAAYG,CAAqB;CAG/DtB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA8BZH,EAAKC,EAA2B,KAAK;CAGnCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA6BZH,EAAKC,EAA2B,WAAW;CAGzCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA0BZH,EAAKC,EAA2B,MAAM;CAGpCnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;;CA0BZH,EAAKC,EAA2B,YAAY;CAG1CnB,EAAA,GAAAoB,EAAK,CAAA;CACLpB,EAAA,GAAAqB,EAAU,CAAA;;;;;;;;sCAvVd,IAAAtB,EAAA,CAAAwB,EAAI,GAAAtB,EAAA,qBAAA,CAAA,MAAA,CAAA,CAAA,GAAAI,CAAA"}
|