@ahoo-wang/fetcher-wow 3.1.2 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/command/commandRequest.d.ts +4 -3
- package/dist/command/commandRequest.d.ts.map +1 -1
- package/dist/command/types.d.ts +4 -1
- package/dist/command/types.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +176 -152
- package/dist/index.es.js.map +1 -1
- package/dist/query/operator.d.ts +2 -0
- package/dist/query/operator.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequestHeaders, UrlParams } from '@ahoo-wang/fetcher';
|
|
2
2
|
import { UrlPathParams } from '../types';
|
|
3
3
|
import { ParameterRequest } from '@ahoo-wang/fetcher-decorator';
|
|
4
|
+
import { CommandBody } from './types';
|
|
4
5
|
/**
|
|
5
6
|
* Command Request Headers Interface
|
|
6
7
|
*
|
|
@@ -28,12 +29,12 @@ export interface CommandUrlParams extends Omit<UrlParams, 'path' | 'query'> {
|
|
|
28
29
|
* Extends RequestHeaders to provide type-safe access to command-related HTTP headers.
|
|
29
30
|
* This interface includes only the essential command headers commonly used in HTTP requests.
|
|
30
31
|
*/
|
|
31
|
-
export interface CommandRequest<C extends object = object> extends ParameterRequest<
|
|
32
|
+
export interface CommandRequest<C extends object = object> extends ParameterRequest<CommandBody<C>> {
|
|
32
33
|
urlParams?: CommandUrlParams;
|
|
33
34
|
headers?: CommandRequestHeaders;
|
|
34
35
|
/**
|
|
35
36
|
* The body of the command request.
|
|
36
37
|
*/
|
|
37
|
-
body?:
|
|
38
|
+
body?: CommandBody<C>;
|
|
38
39
|
}
|
|
39
40
|
//# sourceMappingURL=commandRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandRequest.d.ts","sourceRoot":"","sources":["../../src/command/commandRequest.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"commandRequest.d.ts","sourceRoot":"","sources":["../../src/command/commandRequest.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,qBAAsB,SAAQ,cAAc;CA4G5D;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACzE,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CACvD,SAAQ,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACvB"}
|
package/dist/command/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorInfo, FunctionInfoCapable, Identifier } from '../types';
|
|
2
|
-
import { PartialBy } from '@ahoo-wang/fetcher';
|
|
2
|
+
import { PartialBy, RemoveReadonlyFields } from '@ahoo-wang/fetcher';
|
|
3
3
|
/**
|
|
4
4
|
* Command identifier interface
|
|
5
5
|
*
|
|
@@ -111,6 +111,8 @@ export interface CompensationTarget extends PartialBy<Identifier, 'id'>, Functio
|
|
|
111
111
|
*/
|
|
112
112
|
export interface DeleteAggregate {
|
|
113
113
|
}
|
|
114
|
+
export type CommandBody<C> = RemoveReadonlyFields<C>;
|
|
115
|
+
export type DeleteAggregateCommand = CommandBody<DeleteAggregate>;
|
|
114
116
|
/**
|
|
115
117
|
* Represents a command to recover an aggregate.
|
|
116
118
|
*
|
|
@@ -120,6 +122,7 @@ export interface DeleteAggregate {
|
|
|
120
122
|
*/
|
|
121
123
|
export interface RecoverAggregate {
|
|
122
124
|
}
|
|
125
|
+
export type RecoverAggregateCommand = CommandBody<RecoverAggregate>;
|
|
123
126
|
/**
|
|
124
127
|
* Represents the result of a batch operation, containing information about
|
|
125
128
|
* the pagination and error status of the operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/command/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/command/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACtB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,aAAa,kBAAkB;IAE/B;;OAEG;IACH,YAAY,iBAAiB;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBACf,SAAQ,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,EACjC,mBAAmB;CACtB;AAED;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;CAC/B;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAA;AAEpD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;AAElE;;;;;;GAMG;AAEH,MAAM,WAAW,gBAAgB;CAChC;AAED,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@ahoo-wang/fetcher"),U=require("@ahoo-wang/fetcher-eventstream"),i=require("@ahoo-wang/fetcher-decorator");var At=Object.defineProperty,It=Object.getOwnPropertyDescriptor,K=(t,e,r,n)=>{for(var E=n>1?void 0:n?It(e,r):e,u=t.length-1,A;u>=0;u--)(A=t[u])&&(E=(n?A(e,r,E):A(E))||E);return n&&E&&At(e,r,E),E},b=(t,e)=>(r,n)=>e(r,n,t);exports.CommandClient=class{constructor(e){this.apiMetadata=e}send(e,r){throw i.autoGeneratedError(e,r)}sendAndWaitStream(e,r){throw i.autoGeneratedError(e,r)}};K([i.endpoint(),b(0,i.request()),b(1,i.attribute())],exports.CommandClient.prototype,"send",1);K([i.endpoint(void 0,void 0,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:U.JsonEventStreamResultExtractor}),b(0,i.request()),b(1,i.attribute())],exports.CommandClient.prototype,"sendAndWaitStream",1);exports.CommandClient=K([i.api()],exports.CommandClient);const o=class o{};o.COMMAND_HEADERS_PREFIX="Command-",o.TENANT_ID=`${o.COMMAND_HEADERS_PREFIX}Tenant-Id`,o.OWNER_ID=`${o.COMMAND_HEADERS_PREFIX}Owner-Id`,o.AGGREGATE_ID=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Id`,o.AGGREGATE_VERSION=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Version`,o.WAIT_PREFIX=`${o.COMMAND_HEADERS_PREFIX}Wait-`,o.WAIT_TIME_OUT=`${o.WAIT_PREFIX}Timeout`,o.WAIT_STAGE=`${o.WAIT_PREFIX}Stage`,o.WAIT_CONTEXT=`${o.WAIT_PREFIX}Context`,o.WAIT_PROCESSOR=`${o.WAIT_PREFIX}Processor`,o.WAIT_FUNCTION=`${o.WAIT_PREFIX}Function`,o.WAIT_TAIL_PREFIX=`${o.WAIT_PREFIX}Tail-`,o.WAIT_TAIL_STAGE=`${o.WAIT_TAIL_PREFIX}Stage`,o.WAIT_TAIL_CONTEXT=`${o.WAIT_TAIL_PREFIX}Context`,o.WAIT_TAIL_PROCESSOR=`${o.WAIT_TAIL_PREFIX}Processor`,o.WAIT_TAIL_FUNCTION=`${o.WAIT_TAIL_PREFIX}Function`,o.REQUEST_ID=`${o.COMMAND_HEADERS_PREFIX}Request-Id`,o.LOCAL_FIRST=`${o.COMMAND_HEADERS_PREFIX}Local-First`,o.COMMAND_AGGREGATE_CONTEXT=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Context`,o.COMMAND_AGGREGATE_NAME=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Name`,o.COMMAND_TYPE=`${o.COMMAND_HEADERS_PREFIX}Type`,o.COMMAND_HEADER_X_PREFIX=`${o.COMMAND_HEADERS_PREFIX}Header-`;let X=o;var z=(t=>(t.SENT="SENT",t.PROCESSED="PROCESSED",t.SNAPSHOT="SNAPSHOT",t.PROJECTED="PROJECTED",t.EVENT_HANDLED="EVENT_HANDLED",t.SAGA_HANDLED="SAGA_HANDLED",t))(z||{}),s=(t=>(t.AND="AND",t.OR="OR",t.NOR="NOR",t.ID="ID",t.IDS="IDS",t.AGGREGATE_ID="AGGREGATE_ID",t.AGGREGATE_IDS="AGGREGATE_IDS",t.TENANT_ID="TENANT_ID",t.OWNER_ID="OWNER_ID",t.DELETED="DELETED",t.ALL="ALL",t.EQ="EQ",t.NE="NE",t.GT="GT",t.LT="LT",t.GTE="GTE",t.LTE="LTE",t.CONTAINS="CONTAINS",t.IN="IN",t.NOT_IN="NOT_IN",t.BETWEEN="BETWEEN",t.ALL_IN="ALL_IN",t.STARTS_WITH="STARTS_WITH",t.ENDS_WITH="ENDS_WITH",t.ELEM_MATCH="ELEM_MATCH",t.NULL="NULL",t.NOT_NULL="NOT_NULL",t.TRUE="TRUE",t.FALSE="FALSE",t.EXISTS="EXISTS",t.TODAY="TODAY",t.BEFORE_TODAY="BEFORE_TODAY",t.TOMORROW="TOMORROW",t.THIS_WEEK="THIS_WEEK",t.NEXT_WEEK="NEXT_WEEK",t.LAST_WEEK="LAST_WEEK",t.THIS_MONTH="THIS_MONTH",t.LAST_MONTH="LAST_MONTH",t.RECENT_DAYS="RECENT_DAYS",t.EARLIER_DAYS="EARLIER_DAYS",t.RAW="RAW",t))(s||{});function w(t){return!!t}const d=class d{};d.IGNORE_CASE_OPTION_KEY="ignoreCase",d.ZONE_ID_OPTION_KEY="zoneId",d.DATE_PATTERN_OPTION_KEY="datePattern";let Q=d;function $(t){if(!(typeof t>"u"))return{ignoreCase:t}}function l(t,e){if(typeof t>"u"&&typeof e>"u")return;const r={};return typeof t<"u"&&(r.datePattern=t),typeof e<"u"&&(r.zoneId=e),r}var Z=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(Z||{});function m(...t){if(t.length===0)return _();if(t.length===1)return w(t[0])?t[0]:_();const e=[];return t.forEach(r=>{r?.operator===s.ALL||!w(r)||(r.operator===s.AND&&r.children?e.push(...r.children):e.push(r))}),{operator:s.AND,children:e}}function Nt(...t){const e=t?.filter(r=>w(r));return e.length===0?_():{operator:s.OR,children:e}}function St(...t){return t.length===0?_():{operator:s.NOR,children:t}}function Rt(t){return{operator:s.ID,value:t}}function lt(t){return{operator:s.IDS,value:t}}function Y(t){return{operator:s.AGGREGATE_ID,value:t}}function H(t){return{operator:s.AGGREGATE_IDS,value:t}}function Ot(t){return{operator:s.TENANT_ID,value:t}}function Dt(t){return{operator:s.OWNER_ID,value:t}}function k(t){return{operator:s.DELETED,value:t}}function _t(){return k("ACTIVE")}function _(){return{operator:s.ALL}}function ht(t,e){return{field:t,operator:s.EQ,value:e}}function pt(t,e){return{field:t,operator:s.NE,value:e}}function tt(t,e){return{field:t,operator:s.GT,value:e}}function et(t,e){return{field:t,operator:s.LT,value:e}}function Lt(t,e){return{field:t,operator:s.GTE,value:e}}function Ct(t,e){return{field:t,operator:s.LTE,value:e}}function gt(t,e,r){const n=$(r);return{field:t,operator:s.CONTAINS,value:e,options:n}}function ft(t,...e){return{field:t,operator:s.IN,value:e}}function yt(t,...e){return{field:t,operator:s.NOT_IN,value:e}}function Gt(t,e,r){return{field:t,operator:s.BETWEEN,value:[e,r]}}function Mt(t,...e){return{field:t,operator:s.ALL_IN,value:e}}function dt(t,e,r){const n=$(r);return{field:t,operator:s.STARTS_WITH,value:e,options:n}}function Pt(t,e,r){const n=$(r);return{field:t,operator:s.ENDS_WITH,value:e,options:n}}function Wt(t,e){return{field:t,operator:s.ELEM_MATCH,children:[e]}}function vt(t){return{field:t,operator:s.NULL}}function bt(t){return{field:t,operator:s.NOT_NULL}}function wt(t){return{field:t,operator:s.TRUE}}function Ut(t){return{field:t,operator:s.FALSE}}function $t(t,e=!0){return{field:t,operator:s.EXISTS,value:e}}function Vt(t,e,r){const n=l(e,r);return{field:t,operator:s.TODAY,options:n}}function Bt(t,e,r,n){const E=l(r,n);return{field:t,operator:s.BEFORE_TODAY,value:e,options:E}}function Xt(t,e,r){const n=l(e,r);return{field:t,operator:s.TOMORROW,options:n}}function Qt(t,e,r){const n=l(e,r);return{field:t,operator:s.THIS_WEEK,options:n}}function Yt(t,e,r){const n=l(e,r);return{field:t,operator:s.NEXT_WEEK,options:n}}function Ht(t,e,r){const n=l(e,r);return{field:t,operator:s.LAST_WEEK,options:n}}function Ft(t,e,r){const n=l(e,r);return{field:t,operator:s.THIS_MONTH,options:n}}function xt(t,e,r){const n=l(e,r);return{field:t,operator:s.LAST_MONTH,options:n}}function qt(t,e,r,n){const E=l(r,n);return{field:t,operator:s.RECENT_DAYS,value:e,options:E}}function jt(t,e,r,n){const E=l(r,n);return{field:t,operator:s.EARLIER_DAYS,value:e,options:E}}function Jt(t){return{operator:s.RAW,value:t}}const g={index:1,size:10};function Kt({index:t=g.index,size:e=g.size}=g){return{index:t,size:e}}const rt={};function it(){return rt}function zt({include:t,exclude:e}=it()){return{include:t,exclude:e}}function F({condition:t=_(),projection:e,sort:r}={}){return{condition:t,projection:e,sort:r}}function x({condition:t=_(),projection:e,sort:r,limit:n=g.size}={}){return{condition:t,projection:e,sort:r,limit:n}}function Zt({condition:t=_(),projection:e,sort:r,pagination:n=g}={}){return{condition:t,projection:e,sort:r,pagination:n}}const nt={total:0,list:[]};function mt({total:t,list:e=[]}=nt){return t===void 0&&(t=e.length),{total:t,list:e}}var P=(t=>(t.ASC="ASC",t.DESC="DESC",t))(P||{});function kt(t){return{field:t,direction:"ASC"}}function te(t){return{field:t,direction:"DESC"}}const a=class a{};a.HEADER="header",a.COMMAND_OPERATOR=`${a.HEADER}.command_operator`,a.AGGREGATE_ID="aggregateId",a.TENANT_ID="tenantId",a.OWNER_ID="ownerId",a.COMMAND_ID="commandId",a.REQUEST_ID="requestId",a.VERSION="version",a.BODY="body",a.BODY_ID=`${a.BODY}.id`,a.BODY_NAME=`${a.BODY}.name`,a.BODY_TYPE=`${a.BODY}.bodyType`,a.BODY_REVISION=`${a.BODY}.revision`,a.BODY_BODY=`${a.BODY}.body`,a.CREATE_TIME="createTime";let q=a;const O=class O{};O.EVENT_STREAM_RESOURCE_NAME="event",O.COUNT=`${O.EVENT_STREAM_RESOURCE_NAME}/count`,O.LIST=`${O.EVENT_STREAM_RESOURCE_NAME}/list`,O.PAGED=`${O.EVENT_STREAM_RESOURCE_NAME}/paged`;let C=O;var ee=Object.defineProperty,re=Object.getOwnPropertyDescriptor,v=(t,e,r,n)=>{for(var E=n>1?void 0:n?re(e,r):e,u=t.length-1,A;u>=0;u--)(A=t[u])&&(E=(n?A(e,r,E):A(E))||E);return n&&E&&ee(e,r,E),E},h=(t,e)=>(r,n)=>e(r,n,t);exports.EventStreamQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r){throw i.autoGeneratedError(e,r)}list(e,r){throw i.autoGeneratedError(e,r)}listStream(e,r){throw i.autoGeneratedError(e,r)}paged(e,r){throw i.autoGeneratedError(e,r)}};v([i.post(C.COUNT),h(0,i.body()),h(1,i.attribute())],exports.EventStreamQueryClient.prototype,"count",1);v([i.post(C.LIST),h(0,i.body()),h(1,i.attribute())],exports.EventStreamQueryClient.prototype,"list",1);v([i.post(C.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:U.JsonEventStreamResultExtractor}),h(0,i.body()),h(1,i.attribute())],exports.EventStreamQueryClient.prototype,"listStream",1);v([i.post(C.PAGED),h(0,i.body()),h(1,i.attribute())],exports.EventStreamQueryClient.prototype,"paged",1);exports.EventStreamQueryClient=v([i.api()],exports.EventStreamQueryClient);const S=class S{};S.VERSION="version",S.TENANT_ID="tenantId",S.OWNER_ID="ownerId",S.EVENT_ID="eventId",S.FIRST_EVENT_TIME="firstEventTime",S.EVENT_TIME="eventTime",S.FIRST_OPERATOR="firstOperator",S.OPERATOR="operator",S.SNAPSHOT_TIME="snapshotTime",S.DELETED="deleted",S.STATE="state";let j=S;const I=class I{};I.SNAPSHOT_RESOURCE_NAME="snapshot",I.COUNT=`${I.SNAPSHOT_RESOURCE_NAME}/count`,I.LIST=`${I.SNAPSHOT_RESOURCE_NAME}/list`,I.LIST_STATE=`${I.LIST}/state`,I.PAGED=`${I.SNAPSHOT_RESOURCE_NAME}/paged`,I.PAGED_STATE=`${I.PAGED}/state`,I.SINGLE=`${I.SNAPSHOT_RESOURCE_NAME}/single`,I.SINGLE_STATE=`${I.SINGLE}/state`;let R=I;var ie=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,N=(t,e,r,n)=>{for(var E=n>1?void 0:n?ne(e,r):e,u=t.length-1,A;u>=0;u--)(A=t[u])&&(E=(n?A(e,r,E):A(E))||E);return n&&E&&ie(e,r,E),E},c=(t,e)=>(r,n)=>e(r,n,t);exports.SnapshotQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r){throw i.autoGeneratedError(e,r)}list(e,r){throw i.autoGeneratedError(e,r)}listStream(e,r){throw i.autoGeneratedError(e,r)}listState(e,r){throw i.autoGeneratedError(e,r)}listStateStream(e,r){throw i.autoGeneratedError(e,r)}paged(e,r){throw i.autoGeneratedError(e,r)}pagedState(e,r){throw i.autoGeneratedError(e,r)}single(e,r){throw i.autoGeneratedError(e,r)}singleState(e,r){throw i.autoGeneratedError(e,r)}getById(e,r){const n=F({condition:Y(e)});return this.single(n,r)}getStateById(e,r){const n=F({condition:Y(e)});return this.singleState(n,r)}getByIds(e,r){const n=x({condition:H(e),limit:e.length});return this.list(n,r)}getStateByIds(e,r){const n=x({condition:H(e),limit:e.length});return this.listState(n,r)}};N([i.post(R.COUNT),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"count",1);N([i.post(R.LIST),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"list",1);N([i.post(R.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:U.JsonEventStreamResultExtractor}),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"listStream",1);N([i.post(R.LIST_STATE),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"listState",1);N([i.post(R.LIST_STATE,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:U.JsonEventStreamResultExtractor}),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"listStateStream",1);N([i.post(R.PAGED),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"paged",1);N([i.post(R.PAGED_STATE),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"pagedState",1);N([i.post(R.SINGLE),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"single",1);N([i.post(R.SINGLE_STATE),c(0,i.body()),c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"singleState",1);N([c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getById",1);N([c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getStateById",1);N([c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getByIds",1);N([c(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getStateByIds",1);exports.SnapshotQueryClient=N([i.api()],exports.SnapshotQueryClient);var Ee=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,V=(t,e,r,n)=>{for(var E=n>1?void 0:n?oe(e,r):e,u=t.length-1,A;u>=0;u--)(A=t[u])&&(E=(n?A(e,r,E):A(E))||E);return n&&E&&Ee(e,r,E),E},D=(t,e)=>(r,n)=>e(r,n,t);const p=class p{};p.LOAD="{id}/state",p.LOAD_VERSIONED=`${p.LOAD}/{version}`,p.LOAD_TIME_BASED=`${p.LOAD}/time/{createTime}`;let y=p;exports.LoadStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e,r){throw i.autoGeneratedError(e,r)}loadVersioned(e,r,n){throw i.autoGeneratedError(e,r,n)}loadTimeBased(e,r,n){throw i.autoGeneratedError(e,r,n)}};V([i.get(y.LOAD),D(0,i.path("id")),D(1,i.attribute())],exports.LoadStateAggregateClient.prototype,"load",1);V([i.get(y.LOAD_VERSIONED),D(0,i.path("id")),D(1,i.path("version")),D(2,i.attribute())],exports.LoadStateAggregateClient.prototype,"loadVersioned",1);V([i.get(y.LOAD_TIME_BASED),D(0,i.path("id")),D(1,i.path("createTime")),D(2,i.attribute())],exports.LoadStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadStateAggregateClient=V([i.api()],exports.LoadStateAggregateClient);var se=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,B=(t,e,r,n)=>{for(var E=n>1?void 0:n?ae(e,r):e,u=t.length-1,A;u>=0;u--)(A=t[u])&&(E=(n?A(e,r,E):A(E))||E);return n&&E&&se(e,r,E),E},W=(t,e)=>(r,n)=>e(r,n,t);const L=class L{};L.LOAD="state",L.LOAD_VERSIONED=`${L.LOAD}/{version}`,L.LOAD_TIME_BASED=`${L.LOAD}/time/{createTime}`;let G=L;exports.LoadOwnerStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e){throw i.autoGeneratedError(e)}loadVersioned(e,r){throw i.autoGeneratedError(e,r)}loadTimeBased(e,r){throw i.autoGeneratedError(e,r)}};B([i.get(G.LOAD),W(0,i.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"load",1);B([i.get(G.LOAD_VERSIONED),W(0,i.path("version")),W(1,i.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadVersioned",1);B([i.get(G.LOAD_TIME_BASED),W(0,i.path("createTime")),W(1,i.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadOwnerStateAggregateClient=B([i.api()],exports.LoadOwnerStateAggregateClient);const Et="~";function ot({field:t,cursorId:e=Et,direction:r=P.DESC}){return r===P.ASC?tt(t,e):et(t,e)}function st({field:t,direction:e=P.DESC}){return{field:t,direction:e}}function Te(t){const e=t.query,r=m(ot(t),e.condition),n=st(t);return{...e,condition:r,sort:[n]}}function M(t){let e=f.combineURLs(t.resourceAttribution??"",t.aggregateName??"");return t.contextAlias&&(e=f.combineURLs(t.contextAlias,e)),{...t,basePath:e}}class ce{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.SnapshotQueryClient(r)}createLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadStateAggregateClient(r)}createOwnerLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadOwnerStateAggregateClient(r)}createEventStreamQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.EventStreamQueryClient(r)}}var at=(t=>(t.NONE="",t.TENANT="/tenant/{tenantId}",t.OWNER="/owner/{ownerId}",t.TENANT_OWNER="/tenant/{tenantId}/owner/{ownerId}",t))(at||{}),Tt=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(Tt||{});const T=class T{static isSucceeded(e){return e===T.SUCCEEDED}static isError(e){return!T.isSucceeded(e)}};T.SUCCEEDED="Ok",T.SUCCEEDED_MESSAGE="",T.NOT_FOUND="NotFound",T.NOT_FOUND_MESSAGE="Not found resource!",T.BAD_REQUEST="BadRequest",T.ILLEGAL_ARGUMENT="IllegalArgument",T.ILLEGAL_STATE="IllegalState",T.REQUEST_TIMEOUT="RequestTimeout",T.TOO_MANY_REQUESTS="TooManyRequests",T.DUPLICATE_REQUEST_ID="DuplicateRequestId",T.COMMAND_VALIDATION="CommandValidation",T.REWRITE_NO_COMMAND="RewriteNoCommand",T.EVENT_VERSION_CONFLICT="EventVersionConflict",T.DUPLICATE_AGGREGATE_ID="DuplicateAggregateId",T.COMMAND_EXPECT_VERSION_CONFLICT="CommandExpectVersionConflict",T.SOURCING_VERSION_CONFLICT="SourcingVersionConflict",T.ILLEGAL_ACCESS_DELETED_AGGREGATE="IllegalAccessDeletedAggregate",T.ILLEGAL_ACCESS_OWNER_AGGREGATE="IllegalAccessOwnerAggregate",T.INTERNAL_SERVER_ERROR="InternalServerError";let J=T;var ct=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(ct||{});const ue="";var ut=(t=>(t.MAP="MAP",t.STRING="STRING",t))(ut||{});exports.CURSOR_ID_START=Et;exports.CommandHeaders=X;exports.CommandStage=z;exports.ConditionOptionKey=Q;exports.DEFAULT_OWNER_ID=ue;exports.DEFAULT_PAGINATION=g;exports.DEFAULT_PROJECTION=rt;exports.DeletionState=Z;exports.DomainEventStreamMetadataFields=q;exports.EMPTY_PAGED_LIST=nt;exports.ErrorCodes=J;exports.EventStreamQueryEndpointPaths=C;exports.FunctionKind=ct;exports.LoadOwnerStateAggregateEndpointPaths=G;exports.LoadStateAggregateEndpointPaths=y;exports.MessageHeaderSqlType=ut;exports.Operator=s;exports.QueryClientFactory=ce;exports.RecoverableType=Tt;exports.ResourceAttributionPathSpec=at;exports.SnapshotMetadataFields=j;exports.SnapshotQueryEndpointPaths=R;exports.SortDirection=P;exports.active=_t;exports.aggregateId=Y;exports.aggregateIds=H;exports.all=_;exports.allIn=Mt;exports.and=m;exports.asc=kt;exports.beforeToday=Bt;exports.between=Gt;exports.contains=gt;exports.createQueryApiMetadata=M;exports.cursorCondition=ot;exports.cursorQuery=Te;exports.cursorSort=st;exports.dateOptions=l;exports.defaultProjection=it;exports.deleted=k;exports.desc=te;exports.earlierDays=jt;exports.elemMatch=Wt;exports.endsWith=Pt;exports.eq=ht;exports.exists=$t;exports.gt=tt;exports.gte=Lt;exports.id=Rt;exports.ids=lt;exports.ignoreCaseOptions=$;exports.isFalse=Ut;exports.isIn=ft;exports.isNull=vt;exports.isTrue=wt;exports.isValidateCondition=w;exports.lastMonth=xt;exports.lastWeek=Ht;exports.listQuery=x;exports.lt=et;exports.lte=Ct;exports.ne=pt;exports.nextWeek=Yt;exports.nor=St;exports.notIn=yt;exports.notNull=bt;exports.or=Nt;exports.ownerId=Dt;exports.pagedList=mt;exports.pagedQuery=Zt;exports.pagination=Kt;exports.projection=zt;exports.raw=Jt;exports.recentDays=qt;exports.singleQuery=F;exports.startsWith=dt;exports.tenantId=Ot;exports.thisMonth=Ft;exports.thisWeek=Qt;exports.today=Vt;exports.tomorrow=Xt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@ahoo-wang/fetcher"),b=require("@ahoo-wang/fetcher-eventstream"),i=require("@ahoo-wang/fetcher-decorator");var ut=Object.defineProperty,It=Object.getOwnPropertyDescriptor,J=(t,e,r,n)=>{for(var E=n>1?void 0:n?It(e,r):e,c=t.length-1,u;c>=0;c--)(u=t[c])&&(E=(n?u(e,r,E):u(E))||E);return n&&E&&ut(e,r,E),E},U=(t,e)=>(r,n)=>e(r,n,t);exports.CommandClient=class{constructor(e){this.apiMetadata=e}send(e,r){throw i.autoGeneratedError(e,r)}sendAndWaitStream(e,r){throw i.autoGeneratedError(e,r)}};J([i.endpoint(),U(0,i.request()),U(1,i.attribute())],exports.CommandClient.prototype,"send",1);J([i.endpoint(void 0,void 0,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),U(0,i.request()),U(1,i.attribute())],exports.CommandClient.prototype,"sendAndWaitStream",1);exports.CommandClient=J([i.api()],exports.CommandClient);const o=class o{};o.COMMAND_HEADERS_PREFIX="Command-",o.TENANT_ID=`${o.COMMAND_HEADERS_PREFIX}Tenant-Id`,o.OWNER_ID=`${o.COMMAND_HEADERS_PREFIX}Owner-Id`,o.AGGREGATE_ID=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Id`,o.AGGREGATE_VERSION=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Version`,o.WAIT_PREFIX=`${o.COMMAND_HEADERS_PREFIX}Wait-`,o.WAIT_TIME_OUT=`${o.WAIT_PREFIX}Timeout`,o.WAIT_STAGE=`${o.WAIT_PREFIX}Stage`,o.WAIT_CONTEXT=`${o.WAIT_PREFIX}Context`,o.WAIT_PROCESSOR=`${o.WAIT_PREFIX}Processor`,o.WAIT_FUNCTION=`${o.WAIT_PREFIX}Function`,o.WAIT_TAIL_PREFIX=`${o.WAIT_PREFIX}Tail-`,o.WAIT_TAIL_STAGE=`${o.WAIT_TAIL_PREFIX}Stage`,o.WAIT_TAIL_CONTEXT=`${o.WAIT_TAIL_PREFIX}Context`,o.WAIT_TAIL_PROCESSOR=`${o.WAIT_TAIL_PREFIX}Processor`,o.WAIT_TAIL_FUNCTION=`${o.WAIT_TAIL_PREFIX}Function`,o.REQUEST_ID=`${o.COMMAND_HEADERS_PREFIX}Request-Id`,o.LOCAL_FIRST=`${o.COMMAND_HEADERS_PREFIX}Local-First`,o.COMMAND_AGGREGATE_CONTEXT=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Context`,o.COMMAND_AGGREGATE_NAME=`${o.COMMAND_HEADERS_PREFIX}Aggregate-Name`,o.COMMAND_TYPE=`${o.COMMAND_HEADERS_PREFIX}Type`,o.COMMAND_HEADER_X_PREFIX=`${o.COMMAND_HEADERS_PREFIX}Header-`;let B=o;var z=(t=>(t.SENT="SENT",t.PROCESSED="PROCESSED",t.SNAPSHOT="SNAPSHOT",t.PROJECTED="PROJECTED",t.EVENT_HANDLED="EVENT_HANDLED",t.SAGA_HANDLED="SAGA_HANDLED",t))(z||{}),s=(t=>(t.AND="AND",t.OR="OR",t.NOR="NOR",t.ID="ID",t.IDS="IDS",t.AGGREGATE_ID="AGGREGATE_ID",t.AGGREGATE_IDS="AGGREGATE_IDS",t.TENANT_ID="TENANT_ID",t.OWNER_ID="OWNER_ID",t.DELETED="DELETED",t.ALL="ALL",t.EQ="EQ",t.NE="NE",t.GT="GT",t.LT="LT",t.GTE="GTE",t.LTE="LTE",t.CONTAINS="CONTAINS",t.IN="IN",t.NOT_IN="NOT_IN",t.BETWEEN="BETWEEN",t.ALL_IN="ALL_IN",t.STARTS_WITH="STARTS_WITH",t.ENDS_WITH="ENDS_WITH",t.ELEM_MATCH="ELEM_MATCH",t.NULL="NULL",t.NOT_NULL="NOT_NULL",t.TRUE="TRUE",t.FALSE="FALSE",t.EXISTS="EXISTS",t.TODAY="TODAY",t.BEFORE_TODAY="BEFORE_TODAY",t.TOMORROW="TOMORROW",t.THIS_WEEK="THIS_WEEK",t.NEXT_WEEK="NEXT_WEEK",t.LAST_WEEK="LAST_WEEK",t.THIS_MONTH="THIS_MONTH",t.LAST_MONTH="LAST_MONTH",t.RECENT_DAYS="RECENT_DAYS",t.EARLIER_DAYS="EARLIER_DAYS",t.RAW="RAW",t))(s||{});const St=new Set(["AND","OR","NOR"]),Nt=new Set(["NULL","NOT_NULL","TRUE","FALSE","EXISTS","TODAY","TOMORROW","THIS_WEEK","NEXT_WEEK","LAST_WEEK","THIS_MONTH","LAST_MONTH"]);function w(t){return!!t}const P=class P{};P.IGNORE_CASE_OPTION_KEY="ignoreCase",P.ZONE_ID_OPTION_KEY="zoneId",P.DATE_PATTERN_OPTION_KEY="datePattern";let Q=P;function $(t){if(!(typeof t>"u"))return{ignoreCase:t}}function O(t,e){if(typeof t>"u"&&typeof e>"u")return;const r={};return typeof t<"u"&&(r.datePattern=t),typeof e<"u"&&(r.zoneId=e),r}var Z=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(Z||{});function m(...t){if(t.length===0)return _();if(t.length===1)return w(t[0])?t[0]:_();const e=[];return t.forEach(r=>{r?.operator===s.ALL||!w(r)||(r.operator===s.AND&&r.children?e.push(...r.children):e.push(r))}),{operator:s.AND,children:e}}function Rt(...t){const e=t?.filter(r=>w(r));return e.length===0?_():{operator:s.OR,children:e}}function Ot(...t){return t.length===0?_():{operator:s.NOR,children:t}}function lt(t){return{operator:s.ID,value:t}}function Dt(t){return{operator:s.IDS,value:t}}function Y(t){return{operator:s.AGGREGATE_ID,value:t}}function H(t){return{operator:s.AGGREGATE_IDS,value:t}}function _t(t){return{operator:s.TENANT_ID,value:t}}function Lt(t){return{operator:s.OWNER_ID,value:t}}function k(t){return{operator:s.DELETED,value:t}}function ht(){return k("ACTIVE")}function _(){return{operator:s.ALL}}function pt(t,e){return{field:t,operator:s.EQ,value:e}}function Ct(t,e){return{field:t,operator:s.NE,value:e}}function tt(t,e){return{field:t,operator:s.GT,value:e}}function et(t,e){return{field:t,operator:s.LT,value:e}}function gt(t,e){return{field:t,operator:s.GTE,value:e}}function ft(t,e){return{field:t,operator:s.LTE,value:e}}function yt(t,e,r){const n=$(r);return{field:t,operator:s.CONTAINS,value:e,options:n}}function Gt(t,...e){return{field:t,operator:s.IN,value:e}}function Mt(t,...e){return{field:t,operator:s.NOT_IN,value:e}}function Pt(t,e,r){return{field:t,operator:s.BETWEEN,value:[e,r]}}function dt(t,...e){return{field:t,operator:s.ALL_IN,value:e}}function Wt(t,e,r){const n=$(r);return{field:t,operator:s.STARTS_WITH,value:e,options:n}}function vt(t,e,r){const n=$(r);return{field:t,operator:s.ENDS_WITH,value:e,options:n}}function Ut(t,e){return{field:t,operator:s.ELEM_MATCH,children:[e]}}function wt(t){return{field:t,operator:s.NULL}}function bt(t){return{field:t,operator:s.NOT_NULL}}function $t(t){return{field:t,operator:s.TRUE}}function Vt(t){return{field:t,operator:s.FALSE}}function Xt(t,e=!0){return{field:t,operator:s.EXISTS,value:e}}function Bt(t,e,r){const n=O(e,r);return{field:t,operator:s.TODAY,options:n}}function Qt(t,e,r,n){const E=O(r,n);return{field:t,operator:s.BEFORE_TODAY,value:e,options:E}}function Yt(t,e,r){const n=O(e,r);return{field:t,operator:s.TOMORROW,options:n}}function Ht(t,e,r){const n=O(e,r);return{field:t,operator:s.THIS_WEEK,options:n}}function Ft(t,e,r){const n=O(e,r);return{field:t,operator:s.NEXT_WEEK,options:n}}function xt(t,e,r){const n=O(e,r);return{field:t,operator:s.LAST_WEEK,options:n}}function qt(t,e,r){const n=O(e,r);return{field:t,operator:s.THIS_MONTH,options:n}}function jt(t,e,r){const n=O(e,r);return{field:t,operator:s.LAST_MONTH,options:n}}function Kt(t,e,r,n){const E=O(r,n);return{field:t,operator:s.RECENT_DAYS,value:e,options:E}}function Jt(t,e,r,n){const E=O(r,n);return{field:t,operator:s.EARLIER_DAYS,value:e,options:E}}function zt(t){return{operator:s.RAW,value:t}}const g={index:1,size:10};function Zt({index:t=g.index,size:e=g.size}=g){return{index:t,size:e}}const rt={};function it(){return rt}function mt({include:t,exclude:e}=it()){return{include:t,exclude:e}}function F({condition:t=_(),projection:e,sort:r}={}){return{condition:t,projection:e,sort:r}}function x({condition:t=_(),projection:e,sort:r,limit:n=g.size}={}){return{condition:t,projection:e,sort:r,limit:n}}function kt({condition:t=_(),projection:e,sort:r,pagination:n=g}={}){return{condition:t,projection:e,sort:r,pagination:n}}const nt={total:0,list:[]};function te({total:t,list:e=[]}=nt){return t===void 0&&(t=e.length),{total:t,list:e}}var d=(t=>(t.ASC="ASC",t.DESC="DESC",t))(d||{});function ee(t){return{field:t,direction:"ASC"}}function re(t){return{field:t,direction:"DESC"}}const a=class a{};a.HEADER="header",a.COMMAND_OPERATOR=`${a.HEADER}.command_operator`,a.AGGREGATE_ID="aggregateId",a.TENANT_ID="tenantId",a.OWNER_ID="ownerId",a.COMMAND_ID="commandId",a.REQUEST_ID="requestId",a.VERSION="version",a.BODY="body",a.BODY_ID=`${a.BODY}.id`,a.BODY_NAME=`${a.BODY}.name`,a.BODY_TYPE=`${a.BODY}.bodyType`,a.BODY_REVISION=`${a.BODY}.revision`,a.BODY_BODY=`${a.BODY}.body`,a.CREATE_TIME="createTime";let q=a;const l=class l{};l.EVENT_STREAM_RESOURCE_NAME="event",l.COUNT=`${l.EVENT_STREAM_RESOURCE_NAME}/count`,l.LIST=`${l.EVENT_STREAM_RESOURCE_NAME}/list`,l.PAGED=`${l.EVENT_STREAM_RESOURCE_NAME}/paged`;let C=l;var ie=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,v=(t,e,r,n)=>{for(var E=n>1?void 0:n?ne(e,r):e,c=t.length-1,u;c>=0;c--)(u=t[c])&&(E=(n?u(e,r,E):u(E))||E);return n&&E&&ie(e,r,E),E},L=(t,e)=>(r,n)=>e(r,n,t);exports.EventStreamQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r){throw i.autoGeneratedError(e,r)}list(e,r){throw i.autoGeneratedError(e,r)}listStream(e,r){throw i.autoGeneratedError(e,r)}paged(e,r){throw i.autoGeneratedError(e,r)}};v([i.post(C.COUNT),L(0,i.body()),L(1,i.attribute())],exports.EventStreamQueryClient.prototype,"count",1);v([i.post(C.LIST),L(0,i.body()),L(1,i.attribute())],exports.EventStreamQueryClient.prototype,"list",1);v([i.post(C.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),L(0,i.body()),L(1,i.attribute())],exports.EventStreamQueryClient.prototype,"listStream",1);v([i.post(C.PAGED),L(0,i.body()),L(1,i.attribute())],exports.EventStreamQueryClient.prototype,"paged",1);exports.EventStreamQueryClient=v([i.api()],exports.EventStreamQueryClient);const N=class N{};N.VERSION="version",N.TENANT_ID="tenantId",N.OWNER_ID="ownerId",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.DELETED="deleted",N.STATE="state";let j=N;const I=class I{};I.SNAPSHOT_RESOURCE_NAME="snapshot",I.COUNT=`${I.SNAPSHOT_RESOURCE_NAME}/count`,I.LIST=`${I.SNAPSHOT_RESOURCE_NAME}/list`,I.LIST_STATE=`${I.LIST}/state`,I.PAGED=`${I.SNAPSHOT_RESOURCE_NAME}/paged`,I.PAGED_STATE=`${I.PAGED}/state`,I.SINGLE=`${I.SNAPSHOT_RESOURCE_NAME}/single`,I.SINGLE_STATE=`${I.SINGLE}/state`;let R=I;var Ee=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,S=(t,e,r,n)=>{for(var E=n>1?void 0:n?oe(e,r):e,c=t.length-1,u;c>=0;c--)(u=t[c])&&(E=(n?u(e,r,E):u(E))||E);return n&&E&&Ee(e,r,E),E},A=(t,e)=>(r,n)=>e(r,n,t);exports.SnapshotQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r){throw i.autoGeneratedError(e,r)}list(e,r){throw i.autoGeneratedError(e,r)}listStream(e,r){throw i.autoGeneratedError(e,r)}listState(e,r){throw i.autoGeneratedError(e,r)}listStateStream(e,r){throw i.autoGeneratedError(e,r)}paged(e,r){throw i.autoGeneratedError(e,r)}pagedState(e,r){throw i.autoGeneratedError(e,r)}single(e,r){throw i.autoGeneratedError(e,r)}singleState(e,r){throw i.autoGeneratedError(e,r)}getById(e,r){const n=F({condition:Y(e)});return this.single(n,r)}getStateById(e,r){const n=F({condition:Y(e)});return this.singleState(n,r)}getByIds(e,r){const n=x({condition:H(e),limit:e.length});return this.list(n,r)}getStateByIds(e,r){const n=x({condition:H(e),limit:e.length});return this.listState(n,r)}};S([i.post(R.COUNT),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"count",1);S([i.post(R.LIST),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"list",1);S([i.post(R.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"listStream",1);S([i.post(R.LIST_STATE),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"listState",1);S([i.post(R.LIST_STATE,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"listStateStream",1);S([i.post(R.PAGED),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"paged",1);S([i.post(R.PAGED_STATE),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"pagedState",1);S([i.post(R.SINGLE),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"single",1);S([i.post(R.SINGLE_STATE),A(0,i.body()),A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"singleState",1);S([A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getById",1);S([A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getStateById",1);S([A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getByIds",1);S([A(1,i.attribute())],exports.SnapshotQueryClient.prototype,"getStateByIds",1);exports.SnapshotQueryClient=S([i.api()],exports.SnapshotQueryClient);var se=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,V=(t,e,r,n)=>{for(var E=n>1?void 0:n?ae(e,r):e,c=t.length-1,u;c>=0;c--)(u=t[c])&&(E=(n?u(e,r,E):u(E))||E);return n&&E&&se(e,r,E),E},D=(t,e)=>(r,n)=>e(r,n,t);const h=class h{};h.LOAD="{id}/state",h.LOAD_VERSIONED=`${h.LOAD}/{version}`,h.LOAD_TIME_BASED=`${h.LOAD}/time/{createTime}`;let y=h;exports.LoadStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e,r){throw i.autoGeneratedError(e,r)}loadVersioned(e,r,n){throw i.autoGeneratedError(e,r,n)}loadTimeBased(e,r,n){throw i.autoGeneratedError(e,r,n)}};V([i.get(y.LOAD),D(0,i.path("id")),D(1,i.attribute())],exports.LoadStateAggregateClient.prototype,"load",1);V([i.get(y.LOAD_VERSIONED),D(0,i.path("id")),D(1,i.path("version")),D(2,i.attribute())],exports.LoadStateAggregateClient.prototype,"loadVersioned",1);V([i.get(y.LOAD_TIME_BASED),D(0,i.path("id")),D(1,i.path("createTime")),D(2,i.attribute())],exports.LoadStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadStateAggregateClient=V([i.api()],exports.LoadStateAggregateClient);var Te=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,X=(t,e,r,n)=>{for(var E=n>1?void 0:n?Ae(e,r):e,c=t.length-1,u;c>=0;c--)(u=t[c])&&(E=(n?u(e,r,E):u(E))||E);return n&&E&&Te(e,r,E),E},W=(t,e)=>(r,n)=>e(r,n,t);const p=class p{};p.LOAD="state",p.LOAD_VERSIONED=`${p.LOAD}/{version}`,p.LOAD_TIME_BASED=`${p.LOAD}/time/{createTime}`;let G=p;exports.LoadOwnerStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e){throw i.autoGeneratedError(e)}loadVersioned(e,r){throw i.autoGeneratedError(e,r)}loadTimeBased(e,r){throw i.autoGeneratedError(e,r)}};X([i.get(G.LOAD),W(0,i.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"load",1);X([i.get(G.LOAD_VERSIONED),W(0,i.path("version")),W(1,i.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadVersioned",1);X([i.get(G.LOAD_TIME_BASED),W(0,i.path("createTime")),W(1,i.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadOwnerStateAggregateClient=X([i.api()],exports.LoadOwnerStateAggregateClient);const Et="~";function ot({field:t,cursorId:e=Et,direction:r=d.DESC}){return r===d.ASC?tt(t,e):et(t,e)}function st({field:t,direction:e=d.DESC}){return{field:t,direction:e}}function ce(t){const e=t.query,r=m(ot(t),e.condition),n=st(t);return{...e,condition:r,sort:[n]}}function M(t){let e=f.combineURLs(t.resourceAttribution??"",t.aggregateName??"");return t.contextAlias&&(e=f.combineURLs(t.contextAlias,e)),{...t,basePath:e}}class ue{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.SnapshotQueryClient(r)}createLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadStateAggregateClient(r)}createOwnerLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadOwnerStateAggregateClient(r)}createEventStreamQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.EventStreamQueryClient(r)}}var at=(t=>(t.NONE="",t.TENANT="/tenant/{tenantId}",t.OWNER="/owner/{ownerId}",t.TENANT_OWNER="/tenant/{tenantId}/owner/{ownerId}",t))(at||{}),Tt=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(Tt||{});const T=class T{static isSucceeded(e){return e===T.SUCCEEDED}static isError(e){return!T.isSucceeded(e)}};T.SUCCEEDED="Ok",T.SUCCEEDED_MESSAGE="",T.NOT_FOUND="NotFound",T.NOT_FOUND_MESSAGE="Not found resource!",T.BAD_REQUEST="BadRequest",T.ILLEGAL_ARGUMENT="IllegalArgument",T.ILLEGAL_STATE="IllegalState",T.REQUEST_TIMEOUT="RequestTimeout",T.TOO_MANY_REQUESTS="TooManyRequests",T.DUPLICATE_REQUEST_ID="DuplicateRequestId",T.COMMAND_VALIDATION="CommandValidation",T.REWRITE_NO_COMMAND="RewriteNoCommand",T.EVENT_VERSION_CONFLICT="EventVersionConflict",T.DUPLICATE_AGGREGATE_ID="DuplicateAggregateId",T.COMMAND_EXPECT_VERSION_CONFLICT="CommandExpectVersionConflict",T.SOURCING_VERSION_CONFLICT="SourcingVersionConflict",T.ILLEGAL_ACCESS_DELETED_AGGREGATE="IllegalAccessDeletedAggregate",T.ILLEGAL_ACCESS_OWNER_AGGREGATE="IllegalAccessOwnerAggregate",T.INTERNAL_SERVER_ERROR="InternalServerError";let K=T;var At=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(At||{});const Ie="";var ct=(t=>(t.MAP="MAP",t.STRING="STRING",t))(ct||{});exports.CURSOR_ID_START=Et;exports.CommandHeaders=B;exports.CommandStage=z;exports.ConditionOptionKey=Q;exports.DEFAULT_OWNER_ID=Ie;exports.DEFAULT_PAGINATION=g;exports.DEFAULT_PROJECTION=rt;exports.DeletionState=Z;exports.DomainEventStreamMetadataFields=q;exports.EMPTY_PAGED_LIST=nt;exports.EMPTY_VALUE_OPERATORS=Nt;exports.ErrorCodes=K;exports.EventStreamQueryEndpointPaths=C;exports.FunctionKind=At;exports.LOGICAL_OPERATORS=St;exports.LoadOwnerStateAggregateEndpointPaths=G;exports.LoadStateAggregateEndpointPaths=y;exports.MessageHeaderSqlType=ct;exports.Operator=s;exports.QueryClientFactory=ue;exports.RecoverableType=Tt;exports.ResourceAttributionPathSpec=at;exports.SnapshotMetadataFields=j;exports.SnapshotQueryEndpointPaths=R;exports.SortDirection=d;exports.active=ht;exports.aggregateId=Y;exports.aggregateIds=H;exports.all=_;exports.allIn=dt;exports.and=m;exports.asc=ee;exports.beforeToday=Qt;exports.between=Pt;exports.contains=yt;exports.createQueryApiMetadata=M;exports.cursorCondition=ot;exports.cursorQuery=ce;exports.cursorSort=st;exports.dateOptions=O;exports.defaultProjection=it;exports.deleted=k;exports.desc=re;exports.earlierDays=Jt;exports.elemMatch=Ut;exports.endsWith=vt;exports.eq=pt;exports.exists=Xt;exports.gt=tt;exports.gte=gt;exports.id=lt;exports.ids=Dt;exports.ignoreCaseOptions=$;exports.isFalse=Vt;exports.isIn=Gt;exports.isNull=wt;exports.isTrue=$t;exports.isValidateCondition=w;exports.lastMonth=jt;exports.lastWeek=xt;exports.listQuery=x;exports.lt=et;exports.lte=ft;exports.ne=Ct;exports.nextWeek=Ft;exports.nor=Ot;exports.notIn=Mt;exports.notNull=bt;exports.or=Rt;exports.ownerId=Lt;exports.pagedList=te;exports.pagedQuery=kt;exports.pagination=Zt;exports.projection=mt;exports.raw=zt;exports.recentDays=Kt;exports.singleQuery=F;exports.startsWith=Wt;exports.tenantId=_t;exports.thisMonth=qt;exports.thisWeek=Ht;exports.today=Bt;exports.tomorrow=Yt;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|