@ahoo-wang/fetcher-wow 2.16.0 → 2.16.1

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/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@ahoo-wang/fetcher"),M=require("@ahoo-wang/fetcher-eventstream"),E=require("@ahoo-wang/fetcher-decorator");var nt=Object.defineProperty,it=Object.getOwnPropertyDescriptor,B=(t,e,r,n)=>{for(var o=n>1?void 0:n?it(e,r):e,R=t.length-1,S;R>=0;R--)(S=t[R])&&(o=(n?S(e,r,o):S(o))||o);return n&&o&&nt(e,r,o),o},G=(t,e)=>(r,n)=>e(r,n,t);exports.CommandClient=class{constructor(e){this.apiMetadata=e}send(e,r){throw E.autoGeneratedError(e,r)}sendAndWaitStream(e,r){throw E.autoGeneratedError(e,r)}};B([E.endpoint(),G(0,E.request()),G(1,E.attribute())],exports.CommandClient.prototype,"send",1);B([E.endpoint(void 0,void 0,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:M.JsonEventStreamResultExtractor}),G(0,E.request()),G(1,E.attribute())],exports.CommandClient.prototype,"sendAndWaitStream",1);exports.CommandClient=B([E.api()],exports.CommandClient);const i=class i{};i.COMMAND_HEADERS_PREFIX="Command-",i.TENANT_ID=`${i.COMMAND_HEADERS_PREFIX}Tenant-Id`,i.OWNER_ID=`${i.COMMAND_HEADERS_PREFIX}Owner-Id`,i.AGGREGATE_ID=`${i.COMMAND_HEADERS_PREFIX}Aggregate-Id`,i.AGGREGATE_VERSION=`${i.COMMAND_HEADERS_PREFIX}Aggregate-Version`,i.WAIT_PREFIX=`${i.COMMAND_HEADERS_PREFIX}Wait-`,i.WAIT_TIME_OUT=`${i.WAIT_PREFIX}Timeout`,i.WAIT_STAGE=`${i.WAIT_PREFIX}Stage`,i.WAIT_CONTEXT=`${i.WAIT_PREFIX}Context`,i.WAIT_PROCESSOR=`${i.WAIT_PREFIX}Processor`,i.WAIT_FUNCTION=`${i.WAIT_PREFIX}Function`,i.WAIT_TAIL_PREFIX=`${i.WAIT_PREFIX}Tail-`,i.WAIT_TAIL_STAGE=`${i.WAIT_TAIL_PREFIX}Stage`,i.WAIT_TAIL_CONTEXT=`${i.WAIT_TAIL_PREFIX}Context`,i.WAIT_TAIL_PROCESSOR=`${i.WAIT_TAIL_PREFIX}Processor`,i.WAIT_TAIL_FUNCTION=`${i.WAIT_TAIL_PREFIX}Function`,i.REQUEST_ID=`${i.COMMAND_HEADERS_PREFIX}Request-Id`,i.LOCAL_FIRST=`${i.COMMAND_HEADERS_PREFIX}Local-First`,i.COMMAND_AGGREGATE_CONTEXT=`${i.COMMAND_HEADERS_PREFIX}Aggregate-Context`,i.COMMAND_AGGREGATE_NAME=`${i.COMMAND_HEADERS_PREFIX}Aggregate-Name`,i.COMMAND_TYPE=`${i.COMMAND_HEADERS_PREFIX}Type`,i.COMMAND_HEADER_X_PREFIX=`${i.COMMAND_HEADERS_PREFIX}Header-`;let W=i;var Y=(t=>(t.SENT="SENT",t.PROCESSED="PROCESSED",t.SNAPSHOT="SNAPSHOT",t.PROJECTED="PROJECTED",t.EVENT_HANDLED="EVENT_HANDLED",t.SAGA_HANDLED="SAGA_HANDLED",t))(Y||{}),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 g(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 U=p;function P(t){if(!(typeof t>"u"))return{ignoreCase:t}}function D(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 H=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(H||{});function F(...t){if(t.length===0)return O();if(t.length===1)return g(t[0])?t[0]:O();const e=[];return t.forEach(r=>{r?.operator===s.ALL||!g(r)||(r.operator===s.AND&&r.children?e.push(...r.children):e.push(r))}),{operator:s.AND,children:e}}function st(...t){const e=t?.filter(r=>g(r));return e.length===0?O():{operator:s.OR,children:e}}function ot(...t){return t.length===0?O():{operator:s.NOR,children:t}}function Tt(t){return{operator:s.ID,value:t}}function ut(t){return{operator:s.IDS,value:t}}function b(t){return{operator:s.AGGREGATE_ID,value:t}}function v(t){return{operator:s.AGGREGATE_IDS,value:t}}function ct(t){return{operator:s.TENANT_ID,value:t}}function At(t){return{operator:s.OWNER_ID,value:t}}function x(t){return{operator:s.DELETED,value:t}}function It(){return x("ACTIVE")}function O(){return{operator:s.ALL}}function at(t,e){return{field:t,operator:s.EQ,value:e}}function Nt(t,e){return{field:t,operator:s.NE,value:e}}function q(t,e){return{field:t,operator:s.GT,value:e}}function j(t,e){return{field:t,operator:s.LT,value:e}}function Rt(t,e){return{field:t,operator:s.GTE,value:e}}function St(t,e){return{field:t,operator:s.LTE,value:e}}function Dt(t,e,r){const n=P(r);return{field:t,operator:s.CONTAINS,value:e,options:n}}function lt(t,...e){return{field:t,operator:s.IN,value:e}}function Ot(t,...e){return{field:t,operator:s.NOT_IN,value:e}}function _t(t,e,r){return{field:t,operator:s.BETWEEN,value:[e,r]}}function ht(t,...e){return{field:t,operator:s.ALL_IN,value:e}}function Lt(t,e,r){const n=P(r);return{field:t,operator:s.STARTS_WITH,value:e,options:n}}function Ct(t,e,r){const n=P(r);return{field:t,operator:s.ENDS_WITH,value:e,options:n}}function pt(t,e){return{field:t,operator:s.ELEM_MATCH,children:[e]}}function ft(t){return{field:t,operator:s.NULL}}function yt(t){return{field:t,operator:s.NOT_NULL}}function Gt(t){return{field:t,operator:s.TRUE}}function gt(t){return{field:t,operator:s.FALSE}}function Mt(t,e=!0){return{field:t,operator:s.EXISTS,value:e}}function Pt(t,e,r){const n=D(e,r);return{field:t,operator:s.TODAY,options:n}}function Wt(t,e,r,n){const o=D(r,n);return{field:t,operator:s.BEFORE_TODAY,value:e,options:o}}function Ut(t,e,r){const n=D(e,r);return{field:t,operator:s.TOMORROW,options:n}}function bt(t,e,r){const n=D(e,r);return{field:t,operator:s.THIS_WEEK,options:n}}function vt(t,e,r){const n=D(e,r);return{field:t,operator:s.NEXT_WEEK,options:n}}function Vt(t,e,r){const n=D(e,r);return{field:t,operator:s.LAST_WEEK,options:n}}function $t(t,e,r){const n=D(e,r);return{field:t,operator:s.THIS_MONTH,options:n}}function wt(t,e,r){const n=D(e,r);return{field:t,operator:s.LAST_MONTH,options:n}}function Xt(t,e,r,n){const o=D(r,n);return{field:t,operator:s.RECENT_DAYS,value:e,options:o}}function dt(t,e,r,n){const o=D(r,n);return{field:t,operator:s.EARLIER_DAYS,value:e,options:o}}function Qt(t){return{operator:s.RAW,value:t}}const L={index:1,size:10};function Bt({index:t=L.index,size:e=L.size}=L){return{index:t,size:e}}const J={};function K(){return J}function Yt({include:t,exclude:e}=K()){return{include:t,exclude:e}}function V({condition:t=O(),projection:e,sort:r}={}){return{condition:t,projection:e,sort:r}}function $({condition:t=O(),projection:e,sort:r,limit:n=L.size}={}){return{condition:t,projection:e,sort:r,limit:n}}function Ht({condition:t=O(),projection:e,sort:r,pagination:n=L}={}){return{condition:t,projection:e,sort:r,pagination:n}}const z={total:0,list:[]};function Ft({total:t,list:e=[]}=z){return t===void 0&&(t=e.length),{total:t,list:e}}var f=(t=>(t.ASC="ASC",t.DESC="DESC",t))(f||{});function xt(t){return{field:t,direction:"ASC"}}function qt(t){return{field:t,direction:"DESC"}}const T=class T{};T.HEADER="header",T.COMMAND_OPERATOR=`${T.HEADER}.command_operator`,T.AGGREGATE_ID="aggregateId",T.TENANT_ID="tenantId",T.OWNER_ID="ownerId",T.COMMAND_ID="commandId",T.REQUEST_ID="requestId",T.VERSION="version",T.BODY="body",T.BODY_ID=`${T.BODY}.id`,T.BODY_NAME=`${T.BODY}.name`,T.BODY_TYPE=`${T.BODY}.bodyType`,T.BODY_REVISION=`${T.BODY}.revision`,T.BODY_BODY=`${T.BODY}.body`,T.CREATE_TIME="createTime";let w=T;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 h=l;var jt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,y=(t,e,r,n)=>{for(var o=n>1?void 0:n?Jt(e,r):e,R=t.length-1,S;R>=0;R--)(S=t[R])&&(o=(n?S(e,r,o):S(o))||o);return n&&o&&jt(e,r,o),o},_=(t,e)=>(r,n)=>e(r,n,t);exports.EventStreamQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r){throw E.autoGeneratedError(e,r)}list(e,r){throw E.autoGeneratedError(e,r)}listStream(e,r){throw E.autoGeneratedError(e,r)}paged(e,r){throw E.autoGeneratedError(e,r)}};y([E.post(h.COUNT),_(0,E.body()),_(1,E.attribute())],exports.EventStreamQueryClient.prototype,"count",1);y([E.post(h.LIST),_(0,E.body()),_(1,E.attribute())],exports.EventStreamQueryClient.prototype,"list",1);y([E.post(h.LIST,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:M.JsonEventStreamResultExtractor}),_(0,E.body()),_(1,E.attribute())],exports.EventStreamQueryClient.prototype,"listStream",1);y([E.post(h.PAGED),_(0,E.body()),_(1,E.attribute())],exports.EventStreamQueryClient.prototype,"paged",1);exports.EventStreamQueryClient=y([E.api()],exports.EventStreamQueryClient);const a=class a{};a.VERSION="version",a.TENANT_ID="tenantId",a.OWNER_ID="ownerId",a.EVENT_ID="eventId",a.FIRST_EVENT_TIME="firstEventTime",a.EVENT_TIME="eventTime",a.FIRST_OPERATOR="firstOperator",a.OPERATOR="operator",a.SNAPSHOT_TIME="snapshotTime",a.DELETED="deleted",a.STATE="state";let X=a;const A=class A{};A.SNAPSHOT_RESOURCE_NAME="snapshot",A.COUNT=`${A.SNAPSHOT_RESOURCE_NAME}/count`,A.LIST=`${A.SNAPSHOT_RESOURCE_NAME}/list`,A.LIST_STATE=`${A.LIST}/state`,A.PAGED=`${A.SNAPSHOT_RESOURCE_NAME}/paged`,A.PAGED_STATE=`${A.PAGED}/state`,A.SINGLE=`${A.SNAPSHOT_RESOURCE_NAME}/single`,A.SINGLE_STATE=`${A.SINGLE}/state`;let N=A;var Kt=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,I=(t,e,r,n)=>{for(var o=n>1?void 0:n?zt(e,r):e,R=t.length-1,S;R>=0;R--)(S=t[R])&&(o=(n?S(e,r,o):S(o))||o);return n&&o&&Kt(e,r,o),o},c=(t,e)=>(r,n)=>e(r,n,t);exports.SnapshotQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r){throw E.autoGeneratedError(e,r)}list(e,r){throw E.autoGeneratedError(e,r)}listStream(e,r){throw E.autoGeneratedError(e,r)}listState(e,r){throw E.autoGeneratedError(e,r)}listStateStream(e,r){throw E.autoGeneratedError(e,r)}paged(e,r){throw E.autoGeneratedError(e,r)}pagedState(e,r){throw E.autoGeneratedError(e,r)}single(e,r){throw E.autoGeneratedError(e,r)}singleState(e,r){throw E.autoGeneratedError(e,r)}getById(e,r){const n=V({condition:b(e)});return this.single(n,r)}getStateById(e,r){const n=V({condition:b(e)});return this.singleState(n,r)}getByIds(e,r){const n=$({condition:v(e),limit:e.length});return this.list(n,r)}getStateByIds(e,r){const n=$({condition:v(e),limit:e.length});return this.listState(n,r)}};I([E.post(N.COUNT),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"count",1);I([E.post(N.LIST),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"list",1);I([E.post(N.LIST,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:M.JsonEventStreamResultExtractor}),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"listStream",1);I([E.post(N.LIST_STATE),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"listState",1);I([E.post(N.LIST_STATE,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:M.JsonEventStreamResultExtractor}),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"listStateStream",1);I([E.post(N.PAGED),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"paged",1);I([E.post(N.PAGED_STATE),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"pagedState",1);I([E.post(N.SINGLE),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"single",1);I([E.post(N.SINGLE_STATE),c(0,E.body()),c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"singleState",1);I([c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"getById",1);I([c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"getStateById",1);I([c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"getByIds",1);I([c(1,E.attribute())],exports.SnapshotQueryClient.prototype,"getStateByIds",1);exports.SnapshotQueryClient=I([E.api()],exports.SnapshotQueryClient);const Z="~";function k({field:t,cursorId:e=Z,direction:r=f.DESC}){return r===f.ASC?q(t,e):j(t,e)}function m({field:t,direction:e=f.DESC}){return{field:t,direction:e}}function Zt(t){const e=t.query,r=F(k(t),e.condition),n=m(t);return{...e,condition:r,sort:[n]}}function d(t){let e=C.combineURLs(t.resourceAttribution??"",t.aggregateName??"");return t.contextAlias&&(e=C.combineURLs(t.contextAlias,e)),{...t,basePath:e}}class kt{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){const r=d({...this.defaultOptions,...e});return new exports.SnapshotQueryClient(r)}createEventStreamQueryClient(e){const r=d({...this.defaultOptions,...e});return new exports.EventStreamQueryClient(r)}}var tt=(t=>(t.NONE="",t.TENANT="/tenant/{tenantId}",t.OWNER="/owner/{ownerId}",t.TENANT_OWNER="/tenant/{tenantId}/owner/{ownerId}",t))(tt||{}),et=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(et||{});const u=class u{static isSucceeded(e){return e===u.SUCCEEDED}static isError(e){return!u.isSucceeded(e)}};u.SUCCEEDED="Ok",u.SUCCEEDED_MESSAGE="",u.NOT_FOUND="NotFound",u.NOT_FOUND_MESSAGE="Not found resource!",u.BAD_REQUEST="BadRequest",u.ILLEGAL_ARGUMENT="IllegalArgument",u.ILLEGAL_STATE="IllegalState",u.REQUEST_TIMEOUT="RequestTimeout",u.TOO_MANY_REQUESTS="TooManyRequests",u.DUPLICATE_REQUEST_ID="DuplicateRequestId",u.COMMAND_VALIDATION="CommandValidation",u.REWRITE_NO_COMMAND="RewriteNoCommand",u.EVENT_VERSION_CONFLICT="EventVersionConflict",u.DUPLICATE_AGGREGATE_ID="DuplicateAggregateId",u.COMMAND_EXPECT_VERSION_CONFLICT="CommandExpectVersionConflict",u.SOURCING_VERSION_CONFLICT="SourcingVersionConflict",u.ILLEGAL_ACCESS_DELETED_AGGREGATE="IllegalAccessDeletedAggregate",u.ILLEGAL_ACCESS_OWNER_AGGREGATE="IllegalAccessOwnerAggregate",u.INTERNAL_SERVER_ERROR="InternalServerError";let Q=u;var rt=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(rt||{});const mt="";var Et=(t=>(t.MAP="MAP",t.STRING="STRING",t))(Et||{});exports.CURSOR_ID_START=Z;exports.CommandHeaders=W;exports.CommandStage=Y;exports.ConditionOptionKey=U;exports.DEFAULT_OWNER_ID=mt;exports.DEFAULT_PAGINATION=L;exports.DEFAULT_PROJECTION=J;exports.DeletionState=H;exports.DomainEventStreamMetadataFields=w;exports.EMPTY_PAGED_LIST=z;exports.ErrorCodes=Q;exports.EventStreamQueryEndpointPaths=h;exports.FunctionKind=rt;exports.MessageHeaderSqlType=Et;exports.Operator=s;exports.QueryClientFactory=kt;exports.RecoverableType=et;exports.ResourceAttributionPathSpec=tt;exports.SnapshotMetadataFields=X;exports.SnapshotQueryEndpointPaths=N;exports.SortDirection=f;exports.active=It;exports.aggregateId=b;exports.aggregateIds=v;exports.all=O;exports.allIn=ht;exports.and=F;exports.asc=xt;exports.beforeToday=Wt;exports.between=_t;exports.contains=Dt;exports.createQueryApiMetadata=d;exports.cursorCondition=k;exports.cursorQuery=Zt;exports.cursorSort=m;exports.dateOptions=D;exports.defaultProjection=K;exports.deleted=x;exports.desc=qt;exports.earlierDays=dt;exports.elemMatch=pt;exports.endsWith=Ct;exports.eq=at;exports.exists=Mt;exports.gt=q;exports.gte=Rt;exports.id=Tt;exports.ids=ut;exports.ignoreCaseOptions=P;exports.isFalse=gt;exports.isIn=lt;exports.isNull=ft;exports.isTrue=Gt;exports.isValidateCondition=g;exports.lastMonth=wt;exports.lastWeek=Vt;exports.listQuery=$;exports.lt=j;exports.lte=St;exports.ne=Nt;exports.nextWeek=vt;exports.nor=ot;exports.notIn=Ot;exports.notNull=yt;exports.or=st;exports.ownerId=At;exports.pagedList=Ft;exports.pagedQuery=Ht;exports.pagination=Bt;exports.projection=Yt;exports.raw=Qt;exports.recentDays=Xt;exports.singleQuery=V;exports.startsWith=Lt;exports.tenantId=ct;exports.thisMonth=$t;exports.thisWeek=bt;exports.today=Pt;exports.tomorrow=Ut;
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;
2
2
  //# sourceMappingURL=index.cjs.js.map