@ahoo-wang/fetcher-wow 1.9.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/command/commandClient.d.ts +8 -26
- package/dist/command/commandClient.d.ts.map +1 -1
- package/dist/command/{commandHttpHeaders.d.ts → commandHeaders.d.ts} +2 -2
- package/dist/command/commandHeaders.d.ts.map +1 -0
- package/dist/command/commandRequest.d.ts +6 -5
- package/dist/command/commandRequest.d.ts.map +1 -1
- package/dist/command/index.d.ts +1 -1
- package/dist/command/index.d.ts.map +1 -1
- package/dist/index.es.js +405 -724
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/query/event/eventStreamQueryClient.d.ts +4 -5
- package/dist/query/event/eventStreamQueryClient.d.ts.map +1 -1
- package/dist/query/queryApi.d.ts +0 -35
- package/dist/query/queryApi.d.ts.map +1 -1
- package/dist/query/snapshot/snapshotQueryClient.d.ts +4 -5
- package/dist/query/snapshot/snapshotQueryClient.d.ts.map +1 -1
- package/dist/types/endpoints.d.ts +1 -1
- package/dist/types/endpoints.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/command/commandHttpHeaders.d.ts.map +0 -1
- package/dist/types/client.d.ts +0 -15
- package/dist/types/client.d.ts.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@ahoo-wang/fetcher"),require("@ahoo-wang/fetcher-eventstream")):typeof define=="function"&&define.amd?define(["exports","@ahoo-wang/fetcher","@ahoo-wang/fetcher-eventstream"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.FetcherWow={},i.Fetcher,i.FetcherEventStream))})(this,(function(i,e,L){"use strict";var T=(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))(T||{});function f(t){return!!t}const a=class a{};a.IGNORE_CASE_OPTION_KEY="ignoreCase",a.ZONE_ID_OPTION_KEY="zoneId",a.DATE_PATTERN_OPTION_KEY="datePattern";let G=a;function C(t){if(!(typeof t>"u"))return{ignoreCase:t}}function r(t,E){if(typeof t>"u"&&typeof E>"u")return;const n={};return typeof t<"u"&&(n.datePattern=t),typeof E<"u"&&(n.zoneId=E),n}var y=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(y||{});function X(...t){if(t.length===0)return D();if(t.length===1)return f(t[0])?t[0]:D();const E=[];return t.forEach(n=>{n?.operator===T.ALL||!f(n)||(n.operator===T.AND&&n.children?E.push(...n.children):E.push(n))}),{operator:T.AND,children:E}}function H(...t){const E=t?.filter(n=>f(n));return E.length===0?D():{operator:T.OR,children:E}}function z(...t){return t.length===0?D():{operator:T.NOR,children:t}}function Z(t){return{operator:T.ID,value:t}}function d(t){return{operator:T.IDS,value:t}}function m(t){return{operator:T.AGGREGATE_ID,value:t}}function x(...t){return{operator:T.AGGREGATE_IDS,value:t}}function p(t){return{operator:T.TENANT_ID,value:t}}function tt(t){return{operator:T.OWNER_ID,value:t}}function $(t){return{operator:T.DELETED,value:t}}function Et(){return $("ACTIVE")}function D(){return{operator:T.ALL}}function it(t,E){return{field:t,operator:T.EQ,value:E}}function nt(t,E){return{field:t,operator:T.NE,value:E}}function Y(t,E){return{field:t,operator:T.GT,value:E}}function q(t,E){return{field:t,operator:T.LT,value:E}}function Tt(t,E){return{field:t,operator:T.GTE,value:E}}function At(t,E){return{field:t,operator:T.LTE,value:E}}function st(t,E,n){const s=C(n);return{field:t,operator:T.CONTAINS,value:E,options:s}}function ut(t,...E){return{field:t,operator:T.IN,value:E}}function ct(t,...E){return{field:t,operator:T.NOT_IN,value:E}}function et(t,E,n){return{field:t,operator:T.BETWEEN,value:[E,n]}}function It(t,...E){return{field:t,operator:T.ALL_IN,value:E}}function Nt(t,E,n){const s=C(n);return{field:t,operator:T.STARTS_WITH,value:E,options:s}}function Rt(t,E,n){const s=C(n);return{field:t,operator:T.ENDS_WITH,value:E,options:s}}function rt(t,E){return{field:t,operator:T.ELEM_MATCH,children:[E]}}function St(t){return{field:t,operator:T.NULL}}function Ot(t){return{field:t,operator:T.NOT_NULL}}function Dt(t){return{field:t,operator:T.TRUE}}function ot(t){return{field:t,operator:T.FALSE}}function _t(t,E=!0){return{field:t,operator:T.EXISTS,value:E}}function Lt(t,E,n){const s=r(E,n);return{field:t,operator:T.TODAY,options:s}}function ht(t,E,n,s){const O=r(n,s);return{field:t,operator:T.BEFORE_TODAY,value:E,options:O}}function lt(t,E,n){const s=r(E,n);return{field:t,operator:T.TOMORROW,options:s}}function at(t,E,n){const s=r(E,n);return{field:t,operator:T.THIS_WEEK,options:s}}function ft(t,E,n){const s=r(E,n);return{field:t,operator:T.NEXT_WEEK,options:s}}function Ct(t,E,n){const s=r(E,n);return{field:t,operator:T.LAST_WEEK,options:s}}function Gt(t,E,n){const s=r(E,n);return{field:t,operator:T.THIS_MONTH,options:s}}function gt(t,E,n){const s=r(E,n);return{field:t,operator:T.LAST_MONTH,options:s}}function Mt(t,E,n,s){const O=r(n,s);return{field:t,operator:T.RECENT_DAYS,value:E,options:O}}function Pt(t,E,n,s){const O=r(n,s);return{field:t,operator:T.EARLIER_DAYS,value:E,options:O}}function Wt(t){return{operator:T.RAW,value:t}}const _={index:1,size:10};function Ut({index:t=_.index,size:E=_.size}=_){return{index:t,size:E}}const F={};function B(){return F}function Vt({include:t,exclude:E}=B()){return{include:t,exclude:E}}function yt({condition:t=D(),projection:E,sort:n}={}){return{condition:t,projection:E,sort:n}}function Xt({condition:t=D(),projection:E,sort:n,limit:s=_.size}={}){return{condition:t,projection:E,sort:n,limit:s}}function $t({condition:t=D(),projection:E,sort:n,pagination:s=_}={}){return{condition:t,projection:E,sort:n,pagination:s}}const w={total:0,list:[]};function Yt({total:t,list:E=[]}=w){return t===void 0&&(t=E.length),{total:t,list:E}}const g={resultExtractor:e.ResultExtractors.Json},h={resultExtractor:L.JsonEventStreamResultExtractor};class M{constructor(E){this.options=E}async query(E,n,s,O=e.ContentTypeValues.APPLICATION_JSON){const bt={url:e.combineURLs(this.options.basePath,E),method:e.HttpMethod.POST,headers:{Accept:O},body:n};return await this.options.fetcher.request(bt,e.mergeRequestOptions(g,s))}}var l=(t=>(t.ASC="ASC",t.DESC="DESC",t))(l||{});function qt(t){return{field:t,direction:"ASC"}}function Ft(t){return{field:t,direction:"DESC"}}const u=class u{};u.HEADER="header",u.COMMAND_OPERATOR=`${u.HEADER}.command_operator`,u.AGGREGATE_ID="aggregateId",u.TENANT_ID="tenantId",u.OWNER_ID="ownerId",u.COMMAND_ID="commandId",u.REQUEST_ID="requestId",u.VERSION="version",u.BODY="body",u.BODY_ID=`${u.BODY}.id`,u.BODY_NAME=`${u.BODY}.name`,u.BODY_TYPE=`${u.BODY}.bodyType`,u.BODY_REVISION=`${u.BODY}.revision`,u.BODY_BODY=`${u.BODY}.body`,u.CREATE_TIME="createTime";let P=u;const S=class S{};S.EVENT_STREAM_RESOURCE_NAME="event",S.COUNT=`${S.EVENT_STREAM_RESOURCE_NAME}/count`,S.LIST=`${S.EVENT_STREAM_RESOURCE_NAME}/list`,S.PAGED=`${S.EVENT_STREAM_RESOURCE_NAME}/paged`;let o=S;class Bt extends M{constructor(E){super(E)}count(E,n){return this.query(o.COUNT,E,{attributes:n})}list(E,n){return this.query(o.LIST,E,{attributes:n})}listStream(E,n){return this.query(o.LIST,E,e.mergeRequestOptions(h,{resultExtractor:L.JsonEventStreamResultExtractor,attributes:n}),e.ContentTypeValues.TEXT_EVENT_STREAM)}paged(E,n){return this.query(o.PAGED,E,{attributes:n})}}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 W=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;class wt extends M{constructor(E){super(E)}async count(E,n){return this.query(R.COUNT,E,{attributes:n})}list(E,n){return this.query(R.LIST,E,{attributes:n})}listStream(E,n){return this.query(R.LIST,E,e.mergeRequestOptions(h,{resultExtractor:L.JsonEventStreamResultExtractor,attributes:n}),e.ContentTypeValues.TEXT_EVENT_STREAM)}listState(E,n){return this.query(R.LIST_STATE,E,{attributes:n})}listStateStream(E,n){return this.query(R.LIST_STATE,E,e.mergeRequestOptions(h,{resultExtractor:L.JsonEventStreamResultExtractor,attributes:n}),e.ContentTypeValues.TEXT_EVENT_STREAM)}paged(E,n){return this.query(R.PAGED,E,{attributes:n})}pagedState(E,n){return this.query(R.PAGED_STATE,E,{attributes:n})}single(E,n){return this.query(R.SINGLE,E,{attributes:n})}singleState(E,n){return this.query(R.SINGLE_STATE,E,{attributes:n})}}const Q="~";function v({field:t,cursorId:E=Q,direction:n=l.DESC}){return n===l.ASC?Y(t,E):q(t,E)}function J({field:t,direction:E=l.DESC}){return{field:t,direction:E}}function Qt(t){const E=t.query,n=X(v(t),E.condition),s=J(t);return{...E,condition:n,sort:[s]}}class vt{constructor(E){this.options=E}async sendCommand(E,n,s){const O=e.combineURLs(this.options.basePath,E);return await this.options.fetcher.fetch(O,n,e.mergeRequestOptions(g,s))}send(E,n,s){return this.sendCommand(E,n,{attributes:s})}async sendAndWaitStream(E,n,s){return n.headers={...n.headers,Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},this.sendCommand(E,n,e.mergeRequestOptions(h,{resultExtractor:L.JsonEventStreamResultExtractor,attributes:s}))}}const A=class A{};A.COMMAND_HEADERS_PREFIX="Command-",A.TENANT_ID=`${A.COMMAND_HEADERS_PREFIX}Tenant-Id`,A.OWNER_ID=`${A.COMMAND_HEADERS_PREFIX}Owner-Id`,A.AGGREGATE_ID=`${A.COMMAND_HEADERS_PREFIX}Aggregate-Id`,A.AGGREGATE_VERSION=`${A.COMMAND_HEADERS_PREFIX}Aggregate-Version`,A.WAIT_PREFIX=`${A.COMMAND_HEADERS_PREFIX}Wait-`,A.WAIT_TIME_OUT=`${A.WAIT_PREFIX}Timeout`,A.WAIT_STAGE=`${A.WAIT_PREFIX}Stage`,A.WAIT_CONTEXT=`${A.WAIT_PREFIX}Context`,A.WAIT_PROCESSOR=`${A.WAIT_PREFIX}Processor`,A.WAIT_FUNCTION=`${A.WAIT_PREFIX}Function`,A.WAIT_TAIL_PREFIX=`${A.WAIT_PREFIX}Tail-`,A.WAIT_TAIL_STAGE=`${A.WAIT_TAIL_PREFIX}Stage`,A.WAIT_TAIL_CONTEXT=`${A.WAIT_TAIL_PREFIX}Context`,A.WAIT_TAIL_PROCESSOR=`${A.WAIT_TAIL_PREFIX}Processor`,A.WAIT_TAIL_FUNCTION=`${A.WAIT_TAIL_PREFIX}Function`,A.REQUEST_ID=`${A.COMMAND_HEADERS_PREFIX}Request-Id`,A.LOCAL_FIRST=`${A.COMMAND_HEADERS_PREFIX}Local-First`,A.COMMAND_AGGREGATE_CONTEXT=`${A.COMMAND_HEADERS_PREFIX}Aggregate-Context`,A.COMMAND_AGGREGATE_NAME=`${A.COMMAND_HEADERS_PREFIX}Aggregate-Name`,A.COMMAND_TYPE=`${A.COMMAND_HEADERS_PREFIX}Type`,A.COMMAND_HEADER_X_PREFIX=`${A.COMMAND_HEADERS_PREFIX}Header-`;let U=A;var b=(t=>(t.SENT="SENT",t.PROCESSED="PROCESSED",t.SNAPSHOT="SNAPSHOT",t.PROJECTED="PROJECTED",t.EVENT_HANDLED="EVENT_HANDLED",t.SAGA_HANDLED="SAGA_HANDLED",t))(b||{}),K=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(K||{});const c=class c{static isSucceeded(E){return E===c.SUCCEEDED}static isError(E){return!c.isSucceeded(E)}};c.SUCCEEDED="Ok",c.SUCCEEDED_MESSAGE="",c.NOT_FOUND="NotFound",c.NOT_FOUND_MESSAGE="Not found resource!",c.BAD_REQUEST="BadRequest",c.ILLEGAL_ARGUMENT="IllegalArgument",c.ILLEGAL_STATE="IllegalState",c.REQUEST_TIMEOUT="RequestTimeout",c.TOO_MANY_REQUESTS="TooManyRequests",c.DUPLICATE_REQUEST_ID="DuplicateRequestId",c.COMMAND_VALIDATION="CommandValidation",c.REWRITE_NO_COMMAND="RewriteNoCommand",c.EVENT_VERSION_CONFLICT="EventVersionConflict",c.DUPLICATE_AGGREGATE_ID="DuplicateAggregateId",c.COMMAND_EXPECT_VERSION_CONFLICT="CommandExpectVersionConflict",c.SOURCING_VERSION_CONFLICT="SourcingVersionConflict",c.ILLEGAL_ACCESS_DELETED_AGGREGATE="IllegalAccessDeletedAggregate",c.ILLEGAL_ACCESS_OWNER_AGGREGATE="IllegalAccessOwnerAggregate",c.INTERNAL_SERVER_ERROR="InternalServerError";let V=c;var k=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(k||{});const Jt="";var j=(t=>(t.MAP="MAP",t.STRING="STRING",t))(j||{});i.CURSOR_ID_START=Q,i.CommandClient=vt,i.CommandHttpHeaders=U,i.CommandStage=b,i.ConditionOptionKey=G,i.DEFAULT_OWNER_ID=Jt,i.DEFAULT_PAGINATION=_,i.DEFAULT_PROJECTION=F,i.DeletionState=y,i.DomainEventStreamMetadataFields=P,i.EMPTY_PAGED_LIST=w,i.ErrorCodes=V,i.EventStreamQueryClient=Bt,i.EventStreamQueryEndpointPaths=o,i.FunctionKind=k,i.JSON_EVENT_STREAM_QUERY_REQUEST_OPTIONS=h,i.JSON_QUERY_REQUEST_OPTIONS=g,i.MessageHeaderSqlType=j,i.Operator=T,i.QueryClient=M,i.RecoverableType=K,i.SnapshotMetadataFields=W,i.SnapshotQueryClient=wt,i.SnapshotQueryEndpointPaths=R,i.SortDirection=l,i.active=Et,i.aggregateId=m,i.aggregateIds=x,i.all=D,i.allIn=It,i.and=X,i.asc=qt,i.beforeToday=ht,i.between=et,i.contains=st,i.cursorCondition=v,i.cursorQuery=Qt,i.cursorSort=J,i.dateOptions=r,i.defaultProjection=B,i.deleted=$,i.desc=Ft,i.earlierDays=Pt,i.elemMatch=rt,i.endsWith=Rt,i.eq=it,i.exists=_t,i.gt=Y,i.gte=Tt,i.id=Z,i.ids=d,i.ignoreCaseOptions=C,i.isFalse=ot,i.isIn=ut,i.isNull=St,i.isTrue=Dt,i.isValidateCondition=f,i.lastMonth=gt,i.lastWeek=Ct,i.listQuery=Xt,i.lt=q,i.lte=At,i.ne=nt,i.nextWeek=ft,i.nor=z,i.notIn=ct,i.notNull=Ot,i.or=H,i.ownerId=tt,i.pagedList=Yt,i.pagedQuery=$t,i.pagination=Ut,i.projection=Vt,i.raw=Wt,i.recentDays=Mt,i.singleQuery=yt,i.startsWith=Nt,i.tenantId=p,i.thisMonth=Gt,i.thisWeek=at,i.today=Lt,i.tomorrow=lt,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(i,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("@ahoo-wang/fetcher"),require("@ahoo-wang/fetcher-eventstream"),require("@ahoo-wang/fetcher-decorator")):typeof define=="function"&&define.amd?define(["exports","@ahoo-wang/fetcher","@ahoo-wang/fetcher-eventstream","@ahoo-wang/fetcher-decorator"],C):(i=typeof globalThis<"u"?globalThis:i||self,C(i.FetcherWow={},i.Fetcher,i.FetcherEventStream,i.FetcherDecorator))})(this,(function(i,C,W,T){"use strict";var x=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,V=(t,E,n,A)=>{for(var I=A>1?void 0:A?tt(E,n):E,l=t.length-1,a;l>=0;l--)(a=t[l])&&(I=(A?a(E,n,I):a(I))||I);return A&&I&&x(E,n,I),I},y=(t,E)=>(n,A)=>E(n,A,t);i.CommandClient=class{constructor(E){this.apiMetadata=E}send(E,n){throw T.autoGeneratedError(E,n)}sendAndWaitStream(E,n){throw T.autoGeneratedError(E,n)}},V([T.endpoint(),y(0,T.request()),y(1,T.attribute())],i.CommandClient.prototype,"send",1),V([T.endpoint(void 0,void 0,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:W.JsonEventStreamResultExtractor}),y(0,T.request()),y(1,T.attribute())],i.CommandClient.prototype,"sendAndWaitStream",1),i.CommandClient=V([T.api()],i.CommandClient);const s=class s{};s.COMMAND_HEADERS_PREFIX="Command-",s.TENANT_ID=`${s.COMMAND_HEADERS_PREFIX}Tenant-Id`,s.OWNER_ID=`${s.COMMAND_HEADERS_PREFIX}Owner-Id`,s.AGGREGATE_ID=`${s.COMMAND_HEADERS_PREFIX}Aggregate-Id`,s.AGGREGATE_VERSION=`${s.COMMAND_HEADERS_PREFIX}Aggregate-Version`,s.WAIT_PREFIX=`${s.COMMAND_HEADERS_PREFIX}Wait-`,s.WAIT_TIME_OUT=`${s.WAIT_PREFIX}Timeout`,s.WAIT_STAGE=`${s.WAIT_PREFIX}Stage`,s.WAIT_CONTEXT=`${s.WAIT_PREFIX}Context`,s.WAIT_PROCESSOR=`${s.WAIT_PREFIX}Processor`,s.WAIT_FUNCTION=`${s.WAIT_PREFIX}Function`,s.WAIT_TAIL_PREFIX=`${s.WAIT_PREFIX}Tail-`,s.WAIT_TAIL_STAGE=`${s.WAIT_TAIL_PREFIX}Stage`,s.WAIT_TAIL_CONTEXT=`${s.WAIT_TAIL_PREFIX}Context`,s.WAIT_TAIL_PROCESSOR=`${s.WAIT_TAIL_PREFIX}Processor`,s.WAIT_TAIL_FUNCTION=`${s.WAIT_TAIL_PREFIX}Function`,s.REQUEST_ID=`${s.COMMAND_HEADERS_PREFIX}Request-Id`,s.LOCAL_FIRST=`${s.COMMAND_HEADERS_PREFIX}Local-First`,s.COMMAND_AGGREGATE_CONTEXT=`${s.COMMAND_HEADERS_PREFIX}Aggregate-Context`,s.COMMAND_AGGREGATE_NAME=`${s.COMMAND_HEADERS_PREFIX}Aggregate-Name`,s.COMMAND_TYPE=`${s.COMMAND_HEADERS_PREFIX}Type`,s.COMMAND_HEADER_X_PREFIX=`${s.COMMAND_HEADERS_PREFIX}Header-`;let $=s;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||{}),u=(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))(u||{});function f(t){return!!t}const h=class h{};h.IGNORE_CASE_OPTION_KEY="ignoreCase",h.ZONE_ID_OPTION_KEY="zoneId",h.DATE_PATTERN_OPTION_KEY="datePattern";let v=h;function U(t){if(!(typeof t>"u"))return{ignoreCase:t}}function c(t,E){if(typeof t>"u"&&typeof E>"u")return;const n={};return typeof t<"u"&&(n.datePattern=t),typeof E<"u"&&(n.zoneId=E),n}var d=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(d||{});function F(...t){if(t.length===0)return o();if(t.length===1)return f(t[0])?t[0]:o();const E=[];return t.forEach(n=>{n?.operator===u.ALL||!f(n)||(n.operator===u.AND&&n.children?E.push(...n.children):E.push(n))}),{operator:u.AND,children:E}}function Et(...t){const E=t?.filter(n=>f(n));return E.length===0?o():{operator:u.OR,children:E}}function it(...t){return t.length===0?o():{operator:u.NOR,children:t}}function nt(t){return{operator:u.ID,value:t}}function Tt(t){return{operator:u.IDS,value:t}}function At(t){return{operator:u.AGGREGATE_ID,value:t}}function ut(...t){return{operator:u.AGGREGATE_IDS,value:t}}function st(t){return{operator:u.TENANT_ID,value:t}}function It(t){return{operator:u.OWNER_ID,value:t}}function H(t){return{operator:u.DELETED,value:t}}function Nt(){return H("ACTIVE")}function o(){return{operator:u.ALL}}function Rt(t,E){return{field:t,operator:u.EQ,value:E}}function St(t,E){return{field:t,operator:u.NE,value:E}}function Q(t,E){return{field:t,operator:u.GT,value:E}}function B(t,E){return{field:t,operator:u.LT,value:E}}function et(t,E){return{field:t,operator:u.GTE,value:E}}function Ot(t,E){return{field:t,operator:u.LTE,value:E}}function _t(t,E,n){const A=U(n);return{field:t,operator:u.CONTAINS,value:E,options:A}}function ct(t,...E){return{field:t,operator:u.IN,value:E}}function lt(t,...E){return{field:t,operator:u.NOT_IN,value:E}}function at(t,E,n){return{field:t,operator:u.BETWEEN,value:[E,n]}}function rt(t,...E){return{field:t,operator:u.ALL_IN,value:E}}function Lt(t,E,n){const A=U(n);return{field:t,operator:u.STARTS_WITH,value:E,options:A}}function Ct(t,E,n){const A=U(n);return{field:t,operator:u.ENDS_WITH,value:E,options:A}}function ot(t,E){return{field:t,operator:u.ELEM_MATCH,children:[E]}}function Dt(t){return{field:t,operator:u.NULL}}function Gt(t){return{field:t,operator:u.NOT_NULL}}function gt(t){return{field:t,operator:u.TRUE}}function Mt(t){return{field:t,operator:u.FALSE}}function Pt(t,E=!0){return{field:t,operator:u.EXISTS,value:E}}function ht(t,E,n){const A=c(E,n);return{field:t,operator:u.TODAY,options:A}}function Wt(t,E,n,A){const I=c(n,A);return{field:t,operator:u.BEFORE_TODAY,value:E,options:I}}function yt(t,E,n){const A=c(E,n);return{field:t,operator:u.TOMORROW,options:A}}function ft(t,E,n){const A=c(E,n);return{field:t,operator:u.THIS_WEEK,options:A}}function Ut(t,E,n){const A=c(E,n);return{field:t,operator:u.NEXT_WEEK,options:A}}function Vt(t,E,n){const A=c(E,n);return{field:t,operator:u.LAST_WEEK,options:A}}function $t(t,E,n){const A=c(E,n);return{field:t,operator:u.THIS_MONTH,options:A}}function vt(t,E,n){const A=c(E,n);return{field:t,operator:u.LAST_MONTH,options:A}}function wt(t,E,n,A){const I=c(n,A);return{field:t,operator:u.RECENT_DAYS,value:E,options:I}}function bt(t,E,n,A){const I=c(n,A);return{field:t,operator:u.EARLIER_DAYS,value:E,options:I}}function Xt(t){return{operator:u.RAW,value:t}}const g={index:1,size:10};function Yt({index:t=g.index,size:E=g.size}=g){return{index:t,size:E}}const q={};function p(){return q}function dt({include:t,exclude:E}=p()){return{include:t,exclude:E}}function Ft({condition:t=o(),projection:E,sort:n}={}){return{condition:t,projection:E,sort:n}}function Ht({condition:t=o(),projection:E,sort:n,limit:A=g.size}={}){return{condition:t,projection:E,sort:n,limit:A}}function Qt({condition:t=o(),projection:E,sort:n,pagination:A=g}={}){return{condition:t,projection:E,sort:n,pagination:A}}const j={total:0,list:[]};function Bt({total:t,list:E=[]}=j){return t===void 0&&(t=E.length),{total:t,list:E}}var M=(t=>(t.ASC="ASC",t.DESC="DESC",t))(M||{});function qt(t){return{field:t,direction:"ASC"}}function pt(t){return{field:t,direction:"DESC"}}const N=class N{};N.HEADER="header",N.COMMAND_OPERATOR=`${N.HEADER}.command_operator`,N.AGGREGATE_ID="aggregateId",N.TENANT_ID="tenantId",N.OWNER_ID="ownerId",N.COMMAND_ID="commandId",N.REQUEST_ID="requestId",N.VERSION="version",N.BODY="body",N.BODY_ID=`${N.BODY}.id`,N.BODY_NAME=`${N.BODY}.name`,N.BODY_TYPE=`${N.BODY}.bodyType`,N.BODY_REVISION=`${N.BODY}.revision`,N.BODY_BODY=`${N.BODY}.body`,N.CREATE_TIME="createTime";let w=N;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 G=L;var jt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,P=(t,E,n,A)=>{for(var I=A>1?void 0:A?Jt(E,n):E,l=t.length-1,a;l>=0;l--)(a=t[l])&&(I=(A?a(E,n,I):a(I))||I);return A&&I&&jt(E,n,I),I},D=(t,E)=>(n,A)=>E(n,A,t);i.EventStreamQueryClient=class{constructor(E){this.apiMetadata=E}count(E,n){throw T.autoGeneratedError(E,n)}list(E,n){throw T.autoGeneratedError(E,n)}listStream(E,n){throw T.autoGeneratedError(E,n)}paged(E,n){throw T.autoGeneratedError(E,n)}},P([T.post(G.COUNT),D(0,T.body()),D(1,T.attribute())],i.EventStreamQueryClient.prototype,"count",1),P([T.post(G.LIST),D(0,T.body()),D(1,T.attribute())],i.EventStreamQueryClient.prototype,"list",1),P([T.post(G.LIST,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:W.JsonEventStreamResultExtractor}),D(0,T.body()),D(1,T.attribute())],i.EventStreamQueryClient.prototype,"listStream",1),P([T.post(G.PAGED),D(0,T.body()),D(1,T.attribute())],i.EventStreamQueryClient.prototype,"paged",1),i.EventStreamQueryClient=P([T.api()],i.EventStreamQueryClient);const O=class O{};O.VERSION="version",O.TENANT_ID="tenantId",O.OWNER_ID="ownerId",O.EVENT_ID="eventId",O.FIRST_EVENT_TIME="firstEventTime",O.EVENT_TIME="eventTime",O.FIRST_OPERATOR="firstOperator",O.OPERATOR="operator",O.SNAPSHOT_TIME="snapshotTime",O.DELETED="deleted",O.STATE="state";let b=O;const e=class e{};e.SNAPSHOT_RESOURCE_NAME="snapshot",e.COUNT=`${e.SNAPSHOT_RESOURCE_NAME}/count`,e.LIST=`${e.SNAPSHOT_RESOURCE_NAME}/list`,e.LIST_STATE=`${e.LIST}/state`,e.PAGED=`${e.SNAPSHOT_RESOURCE_NAME}/paged`,e.PAGED_STATE=`${e.PAGED}/state`,e.SINGLE=`${e.SNAPSHOT_RESOURCE_NAME}/single`,e.SINGLE_STATE=`${e.SINGLE}/state`;let _=e;var Kt=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,r=(t,E,n,A)=>{for(var I=A>1?void 0:A?zt(E,n):E,l=t.length-1,a;l>=0;l--)(a=t[l])&&(I=(A?a(E,n,I):a(I))||I);return A&&I&&Kt(E,n,I),I},S=(t,E)=>(n,A)=>E(n,A,t);i.SnapshotQueryClient=class{constructor(E){this.apiMetadata=E}count(E,n){throw T.autoGeneratedError(E,n)}list(E,n){throw T.autoGeneratedError(E,n)}listStream(E,n){throw T.autoGeneratedError(E,n)}listState(E,n){throw T.autoGeneratedError(E,n)}listStateStream(E,n){throw T.autoGeneratedError(E,n)}paged(E,n){throw T.autoGeneratedError(E,n)}pagedState(E,n){throw T.autoGeneratedError(E,n)}single(E,n){throw T.autoGeneratedError(E,n)}singleState(E,n){throw T.autoGeneratedError(E,n)}},r([T.post(_.COUNT),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"count",1),r([T.post(_.LIST),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"list",1),r([T.post(_.LIST,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:W.JsonEventStreamResultExtractor}),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"listStream",1),r([T.post(_.LIST_STATE),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"listState",1),r([T.post(_.LIST_STATE,{headers:{Accept:C.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:W.JsonEventStreamResultExtractor}),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"listStateStream",1),r([T.post(_.PAGED),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"paged",1),r([T.post(_.PAGED_STATE),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"pagedState",1),r([T.post(_.SINGLE),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"single",1),r([T.post(_.SINGLE_STATE),S(0,T.body()),S(1,T.attribute())],i.SnapshotQueryClient.prototype,"singleState",1),i.SnapshotQueryClient=r([T.api()],i.SnapshotQueryClient);const J="~";function K({field:t,cursorId:E=J,direction:n=M.DESC}){return n===M.ASC?Q(t,E):B(t,E)}function z({field:t,direction:E=M.DESC}){return{field:t,direction:E}}function Zt(t){const E=t.query,n=F(K(t),E.condition),A=z(t);return{...E,condition:n,sort:[A]}}var Z=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(Z||{});const R=class R{static isSucceeded(E){return E===R.SUCCEEDED}static isError(E){return!R.isSucceeded(E)}};R.SUCCEEDED="Ok",R.SUCCEEDED_MESSAGE="",R.NOT_FOUND="NotFound",R.NOT_FOUND_MESSAGE="Not found resource!",R.BAD_REQUEST="BadRequest",R.ILLEGAL_ARGUMENT="IllegalArgument",R.ILLEGAL_STATE="IllegalState",R.REQUEST_TIMEOUT="RequestTimeout",R.TOO_MANY_REQUESTS="TooManyRequests",R.DUPLICATE_REQUEST_ID="DuplicateRequestId",R.COMMAND_VALIDATION="CommandValidation",R.REWRITE_NO_COMMAND="RewriteNoCommand",R.EVENT_VERSION_CONFLICT="EventVersionConflict",R.DUPLICATE_AGGREGATE_ID="DuplicateAggregateId",R.COMMAND_EXPECT_VERSION_CONFLICT="CommandExpectVersionConflict",R.SOURCING_VERSION_CONFLICT="SourcingVersionConflict",R.ILLEGAL_ACCESS_DELETED_AGGREGATE="IllegalAccessDeletedAggregate",R.ILLEGAL_ACCESS_OWNER_AGGREGATE="IllegalAccessOwnerAggregate",R.INTERNAL_SERVER_ERROR="InternalServerError";let X=R;var k=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(k||{});const kt="";var m=(t=>(t.MAP="MAP",t.STRING="STRING",t))(m||{});i.CURSOR_ID_START=J,i.CommandHeaders=$,i.CommandStage=Y,i.ConditionOptionKey=v,i.DEFAULT_OWNER_ID=kt,i.DEFAULT_PAGINATION=g,i.DEFAULT_PROJECTION=q,i.DeletionState=d,i.DomainEventStreamMetadataFields=w,i.EMPTY_PAGED_LIST=j,i.ErrorCodes=X,i.EventStreamQueryEndpointPaths=G,i.FunctionKind=k,i.MessageHeaderSqlType=m,i.Operator=u,i.RecoverableType=Z,i.SnapshotMetadataFields=b,i.SnapshotQueryEndpointPaths=_,i.SortDirection=M,i.active=Nt,i.aggregateId=At,i.aggregateIds=ut,i.all=o,i.allIn=rt,i.and=F,i.asc=qt,i.beforeToday=Wt,i.between=at,i.contains=_t,i.cursorCondition=K,i.cursorQuery=Zt,i.cursorSort=z,i.dateOptions=c,i.defaultProjection=p,i.deleted=H,i.desc=pt,i.earlierDays=bt,i.elemMatch=ot,i.endsWith=Ct,i.eq=Rt,i.exists=Pt,i.gt=Q,i.gte=et,i.id=nt,i.ids=Tt,i.ignoreCaseOptions=U,i.isFalse=Mt,i.isIn=ct,i.isNull=Dt,i.isTrue=gt,i.isValidateCondition=f,i.lastMonth=vt,i.lastWeek=Vt,i.listQuery=Ht,i.lt=B,i.lte=Ot,i.ne=St,i.nextWeek=Ut,i.nor=it,i.notIn=lt,i.notNull=Gt,i.or=Et,i.ownerId=It,i.pagedList=Bt,i.pagedQuery=Qt,i.pagination=Yt,i.projection=dt,i.raw=Xt,i.recentDays=wt,i.singleQuery=Ft,i.startsWith=Lt,i.tenantId=st,i.thisMonth=$t,i.thisWeek=ft,i.today=ht,i.tomorrow=yt,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|