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