@ahoo-wang/wow-client 9.7.0 → 9.9.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 (143) 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/dataset/datasetDescriptorEndpoint.cjs +2 -0
  9. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs.map +1 -0
  10. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.cts +8 -0
  11. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.ts +8 -0
  12. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js +34 -0
  13. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js.map +1 -0
  14. package/dist/client/query/dataset/datasetDirectoryClient.cjs +2 -0
  15. package/dist/client/query/dataset/datasetDirectoryClient.cjs.map +1 -0
  16. package/dist/client/query/dataset/datasetDirectoryClient.d.cts +29 -0
  17. package/dist/client/query/dataset/datasetDirectoryClient.d.ts +29 -0
  18. package/dist/client/query/dataset/datasetDirectoryClient.es.js +25 -0
  19. package/dist/client/query/dataset/datasetDirectoryClient.es.js.map +1 -0
  20. package/dist/client/query/dataset/datasetQueryApi.d.cts +40 -0
  21. package/dist/client/query/dataset/datasetQueryApi.d.ts +40 -0
  22. package/dist/client/query/dataset/datasetQueryClient.cjs +2 -0
  23. package/dist/client/query/dataset/datasetQueryClient.cjs.map +1 -0
  24. package/dist/client/query/dataset/datasetQueryClient.d.cts +57 -0
  25. package/dist/client/query/dataset/datasetQueryClient.d.ts +57 -0
  26. package/dist/client/query/dataset/datasetQueryClient.es.js +154 -0
  27. package/dist/client/query/dataset/datasetQueryClient.es.js.map +1 -0
  28. package/dist/client/query/dataset/endpointPaths.cjs +2 -0
  29. package/dist/client/query/dataset/endpointPaths.cjs.map +1 -0
  30. package/dist/client/query/dataset/endpointPaths.d.cts +9 -0
  31. package/dist/client/query/dataset/endpointPaths.d.ts +9 -0
  32. package/dist/client/query/dataset/endpointPaths.es.js +14 -0
  33. package/dist/client/query/dataset/endpointPaths.es.js.map +1 -0
  34. package/dist/client/query/dataset/index.d.cts +3 -0
  35. package/dist/client/query/dataset/index.d.ts +3 -0
  36. package/dist/client/query/descriptor/descriptorEndpoints.cjs +1 -1
  37. package/dist/client/query/descriptor/descriptorEndpoints.es.js +3 -3
  38. package/dist/client/query/event/eventStreamQueryApi.d.cts +1 -1
  39. package/dist/client/query/event/eventStreamQueryApi.d.ts +1 -1
  40. package/dist/client/query/event/eventStreamQueryClient.cjs +1 -1
  41. package/dist/client/query/event/eventStreamQueryClient.cjs.map +1 -1
  42. package/dist/client/query/event/eventStreamQueryClient.d.cts +4 -1
  43. package/dist/client/query/event/eventStreamQueryClient.d.ts +4 -1
  44. package/dist/client/query/event/eventStreamQueryClient.es.js +3 -3
  45. package/dist/client/query/event/eventStreamQueryClient.es.js.map +1 -1
  46. package/dist/client/query/event/index.d.cts +0 -1
  47. package/dist/client/query/event/index.d.ts +0 -1
  48. package/dist/client/query/index.d.cts +1 -0
  49. package/dist/client/query/index.d.ts +1 -0
  50. package/dist/client/query/snapshot/index.d.cts +0 -1
  51. package/dist/client/query/snapshot/index.d.ts +0 -1
  52. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +1 -1
  53. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +1 -1
  54. package/dist/client/query/snapshot/snapshotQueryClient.cjs +1 -1
  55. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +1 -1
  56. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +4 -1
  57. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +4 -1
  58. package/dist/client/query/snapshot/snapshotQueryClient.es.js +3 -3
  59. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +1 -1
  60. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +1 -1
  61. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +3 -3
  62. package/dist/client/query/state/loadStateAggregateClient.cjs +1 -1
  63. package/dist/client/query/state/loadStateAggregateClient.es.js +3 -3
  64. package/dist/client/routing.cjs.map +1 -1
  65. package/dist/client/routing.d.cts +2 -2
  66. package/dist/client/routing.d.ts +2 -2
  67. package/dist/client/routing.es.js.map +1 -1
  68. package/dist/dsl/aggregation/admit.cjs +1 -1
  69. package/dist/dsl/aggregation/admit.cjs.map +1 -1
  70. package/dist/dsl/aggregation/admit.es.js +84 -65
  71. package/dist/dsl/aggregation/admit.es.js.map +1 -1
  72. package/dist/dsl/aggregation/builders.cjs +1 -1
  73. package/dist/dsl/aggregation/builders.cjs.map +1 -1
  74. package/dist/dsl/aggregation/builders.d.cts +16 -4
  75. package/dist/dsl/aggregation/builders.d.ts +16 -4
  76. package/dist/dsl/aggregation/builders.es.js +89 -78
  77. package/dist/dsl/aggregation/builders.es.js.map +1 -1
  78. package/dist/dsl/aggregation/derived.cjs +1 -1
  79. package/dist/dsl/aggregation/derived.cjs.map +1 -1
  80. package/dist/dsl/aggregation/derived.d.cts +32 -1
  81. package/dist/dsl/aggregation/derived.d.ts +32 -1
  82. package/dist/dsl/aggregation/derived.es.js +23 -1
  83. package/dist/dsl/aggregation/derived.es.js.map +1 -1
  84. package/dist/dsl/aggregation/types.cjs +1 -1
  85. package/dist/dsl/aggregation/types.cjs.map +1 -1
  86. package/dist/dsl/aggregation/types.d.cts +112 -7
  87. package/dist/dsl/aggregation/types.d.ts +112 -7
  88. package/dist/dsl/aggregation/types.es.js +19 -12
  89. package/dist/dsl/aggregation/types.es.js.map +1 -1
  90. package/dist/dsl/descriptor.cjs +1 -1
  91. package/dist/dsl/descriptor.cjs.map +1 -1
  92. package/dist/dsl/descriptor.d.cts +16 -1
  93. package/dist/dsl/descriptor.d.ts +16 -1
  94. package/dist/dsl/descriptor.es.js +2 -1
  95. package/dist/dsl/descriptor.es.js.map +1 -1
  96. package/dist/dsl/filter/datePattern.cjs +1 -1
  97. package/dist/dsl/filter/datePattern.cjs.map +1 -1
  98. package/dist/dsl/filter/datePattern.es.js +2 -5
  99. package/dist/dsl/filter/datePattern.es.js.map +1 -1
  100. package/dist/dsl.cjs +1 -1
  101. package/dist/dsl.d.cts +2 -2
  102. package/dist/dsl.d.ts +2 -2
  103. package/dist/dsl.es.js +13 -13
  104. package/dist/error/headers.cjs.map +1 -1
  105. package/dist/error/headers.d.cts +3 -2
  106. package/dist/error/headers.d.ts +3 -2
  107. package/dist/error/headers.es.js.map +1 -1
  108. package/dist/error/queryErrorCodes.cjs +1 -1
  109. package/dist/error/queryErrorCodes.cjs.map +1 -1
  110. package/dist/error/queryErrorCodes.d.cts +7 -0
  111. package/dist/error/queryErrorCodes.d.ts +7 -0
  112. package/dist/error/queryErrorCodes.es.js +2 -1
  113. package/dist/error/queryErrorCodes.es.js.map +1 -1
  114. package/dist/index.cjs +1 -1
  115. package/dist/index.es.js +35 -33
  116. package/dist/model/domainEventStream.cjs.map +1 -0
  117. package/dist/{client/query/event → model}/domainEventStream.d.cts +5 -1
  118. package/dist/{client/query/event → model}/domainEventStream.d.ts +5 -1
  119. package/dist/{client/query/event → model}/domainEventStream.es.js +1 -1
  120. package/dist/model/domainEventStream.es.js.map +1 -0
  121. package/dist/model/index.d.cts +2 -0
  122. package/dist/model/index.d.ts +2 -0
  123. package/dist/model/snapshot.cjs.map +1 -0
  124. package/dist/{client/query/snapshot → model}/snapshot.d.cts +3 -1
  125. package/dist/{client/query/snapshot → model}/snapshot.d.ts +3 -1
  126. package/dist/{client/query/snapshot → model}/snapshot.es.js +1 -1
  127. package/dist/model/snapshot.es.js.map +1 -0
  128. package/dist/transport/eventStreams.cjs +1 -1
  129. package/dist/transport/eventStreams.cjs.map +1 -1
  130. package/dist/transport/eventStreams.d.cts +3 -1
  131. package/dist/transport/eventStreams.d.ts +3 -1
  132. package/dist/transport/eventStreams.es.js +7 -8
  133. package/dist/transport/eventStreams.es.js.map +1 -1
  134. package/package.json +3 -3
  135. package/dist/client/query/event/domainEventStream.cjs.map +0 -1
  136. package/dist/client/query/event/domainEventStream.es.js.map +0 -1
  137. package/dist/client/query/snapshot/snapshot.cjs.map +0 -1
  138. package/dist/client/query/snapshot/snapshot.es.js.map +0 -1
  139. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorate.cjs +0 -0
  140. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorateMetadata.cjs +0 -0
  141. /package/dist/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.153.0}/helpers/esm/decorateParam.cjs +0 -0
  142. /package/dist/{client/query/event → model}/domainEventStream.cjs +0 -0
  143. /package/dist/{client/query/snapshot → model}/snapshot.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 {
@@ -0,0 +1,2 @@
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=class{constructor(e){this.apiMetadata=e}schema(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}};n.default([(0,a.get)(r.DatasetQueryEndpointPaths.SCHEMA,{resultExtractor:i.ExchangeResultExtractor,attributes:{[i.IGNORE_VALIDATE_STATUS]:!0}}),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)],o.prototype,`schema`,null),o=n.default([(0,a.api)(),e.default(`design:paramtypes`,[Object])],o),Object.defineProperty(exports,"DatasetDescriptorEndpoint",{enumerable:!0,get:function(){return o}});
2
+ //# sourceMappingURL=datasetDescriptorEndpoint.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasetDescriptorEndpoint.cjs","names":["autoGeneratedError","_decorate","get","DatasetQueryEndpointPaths","ExchangeResultExtractor","IGNORE_VALIDATE_STATUS","_decorateParam","header","attribute","_decorateMetadata","api","require_decorateMetadata","require_decorateParam","require_decorate","require_endpointPaths","_ahoo_wang_fetcher","_ahoo_wang_fetcher_decorator","DatasetDescriptorEndpoint","apiMetadata","ifNoneMatch","attributes","abort"],"sources":["../../../../src/client/query/dataset/datasetDescriptorEndpoint.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: the index of this folder does not re-export this file.\n\nimport {\n ExchangeResultExtractor,\n type FetchExchange,\n IGNORE_VALIDATE_STATUS,\n} from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n header,\n} from '@ahoo-wang/fetcher-decorator';\nimport { DatasetQueryEndpointPaths } from './endpointPaths.js';\n\n/** `GET …/schema`, answered as the raw exchange so a 304 is read, not thrown. */\n@api()\nexport class DatasetDescriptorEndpoint implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {}\n\n @get(DatasetQueryEndpointPaths.SCHEMA, {\n resultExtractor: ExchangeResultExtractor,\n attributes: { [IGNORE_VALIDATE_STATUS]: true },\n })\n /* v8 ignore start */\n schema(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n}\n"],"mappings":"oYAmCO,IAAMiB,EAAN,KAA8D,CACnE,YAAY,EAA2C,CAA3B,KAAA,YAAAC,CAA4B,CAExD,OAME,EACA,EACA,EACwB,CACxB,MAAA,EAAMlB,EAAAA,mBAAAA,CAAmBmB,EAAaC,EAAYC,CAAK,CACzD,CAEF,cAbGnB,EAAAA,EAAAA,IAAAA,CAAIC,EAAAA,0BAA0B,OAAQ,CACrC,gBAAiBC,EAAAA,wBACjB,WAAY,EAAGC,EAAAA,wBAAyB,EAAK,CAC/C,CAAC,EAGEC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,OAAAA,CAAO,eAAe,CAAA,EACtBD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,gNAXd,EAAAP,EAAAA,QAAA,EAAA,EAAAS,EAAAA,IAAAA,CAAI,EAAAD,EAAAA,QAAA,oBAAA,CAAA,MAAA,CAAA,CAAA,EAAAQ,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { FetchExchange } from '@ahoo-wang/fetcher';
2
+ import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
3
+ /** `GET …/schema`, answered as the raw exchange so a 304 is read, not thrown. */
4
+ export declare class DatasetDescriptorEndpoint implements ApiMetadataCapable {
5
+ readonly apiMetadata?: ApiMetadata | undefined;
6
+ constructor(apiMetadata?: ApiMetadata | undefined);
7
+ schema(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { FetchExchange } from '@ahoo-wang/fetcher';
2
+ import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
3
+ /** `GET …/schema`, answered as the raw exchange so a 304 is read, not thrown. */
4
+ export declare class DatasetDescriptorEndpoint implements ApiMetadataCapable {
5
+ readonly apiMetadata?: ApiMetadata | undefined;
6
+ constructor(apiMetadata?: ApiMetadata | undefined);
7
+ schema(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
8
+ }
@@ -0,0 +1,34 @@
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
+ import { DatasetQueryEndpointPaths as r } from "./endpointPaths.es.js";
5
+ import { ExchangeResultExtractor as i, IGNORE_VALIDATE_STATUS as a } from "@ahoo-wang/fetcher";
6
+ import { api as o, attribute as s, autoGeneratedError as c, get as l, header as u } from "@ahoo-wang/fetcher-decorator";
7
+ //#region src/client/query/dataset/datasetDescriptorEndpoint.ts
8
+ var d = class {
9
+ constructor(e) {
10
+ this.apiMetadata = e;
11
+ }
12
+ schema(e, t, n) {
13
+ throw c(e, t, n);
14
+ }
15
+ };
16
+ n([
17
+ l(r.SCHEMA, {
18
+ resultExtractor: i,
19
+ attributes: { [a]: !0 }
20
+ }),
21
+ t(0, u("If-None-Match")),
22
+ t(1, s()),
23
+ e("design:type", Function),
24
+ e("design:paramtypes", [
25
+ String,
26
+ typeof Record > "u" ? Object : Record,
27
+ Object
28
+ ]),
29
+ e("design:returntype", typeof Promise > "u" ? Object : Promise)
30
+ ], d.prototype, "schema", null), d = n([o(), e("design:paramtypes", [Object])], d);
31
+ //#endregion
32
+ export { d as DatasetDescriptorEndpoint };
33
+
34
+ //# sourceMappingURL=datasetDescriptorEndpoint.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasetDescriptorEndpoint.es.js","names":["_decorate","_decorateParam","_decorateMetadata","__decorateMetadata","__decorateParam","__decorate","DatasetDescriptorEndpoint","apiMetadata","autoGeneratedError","ifNoneMatch","attributes","abort","get","DatasetQueryEndpointPaths","ExchangeResultExtractor","IGNORE_VALIDATE_STATUS","header","attribute","api"],"sources":["../../../../src/client/query/dataset/datasetDescriptorEndpoint.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Internal: the index of this folder does not re-export this file.\n\nimport {\n ExchangeResultExtractor,\n type FetchExchange,\n IGNORE_VALIDATE_STATUS,\n} from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n header,\n} from '@ahoo-wang/fetcher-decorator';\nimport { DatasetQueryEndpointPaths } from './endpointPaths.js';\n\n/** `GET …/schema`, answered as the raw exchange so a 304 is read, not thrown. */\n@api()\nexport class DatasetDescriptorEndpoint implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {}\n\n @get(DatasetQueryEndpointPaths.SCHEMA, {\n resultExtractor: ExchangeResultExtractor,\n attributes: { [IGNORE_VALIDATE_STATUS]: true },\n })\n /* v8 ignore start */\n schema(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n}\n"],"mappings":";;;;;;;AAmCO,IAAMM,IAAN,MAA8D;CACnE,YAAY,GAA2C;EAA3B,KAAA,cAAAC;CAA4B;CAExD,OAME,GACA,GACA,GACwB;EACxB,MAAMC,EAAmBC,GAAaC,GAAYC,CAAK;CACzD;AAEF;;CAbGC,EAAIC,EAA0B,QAAQ;EACrC,iBAAiBC;EACjB,YAAY,GAAGC,IAAyB,GAAK;CAC/C,CAAC;CAGEd,EAAA,GAAAe,EAAO,eAAe,CAAA;CACtBf,EAAA,GAAAgB,EAAU,CAAA;;;;;;;;iCAXd,IAAAjB,EAAA,CAAAkB,EAAI,GAAAhB,EAAA,qBAAA,CAAA,MAAA,CAAA,CAAA,GAAAI,CAAA"}
@@ -0,0 +1,2 @@
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)}list(e,t){throw(0,i.autoGeneratedError)(e,t)}};r.default([(0,i.get)(`dataset`),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,`list`,null),a=r.default([(0,i.api)(),t.default(`design:paramtypes`,[Object])],a),Object.defineProperty(exports,"DatasetDirectoryClient",{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=datasetDirectoryClient.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasetDirectoryClient.cjs","names":["autoGeneratedError","_decorate","get","_decorateParam","attribute","_decorateMetadata","api","require_bindMethods","require_decorateMetadata","require_decorateParam","require_decorate","_ahoo_wang_fetcher_decorator","DatasetDirectoryClient","apiMetadata","attributes","abort"],"sources":["../../../../src/client/query/dataset/datasetDirectoryClient.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n} from '@ahoo-wang/fetcher-decorator';\nimport { bindMethods } from '../../bindMethods.js';\n\n/**\n * One dataset a service serves, as its directory lists it: where it is named,\n * its title, and the version of its capability descriptor, `null` while its\n * schema does not compile (its table contradicts its declaration, say).\n */\nexport interface DatasetDirectoryEntry {\n contextName: string;\n name: string;\n title: string | null;\n version: string | null;\n}\n\n/**\n * The dataset directory of a service (`GET /dataset`): every dataset it\n * serves, those published at run time included. A host reads it to offer\n * the datasets and to register each one with the view engine.\n *\n * @example\n * ```typescript\n * import { DatasetDirectoryClient } from '@ahoo-wang/wow-client';\n *\n * const datasets = await new DatasetDirectoryClient().list();\n * ```\n */\n@api()\nexport class DatasetDirectoryClient implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n @get('dataset')\n /* v8 ignore start */\n list(\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<DatasetDirectoryEntry[]> {\n throw autoGeneratedError(attributes, abort);\n }\n /* v8 ignore stop */\n}\n"],"mappings":"sWAkDO,IAAMY,EAAN,KAA2D,CAChE,YAAY,EAA2C,CAA3B,KAAA,YAAAC,EAC1BN,EAAA,YAAY,IAAI,CAClB,CAEA,KAGE,EACA,EACkC,CAClC,MAAA,EAAMP,EAAAA,mBAAAA,CAAmBc,EAAYC,CAAK,CAC5C,CAEF,cATGb,EAAAA,EAAAA,IAAAA,CAAI,SAAS,EAGXC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,UAAAA,CAAU,CAAA,uMATd,EAAAH,EAAAA,QAAA,EAAA,EAAAK,EAAAA,IAAAA,CAAI,EAAAD,EAAAA,QAAA,oBAAA,CAAA,MAAA,CAAA,CAAA,EAAAO,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
2
+ /**
3
+ * One dataset a service serves, as its directory lists it: where it is named,
4
+ * its title, and the version of its capability descriptor, `null` while its
5
+ * schema does not compile (its table contradicts its declaration, say).
6
+ */
7
+ export interface DatasetDirectoryEntry {
8
+ contextName: string;
9
+ name: string;
10
+ title: string | null;
11
+ version: string | null;
12
+ }
13
+ /**
14
+ * The dataset directory of a service (`GET /dataset`): every dataset it
15
+ * serves, those published at run time included. A host reads it to offer
16
+ * the datasets and to register each one with the view engine.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { DatasetDirectoryClient } from '@ahoo-wang/wow-client';
21
+ *
22
+ * const datasets = await new DatasetDirectoryClient().list();
23
+ * ```
24
+ */
25
+ export declare class DatasetDirectoryClient implements ApiMetadataCapable {
26
+ readonly apiMetadata?: ApiMetadata | undefined;
27
+ constructor(apiMetadata?: ApiMetadata | undefined);
28
+ list(attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<DatasetDirectoryEntry[]>;
29
+ }
@@ -0,0 +1,29 @@
1
+ import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
2
+ /**
3
+ * One dataset a service serves, as its directory lists it: where it is named,
4
+ * its title, and the version of its capability descriptor, `null` while its
5
+ * schema does not compile (its table contradicts its declaration, say).
6
+ */
7
+ export interface DatasetDirectoryEntry {
8
+ contextName: string;
9
+ name: string;
10
+ title: string | null;
11
+ version: string | null;
12
+ }
13
+ /**
14
+ * The dataset directory of a service (`GET /dataset`): every dataset it
15
+ * serves, those published at run time included. A host reads it to offer
16
+ * the datasets and to register each one with the view engine.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { DatasetDirectoryClient } from '@ahoo-wang/wow-client';
21
+ *
22
+ * const datasets = await new DatasetDirectoryClient().list();
23
+ * ```
24
+ */
25
+ export declare class DatasetDirectoryClient implements ApiMetadataCapable {
26
+ readonly apiMetadata?: ApiMetadata | undefined;
27
+ constructor(apiMetadata?: ApiMetadata | undefined);
28
+ list(attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<DatasetDirectoryEntry[]>;
29
+ }
@@ -0,0 +1,25 @@
1
+ import { bindMethods as e } from "../../bindMethods.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
+ import { api as i, attribute as a, autoGeneratedError as o, get as s } from "@ahoo-wang/fetcher-decorator";
6
+ //#region src/client/query/dataset/datasetDirectoryClient.ts
7
+ var c = class {
8
+ constructor(t) {
9
+ this.apiMetadata = t, e(this);
10
+ }
11
+ list(e, t) {
12
+ throw o(e, t);
13
+ }
14
+ };
15
+ r([
16
+ s("dataset"),
17
+ n(0, a()),
18
+ t("design:type", Function),
19
+ t("design:paramtypes", [typeof Record > "u" ? Object : Record, Object]),
20
+ t("design:returntype", typeof Promise > "u" ? Object : Promise)
21
+ ], c.prototype, "list", null), c = r([i(), t("design:paramtypes", [Object])], c);
22
+ //#endregion
23
+ export { c as DatasetDirectoryClient };
24
+
25
+ //# sourceMappingURL=datasetDirectoryClient.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasetDirectoryClient.es.js","names":["_decorate","_decorateParam","_decorateMetadata","__decorateMetadata","__decorateParam","__decorate","DatasetDirectoryClient","apiMetadata","bindMethods","autoGeneratedError","attributes","abort","get","attribute","api"],"sources":["../../../../src/client/query/dataset/datasetDirectoryClient.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n} from '@ahoo-wang/fetcher-decorator';\nimport { bindMethods } from '../../bindMethods.js';\n\n/**\n * One dataset a service serves, as its directory lists it: where it is named,\n * its title, and the version of its capability descriptor, `null` while its\n * schema does not compile (its table contradicts its declaration, say).\n */\nexport interface DatasetDirectoryEntry {\n contextName: string;\n name: string;\n title: string | null;\n version: string | null;\n}\n\n/**\n * The dataset directory of a service (`GET /dataset`): every dataset it\n * serves, those published at run time included. A host reads it to offer\n * the datasets and to register each one with the view engine.\n *\n * @example\n * ```typescript\n * import { DatasetDirectoryClient } from '@ahoo-wang/wow-client';\n *\n * const datasets = await new DatasetDirectoryClient().list();\n * ```\n */\n@api()\nexport class DatasetDirectoryClient implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n @get('dataset')\n /* v8 ignore start */\n list(\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<DatasetDirectoryEntry[]> {\n throw autoGeneratedError(attributes, abort);\n }\n /* v8 ignore stop */\n}\n"],"mappings":";;;;;;AAkDO,IAAMM,IAAN,MAA2D;CAChE,YAAY,GAA2C;EACrD,AAD0B,KAAA,cAAAC,GAC1BC,EAAY,IAAI;CAClB;CAEA,KAGE,GACA,GACkC;EAClC,MAAMC,EAAmBC,GAAYC,CAAK;CAC5C;AAEF;;CATGC,EAAI,SAAS;CAGXX,EAAA,GAAAY,EAAU,CAAA;;;;+BATd,IAAAb,EAAA,CAAAc,EAAI,GAAAZ,EAAA,qBAAA,CAAA,MAAA,CAAA,CAAA,GAAAI,CAAA"}
@@ -0,0 +1,40 @@
1
+ import { AggregationQuery } from '../../../dsl/aggregation/index.cjs';
2
+ import { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.cjs';
3
+ import { DynamicDocument } from '../../../dsl/documents.cjs';
4
+ import { FilterExpression } from '../../../dsl/filter/index.cjs';
5
+ import { FilterListQuery, FilterPagedQuery, FilterSingleQuery, PagedList } from '../../../dsl/queryable.cjs';
6
+ import { QueryDescriptorResult } from '../descriptor/queryDescriptorApi.cjs';
7
+ /**
8
+ * The query API of one dataset: a declared, table-like record set such as a BI
9
+ * wide table, served by a Wow service under `dataset/{context}/{dataset}`.
10
+ *
11
+ * A dataset's records have no domain type, so each is a {@link DynamicDocument}
12
+ * by default. The API also describes the dataset ({@link describe}), so one
13
+ * client is a complete view-engine data source.
14
+ *
15
+ * @typeParam R - The record type, when the caller knows the dataset's columns.
16
+ * @typeParam FIELDS - The field names a query may use.
17
+ */
18
+ export interface DatasetQueryApi<R = DynamicDocument, FIELDS extends string = string> {
19
+ /** Retrieves the first record in sort order, or fails with 404 when none matches. */
20
+ single<T extends Partial<R> = R>(query: FilterSingleQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T>;
21
+ /** Retrieves the matching records, at most the query's limit. */
22
+ list<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T[]>;
23
+ /** Streams the matching records, one per server-sent event. */
24
+ listStream<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<T>>;
25
+ /** Retrieves one page of records and the total. */
26
+ paged<T extends Partial<R> = R>(query: FilterPagedQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<PagedList<T>>;
27
+ /** Retrieves the next forward-only cursor page. */
28
+ cursor<T extends Partial<R> = R>(query: CursorQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<CursorPage<T>>;
29
+ /** Counts the matching records. */
30
+ count(filter: FilterExpression<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<number>;
31
+ /** Runs an aggregation and returns all result rows. */
32
+ aggregate<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<Row[]>;
33
+ /** Runs an aggregation and streams the result rows, one per server-sent event. */
34
+ aggregateStream<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<Row>>;
35
+ /**
36
+ * The dataset's capability descriptor. Given the version already held, an
37
+ * unchanged descriptor answers `notModified` (the server answers 304).
38
+ */
39
+ describe(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
40
+ }
@@ -0,0 +1,40 @@
1
+ import { AggregationQuery } from '../../../dsl/aggregation/index.js';
2
+ import { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.js';
3
+ import { DynamicDocument } from '../../../dsl/documents.js';
4
+ import { FilterExpression } from '../../../dsl/filter/index.js';
5
+ import { FilterListQuery, FilterPagedQuery, FilterSingleQuery, PagedList } from '../../../dsl/queryable.js';
6
+ import { QueryDescriptorResult } from '../descriptor/queryDescriptorApi.js';
7
+ /**
8
+ * The query API of one dataset: a declared, table-like record set such as a BI
9
+ * wide table, served by a Wow service under `dataset/{context}/{dataset}`.
10
+ *
11
+ * A dataset's records have no domain type, so each is a {@link DynamicDocument}
12
+ * by default. The API also describes the dataset ({@link describe}), so one
13
+ * client is a complete view-engine data source.
14
+ *
15
+ * @typeParam R - The record type, when the caller knows the dataset's columns.
16
+ * @typeParam FIELDS - The field names a query may use.
17
+ */
18
+ export interface DatasetQueryApi<R = DynamicDocument, FIELDS extends string = string> {
19
+ /** Retrieves the first record in sort order, or fails with 404 when none matches. */
20
+ single<T extends Partial<R> = R>(query: FilterSingleQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T>;
21
+ /** Retrieves the matching records, at most the query's limit. */
22
+ list<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T[]>;
23
+ /** Streams the matching records, one per server-sent event. */
24
+ listStream<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<T>>;
25
+ /** Retrieves one page of records and the total. */
26
+ paged<T extends Partial<R> = R>(query: FilterPagedQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<PagedList<T>>;
27
+ /** Retrieves the next forward-only cursor page. */
28
+ cursor<T extends Partial<R> = R>(query: CursorQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<CursorPage<T>>;
29
+ /** Counts the matching records. */
30
+ count(filter: FilterExpression<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<number>;
31
+ /** Runs an aggregation and returns all result rows. */
32
+ aggregate<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<Row[]>;
33
+ /** Runs an aggregation and streams the result rows, one per server-sent event. */
34
+ aggregateStream<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<Row>>;
35
+ /**
36
+ * The dataset's capability descriptor. Given the version already held, an
37
+ * unchanged descriptor answers `notModified` (the server answers 304).
38
+ */
39
+ describe(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
40
+ }
@@ -0,0 +1,2 @@
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("../descriptor/descriptorEndpoints.cjs"),o=require("../../routing.cjs"),s=require("./endpointPaths.cjs"),c=require("./datasetDescriptorEndpoint.cjs");let l=require("@ahoo-wang/fetcher"),u=require("@ahoo-wang/fetcher-decorator");function d(e,t,n=o.ResourceAttributionPathSpec.NONE){let r=`dataset/${encodeURIComponent(e)}/${encodeURIComponent(t)}`;return n?(0,l.combineURLs)(n,r):r}var f=class{constructor(e){let{context:n,dataset:r,resourceAttribution:i,...a}=e;this.apiMetadata={...a,basePath:e.basePath??d(n,r,i)},t.bindMethods(this)}single(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}list(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}listStream(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}paged(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}cursor(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}count(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}aggregate(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}aggregateStream(e,t,n){throw(0,u.autoGeneratedError)(e,t,n)}async describe(e,t,n){let r=a.descriptorVersion(e),i=await new c.DatasetDescriptorEndpoint(this.apiMetadata).schema(a.ifNoneMatch(r),t,n);return a.readDescriptor(i,r)}};i.default([(0,u.post)(s.DatasetQueryEndpointPaths.SINGLE),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`single`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.LIST),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`list`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.LIST,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`listStream`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.PAGED),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`paged`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.CURSOR),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`cursor`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.COUNT),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`count`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.AGGREGATION),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`aggregate`,null),i.default([(0,u.post)(s.DatasetQueryEndpointPaths.AGGREGATION,e.QUERY_STREAM_ENDPOINT),r.default(0,(0,u.body)()),r.default(1,(0,u.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)],f.prototype,`aggregateStream`,null),f=i.default([(0,u.api)(),n.default(`design:paramtypes`,[Object])],f),Object.defineProperty(exports,"DatasetQueryClient",{enumerable:!0,get:function(){return f}}),exports.datasetBasePath=d;
2
+ //# sourceMappingURL=datasetQueryClient.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datasetQueryClient.cjs","names":["ResourceAttributionPathSpec","combineURLs","autoGeneratedError","descriptorVersion","DatasetDescriptorEndpoint","ifNoneMatch","readDescriptor","_decorate","post","DatasetQueryEndpointPaths","_decorateParam","body","attribute","_decorateMetadata","QUERY_STREAM_ENDPOINT","api","require_endpoints","require_bindMethods","require_decorateMetadata","require_decorateParam","require_decorate","require_descriptorEndpoints","require_routing","require_endpointPaths","require_datasetDescriptorEndpoint","_ahoo_wang_fetcher","_ahoo_wang_fetcher_decorator","datasetBasePath","path","context","dataset","resourceAttribution","DatasetQueryClient","apiMetadata","options","query","attributes","abort","filter","version","previous","exchange"],"sources":["../../../../src/client/query/dataset/datasetQueryClient.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 { combineURLs, type PartialBy } from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n body,\n post,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { AggregationQuery } from '../../../dsl/aggregation/index.js';\nimport type { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.js';\nimport type { DynamicDocument } from '../../../dsl/documents.js';\nimport type { FilterExpression } from '../../../dsl/filter/index.js';\nimport type {\n FilterListQuery,\n FilterPagedQuery,\n FilterSingleQuery,\n PagedList,\n} from '../../../dsl/queryable.js';\nimport { QUERY_STREAM_ENDPOINT } from '../../../transport/endpoints.js';\nimport { bindMethods } from '../../bindMethods.js';\nimport { ResourceAttributionPathSpec } from '../../routing.js';\nimport type { QueryDescriptorResult } from '../descriptor/queryDescriptorApi.js';\nimport {\n descriptorVersion,\n ifNoneMatch,\n readDescriptor,\n} from '../descriptor/descriptorEndpoints.js';\nimport type { DatasetQueryApi } from './datasetQueryApi.js';\nimport { DatasetDescriptorEndpoint } from './datasetDescriptorEndpoint.js';\nimport { DatasetQueryEndpointPaths } from './endpointPaths.js';\n\n/**\n * Where a dataset client sends its queries: the dataset's bounded context and\n * name, and optionally a tenant prefix (`ResourceAttributionPathSpec.TENANT`,\n * whose `{tenantId}` the `urlParams` fill). `basePath` replaces\n * the computed `{attribution}/dataset/{context}/{dataset}` when given.\n */\nexport interface DatasetQueryClientOptions extends PartialBy<\n ApiMetadata,\n 'basePath'\n> {\n context: string;\n dataset: string;\n resourceAttribution?:\n ResourceAttributionPathSpec.NONE | ResourceAttributionPathSpec.TENANT;\n}\n\n/** `{attribution}/dataset/{context}/{dataset}`, the base path of a dataset's routes. */\nexport function datasetBasePath(\n context: string,\n dataset: string,\n resourceAttribution: ResourceAttributionPathSpec = ResourceAttributionPathSpec.NONE,\n): string {\n const path = `dataset/${encodeURIComponent(context)}/${encodeURIComponent(dataset)}`;\n return resourceAttribution ? combineURLs(resourceAttribution, path) : path;\n}\n\n/**\n * A client for one dataset's query routes. It implements\n * {@link DatasetQueryApi}, the shape of a view-engine data source, so it can be\n * handed to the engine's `resources` as it is.\n *\n * @example\n * ```typescript\n * import { DatasetQueryClient, aggregation } from '@ahoo-wang/wow-client';\n *\n * const orders = new DatasetQueryClient({\n * context: 'analytics',\n * dataset: 'order_wide',\n * });\n * const byCity = await orders.aggregate(\n * aggregation.query({\n * groupBy: [aggregation.terms('city', 'city')],\n * metrics: [aggregation.count('orders')],\n * }),\n * );\n * ```\n */\n@api()\nexport class DatasetQueryClient<\n R = DynamicDocument,\n FIELDS extends string = string,\n>\n implements DatasetQueryApi<R, FIELDS>, ApiMetadataCapable\n{\n public readonly apiMetadata: ApiMetadata;\n\n constructor(options: DatasetQueryClientOptions) {\n const { context, dataset, resourceAttribution, ...apiMetadata } = options;\n this.apiMetadata = {\n ...apiMetadata,\n basePath:\n options.basePath ??\n datasetBasePath(context, dataset, resourceAttribution),\n };\n bindMethods(this);\n }\n\n @post(DatasetQueryEndpointPaths.SINGLE)\n /* v8 ignore start */\n single<T extends Partial<R> = R>(\n @body() query: FilterSingleQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<T> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.LIST)\n /* v8 ignore start */\n list<T extends Partial<R> = R>(\n @body() query: FilterListQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<T[]> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.LIST, QUERY_STREAM_ENDPOINT)\n /* v8 ignore start */\n listStream<T extends Partial<R> = R>(\n @body() query: FilterListQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<ReadableStream<T>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.PAGED)\n /* v8 ignore start */\n paged<T extends Partial<R> = R>(\n @body() query: FilterPagedQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<PagedList<T>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.CURSOR)\n /* v8 ignore start */\n cursor<T extends Partial<R> = R>(\n @body() query: CursorQuery<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<CursorPage<T>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.COUNT)\n /* v8 ignore start */\n count(\n @body() filter: FilterExpression<FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<number> {\n throw autoGeneratedError(filter, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.AGGREGATION)\n /* v8 ignore start */\n aggregate<\n Row extends object = DynamicDocument,\n AGGREGATION_FIELDS extends string = string,\n >(\n @body() query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<Row[]> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n @post(DatasetQueryEndpointPaths.AGGREGATION, QUERY_STREAM_ENDPOINT)\n /* v8 ignore start */\n aggregateStream<\n Row extends object = DynamicDocument,\n AGGREGATION_FIELDS extends string = string,\n >(\n @body() query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<ReadableStream<Row>> {\n throw autoGeneratedError(query, attributes, abort);\n }\n /* v8 ignore stop */\n\n async describe(\n previous?: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<QueryDescriptorResult> {\n const version = descriptorVersion(previous);\n const exchange = await new DatasetDescriptorEndpoint(\n this.apiMetadata,\n ).schema(ifNoneMatch(version), attributes, abort);\n return readDescriptor(exchange, version);\n }\n}\n"],"mappings":"olBAiEA,SAAgB2B,EACd,EACA,EACA,EAAmD3B,EAAAA,4BAA4B,KACvE,CACR,IAAM4B,EAAO,WAAW,mBAAmBC,CAAO,EAAE,GAAG,mBAAmBC,CAAO,IACjF,OAAOC,GAAA,EAAsB9B,EAAAA,YAAAA,CAAY8B,EAAqBH,CAAI,EAAIA,CACxE,CAwBO,IAAMI,EAAN,KAKP,CAGE,YAAY,EAAoC,CAC9C,GAAM,CAAE,UAAS,UAAS,sBAAqB,GAAGC,GAAgBC,EAClE,KAAK,YAAc,CACjB,GAAGD,EACH,SACEC,EAAQ,UACRP,EAAgBE,EAASC,EAASC,CAAmB,CACzD,EACAd,EAAA,YAAY,IAAI,CAClB,CAEA,OAGE,EACA,EACA,EACY,CACZ,MAAA,EAAMf,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,KAGE,EACA,EACA,EACc,CACd,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,WAGE,EACA,EACA,EAC4B,CAC5B,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,MAGE,EACA,EACA,EACuB,CACvB,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,OAGE,EACA,EACA,EACwB,CACxB,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,MAGE,EACA,EACA,EACiB,CACjB,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBoC,EAAQF,EAAYC,CAAK,CACpD,CAGA,UAME,EACA,EACA,EACgB,CAChB,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,gBAME,EACA,EACA,EAC8B,CAC9B,MAAA,EAAMnC,EAAAA,mBAAAA,CAAmBiC,EAAOC,EAAYC,CAAK,CACnD,CAGA,MAAM,SACJ,EACA,EACA,EACgC,CAChC,IAAME,EAAUpC,EAAAA,kBAAkBqC,CAAQ,EACpCC,EAAW,MAAM,IAAIrC,EAAAA,0BACzB,KAAK,WACP,CAAC,CAAC,OAAOC,EAAAA,YAAYkC,CAAO,EAAGH,EAAYC,CAAK,EAChD,OAAO/B,EAAAA,eAAemC,EAAUF,CAAO,CACzC,CACF,cAzGG/B,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,MAAM,EAGnCC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,4NAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,IAAI,EAGjCC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,0NAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,KAAMK,EAAAA,qBAAqB,EAGxDJ,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,gOAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,KAAK,EAGlCC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,2NAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,MAAM,EAGnCC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,4NAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,KAAK,EAGlCC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,2NAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,WAAW,EAMxCC,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,+NAOZJ,EAAAA,EAAAA,KAAAA,CAAKC,EAAAA,0BAA0B,YAAaK,EAAAA,qBAAqB,EAM/DJ,EAAAA,QAAA,GAAA,EAAAC,EAAAA,KAAAA,CAAK,CAAA,EACLD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,yNA3Gd,EAAAL,EAAAA,QAAA,EAAA,EAAAQ,EAAAA,IAAAA,CAAI,EAAAF,EAAAA,QAAA,oBAAA,CAAA,MAAA,CAAA,CAAA,EAAAmB,CAAA"}
@@ -0,0 +1,57 @@
1
+ import { PartialBy } from '@ahoo-wang/fetcher';
2
+ import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
3
+ import { AggregationQuery } from '../../../dsl/aggregation/index.cjs';
4
+ import { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.cjs';
5
+ import { DynamicDocument } from '../../../dsl/documents.cjs';
6
+ import { FilterExpression } from '../../../dsl/filter/index.cjs';
7
+ import { FilterListQuery, FilterPagedQuery, FilterSingleQuery, PagedList } from '../../../dsl/queryable.cjs';
8
+ import { ResourceAttributionPathSpec } from '../../routing.cjs';
9
+ import { QueryDescriptorResult } from '../descriptor/queryDescriptorApi.cjs';
10
+ import { DatasetQueryApi } from './datasetQueryApi.cjs';
11
+ /**
12
+ * Where a dataset client sends its queries: the dataset's bounded context and
13
+ * name, and optionally a tenant prefix (`ResourceAttributionPathSpec.TENANT`,
14
+ * whose `{tenantId}` the `urlParams` fill). `basePath` replaces
15
+ * the computed `{attribution}/dataset/{context}/{dataset}` when given.
16
+ */
17
+ export interface DatasetQueryClientOptions extends PartialBy<ApiMetadata, 'basePath'> {
18
+ context: string;
19
+ dataset: string;
20
+ resourceAttribution?: ResourceAttributionPathSpec.NONE | ResourceAttributionPathSpec.TENANT;
21
+ }
22
+ /** `{attribution}/dataset/{context}/{dataset}`, the base path of a dataset's routes. */
23
+ export declare function datasetBasePath(context: string, dataset: string, resourceAttribution?: ResourceAttributionPathSpec): string;
24
+ /**
25
+ * A client for one dataset's query routes. It implements
26
+ * {@link DatasetQueryApi}, the shape of a view-engine data source, so it can be
27
+ * handed to the engine's `resources` as it is.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * import { DatasetQueryClient, aggregation } from '@ahoo-wang/wow-client';
32
+ *
33
+ * const orders = new DatasetQueryClient({
34
+ * context: 'analytics',
35
+ * dataset: 'order_wide',
36
+ * });
37
+ * const byCity = await orders.aggregate(
38
+ * aggregation.query({
39
+ * groupBy: [aggregation.terms('city', 'city')],
40
+ * metrics: [aggregation.count('orders')],
41
+ * }),
42
+ * );
43
+ * ```
44
+ */
45
+ export declare class DatasetQueryClient<R = DynamicDocument, FIELDS extends string = string> implements DatasetQueryApi<R, FIELDS>, ApiMetadataCapable {
46
+ readonly apiMetadata: ApiMetadata;
47
+ constructor(options: DatasetQueryClientOptions);
48
+ single<T extends Partial<R> = R>(query: FilterSingleQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T>;
49
+ list<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T[]>;
50
+ listStream<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<T>>;
51
+ paged<T extends Partial<R> = R>(query: FilterPagedQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<PagedList<T>>;
52
+ cursor<T extends Partial<R> = R>(query: CursorQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<CursorPage<T>>;
53
+ count(filter: FilterExpression<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<number>;
54
+ aggregate<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<Row[]>;
55
+ aggregateStream<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<Row>>;
56
+ describe(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
57
+ }
@@ -0,0 +1,57 @@
1
+ import { PartialBy } from '@ahoo-wang/fetcher';
2
+ import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
3
+ import { AggregationQuery } from '../../../dsl/aggregation/index.js';
4
+ import { CursorPage, CursorQuery } from '../../../dsl/cursorQuery.js';
5
+ import { DynamicDocument } from '../../../dsl/documents.js';
6
+ import { FilterExpression } from '../../../dsl/filter/index.js';
7
+ import { FilterListQuery, FilterPagedQuery, FilterSingleQuery, PagedList } from '../../../dsl/queryable.js';
8
+ import { ResourceAttributionPathSpec } from '../../routing.js';
9
+ import { QueryDescriptorResult } from '../descriptor/queryDescriptorApi.js';
10
+ import { DatasetQueryApi } from './datasetQueryApi.js';
11
+ /**
12
+ * Where a dataset client sends its queries: the dataset's bounded context and
13
+ * name, and optionally a tenant prefix (`ResourceAttributionPathSpec.TENANT`,
14
+ * whose `{tenantId}` the `urlParams` fill). `basePath` replaces
15
+ * the computed `{attribution}/dataset/{context}/{dataset}` when given.
16
+ */
17
+ export interface DatasetQueryClientOptions extends PartialBy<ApiMetadata, 'basePath'> {
18
+ context: string;
19
+ dataset: string;
20
+ resourceAttribution?: ResourceAttributionPathSpec.NONE | ResourceAttributionPathSpec.TENANT;
21
+ }
22
+ /** `{attribution}/dataset/{context}/{dataset}`, the base path of a dataset's routes. */
23
+ export declare function datasetBasePath(context: string, dataset: string, resourceAttribution?: ResourceAttributionPathSpec): string;
24
+ /**
25
+ * A client for one dataset's query routes. It implements
26
+ * {@link DatasetQueryApi}, the shape of a view-engine data source, so it can be
27
+ * handed to the engine's `resources` as it is.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * import { DatasetQueryClient, aggregation } from '@ahoo-wang/wow-client';
32
+ *
33
+ * const orders = new DatasetQueryClient({
34
+ * context: 'analytics',
35
+ * dataset: 'order_wide',
36
+ * });
37
+ * const byCity = await orders.aggregate(
38
+ * aggregation.query({
39
+ * groupBy: [aggregation.terms('city', 'city')],
40
+ * metrics: [aggregation.count('orders')],
41
+ * }),
42
+ * );
43
+ * ```
44
+ */
45
+ export declare class DatasetQueryClient<R = DynamicDocument, FIELDS extends string = string> implements DatasetQueryApi<R, FIELDS>, ApiMetadataCapable {
46
+ readonly apiMetadata: ApiMetadata;
47
+ constructor(options: DatasetQueryClientOptions);
48
+ single<T extends Partial<R> = R>(query: FilterSingleQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T>;
49
+ list<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<T[]>;
50
+ listStream<T extends Partial<R> = R>(query: FilterListQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<T>>;
51
+ paged<T extends Partial<R> = R>(query: FilterPagedQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<PagedList<T>>;
52
+ cursor<T extends Partial<R> = R>(query: CursorQuery<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<CursorPage<T>>;
53
+ count(filter: FilterExpression<FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<number>;
54
+ aggregate<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<Row[]>;
55
+ aggregateStream<Row extends object = DynamicDocument, AGGREGATION_FIELDS extends string = string>(query: AggregationQuery<FIELDS, AGGREGATION_FIELDS>, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<ReadableStream<Row>>;
56
+ describe(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
57
+ }