@ahoo-wang/wow-client 9.7.0 → 9.8.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.
Files changed (29) hide show
  1. package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorate.es.js +1 -1
  2. package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorateMetadata.es.js +1 -1
  3. package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorateParam.es.js +1 -1
  4. package/dist/client/command/commandClient.cjs +1 -1
  5. package/dist/client/command/commandClient.es.js +3 -3
  6. package/dist/client/metadata/wowMetadataClient.cjs +1 -1
  7. package/dist/client/metadata/wowMetadataClient.es.js +3 -3
  8. package/dist/client/query/descriptor/descriptorEndpoints.cjs +1 -1
  9. package/dist/client/query/descriptor/descriptorEndpoints.es.js +3 -3
  10. package/dist/client/query/event/eventStreamQueryClient.cjs +1 -1
  11. package/dist/client/query/event/eventStreamQueryClient.es.js +3 -3
  12. package/dist/client/query/snapshot/snapshotQueryClient.cjs +1 -1
  13. package/dist/client/query/snapshot/snapshotQueryClient.es.js +3 -3
  14. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +1 -1
  15. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +3 -3
  16. package/dist/client/query/state/loadStateAggregateClient.cjs +1 -1
  17. package/dist/client/query/state/loadStateAggregateClient.es.js +3 -3
  18. package/dist/dsl/filter/datePattern.cjs +1 -1
  19. package/dist/dsl/filter/datePattern.cjs.map +1 -1
  20. package/dist/dsl/filter/datePattern.es.js +2 -5
  21. package/dist/dsl/filter/datePattern.es.js.map +1 -1
  22. package/dist/transport/eventStreams.cjs +1 -1
  23. package/dist/transport/eventStreams.cjs.map +1 -1
  24. package/dist/transport/eventStreams.es.js +1 -5
  25. package/dist/transport/eventStreams.es.js.map +1 -1
  26. package/package.json +2 -2
  27. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorate.cjs +0 -0
  28. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorateMetadata.cjs +0 -0
  29. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorateParam.cjs +0 -0
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
1
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
2
2
  function e(e, t, n, r) {
3
3
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
4
4
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
1
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateMetadata.js
2
2
  function e(e, t) {
3
3
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
4
4
  }
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateParam.js
1
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
2
2
  function e(e, t) {
3
3
  return function(n, r) {
4
4
  t(n, r, e);
@@ -1,2 +1,2 @@
1
- const e=require("../../transport/endpoints.cjs"),t=require("../bindMethods.cjs"),n=require("../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs"),r=require("../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs"),i=require("../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs");let a=require("@ahoo-wang/fetcher-decorator");var o=class{constructor(e){this.apiMetadata=e,t.bindMethods(this)}send(e,t){throw(0,a.autoGeneratedError)(e,t)}sendAndWaitStream(e,t){throw(0,a.autoGeneratedError)(e,t)}};i.default([(0,a.endpoint)(),r.default(0,(0,a.request)()),r.default(1,(0,a.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`send`,null),i.default([(0,a.endpoint)(void 0,void 0,e.COMMAND_STREAM_ENDPOINT),r.default(0,(0,a.request)()),r.default(1,(0,a.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`sendAndWaitStream`,null),o=i.default([(0,a.api)(),n.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"CommandClient",{enumerable:!0,get:function(){return o}});
1
+ const e=require("../../transport/endpoints.cjs"),t=require("../bindMethods.cjs"),n=require("../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),r=require("../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),i=require("../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs");let a=require("@ahoo-wang/fetcher-decorator");var o=class{constructor(e){this.apiMetadata=e,t.bindMethods(this)}send(e,t){throw(0,a.autoGeneratedError)(e,t)}sendAndWaitStream(e,t){throw(0,a.autoGeneratedError)(e,t)}};i.default([(0,a.endpoint)(),r.default(0,(0,a.request)()),r.default(1,(0,a.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`send`,null),i.default([(0,a.endpoint)(void 0,void 0,e.COMMAND_STREAM_ENDPOINT),r.default(0,(0,a.request)()),r.default(1,(0,a.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`sendAndWaitStream`,null),o=i.default([(0,a.api)(),n.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"CommandClient",{enumerable:!0,get:function(){return o}});
2
2
  //# sourceMappingURL=commandClient.cjs.map
@@ -1,8 +1,8 @@
1
1
  import { COMMAND_STREAM_ENDPOINT as e } from "../../transport/endpoints.es.js";
2
2
  import { bindMethods as t } from "../bindMethods.es.js";
3
- import n from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js";
4
- import r from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js";
5
- import i from "../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js";
3
+ import n from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
4
+ import r from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
5
+ import i from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
6
6
  import { api as a, attribute as o, autoGeneratedError as s, endpoint as c, request as l } from "@ahoo-wang/fetcher-decorator";
7
7
  //#region src/client/command/commandClient.ts
8
8
  var u = class {
@@ -1,2 +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}});
1
+ const e=require("../bindMethods.cjs"),t=require("../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),n=require("../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),r=require("../../_virtual/_@oxc-project_runtime@0.153.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
2
  //# sourceMappingURL=wowMetadataClient.cjs.map
@@ -1,7 +1,7 @@
1
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";
2
+ import t from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
3
+ import n from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
4
+ import r from "../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
5
5
  import { api as i, attribute as a, autoGeneratedError as o, get as s } from "@ahoo-wang/fetcher-decorator";
6
6
  //#region src/client/metadata/wowMetadataClient.ts
7
7
  var c = class {
@@ -1,2 +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;
1
+ const e=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),t=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.153.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
2
  //# sourceMappingURL=descriptorEndpoints.cjs.map
@@ -1,6 +1,6 @@
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";
1
+ import e from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
2
+ import t from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
3
+ import n from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
4
4
  import { QueryDescriptorEndpointPaths as r } from "./endpointPaths.es.js";
5
5
  import { ExchangeResultExtractor as i, HttpStatusValidationError as a, IGNORE_VALIDATE_STATUS as o } from "@ahoo-wang/fetcher";
6
6
  import { api as s, attribute as c, autoGeneratedError as l, get as u, header as d } from "@ahoo-wang/fetcher-decorator";
@@ -1,2 +1,2 @@
1
- const e=require("../../../transport/endpoints.cjs"),t=require("../../bindMethods.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs"),r=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs"),i=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs"),a=require("./endpointPaths.cjs");let o=require("@ahoo-wang/fetcher-decorator");var s=class{constructor(e){this.apiMetadata=e,t.bindMethods(this)}aggregate(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}aggregateStream(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}cursor(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}count(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}list(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}listStream(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}paged(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}load(e,t,n,r,i){throw(0,o.autoGeneratedError)(e,t,n,r,i)}loadStream(e,t,n,r,i){throw(0,o.autoGeneratedError)(e,t,n,r,i)}};i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.AGGREGATION),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`aggregate`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.AGGREGATION,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`aggregateStream`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.CURSOR),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`cursor`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.COUNT),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`count`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.LIST),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`list`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.LIST,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`listStream`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.PAGED),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`paged`,null),i.default([(0,o.get)(a.EventStreamQueryEndpointPaths.LOAD),r.default(0,(0,o.path)(`id`)),r.default(1,(0,o.path)(`headVersion`)),r.default(2,(0,o.path)(`tailVersion`)),r.default(3,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[String,Number,Number,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`load`,null),i.default([(0,o.get)(a.EventStreamQueryEndpointPaths.LOAD,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,o.path)(`id`)),r.default(1,(0,o.path)(`headVersion`)),r.default(2,(0,o.path)(`tailVersion`)),r.default(3,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[String,Number,Number,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`loadStream`,null),s=i.default([(0,o.api)(),n.default(`design:paramtypes`,[Object])],s),Object.defineProperty(exports,"EventStreamQueryClient",{enumerable:!0,get:function(){return s}});
1
+ const e=require("../../../transport/endpoints.cjs"),t=require("../../bindMethods.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),r=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),i=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs"),a=require("./endpointPaths.cjs");let o=require("@ahoo-wang/fetcher-decorator");var s=class{constructor(e){this.apiMetadata=e,t.bindMethods(this)}aggregate(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}aggregateStream(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}cursor(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}count(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}list(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}listStream(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}paged(e,t,n){throw(0,o.autoGeneratedError)(e,t,n)}load(e,t,n,r,i){throw(0,o.autoGeneratedError)(e,t,n,r,i)}loadStream(e,t,n,r,i){throw(0,o.autoGeneratedError)(e,t,n,r,i)}};i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.AGGREGATION),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`aggregate`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.AGGREGATION,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`aggregateStream`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.CURSOR),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`cursor`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.COUNT),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`count`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.LIST),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`list`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.LIST,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`listStream`,null),i.default([(0,o.post)(a.EventStreamQueryEndpointPaths.PAGED),r.default(0,(0,o.body)()),r.default(1,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`paged`,null),i.default([(0,o.get)(a.EventStreamQueryEndpointPaths.LOAD),r.default(0,(0,o.path)(`id`)),r.default(1,(0,o.path)(`headVersion`)),r.default(2,(0,o.path)(`tailVersion`)),r.default(3,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[String,Number,Number,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`load`,null),i.default([(0,o.get)(a.EventStreamQueryEndpointPaths.LOAD,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,o.path)(`id`)),r.default(1,(0,o.path)(`headVersion`)),r.default(2,(0,o.path)(`tailVersion`)),r.default(3,(0,o.attribute)()),n.default(`design:type`,Function),n.default(`design:paramtypes`,[String,Number,Number,typeof Record>`u`?Object:Record,Object]),n.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`loadStream`,null),s=i.default([(0,o.api)(),n.default(`design:paramtypes`,[Object])],s),Object.defineProperty(exports,"EventStreamQueryClient",{enumerable:!0,get:function(){return s}});
2
2
  //# sourceMappingURL=eventStreamQueryClient.cjs.map
@@ -1,8 +1,8 @@
1
1
  import { QUERY_STREAM_ENDPOINT as e } from "../../../transport/endpoints.es.js";
2
2
  import { bindMethods as t } from "../../bindMethods.es.js";
3
- import n from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js";
4
- import r from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js";
5
- import i from "../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js";
3
+ import n from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
4
+ import r from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
5
+ import i from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
6
6
  import { EventStreamQueryEndpointPaths as a } from "./endpointPaths.es.js";
7
7
  import { api as o, attribute as s, autoGeneratedError as c, body as l, get as u, path as d, post as f } from "@ahoo-wang/fetcher-decorator";
8
8
  //#region src/client/query/event/eventStreamQueryClient.ts
@@ -1,2 +1,2 @@
1
- const e=require("../../../dsl/filter/builders.cjs"),t=require("../../../dsl/queryable.cjs"),n=require("../../../transport/endpoints.cjs"),r=require("../../bindMethods.cjs"),i=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs"),a=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs"),o=require("../../../_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs"),s=require("./endpointPaths.cjs");let c=require("@ahoo-wang/fetcher-decorator");var l=class{constructor(e){this.apiMetadata=e,r.bindMethods(this)}aggregate(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}aggregateStream(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}cursor(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}cursorState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}count(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}list(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}listStream(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}listState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}listStateStream(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}paged(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}pagedState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}single(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}singleState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}getById(n,r,i){let a=t.singleQuery({filter:e.filter.aggregateId(n)});return this.single(a,r,i)}getStateById(n,r,i){let a=t.singleQuery({filter:e.filter.aggregateId(n)});return this.singleState(a,r,i)}getByIds(n,r,i){if(n.length===0)return Promise.resolve([]);let a=t.listQuery({filter:e.filter.aggregateIds(n),limit:n.length});return this.list(a,r,i)}getStateByIds(n,r,i){if(n.length===0)return Promise.resolve([]);let a=t.listQuery({filter:e.filter.aggregateIds(n),limit:n.length});return this.listState(a,r,i)}};o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.AGGREGATION),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`aggregate`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.AGGREGATION,n.QUERY_STREAM_ENDPOINT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`aggregateStream`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.CURSOR),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`cursor`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.CURSOR_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`cursorState`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.COUNT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`count`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`list`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST,n.QUERY_STREAM_ENDPOINT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`listStream`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`listState`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST_STATE,n.QUERY_STREAM_ENDPOINT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`listStateStream`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.PAGED),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`paged`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.PAGED_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`pagedState`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.SINGLE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`single`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.SINGLE_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`singleState`,null),l=o.default([(0,c.api)(),i.default(`design:paramtypes`,[Object])],l),Object.defineProperty(exports,"SnapshotQueryClient",{enumerable:!0,get:function(){return l}});
1
+ const e=require("../../../dsl/filter/builders.cjs"),t=require("../../../dsl/queryable.cjs"),n=require("../../../transport/endpoints.cjs"),r=require("../../bindMethods.cjs"),i=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),a=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),o=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs"),s=require("./endpointPaths.cjs");let c=require("@ahoo-wang/fetcher-decorator");var l=class{constructor(e){this.apiMetadata=e,r.bindMethods(this)}aggregate(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}aggregateStream(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}cursor(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}cursorState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}count(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}list(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}listStream(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}listState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}listStateStream(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}paged(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}pagedState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}single(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}singleState(e,t,n){throw(0,c.autoGeneratedError)(e,t,n)}getById(n,r,i){let a=t.singleQuery({filter:e.filter.aggregateId(n)});return this.single(a,r,i)}getStateById(n,r,i){let a=t.singleQuery({filter:e.filter.aggregateId(n)});return this.singleState(a,r,i)}getByIds(n,r,i){if(n.length===0)return Promise.resolve([]);let a=t.listQuery({filter:e.filter.aggregateIds(n),limit:n.length});return this.list(a,r,i)}getStateByIds(n,r,i){if(n.length===0)return Promise.resolve([]);let a=t.listQuery({filter:e.filter.aggregateIds(n),limit:n.length});return this.listState(a,r,i)}};o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.AGGREGATION),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`aggregate`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.AGGREGATION,n.QUERY_STREAM_ENDPOINT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`aggregateStream`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.CURSOR),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`cursor`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.CURSOR_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`cursorState`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.COUNT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`count`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`list`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST,n.QUERY_STREAM_ENDPOINT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`listStream`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`listState`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.LIST_STATE,n.QUERY_STREAM_ENDPOINT),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`listStateStream`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.PAGED),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`paged`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.PAGED_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`pagedState`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.SINGLE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`single`,null),o.default([(0,c.post)(s.SnapshotQueryEndpointPaths.SINGLE_STATE),a.default(0,(0,c.body)()),a.default(1,(0,c.attribute)()),i.default(`design:type`,Function),i.default(`design:paramtypes`,[Object,typeof Record>`u`?Object:Record,Object]),i.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],l.prototype,`singleState`,null),l=o.default([(0,c.api)(),i.default(`design:paramtypes`,[Object])],l),Object.defineProperty(exports,"SnapshotQueryClient",{enumerable:!0,get:function(){return l}});
2
2
  //# sourceMappingURL=snapshotQueryClient.cjs.map
@@ -2,9 +2,9 @@ import { filter as e } from "../../../dsl/filter/builders.es.js";
2
2
  import { listQuery as t, singleQuery as n } from "../../../dsl/queryable.es.js";
3
3
  import { QUERY_STREAM_ENDPOINT as r } from "../../../transport/endpoints.es.js";
4
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";
5
+ import a from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
6
+ import o from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
7
+ import s from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
8
8
  import { SnapshotQueryEndpointPaths as c } from "./endpointPaths.es.js";
9
9
  import { api as l, attribute as u, autoGeneratedError as d, body as f, post as p } from "@ahoo-wang/fetcher-decorator";
10
10
  //#region src/client/query/snapshot/snapshotQueryClient.ts
@@ -1,2 +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"),i=require("./endpointPaths.cjs");let a=require("@ahoo-wang/fetcher-decorator");var o=class{constructor(t){this.apiMetadata=t,e.bindMethods(this)}load(e,t){throw(0,a.autoGeneratedError)(e,t)}loadVersioned(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}loadTimeBased(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}};r.default([(0,a.get)(i.LoadOwnerStateAggregateEndpointPaths.LOAD),n.default(0,(0,a.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)],o.prototype,`load`,null),r.default([(0,a.get)(i.LoadOwnerStateAggregateEndpointPaths.LOAD_VERSIONED),n.default(0,(0,a.path)(`version`)),n.default(1,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadVersioned`,null),r.default([(0,a.get)(i.LoadOwnerStateAggregateEndpointPaths.LOAD_TIME_BASED),n.default(0,(0,a.path)(`createTime`)),n.default(1,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadTimeBased`,null),o=r.default([(0,a.api)(),t.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"LoadOwnerStateAggregateClient",{enumerable:!0,get:function(){return o}});
1
+ const e=require("../../bindMethods.cjs"),t=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),r=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs"),i=require("./endpointPaths.cjs");let a=require("@ahoo-wang/fetcher-decorator");var o=class{constructor(t){this.apiMetadata=t,e.bindMethods(this)}load(e,t){throw(0,a.autoGeneratedError)(e,t)}loadVersioned(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}loadTimeBased(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}};r.default([(0,a.get)(i.LoadOwnerStateAggregateEndpointPaths.LOAD),n.default(0,(0,a.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)],o.prototype,`load`,null),r.default([(0,a.get)(i.LoadOwnerStateAggregateEndpointPaths.LOAD_VERSIONED),n.default(0,(0,a.path)(`version`)),n.default(1,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadVersioned`,null),r.default([(0,a.get)(i.LoadOwnerStateAggregateEndpointPaths.LOAD_TIME_BASED),n.default(0,(0,a.path)(`createTime`)),n.default(1,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadTimeBased`,null),o=r.default([(0,a.api)(),t.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"LoadOwnerStateAggregateClient",{enumerable:!0,get:function(){return o}});
2
2
  //# sourceMappingURL=loadOwnerStateAggregateClient.cjs.map
@@ -1,7 +1,7 @@
1
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";
2
+ import t from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
3
+ import n from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
4
+ import r from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
5
5
  import { LoadOwnerStateAggregateEndpointPaths as i } from "./endpointPaths.es.js";
6
6
  import { api as a, attribute as o, autoGeneratedError as s, get as c, path as l } from "@ahoo-wang/fetcher-decorator";
7
7
  //#region src/client/query/state/loadOwnerStateAggregateClient.ts
@@ -1,2 +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"),i=require("./endpointPaths.cjs");let a=require("@ahoo-wang/fetcher-decorator");var o=class{constructor(t){this.apiMetadata=t,e.bindMethods(this)}load(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}loadVersioned(e,t,n,r){throw(0,a.autoGeneratedError)(e,t,n,r)}loadTimeBased(e,t,n,r){throw(0,a.autoGeneratedError)(e,t,n,r)}};r.default([(0,a.get)(i.LoadStateAggregateEndpointPaths.LOAD),n.default(0,(0,a.path)(`id`)),n.default(1,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[String,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`load`,null),r.default([(0,a.get)(i.LoadStateAggregateEndpointPaths.LOAD_VERSIONED),n.default(0,(0,a.path)(`id`)),n.default(1,(0,a.path)(`version`)),n.default(2,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[String,Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadVersioned`,null),r.default([(0,a.get)(i.LoadStateAggregateEndpointPaths.LOAD_TIME_BASED),n.default(0,(0,a.path)(`id`)),n.default(1,(0,a.path)(`createTime`)),n.default(2,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[String,Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadTimeBased`,null),o=r.default([(0,a.api)(),t.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"LoadStateAggregateClient",{enumerable:!0,get:function(){return o}});
1
+ const e=require("../../bindMethods.cjs"),t=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),r=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs"),i=require("./endpointPaths.cjs");let a=require("@ahoo-wang/fetcher-decorator");var o=class{constructor(t){this.apiMetadata=t,e.bindMethods(this)}load(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}loadVersioned(e,t,n,r){throw(0,a.autoGeneratedError)(e,t,n,r)}loadTimeBased(e,t,n,r){throw(0,a.autoGeneratedError)(e,t,n,r)}};r.default([(0,a.get)(i.LoadStateAggregateEndpointPaths.LOAD),n.default(0,(0,a.path)(`id`)),n.default(1,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[String,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`load`,null),r.default([(0,a.get)(i.LoadStateAggregateEndpointPaths.LOAD_VERSIONED),n.default(0,(0,a.path)(`id`)),n.default(1,(0,a.path)(`version`)),n.default(2,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[String,Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadVersioned`,null),r.default([(0,a.get)(i.LoadStateAggregateEndpointPaths.LOAD_TIME_BASED),n.default(0,(0,a.path)(`id`)),n.default(1,(0,a.path)(`createTime`)),n.default(2,(0,a.attribute)()),t.default(`design:type`,Function),t.default(`design:paramtypes`,[String,Number,typeof Record>`u`?Object:Record,Object]),t.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],o.prototype,`loadTimeBased`,null),o=r.default([(0,a.api)(),t.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"LoadStateAggregateClient",{enumerable:!0,get:function(){return o}});
2
2
  //# sourceMappingURL=loadStateAggregateClient.cjs.map
@@ -1,7 +1,7 @@
1
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";
2
+ import t from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
3
+ import n from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
4
+ import r from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
5
5
  import { LoadStateAggregateEndpointPaths as i } from "./endpointPaths.es.js";
6
6
  import { api as a, attribute as o, autoGeneratedError as s, get as c, path as l } from "@ahoo-wang/fetcher-decorator";
7
7
  //#region src/client/query/state/loadStateAggregateClient.ts
@@ -1,2 +1,2 @@
1
- function e(e){return[...e].every(e=>{let t=e.charCodeAt(0);return t>=9&&t<=13||t>=28&&t<=31||/^[\p{Zs}\p{Zl}\p{Zp}]$/u.test(e)})}var t={G:5,u:19,y:19,Q:5,q:5,M:5,L:5,D:3,d:2,F:1,E:5,e:5,c:[1,3,4,5],a:1,B:[1,4,5],h:2,H:2,k:2,K:2,m:2,s:2,S:9,A:19,n:19,N:19,V:[2],v:[1,4],z:4,O:[1,4],X:5,x:5,Z:5,W:1,w:2,Y:1/0,g:19};function n(e,n,r){let i=t[n];if(!(typeof i==`number`?r<=i:i?.includes(r)===!0))throw TypeError(`datePattern is invalid: [${e}].`)}function r(e,t){return e!==void 0&&(`uyDFdhHkKmsSgAnNWwY`.includes(e)||e===`c`&&t===1||`eMLQq`.includes(e)&&t<=2)}function i(t){if(typeof t!=`string`||e(t))throw TypeError(`datePattern cannot be blank.`);let i=!1,a=0;for(let e=0;e<t.length;e++){let o=t[e];if(o===`'`){t[e+1]===`'`?e++:i=!i;continue}if(!i){if(/[A-Za-z]/.test(o)){let i=o,a=e+1;for(;t[a]===i;)a++;let s=a-e,c=!1;if(i===`p`){if(c=!0,i=t[a],!i||!/[A-Za-z]/.test(i))throw TypeError(`datePattern is invalid: [${t}].`);let e=a++;for(;t[a]===i;)a++;s=a-e}if(n(t,i,s),c&&r(i,s)){let e=t[a],n=a;for(;n<t.length&&t[n]===e;)n++;if(r(e,n-a))throw TypeError(`datePattern is invalid: [${t}].`)}e=a-1}else if(o===`[`)a++;else if(o===`]`){if(a===0)throw TypeError(`datePattern is invalid: [${t}].`);a--}else if(`{}#`.includes(o))throw TypeError(`datePattern is invalid: [${t}].`)}}if(i)throw TypeError(`datePattern is invalid: [${t}].`)}exports.validateDatePattern=i;
1
+ function e(e){return[...e].every(e=>{let t=e.charCodeAt(0);return t>=9&&t<=13||t>=28&&t<=31||/^[\p{Zs}\p{Zl}\p{Zp}]$/u.test(e)})}var t={G:5,u:19,y:19,Q:5,q:5,M:5,L:5,D:3,d:2,F:1,E:5,e:5,c:[1,3,4,5],a:1,B:[1,4,5],h:2,H:2,k:2,K:2,m:2,s:2,S:9,A:19,n:19,N:19,V:[2],v:[1,4],z:4,O:[1,4],X:5,x:5,Z:5,W:1,w:2,Y:1/0,g:19};function n(e,n,r){let i=t[n];if(!(typeof i==`number`?r<=i:i?.includes(r)===!0))throw TypeError(`datePattern is invalid: [${e}].`)}function r(e,t){return e!==void 0&&(`uyDFdhHkKmsSgAnNWwY`.includes(e)||e===`c`&&t===1||`eMLQq`.includes(e)&&t<=2)}function i(t){if(typeof t!=`string`||e(t))throw TypeError(`datePattern cannot be blank.`);let i=!1,a=0;for(let e=0;e<t.length;e++){let o=t[e];if(o===`'`)t[e+1]===`'`?e++:i=!i;else if(!i){if(/[A-Za-z]/.test(o)){let i=o,a=e+1;for(;t[a]===i;)a++;let s=a-e,c=!1;if(i===`p`){if(c=!0,i=t[a],!i||!/[A-Za-z]/.test(i))throw TypeError(`datePattern is invalid: [${t}].`);let e=a++;for(;t[a]===i;)a++;s=a-e}if(n(t,i,s),c&&r(i,s)){let e=t[a],n=a;for(;n<t.length&&t[n]===e;)n++;if(r(e,n-a))throw TypeError(`datePattern is invalid: [${t}].`)}e=a-1}else if(o===`[`)a++;else if(o===`]`){if(a===0)throw TypeError(`datePattern is invalid: [${t}].`);a--}else if(`{}#`.includes(o))throw TypeError(`datePattern is invalid: [${t}].`)}}if(i)throw TypeError(`datePattern is invalid: [${t}].`)}exports.validateDatePattern=i;
2
2
  //# sourceMappingURL=datePattern.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"datePattern.cjs","names":["isKotlinBlank","value","code","character","DATE_PATTERN_COUNTS","validateDatePatternLetter","allowed","letter","count","pattern","isNumericDatePatternLetter","validateDatePattern","quoted","optionalDepth","index","end","padded","fieldStart","nextLetter","nextEnd"],"sources":["../../../src/dsl/filter/datePattern.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: not re-exported by filter/index.ts. The pattern syntax of\n// `java.time.format.DateTimeFormatter`, as far as `datePattern` is checked\n// before it reaches the server.\n\n/**\n * Kotlin's `String.isBlank()`: every character is `Char.isWhitespace()`,\n * which is Java's `isWhitespace` or `isSpaceChar` — the Unicode separators\n * (Zs, Zl, Zp) plus the controls U+0009–U+000D and U+001C–U+001F.\n * `String.trim()` is not the same set: it strips U+FEFF, which Kotlin keeps as\n * a literal, and keeps U+001C–U+001F, which Kotlin counts as blank.\n */\nfunction isKotlinBlank(value: string): boolean {\n return [...value].every(character => {\n const code = character.charCodeAt(0);\n return (\n (code >= 0x09 && code <= 0x0d) ||\n (code >= 0x1c && code <= 0x1f) ||\n /^[\\p{Zs}\\p{Zl}\\p{Zp}]$/u.test(character)\n );\n });\n}\n\n/** The repeat counts each pattern letter accepts. */\nconst DATE_PATTERN_COUNTS: Readonly<\n Record<string, number | readonly number[]>\n> = {\n G: 5,\n u: 19,\n y: 19,\n Q: 5,\n q: 5,\n M: 5,\n L: 5,\n D: 3,\n d: 2,\n F: 1,\n E: 5,\n e: 5,\n c: [1, 3, 4, 5],\n a: 1,\n B: [1, 4, 5],\n h: 2,\n H: 2,\n k: 2,\n K: 2,\n m: 2,\n s: 2,\n S: 9,\n A: 19,\n n: 19,\n N: 19,\n V: [2],\n v: [1, 4],\n z: 4,\n O: [1, 4],\n X: 5,\n x: 5,\n Z: 5,\n W: 1,\n w: 2,\n Y: Number.POSITIVE_INFINITY,\n g: 19,\n};\n\nfunction validateDatePatternLetter(\n pattern: string,\n letter: string,\n count: number,\n): void {\n const allowed = DATE_PATTERN_COUNTS[letter];\n const valid =\n typeof allowed === 'number'\n ? count <= allowed\n : allowed?.includes(count) === true;\n if (!valid) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n\nfunction isNumericDatePatternLetter(\n letter: string | undefined,\n count: number,\n): boolean {\n return (\n letter !== undefined &&\n ('uyDFdhHkKmsSgAnNWwY'.includes(letter) ||\n (letter === 'c' && count === 1) ||\n ('eMLQq'.includes(letter) && count <= 2))\n );\n}\n\n/**\n * Refuses a `datePattern` Wow refuses: a blank one (blank as Kotlin counts\n * it), and one `DateTimeFormatter.ofPattern` would refuse — an unknown letter\n * or repeat count, an unclosed quote, a `]` without its `[`, a reserved\n * character, or a padded numeric field followed directly by another numeric\n * field. `test/dsl/datePattern.test.ts` holds this to a corpus the JVM judged.\n */\nexport function validateDatePattern(pattern: string): void {\n if (typeof pattern !== 'string' || isKotlinBlank(pattern)) {\n throw new TypeError('datePattern cannot be blank.');\n }\n let quoted = false;\n let optionalDepth = 0;\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern[index];\n if (character === \"'\") {\n if (pattern[index + 1] === \"'\") {\n index++;\n } else {\n quoted = !quoted;\n }\n continue;\n }\n if (quoted) continue;\n if (/[A-Za-z]/.test(character)) {\n let letter = character;\n let end = index + 1;\n while (pattern[end] === letter) end++;\n let count = end - index;\n let padded = false;\n if (letter === 'p') {\n padded = true;\n letter = pattern[end];\n if (!letter || !/[A-Za-z]/.test(letter)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n const fieldStart = end++;\n while (pattern[end] === letter) end++;\n count = end - fieldStart;\n }\n validateDatePatternLetter(pattern, letter, count);\n if (padded && isNumericDatePatternLetter(letter, count)) {\n const nextLetter = pattern[end];\n let nextEnd = end;\n while (nextEnd < pattern.length && pattern[nextEnd] === nextLetter)\n nextEnd++;\n if (isNumericDatePatternLetter(nextLetter, nextEnd - end)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n index = end - 1;\n } else if (character === '[') {\n optionalDepth++;\n } else if (character === ']') {\n if (optionalDepth === 0)\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n optionalDepth--;\n } else if ('{}#'.includes(character)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n if (quoted) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"datePattern.cjs","names":["isKotlinBlank","value","code","character","DATE_PATTERN_COUNTS","validateDatePatternLetter","allowed","letter","count","pattern","isNumericDatePatternLetter","validateDatePattern","quoted","optionalDepth","index","end","padded","fieldStart","nextLetter","nextEnd"],"sources":["../../../src/dsl/filter/datePattern.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: not re-exported by filter/index.ts. The pattern syntax of\n// `java.time.format.DateTimeFormatter`, as far as `datePattern` is checked\n// before it reaches the server.\n\n/**\n * Kotlin's `String.isBlank()`: every character is `Char.isWhitespace()`,\n * which is Java's `isWhitespace` or `isSpaceChar` — the Unicode separators\n * (Zs, Zl, Zp) plus the controls U+0009–U+000D and U+001C–U+001F.\n * `String.trim()` is not the same set: it strips U+FEFF, which Kotlin keeps as\n * a literal, and keeps U+001C–U+001F, which Kotlin counts as blank.\n */\nfunction isKotlinBlank(value: string): boolean {\n return [...value].every(character => {\n const code = character.charCodeAt(0);\n return (\n (code >= 0x09 && code <= 0x0d) ||\n (code >= 0x1c && code <= 0x1f) ||\n /^[\\p{Zs}\\p{Zl}\\p{Zp}]$/u.test(character)\n );\n });\n}\n\n/** The repeat counts each pattern letter accepts. */\nconst DATE_PATTERN_COUNTS: Readonly<\n Record<string, number | readonly number[]>\n> = {\n G: 5,\n u: 19,\n y: 19,\n Q: 5,\n q: 5,\n M: 5,\n L: 5,\n D: 3,\n d: 2,\n F: 1,\n E: 5,\n e: 5,\n c: [1, 3, 4, 5],\n a: 1,\n B: [1, 4, 5],\n h: 2,\n H: 2,\n k: 2,\n K: 2,\n m: 2,\n s: 2,\n S: 9,\n A: 19,\n n: 19,\n N: 19,\n V: [2],\n v: [1, 4],\n z: 4,\n O: [1, 4],\n X: 5,\n x: 5,\n Z: 5,\n W: 1,\n w: 2,\n Y: Number.POSITIVE_INFINITY,\n g: 19,\n};\n\nfunction validateDatePatternLetter(\n pattern: string,\n letter: string,\n count: number,\n): void {\n const allowed = DATE_PATTERN_COUNTS[letter];\n const valid =\n typeof allowed === 'number'\n ? count <= allowed\n : allowed?.includes(count) === true;\n if (!valid) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n\nfunction isNumericDatePatternLetter(\n letter: string | undefined,\n count: number,\n): boolean {\n return (\n letter !== undefined &&\n ('uyDFdhHkKmsSgAnNWwY'.includes(letter) ||\n (letter === 'c' && count === 1) ||\n ('eMLQq'.includes(letter) && count <= 2))\n );\n}\n\n/**\n * Refuses a `datePattern` Wow refuses: a blank one (blank as Kotlin counts\n * it), and one `DateTimeFormatter.ofPattern` would refuse — an unknown letter\n * or repeat count, an unclosed quote, a `]` without its `[`, a reserved\n * character, or a padded numeric field followed directly by another numeric\n * field. `test/dsl/datePattern.test.ts` holds this to a corpus the JVM judged.\n */\nexport function validateDatePattern(pattern: string): void {\n if (typeof pattern !== 'string' || isKotlinBlank(pattern)) {\n throw new TypeError('datePattern cannot be blank.');\n }\n let quoted = false;\n let optionalDepth = 0;\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern[index];\n if (character === \"'\") {\n if (pattern[index + 1] === \"'\") {\n index++;\n } else {\n quoted = !quoted;\n }\n continue;\n }\n if (quoted) continue;\n if (/[A-Za-z]/.test(character)) {\n let letter = character;\n let end = index + 1;\n while (pattern[end] === letter) end++;\n let count = end - index;\n let padded = false;\n if (letter === 'p') {\n padded = true;\n letter = pattern[end];\n if (!letter || !/[A-Za-z]/.test(letter)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n const fieldStart = end++;\n while (pattern[end] === letter) end++;\n count = end - fieldStart;\n }\n validateDatePatternLetter(pattern, letter, count);\n if (padded && isNumericDatePatternLetter(letter, count)) {\n const nextLetter = pattern[end];\n let nextEnd = end;\n while (nextEnd < pattern.length && pattern[nextEnd] === nextLetter)\n nextEnd++;\n if (isNumericDatePatternLetter(nextLetter, nextEnd - end)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n index = end - 1;\n } else if (character === '[') {\n optionalDepth++;\n } else if (character === ']') {\n if (optionalDepth === 0)\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n optionalDepth--;\n } else if ('{}#'.includes(character)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n if (quoted) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n"],"mappings":"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"}
@@ -64,11 +64,8 @@ function i(t) {
64
64
  let i = !1, a = 0;
65
65
  for (let e = 0; e < t.length; e++) {
66
66
  let o = t[e];
67
- if (o === "'") {
68
- t[e + 1] === "'" ? e++ : i = !i;
69
- continue;
70
- }
71
- if (!i) {
67
+ if (o === "'") t[e + 1] === "'" ? e++ : i = !i;
68
+ else if (!i) {
72
69
  if (/[A-Za-z]/.test(o)) {
73
70
  let i = o, a = e + 1;
74
71
  for (; t[a] === i;) a++;
@@ -1 +1 @@
1
- {"version":3,"file":"datePattern.es.js","names":["isKotlinBlank","value","code","character","DATE_PATTERN_COUNTS","validateDatePatternLetter","allowed","letter","count","pattern","isNumericDatePatternLetter","validateDatePattern","quoted","optionalDepth","index","end","padded","fieldStart","nextLetter","nextEnd"],"sources":["../../../src/dsl/filter/datePattern.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: not re-exported by filter/index.ts. The pattern syntax of\n// `java.time.format.DateTimeFormatter`, as far as `datePattern` is checked\n// before it reaches the server.\n\n/**\n * Kotlin's `String.isBlank()`: every character is `Char.isWhitespace()`,\n * which is Java's `isWhitespace` or `isSpaceChar` — the Unicode separators\n * (Zs, Zl, Zp) plus the controls U+0009–U+000D and U+001C–U+001F.\n * `String.trim()` is not the same set: it strips U+FEFF, which Kotlin keeps as\n * a literal, and keeps U+001C–U+001F, which Kotlin counts as blank.\n */\nfunction isKotlinBlank(value: string): boolean {\n return [...value].every(character => {\n const code = character.charCodeAt(0);\n return (\n (code >= 0x09 && code <= 0x0d) ||\n (code >= 0x1c && code <= 0x1f) ||\n /^[\\p{Zs}\\p{Zl}\\p{Zp}]$/u.test(character)\n );\n });\n}\n\n/** The repeat counts each pattern letter accepts. */\nconst DATE_PATTERN_COUNTS: Readonly<\n Record<string, number | readonly number[]>\n> = {\n G: 5,\n u: 19,\n y: 19,\n Q: 5,\n q: 5,\n M: 5,\n L: 5,\n D: 3,\n d: 2,\n F: 1,\n E: 5,\n e: 5,\n c: [1, 3, 4, 5],\n a: 1,\n B: [1, 4, 5],\n h: 2,\n H: 2,\n k: 2,\n K: 2,\n m: 2,\n s: 2,\n S: 9,\n A: 19,\n n: 19,\n N: 19,\n V: [2],\n v: [1, 4],\n z: 4,\n O: [1, 4],\n X: 5,\n x: 5,\n Z: 5,\n W: 1,\n w: 2,\n Y: Number.POSITIVE_INFINITY,\n g: 19,\n};\n\nfunction validateDatePatternLetter(\n pattern: string,\n letter: string,\n count: number,\n): void {\n const allowed = DATE_PATTERN_COUNTS[letter];\n const valid =\n typeof allowed === 'number'\n ? count <= allowed\n : allowed?.includes(count) === true;\n if (!valid) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n\nfunction isNumericDatePatternLetter(\n letter: string | undefined,\n count: number,\n): boolean {\n return (\n letter !== undefined &&\n ('uyDFdhHkKmsSgAnNWwY'.includes(letter) ||\n (letter === 'c' && count === 1) ||\n ('eMLQq'.includes(letter) && count <= 2))\n );\n}\n\n/**\n * Refuses a `datePattern` Wow refuses: a blank one (blank as Kotlin counts\n * it), and one `DateTimeFormatter.ofPattern` would refuse — an unknown letter\n * or repeat count, an unclosed quote, a `]` without its `[`, a reserved\n * character, or a padded numeric field followed directly by another numeric\n * field. `test/dsl/datePattern.test.ts` holds this to a corpus the JVM judged.\n */\nexport function validateDatePattern(pattern: string): void {\n if (typeof pattern !== 'string' || isKotlinBlank(pattern)) {\n throw new TypeError('datePattern cannot be blank.');\n }\n let quoted = false;\n let optionalDepth = 0;\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern[index];\n if (character === \"'\") {\n if (pattern[index + 1] === \"'\") {\n index++;\n } else {\n quoted = !quoted;\n }\n continue;\n }\n if (quoted) continue;\n if (/[A-Za-z]/.test(character)) {\n let letter = character;\n let end = index + 1;\n while (pattern[end] === letter) end++;\n let count = end - index;\n let padded = false;\n if (letter === 'p') {\n padded = true;\n letter = pattern[end];\n if (!letter || !/[A-Za-z]/.test(letter)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n const fieldStart = end++;\n while (pattern[end] === letter) end++;\n count = end - fieldStart;\n }\n validateDatePatternLetter(pattern, letter, count);\n if (padded && isNumericDatePatternLetter(letter, count)) {\n const nextLetter = pattern[end];\n let nextEnd = end;\n while (nextEnd < pattern.length && pattern[nextEnd] === nextLetter)\n nextEnd++;\n if (isNumericDatePatternLetter(nextLetter, nextEnd - end)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n index = end - 1;\n } else if (character === '[') {\n optionalDepth++;\n } else if (character === ']') {\n if (optionalDepth === 0)\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n optionalDepth--;\n } else if ('{}#'.includes(character)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n if (quoted) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"datePattern.es.js","names":["isKotlinBlank","value","code","character","DATE_PATTERN_COUNTS","validateDatePatternLetter","allowed","letter","count","pattern","isNumericDatePatternLetter","validateDatePattern","quoted","optionalDepth","index","end","padded","fieldStart","nextLetter","nextEnd"],"sources":["../../../src/dsl/filter/datePattern.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: not re-exported by filter/index.ts. The pattern syntax of\n// `java.time.format.DateTimeFormatter`, as far as `datePattern` is checked\n// before it reaches the server.\n\n/**\n * Kotlin's `String.isBlank()`: every character is `Char.isWhitespace()`,\n * which is Java's `isWhitespace` or `isSpaceChar` — the Unicode separators\n * (Zs, Zl, Zp) plus the controls U+0009–U+000D and U+001C–U+001F.\n * `String.trim()` is not the same set: it strips U+FEFF, which Kotlin keeps as\n * a literal, and keeps U+001C–U+001F, which Kotlin counts as blank.\n */\nfunction isKotlinBlank(value: string): boolean {\n return [...value].every(character => {\n const code = character.charCodeAt(0);\n return (\n (code >= 0x09 && code <= 0x0d) ||\n (code >= 0x1c && code <= 0x1f) ||\n /^[\\p{Zs}\\p{Zl}\\p{Zp}]$/u.test(character)\n );\n });\n}\n\n/** The repeat counts each pattern letter accepts. */\nconst DATE_PATTERN_COUNTS: Readonly<\n Record<string, number | readonly number[]>\n> = {\n G: 5,\n u: 19,\n y: 19,\n Q: 5,\n q: 5,\n M: 5,\n L: 5,\n D: 3,\n d: 2,\n F: 1,\n E: 5,\n e: 5,\n c: [1, 3, 4, 5],\n a: 1,\n B: [1, 4, 5],\n h: 2,\n H: 2,\n k: 2,\n K: 2,\n m: 2,\n s: 2,\n S: 9,\n A: 19,\n n: 19,\n N: 19,\n V: [2],\n v: [1, 4],\n z: 4,\n O: [1, 4],\n X: 5,\n x: 5,\n Z: 5,\n W: 1,\n w: 2,\n Y: Number.POSITIVE_INFINITY,\n g: 19,\n};\n\nfunction validateDatePatternLetter(\n pattern: string,\n letter: string,\n count: number,\n): void {\n const allowed = DATE_PATTERN_COUNTS[letter];\n const valid =\n typeof allowed === 'number'\n ? count <= allowed\n : allowed?.includes(count) === true;\n if (!valid) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n\nfunction isNumericDatePatternLetter(\n letter: string | undefined,\n count: number,\n): boolean {\n return (\n letter !== undefined &&\n ('uyDFdhHkKmsSgAnNWwY'.includes(letter) ||\n (letter === 'c' && count === 1) ||\n ('eMLQq'.includes(letter) && count <= 2))\n );\n}\n\n/**\n * Refuses a `datePattern` Wow refuses: a blank one (blank as Kotlin counts\n * it), and one `DateTimeFormatter.ofPattern` would refuse — an unknown letter\n * or repeat count, an unclosed quote, a `]` without its `[`, a reserved\n * character, or a padded numeric field followed directly by another numeric\n * field. `test/dsl/datePattern.test.ts` holds this to a corpus the JVM judged.\n */\nexport function validateDatePattern(pattern: string): void {\n if (typeof pattern !== 'string' || isKotlinBlank(pattern)) {\n throw new TypeError('datePattern cannot be blank.');\n }\n let quoted = false;\n let optionalDepth = 0;\n for (let index = 0; index < pattern.length; index++) {\n const character = pattern[index];\n if (character === \"'\") {\n if (pattern[index + 1] === \"'\") {\n index++;\n } else {\n quoted = !quoted;\n }\n continue;\n }\n if (quoted) continue;\n if (/[A-Za-z]/.test(character)) {\n let letter = character;\n let end = index + 1;\n while (pattern[end] === letter) end++;\n let count = end - index;\n let padded = false;\n if (letter === 'p') {\n padded = true;\n letter = pattern[end];\n if (!letter || !/[A-Za-z]/.test(letter)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n const fieldStart = end++;\n while (pattern[end] === letter) end++;\n count = end - fieldStart;\n }\n validateDatePatternLetter(pattern, letter, count);\n if (padded && isNumericDatePatternLetter(letter, count)) {\n const nextLetter = pattern[end];\n let nextEnd = end;\n while (nextEnd < pattern.length && pattern[nextEnd] === nextLetter)\n nextEnd++;\n if (isNumericDatePatternLetter(nextLetter, nextEnd - end)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n index = end - 1;\n } else if (character === '[') {\n optionalDepth++;\n } else if (character === ']') {\n if (optionalDepth === 0)\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n optionalDepth--;\n } else if ('{}#'.includes(character)) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n }\n if (quoted) {\n throw new TypeError(`datePattern is invalid: [${pattern}].`);\n }\n}\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- const e=require("../error/wowError.cjs"),t=require("../model/command.cjs");let n=require("@ahoo-wang/fetcher-eventstream");var r=`message`,i=new Set(Object.values(t.CommandStage));function a(t){return new TransformStream({transform(n,r){if(t(n.event)){r.enqueue(n.data);return}r.error(new e.WowError(e.isErrorInfo(n.data)?n.data:{errorCode:n.event,errorMsg:``}))}})}var o=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(a(e=>e===r)),s=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(a(e=>i.has(e)));exports.CommandResultEventStreamResultExtractor=s,exports.QueryEventStreamResultExtractor=o;
1
+ const e=require("../error/wowError.cjs"),t=require("../model/command.cjs");let n=require("@ahoo-wang/fetcher-eventstream");var r=`message`,i=new Set(Object.values(t.CommandStage));function a(t){return new TransformStream({transform(n,r){t(n.event)?r.enqueue(n.data):r.error(new e.WowError(e.isErrorInfo(n.data)?n.data:{errorCode:n.event,errorMsg:``}))}})}var o=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(a(e=>e===r)),s=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(a(e=>i.has(e)));exports.CommandResultEventStreamResultExtractor=s,exports.QueryEventStreamResultExtractor=o;
2
2
  //# sourceMappingURL=eventStreams.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventStreams.cjs","names":["CommandStage","WowError","isErrorInfo","JsonEventStreamResultExtractor","require_wowError","require_command","_ahoo_wang_fetcher_eventstream","ROW_EVENT","COMMAND_STAGES","rowsUntilErrorEvent","isData","event","controller","QueryEventStreamResultExtractor","exchange","eventName","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.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 { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (eventName: string) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event.event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(eventName => eventName === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(eventName =>\n COMMAND_STAGES.has(eventName),\n ),\n );\n"],"mappings":"2HA0BA,IAAMO,EAAY,UAEZC,EAAsC,IAAI,IAC9C,OAAO,OAAOR,EAAAA,YAAY,CAC5B,EAiBA,SAASS,EACP,EACkD,CAClD,OAAO,IAAI,gBAAgB,CACzB,UAAU,EAAO,EAAY,CAC3B,GAAIC,EAAOC,EAAM,KAAK,EAAG,CACvBC,EAAW,QAAQD,EAAM,IAAS,EAClC,MACF,CACAC,EAAW,MACT,IAAIX,EAAAA,SACFC,EAAAA,YAAYS,EAAM,IAAI,EAClBA,EAAM,KACN,CAAE,UAAWA,EAAM,MAAO,SAAU,EAAG,CAC7C,CACF,CACF,CACF,CAAC,CACH,CAYA,IAAaE,EAET,KAAM,KACP,MAAA,EAAMV,EAAAA,+BAAAA,CAA+BW,CAAQ,EAAA,CAAG,YAC/CL,EAAoB,GAAaM,IAAcR,CAAS,CAC1D,EAWWS,EAET,KAAM,KACP,MAAA,EAAMb,EAAAA,+BAAAA,CAA+BW,CAAQ,EAAA,CAAG,YAC/CL,EAAmC,GACjCD,EAAe,IAAIO,CAAS,CAC9B,CACF"}
1
+ {"version":3,"file":"eventStreams.cjs","names":["CommandStage","WowError","isErrorInfo","JsonEventStreamResultExtractor","require_wowError","require_command","_ahoo_wang_fetcher_eventstream","ROW_EVENT","COMMAND_STAGES","rowsUntilErrorEvent","isData","event","controller","QueryEventStreamResultExtractor","exchange","eventName","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.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 { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (eventName: string) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event.event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(eventName => eventName === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(eventName =>\n COMMAND_STAGES.has(eventName),\n ),\n );\n"],"mappings":"2HA0BA,IAAMO,EAAY,UAEZC,EAAsC,IAAI,IAC9C,OAAO,OAAOR,EAAAA,YAAY,CAC5B,EAiBA,SAASS,EACP,EACkD,CAClD,OAAO,IAAI,gBAAgB,CACzB,UAAU,EAAO,EAAY,CACvBC,EAAOC,EAAM,KAAK,EACpBC,EAAW,QAAQD,EAAM,IAAS,EAGpCC,EAAW,MACT,IAAIX,EAAAA,SACFC,EAAAA,YAAYS,EAAM,IAAI,EAClBA,EAAM,KACN,CAAE,UAAWA,EAAM,MAAO,SAAU,EAAG,CAC7C,CACF,CACF,CACF,CAAC,CACH,CAYA,IAAaE,EAET,KAAM,KACP,MAAA,EAAMV,EAAAA,+BAAAA,CAA+BW,CAAQ,EAAA,CAAG,YAC/CL,EAAoB,GAAaM,IAAcR,CAAS,CAC1D,EAWWS,EAET,KAAM,KACP,MAAA,EAAMb,EAAAA,+BAAAA,CAA+BW,CAAQ,EAAA,CAAG,YAC/CL,EAAmC,GACjCD,EAAe,IAAIO,CAAS,CAC9B,CACF"}
@@ -5,11 +5,7 @@ import { JsonEventStreamResultExtractor as r } from "@ahoo-wang/fetcher-eventstr
5
5
  var i = "message", a = new Set(Object.values(n));
6
6
  function o(n) {
7
7
  return new TransformStream({ transform(r, i) {
8
- if (n(r.event)) {
9
- i.enqueue(r.data);
10
- return;
11
- }
12
- i.error(new e(t(r.data) ? r.data : {
8
+ n(r.event) ? i.enqueue(r.data) : i.error(new e(t(r.data) ? r.data : {
13
9
  errorCode: r.event,
14
10
  errorMsg: ""
15
11
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"eventStreams.es.js","names":["ROW_EVENT","COMMAND_STAGES","CommandStage","rowsUntilErrorEvent","isData","event","WowError","isErrorInfo","QueryEventStreamResultExtractor","JsonEventStreamResultExtractor","exchange","eventName","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.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 { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (eventName: string) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event.event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(eventName => eventName === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(eventName =>\n COMMAND_STAGES.has(eventName),\n ),\n );\n"],"mappings":";;;;AA0BA,IAAMA,IAAY,WAEZC,IAAsC,IAAI,IAC9C,OAAO,OAAOC,CAAY,CAC5B;AAiBA,SAASC,EACP,GACkD;CAClD,OAAO,IAAI,gBAAgB,EACzB,UAAU,GAAO,GAAY;EAC3B,IAAIC,EAAOC,EAAM,KAAK,GAAG;GACvB,EAAW,QAAQA,EAAM,IAAS;GAClC;EACF;EACA,EAAW,MACT,IAAIC,EACFC,EAAYF,EAAM,IAAI,IAClBA,EAAM,OACN;GAAE,WAAWA,EAAM;GAAO,UAAU;EAAG,CAC7C,CACF;CACF,EACF,CAAC;AACH;AAYA,IAAaG,IAET,OAAM,OACP,MAAMC,EAA+BC,CAAQ,EAAA,CAAG,YAC/CP,GAAoB,MAAaQ,MAAcX,CAAS,CAC1D,GAWWY,IAET,OAAM,OACP,MAAMH,EAA+BC,CAAQ,EAAA,CAAG,YAC/CP,GAAmC,MACjCF,EAAe,IAAIU,CAAS,CAC9B,CACF"}
1
+ {"version":3,"file":"eventStreams.es.js","names":["ROW_EVENT","COMMAND_STAGES","CommandStage","rowsUntilErrorEvent","isData","event","controller","WowError","isErrorInfo","QueryEventStreamResultExtractor","JsonEventStreamResultExtractor","exchange","eventName","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.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 { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (eventName: string) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event.event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(eventName => eventName === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(eventName =>\n COMMAND_STAGES.has(eventName),\n ),\n );\n"],"mappings":";;;;AA0BA,IAAMA,IAAY,WAEZC,IAAsC,IAAI,IAC9C,OAAO,OAAOC,CAAY,CAC5B;AAiBA,SAASC,EACP,GACkD;CAClD,OAAO,IAAI,gBAAgB,EACzB,UAAU,GAAO,GAAY;EAC3B,AAAIC,EAAOC,EAAM,KAAK,IACpBC,EAAW,QAAQD,EAAM,IAAS,IAGpCC,EAAW,MACT,IAAIC,EACFC,EAAYH,EAAM,IAAI,IAClBA,EAAM,OACN;GAAE,WAAWA,EAAM;GAAO,UAAU;EAAG,CAC7C,CACF;CACF,EACF,CAAC;AACH;AAYA,IAAaI,IAET,OAAM,OACP,MAAMC,EAA+BC,CAAQ,EAAA,CAAG,YAC/CR,GAAoB,MAAaS,MAAcZ,CAAS,CAC1D,GAWWa,IAET,OAAM,OACP,MAAMH,EAA+BC,CAAQ,EAAA,CAAG,YAC/CR,GAAmC,MACjCF,EAAe,IAAIW,CAAS,CAC9B,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahoo-wang/wow-client",
3
- "version": "9.7.0",
3
+ "version": "9.8.0",
4
4
  "description": "TypeScript client for Wow (https://github.com/Ahoo-Wang/Wow): commands, snapshot and event-stream queries, and the query DSL, built on Fetcher.",
5
5
  "keywords": [
6
6
  "wow",
@@ -91,7 +91,7 @@
91
91
  "typescript": "~6.0.3",
92
92
  "typescript-eslint": "^8.71.1",
93
93
  "unplugin-dts": "1.1.2",
94
- "vite": "8.3.3",
94
+ "vite": "8.3.4",
95
95
  "vite-bundle-analyzer": "^1.3.9",
96
96
  "vitest": "^4.1.11"
97
97
  },