@ahoo-wang/wow-client 9.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +291 -0
- package/README.zh-CN.md +267 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js +6 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js +8 -0
- package/dist/client/bindMethods.cjs +2 -0
- package/dist/client/bindMethods.cjs.map +1 -0
- package/dist/client/bindMethods.d.cts +13 -0
- package/dist/client/bindMethods.d.ts +13 -0
- package/dist/client/bindMethods.es.js +19 -0
- package/dist/client/bindMethods.es.js.map +1 -0
- package/dist/client/command/commandClient.cjs +2 -0
- package/dist/client/command/commandClient.cjs.map +1 -0
- package/dist/client/command/commandClient.d.cts +67 -0
- package/dist/client/command/commandClient.d.ts +67 -0
- package/dist/client/command/commandClient.es.js +38 -0
- package/dist/client/command/commandClient.es.js.map +1 -0
- package/dist/client/command/commandHeaders.cjs +2 -0
- package/dist/client/command/commandHeaders.cjs.map +1 -0
- package/dist/client/command/commandHeaders.d.cts +75 -0
- package/dist/client/command/commandHeaders.d.ts +75 -0
- package/dist/client/command/commandHeaders.es.js +31 -0
- package/dist/client/command/commandHeaders.es.js.map +1 -0
- package/dist/client/command/commandRequest.cjs +2 -0
- package/dist/client/command/commandRequest.cjs.map +1 -0
- package/dist/client/command/commandRequest.d.cts +180 -0
- package/dist/client/command/commandRequest.d.ts +180 -0
- package/dist/client/command/commandRequest.es.js +31 -0
- package/dist/client/command/commandRequest.es.js.map +1 -0
- package/dist/client/command/commandResult.d.cts +15 -0
- package/dist/client/command/commandResult.d.ts +15 -0
- package/dist/client/command/index.d.cts +5 -0
- package/dist/client/command/index.d.ts +5 -0
- package/dist/client/command/types.d.cts +71 -0
- package/dist/client/command/types.d.ts +71 -0
- package/dist/client/metadata/index.d.cts +2 -0
- package/dist/client/metadata/index.d.ts +2 -0
- package/dist/client/metadata/wowMetadata.d.cts +48 -0
- package/dist/client/metadata/wowMetadata.d.ts +48 -0
- package/dist/client/metadata/wowMetadataClient.cjs +2 -0
- package/dist/client/metadata/wowMetadataClient.cjs.map +1 -0
- package/dist/client/metadata/wowMetadataClient.d.cts +23 -0
- package/dist/client/metadata/wowMetadataClient.d.ts +23 -0
- package/dist/client/metadata/wowMetadataClient.es.js +25 -0
- package/dist/client/metadata/wowMetadataClient.es.js.map +1 -0
- package/dist/client/query/descriptor/descriptorEndpoints.cjs +2 -0
- package/dist/client/query/descriptor/descriptorEndpoints.cjs.map +1 -0
- package/dist/client/query/descriptor/descriptorEndpoints.d.cts +29 -0
- package/dist/client/query/descriptor/descriptorEndpoints.d.ts +29 -0
- package/dist/client/query/descriptor/descriptorEndpoints.es.js +69 -0
- package/dist/client/query/descriptor/descriptorEndpoints.es.js.map +1 -0
- package/dist/client/query/descriptor/endpointPaths.cjs +2 -0
- package/dist/client/query/descriptor/endpointPaths.cjs.map +1 -0
- package/dist/client/query/descriptor/endpointPaths.d.cts +4 -0
- package/dist/client/query/descriptor/endpointPaths.d.ts +4 -0
- package/dist/client/query/descriptor/endpointPaths.es.js +9 -0
- package/dist/client/query/descriptor/endpointPaths.es.js.map +1 -0
- package/dist/client/query/descriptor/index.d.cts +2 -0
- package/dist/client/query/descriptor/index.d.ts +2 -0
- package/dist/client/query/descriptor/queryDescriptorApi.d.cts +58 -0
- package/dist/client/query/descriptor/queryDescriptorApi.d.ts +58 -0
- package/dist/client/query/descriptor/queryDescriptorClient.cjs +2 -0
- package/dist/client/query/descriptor/queryDescriptorClient.cjs.map +1 -0
- package/dist/client/query/descriptor/queryDescriptorClient.d.cts +61 -0
- package/dist/client/query/descriptor/queryDescriptorClient.d.ts +61 -0
- package/dist/client/query/descriptor/queryDescriptorClient.es.js +20 -0
- package/dist/client/query/descriptor/queryDescriptorClient.es.js.map +1 -0
- package/dist/client/query/event/domainEventStream.cjs +2 -0
- package/dist/client/query/event/domainEventStream.cjs.map +1 -0
- package/dist/client/query/event/domainEventStream.d.cts +105 -0
- package/dist/client/query/event/domainEventStream.d.ts +105 -0
- package/dist/client/query/event/domainEventStream.es.js +23 -0
- package/dist/client/query/event/domainEventStream.es.js.map +1 -0
- package/dist/client/query/event/endpointPaths.cjs +2 -0
- package/dist/client/query/event/endpointPaths.cjs.map +1 -0
- package/dist/client/query/event/endpointPaths.d.cts +8 -0
- package/dist/client/query/event/endpointPaths.d.ts +8 -0
- package/dist/client/query/event/endpointPaths.es.js +13 -0
- package/dist/client/query/event/endpointPaths.es.js.map +1 -0
- package/dist/client/query/event/eventStreamQueryApi.d.cts +29 -0
- package/dist/client/query/event/eventStreamQueryApi.d.ts +29 -0
- package/dist/client/query/event/eventStreamQueryClient.cjs +2 -0
- package/dist/client/query/event/eventStreamQueryClient.cjs.map +1 -0
- package/dist/client/query/event/eventStreamQueryClient.d.cts +190 -0
- package/dist/client/query/event/eventStreamQueryClient.d.ts +190 -0
- package/dist/client/query/event/eventStreamQueryClient.es.js +160 -0
- package/dist/client/query/event/eventStreamQueryClient.es.js.map +1 -0
- package/dist/client/query/event/index.d.cts +3 -0
- package/dist/client/query/event/index.d.ts +3 -0
- package/dist/client/query/factory.cjs +2 -0
- package/dist/client/query/factory.cjs.map +1 -0
- package/dist/client/query/factory.d.cts +165 -0
- package/dist/client/query/factory.d.ts +165 -0
- package/dist/client/query/factory.es.js +45 -0
- package/dist/client/query/factory.es.js.map +1 -0
- package/dist/client/query/index.d.cts +6 -0
- package/dist/client/query/index.d.ts +6 -0
- package/dist/client/query/queryApi.d.cts +68 -0
- package/dist/client/query/queryApi.d.ts +68 -0
- package/dist/client/query/requests.d.cts +24 -0
- package/dist/client/query/requests.d.ts +24 -0
- package/dist/client/query/snapshot/endpointPaths.cjs +2 -0
- package/dist/client/query/snapshot/endpointPaths.cjs.map +1 -0
- package/dist/client/query/snapshot/endpointPaths.d.cts +12 -0
- package/dist/client/query/snapshot/endpointPaths.d.ts +12 -0
- package/dist/client/query/snapshot/endpointPaths.es.js +17 -0
- package/dist/client/query/snapshot/endpointPaths.es.js.map +1 -0
- package/dist/client/query/snapshot/index.d.cts +3 -0
- package/dist/client/query/snapshot/index.d.ts +3 -0
- package/dist/client/query/snapshot/snapshot.cjs +2 -0
- package/dist/client/query/snapshot/snapshot.cjs.map +1 -0
- package/dist/client/query/snapshot/snapshot.d.cts +51 -0
- package/dist/client/query/snapshot/snapshot.d.ts +51 -0
- package/dist/client/query/snapshot/snapshot.es.js +20 -0
- package/dist/client/query/snapshot/snapshot.es.js.map +1 -0
- package/dist/client/query/snapshot/snapshotQueryApi.d.cts +101 -0
- package/dist/client/query/snapshot/snapshotQueryApi.d.ts +101 -0
- package/dist/client/query/snapshot/snapshotQueryClient.cjs +2 -0
- package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +1 -0
- package/dist/client/query/snapshot/snapshotQueryClient.d.cts +369 -0
- package/dist/client/query/snapshot/snapshotQueryClient.d.ts +369 -0
- package/dist/client/query/snapshot/snapshotQueryClient.es.js +239 -0
- package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +1 -0
- package/dist/client/query/state/endpointPaths.cjs +2 -0
- package/dist/client/query/state/endpointPaths.cjs.map +1 -0
- package/dist/client/query/state/endpointPaths.d.cts +10 -0
- package/dist/client/query/state/endpointPaths.d.ts +10 -0
- package/dist/client/query/state/endpointPaths.es.js +14 -0
- package/dist/client/query/state/endpointPaths.es.js.map +1 -0
- package/dist/client/query/state/index.d.cts +4 -0
- package/dist/client/query/state/index.d.ts +4 -0
- package/dist/client/query/state/loadOwnerStateAggregateApi.d.cts +36 -0
- package/dist/client/query/state/loadOwnerStateAggregateApi.d.ts +36 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +2 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.cjs.map +1 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.d.cts +58 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.d.ts +58 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +56 -0
- package/dist/client/query/state/loadOwnerStateAggregateClient.es.js.map +1 -0
- package/dist/client/query/state/loadStateAggregateApi.d.cts +37 -0
- package/dist/client/query/state/loadStateAggregateApi.d.ts +37 -0
- package/dist/client/query/state/loadStateAggregateClient.cjs +2 -0
- package/dist/client/query/state/loadStateAggregateClient.cjs.map +1 -0
- package/dist/client/query/state/loadStateAggregateClient.d.cts +62 -0
- package/dist/client/query/state/loadStateAggregateClient.d.ts +62 -0
- package/dist/client/query/state/loadStateAggregateClient.es.js +65 -0
- package/dist/client/query/state/loadStateAggregateClient.es.js.map +1 -0
- package/dist/client/routing.cjs +2 -0
- package/dist/client/routing.cjs.map +1 -0
- package/dist/client/routing.d.cts +47 -0
- package/dist/client/routing.d.ts +47 -0
- package/dist/client/routing.es.js +8 -0
- package/dist/client/routing.es.js.map +1 -0
- package/dist/dsl/aggregation/admit.cjs +2 -0
- package/dist/dsl/aggregation/admit.cjs.map +1 -0
- package/dist/dsl/aggregation/admit.d.cts +6 -0
- package/dist/dsl/aggregation/admit.d.ts +6 -0
- package/dist/dsl/aggregation/admit.es.js +142 -0
- package/dist/dsl/aggregation/admit.es.js.map +1 -0
- package/dist/dsl/aggregation/builders.cjs +2 -0
- package/dist/dsl/aggregation/builders.cjs.map +1 -0
- package/dist/dsl/aggregation/builders.d.cts +309 -0
- package/dist/dsl/aggregation/builders.d.ts +309 -0
- package/dist/dsl/aggregation/builders.es.js +188 -0
- package/dist/dsl/aggregation/builders.es.js.map +1 -0
- package/dist/dsl/aggregation/derived.cjs +2 -0
- package/dist/dsl/aggregation/derived.cjs.map +1 -0
- package/dist/dsl/aggregation/derived.d.cts +33 -0
- package/dist/dsl/aggregation/derived.d.ts +33 -0
- package/dist/dsl/aggregation/derived.es.js +31 -0
- package/dist/dsl/aggregation/derived.es.js.map +1 -0
- package/dist/dsl/aggregation/expressionTrees.cjs +2 -0
- package/dist/dsl/aggregation/expressionTrees.cjs.map +1 -0
- package/dist/dsl/aggregation/expressionTrees.d.cts +10 -0
- package/dist/dsl/aggregation/expressionTrees.d.ts +10 -0
- package/dist/dsl/aggregation/expressionTrees.es.js +44 -0
- package/dist/dsl/aggregation/expressionTrees.es.js.map +1 -0
- package/dist/dsl/aggregation/having.cjs +2 -0
- package/dist/dsl/aggregation/having.cjs.map +1 -0
- package/dist/dsl/aggregation/having.d.cts +94 -0
- package/dist/dsl/aggregation/having.d.ts +94 -0
- package/dist/dsl/aggregation/having.es.js +62 -0
- package/dist/dsl/aggregation/having.es.js.map +1 -0
- package/dist/dsl/aggregation/index.d.cts +4 -0
- package/dist/dsl/aggregation/index.d.ts +4 -0
- package/dist/dsl/aggregation/sort.cjs +2 -0
- package/dist/dsl/aggregation/sort.cjs.map +1 -0
- package/dist/dsl/aggregation/sort.d.cts +7 -0
- package/dist/dsl/aggregation/sort.d.ts +7 -0
- package/dist/dsl/aggregation/sort.es.js +10 -0
- package/dist/dsl/aggregation/sort.es.js.map +1 -0
- package/dist/dsl/aggregation/types.cjs +2 -0
- package/dist/dsl/aggregation/types.cjs.map +1 -0
- package/dist/dsl/aggregation/types.d.cts +608 -0
- package/dist/dsl/aggregation/types.d.ts +608 -0
- package/dist/dsl/aggregation/types.es.js +37 -0
- package/dist/dsl/aggregation/types.es.js.map +1 -0
- package/dist/dsl/cursorQuery.cjs +2 -0
- package/dist/dsl/cursorQuery.cjs.map +1 -0
- package/dist/dsl/cursorQuery.d.cts +69 -0
- package/dist/dsl/cursorQuery.d.ts +69 -0
- package/dist/dsl/cursorQuery.es.js +19 -0
- package/dist/dsl/cursorQuery.es.js.map +1 -0
- package/dist/dsl/deletionState.cjs +2 -0
- package/dist/dsl/deletionState.cjs.map +1 -0
- package/dist/dsl/deletionState.d.cts +19 -0
- package/dist/dsl/deletionState.d.ts +19 -0
- package/dist/dsl/deletionState.es.js +8 -0
- package/dist/dsl/deletionState.es.js.map +1 -0
- package/dist/dsl/descriptor.cjs +2 -0
- package/dist/dsl/descriptor.cjs.map +1 -0
- package/dist/dsl/descriptor.d.cts +629 -0
- package/dist/dsl/descriptor.d.ts +629 -0
- package/dist/dsl/descriptor.es.js +37 -0
- package/dist/dsl/descriptor.es.js.map +1 -0
- package/dist/dsl/documents.d.cts +8 -0
- package/dist/dsl/documents.d.ts +8 -0
- package/dist/dsl/field.cjs +2 -0
- package/dist/dsl/field.cjs.map +1 -0
- package/dist/dsl/field.d.cts +2 -0
- package/dist/dsl/field.d.ts +2 -0
- package/dist/dsl/field.es.js +10 -0
- package/dist/dsl/field.es.js.map +1 -0
- package/dist/dsl/filter/builders.cjs +2 -0
- package/dist/dsl/filter/builders.cjs.map +1 -0
- package/dist/dsl/filter/builders.d.cts +962 -0
- package/dist/dsl/filter/builders.d.ts +962 -0
- package/dist/dsl/filter/builders.es.js +289 -0
- package/dist/dsl/filter/builders.es.js.map +1 -0
- package/dist/dsl/filter/datePattern.cjs +2 -0
- package/dist/dsl/filter/datePattern.cjs.map +1 -0
- package/dist/dsl/filter/datePattern.d.cts +8 -0
- package/dist/dsl/filter/datePattern.d.ts +8 -0
- package/dist/dsl/filter/datePattern.es.js +100 -0
- package/dist/dsl/filter/datePattern.es.js.map +1 -0
- package/dist/dsl/filter/index.d.cts +3 -0
- package/dist/dsl/filter/index.d.ts +3 -0
- package/dist/dsl/filter/operator.cjs +2 -0
- package/dist/dsl/filter/operator.cjs.map +1 -0
- package/dist/dsl/filter/operator.d.cts +113 -0
- package/dist/dsl/filter/operator.d.ts +113 -0
- package/dist/dsl/filter/operator.es.js +14 -0
- package/dist/dsl/filter/operator.es.js.map +1 -0
- package/dist/dsl/filter/scope.cjs +2 -0
- package/dist/dsl/filter/scope.cjs.map +1 -0
- package/dist/dsl/filter/scope.d.cts +15 -0
- package/dist/dsl/filter/scope.d.ts +15 -0
- package/dist/dsl/filter/scope.es.js +32 -0
- package/dist/dsl/filter/scope.es.js.map +1 -0
- package/dist/dsl/filter/types.d.cts +274 -0
- package/dist/dsl/filter/types.d.ts +274 -0
- package/dist/dsl/filter/validate.cjs +2 -0
- package/dist/dsl/filter/validate.cjs.map +1 -0
- package/dist/dsl/filter/validate.d.cts +18 -0
- package/dist/dsl/filter/validate.d.ts +18 -0
- package/dist/dsl/filter/validate.es.js +56 -0
- package/dist/dsl/filter/validate.es.js.map +1 -0
- package/dist/dsl/pagination.cjs +2 -0
- package/dist/dsl/pagination.cjs.map +1 -0
- package/dist/dsl/pagination.d.cts +28 -0
- package/dist/dsl/pagination.d.ts +28 -0
- package/dist/dsl/pagination.es.js +15 -0
- package/dist/dsl/pagination.es.js.map +1 -0
- package/dist/dsl/projection.cjs +2 -0
- package/dist/dsl/projection.cjs.map +1 -0
- package/dist/dsl/projection.d.cts +27 -0
- package/dist/dsl/projection.d.ts +27 -0
- package/dist/dsl/projection.es.js +12 -0
- package/dist/dsl/projection.es.js.map +1 -0
- package/dist/dsl/queryable.cjs +2 -0
- package/dist/dsl/queryable.cjs.map +1 -0
- package/dist/dsl/queryable.d.cts +101 -0
- package/dist/dsl/queryable.d.ts +101 -0
- package/dist/dsl/queryable.es.js +40 -0
- package/dist/dsl/queryable.es.js.map +1 -0
- package/dist/dsl/sort.cjs +2 -0
- package/dist/dsl/sort.cjs.map +1 -0
- package/dist/dsl/sort.d.cts +33 -0
- package/dist/dsl/sort.d.ts +33 -0
- package/dist/dsl/sort.es.js +21 -0
- package/dist/dsl/sort.es.js.map +1 -0
- package/dist/dsl.cjs +1 -0
- package/dist/dsl.d.cts +23 -0
- package/dist/dsl.d.ts +23 -0
- package/dist/dsl.es.js +14 -0
- package/dist/error/errorInfo.cjs +2 -0
- package/dist/error/errorInfo.cjs.map +1 -0
- package/dist/error/errorInfo.d.cts +139 -0
- package/dist/error/errorInfo.d.ts +139 -0
- package/dist/error/errorInfo.es.js +32 -0
- package/dist/error/errorInfo.es.js.map +1 -0
- package/dist/error/headers.cjs +2 -0
- package/dist/error/headers.cjs.map +1 -0
- package/dist/error/headers.d.cts +38 -0
- package/dist/error/headers.d.ts +38 -0
- package/dist/error/headers.es.js +10 -0
- package/dist/error/headers.es.js.map +1 -0
- package/dist/error/index.d.cts +21 -0
- package/dist/error/index.d.ts +21 -0
- package/dist/error/queryErrorCodes.cjs +2 -0
- package/dist/error/queryErrorCodes.cjs.map +1 -0
- package/dist/error/queryErrorCodes.d.cts +199 -0
- package/dist/error/queryErrorCodes.d.ts +199 -0
- package/dist/error/queryErrorCodes.es.js +53 -0
- package/dist/error/queryErrorCodes.es.js.map +1 -0
- package/dist/error/wowError.cjs +2 -0
- package/dist/error/wowError.cjs.map +1 -0
- package/dist/error/wowError.d.cts +99 -0
- package/dist/error/wowError.d.ts +99 -0
- package/dist/error/wowError.es.js +53 -0
- package/dist/error/wowError.es.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.es.js +34 -0
- package/dist/legacy/condition.cjs +2 -0
- package/dist/legacy/condition.cjs.map +1 -0
- package/dist/legacy/condition.d.cts +517 -0
- package/dist/legacy/condition.d.ts +517 -0
- package/dist/legacy/condition.es.js +338 -0
- package/dist/legacy/condition.es.js.map +1 -0
- package/dist/legacy/index.d.cts +16 -0
- package/dist/legacy/index.d.ts +16 -0
- package/dist/legacy/locale/en_US.cjs +2 -0
- package/dist/legacy/locale/en_US.cjs.map +1 -0
- package/dist/legacy/locale/en_US.d.cts +7 -0
- package/dist/legacy/locale/en_US.d.ts +7 -0
- package/dist/legacy/locale/en_US.es.js +50 -0
- package/dist/legacy/locale/en_US.es.js.map +1 -0
- package/dist/legacy/locale/operatorLocale.d.cts +10 -0
- package/dist/legacy/locale/operatorLocale.d.ts +10 -0
- package/dist/legacy/locale/zh_CN.cjs +2 -0
- package/dist/legacy/locale/zh_CN.cjs.map +1 -0
- package/dist/legacy/locale/zh_CN.d.cts +7 -0
- package/dist/legacy/locale/zh_CN.d.ts +7 -0
- package/dist/legacy/locale/zh_CN.es.js +50 -0
- package/dist/legacy/locale/zh_CN.es.js.map +1 -0
- package/dist/legacy/operator.cjs +2 -0
- package/dist/legacy/operator.cjs.map +1 -0
- package/dist/legacy/operator.d.cts +218 -0
- package/dist/legacy/operator.d.ts +218 -0
- package/dist/legacy/operator.es.js +25 -0
- package/dist/legacy/operator.es.js.map +1 -0
- package/dist/legacy/queryable.cjs +2 -0
- package/dist/legacy/queryable.cjs.map +1 -0
- package/dist/legacy/queryable.d.cts +61 -0
- package/dist/legacy/queryable.d.ts +61 -0
- package/dist/legacy/queryable.es.js +34 -0
- package/dist/legacy/queryable.es.js.map +1 -0
- package/dist/legacy.cjs +1 -0
- package/dist/legacy.es.js +6 -0
- package/dist/model/abac.cjs +2 -0
- package/dist/model/abac.cjs.map +1 -0
- package/dist/model/abac.d.cts +33 -0
- package/dist/model/abac.d.ts +33 -0
- package/dist/model/abac.es.js +6 -0
- package/dist/model/abac.es.js.map +1 -0
- package/dist/model/bi.cjs +2 -0
- package/dist/model/bi.cjs.map +1 -0
- package/dist/model/bi.d.cts +12 -0
- package/dist/model/bi.d.ts +12 -0
- package/dist/model/bi.es.js +8 -0
- package/dist/model/bi.es.js.map +1 -0
- package/dist/model/command.cjs +2 -0
- package/dist/model/command.cjs.map +1 -0
- package/dist/model/command.d.cts +137 -0
- package/dist/model/command.d.ts +137 -0
- package/dist/model/command.es.js +8 -0
- package/dist/model/command.es.js.map +1 -0
- package/dist/model/common.d.cts +19 -0
- package/dist/model/common.d.ts +19 -0
- package/dist/model/function.cjs +2 -0
- package/dist/model/function.cjs.map +1 -0
- package/dist/model/function.d.cts +41 -0
- package/dist/model/function.d.ts +41 -0
- package/dist/model/function.es.js +8 -0
- package/dist/model/function.es.js.map +1 -0
- package/dist/model/index.d.cts +22 -0
- package/dist/model/index.d.ts +22 -0
- package/dist/model/messaging.d.cts +5 -0
- package/dist/model/messaging.d.ts +5 -0
- package/dist/model/modeling.d.cts +145 -0
- package/dist/model/modeling.d.ts +145 -0
- package/dist/model/naming.d.cts +27 -0
- package/dist/model/naming.d.ts +27 -0
- package/dist/transport/endpoints.cjs +2 -0
- package/dist/transport/endpoints.cjs.map +1 -0
- package/dist/transport/endpoints.d.cts +79 -0
- package/dist/transport/endpoints.d.ts +79 -0
- package/dist/transport/endpoints.es.js +14 -0
- package/dist/transport/endpoints.es.js.map +1 -0
- package/dist/transport/eventStreams.cjs +2 -0
- package/dist/transport/eventStreams.cjs.map +1 -0
- package/dist/transport/eventStreams.d.cts +23 -0
- package/dist/transport/eventStreams.d.ts +23 -0
- package/dist/transport/eventStreams.es.js +22 -0
- package/dist/transport/eventStreams.es.js.map +1 -0
- package/dist/transport/index.d.cts +1 -0
- package/dist/transport/index.d.ts +1 -0
- package/package.json +110 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandRequest.es.js","names":["STAGES","CommandStage","stageName","stage","label","integer","value","minimum","put","name","commandHeaders","headers","CommandHeaders","options","waitStrategy"],"sources":["../../../src/client/command/commandRequest.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 { RequestHeaders, UrlParams } from '@ahoo-wang/fetcher';\nimport { CommandHeaders } from './commandHeaders.js';\nimport type { UrlPathParams } from '../routing.js';\nimport type { ParameterRequest } from '@ahoo-wang/fetcher-decorator';\nimport { CommandStage } from '../../model/index.js';\nimport type { CommandBody } from './types.js';\n\n/** A command stage, as the enum member or as its name. */\nexport type CommandStageName = CommandStage | `${CommandStage}`;\n\n/**\n * The headers of a command request.\n *\n * Every command header is optional and typed by what the server parses:\n * a stage is a {@link CommandStage}, a version or a timeout is an integer,\n * `Local-First` is a boolean. Any other header (`Authorization`, a\n * `Command-Header-*` extension, …) is still allowed as a string. Build these\n * with {@link commandHeaders} and {@link waitStrategy} rather than by hand.\n *\n * @example\n * ```typescript\n * const headers: CommandRequestHeaders = {\n * ...commandHeaders({ ownerId: 'user-1', requestId }),\n * ...waitStrategy({ stage: CommandStage.SNAPSHOT, timeoutMs: 10_000 }),\n * };\n * ```\n */\nexport interface CommandRequestHeaders extends RequestHeaders {\n /** Tenant of the command, when the route has no tenant path segment */\n [CommandHeaders.TENANT_ID]?: string;\n /** Owner of the command, when the route has no owner path segment */\n [CommandHeaders.OWNER_ID]?: string;\n /** Space of the command, `Wow-Space-Id` */\n [CommandHeaders.SPACE_ID]?: string;\n /** Aggregate the command targets, when the route has no id path segment */\n [CommandHeaders.AGGREGATE_ID]?: string;\n /** The aggregate version the command expects, an integer */\n [CommandHeaders.AGGREGATE_VERSION]?: `${number}`;\n /** How long the server waits, in whole milliseconds */\n [CommandHeaders.WAIT_TIME_OUT]?: `${number}`;\n /** The stage to wait for; `PROCESSED` when absent */\n [CommandHeaders.WAIT_STAGE]?: CommandStageName;\n /** The bounded context the wait stage refers to */\n [CommandHeaders.WAIT_CONTEXT]?: string;\n /** The processor the wait stage refers to */\n [CommandHeaders.WAIT_PROCESSOR]?: string;\n /** The function the wait stage refers to */\n [CommandHeaders.WAIT_FUNCTION]?: string;\n /** The stage of the wait-chain tail; only with a `SAGA_HANDLED` wait stage */\n [CommandHeaders.WAIT_TAIL_STAGE]?: CommandStageName;\n /** The bounded context of the wait-chain tail */\n [CommandHeaders.WAIT_TAIL_CONTEXT]?: string;\n /** The processor of the wait-chain tail */\n [CommandHeaders.WAIT_TAIL_PROCESSOR]?: string;\n /** The function of the wait-chain tail */\n [CommandHeaders.WAIT_TAIL_FUNCTION]?: string;\n /** Idempotency key of the command */\n [CommandHeaders.REQUEST_ID]?: string;\n /** Whether the server may process the command locally */\n [CommandHeaders.LOCAL_FIRST]?: 'true' | 'false';\n /** Bounded context of the aggregate, for `/wow/command/send` */\n [CommandHeaders.COMMAND_AGGREGATE_CONTEXT]?: string;\n /** Name of the aggregate, for `/wow/command/send` */\n [CommandHeaders.COMMAND_AGGREGATE_NAME]?: string;\n /** Fully qualified command type, for `/wow/command/send` */\n [CommandHeaders.COMMAND_TYPE]?: string;\n}\n\n/** Who a command is for; each option sets one command header. */\nexport interface CommandHeaderOptions {\n /** The tenant, `Command-Tenant-Id`; for a route without a tenant segment. */\n tenantId?: string;\n /** The owner, `Command-Owner-Id`; for a route without an owner segment. */\n ownerId?: string;\n /**\n * The space, `Wow-Space-Id`; the tenant's default space when absent. Only a\n * spaced aggregate reads it.\n */\n spaceId?: string;\n /**\n * The target aggregate, `Command-Aggregate-Id`; for a route without an id\n * segment.\n */\n aggregateId?: string;\n /** The aggregate version the command expects: a non-negative integer. */\n aggregateVersion?: number;\n /** Idempotency key; the server refuses a repeated one. */\n requestId?: string;\n /**\n * Whether the server may process the command in its own process when it\n * hosts the aggregate, `Command-Local-First`; it does unless this is `false`.\n */\n localFirst?: boolean;\n}\n\n/** The processing a wait stage refers to; blank means any. */\nexport interface WaitFunction {\n context?: string;\n processor?: string;\n function?: string;\n}\n\n/** Wait for one stage of the command. */\nexport interface WaitStageOptions extends WaitFunction {\n /** The stage to wait for. The server waits for `PROCESSED` when absent. */\n stage?: CommandStageName;\n /** How long the server waits, in whole milliseconds. */\n timeoutMs?: number;\n tail?: never;\n}\n\n/**\n * Wait for a saga to handle the command's events, and then for the command\n * that saga sends to reach `tail.stage` — Wow's wait chain.\n */\nexport interface WaitChainOptions extends WaitFunction {\n stage: CommandStage.SAGA_HANDLED | 'SAGA_HANDLED';\n tail: WaitFunction & { stage: CommandStageName };\n /** How long the server waits, in whole milliseconds. */\n timeoutMs?: number;\n}\n\n/** What {@link waitStrategy} takes: one stage, or a wait chain. */\nexport type WaitStrategyOptions = WaitStageOptions | WaitChainOptions;\n\nconst STAGES: ReadonlySet<string> = new Set(Object.values(CommandStage));\n\nfunction stageName(label: string, stage: string): CommandStageName {\n if (!STAGES.has(stage)) {\n throw new TypeError(\n `${label} must be one of ${[...STAGES].join(', ')}, got [${stage}].`,\n );\n }\n return stage as CommandStageName;\n}\n\nfunction integer(label: string, value: number, minimum: number): `${number}` {\n if (!Number.isSafeInteger(value) || value < minimum) {\n throw new TypeError(\n `${label} must be an integer of at least ${minimum}, got [${value}].`,\n );\n }\n return `${value}`;\n}\n\nfunction put(\n headers: CommandRequestHeaders,\n name: keyof CommandRequestHeaders,\n value: string | undefined,\n): void {\n if (value !== undefined) headers[name] = value as never;\n}\n\n/**\n * Builds the headers that say who a command is for. Options left out send\n * no header.\n *\n * @throws TypeError when `aggregateVersion` is not a non-negative integer.\n *\n * @example\n * ```typescript\n * await commandClient.send({\n * path: 'owner/{ownerId}/cart/add_cart_item',\n * method: 'POST',\n * headers: commandHeaders({ spaceId: 'store-1', requestId: crypto.randomUUID() }),\n * body: { productId: 'p-1', quantity: 1 },\n * });\n * ```\n */\nexport function commandHeaders(\n options: CommandHeaderOptions,\n): CommandRequestHeaders {\n const headers: CommandRequestHeaders = {};\n put(headers, CommandHeaders.TENANT_ID, options.tenantId);\n put(headers, CommandHeaders.OWNER_ID, options.ownerId);\n put(headers, CommandHeaders.SPACE_ID, options.spaceId);\n put(headers, CommandHeaders.AGGREGATE_ID, options.aggregateId);\n if (options.aggregateVersion !== undefined) {\n headers[CommandHeaders.AGGREGATE_VERSION] = integer(\n 'aggregateVersion',\n options.aggregateVersion,\n 0,\n );\n }\n put(headers, CommandHeaders.REQUEST_ID, options.requestId);\n if (options.localFirst !== undefined) {\n headers[CommandHeaders.LOCAL_FIRST] = options.localFirst ? 'true' : 'false';\n }\n return headers;\n}\n\n/**\n * Builds the headers that say how long, and for what, the server waits\n * before it answers a command — Kotlin's `WaitingFor`. Options left out send\n * no header, and the server's defaults apply: `PROCESSED` in the command's own\n * bounded context.\n *\n * @throws TypeError when a stage is not a `CommandStage`, when `timeoutMs` is\n * not a positive integer, or when a `tail` is given with a stage other than\n * `SAGA_HANDLED` (the server ignores the tail then).\n *\n * @example\n * ```typescript\n * // Answer once the snapshot is written, or after five seconds.\n * waitStrategy({ stage: CommandStage.SNAPSHOT, timeoutMs: 5_000 });\n *\n * // Answer once the saga's command has been processed.\n * waitStrategy({\n * stage: 'SAGA_HANDLED',\n * processor: 'TransferSaga',\n * tail: { stage: 'PROCESSED', context: 'account' },\n * });\n * ```\n */\nexport function waitStrategy(\n options: WaitStrategyOptions,\n): CommandRequestHeaders {\n const headers: CommandRequestHeaders = {};\n if (options.stage !== undefined) {\n headers[CommandHeaders.WAIT_STAGE] = stageName('stage', options.stage);\n }\n put(headers, CommandHeaders.WAIT_CONTEXT, options.context);\n put(headers, CommandHeaders.WAIT_PROCESSOR, options.processor);\n put(headers, CommandHeaders.WAIT_FUNCTION, options.function);\n if (options.tail !== undefined) {\n if (options.stage !== CommandStage.SAGA_HANDLED) {\n throw new TypeError('A wait tail needs the SAGA_HANDLED stage.');\n }\n headers[CommandHeaders.WAIT_TAIL_STAGE] = stageName(\n 'tail.stage',\n options.tail.stage,\n );\n put(headers, CommandHeaders.WAIT_TAIL_CONTEXT, options.tail.context);\n put(headers, CommandHeaders.WAIT_TAIL_PROCESSOR, options.tail.processor);\n put(headers, CommandHeaders.WAIT_TAIL_FUNCTION, options.tail.function);\n }\n if (options.timeoutMs !== undefined) {\n headers[CommandHeaders.WAIT_TIME_OUT] = integer(\n 'timeoutMs',\n options.timeoutMs,\n 1,\n );\n }\n return headers;\n}\n\n/**\n * The URL parameters of a {@link CommandRequest}: the values of the route's\n * path variables. A command takes no query string.\n */\nexport interface CommandUrlParams extends Omit<UrlParams, 'path' | 'query'> {\n /** The path variables, such as `{ ownerId, id }`. */\n path?: UrlPathParams;\n}\n\n/**\n * A command request: the path of the command route, its URL parameters, its\n * typed headers and its body.\n */\nexport interface CommandRequest<\n C extends object = object,\n> extends ParameterRequest<CommandBody<C>> {\n urlParams?: CommandUrlParams;\n headers?: CommandRequestHeaders;\n /**\n * The body of the command request.\n */\n body?: CommandBody<C>;\n}\n"],"mappings":";;;AA0IA,IAAMA,IAA8B,IAAI,IAAI,OAAO,OAAOC,CAAY,CAAC;AAEvE,SAASC,EAAU,GAAe,GAAiC;CACjE,IAAI,CAACF,EAAO,IAAIG,CAAK,GACnB,MAAU,UACR,GAAGC,EAAM,kBAAkB,CAAC,GAAGJ,CAAM,CAAC,CAAC,KAAK,IAAI,EAAE,SAASG,EAAM,GACnE;CAEF,OAAOA;AACT;AAEA,SAASE,EAAQ,GAAe,GAAe,GAA8B;CAC3E,IAAI,CAAC,OAAO,cAAcC,CAAK,KAAKA,IAAQC,GAC1C,MAAU,UACR,GAAGH,EAAM,kCAAkCG,EAAQ,SAASD,EAAM,GACpE;CAEF,OAAO,GAAGA;AACZ;AAEA,SAASE,EACP,GACA,GACA,GACM;CACN,AAAIF,MAAU,KAAA,MAAW,EAAQG,KAAQH;AAC3C;AAkBA,SAAgBI,EACd,GACuB;CACvB,IAAMC,IAAiC,CAAC;CAgBxC,OAfAH,EAAIG,GAASC,EAAe,WAAWC,EAAQ,QAAQ,GACvDL,EAAIG,GAASC,EAAe,UAAUC,EAAQ,OAAO,GACrDL,EAAIG,GAASC,EAAe,UAAUC,EAAQ,OAAO,GACrDL,EAAIG,GAASC,EAAe,cAAcC,EAAQ,WAAW,GACzDA,EAAQ,qBAAqB,KAAA,MAC/B,EAAQD,EAAe,qBAAqBP,EAC1C,oBACAQ,EAAQ,kBACR,CACF,IAEFL,EAAIG,GAASC,EAAe,YAAYC,EAAQ,SAAS,GACrDA,EAAQ,eAAe,KAAA,MACzB,EAAQD,EAAe,eAAeC,EAAQ,aAAa,SAAS,UAE/DF;AACT;AAyBA,SAAgBG,EACd,GACuB;CACvB,IAAMH,IAAiC,CAAC;CAOxC,IANIE,EAAQ,UAAU,KAAA,MACpB,EAAQD,EAAe,cAAcV,EAAU,SAASW,EAAQ,KAAK,IAEvEL,EAAIG,GAASC,EAAe,cAAcC,EAAQ,OAAO,GACzDL,EAAIG,GAASC,EAAe,gBAAgBC,EAAQ,SAAS,GAC7DL,EAAIG,GAASC,EAAe,eAAeC,EAAQ,QAAQ,GACvDA,EAAQ,SAAS,KAAA,GAAW;EAC9B,IAAIA,EAAQ,UAAUZ,EAAa,cACjC,MAAU,UAAU,2CAA2C;EAQjE,AANA,EAAQW,EAAe,mBAAmBV,EACxC,cACAW,EAAQ,KAAK,KACf,GACAL,EAAIG,GAASC,EAAe,mBAAmBC,EAAQ,KAAK,OAAO,GACnEL,EAAIG,GAASC,EAAe,qBAAqBC,EAAQ,KAAK,SAAS,GACvEL,EAAIG,GAASC,EAAe,oBAAoBC,EAAQ,KAAK,QAAQ;CACvE;CAQA,OAPIA,EAAQ,cAAc,KAAA,MACxB,EAAQD,EAAe,iBAAiBP,EACtC,aACAQ,EAAQ,WACR,CACF,IAEKF;AACT"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommandResult } from '../../model/index.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* The stream `sendAndWaitStream` answers: one command result per stage the
|
|
4
|
+
* command reached, in order. It errors with a `WowError` when the server
|
|
5
|
+
* fails midway, so a `for await` over it throws.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* declare const stream: CommandResultEventStream;
|
|
10
|
+
* for await (const result of stream) {
|
|
11
|
+
* console.log(result.stage, result.errorCode);
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type CommandResultEventStream = ReadableStream<CommandResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CommandResult } from '../../model/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The stream `sendAndWaitStream` answers: one command result per stage the
|
|
4
|
+
* command reached, in order. It errors with a `WowError` when the server
|
|
5
|
+
* fails midway, so a `for await` over it throws.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* declare const stream: CommandResultEventStream;
|
|
10
|
+
* for await (const result of stream) {
|
|
11
|
+
* console.log(result.stage, result.errorCode);
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type CommandResultEventStream = ReadableStream<CommandResult>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ErrorInfo } from '../../error/index.cjs';
|
|
2
|
+
import { ApplyAbacTags, FunctionInfoCapable, Identifier } from '../../model/index.cjs';
|
|
3
|
+
import { PartialBy, RemoveReadonlyFields } from '@ahoo-wang/fetcher';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a target for compensation operations.
|
|
6
|
+
*
|
|
7
|
+
* This interface extends Identifier (with optional id) and FunctionInfoCapable to define
|
|
8
|
+
* the structure for objects that can be targeted for compensation operations. Compensation
|
|
9
|
+
* targets typically represent entities that can have operations reversed or corrected.
|
|
10
|
+
*/
|
|
11
|
+
export interface CompensationTarget extends PartialBy<Identifier, 'id'>, FunctionInfoCapable {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents a command to delete an aggregate.
|
|
15
|
+
*
|
|
16
|
+
* This interface defines the structure for commands that request the deletion of an aggregate.
|
|
17
|
+
* It is typically used in conjunction with other command interfaces to provide a complete
|
|
18
|
+
* command processing workflow.
|
|
19
|
+
*/
|
|
20
|
+
export interface DeleteAggregate {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The body a client sends for command `C`: its writable fields, with the
|
|
24
|
+
* `readonly` ones left out. `CommandRequest` and the generated command
|
|
25
|
+
* clients type their bodies with it.
|
|
26
|
+
*/
|
|
27
|
+
export type CommandBody<C> = RemoveReadonlyFields<C>;
|
|
28
|
+
/**
|
|
29
|
+
* The body of Wow's built-in delete command, sent with `DELETE` to the
|
|
30
|
+
* aggregate's route.
|
|
31
|
+
*/
|
|
32
|
+
export type DeleteAggregateCommand = CommandBody<DeleteAggregate>;
|
|
33
|
+
/**
|
|
34
|
+
* Represents a command to recover an aggregate.
|
|
35
|
+
*
|
|
36
|
+
* This interface defines the structure for commands that request the recovery of an aggregate,
|
|
37
|
+
* typically used in scenarios where an aggregate needs to be restored to a previous state
|
|
38
|
+
* or recovered from an error condition.
|
|
39
|
+
*/
|
|
40
|
+
export interface RecoverAggregate {
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The body of Wow's built-in recover command, which restores a deleted
|
|
44
|
+
* aggregate; sent with `PUT` to the aggregate's `recover` route.
|
|
45
|
+
*/
|
|
46
|
+
export type RecoverAggregateCommand = CommandBody<RecoverAggregate>;
|
|
47
|
+
/**
|
|
48
|
+
* Wow's built-in command that applies ABAC tags to an aggregate, sent with
|
|
49
|
+
* `PUT` to the aggregate's `tags` route; the server refuses a blank tag key.
|
|
50
|
+
*/
|
|
51
|
+
export interface ApplyResourceTags extends ApplyAbacTags {
|
|
52
|
+
}
|
|
53
|
+
/** The body of {@link ApplyResourceTags}. */
|
|
54
|
+
export type ApplyResourceTagsCommand = CommandBody<ApplyResourceTags>;
|
|
55
|
+
/**
|
|
56
|
+
* Represents the result of a batch operation, containing information about
|
|
57
|
+
* the pagination and error status of the operation.
|
|
58
|
+
*
|
|
59
|
+
* Extends ErrorInfo to include error details if the batch operation failed.
|
|
60
|
+
*/
|
|
61
|
+
export interface BatchResult extends ErrorInfo {
|
|
62
|
+
/**
|
|
63
|
+
* The cursor or identifier for the next item after the current batch.
|
|
64
|
+
* Used for pagination to continue fetching the next batch of items.
|
|
65
|
+
*/
|
|
66
|
+
after: string;
|
|
67
|
+
/**
|
|
68
|
+
* The number of items in the current batch.
|
|
69
|
+
*/
|
|
70
|
+
size: number;
|
|
71
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ErrorInfo } from '../../error/index.js';
|
|
2
|
+
import { ApplyAbacTags, FunctionInfoCapable, Identifier } from '../../model/index.js';
|
|
3
|
+
import { PartialBy, RemoveReadonlyFields } from '@ahoo-wang/fetcher';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a target for compensation operations.
|
|
6
|
+
*
|
|
7
|
+
* This interface extends Identifier (with optional id) and FunctionInfoCapable to define
|
|
8
|
+
* the structure for objects that can be targeted for compensation operations. Compensation
|
|
9
|
+
* targets typically represent entities that can have operations reversed or corrected.
|
|
10
|
+
*/
|
|
11
|
+
export interface CompensationTarget extends PartialBy<Identifier, 'id'>, FunctionInfoCapable {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents a command to delete an aggregate.
|
|
15
|
+
*
|
|
16
|
+
* This interface defines the structure for commands that request the deletion of an aggregate.
|
|
17
|
+
* It is typically used in conjunction with other command interfaces to provide a complete
|
|
18
|
+
* command processing workflow.
|
|
19
|
+
*/
|
|
20
|
+
export interface DeleteAggregate {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The body a client sends for command `C`: its writable fields, with the
|
|
24
|
+
* `readonly` ones left out. `CommandRequest` and the generated command
|
|
25
|
+
* clients type their bodies with it.
|
|
26
|
+
*/
|
|
27
|
+
export type CommandBody<C> = RemoveReadonlyFields<C>;
|
|
28
|
+
/**
|
|
29
|
+
* The body of Wow's built-in delete command, sent with `DELETE` to the
|
|
30
|
+
* aggregate's route.
|
|
31
|
+
*/
|
|
32
|
+
export type DeleteAggregateCommand = CommandBody<DeleteAggregate>;
|
|
33
|
+
/**
|
|
34
|
+
* Represents a command to recover an aggregate.
|
|
35
|
+
*
|
|
36
|
+
* This interface defines the structure for commands that request the recovery of an aggregate,
|
|
37
|
+
* typically used in scenarios where an aggregate needs to be restored to a previous state
|
|
38
|
+
* or recovered from an error condition.
|
|
39
|
+
*/
|
|
40
|
+
export interface RecoverAggregate {
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The body of Wow's built-in recover command, which restores a deleted
|
|
44
|
+
* aggregate; sent with `PUT` to the aggregate's `recover` route.
|
|
45
|
+
*/
|
|
46
|
+
export type RecoverAggregateCommand = CommandBody<RecoverAggregate>;
|
|
47
|
+
/**
|
|
48
|
+
* Wow's built-in command that applies ABAC tags to an aggregate, sent with
|
|
49
|
+
* `PUT` to the aggregate's `tags` route; the server refuses a blank tag key.
|
|
50
|
+
*/
|
|
51
|
+
export interface ApplyResourceTags extends ApplyAbacTags {
|
|
52
|
+
}
|
|
53
|
+
/** The body of {@link ApplyResourceTags}. */
|
|
54
|
+
export type ApplyResourceTagsCommand = CommandBody<ApplyResourceTags>;
|
|
55
|
+
/**
|
|
56
|
+
* Represents the result of a batch operation, containing information about
|
|
57
|
+
* the pagination and error status of the operation.
|
|
58
|
+
*
|
|
59
|
+
* Extends ErrorInfo to include error details if the batch operation failed.
|
|
60
|
+
*/
|
|
61
|
+
export interface BatchResult extends ErrorInfo {
|
|
62
|
+
/**
|
|
63
|
+
* The cursor or identifier for the next item after the current batch.
|
|
64
|
+
* Used for pagination to continue fetching the next batch of items.
|
|
65
|
+
*/
|
|
66
|
+
after: string;
|
|
67
|
+
/**
|
|
68
|
+
* The number of items in the current batch.
|
|
69
|
+
*/
|
|
70
|
+
size: number;
|
|
71
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DescriptionCapable } from '../../model/index.cjs';
|
|
2
|
+
/** Something that owns packages, by package name prefix. */
|
|
3
|
+
export interface ScopesCapable {
|
|
4
|
+
/** The packages that belong to it. */
|
|
5
|
+
scopes: string[];
|
|
6
|
+
}
|
|
7
|
+
/** One aggregate of a {@link BoundedContext} in {@link WowMetadata}. */
|
|
8
|
+
export interface Aggregate extends ScopesCapable {
|
|
9
|
+
/**
|
|
10
|
+
* Aggregate type fully qualified name
|
|
11
|
+
*/
|
|
12
|
+
type: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Static tenant ID
|
|
15
|
+
*/
|
|
16
|
+
tenantId: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Custom ID generator name
|
|
19
|
+
*/
|
|
20
|
+
id: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* The packages of the commands the aggregate handles
|
|
23
|
+
*/
|
|
24
|
+
commands: string[];
|
|
25
|
+
/**
|
|
26
|
+
* The packages of the domain events the aggregate raises
|
|
27
|
+
*/
|
|
28
|
+
events: string[];
|
|
29
|
+
}
|
|
30
|
+
/** One bounded context of {@link WowMetadata}. */
|
|
31
|
+
export interface BoundedContext extends ScopesCapable, DescriptionCapable {
|
|
32
|
+
/**
|
|
33
|
+
* The context's short name, unique across the server, which Wow uses in
|
|
34
|
+
* route paths and schema names in place of the context name; `null` when
|
|
35
|
+
* the context has none.
|
|
36
|
+
*/
|
|
37
|
+
alias: string | null;
|
|
38
|
+
/** The context's aggregates, by aggregate name. */
|
|
39
|
+
aggregates: Record<string, Aggregate>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What a Wow server declares about itself: its bounded contexts and their
|
|
43
|
+
* aggregates, as `WowMetadataClient` reads it from `GET /wow/metadata`.
|
|
44
|
+
*/
|
|
45
|
+
export interface WowMetadata extends DescriptionCapable {
|
|
46
|
+
/** The bounded contexts, by context name. */
|
|
47
|
+
contexts: Record<string, BoundedContext>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DescriptionCapable } from '../../model/index.js';
|
|
2
|
+
/** Something that owns packages, by package name prefix. */
|
|
3
|
+
export interface ScopesCapable {
|
|
4
|
+
/** The packages that belong to it. */
|
|
5
|
+
scopes: string[];
|
|
6
|
+
}
|
|
7
|
+
/** One aggregate of a {@link BoundedContext} in {@link WowMetadata}. */
|
|
8
|
+
export interface Aggregate extends ScopesCapable {
|
|
9
|
+
/**
|
|
10
|
+
* Aggregate type fully qualified name
|
|
11
|
+
*/
|
|
12
|
+
type: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Static tenant ID
|
|
15
|
+
*/
|
|
16
|
+
tenantId: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Custom ID generator name
|
|
19
|
+
*/
|
|
20
|
+
id: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* The packages of the commands the aggregate handles
|
|
23
|
+
*/
|
|
24
|
+
commands: string[];
|
|
25
|
+
/**
|
|
26
|
+
* The packages of the domain events the aggregate raises
|
|
27
|
+
*/
|
|
28
|
+
events: string[];
|
|
29
|
+
}
|
|
30
|
+
/** One bounded context of {@link WowMetadata}. */
|
|
31
|
+
export interface BoundedContext extends ScopesCapable, DescriptionCapable {
|
|
32
|
+
/**
|
|
33
|
+
* The context's short name, unique across the server, which Wow uses in
|
|
34
|
+
* route paths and schema names in place of the context name; `null` when
|
|
35
|
+
* the context has none.
|
|
36
|
+
*/
|
|
37
|
+
alias: string | null;
|
|
38
|
+
/** The context's aggregates, by aggregate name. */
|
|
39
|
+
aggregates: Record<string, Aggregate>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What a Wow server declares about itself: its bounded contexts and their
|
|
43
|
+
* aggregates, as `WowMetadataClient` reads it from `GET /wow/metadata`.
|
|
44
|
+
*/
|
|
45
|
+
export interface WowMetadata extends DescriptionCapable {
|
|
46
|
+
/** The bounded contexts, by context name. */
|
|
47
|
+
contexts: Record<string, BoundedContext>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../bindMethods.cjs"),t=require("../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs"),n=require("../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs"),r=require("../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs");let i=require("@ahoo-wang/fetcher-decorator");var a=class{constructor(t){this.apiMetadata=t,e.bindMethods(this)}metadata(e,t){throw(0,i.autoGeneratedError)(e,t)}};r.default([(0,i.get)(`/wow/metadata`),n.default(0,(0,i.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],a.prototype,`metadata`,null),a=r.default([(0,i.api)(),t.default(`design:paramtypes`,[Object])],a),Object.defineProperty(exports,"WowMetadataClient",{enumerable:!0,get:function(){return a}});
|
|
2
|
+
//# sourceMappingURL=wowMetadataClient.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wowMetadataClient.cjs","names":["autoGeneratedError","_decorate","get","_decorateParam","attribute","_decorateMetadata","api","require_bindMethods","require_decorateMetadata","require_decorateParam","require_decorate","_ahoo_wang_fetcher_decorator","WowMetadataClient","apiMetadata","attributes","abort"],"sources":["../../../src/client/metadata/wowMetadataClient.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { WowMetadata } from './wowMetadata.js';\nimport { bindMethods } from '../bindMethods.js';\n\n/**\n * Reads the server's `WowMetadata`: its bounded contexts, their aggregates,\n * and each aggregate's commands and events. `GET /wow/metadata`, relative to\n * the fetcher's base URL: construct it without a `basePath`, which would be\n * put in front of the path.\n *\n * @example\n * ```typescript\n * const metadata = await new WowMetadataClient().metadata();\n * Object.keys(metadata.contexts); // ['example-service', …]\n * ```\n */\n@api()\nexport class WowMetadataClient implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n /**\n * @param attributes - Optional shared attributes for the 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 */\n @get('/wow/metadata')\n /* v8 ignore start */\n metadata(\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<WowMetadata> {\n throw autoGeneratedError(attributes, abort);\n }\n /* v8 ignore stop */\n}\n"],"mappings":"0VAuCO,IAAMY,EAAN,KAAsD,CAC3D,YAAY,EAA2C,CAA3B,KAAA,YAAAC,EAC1BN,EAAA,YAAY,IAAI,CAClB,CAMA,SAGE,EACA,EACsB,CACtB,MAAA,EAAMP,EAAAA,mBAAAA,CAAmBc,EAAYC,CAAK,CAC5C,CAEF,cATGb,EAAAA,EAAAA,IAAAA,CAAI,eAAe,EAGjBC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,UAAAA,CAAU,CAAA,2MAbd,EAAAH,EAAAA,QAAA,EAAA,EAAAK,EAAAA,IAAAA,CAAI,EAAAD,EAAAA,QAAA,oBAAA,CAAA,MAAA,CAAA,CAAA,EAAAO,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
|
|
2
|
+
import { WowMetadata } from './wowMetadata.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the server's `WowMetadata`: its bounded contexts, their aggregates,
|
|
5
|
+
* and each aggregate's commands and events. `GET /wow/metadata`, relative to
|
|
6
|
+
* the fetcher's base URL: construct it without a `basePath`, which would be
|
|
7
|
+
* put in front of the path.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const metadata = await new WowMetadataClient().metadata();
|
|
12
|
+
* Object.keys(metadata.contexts); // ['example-service', …]
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class WowMetadataClient implements ApiMetadataCapable {
|
|
16
|
+
readonly apiMetadata?: ApiMetadata | undefined;
|
|
17
|
+
constructor(apiMetadata?: ApiMetadata | undefined);
|
|
18
|
+
/**
|
|
19
|
+
* @param attributes - Optional shared attributes for the interceptors
|
|
20
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
21
|
+
*/
|
|
22
|
+
metadata(attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<WowMetadata>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
|
|
2
|
+
import { WowMetadata } from './wowMetadata.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the server's `WowMetadata`: its bounded contexts, their aggregates,
|
|
5
|
+
* and each aggregate's commands and events. `GET /wow/metadata`, relative to
|
|
6
|
+
* the fetcher's base URL: construct it without a `basePath`, which would be
|
|
7
|
+
* put in front of the path.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const metadata = await new WowMetadataClient().metadata();
|
|
12
|
+
* Object.keys(metadata.contexts); // ['example-service', …]
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class WowMetadataClient implements ApiMetadataCapable {
|
|
16
|
+
readonly apiMetadata?: ApiMetadata | undefined;
|
|
17
|
+
constructor(apiMetadata?: ApiMetadata | undefined);
|
|
18
|
+
/**
|
|
19
|
+
* @param attributes - Optional shared attributes for the interceptors
|
|
20
|
+
* @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
|
|
21
|
+
*/
|
|
22
|
+
metadata(attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<WowMetadata>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { bindMethods as e } from "../bindMethods.es.js";
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js";
|
|
3
|
+
import n from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js";
|
|
4
|
+
import r from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js";
|
|
5
|
+
import { api as i, attribute as a, autoGeneratedError as o, get as s } from "@ahoo-wang/fetcher-decorator";
|
|
6
|
+
//#region src/client/metadata/wowMetadataClient.ts
|
|
7
|
+
var c = class {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
this.apiMetadata = t, e(this);
|
|
10
|
+
}
|
|
11
|
+
metadata(e, t) {
|
|
12
|
+
throw o(e, t);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
r([
|
|
16
|
+
s("/wow/metadata"),
|
|
17
|
+
n(0, a()),
|
|
18
|
+
t("design:type", Function),
|
|
19
|
+
t("design:paramtypes", [typeof Record > "u" ? Object : Record, Object]),
|
|
20
|
+
t("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
21
|
+
], c.prototype, "metadata", null), c = r([i(), t("design:paramtypes", [Object])], c);
|
|
22
|
+
//#endregion
|
|
23
|
+
export { c as WowMetadataClient };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=wowMetadataClient.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wowMetadataClient.es.js","names":["_decorate","_decorateParam","_decorateMetadata","__decorateMetadata","__decorateParam","__decorate","WowMetadataClient","apiMetadata","bindMethods","autoGeneratedError","attributes","abort","get","attribute","api"],"sources":["../../../src/client/metadata/wowMetadataClient.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { WowMetadata } from './wowMetadata.js';\nimport { bindMethods } from '../bindMethods.js';\n\n/**\n * Reads the server's `WowMetadata`: its bounded contexts, their aggregates,\n * and each aggregate's commands and events. `GET /wow/metadata`, relative to\n * the fetcher's base URL: construct it without a `basePath`, which would be\n * put in front of the path.\n *\n * @example\n * ```typescript\n * const metadata = await new WowMetadataClient().metadata();\n * Object.keys(metadata.contexts); // ['example-service', …]\n * ```\n */\n@api()\nexport class WowMetadataClient implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n /**\n * @param attributes - Optional shared attributes for the 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 */\n @get('/wow/metadata')\n /* v8 ignore start */\n metadata(\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<WowMetadata> {\n throw autoGeneratedError(attributes, abort);\n }\n /* v8 ignore stop */\n}\n"],"mappings":";;;;;;AAuCO,IAAMM,IAAN,MAAsD;CAC3D,YAAY,GAA2C;EACrD,AAD0B,KAAA,cAAAC,GAC1BC,EAAY,IAAI;CAClB;CAMA,SAGE,GACA,GACsB;EACtB,MAAMC,EAAmBC,GAAYC,CAAK;CAC5C;AAEF;;CATGC,EAAI,eAAe;CAGjBX,EAAA,GAAAY,EAAU,CAAA;;;;mCAbd,IAAAb,EAAA,CAAAc,EAAI,GAAAZ,EAAA,qBAAA,CAAA,MAAA,CAAA,CAAA,GAAAI,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs"),t=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs"),r=require("./endpointPaths.cjs");let i=require("@ahoo-wang/fetcher"),a=require("@ahoo-wang/fetcher-decorator");var o=Object.freeze({resultExtractor:i.ExchangeResultExtractor,attributes:Object.freeze({[i.IGNORE_VALIDATE_STATUS]:!0})}),s=class{constructor(e){this.apiMetadata=e}snapshot(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}eventStream(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}};n.default([(0,a.get)(r.QueryDescriptorEndpointPaths.SNAPSHOT,o),t.default(0,(0,a.header)(`If-None-Match`)),t.default(1,(0,a.attribute)()),e.default(`design:type`,Function),e.default(`design:paramtypes`,[String,typeof Record>`u`?Object:Record,Object]),e.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`snapshot`,null),n.default([(0,a.get)(r.QueryDescriptorEndpointPaths.EVENT_STREAM,o),t.default(0,(0,a.header)(`If-None-Match`)),t.default(1,(0,a.attribute)()),e.default(`design:type`,Function),e.default(`design:paramtypes`,[String,typeof Record>`u`?Object:Record,Object]),e.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`eventStream`,null),s=n.default([(0,a.api)(),e.default(`design:paramtypes`,[Object])],s);function c(e){return e?.trim().replace(/^W\//,``).replace(/^"(.*)"$/,`$1`)||void 0}function l(e){return e===void 0?void 0:`"${e}"`}async function u(e,t){let n=e.requiredResponse;if(n.status===304&&t!==void 0)return{notModified:!0,version:t};if(!n.ok)throw new i.HttpStatusValidationError(e);let r=await n.json();return{notModified:!1,descriptor:r,version:r.version}}Object.defineProperty(exports,"QueryDescriptorEndpoints",{enumerable:!0,get:function(){return s}}),exports.descriptorVersion=c,exports.ifNoneMatch=l,exports.readDescriptor=u;
|
|
2
|
+
//# sourceMappingURL=descriptorEndpoints.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptorEndpoints.cjs","names":["ExchangeResultExtractor","IGNORE_VALIDATE_STATUS","autoGeneratedError","_decorate","get","QueryDescriptorEndpointPaths","_decorateParam","header","attribute","_decorateMetadata","api","HttpStatusValidationError","require_decorateMetadata","require_decorateParam","require_decorate","require_endpointPaths","_ahoo_wang_fetcher","_ahoo_wang_fetcher_decorator","DESCRIPTOR_ENDPOINT","QueryDescriptorEndpoints","apiMetadata","ifNoneMatch","attributes","abort","descriptorVersion","previous","version","readDescriptor","response","exchange","descriptor"],"sources":["../../../../src/client/query/descriptor/descriptorEndpoints.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: the index of this folder does not re-export this file.\n\nimport {\n ExchangeResultExtractor,\n type FetchExchange,\n HttpStatusValidationError,\n IGNORE_VALIDATE_STATUS,\n} from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n header,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { QueryModelDescriptor } from '../../../dsl/descriptor.js';\nimport type { QueryDescriptorResult } from './queryDescriptorApi.js';\nimport { QueryDescriptorEndpointPaths } from './endpointPaths.js';\n\n/**\n * The endpoints answer the exchange with its status unchecked, so a 304 is\n * not an error; {@link readDescriptor} checks the status instead.\n */\nconst DESCRIPTOR_ENDPOINT = Object.freeze({\n resultExtractor: ExchangeResultExtractor,\n attributes: Object.freeze({ [IGNORE_VALIDATE_STATUS]: true }),\n});\n\n/**\n * The decorated requests behind `QueryDescriptorClient`, which turns the\n * version it is given into an ETag before they run.\n */\n@api()\nexport class QueryDescriptorEndpoints implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {}\n\n @get(QueryDescriptorEndpointPaths.SNAPSHOT, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n snapshot(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n\n @get(QueryDescriptorEndpointPaths.EVENT_STREAM, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n eventStream(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n}\n\n/**\n * The version a descriptor version or an ETag names: `sha256:…`,\n * `\"sha256:…\"` and `W/\"sha256:…\"` all name `sha256:…`. `undefined` for\n * nothing, or only blanks.\n */\nexport function descriptorVersion(previous?: string): string | undefined {\n const version = previous\n ?.trim()\n .replace(/^W\\//, '')\n .replace(/^\"(.*)\"$/, '$1');\n return version ? version : undefined;\n}\n\n/**\n * The `If-None-Match` value for `version`: the ETag the server sends, which it\n * compares as it is.\n */\nexport function ifNoneMatch(version?: string): string | undefined {\n return version === undefined ? undefined : `\"${version}\"`;\n}\n\n/**\n * What an exchange answers: 304 means the version sent is current; any other\n * status outside 2xx rejects with the error the fetcher would have thrown.\n */\nexport async function readDescriptor(\n exchange: FetchExchange,\n version: string | undefined,\n): Promise<QueryDescriptorResult> {\n const response = exchange.requiredResponse;\n if (response.status === 304 && version !== undefined)\n return { notModified: true, version };\n if (!response.ok) throw new HttpStatusValidationError(exchange);\n const descriptor = (await response.json()) as QueryModelDescriptor;\n return { notModified: false, descriptor, version: descriptor.version };\n}\n"],"mappings":"oYAwCA,IAAMkB,EAAsB,OAAO,OAAO,CACxC,gBAAiBlB,EAAAA,wBACjB,WAAY,OAAO,OAAO,EAAGC,EAAAA,wBAAyB,EAAK,CAAC,CAC9D,CAAC,EAOYkB,EAAN,KAA6D,CAClE,YAAY,EAA2C,CAA3B,KAAA,YAAAC,CAA4B,CAExD,SAGE,EACA,EACA,EACwB,CACxB,MAAA,EAAMlB,EAAAA,mBAAAA,CAAmBmB,EAAaC,EAAYC,CAAK,CACzD,CAGA,YAGE,EACA,EACA,EACwB,CACxB,MAAA,EAAMrB,EAAAA,mBAAAA,CAAmBmB,EAAaC,EAAYC,CAAK,CACzD,CAEF,cArBGnB,EAAAA,EAAAA,IAAAA,CAAIC,EAAAA,6BAA6B,SAAUa,CAAmB,EAG5DZ,EAAAA,QAAA,GAAA,EAAAC,EAAAA,OAAAA,CAAO,eAAe,CAAA,EACtBD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,8NAOZJ,EAAAA,EAAAA,IAAAA,CAAIC,EAAAA,6BAA6B,aAAca,CAAmB,EAGhEZ,EAAAA,QAAA,GAAA,EAAAC,EAAAA,OAAAA,CAAO,eAAe,CAAA,EACtBD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,qNAnBd,EAAAL,EAAAA,QAAA,EAAA,EAAAO,EAAAA,IAAAA,CAAI,EAAAD,EAAAA,QAAA,oBAAA,CAAA,MAAA,CAAA,CAAA,EAAAU,CAAA,EAgCL,SAAgBK,EAAkB,EAAuC,CAKvE,OAJgBC,GACZ,KAAK,CAAC,CACP,QAAQ,OAAQ,EAAE,CAAC,CACnB,QAAQ,WAAY,IAAI,GACA,IAAA,EAC7B,CAMA,SAAgBJ,EAAY,EAAsC,CAChE,OAAOK,IAAY,IAAA,GAAY,IAAA,GAAY,IAAIA,EAAQ,EACzD,CAMA,eAAsBC,EACpB,EACA,EACgC,CAChC,IAAMC,EAAWC,EAAS,iBAC1B,GAAID,EAAS,SAAW,KAAOF,IAAY,IAAA,GACzC,MAAO,CAAE,YAAa,GAAM,SAAQ,EACtC,GAAI,CAACE,EAAS,GAAI,MAAM,IAAIjB,EAAAA,0BAA0BkB,CAAQ,EAC9D,IAAMC,EAAc,MAAMF,EAAS,KAAK,EACxC,MAAO,CAAE,YAAa,GAAO,aAAY,QAASE,EAAW,OAAQ,CACvE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FetchExchange } from '@ahoo-wang/fetcher';
|
|
2
|
+
import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
|
|
3
|
+
import { QueryDescriptorResult } from './queryDescriptorApi.cjs';
|
|
4
|
+
/**
|
|
5
|
+
* The decorated requests behind `QueryDescriptorClient`, which turns the
|
|
6
|
+
* version it is given into an ETag before they run.
|
|
7
|
+
*/
|
|
8
|
+
export declare class QueryDescriptorEndpoints implements ApiMetadataCapable {
|
|
9
|
+
readonly apiMetadata?: ApiMetadata | undefined;
|
|
10
|
+
constructor(apiMetadata?: ApiMetadata | undefined);
|
|
11
|
+
snapshot(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
|
|
12
|
+
eventStream(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The version a descriptor version or an ETag names: `sha256:…`,
|
|
16
|
+
* `"sha256:…"` and `W/"sha256:…"` all name `sha256:…`. `undefined` for
|
|
17
|
+
* nothing, or only blanks.
|
|
18
|
+
*/
|
|
19
|
+
export declare function descriptorVersion(previous?: string): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The `If-None-Match` value for `version`: the ETag the server sends, which it
|
|
22
|
+
* compares as it is.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ifNoneMatch(version?: string): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* What an exchange answers: 304 means the version sent is current; any other
|
|
27
|
+
* status outside 2xx rejects with the error the fetcher would have thrown.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readDescriptor(exchange: FetchExchange, version: string | undefined): Promise<QueryDescriptorResult>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FetchExchange } from '@ahoo-wang/fetcher';
|
|
2
|
+
import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
|
|
3
|
+
import { QueryDescriptorResult } from './queryDescriptorApi.js';
|
|
4
|
+
/**
|
|
5
|
+
* The decorated requests behind `QueryDescriptorClient`, which turns the
|
|
6
|
+
* version it is given into an ETag before they run.
|
|
7
|
+
*/
|
|
8
|
+
export declare class QueryDescriptorEndpoints implements ApiMetadataCapable {
|
|
9
|
+
readonly apiMetadata?: ApiMetadata | undefined;
|
|
10
|
+
constructor(apiMetadata?: ApiMetadata | undefined);
|
|
11
|
+
snapshot(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
|
|
12
|
+
eventStream(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The version a descriptor version or an ETag names: `sha256:…`,
|
|
16
|
+
* `"sha256:…"` and `W/"sha256:…"` all name `sha256:…`. `undefined` for
|
|
17
|
+
* nothing, or only blanks.
|
|
18
|
+
*/
|
|
19
|
+
export declare function descriptorVersion(previous?: string): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The `If-None-Match` value for `version`: the ETag the server sends, which it
|
|
22
|
+
* compares as it is.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ifNoneMatch(version?: string): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* What an exchange answers: 304 means the version sent is current; any other
|
|
27
|
+
* status outside 2xx rejects with the error the fetcher would have thrown.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readDescriptor(exchange: FetchExchange, version: string | undefined): Promise<QueryDescriptorResult>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import e from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js";
|
|
2
|
+
import t from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js";
|
|
3
|
+
import n from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js";
|
|
4
|
+
import { QueryDescriptorEndpointPaths as r } from "./endpointPaths.es.js";
|
|
5
|
+
import { ExchangeResultExtractor as i, HttpStatusValidationError as a, IGNORE_VALIDATE_STATUS as o } from "@ahoo-wang/fetcher";
|
|
6
|
+
import { api as s, attribute as c, autoGeneratedError as l, get as u, header as d } from "@ahoo-wang/fetcher-decorator";
|
|
7
|
+
//#region src/client/query/descriptor/descriptorEndpoints.ts
|
|
8
|
+
var f = Object.freeze({
|
|
9
|
+
resultExtractor: i,
|
|
10
|
+
attributes: Object.freeze({ [o]: !0 })
|
|
11
|
+
}), p = class {
|
|
12
|
+
constructor(e) {
|
|
13
|
+
this.apiMetadata = e;
|
|
14
|
+
}
|
|
15
|
+
snapshot(e, t, n) {
|
|
16
|
+
throw l(e, t, n);
|
|
17
|
+
}
|
|
18
|
+
/* v8 ignore stop */
|
|
19
|
+
eventStream(e, t, n) {
|
|
20
|
+
throw l(e, t, n);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
n([
|
|
24
|
+
u(r.SNAPSHOT, f),
|
|
25
|
+
t(0, d("If-None-Match")),
|
|
26
|
+
t(1, c()),
|
|
27
|
+
e("design:type", Function),
|
|
28
|
+
e("design:paramtypes", [
|
|
29
|
+
String,
|
|
30
|
+
typeof Record > "u" ? Object : Record,
|
|
31
|
+
Object
|
|
32
|
+
]),
|
|
33
|
+
e("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
34
|
+
], p.prototype, "snapshot", null), n([
|
|
35
|
+
u(r.EVENT_STREAM, f),
|
|
36
|
+
t(0, d("If-None-Match")),
|
|
37
|
+
t(1, c()),
|
|
38
|
+
e("design:type", Function),
|
|
39
|
+
e("design:paramtypes", [
|
|
40
|
+
String,
|
|
41
|
+
typeof Record > "u" ? Object : Record,
|
|
42
|
+
Object
|
|
43
|
+
]),
|
|
44
|
+
e("design:returntype", typeof Promise > "u" ? Object : Promise)
|
|
45
|
+
], p.prototype, "eventStream", null), p = n([s(), e("design:paramtypes", [Object])], p);
|
|
46
|
+
function m(e) {
|
|
47
|
+
return e?.trim().replace(/^W\//, "").replace(/^"(.*)"$/, "$1") || void 0;
|
|
48
|
+
}
|
|
49
|
+
function h(e) {
|
|
50
|
+
return e === void 0 ? void 0 : `"${e}"`;
|
|
51
|
+
}
|
|
52
|
+
async function g(e, t) {
|
|
53
|
+
let n = e.requiredResponse;
|
|
54
|
+
if (n.status === 304 && t !== void 0) return {
|
|
55
|
+
notModified: !0,
|
|
56
|
+
version: t
|
|
57
|
+
};
|
|
58
|
+
if (!n.ok) throw new a(e);
|
|
59
|
+
let r = await n.json();
|
|
60
|
+
return {
|
|
61
|
+
notModified: !1,
|
|
62
|
+
descriptor: r,
|
|
63
|
+
version: r.version
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { p as QueryDescriptorEndpoints, m as descriptorVersion, h as ifNoneMatch, g as readDescriptor };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=descriptorEndpoints.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptorEndpoints.es.js","names":["_decorate","_decorateParam","_decorateMetadata","__decorateMetadata","__decorateParam","__decorate","DESCRIPTOR_ENDPOINT","ExchangeResultExtractor","IGNORE_VALIDATE_STATUS","QueryDescriptorEndpoints","apiMetadata","autoGeneratedError","ifNoneMatch","attributes","abort","get","QueryDescriptorEndpointPaths","header","attribute","api","descriptorVersion","previous","version","readDescriptor","response","exchange","HttpStatusValidationError","descriptor"],"sources":["../../../../src/client/query/descriptor/descriptorEndpoints.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: the index of this folder does not re-export this file.\n\nimport {\n ExchangeResultExtractor,\n type FetchExchange,\n HttpStatusValidationError,\n IGNORE_VALIDATE_STATUS,\n} from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n header,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { QueryModelDescriptor } from '../../../dsl/descriptor.js';\nimport type { QueryDescriptorResult } from './queryDescriptorApi.js';\nimport { QueryDescriptorEndpointPaths } from './endpointPaths.js';\n\n/**\n * The endpoints answer the exchange with its status unchecked, so a 304 is\n * not an error; {@link readDescriptor} checks the status instead.\n */\nconst DESCRIPTOR_ENDPOINT = Object.freeze({\n resultExtractor: ExchangeResultExtractor,\n attributes: Object.freeze({ [IGNORE_VALIDATE_STATUS]: true }),\n});\n\n/**\n * The decorated requests behind `QueryDescriptorClient`, which turns the\n * version it is given into an ETag before they run.\n */\n@api()\nexport class QueryDescriptorEndpoints implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {}\n\n @get(QueryDescriptorEndpointPaths.SNAPSHOT, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n snapshot(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n\n @get(QueryDescriptorEndpointPaths.EVENT_STREAM, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n eventStream(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n}\n\n/**\n * The version a descriptor version or an ETag names: `sha256:…`,\n * `\"sha256:…\"` and `W/\"sha256:…\"` all name `sha256:…`. `undefined` for\n * nothing, or only blanks.\n */\nexport function descriptorVersion(previous?: string): string | undefined {\n const version = previous\n ?.trim()\n .replace(/^W\\//, '')\n .replace(/^\"(.*)\"$/, '$1');\n return version ? version : undefined;\n}\n\n/**\n * The `If-None-Match` value for `version`: the ETag the server sends, which it\n * compares as it is.\n */\nexport function ifNoneMatch(version?: string): string | undefined {\n return version === undefined ? undefined : `\"${version}\"`;\n}\n\n/**\n * What an exchange answers: 304 means the version sent is current; any other\n * status outside 2xx rejects with the error the fetcher would have thrown.\n */\nexport async function readDescriptor(\n exchange: FetchExchange,\n version: string | undefined,\n): Promise<QueryDescriptorResult> {\n const response = exchange.requiredResponse;\n if (response.status === 304 && version !== undefined)\n return { notModified: true, version };\n if (!response.ok) throw new HttpStatusValidationError(exchange);\n const descriptor = (await response.json()) as QueryModelDescriptor;\n return { notModified: false, descriptor, version: descriptor.version };\n}\n"],"mappings":";;;;;;;AAwCA,IAAMM,IAAsB,OAAO,OAAO;CACxC,iBAAiBC;CACjB,YAAY,OAAO,OAAO,GAAGC,IAAyB,GAAK,CAAC;AAC9D,CAAC,GAOYC,IAAN,MAA6D;CAClE,YAAY,GAA2C;EAA3B,KAAA,cAAAC;CAA4B;CAExD,SAGE,GACA,GACA,GACwB;EACxB,MAAMC,EAAmBC,GAAaC,GAAYC,CAAK;CACzD;;CAGA,YAGE,GACA,GACA,GACwB;EACxB,MAAMH,EAAmBC,GAAaC,GAAYC,CAAK;CACzD;AAEF;;CArBGC,EAAIC,EAA6B,UAAUV,CAAmB;CAG5DL,EAAA,GAAAgB,EAAO,eAAe,CAAA;CACtBhB,EAAA,GAAAiB,EAAU,CAAA;;;;;;;;;CAOZH,EAAIC,EAA6B,cAAcV,CAAmB;CAGhEL,EAAA,GAAAgB,EAAO,eAAe,CAAA;CACtBhB,EAAA,GAAAiB,EAAU,CAAA;;;;;;;;sCAnBd,IAAAlB,EAAA,CAAAmB,EAAI,GAAAjB,EAAA,qBAAA,CAAA,MAAA,CAAA,CAAA,GAAAO,CAAA;AAgCL,SAAgBW,EAAkB,GAAuC;CAKvE,OAJgBC,GACZ,KAAK,CAAC,CACP,QAAQ,QAAQ,EAAE,CAAC,CACnB,QAAQ,YAAY,IAAI,KACA,KAAA;AAC7B;AAMA,SAAgBT,EAAY,GAAsC;CAChE,OAAOU,MAAY,KAAA,IAAY,KAAA,IAAY,IAAIA,EAAQ;AACzD;AAMA,eAAsBC,EACpB,GACA,GACgC;CAChC,IAAMC,IAAWC,EAAS;CAC1B,IAAID,EAAS,WAAW,OAAOF,MAAY,KAAA,GACzC,OAAO;EAAE,aAAa;EAAM;CAAQ;CACtC,IAAI,CAACE,EAAS,IAAI,MAAM,IAAIE,EAA0BD,CAAQ;CAC9D,IAAME,IAAc,MAAMH,EAAS,KAAK;CACxC,OAAO;EAAE,aAAa;EAAO;EAAY,SAASG,EAAW;CAAQ;AACvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpointPaths.cjs","names":["QueryDescriptorEndpointPaths"],"sources":["../../../../src/client/query/descriptor/endpointPaths.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: the index of this folder does not re-export this file. The\n// paths are relative to the client's base path, which names the aggregate\n// without a tenant or owner segment: the schema routes have neither.\nexport const QueryDescriptorEndpointPaths = Object.freeze({\n SNAPSHOT: 'snapshot/schema',\n EVENT_STREAM: 'event/schema',\n} as const);\n"],"mappings":"AAgBA,IAAaA,EAA+B,OAAO,OAAO,CACxD,SAAU,kBACV,aAAc,cAChB,CAAU"}
|