@ahoo-wang/wow-client 9.8.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 (119) hide show
  1. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs +2 -0
  2. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs.map +1 -0
  3. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.cts +8 -0
  4. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.ts +8 -0
  5. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js +34 -0
  6. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js.map +1 -0
  7. package/dist/client/query/dataset/datasetDirectoryClient.cjs +2 -0
  8. package/dist/client/query/dataset/datasetDirectoryClient.cjs.map +1 -0
  9. package/dist/client/query/dataset/datasetDirectoryClient.d.cts +29 -0
  10. package/dist/client/query/dataset/datasetDirectoryClient.d.ts +29 -0
  11. package/dist/client/query/dataset/datasetDirectoryClient.es.js +25 -0
  12. package/dist/client/query/dataset/datasetDirectoryClient.es.js.map +1 -0
  13. package/dist/client/query/dataset/datasetQueryApi.d.cts +40 -0
  14. package/dist/client/query/dataset/datasetQueryApi.d.ts +40 -0
  15. package/dist/client/query/dataset/datasetQueryClient.cjs +2 -0
  16. package/dist/client/query/dataset/datasetQueryClient.cjs.map +1 -0
  17. package/dist/client/query/dataset/datasetQueryClient.d.cts +57 -0
  18. package/dist/client/query/dataset/datasetQueryClient.d.ts +57 -0
  19. package/dist/client/query/dataset/datasetQueryClient.es.js +154 -0
  20. package/dist/client/query/dataset/datasetQueryClient.es.js.map +1 -0
  21. package/dist/client/query/dataset/endpointPaths.cjs +2 -0
  22. package/dist/client/query/dataset/endpointPaths.cjs.map +1 -0
  23. package/dist/client/query/dataset/endpointPaths.d.cts +9 -0
  24. package/dist/client/query/dataset/endpointPaths.d.ts +9 -0
  25. package/dist/client/query/dataset/endpointPaths.es.js +14 -0
  26. package/dist/client/query/dataset/endpointPaths.es.js.map +1 -0
  27. package/dist/client/query/dataset/index.d.cts +3 -0
  28. package/dist/client/query/dataset/index.d.ts +3 -0
  29. package/dist/client/query/event/eventStreamQueryApi.d.cts +1 -1
  30. package/dist/client/query/event/eventStreamQueryApi.d.ts +1 -1
  31. package/dist/client/query/event/eventStreamQueryClient.cjs.map +1 -1
  32. package/dist/client/query/event/eventStreamQueryClient.d.cts +4 -1
  33. package/dist/client/query/event/eventStreamQueryClient.d.ts +4 -1
  34. package/dist/client/query/event/eventStreamQueryClient.es.js.map +1 -1
  35. package/dist/client/query/event/index.d.cts +0 -1
  36. package/dist/client/query/event/index.d.ts +0 -1
  37. package/dist/client/query/index.d.cts +1 -0
  38. package/dist/client/query/index.d.ts +1 -0
  39. package/dist/client/query/snapshot/index.d.cts +0 -1
  40. package/dist/client/query/snapshot/index.d.ts +0 -1
  41. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +1 -1
  42. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +1 -1
  43. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +1 -1
  44. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +4 -1
  45. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +4 -1
  46. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +1 -1
  47. package/dist/client/routing.cjs.map +1 -1
  48. package/dist/client/routing.d.cts +2 -2
  49. package/dist/client/routing.d.ts +2 -2
  50. package/dist/client/routing.es.js.map +1 -1
  51. package/dist/dsl/aggregation/admit.cjs +1 -1
  52. package/dist/dsl/aggregation/admit.cjs.map +1 -1
  53. package/dist/dsl/aggregation/admit.es.js +84 -65
  54. package/dist/dsl/aggregation/admit.es.js.map +1 -1
  55. package/dist/dsl/aggregation/builders.cjs +1 -1
  56. package/dist/dsl/aggregation/builders.cjs.map +1 -1
  57. package/dist/dsl/aggregation/builders.d.cts +16 -4
  58. package/dist/dsl/aggregation/builders.d.ts +16 -4
  59. package/dist/dsl/aggregation/builders.es.js +89 -78
  60. package/dist/dsl/aggregation/builders.es.js.map +1 -1
  61. package/dist/dsl/aggregation/derived.cjs +1 -1
  62. package/dist/dsl/aggregation/derived.cjs.map +1 -1
  63. package/dist/dsl/aggregation/derived.d.cts +32 -1
  64. package/dist/dsl/aggregation/derived.d.ts +32 -1
  65. package/dist/dsl/aggregation/derived.es.js +23 -1
  66. package/dist/dsl/aggregation/derived.es.js.map +1 -1
  67. package/dist/dsl/aggregation/types.cjs +1 -1
  68. package/dist/dsl/aggregation/types.cjs.map +1 -1
  69. package/dist/dsl/aggregation/types.d.cts +112 -7
  70. package/dist/dsl/aggregation/types.d.ts +112 -7
  71. package/dist/dsl/aggregation/types.es.js +19 -12
  72. package/dist/dsl/aggregation/types.es.js.map +1 -1
  73. package/dist/dsl/descriptor.cjs +1 -1
  74. package/dist/dsl/descriptor.cjs.map +1 -1
  75. package/dist/dsl/descriptor.d.cts +16 -1
  76. package/dist/dsl/descriptor.d.ts +16 -1
  77. package/dist/dsl/descriptor.es.js +2 -1
  78. package/dist/dsl/descriptor.es.js.map +1 -1
  79. package/dist/dsl.cjs +1 -1
  80. package/dist/dsl.d.cts +2 -2
  81. package/dist/dsl.d.ts +2 -2
  82. package/dist/dsl.es.js +13 -13
  83. package/dist/error/headers.cjs.map +1 -1
  84. package/dist/error/headers.d.cts +3 -2
  85. package/dist/error/headers.d.ts +3 -2
  86. package/dist/error/headers.es.js.map +1 -1
  87. package/dist/error/queryErrorCodes.cjs +1 -1
  88. package/dist/error/queryErrorCodes.cjs.map +1 -1
  89. package/dist/error/queryErrorCodes.d.cts +7 -0
  90. package/dist/error/queryErrorCodes.d.ts +7 -0
  91. package/dist/error/queryErrorCodes.es.js +2 -1
  92. package/dist/error/queryErrorCodes.es.js.map +1 -1
  93. package/dist/index.cjs +1 -1
  94. package/dist/index.es.js +35 -33
  95. package/dist/model/domainEventStream.cjs.map +1 -0
  96. package/dist/{client/query/event → model}/domainEventStream.d.cts +5 -1
  97. package/dist/{client/query/event → model}/domainEventStream.d.ts +5 -1
  98. package/dist/{client/query/event → model}/domainEventStream.es.js +1 -1
  99. package/dist/model/domainEventStream.es.js.map +1 -0
  100. package/dist/model/index.d.cts +2 -0
  101. package/dist/model/index.d.ts +2 -0
  102. package/dist/model/snapshot.cjs.map +1 -0
  103. package/dist/{client/query/snapshot → model}/snapshot.d.cts +3 -1
  104. package/dist/{client/query/snapshot → model}/snapshot.d.ts +3 -1
  105. package/dist/{client/query/snapshot → model}/snapshot.es.js +1 -1
  106. package/dist/model/snapshot.es.js.map +1 -0
  107. package/dist/transport/eventStreams.cjs +1 -1
  108. package/dist/transport/eventStreams.cjs.map +1 -1
  109. package/dist/transport/eventStreams.d.cts +3 -1
  110. package/dist/transport/eventStreams.d.ts +3 -1
  111. package/dist/transport/eventStreams.es.js +7 -4
  112. package/dist/transport/eventStreams.es.js.map +1 -1
  113. package/package.json +2 -2
  114. package/dist/client/query/event/domainEventStream.cjs.map +0 -1
  115. package/dist/client/query/event/domainEventStream.es.js.map +0 -1
  116. package/dist/client/query/snapshot/snapshot.cjs.map +0 -1
  117. package/dist/client/query/snapshot/snapshot.es.js.map +0 -1
  118. /package/dist/{client/query/event → model}/domainEventStream.cjs +0 -0
  119. /package/dist/{client/query/snapshot → model}/snapshot.cjs +0 -0
