@ahoo-wang/fetcher-wow 3.16.8 → 3.16.10
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 +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/query/condition.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@ahoo-wang/fetcher`),t=require(`@ahoo-wang/fetcher-eventstream`),n=require(`@ahoo-wang/fetcher-decorator`);function r(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function i(e,t){return function(n,r){t(n,r,e)}}function a(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var o,s,c,ee,l=class{constructor(e){this.apiMetadata=e}send(e,t){throw(0,n.autoGeneratedError)(e,t)}sendAndWaitStream(e,t){throw(0,n.autoGeneratedError)(e,t)}};a([(0,n.endpoint)(),i(0,(0,n.request)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(s=typeof Record<`u`&&Record)==`function`?s:Object]),r(`design:returntype`,typeof(o=typeof Promise<`u`&&Promise)==`function`?o:Object)],l.prototype,`send`,null),a([(0,n.endpoint)(void 0,void 0,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.request)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ee=typeof Record<`u`&&Record)==`function`?ee:Object]),r(`design:returntype`,typeof(c=typeof Promise<`u`&&Promise)==`function`?c:Object)],l.prototype,`sendAndWaitStream`,null),l=a([(0,n.api)(),r(`design:paramtypes`,[Object])],l);var te=class e{static{this.COMMAND_HEADERS_PREFIX=`Command-`}static{this.TENANT_ID=`${e.COMMAND_HEADERS_PREFIX}Tenant-Id`}static{this.OWNER_ID=`${e.COMMAND_HEADERS_PREFIX}Owner-Id`}static{this.SPACE_ID=`${e.COMMAND_HEADERS_PREFIX}Space-Id`}static{this.AGGREGATE_ID=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Id`}static{this.AGGREGATE_VERSION=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Version`}static{this.WAIT_PREFIX=`${e.COMMAND_HEADERS_PREFIX}Wait-`}static{this.WAIT_TIME_OUT=`${e.WAIT_PREFIX}Timeout`}static{this.WAIT_STAGE=`${e.WAIT_PREFIX}Stage`}static{this.WAIT_CONTEXT=`${e.WAIT_PREFIX}Context`}static{this.WAIT_PROCESSOR=`${e.WAIT_PREFIX}Processor`}static{this.WAIT_FUNCTION=`${e.WAIT_PREFIX}Function`}static{this.WAIT_TAIL_PREFIX=`${e.WAIT_PREFIX}Tail-`}static{this.WAIT_TAIL_STAGE=`${e.WAIT_TAIL_PREFIX}Stage`}static{this.WAIT_TAIL_CONTEXT=`${e.WAIT_TAIL_PREFIX}Context`}static{this.WAIT_TAIL_PROCESSOR=`${e.WAIT_TAIL_PREFIX}Processor`}static{this.WAIT_TAIL_FUNCTION=`${e.WAIT_TAIL_PREFIX}Function`}static{this.REQUEST_ID=`${e.COMMAND_HEADERS_PREFIX}Request-Id`}static{this.LOCAL_FIRST=`${e.COMMAND_HEADERS_PREFIX}Local-First`}static{this.COMMAND_AGGREGATE_CONTEXT=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Context`}static{this.COMMAND_AGGREGATE_NAME=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Name`}static{this.COMMAND_TYPE=`${e.COMMAND_HEADERS_PREFIX}Type`}static{this.COMMAND_HEADER_X_PREFIX=`${e.COMMAND_HEADERS_PREFIX}Header-`}},ne=function(e){return e.SENT=`SENT`,e.PROCESSED=`PROCESSED`,e.SNAPSHOT=`SNAPSHOT`,e.PROJECTED=`PROJECTED`,e.EVENT_HANDLED=`EVENT_HANDLED`,e.SAGA_HANDLED=`SAGA_HANDLED`,e}({}),u=function(e){return e.AND=`AND`,e.OR=`OR`,e.NOR=`NOR`,e.ID=`ID`,e.IDS=`IDS`,e.AGGREGATE_ID=`AGGREGATE_ID`,e.AGGREGATE_IDS=`AGGREGATE_IDS`,e.TENANT_ID=`TENANT_ID`,e.OWNER_ID=`OWNER_ID`,e.SPACE_ID=`SPACE_ID`,e.DELETED=`DELETED`,e.ALL=`ALL`,e.EQ=`EQ`,e.NE=`NE`,e.GT=`GT`,e.LT=`LT`,e.GTE=`GTE`,e.LTE=`LTE`,e.CONTAINS=`CONTAINS`,e.IN=`IN`,e.NOT_IN=`NOT_IN`,e.BETWEEN=`BETWEEN`,e.ALL_IN=`ALL_IN`,e.STARTS_WITH=`STARTS_WITH`,e.ENDS_WITH=`ENDS_WITH`,e.ELEM_MATCH=`ELEM_MATCH`,e.NULL=`NULL`,e.NOT_NULL=`NOT_NULL`,e.TRUE=`TRUE`,e.FALSE=`FALSE`,e.EXISTS=`EXISTS`,e.TODAY=`TODAY`,e.BEFORE_TODAY=`BEFORE_TODAY`,e.TOMORROW=`TOMORROW`,e.THIS_WEEK=`THIS_WEEK`,e.NEXT_WEEK=`NEXT_WEEK`,e.LAST_WEEK=`LAST_WEEK`,e.THIS_MONTH=`THIS_MONTH`,e.LAST_MONTH=`LAST_MONTH`,e.RECENT_DAYS=`RECENT_DAYS`,e.EARLIER_DAYS=`EARLIER_DAYS`,e.MATCH=`MATCH`,e.RAW=`RAW`,e}({}),re=new Set([u.AND,u.OR,u.NOR]),ie=new Set([u.NULL,u.NOT_NULL,u.TRUE,u.FALSE,u.EXISTS,u.TODAY,u.TOMORROW,u.THIS_WEEK,u.NEXT_WEEK,u.LAST_WEEK,u.THIS_MONTH,u.LAST_MONTH]);function d(e){return!!e}var ae=class{static{this.IGNORE_CASE_OPTION_KEY=`ignoreCase`}static{this.ZONE_ID_OPTION_KEY=`zoneId`}static{this.DATE_PATTERN_OPTION_KEY=`datePattern`}};function f(e){if(e!==void 0)return{ignoreCase:e}}function p(e,t){if(e===void 0&&t===void 0)return;let n={};return e!==void 0&&(n.datePattern=e),t!==void 0&&(n.zoneId=t),n}var m=function(e){return e.ACTIVE=`ACTIVE`,e.DELETED=`DELETED`,e.ALL=`ALL`,e}({});function h(...e){if(e.length===0)return v();if(e.length===1)return d(e[0])?e[0]:v();let t=[];return e.forEach(e=>{e?.operator===u.ALL||!d(e)||(e.operator===u.AND&&e.children?t.push(...e.children):t.push(e))}),{operator:u.AND,children:t}}function oe(...e){let t=e?.filter(e=>d(e));return t.length===0?v():{operator:u.OR,children:t}}function se(...e){return e.length===0?v():{operator:u.NOR,children:e}}function ce(e){return{operator:u.ID,value:e}}function le(e){return{operator:u.IDS,value:e}}function g(e){return{operator:u.AGGREGATE_ID,value:e}}function _(e){return{operator:u.AGGREGATE_IDS,value:e}}function ue(e){return{operator:u.TENANT_ID,value:e}}function de(e){return{operator:u.OWNER_ID,value:e}}function fe(e){return{operator:u.SPACE_ID,value:e}}function pe(e){return{operator:u.DELETED,value:e}}function me(){return pe(m.ACTIVE)}function v(){return{operator:u.ALL}}function he(e,t){return{field:e,operator:u.EQ,value:t}}function ge(e,t){return{field:e,operator:u.NE,value:t}}function y(e,t){return{field:e,operator:u.GT,value:t}}function b(e,t){return{field:e,operator:u.LT,value:t}}function _e(e,t){return{field:e,operator:u.GTE,value:t}}function ve(e,t){return{field:e,operator:u.LTE,value:t}}function ye(e,t,n){let r=f(n);return{field:e,operator:u.CONTAINS,value:t,options:r}}function be(e,...t){return{field:e,operator:u.IN,value:t}}function xe(e,...t){return{field:e,operator:u.NOT_IN,value:t}}function Se(e,t,n){return{field:e,operator:u.BETWEEN,value:[t,n]}}function Ce(e,...t){return{field:e,operator:u.ALL_IN,value:t}}function we(e,t,n){let r=f(n);return{field:e,operator:u.STARTS_WITH,value:t,options:r}}function Te(e,t){return{field:e,operator:u.MATCH,value:t}}function Ee(e,t,n){let r=f(n);return{field:e,operator:u.ENDS_WITH,value:t,options:r}}function De(e,t){return{field:e,operator:u.ELEM_MATCH,children:[t]}}function Oe(e){return{field:e,operator:u.NULL}}function ke(e){return{field:e,operator:u.NOT_NULL}}function Ae(e){return{field:e,operator:u.TRUE}}function je(e){return{field:e,operator:u.FALSE}}function Me(e,t=!0){return{field:e,operator:u.EXISTS,value:t}}function Ne(e,t,n){let r=p(t,n);return{field:e,operator:u.TODAY,options:r}}function Pe(e,t,n,r){let i=p(n,r);return{field:e,operator:u.BEFORE_TODAY,value:t,options:i}}function Fe(e,t,n){let r=p(t,n);return{field:e,operator:u.TOMORROW,options:r}}function Ie(e,t,n){let r=p(t,n);return{field:e,operator:u.THIS_WEEK,options:r}}function Le(e,t,n){let r=p(t,n);return{field:e,operator:u.NEXT_WEEK,options:r}}function Re(e,t,n){let r=p(t,n);return{field:e,operator:u.LAST_WEEK,options:r}}function ze(e,t,n){let r=p(t,n);return{field:e,operator:u.THIS_MONTH,options:r}}function Be(e,t,n){let r=p(t,n);return{field:e,operator:u.LAST_MONTH,options:r}}function Ve(e,t,n,r){let i=p(n,r);return{field:e,operator:u.RECENT_DAYS,value:t,options:i}}function He(e,t,n,r){let i=p(n,r);return{field:e,operator:u.EARLIER_DAYS,value:t,options:i}}function Ue(e){return{operator:u.RAW,value:e}}var x={index:1,size:10};function We({index:e=x.index,size:t=x.size}=x){return{index:e,size:t}}var S={};function C(){return S}function Ge({include:e,exclude:t}=C()){return{include:e,exclude:t}}function w({condition:e=v(),projection:t,sort:n}={}){return{condition:e,projection:t,sort:n}}function T({condition:e=v(),projection:t,sort:n,limit:r=x.size}={}){return{condition:e,projection:t,sort:n,limit:r}}function Ke({condition:e=v(),projection:t,sort:n,pagination:r=x}={}){return{condition:e,projection:t,sort:n,pagination:r}}var E={total:0,list:[]};function qe({total:e,list:t=[]}=E){return e===void 0&&(e=t.length),{total:e,list:t}}var D=function(e){return e.ASC=`ASC`,e.DESC=`DESC`,e}({});function Je(e){return{field:e,direction:D.ASC}}function Ye(e){return{field:e,direction:D.DESC}}var Xe=class e{static{this.HEADER=`header`}static{this.COMMAND_OPERATOR=`${e.HEADER}.command_operator`}static{this.AGGREGATE_ID=`aggregateId`}static{this.TENANT_ID=`tenantId`}static{this.OWNER_ID=`ownerId`}static{this.SPACE_ID=`spaceId`}static{this.COMMAND_ID=`commandId`}static{this.REQUEST_ID=`requestId`}static{this.VERSION=`version`}static{this.BODY=`body`}static{this.BODY_ID=`${e.BODY}.id`}static{this.BODY_NAME=`${e.BODY}.name`}static{this.BODY_TYPE=`${e.BODY}.bodyType`}static{this.BODY_REVISION=`${e.BODY}.revision`}static{this.BODY_BODY=`${e.BODY}.body`}static{this.CREATE_TIME=`createTime`}},O=class e{static{this.EVENT_STREAM_RESOURCE_NAME=`event`}static{this.COUNT=`${e.EVENT_STREAM_RESOURCE_NAME}/count`}static{this.LIST=`${e.EVENT_STREAM_RESOURCE_NAME}/list`}static{this.PAGED=`${e.EVENT_STREAM_RESOURCE_NAME}/paged`}},k,A,j,M,N,P,F,I,L,R,z,B,V=class{constructor(e){this.apiMetadata=e}count(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}list(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listStream(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}paged(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}};a([(0,n.post)(O.COUNT),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(A=typeof Record<`u`&&Record)==`function`?A:Object,typeof(j=typeof AbortController<`u`&&AbortController)==`function`?j:Object]),r(`design:returntype`,typeof(k=typeof Promise<`u`&&Promise)==`function`?k:Object)],V.prototype,`count`,null),a([(0,n.post)(O.LIST),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(N=typeof Record<`u`&&Record)==`function`?N:Object,typeof(P=typeof AbortController<`u`&&AbortController)==`function`?P:Object]),r(`design:returntype`,typeof(M=typeof Promise<`u`&&Promise)==`function`?M:Object)],V.prototype,`list`,null),a([(0,n.post)(O.LIST,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(I=typeof Record<`u`&&Record)==`function`?I:Object,typeof(L=typeof AbortController<`u`&&AbortController)==`function`?L:Object]),r(`design:returntype`,typeof(F=typeof Promise<`u`&&Promise)==`function`?F:Object)],V.prototype,`listStream`,null),a([(0,n.post)(O.PAGED),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(z=typeof Record<`u`&&Record)==`function`?z:Object,typeof(B=typeof AbortController<`u`&&AbortController)==`function`?B:Object]),r(`design:returntype`,typeof(R=typeof Promise<`u`&&Promise)==`function`?R:Object)],V.prototype,`paged`,null),V=a([(0,n.api)(),r(`design:paramtypes`,[Object])],V);var Ze=class{static{this.VERSION=`version`}static{this.TENANT_ID=`tenantId`}static{this.OWNER_ID=`ownerId`}static{this.SPACE_ID=`spaceId`}static{this.EVENT_ID=`eventId`}static{this.FIRST_EVENT_TIME=`firstEventTime`}static{this.EVENT_TIME=`eventTime`}static{this.FIRST_OPERATOR=`firstOperator`}static{this.OPERATOR=`operator`}static{this.SNAPSHOT_TIME=`snapshotTime`}static{this.TAGS=`tags`}static{this.DELETED=`deleted`}static{this.STATE=`state`}},H=class e{static{this.SNAPSHOT_RESOURCE_NAME=`snapshot`}static{this.COUNT=`${e.SNAPSHOT_RESOURCE_NAME}/count`}static{this.LIST=`${e.SNAPSHOT_RESOURCE_NAME}/list`}static{this.LIST_STATE=`${e.LIST}/state`}static{this.PAGED=`${e.SNAPSHOT_RESOURCE_NAME}/paged`}static{this.PAGED_STATE=`${e.PAGED}/state`}static{this.SINGLE=`${e.SNAPSHOT_RESOURCE_NAME}/single`}static{this.SINGLE_STATE=`${e.SINGLE}/state`}},U,W,G,K,q,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,J=class{constructor(e){this.apiMetadata=e}count(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}list(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listStream(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listState(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listStateStream(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}paged(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}pagedState(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}single(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}singleState(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}getById(e,t,n){let r=w({condition:g(e)});return this.single(r,t,n)}getStateById(e,t,n){let r=w({condition:g(e)});return this.singleState(r,t,n)}getByIds(e,t,n){let r=T({condition:_(e),limit:e.length});return this.list(r,t,n)}getStateByIds(e,t,n){let r=T({condition:_(e),limit:e.length});return this.listState(r,t,n)}};a([(0,n.post)(H.COUNT),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(W=typeof Record<`u`&&Record)==`function`?W:Object,typeof(G=typeof AbortController<`u`&&AbortController)==`function`?G:Object]),r(`design:returntype`,typeof(U=typeof Promise<`u`&&Promise)==`function`?U:Object)],J.prototype,`count`,null),a([(0,n.post)(H.LIST),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(q=typeof Record<`u`&&Record)==`function`?q:Object,typeof(Qe=typeof AbortController<`u`&&AbortController)==`function`?Qe:Object]),r(`design:returntype`,typeof(K=typeof Promise<`u`&&Promise)==`function`?K:Object)],J.prototype,`list`,null),a([(0,n.post)(H.LIST,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(et=typeof Record<`u`&&Record)==`function`?et:Object,typeof(tt=typeof AbortController<`u`&&AbortController)==`function`?tt:Object]),r(`design:returntype`,typeof($e=typeof Promise<`u`&&Promise)==`function`?$e:Object)],J.prototype,`listStream`,null),a([(0,n.post)(H.LIST_STATE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(rt=typeof Record<`u`&&Record)==`function`?rt:Object,typeof(it=typeof AbortController<`u`&&AbortController)==`function`?it:Object]),r(`design:returntype`,typeof(nt=typeof Promise<`u`&&Promise)==`function`?nt:Object)],J.prototype,`listState`,null),a([(0,n.post)(H.LIST_STATE,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ot=typeof Record<`u`&&Record)==`function`?ot:Object,typeof(st=typeof AbortController<`u`&&AbortController)==`function`?st:Object]),r(`design:returntype`,typeof(at=typeof Promise<`u`&&Promise)==`function`?at:Object)],J.prototype,`listStateStream`,null),a([(0,n.post)(H.PAGED),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(lt=typeof Record<`u`&&Record)==`function`?lt:Object,typeof(ut=typeof AbortController<`u`&&AbortController)==`function`?ut:Object]),r(`design:returntype`,typeof(ct=typeof Promise<`u`&&Promise)==`function`?ct:Object)],J.prototype,`paged`,null),a([(0,n.post)(H.PAGED_STATE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ft=typeof Record<`u`&&Record)==`function`?ft:Object,typeof(pt=typeof AbortController<`u`&&AbortController)==`function`?pt:Object]),r(`design:returntype`,typeof(dt=typeof Promise<`u`&&Promise)==`function`?dt:Object)],J.prototype,`pagedState`,null),a([(0,n.post)(H.SINGLE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ht=typeof Record<`u`&&Record)==`function`?ht:Object,typeof(gt=typeof AbortController<`u`&&AbortController)==`function`?gt:Object]),r(`design:returntype`,typeof(mt=typeof Promise<`u`&&Promise)==`function`?mt:Object)],J.prototype,`single`,null),a([(0,n.post)(H.SINGLE_STATE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(vt=typeof Record<`u`&&Record)==`function`?vt:Object,typeof(yt=typeof AbortController<`u`&&AbortController)==`function`?yt:Object]),r(`design:returntype`,typeof(_t=typeof Promise<`u`&&Promise)==`function`?_t:Object)],J.prototype,`singleState`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,typeof(xt=typeof Record<`u`&&Record)==`function`?xt:Object,typeof(St=typeof AbortController<`u`&&AbortController)==`function`?St:Object]),r(`design:returntype`,typeof(bt=typeof Promise<`u`&&Promise)==`function`?bt:Object)],J.prototype,`getById`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,typeof(wt=typeof Record<`u`&&Record)==`function`?wt:Object,typeof(Tt=typeof AbortController<`u`&&AbortController)==`function`?Tt:Object]),r(`design:returntype`,typeof(Ct=typeof Promise<`u`&&Promise)==`function`?Ct:Object)],J.prototype,`getStateById`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Array,typeof(Dt=typeof Record<`u`&&Record)==`function`?Dt:Object,typeof(Ot=typeof AbortController<`u`&&AbortController)==`function`?Ot:Object]),r(`design:returntype`,typeof(Et=typeof Promise<`u`&&Promise)==`function`?Et:Object)],J.prototype,`getByIds`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Array,typeof(At=typeof Record<`u`&&Record)==`function`?At:Object,typeof(jt=typeof AbortController<`u`&&AbortController)==`function`?jt:Object]),r(`design:returntype`,typeof(kt=typeof Promise<`u`&&Promise)==`function`?kt:Object)],J.prototype,`getStateByIds`,null),J=a([(0,n.api)(),r(`design:paramtypes`,[Object])],J);var Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Y=class e{static{this.LOAD=`{id}/state`}static{this.LOAD_VERSIONED=`${e.LOAD}/{version}`}static{this.LOAD_TIME_BASED=`${e.LOAD}/time/{createTime}`}},X=class{constructor(e){this.apiMetadata=e}load(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}loadVersioned(e,t,r,i){throw(0,n.autoGeneratedError)(e,t,r,i)}loadTimeBased(e,t,r,i){throw(0,n.autoGeneratedError)(e,t,r,i)}};a([(0,n.get)(Y.LOAD),i(0,(0,n.path)(`id`)),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,typeof(Nt=typeof Record<`u`&&Record)==`function`?Nt:Object,typeof(Pt=typeof AbortController<`u`&&AbortController)==`function`?Pt:Object]),r(`design:returntype`,typeof(Mt=typeof Promise<`u`&&Promise)==`function`?Mt:Object)],X.prototype,`load`,null),a([(0,n.get)(Y.LOAD_VERSIONED),i(0,(0,n.path)(`id`)),i(1,(0,n.path)(`version`)),i(2,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,typeof(It=typeof Record<`u`&&Record)==`function`?It:Object,typeof(Lt=typeof AbortController<`u`&&AbortController)==`function`?Lt:Object]),r(`design:returntype`,typeof(Ft=typeof Promise<`u`&&Promise)==`function`?Ft:Object)],X.prototype,`loadVersioned`,null),a([(0,n.get)(Y.LOAD_TIME_BASED),i(0,(0,n.path)(`id`)),i(1,(0,n.path)(`createTime`)),i(2,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,typeof(zt=typeof Record<`u`&&Record)==`function`?zt:Object,typeof(Bt=typeof AbortController<`u`&&AbortController)==`function`?Bt:Object]),r(`design:returntype`,typeof(Rt=typeof Promise<`u`&&Promise)==`function`?Rt:Object)],X.prototype,`loadTimeBased`,null),X=a([(0,n.api)(),r(`design:paramtypes`,[Object])],X);var Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Z=class e{static{this.LOAD=`state`}static{this.LOAD_VERSIONED=`${e.LOAD}/{version}`}static{this.LOAD_TIME_BASED=`${e.LOAD}/time/{createTime}`}},Q=class{constructor(e){this.apiMetadata=e}load(e,t){throw(0,n.autoGeneratedError)(e,t)}loadVersioned(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}loadTimeBased(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}};a([(0,n.get)(Z.LOAD),i(0,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[typeof(Ht=typeof Record<`u`&&Record)==`function`?Ht:Object,typeof(Ut=typeof AbortController<`u`&&AbortController)==`function`?Ut:Object]),r(`design:returntype`,typeof(Vt=typeof Promise<`u`&&Promise)==`function`?Vt:Object)],Q.prototype,`load`,null),a([(0,n.get)(Z.LOAD_VERSIONED),i(0,(0,n.path)(`version`)),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Number,typeof(Gt=typeof Record<`u`&&Record)==`function`?Gt:Object,typeof(Kt=typeof AbortController<`u`&&AbortController)==`function`?Kt:Object]),r(`design:returntype`,typeof(Wt=typeof Promise<`u`&&Promise)==`function`?Wt:Object)],Q.prototype,`loadVersioned`,null),a([(0,n.get)(Z.LOAD_TIME_BASED),i(0,(0,n.path)(`createTime`)),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Number,typeof(Jt=typeof Record<`u`&&Record)==`function`?Jt:Object,typeof(Yt=typeof AbortController<`u`&&AbortController)==`function`?Yt:Object]),r(`design:returntype`,typeof(qt=typeof Promise<`u`&&Promise)==`function`?qt:Object)],Q.prototype,`loadTimeBased`,null),Q=a([(0,n.api)(),r(`design:paramtypes`,[Object])],Q);var Xt=`~`;function Zt({field:e,cursorId:t=`~`,direction:n=D.DESC}){return n===D.ASC?y(e,t):b(e,t)}function Qt({field:e,direction:t=D.DESC}){return{field:e,direction:t}}function $t(e){let t=e.query,n=h(Zt(e),t.condition),r=Qt(e);return{...t,condition:n,sort:[r]}}function $(t){let n=(0,e.combineURLs)(t.resourceAttribution??``,t.aggregateName??``);return t.contextAlias&&(n=(0,e.combineURLs)(t.contextAlias,n)),{...t,basePath:n}}var en=class{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){return new J($({...this.defaultOptions,...e}))}createLoadStateAggregateClient(e){return new X($({...this.defaultOptions,...e}))}createOwnerLoadStateAggregateClient(e){return new Q($({...this.defaultOptions,...e}))}createEventStreamQueryClient(e){return new V($({...this.defaultOptions,...e}))}},tn={},nn=[`*`],rn=function(e){return e.NONE=``,e.TENANT=`/tenant/{tenantId}`,e.OWNER=`/owner/{ownerId}`,e.TENANT_OWNER=`/tenant/{tenantId}/owner/{ownerId}`,e}({}),an=function(e){return e.RECOVERABLE=`RECOVERABLE`,e.UNKNOWN=`UNKNOWN`,e.UNRECOVERABLE=`UNRECOVERABLE`,e}({}),on=class e{static{this.SUCCEEDED=`Ok`}static{this.SUCCEEDED_MESSAGE=``}static{this.NOT_FOUND=`NotFound`}static{this.NOT_FOUND_MESSAGE=`Not found resource!`}static{this.BAD_REQUEST=`BadRequest`}static{this.ILLEGAL_ARGUMENT=`IllegalArgument`}static{this.ILLEGAL_STATE=`IllegalState`}static{this.REQUEST_TIMEOUT=`RequestTimeout`}static{this.TOO_MANY_REQUESTS=`TooManyRequests`}static{this.DUPLICATE_REQUEST_ID=`DuplicateRequestId`}static{this.COMMAND_VALIDATION=`CommandValidation`}static{this.REWRITE_NO_COMMAND=`RewriteNoCommand`}static{this.EVENT_VERSION_CONFLICT=`EventVersionConflict`}static{this.DUPLICATE_AGGREGATE_ID=`DuplicateAggregateId`}static{this.COMMAND_EXPECT_VERSION_CONFLICT=`CommandExpectVersionConflict`}static{this.SOURCING_VERSION_CONFLICT=`SourcingVersionConflict`}static{this.ILLEGAL_ACCESS_DELETED_AGGREGATE=`IllegalAccessDeletedAggregate`}static{this.ILLEGAL_ACCESS_OWNER_AGGREGATE=`IllegalAccessOwnerAggregate`}static{this.ILLEGAL_ACCESS_SPACE_AGGREGATE=`IllegalAccessSpaceAggregate`}static{this.INTERNAL_SERVER_ERROR=`InternalServerError`}static isSucceeded(t){return t===e.SUCCEEDED}static isError(t){return!e.isSucceeded(t)}},sn=function(e){return e.COMMAND=`COMMAND`,e.ERROR=`ERROR`,e.EVENT=`EVENT`,e.SOURCING=`SOURCING`,e.STATE_EVENT=`STATE_EVENT`,e}({}),cn=``,ln=function(e){return e.MAP=`MAP`,e.STRING=`STRING`,e}({});function un(e,t,n){if(e==null)return n;let r=Array.isArray(t)?t:t.split(`.`).filter(Boolean);if(r.length===0)return e;let i=e;for(let e of r){if(Array.isArray(i)){let t=parseInt(e,10);if(isNaN(t)||t<0||!Number.isInteger(t))return n;i=i[t]}else if(typeof i==`object`)i=i[e];else return n;if(i==null)return n}return i}exports.CURSOR_ID_START=Xt,Object.defineProperty(exports,`CommandClient`,{enumerable:!0,get:function(){return l}}),exports.CommandHeaders=te,exports.CommandStage=ne,exports.ConditionOptionKey=ae,exports.DEFAULT_OWNER_ID=cn,exports.DEFAULT_PAGINATION=x,exports.DEFAULT_PROJECTION=S,exports.DeletionState=m,exports.DomainEventStreamMetadataFields=Xe,exports.EMPTY_ABAC_TAGS=tn,exports.EMPTY_PAGED_LIST=E,exports.EMPTY_VALUE_OPERATORS=ie,exports.ErrorCodes=on,Object.defineProperty(exports,`EventStreamQueryClient`,{enumerable:!0,get:function(){return V}}),exports.EventStreamQueryEndpointPaths=O,exports.FunctionKind=sn,exports.LOGICAL_OPERATORS=re,Object.defineProperty(exports,`LoadOwnerStateAggregateClient`,{enumerable:!0,get:function(){return Q}}),exports.LoadOwnerStateAggregateEndpointPaths=Z,Object.defineProperty(exports,`LoadStateAggregateClient`,{enumerable:!0,get:function(){return X}}),exports.LoadStateAggregateEndpointPaths=Y,exports.MessageHeaderSqlType=ln,exports.Operator=u,exports.QueryClientFactory=en,exports.RecoverableType=an,exports.ResourceAttributionPathSpec=rn,exports.SnapshotMetadataFields=Ze,Object.defineProperty(exports,`SnapshotQueryClient`,{enumerable:!0,get:function(){return J}}),exports.SnapshotQueryEndpointPaths=H,exports.SortDirection=D,exports.WILDCARD_ABAC_TAG_VALUES=nn,exports.active=me,exports.aggregateId=g,exports.aggregateIds=_,exports.all=v,exports.allIn=Ce,exports.and=h,exports.asc=Je,exports.beforeToday=Pe,exports.between=Se,exports.contains=ye,exports.createQueryApiMetadata=$,exports.cursorCondition=Zt,exports.cursorQuery=$t,exports.cursorSort=Qt,exports.dateOptions=p,exports.defaultProjection=C,exports.deleted=pe,exports.desc=Ye,exports.earlierDays=He,exports.elemMatch=De,exports.endsWith=Ee,exports.eq=he,exports.exists=Me,exports.getPropertyValue=un,exports.gt=y,exports.gte=_e,exports.id=ce,exports.ids=le,exports.ignoreCaseOptions=f,exports.isFalse=je,exports.isIn=be,exports.isNull=Oe,exports.isTrue=Ae,exports.isValidateCondition=d,exports.lastMonth=Be,exports.lastWeek=Re,exports.listQuery=T,exports.lt=b,exports.lte=ve,exports.match=Te,exports.ne=ge,exports.nextWeek=Le,exports.nor=se,exports.notIn=xe,exports.notNull=ke,exports.or=oe,exports.ownerId=de,exports.pagedList=qe,exports.pagedQuery=Ke,exports.pagination=We,exports.projection=Ge,exports.raw=Ue,exports.recentDays=Ve,exports.singleQuery=w,exports.spaceId=fe,exports.startsWith=we,exports.tenantId=ue,exports.thisMonth=ze,exports.thisWeek=Ie,exports.today=Ne,exports.tomorrow=Fe;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@ahoo-wang/fetcher`),t=require(`@ahoo-wang/fetcher-eventstream`),n=require(`@ahoo-wang/fetcher-decorator`);function r(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function i(e,t){return function(n,r){t(n,r,e)}}function a(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var o,s,c,ee,l=class{constructor(e){this.apiMetadata=e}send(e,t){throw(0,n.autoGeneratedError)(e,t)}sendAndWaitStream(e,t){throw(0,n.autoGeneratedError)(e,t)}};a([(0,n.endpoint)(),i(0,(0,n.request)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(s=typeof Record<`u`&&Record)==`function`?s:Object]),r(`design:returntype`,typeof(o=typeof Promise<`u`&&Promise)==`function`?o:Object)],l.prototype,`send`,null),a([(0,n.endpoint)(void 0,void 0,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.request)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ee=typeof Record<`u`&&Record)==`function`?ee:Object]),r(`design:returntype`,typeof(c=typeof Promise<`u`&&Promise)==`function`?c:Object)],l.prototype,`sendAndWaitStream`,null),l=a([(0,n.api)(),r(`design:paramtypes`,[Object])],l);var te=class e{static{this.COMMAND_HEADERS_PREFIX=`Command-`}static{this.TENANT_ID=`${e.COMMAND_HEADERS_PREFIX}Tenant-Id`}static{this.OWNER_ID=`${e.COMMAND_HEADERS_PREFIX}Owner-Id`}static{this.SPACE_ID=`${e.COMMAND_HEADERS_PREFIX}Space-Id`}static{this.AGGREGATE_ID=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Id`}static{this.AGGREGATE_VERSION=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Version`}static{this.WAIT_PREFIX=`${e.COMMAND_HEADERS_PREFIX}Wait-`}static{this.WAIT_TIME_OUT=`${e.WAIT_PREFIX}Timeout`}static{this.WAIT_STAGE=`${e.WAIT_PREFIX}Stage`}static{this.WAIT_CONTEXT=`${e.WAIT_PREFIX}Context`}static{this.WAIT_PROCESSOR=`${e.WAIT_PREFIX}Processor`}static{this.WAIT_FUNCTION=`${e.WAIT_PREFIX}Function`}static{this.WAIT_TAIL_PREFIX=`${e.WAIT_PREFIX}Tail-`}static{this.WAIT_TAIL_STAGE=`${e.WAIT_TAIL_PREFIX}Stage`}static{this.WAIT_TAIL_CONTEXT=`${e.WAIT_TAIL_PREFIX}Context`}static{this.WAIT_TAIL_PROCESSOR=`${e.WAIT_TAIL_PREFIX}Processor`}static{this.WAIT_TAIL_FUNCTION=`${e.WAIT_TAIL_PREFIX}Function`}static{this.REQUEST_ID=`${e.COMMAND_HEADERS_PREFIX}Request-Id`}static{this.LOCAL_FIRST=`${e.COMMAND_HEADERS_PREFIX}Local-First`}static{this.COMMAND_AGGREGATE_CONTEXT=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Context`}static{this.COMMAND_AGGREGATE_NAME=`${e.COMMAND_HEADERS_PREFIX}Aggregate-Name`}static{this.COMMAND_TYPE=`${e.COMMAND_HEADERS_PREFIX}Type`}static{this.COMMAND_HEADER_X_PREFIX=`${e.COMMAND_HEADERS_PREFIX}Header-`}},ne=function(e){return e.SENT=`SENT`,e.PROCESSED=`PROCESSED`,e.SNAPSHOT=`SNAPSHOT`,e.PROJECTED=`PROJECTED`,e.EVENT_HANDLED=`EVENT_HANDLED`,e.SAGA_HANDLED=`SAGA_HANDLED`,e}({}),u=function(e){return e.AND=`AND`,e.OR=`OR`,e.NOR=`NOR`,e.ID=`ID`,e.IDS=`IDS`,e.AGGREGATE_ID=`AGGREGATE_ID`,e.AGGREGATE_IDS=`AGGREGATE_IDS`,e.TENANT_ID=`TENANT_ID`,e.OWNER_ID=`OWNER_ID`,e.SPACE_ID=`SPACE_ID`,e.DELETED=`DELETED`,e.ALL=`ALL`,e.EQ=`EQ`,e.NE=`NE`,e.GT=`GT`,e.LT=`LT`,e.GTE=`GTE`,e.LTE=`LTE`,e.CONTAINS=`CONTAINS`,e.IN=`IN`,e.NOT_IN=`NOT_IN`,e.BETWEEN=`BETWEEN`,e.ALL_IN=`ALL_IN`,e.STARTS_WITH=`STARTS_WITH`,e.ENDS_WITH=`ENDS_WITH`,e.ELEM_MATCH=`ELEM_MATCH`,e.NULL=`NULL`,e.NOT_NULL=`NOT_NULL`,e.TRUE=`TRUE`,e.FALSE=`FALSE`,e.EXISTS=`EXISTS`,e.TODAY=`TODAY`,e.BEFORE_TODAY=`BEFORE_TODAY`,e.TOMORROW=`TOMORROW`,e.THIS_WEEK=`THIS_WEEK`,e.NEXT_WEEK=`NEXT_WEEK`,e.LAST_WEEK=`LAST_WEEK`,e.THIS_MONTH=`THIS_MONTH`,e.LAST_MONTH=`LAST_MONTH`,e.RECENT_DAYS=`RECENT_DAYS`,e.EARLIER_DAYS=`EARLIER_DAYS`,e.MATCH=`MATCH`,e.RAW=`RAW`,e}({}),re=new Set([u.AND,u.OR,u.NOR]),ie=new Set([u.NULL,u.NOT_NULL,u.TRUE,u.FALSE,u.EXISTS,u.TODAY,u.TOMORROW,u.THIS_WEEK,u.NEXT_WEEK,u.LAST_WEEK,u.THIS_MONTH,u.LAST_MONTH]);function d(e){return!!e}var ae=class{static{this.IGNORE_CASE_OPTION_KEY=`ignoreCase`}static{this.ZONE_ID_OPTION_KEY=`zoneId`}static{this.DATE_PATTERN_OPTION_KEY=`datePattern`}};function f(e){if(e!==void 0)return{ignoreCase:e}}function p(e,t){if(e===void 0&&t===void 0)return;let n={};return e!==void 0&&(n.datePattern=e),t!==void 0&&(n.zoneId=t),n}var m=function(e){return e.ACTIVE=`ACTIVE`,e.DELETED=`DELETED`,e.ALL=`ALL`,e}({});function h(...e){if(e.length===0)return v();if(e.length===1)return d(e[0])?e[0]:v();let t=[];return e.forEach(e=>{e?.operator===u.ALL||!d(e)||(e.operator===u.AND&&e.children?t.push(...e.children):t.push(e))}),t.length===0?v():{operator:u.AND,children:t}}function oe(...e){let t=e?.filter(e=>d(e));return t.length===0?v():{operator:u.OR,children:t}}function se(...e){return e.length===0?v():{operator:u.NOR,children:e}}function ce(e){return{operator:u.ID,value:e}}function le(e){return{operator:u.IDS,value:e}}function g(e){return{operator:u.AGGREGATE_ID,value:e}}function _(e){return{operator:u.AGGREGATE_IDS,value:e}}function ue(e){return{operator:u.TENANT_ID,value:e}}function de(e){return{operator:u.OWNER_ID,value:e}}function fe(e){return{operator:u.SPACE_ID,value:e}}function pe(e){return{operator:u.DELETED,value:e}}function me(){return pe(m.ACTIVE)}function v(){return{operator:u.ALL}}function he(e,t){return{field:e,operator:u.EQ,value:t}}function ge(e,t){return{field:e,operator:u.NE,value:t}}function y(e,t){return{field:e,operator:u.GT,value:t}}function b(e,t){return{field:e,operator:u.LT,value:t}}function _e(e,t){return{field:e,operator:u.GTE,value:t}}function ve(e,t){return{field:e,operator:u.LTE,value:t}}function ye(e,t,n){let r=f(n);return{field:e,operator:u.CONTAINS,value:t,options:r}}function be(e,...t){return{field:e,operator:u.IN,value:t}}function xe(e,...t){return{field:e,operator:u.NOT_IN,value:t}}function Se(e,t,n){return{field:e,operator:u.BETWEEN,value:[t,n]}}function Ce(e,...t){return{field:e,operator:u.ALL_IN,value:t}}function we(e,t,n){let r=f(n);return{field:e,operator:u.STARTS_WITH,value:t,options:r}}function Te(e,t){return{field:e,operator:u.MATCH,value:t}}function Ee(e,t,n){let r=f(n);return{field:e,operator:u.ENDS_WITH,value:t,options:r}}function De(e,t){return{field:e,operator:u.ELEM_MATCH,children:[t]}}function Oe(e){return{field:e,operator:u.NULL}}function ke(e){return{field:e,operator:u.NOT_NULL}}function Ae(e){return{field:e,operator:u.TRUE}}function je(e){return{field:e,operator:u.FALSE}}function Me(e,t=!0){return{field:e,operator:u.EXISTS,value:t}}function Ne(e,t,n){let r=p(t,n);return{field:e,operator:u.TODAY,options:r}}function Pe(e,t,n,r){let i=p(n,r);return{field:e,operator:u.BEFORE_TODAY,value:t,options:i}}function Fe(e,t,n){let r=p(t,n);return{field:e,operator:u.TOMORROW,options:r}}function Ie(e,t,n){let r=p(t,n);return{field:e,operator:u.THIS_WEEK,options:r}}function Le(e,t,n){let r=p(t,n);return{field:e,operator:u.NEXT_WEEK,options:r}}function Re(e,t,n){let r=p(t,n);return{field:e,operator:u.LAST_WEEK,options:r}}function ze(e,t,n){let r=p(t,n);return{field:e,operator:u.THIS_MONTH,options:r}}function Be(e,t,n){let r=p(t,n);return{field:e,operator:u.LAST_MONTH,options:r}}function Ve(e,t,n,r){let i=p(n,r);return{field:e,operator:u.RECENT_DAYS,value:t,options:i}}function He(e,t,n,r){let i=p(n,r);return{field:e,operator:u.EARLIER_DAYS,value:t,options:i}}function Ue(e){return{operator:u.RAW,value:e}}var x={index:1,size:10};function We({index:e=x.index,size:t=x.size}=x){return{index:e,size:t}}var S={};function C(){return S}function Ge({include:e,exclude:t}=C()){return{include:e,exclude:t}}function w({condition:e=v(),projection:t,sort:n}={}){return{condition:e,projection:t,sort:n}}function T({condition:e=v(),projection:t,sort:n,limit:r=x.size}={}){return{condition:e,projection:t,sort:n,limit:r}}function Ke({condition:e=v(),projection:t,sort:n,pagination:r=x}={}){return{condition:e,projection:t,sort:n,pagination:r}}var E={total:0,list:[]};function qe({total:e,list:t=[]}=E){return e===void 0&&(e=t.length),{total:e,list:t}}var D=function(e){return e.ASC=`ASC`,e.DESC=`DESC`,e}({});function Je(e){return{field:e,direction:D.ASC}}function Ye(e){return{field:e,direction:D.DESC}}var Xe=class e{static{this.HEADER=`header`}static{this.COMMAND_OPERATOR=`${e.HEADER}.command_operator`}static{this.AGGREGATE_ID=`aggregateId`}static{this.TENANT_ID=`tenantId`}static{this.OWNER_ID=`ownerId`}static{this.SPACE_ID=`spaceId`}static{this.COMMAND_ID=`commandId`}static{this.REQUEST_ID=`requestId`}static{this.VERSION=`version`}static{this.BODY=`body`}static{this.BODY_ID=`${e.BODY}.id`}static{this.BODY_NAME=`${e.BODY}.name`}static{this.BODY_TYPE=`${e.BODY}.bodyType`}static{this.BODY_REVISION=`${e.BODY}.revision`}static{this.BODY_BODY=`${e.BODY}.body`}static{this.CREATE_TIME=`createTime`}},O=class e{static{this.EVENT_STREAM_RESOURCE_NAME=`event`}static{this.COUNT=`${e.EVENT_STREAM_RESOURCE_NAME}/count`}static{this.LIST=`${e.EVENT_STREAM_RESOURCE_NAME}/list`}static{this.PAGED=`${e.EVENT_STREAM_RESOURCE_NAME}/paged`}},k,A,j,M,N,P,F,I,L,R,z,B,V=class{constructor(e){this.apiMetadata=e}count(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}list(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listStream(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}paged(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}};a([(0,n.post)(O.COUNT),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(A=typeof Record<`u`&&Record)==`function`?A:Object,typeof(j=typeof AbortController<`u`&&AbortController)==`function`?j:Object]),r(`design:returntype`,typeof(k=typeof Promise<`u`&&Promise)==`function`?k:Object)],V.prototype,`count`,null),a([(0,n.post)(O.LIST),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(N=typeof Record<`u`&&Record)==`function`?N:Object,typeof(P=typeof AbortController<`u`&&AbortController)==`function`?P:Object]),r(`design:returntype`,typeof(M=typeof Promise<`u`&&Promise)==`function`?M:Object)],V.prototype,`list`,null),a([(0,n.post)(O.LIST,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(I=typeof Record<`u`&&Record)==`function`?I:Object,typeof(L=typeof AbortController<`u`&&AbortController)==`function`?L:Object]),r(`design:returntype`,typeof(F=typeof Promise<`u`&&Promise)==`function`?F:Object)],V.prototype,`listStream`,null),a([(0,n.post)(O.PAGED),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(z=typeof Record<`u`&&Record)==`function`?z:Object,typeof(B=typeof AbortController<`u`&&AbortController)==`function`?B:Object]),r(`design:returntype`,typeof(R=typeof Promise<`u`&&Promise)==`function`?R:Object)],V.prototype,`paged`,null),V=a([(0,n.api)(),r(`design:paramtypes`,[Object])],V);var Ze=class{static{this.VERSION=`version`}static{this.TENANT_ID=`tenantId`}static{this.OWNER_ID=`ownerId`}static{this.SPACE_ID=`spaceId`}static{this.EVENT_ID=`eventId`}static{this.FIRST_EVENT_TIME=`firstEventTime`}static{this.EVENT_TIME=`eventTime`}static{this.FIRST_OPERATOR=`firstOperator`}static{this.OPERATOR=`operator`}static{this.SNAPSHOT_TIME=`snapshotTime`}static{this.TAGS=`tags`}static{this.DELETED=`deleted`}static{this.STATE=`state`}},H=class e{static{this.SNAPSHOT_RESOURCE_NAME=`snapshot`}static{this.COUNT=`${e.SNAPSHOT_RESOURCE_NAME}/count`}static{this.LIST=`${e.SNAPSHOT_RESOURCE_NAME}/list`}static{this.LIST_STATE=`${e.LIST}/state`}static{this.PAGED=`${e.SNAPSHOT_RESOURCE_NAME}/paged`}static{this.PAGED_STATE=`${e.PAGED}/state`}static{this.SINGLE=`${e.SNAPSHOT_RESOURCE_NAME}/single`}static{this.SINGLE_STATE=`${e.SINGLE}/state`}},U,W,G,K,q,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St,Ct,wt,Tt,Et,Dt,Ot,kt,At,jt,J=class{constructor(e){this.apiMetadata=e}count(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}list(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listStream(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listState(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}listStateStream(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}paged(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}pagedState(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}single(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}singleState(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}getById(e,t,n){let r=w({condition:g(e)});return this.single(r,t,n)}getStateById(e,t,n){let r=w({condition:g(e)});return this.singleState(r,t,n)}getByIds(e,t,n){let r=T({condition:_(e),limit:e.length});return this.list(r,t,n)}getStateByIds(e,t,n){let r=T({condition:_(e),limit:e.length});return this.listState(r,t,n)}};a([(0,n.post)(H.COUNT),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(W=typeof Record<`u`&&Record)==`function`?W:Object,typeof(G=typeof AbortController<`u`&&AbortController)==`function`?G:Object]),r(`design:returntype`,typeof(U=typeof Promise<`u`&&Promise)==`function`?U:Object)],J.prototype,`count`,null),a([(0,n.post)(H.LIST),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(q=typeof Record<`u`&&Record)==`function`?q:Object,typeof(Qe=typeof AbortController<`u`&&AbortController)==`function`?Qe:Object]),r(`design:returntype`,typeof(K=typeof Promise<`u`&&Promise)==`function`?K:Object)],J.prototype,`list`,null),a([(0,n.post)(H.LIST,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(et=typeof Record<`u`&&Record)==`function`?et:Object,typeof(tt=typeof AbortController<`u`&&AbortController)==`function`?tt:Object]),r(`design:returntype`,typeof($e=typeof Promise<`u`&&Promise)==`function`?$e:Object)],J.prototype,`listStream`,null),a([(0,n.post)(H.LIST_STATE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(rt=typeof Record<`u`&&Record)==`function`?rt:Object,typeof(it=typeof AbortController<`u`&&AbortController)==`function`?it:Object]),r(`design:returntype`,typeof(nt=typeof Promise<`u`&&Promise)==`function`?nt:Object)],J.prototype,`listState`,null),a([(0,n.post)(H.LIST_STATE,{headers:{Accept:e.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:t.JsonEventStreamResultExtractor}),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ot=typeof Record<`u`&&Record)==`function`?ot:Object,typeof(st=typeof AbortController<`u`&&AbortController)==`function`?st:Object]),r(`design:returntype`,typeof(at=typeof Promise<`u`&&Promise)==`function`?at:Object)],J.prototype,`listStateStream`,null),a([(0,n.post)(H.PAGED),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(lt=typeof Record<`u`&&Record)==`function`?lt:Object,typeof(ut=typeof AbortController<`u`&&AbortController)==`function`?ut:Object]),r(`design:returntype`,typeof(ct=typeof Promise<`u`&&Promise)==`function`?ct:Object)],J.prototype,`paged`,null),a([(0,n.post)(H.PAGED_STATE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ft=typeof Record<`u`&&Record)==`function`?ft:Object,typeof(pt=typeof AbortController<`u`&&AbortController)==`function`?pt:Object]),r(`design:returntype`,typeof(dt=typeof Promise<`u`&&Promise)==`function`?dt:Object)],J.prototype,`pagedState`,null),a([(0,n.post)(H.SINGLE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(ht=typeof Record<`u`&&Record)==`function`?ht:Object,typeof(gt=typeof AbortController<`u`&&AbortController)==`function`?gt:Object]),r(`design:returntype`,typeof(mt=typeof Promise<`u`&&Promise)==`function`?mt:Object)],J.prototype,`single`,null),a([(0,n.post)(H.SINGLE_STATE),i(0,(0,n.body)()),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Object,typeof(vt=typeof Record<`u`&&Record)==`function`?vt:Object,typeof(yt=typeof AbortController<`u`&&AbortController)==`function`?yt:Object]),r(`design:returntype`,typeof(_t=typeof Promise<`u`&&Promise)==`function`?_t:Object)],J.prototype,`singleState`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,typeof(xt=typeof Record<`u`&&Record)==`function`?xt:Object,typeof(St=typeof AbortController<`u`&&AbortController)==`function`?St:Object]),r(`design:returntype`,typeof(bt=typeof Promise<`u`&&Promise)==`function`?bt:Object)],J.prototype,`getById`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,typeof(wt=typeof Record<`u`&&Record)==`function`?wt:Object,typeof(Tt=typeof AbortController<`u`&&AbortController)==`function`?Tt:Object]),r(`design:returntype`,typeof(Ct=typeof Promise<`u`&&Promise)==`function`?Ct:Object)],J.prototype,`getStateById`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Array,typeof(Dt=typeof Record<`u`&&Record)==`function`?Dt:Object,typeof(Ot=typeof AbortController<`u`&&AbortController)==`function`?Ot:Object]),r(`design:returntype`,typeof(Et=typeof Promise<`u`&&Promise)==`function`?Et:Object)],J.prototype,`getByIds`,null),a([i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Array,typeof(At=typeof Record<`u`&&Record)==`function`?At:Object,typeof(jt=typeof AbortController<`u`&&AbortController)==`function`?jt:Object]),r(`design:returntype`,typeof(kt=typeof Promise<`u`&&Promise)==`function`?kt:Object)],J.prototype,`getStateByIds`,null),J=a([(0,n.api)(),r(`design:paramtypes`,[Object])],J);var Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Y=class e{static{this.LOAD=`{id}/state`}static{this.LOAD_VERSIONED=`${e.LOAD}/{version}`}static{this.LOAD_TIME_BASED=`${e.LOAD}/time/{createTime}`}},X=class{constructor(e){this.apiMetadata=e}load(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}loadVersioned(e,t,r,i){throw(0,n.autoGeneratedError)(e,t,r,i)}loadTimeBased(e,t,r,i){throw(0,n.autoGeneratedError)(e,t,r,i)}};a([(0,n.get)(Y.LOAD),i(0,(0,n.path)(`id`)),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,typeof(Nt=typeof Record<`u`&&Record)==`function`?Nt:Object,typeof(Pt=typeof AbortController<`u`&&AbortController)==`function`?Pt:Object]),r(`design:returntype`,typeof(Mt=typeof Promise<`u`&&Promise)==`function`?Mt:Object)],X.prototype,`load`,null),a([(0,n.get)(Y.LOAD_VERSIONED),i(0,(0,n.path)(`id`)),i(1,(0,n.path)(`version`)),i(2,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,typeof(It=typeof Record<`u`&&Record)==`function`?It:Object,typeof(Lt=typeof AbortController<`u`&&AbortController)==`function`?Lt:Object]),r(`design:returntype`,typeof(Ft=typeof Promise<`u`&&Promise)==`function`?Ft:Object)],X.prototype,`loadVersioned`,null),a([(0,n.get)(Y.LOAD_TIME_BASED),i(0,(0,n.path)(`id`)),i(1,(0,n.path)(`createTime`)),i(2,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,typeof(zt=typeof Record<`u`&&Record)==`function`?zt:Object,typeof(Bt=typeof AbortController<`u`&&AbortController)==`function`?Bt:Object]),r(`design:returntype`,typeof(Rt=typeof Promise<`u`&&Promise)==`function`?Rt:Object)],X.prototype,`loadTimeBased`,null),X=a([(0,n.api)(),r(`design:paramtypes`,[Object])],X);var Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Z=class e{static{this.LOAD=`state`}static{this.LOAD_VERSIONED=`${e.LOAD}/{version}`}static{this.LOAD_TIME_BASED=`${e.LOAD}/time/{createTime}`}},Q=class{constructor(e){this.apiMetadata=e}load(e,t){throw(0,n.autoGeneratedError)(e,t)}loadVersioned(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}loadTimeBased(e,t,r){throw(0,n.autoGeneratedError)(e,t,r)}};a([(0,n.get)(Z.LOAD),i(0,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[typeof(Ht=typeof Record<`u`&&Record)==`function`?Ht:Object,typeof(Ut=typeof AbortController<`u`&&AbortController)==`function`?Ut:Object]),r(`design:returntype`,typeof(Vt=typeof Promise<`u`&&Promise)==`function`?Vt:Object)],Q.prototype,`load`,null),a([(0,n.get)(Z.LOAD_VERSIONED),i(0,(0,n.path)(`version`)),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Number,typeof(Gt=typeof Record<`u`&&Record)==`function`?Gt:Object,typeof(Kt=typeof AbortController<`u`&&AbortController)==`function`?Kt:Object]),r(`design:returntype`,typeof(Wt=typeof Promise<`u`&&Promise)==`function`?Wt:Object)],Q.prototype,`loadVersioned`,null),a([(0,n.get)(Z.LOAD_TIME_BASED),i(0,(0,n.path)(`createTime`)),i(1,(0,n.attribute)()),r(`design:type`,Function),r(`design:paramtypes`,[Number,typeof(Jt=typeof Record<`u`&&Record)==`function`?Jt:Object,typeof(Yt=typeof AbortController<`u`&&AbortController)==`function`?Yt:Object]),r(`design:returntype`,typeof(qt=typeof Promise<`u`&&Promise)==`function`?qt:Object)],Q.prototype,`loadTimeBased`,null),Q=a([(0,n.api)(),r(`design:paramtypes`,[Object])],Q);var Xt=`~`;function Zt({field:e,cursorId:t=`~`,direction:n=D.DESC}){return n===D.ASC?y(e,t):b(e,t)}function Qt({field:e,direction:t=D.DESC}){return{field:e,direction:t}}function $t(e){let t=e.query,n=h(Zt(e),t.condition),r=Qt(e);return{...t,condition:n,sort:[r]}}function $(t){let n=(0,e.combineURLs)(t.resourceAttribution??``,t.aggregateName??``);return t.contextAlias&&(n=(0,e.combineURLs)(t.contextAlias,n)),{...t,basePath:n}}var en=class{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){return new J($({...this.defaultOptions,...e}))}createLoadStateAggregateClient(e){return new X($({...this.defaultOptions,...e}))}createOwnerLoadStateAggregateClient(e){return new Q($({...this.defaultOptions,...e}))}createEventStreamQueryClient(e){return new V($({...this.defaultOptions,...e}))}},tn={},nn=[`*`],rn=function(e){return e.NONE=``,e.TENANT=`/tenant/{tenantId}`,e.OWNER=`/owner/{ownerId}`,e.TENANT_OWNER=`/tenant/{tenantId}/owner/{ownerId}`,e}({}),an=function(e){return e.RECOVERABLE=`RECOVERABLE`,e.UNKNOWN=`UNKNOWN`,e.UNRECOVERABLE=`UNRECOVERABLE`,e}({}),on=class e{static{this.SUCCEEDED=`Ok`}static{this.SUCCEEDED_MESSAGE=``}static{this.NOT_FOUND=`NotFound`}static{this.NOT_FOUND_MESSAGE=`Not found resource!`}static{this.BAD_REQUEST=`BadRequest`}static{this.ILLEGAL_ARGUMENT=`IllegalArgument`}static{this.ILLEGAL_STATE=`IllegalState`}static{this.REQUEST_TIMEOUT=`RequestTimeout`}static{this.TOO_MANY_REQUESTS=`TooManyRequests`}static{this.DUPLICATE_REQUEST_ID=`DuplicateRequestId`}static{this.COMMAND_VALIDATION=`CommandValidation`}static{this.REWRITE_NO_COMMAND=`RewriteNoCommand`}static{this.EVENT_VERSION_CONFLICT=`EventVersionConflict`}static{this.DUPLICATE_AGGREGATE_ID=`DuplicateAggregateId`}static{this.COMMAND_EXPECT_VERSION_CONFLICT=`CommandExpectVersionConflict`}static{this.SOURCING_VERSION_CONFLICT=`SourcingVersionConflict`}static{this.ILLEGAL_ACCESS_DELETED_AGGREGATE=`IllegalAccessDeletedAggregate`}static{this.ILLEGAL_ACCESS_OWNER_AGGREGATE=`IllegalAccessOwnerAggregate`}static{this.ILLEGAL_ACCESS_SPACE_AGGREGATE=`IllegalAccessSpaceAggregate`}static{this.INTERNAL_SERVER_ERROR=`InternalServerError`}static isSucceeded(t){return t===e.SUCCEEDED}static isError(t){return!e.isSucceeded(t)}},sn=function(e){return e.COMMAND=`COMMAND`,e.ERROR=`ERROR`,e.EVENT=`EVENT`,e.SOURCING=`SOURCING`,e.STATE_EVENT=`STATE_EVENT`,e}({}),cn=``,ln=function(e){return e.MAP=`MAP`,e.STRING=`STRING`,e}({});function un(e,t,n){if(e==null)return n;let r=Array.isArray(t)?t:t.split(`.`).filter(Boolean);if(r.length===0)return e;let i=e;for(let e of r){if(Array.isArray(i)){let t=parseInt(e,10);if(isNaN(t)||t<0||!Number.isInteger(t))return n;i=i[t]}else if(typeof i==`object`)i=i[e];else return n;if(i==null)return n}return i}exports.CURSOR_ID_START=Xt,Object.defineProperty(exports,`CommandClient`,{enumerable:!0,get:function(){return l}}),exports.CommandHeaders=te,exports.CommandStage=ne,exports.ConditionOptionKey=ae,exports.DEFAULT_OWNER_ID=cn,exports.DEFAULT_PAGINATION=x,exports.DEFAULT_PROJECTION=S,exports.DeletionState=m,exports.DomainEventStreamMetadataFields=Xe,exports.EMPTY_ABAC_TAGS=tn,exports.EMPTY_PAGED_LIST=E,exports.EMPTY_VALUE_OPERATORS=ie,exports.ErrorCodes=on,Object.defineProperty(exports,`EventStreamQueryClient`,{enumerable:!0,get:function(){return V}}),exports.EventStreamQueryEndpointPaths=O,exports.FunctionKind=sn,exports.LOGICAL_OPERATORS=re,Object.defineProperty(exports,`LoadOwnerStateAggregateClient`,{enumerable:!0,get:function(){return Q}}),exports.LoadOwnerStateAggregateEndpointPaths=Z,Object.defineProperty(exports,`LoadStateAggregateClient`,{enumerable:!0,get:function(){return X}}),exports.LoadStateAggregateEndpointPaths=Y,exports.MessageHeaderSqlType=ln,exports.Operator=u,exports.QueryClientFactory=en,exports.RecoverableType=an,exports.ResourceAttributionPathSpec=rn,exports.SnapshotMetadataFields=Ze,Object.defineProperty(exports,`SnapshotQueryClient`,{enumerable:!0,get:function(){return J}}),exports.SnapshotQueryEndpointPaths=H,exports.SortDirection=D,exports.WILDCARD_ABAC_TAG_VALUES=nn,exports.active=me,exports.aggregateId=g,exports.aggregateIds=_,exports.all=v,exports.allIn=Ce,exports.and=h,exports.asc=Je,exports.beforeToday=Pe,exports.between=Se,exports.contains=ye,exports.createQueryApiMetadata=$,exports.cursorCondition=Zt,exports.cursorQuery=$t,exports.cursorSort=Qt,exports.dateOptions=p,exports.defaultProjection=C,exports.deleted=pe,exports.desc=Ye,exports.earlierDays=He,exports.elemMatch=De,exports.endsWith=Ee,exports.eq=he,exports.exists=Me,exports.getPropertyValue=un,exports.gt=y,exports.gte=_e,exports.id=ce,exports.ids=le,exports.ignoreCaseOptions=f,exports.isFalse=je,exports.isIn=be,exports.isNull=Oe,exports.isTrue=Ae,exports.isValidateCondition=d,exports.lastMonth=Be,exports.lastWeek=Re,exports.listQuery=T,exports.lt=b,exports.lte=ve,exports.match=Te,exports.ne=ge,exports.nextWeek=Le,exports.nor=se,exports.notIn=xe,exports.notNull=ke,exports.or=oe,exports.ownerId=de,exports.pagedList=qe,exports.pagedQuery=Ke,exports.pagination=We,exports.projection=Ge,exports.raw=Ue,exports.recentDays=Ve,exports.singleQuery=w,exports.spaceId=fe,exports.startsWith=we,exports.tenantId=ue,exports.thisMonth=ze,exports.thisWeek=Ie,exports.today=Ne,exports.tomorrow=Fe;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|