@@ -16,7 +16,9 @@ export declare const QueryEventStreamResultExtractor: ResultExtractor<ReadableSt
16
16
  * stage the command reached, which errors with a {@link WowError} when the
17
17
  * server sends an error event. A command result whose own `errorCode` is not
18
18
  * `Ok` is still a result — the command failed in its processing — and is
19
- * passed on as one.
19
+ * passed on as one. So is a result from a stage this version does not know:
20
+ * a command result names its stage in `stage`, the error event's `ErrorInfo`
21
+ * does not, so a newer server's stage is not read as an error.
20
22
  *
21
23
  * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.
22
24
  */
@@ -3,16 +3,19 @@ import { CommandStage as n } from "../model/command.es.js";
3
3
  import { JsonEventStreamResultExtractor as r } from "@ahoo-wang/fetcher-eventstream";
4
4
  //#region src/transport/eventStreams.ts
5
5
  var i = "message", a = new Set(Object.values(n));
6
- function o(n) {
6
+ function o(e) {
7
+ return typeof e == "object" && !!e && typeof e.stage == "string";
8
+ }
9
+ function s(n) {
7
10
  return new TransformStream({ transform(r, i) {
8
- n(r.event) ? i.enqueue(r.data) : i.error(new e(t(r.data) ? r.data : {
11
+ n(r) ? i.enqueue(r.data) : i.error(new e(t(r.data) ? r.data : {
9
12
  errorCode: r.event,
10
13
  errorMsg: ""
11
14
  }));
12
15
  } });
13
16
  }
14
- var s = async (e) => (await r(e)).pipeThrough(o((e) => e === i)), c = async (e) => (await r(e)).pipeThrough(o((e) => a.has(e)));
17
+ var c = async (e) => (await r(e)).pipeThrough(s((e) => e.event === i)), l = async (e) => (await r(e)).pipeThrough(s((e) => a.has(e.event) || o(e.data)));
15
18
  //#endregion
16
- export { c as CommandResultEventStreamResultExtractor, s as QueryEventStreamResultExtractor };
19
+ export { l as CommandResultEventStreamResultExtractor, c as QueryEventStreamResultExtractor };
17
20
 
18
21
  //# sourceMappingURL=eventStreams.es.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"eventStreams.es.js","names":["ROW_EVENT","COMMAND_STAGES","CommandStage","namesStage","data","rowsUntilErrorEvent","isData","event","controller","WowError","isErrorInfo","QueryEventStreamResultExtractor","JsonEventStreamResultExtractor","exchange","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/** True when the data is a command result: it names the stage it reports. */\nfunction namesStage(data: unknown): boolean {\n return (\n typeof data === 'object' &&\n data !== null &&\n typeof (data as { stage?: unknown }).stage === 'string'\n );\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: (event: JsonServerSentEvent<unknown>) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(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(event => event.event === 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. So is a result from a stage this version does not know:\n * a command result names its stage in `stage`, the error event's `ErrorInfo`\n * does not, so a newer server's stage is not read as an error.\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>(\n event => COMMAND_STAGES.has(event.event) || namesStage(event.data),\n ),\n );\n"],"mappings":";;;;AA0BA,IAAMA,IAAY,WAEZC,IAAsC,IAAI,IAC9C,OAAO,OAAOC,CAAY,CAC5B;AAGA,SAASC,EAAW,GAAwB;CAC1C,OACE,OAAOC,KAAS,cAChBA,KACA,OAAQA,EAA6B,SAAU;AAEnD;AAiBA,SAASC,EACP,GACkD;CAClD,OAAO,IAAI,gBAAgB,EACzB,UAAU,GAAO,GAAY;EAC3B,AAAIC,EAAOC,CAAK,IACdC,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,MAASE,EAAM,UAAUP,CAAS,CACxD,GAaWc,IAET,OAAM,OACP,MAAMF,EAA+BC,CAAQ,EAAA,CAAG,YAC/CR,GACE,MAASJ,EAAe,IAAIM,EAAM,KAAK,KAAKJ,EAAWI,EAAM,IAAI,CACnE,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahoo-wang/wow-client",
3
- "version": "9.8.0",
3
+ "version": "9.9.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",
@@ -82,7 +82,7 @@
82
82
  "@ahoo-wang/fetcher-eventstream": "^6.0.1",
83
83
  "@eslint/js": "^10.0.1",
84
84
  "@microsoft/api-extractor": "^7.59.4",
85
- "@types/node": "^26.6.4",
85
+ "@types/node": "^26.6.5",
86
86
  "@vitest/coverage-v8": "4.1.11",
87
87
  "@vitest/ui": "^4.1.11",
88
88
  "eslint": "^10.12.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"domainEventStream.cjs","names":["DomainEventStreamMetadataFields"],"sources":["../../../../src/client/query/event/domainEventStream.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 AggregateId,\n CreateTimeCapable,\n DeletedCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n Identifier,\n Named,\n OwnerId,\n SpaceIdCapable,\n StateCapable,\n Version,\n BodyCapable,\n CommandId,\n CommandStage,\n RequestId,\n} from '../../../model/index.js';\n\n/**\n * Represents a domain event with a specific body type.\n * Extends Identifier, Named, and BodyCapable interfaces to provide identification,\n * naming, and body capabilities for the domain event.\n * @template BODY - The type of the event content for this domain event\n */\nexport interface DomainEvent<BODY>\n extends Identifier, Named, BodyCapable<BODY> {\n /**\n * The type of the event content.\n */\n bodyType: string;\n /**\n * The revision of the domain event.\n */\n revision: string;\n}\n\n/**\n * Represents the header information for a domain event stream.\n * Contains metadata about the event stream such as command information,\n * network details, and tracing information.\n */\nexport interface DomainEventStreamHeader {\n /**\n * The operator that executed the command.\n */\n command_operator?: string;\n /**\n * The endpoint to wait for command completion.\n */\n command_wait_endpoint?: string;\n /**\n * The stage to wait for in command execution.\n */\n command_wait_stage?: CommandStage;\n /**\n * Whether the command could be processed locally, `'true'` or `'false'`.\n */\n local_first?: string;\n /**\n * The IP address of the remote client.\n */\n remote_ip?: string;\n /**\n * The user agent of the client.\n */\n user_agent?: string;\n /**\n * The trace identifier for distributed tracing.\n */\n trace_id?: string;\n\n /**\n * Index signature for additional custom header properties.\n * Allows for any additional string key-value pairs to be included as header properties.\n */\n [key: string]: string | undefined;\n}\n\n/**\n * Represents a stream of domain events.\n * Combines multiple interfaces to provide a complete domain event stream,\n * including identification, aggregation, ownership, command information,\n * versioning, and the actual event data.\n */\nexport interface DomainEventStream<DomainEventBody = unknown>\n extends\n Identifier,\n AggregateId,\n OwnerId,\n SpaceIdCapable,\n CommandId,\n CreateTimeCapable,\n RequestId,\n Version,\n BodyCapable<DomainEvent<DomainEventBody>[]> {\n /**\n * The header information for the domain event stream.\n */\n header: DomainEventStreamHeader;\n}\n\n/**\n * A domain event stream together with the aggregate state after it was\n * applied: what Wow publishes on its state event bus. Wow's OpenAPI document\n * derives an `…StateEvent` schema from each aggregate's state, which\n * generated code maps to this type.\n *\n * @template DomainEventBody - The type of the event bodies\n * @template S - The type of the aggregate state\n */\nexport interface StateEvent<DomainEventBody = unknown, S = unknown>\n extends\n DomainEventStream<DomainEventBody>,\n StateCapable<S>,\n FirstOperatorCapable,\n FirstEventTimeCapable,\n DeletedCapable {}\n\n/**\n * The field names of a domain event stream, for filters, sorts and\n * projections over event streams (`body.name`, `header.command_operator`, …).\n *\n * A frozen name table: read `DomainEventStreamMetadataFields.BODY_NAME`; each\n * value is a string literal type.\n */\nexport const DomainEventStreamMetadataFields = Object.freeze({\n HEADER: 'header',\n COMMAND_OPERATOR: 'header.command_operator',\n AGGREGATE_ID: 'aggregateId',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n COMMAND_ID: 'commandId',\n REQUEST_ID: 'requestId',\n VERSION: 'version',\n BODY: 'body',\n BODY_ID: 'body.id',\n BODY_NAME: 'body.name',\n BODY_TYPE: 'body.bodyType',\n BODY_REVISION: 'body.revision',\n BODY_BODY: 'body.body',\n CREATE_TIME: 'createTime',\n} as const);\n"],"mappings":"AA0IA,IAAaA,EAAkC,OAAO,OAAO,CAC3D,OAAQ,SACR,iBAAkB,0BAClB,aAAc,cACd,UAAW,WACX,SAAU,UACV,SAAU,UACV,WAAY,YACZ,WAAY,YACZ,QAAS,UACT,KAAM,OACN,QAAS,UACT,UAAW,YACX,UAAW,gBACX,cAAe,gBACf,UAAW,YACX,YAAa,YACf,CAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"domainEventStream.es.js","names":["DomainEventStreamMetadataFields"],"sources":["../../../../src/client/query/event/domainEventStream.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 AggregateId,\n CreateTimeCapable,\n DeletedCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n Identifier,\n Named,\n OwnerId,\n SpaceIdCapable,\n StateCapable,\n Version,\n BodyCapable,\n CommandId,\n CommandStage,\n RequestId,\n} from '../../../model/index.js';\n\n/**\n * Represents a domain event with a specific body type.\n * Extends Identifier, Named, and BodyCapable interfaces to provide identification,\n * naming, and body capabilities for the domain event.\n * @template BODY - The type of the event content for this domain event\n */\nexport interface DomainEvent<BODY>\n extends Identifier, Named, BodyCapable<BODY> {\n /**\n * The type of the event content.\n */\n bodyType: string;\n /**\n * The revision of the domain event.\n */\n revision: string;\n}\n\n/**\n * Represents the header information for a domain event stream.\n * Contains metadata about the event stream such as command information,\n * network details, and tracing information.\n */\nexport interface DomainEventStreamHeader {\n /**\n * The operator that executed the command.\n */\n command_operator?: string;\n /**\n * The endpoint to wait for command completion.\n */\n command_wait_endpoint?: string;\n /**\n * The stage to wait for in command execution.\n */\n command_wait_stage?: CommandStage;\n /**\n * Whether the command could be processed locally, `'true'` or `'false'`.\n */\n local_first?: string;\n /**\n * The IP address of the remote client.\n */\n remote_ip?: string;\n /**\n * The user agent of the client.\n */\n user_agent?: string;\n /**\n * The trace identifier for distributed tracing.\n */\n trace_id?: string;\n\n /**\n * Index signature for additional custom header properties.\n * Allows for any additional string key-value pairs to be included as header properties.\n */\n [key: string]: string | undefined;\n}\n\n/**\n * Represents a stream of domain events.\n * Combines multiple interfaces to provide a complete domain event stream,\n * including identification, aggregation, ownership, command information,\n * versioning, and the actual event data.\n */\nexport interface DomainEventStream<DomainEventBody = unknown>\n extends\n Identifier,\n AggregateId,\n OwnerId,\n SpaceIdCapable,\n CommandId,\n CreateTimeCapable,\n RequestId,\n Version,\n BodyCapable<DomainEvent<DomainEventBody>[]> {\n /**\n * The header information for the domain event stream.\n */\n header: DomainEventStreamHeader;\n}\n\n/**\n * A domain event stream together with the aggregate state after it was\n * applied: what Wow publishes on its state event bus. Wow's OpenAPI document\n * derives an `…StateEvent` schema from each aggregate's state, which\n * generated code maps to this type.\n *\n * @template DomainEventBody - The type of the event bodies\n * @template S - The type of the aggregate state\n */\nexport interface StateEvent<DomainEventBody = unknown, S = unknown>\n extends\n DomainEventStream<DomainEventBody>,\n StateCapable<S>,\n FirstOperatorCapable,\n FirstEventTimeCapable,\n DeletedCapable {}\n\n/**\n * The field names of a domain event stream, for filters, sorts and\n * projections over event streams (`body.name`, `header.command_operator`, …).\n *\n * A frozen name table: read `DomainEventStreamMetadataFields.BODY_NAME`; each\n * value is a string literal type.\n */\nexport const DomainEventStreamMetadataFields = Object.freeze({\n HEADER: 'header',\n COMMAND_OPERATOR: 'header.command_operator',\n AGGREGATE_ID: 'aggregateId',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n COMMAND_ID: 'commandId',\n REQUEST_ID: 'requestId',\n VERSION: 'version',\n BODY: 'body',\n BODY_ID: 'body.id',\n BODY_NAME: 'body.name',\n BODY_TYPE: 'body.bodyType',\n BODY_REVISION: 'body.revision',\n BODY_BODY: 'body.body',\n CREATE_TIME: 'createTime',\n} as const);\n"],"mappings":";AA0IA,IAAaA,IAAkC,OAAO,OAAO;CAC3D,QAAQ;CACR,kBAAkB;CAClB,cAAc;CACd,WAAW;CACX,UAAU;CACV,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,MAAM;CACN,SAAS;CACT,WAAW;CACX,WAAW;CACX,eAAe;CACf,WAAW;CACX,aAAa;AACf,CAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.cjs","names":["SnapshotMetadataFields"],"sources":["../../../../src/client/query/snapshot/snapshot.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 AbacTaggable,\n AggregateId,\n DeletedCapable,\n EventIdCapable,\n EventTimeCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OperatorCapable,\n OwnerId,\n SnapshotTimeCapable,\n SpaceIdCapable,\n StateCapable,\n TenantId,\n Version,\n} from '../../../model/index.js';\n\n/**\n * Interface for materialized snapshots with full capabilities.\n */\nexport interface MaterializedSnapshot<S>\n extends\n StateCapable<S>,\n AggregateId,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n SnapshotTimeCapable,\n AbacTaggable,\n DeletedCapable {}\n\n/**\n * Interface for materialized snapshots with medium capabilities.\n *\n * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.\n * This interface is designed to be generic, capable of holding state data of any type.\n * Each snapshot corresponds to a specific version of the state within a tenant and owner context,\n * and records information such as event IDs and operation times to support tracing and auditing.\n *\n * Mirrors `MediumMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.\n */\nexport interface MediumMaterializedSnapshot<S>\n extends\n StateCapable<S>,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n AbacTaggable {}\n\n/**\n * Interface for simplified materialized snapshots with generic state.\n *\n * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.\n *\n * Mirrors `SmallMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.\n */\nexport interface SmallMaterializedSnapshot<S>\n extends StateCapable<S>, Version, FirstEventTimeCapable {}\n\n/**\n * The field names of a materialized snapshot, for filters, sorts and\n * projections over snapshots (`tenantId`, `state`, `deleted`, …).\n *\n * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is\n * a string literal type.\n */\nexport const SnapshotMetadataFields = Object.freeze({\n VERSION: 'version',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n EVENT_ID: 'eventId',\n FIRST_EVENT_TIME: 'firstEventTime',\n EVENT_TIME: 'eventTime',\n FIRST_OPERATOR: 'firstOperator',\n OPERATOR: 'operator',\n SNAPSHOT_TIME: 'snapshotTime',\n TAGS: 'tags',\n DELETED: 'deleted',\n STATE: 'state',\n} as const);\n"],"mappings":"AA6FA,IAAaA,EAAyB,OAAO,OAAO,CAClD,QAAS,UACT,UAAW,WACX,SAAU,UACV,SAAU,UACV,SAAU,UACV,iBAAkB,iBAClB,WAAY,YACZ,eAAgB,gBAChB,SAAU,WACV,cAAe,eACf,KAAM,OACN,QAAS,UACT,MAAO,OACT,CAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.es.js","names":["SnapshotMetadataFields"],"sources":["../../../../src/client/query/snapshot/snapshot.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 AbacTaggable,\n AggregateId,\n DeletedCapable,\n EventIdCapable,\n EventTimeCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OperatorCapable,\n OwnerId,\n SnapshotTimeCapable,\n SpaceIdCapable,\n StateCapable,\n TenantId,\n Version,\n} from '../../../model/index.js';\n\n/**\n * Interface for materialized snapshots with full capabilities.\n */\nexport interface MaterializedSnapshot<S>\n extends\n StateCapable<S>,\n AggregateId,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n SnapshotTimeCapable,\n AbacTaggable,\n DeletedCapable {}\n\n/**\n * Interface for materialized snapshots with medium capabilities.\n *\n * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.\n * This interface is designed to be generic, capable of holding state data of any type.\n * Each snapshot corresponds to a specific version of the state within a tenant and owner context,\n * and records information such as event IDs and operation times to support tracing and auditing.\n *\n * Mirrors `MediumMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.\n */\nexport interface MediumMaterializedSnapshot<S>\n extends\n StateCapable<S>,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n AbacTaggable {}\n\n/**\n * Interface for simplified materialized snapshots with generic state.\n *\n * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.\n *\n * Mirrors `SmallMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.\n */\nexport interface SmallMaterializedSnapshot<S>\n extends StateCapable<S>, Version, FirstEventTimeCapable {}\n\n/**\n * The field names of a materialized snapshot, for filters, sorts and\n * projections over snapshots (`tenantId`, `state`, `deleted`, …).\n *\n * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is\n * a string literal type.\n */\nexport const SnapshotMetadataFields = Object.freeze({\n VERSION: 'version',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n EVENT_ID: 'eventId',\n FIRST_EVENT_TIME: 'firstEventTime',\n EVENT_TIME: 'eventTime',\n FIRST_OPERATOR: 'firstOperator',\n OPERATOR: 'operator',\n SNAPSHOT_TIME: 'snapshotTime',\n TAGS: 'tags',\n DELETED: 'deleted',\n STATE: 'state',\n} as const);\n"],"mappings":";AA6FA,IAAaA,IAAyB,OAAO,OAAO;CAClD,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,UAAU;CACV,kBAAkB;CAClB,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACV,eAAe;CACf,MAAM;CACN,SAAS;CACT,OAAO;AACT,CAAU"}