@ahoo-wang/fetcher-wow 3.12.21 → 3.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { ErrorInfo, FunctionInfoCapable, Identifier } from '../types';
1
+ import { ApplyAbacTags, ErrorInfo, FunctionInfoCapable, Identifier } from '../types';
2
2
  import { PartialBy, RemoveReadonlyFields } from '@ahoo-wang/fetcher';
3
3
  /**
4
4
  * Command identifier interface
@@ -123,6 +123,9 @@ export type DeleteAggregateCommand = CommandBody<DeleteAggregate>;
123
123
  export interface RecoverAggregate {
124
124
  }
125
125
  export type RecoverAggregateCommand = CommandBody<RecoverAggregate>;
126
+ export interface ApplyResourceTags extends ApplyAbacTags {
127
+ }
128
+ export type ApplyResourceTagsCommand = CommandBody<ApplyResourceTags>;
126
129
  /**
127
130
  * Represents the result of a batch operation, containing information about
128
131
  * the pagination and error status of the operation.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/command/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACtB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,aAAa,kBAAkB;IAE/B;;OAEG;IACH,YAAY,iBAAiB;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBACf,SAAQ,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,EACjC,mBAAmB;CAAG;AAE1B;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;CAAG;AAEnC,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAErD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;AAElE;;;;;;GAMG;AAEH,MAAM,WAAW,gBAAgB;CAAG;AAEpC,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/command/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACtB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,QAAQ,aAAa;IAErB;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,aAAa,kBAAkB;IAE/B;;OAEG;IACH,YAAY,iBAAiB;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBACf,SAAQ,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,EACjC,mBAAmB;CACtB;AAED;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;CAC/B;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAErD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;AAElE;;;;;;GAMG;AAEH,MAAM,WAAW,gBAAgB;CAChC;AAED,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAGpE,MAAM,WAAW,iBAAkB,SAAQ,aAAa;CACvD;AAED,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@ahoo-wang/fetcher"),b=require("@ahoo-wang/fetcher-eventstream"),n=require("@ahoo-wang/fetcher-decorator");var ut=Object.defineProperty,It=Object.getOwnPropertyDescriptor,J=(t,e,r,i)=>{for(var E=i>1?void 0:i?It(e,r):e,c=t.length-1,a;c>=0;c--)(a=t[c])&&(E=(i?a(e,r,E):a(E))||E);return i&&E&&ut(e,r,E),E},U=(t,e)=>(r,i)=>e(r,i,t);exports.CommandClient=class{constructor(e){this.apiMetadata=e}send(e,r){throw n.autoGeneratedError(e,r)}sendAndWaitStream(e,r){throw n.autoGeneratedError(e,r)}};J([n.endpoint(),U(0,n.request()),U(1,n.attribute())],exports.CommandClient.prototype,"send",1);J([n.endpoint(void 0,void 0,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),U(0,n.request()),U(1,n.attribute())],exports.CommandClient.prototype,"sendAndWaitStream",1);exports.CommandClient=J([n.api()],exports.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.SPACE_ID=`${s.COMMAND_HEADERS_PREFIX}Space-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 B=s;var z=(t=>(t.SENT="SENT",t.PROCESSED="PROCESSED",t.SNAPSHOT="SNAPSHOT",t.PROJECTED="PROJECTED",t.EVENT_HANDLED="EVENT_HANDLED",t.SAGA_HANDLED="SAGA_HANDLED",t))(z||{}),o=(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.SPACE_ID="SPACE_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))(o||{});const St=new Set(["AND","OR","NOR"]),Nt=new Set(["NULL","NOT_NULL","TRUE","FALSE","EXISTS","TODAY","TOMORROW","THIS_WEEK","NEXT_WEEK","LAST_WEEK","THIS_MONTH","LAST_MONTH"]);function w(t){return!!t}const P=class P{};P.IGNORE_CASE_OPTION_KEY="ignoreCase",P.ZONE_ID_OPTION_KEY="zoneId",P.DATE_PATTERN_OPTION_KEY="datePattern";let Q=P;function $(t){if(!(typeof t>"u"))return{ignoreCase:t}}function O(t,e){if(typeof t>"u"&&typeof e>"u")return;const r={};return typeof t<"u"&&(r.datePattern=t),typeof e<"u"&&(r.zoneId=e),r}var Z=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(Z||{});function m(...t){if(t.length===0)return _();if(t.length===1)return w(t[0])?t[0]:_();const e=[];return t.forEach(r=>{r?.operator===o.ALL||!w(r)||(r.operator===o.AND&&r.children?e.push(...r.children):e.push(r))}),{operator:o.AND,children:e}}function Rt(...t){const e=t?.filter(r=>w(r));return e.length===0?_():{operator:o.OR,children:e}}function Ot(...t){return t.length===0?_():{operator:o.NOR,children:t}}function lt(t){return{operator:o.ID,value:t}}function Dt(t){return{operator:o.IDS,value:t}}function Y(t){return{operator:o.AGGREGATE_ID,value:t}}function H(t){return{operator:o.AGGREGATE_IDS,value:t}}function _t(t){return{operator:o.TENANT_ID,value:t}}function Lt(t){return{operator:o.OWNER_ID,value:t}}function ht(t){return{operator:o.SPACE_ID,value:t}}function k(t){return{operator:o.DELETED,value:t}}function pt(){return k("ACTIVE")}function _(){return{operator:o.ALL}}function Ct(t,e){return{field:t,operator:o.EQ,value:e}}function gt(t,e){return{field:t,operator:o.NE,value:e}}function tt(t,e){return{field:t,operator:o.GT,value:e}}function et(t,e){return{field:t,operator:o.LT,value:e}}function ft(t,e){return{field:t,operator:o.GTE,value:e}}function yt(t,e){return{field:t,operator:o.LTE,value:e}}function Gt(t,e,r){const i=$(r);return{field:t,operator:o.CONTAINS,value:e,options:i}}function Mt(t,...e){return{field:t,operator:o.IN,value:e}}function Pt(t,...e){return{field:t,operator:o.NOT_IN,value:e}}function dt(t,e,r){return{field:t,operator:o.BETWEEN,value:[e,r]}}function Wt(t,...e){return{field:t,operator:o.ALL_IN,value:e}}function vt(t,e,r){const i=$(r);return{field:t,operator:o.STARTS_WITH,value:e,options:i}}function Ut(t,e,r){const i=$(r);return{field:t,operator:o.ENDS_WITH,value:e,options:i}}function wt(t,e){return{field:t,operator:o.ELEM_MATCH,children:[e]}}function bt(t){return{field:t,operator:o.NULL}}function $t(t){return{field:t,operator:o.NOT_NULL}}function Vt(t){return{field:t,operator:o.TRUE}}function Xt(t){return{field:t,operator:o.FALSE}}function Bt(t,e=!0){return{field:t,operator:o.EXISTS,value:e}}function Qt(t,e,r){const i=O(e,r);return{field:t,operator:o.TODAY,options:i}}function Yt(t,e,r,i){const E=O(r,i);return{field:t,operator:o.BEFORE_TODAY,value:e,options:E}}function Ht(t,e,r){const i=O(e,r);return{field:t,operator:o.TOMORROW,options:i}}function Ft(t,e,r){const i=O(e,r);return{field:t,operator:o.THIS_WEEK,options:i}}function xt(t,e,r){const i=O(e,r);return{field:t,operator:o.NEXT_WEEK,options:i}}function qt(t,e,r){const i=O(e,r);return{field:t,operator:o.LAST_WEEK,options:i}}function jt(t,e,r){const i=O(e,r);return{field:t,operator:o.THIS_MONTH,options:i}}function Kt(t,e,r){const i=O(e,r);return{field:t,operator:o.LAST_MONTH,options:i}}function Jt(t,e,r,i){const E=O(r,i);return{field:t,operator:o.RECENT_DAYS,value:e,options:E}}function zt(t,e,r,i){const E=O(r,i);return{field:t,operator:o.EARLIER_DAYS,value:e,options:E}}function Zt(t){return{operator:o.RAW,value:t}}const g={index:1,size:10};function mt({index:t=g.index,size:e=g.size}=g){return{index:t,size:e}}const rt={};function it(){return rt}function kt({include:t,exclude:e}=it()){return{include:t,exclude:e}}function F({condition:t=_(),projection:e,sort:r}={}){return{condition:t,projection:e,sort:r}}function x({condition:t=_(),projection:e,sort:r,limit:i=g.size}={}){return{condition:t,projection:e,sort:r,limit:i}}function te({condition:t=_(),projection:e,sort:r,pagination:i=g}={}){return{condition:t,projection:e,sort:r,pagination:i}}const nt={total:0,list:[]};function ee({total:t,list:e=[]}=nt){return t===void 0&&(t=e.length),{total:t,list:e}}var d=(t=>(t.ASC="ASC",t.DESC="DESC",t))(d||{});function re(t){return{field:t,direction:"ASC"}}function ie(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.SPACE_ID="spaceId",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 q=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 C=l;var ne=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,v=(t,e,r,i)=>{for(var E=i>1?void 0:i?Ee(e,r):e,c=t.length-1,a;c>=0;c--)(a=t[c])&&(E=(i?a(e,r,E):a(E))||E);return i&&E&&ne(e,r,E),E},L=(t,e)=>(r,i)=>e(r,i,t);exports.EventStreamQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r,i){throw n.autoGeneratedError(e,r,i)}list(e,r,i){throw n.autoGeneratedError(e,r,i)}listStream(e,r,i){throw n.autoGeneratedError(e,r,i)}paged(e,r,i){throw n.autoGeneratedError(e,r,i)}};v([n.post(C.COUNT),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"count",1);v([n.post(C.LIST),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"list",1);v([n.post(C.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"listStream",1);v([n.post(C.PAGED),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"paged",1);exports.EventStreamQueryClient=v([n.api()],exports.EventStreamQueryClient);const S=class S{};S.VERSION="version",S.TENANT_ID="tenantId",S.OWNER_ID="ownerId",S.SPACE_ID="spaceId",S.EVENT_ID="eventId",S.FIRST_EVENT_TIME="firstEventTime",S.EVENT_TIME="eventTime",S.FIRST_OPERATOR="firstOperator",S.OPERATOR="operator",S.SNAPSHOT_TIME="snapshotTime",S.DELETED="deleted",S.STATE="state";let j=S;const I=class I{};I.SNAPSHOT_RESOURCE_NAME="snapshot",I.COUNT=`${I.SNAPSHOT_RESOURCE_NAME}/count`,I.LIST=`${I.SNAPSHOT_RESOURCE_NAME}/list`,I.LIST_STATE=`${I.LIST}/state`,I.PAGED=`${I.SNAPSHOT_RESOURCE_NAME}/paged`,I.PAGED_STATE=`${I.PAGED}/state`,I.SINGLE=`${I.SNAPSHOT_RESOURCE_NAME}/single`,I.SINGLE_STATE=`${I.SINGLE}/state`;let R=I;var se=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,N=(t,e,r,i)=>{for(var E=i>1?void 0:i?oe(e,r):e,c=t.length-1,a;c>=0;c--)(a=t[c])&&(E=(i?a(e,r,E):a(E))||E);return i&&E&&se(e,r,E),E},u=(t,e)=>(r,i)=>e(r,i,t);exports.SnapshotQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r,i){throw n.autoGeneratedError(e,r,i)}list(e,r,i){throw n.autoGeneratedError(e,r,i)}listStream(e,r,i){throw n.autoGeneratedError(e,r,i)}listState(e,r,i){throw n.autoGeneratedError(e,r,i)}listStateStream(e,r,i){throw n.autoGeneratedError(e,r,i)}paged(e,r,i){throw n.autoGeneratedError(e,r,i)}pagedState(e,r,i){throw n.autoGeneratedError(e,r,i)}single(e,r,i){throw n.autoGeneratedError(e,r,i)}singleState(e,r,i){throw n.autoGeneratedError(e,r,i)}getById(e,r,i){const E=F({condition:Y(e)});return this.single(E,r,i)}getStateById(e,r,i){const E=F({condition:Y(e)});return this.singleState(E,r,i)}getByIds(e,r,i){const E=x({condition:H(e),limit:e.length});return this.list(E,r,i)}getStateByIds(e,r,i){const E=x({condition:H(e),limit:e.length});return this.listState(E,r,i)}};N([n.post(R.COUNT),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"count",1);N([n.post(R.LIST),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"list",1);N([n.post(R.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"listStream",1);N([n.post(R.LIST_STATE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"listState",1);N([n.post(R.LIST_STATE,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"listStateStream",1);N([n.post(R.PAGED),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"paged",1);N([n.post(R.PAGED_STATE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"pagedState",1);N([n.post(R.SINGLE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"single",1);N([n.post(R.SINGLE_STATE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"singleState",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getById",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getStateById",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getByIds",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getStateByIds",1);exports.SnapshotQueryClient=N([n.api()],exports.SnapshotQueryClient);var ae=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,V=(t,e,r,i)=>{for(var E=i>1?void 0:i?Te(e,r):e,c=t.length-1,a;c>=0;c--)(a=t[c])&&(E=(i?a(e,r,E):a(E))||E);return i&&E&&ae(e,r,E),E},D=(t,e)=>(r,i)=>e(r,i,t);const h=class h{};h.LOAD="{id}/state",h.LOAD_VERSIONED=`${h.LOAD}/{version}`,h.LOAD_TIME_BASED=`${h.LOAD}/time/{createTime}`;let y=h;exports.LoadStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e,r,i){throw n.autoGeneratedError(e,r,i)}loadVersioned(e,r,i,E){throw n.autoGeneratedError(e,r,i,E)}loadTimeBased(e,r,i,E){throw n.autoGeneratedError(e,r,i,E)}};V([n.get(y.LOAD),D(0,n.path("id")),D(1,n.attribute())],exports.LoadStateAggregateClient.prototype,"load",1);V([n.get(y.LOAD_VERSIONED),D(0,n.path("id")),D(1,n.path("version")),D(2,n.attribute())],exports.LoadStateAggregateClient.prototype,"loadVersioned",1);V([n.get(y.LOAD_TIME_BASED),D(0,n.path("id")),D(1,n.path("createTime")),D(2,n.attribute())],exports.LoadStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadStateAggregateClient=V([n.api()],exports.LoadStateAggregateClient);var Ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,X=(t,e,r,i)=>{for(var E=i>1?void 0:i?ce(e,r):e,c=t.length-1,a;c>=0;c--)(a=t[c])&&(E=(i?a(e,r,E):a(E))||E);return i&&E&&Ae(e,r,E),E},W=(t,e)=>(r,i)=>e(r,i,t);const p=class p{};p.LOAD="state",p.LOAD_VERSIONED=`${p.LOAD}/{version}`,p.LOAD_TIME_BASED=`${p.LOAD}/time/{createTime}`;let G=p;exports.LoadOwnerStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e,r){throw n.autoGeneratedError(e,r)}loadVersioned(e,r,i){throw n.autoGeneratedError(e,r,i)}loadTimeBased(e,r,i){throw n.autoGeneratedError(e,r,i)}};X([n.get(G.LOAD),W(0,n.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"load",1);X([n.get(G.LOAD_VERSIONED),W(0,n.path("version")),W(1,n.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadVersioned",1);X([n.get(G.LOAD_TIME_BASED),W(0,n.path("createTime")),W(1,n.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadOwnerStateAggregateClient=X([n.api()],exports.LoadOwnerStateAggregateClient);const Et="~";function st({field:t,cursorId:e=Et,direction:r=d.DESC}){return r===d.ASC?tt(t,e):et(t,e)}function ot({field:t,direction:e=d.DESC}){return{field:t,direction:e}}function ue(t){const e=t.query,r=m(st(t),e.condition),i=ot(t);return{...e,condition:r,sort:[i]}}function M(t){let e=f.combineURLs(t.resourceAttribution??"",t.aggregateName??"");return t.contextAlias&&(e=f.combineURLs(t.contextAlias,e)),{...t,basePath:e}}class Ie{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.SnapshotQueryClient(r)}createLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadStateAggregateClient(r)}createOwnerLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadOwnerStateAggregateClient(r)}createEventStreamQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.EventStreamQueryClient(r)}}var at=(t=>(t.NONE="",t.TENANT="/tenant/{tenantId}",t.OWNER="/owner/{ownerId}",t.TENANT_OWNER="/tenant/{tenantId}/owner/{ownerId}",t))(at||{}),Tt=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(Tt||{});const 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.ILLEGAL_ACCESS_SPACE_AGGREGATE="IllegalAccessSpaceAggregate",A.INTERNAL_SERVER_ERROR="InternalServerError";let K=A;var At=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(At||{});const Se="";var ct=(t=>(t.MAP="MAP",t.STRING="STRING",t))(ct||{});function Ne(t,e,r){if(t==null)return r;const i=Array.isArray(e)?e:e.split(".").filter(Boolean);if(i.length===0)return t;let E=t;for(const c of i){if(Array.isArray(E)){const a=parseInt(c,10);if(isNaN(a)||a<0||!Number.isInteger(a))return r;E=E[a]}else if(typeof E=="object")E=E[c];else return r;if(E==null)return r}return E}exports.CURSOR_ID_START=Et;exports.CommandHeaders=B;exports.CommandStage=z;exports.ConditionOptionKey=Q;exports.DEFAULT_OWNER_ID=Se;exports.DEFAULT_PAGINATION=g;exports.DEFAULT_PROJECTION=rt;exports.DeletionState=Z;exports.DomainEventStreamMetadataFields=q;exports.EMPTY_PAGED_LIST=nt;exports.EMPTY_VALUE_OPERATORS=Nt;exports.ErrorCodes=K;exports.EventStreamQueryEndpointPaths=C;exports.FunctionKind=At;exports.LOGICAL_OPERATORS=St;exports.LoadOwnerStateAggregateEndpointPaths=G;exports.LoadStateAggregateEndpointPaths=y;exports.MessageHeaderSqlType=ct;exports.Operator=o;exports.QueryClientFactory=Ie;exports.RecoverableType=Tt;exports.ResourceAttributionPathSpec=at;exports.SnapshotMetadataFields=j;exports.SnapshotQueryEndpointPaths=R;exports.SortDirection=d;exports.active=pt;exports.aggregateId=Y;exports.aggregateIds=H;exports.all=_;exports.allIn=Wt;exports.and=m;exports.asc=re;exports.beforeToday=Yt;exports.between=dt;exports.contains=Gt;exports.createQueryApiMetadata=M;exports.cursorCondition=st;exports.cursorQuery=ue;exports.cursorSort=ot;exports.dateOptions=O;exports.defaultProjection=it;exports.deleted=k;exports.desc=ie;exports.earlierDays=zt;exports.elemMatch=wt;exports.endsWith=Ut;exports.eq=Ct;exports.exists=Bt;exports.getPropertyValue=Ne;exports.gt=tt;exports.gte=ft;exports.id=lt;exports.ids=Dt;exports.ignoreCaseOptions=$;exports.isFalse=Xt;exports.isIn=Mt;exports.isNull=bt;exports.isTrue=Vt;exports.isValidateCondition=w;exports.lastMonth=Kt;exports.lastWeek=qt;exports.listQuery=x;exports.lt=et;exports.lte=yt;exports.ne=gt;exports.nextWeek=xt;exports.nor=Ot;exports.notIn=Pt;exports.notNull=$t;exports.or=Rt;exports.ownerId=Lt;exports.pagedList=ee;exports.pagedQuery=te;exports.pagination=mt;exports.projection=kt;exports.raw=Zt;exports.recentDays=Jt;exports.singleQuery=F;exports.spaceId=ht;exports.startsWith=vt;exports.tenantId=_t;exports.thisMonth=jt;exports.thisWeek=Ft;exports.today=Qt;exports.tomorrow=Ht;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@ahoo-wang/fetcher"),b=require("@ahoo-wang/fetcher-eventstream"),n=require("@ahoo-wang/fetcher-decorator");var ut=Object.defineProperty,It=Object.getOwnPropertyDescriptor,J=(t,e,r,i)=>{for(var E=i>1?void 0:i?It(e,r):e,c=t.length-1,A;c>=0;c--)(A=t[c])&&(E=(i?A(e,r,E):A(E))||E);return i&&E&&ut(e,r,E),E},U=(t,e)=>(r,i)=>e(r,i,t);exports.CommandClient=class{constructor(e){this.apiMetadata=e}send(e,r){throw n.autoGeneratedError(e,r)}sendAndWaitStream(e,r){throw n.autoGeneratedError(e,r)}};J([n.endpoint(),U(0,n.request()),U(1,n.attribute())],exports.CommandClient.prototype,"send",1);J([n.endpoint(void 0,void 0,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),U(0,n.request()),U(1,n.attribute())],exports.CommandClient.prototype,"sendAndWaitStream",1);exports.CommandClient=J([n.api()],exports.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.SPACE_ID=`${s.COMMAND_HEADERS_PREFIX}Space-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 X=s;var z=(t=>(t.SENT="SENT",t.PROCESSED="PROCESSED",t.SNAPSHOT="SNAPSHOT",t.PROJECTED="PROJECTED",t.EVENT_HANDLED="EVENT_HANDLED",t.SAGA_HANDLED="SAGA_HANDLED",t))(z||{}),o=(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.SPACE_ID="SPACE_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))(o||{});const St=new Set(["AND","OR","NOR"]),Nt=new Set(["NULL","NOT_NULL","TRUE","FALSE","EXISTS","TODAY","TOMORROW","THIS_WEEK","NEXT_WEEK","LAST_WEEK","THIS_MONTH","LAST_MONTH"]);function w(t){return!!t}const P=class P{};P.IGNORE_CASE_OPTION_KEY="ignoreCase",P.ZONE_ID_OPTION_KEY="zoneId",P.DATE_PATTERN_OPTION_KEY="datePattern";let Q=P;function $(t){if(!(typeof t>"u"))return{ignoreCase:t}}function O(t,e){if(typeof t>"u"&&typeof e>"u")return;const r={};return typeof t<"u"&&(r.datePattern=t),typeof e<"u"&&(r.zoneId=e),r}var Z=(t=>(t.ACTIVE="ACTIVE",t.DELETED="DELETED",t.ALL="ALL",t))(Z||{});function m(...t){if(t.length===0)return _();if(t.length===1)return w(t[0])?t[0]:_();const e=[];return t.forEach(r=>{r?.operator===o.ALL||!w(r)||(r.operator===o.AND&&r.children?e.push(...r.children):e.push(r))}),{operator:o.AND,children:e}}function Rt(...t){const e=t?.filter(r=>w(r));return e.length===0?_():{operator:o.OR,children:e}}function Ot(...t){return t.length===0?_():{operator:o.NOR,children:t}}function lt(t){return{operator:o.ID,value:t}}function Dt(t){return{operator:o.IDS,value:t}}function Y(t){return{operator:o.AGGREGATE_ID,value:t}}function H(t){return{operator:o.AGGREGATE_IDS,value:t}}function _t(t){return{operator:o.TENANT_ID,value:t}}function Lt(t){return{operator:o.OWNER_ID,value:t}}function ht(t){return{operator:o.SPACE_ID,value:t}}function k(t){return{operator:o.DELETED,value:t}}function pt(){return k("ACTIVE")}function _(){return{operator:o.ALL}}function Ct(t,e){return{field:t,operator:o.EQ,value:e}}function gt(t,e){return{field:t,operator:o.NE,value:e}}function tt(t,e){return{field:t,operator:o.GT,value:e}}function et(t,e){return{field:t,operator:o.LT,value:e}}function ft(t,e){return{field:t,operator:o.GTE,value:e}}function Gt(t,e){return{field:t,operator:o.LTE,value:e}}function yt(t,e,r){const i=$(r);return{field:t,operator:o.CONTAINS,value:e,options:i}}function Mt(t,...e){return{field:t,operator:o.IN,value:e}}function Pt(t,...e){return{field:t,operator:o.NOT_IN,value:e}}function Wt(t,e,r){return{field:t,operator:o.BETWEEN,value:[e,r]}}function dt(t,...e){return{field:t,operator:o.ALL_IN,value:e}}function vt(t,e,r){const i=$(r);return{field:t,operator:o.STARTS_WITH,value:e,options:i}}function Ut(t,e,r){const i=$(r);return{field:t,operator:o.ENDS_WITH,value:e,options:i}}function wt(t,e){return{field:t,operator:o.ELEM_MATCH,children:[e]}}function bt(t){return{field:t,operator:o.NULL}}function $t(t){return{field:t,operator:o.NOT_NULL}}function Vt(t){return{field:t,operator:o.TRUE}}function Bt(t){return{field:t,operator:o.FALSE}}function Xt(t,e=!0){return{field:t,operator:o.EXISTS,value:e}}function Qt(t,e,r){const i=O(e,r);return{field:t,operator:o.TODAY,options:i}}function Yt(t,e,r,i){const E=O(r,i);return{field:t,operator:o.BEFORE_TODAY,value:e,options:E}}function Ht(t,e,r){const i=O(e,r);return{field:t,operator:o.TOMORROW,options:i}}function Ft(t,e,r){const i=O(e,r);return{field:t,operator:o.THIS_WEEK,options:i}}function xt(t,e,r){const i=O(e,r);return{field:t,operator:o.NEXT_WEEK,options:i}}function qt(t,e,r){const i=O(e,r);return{field:t,operator:o.LAST_WEEK,options:i}}function jt(t,e,r){const i=O(e,r);return{field:t,operator:o.THIS_MONTH,options:i}}function Kt(t,e,r){const i=O(e,r);return{field:t,operator:o.LAST_MONTH,options:i}}function Jt(t,e,r,i){const E=O(r,i);return{field:t,operator:o.RECENT_DAYS,value:e,options:E}}function zt(t,e,r,i){const E=O(r,i);return{field:t,operator:o.EARLIER_DAYS,value:e,options:E}}function Zt(t){return{operator:o.RAW,value:t}}const g={index:1,size:10};function mt({index:t=g.index,size:e=g.size}=g){return{index:t,size:e}}const rt={};function it(){return rt}function kt({include:t,exclude:e}=it()){return{include:t,exclude:e}}function F({condition:t=_(),projection:e,sort:r}={}){return{condition:t,projection:e,sort:r}}function x({condition:t=_(),projection:e,sort:r,limit:i=g.size}={}){return{condition:t,projection:e,sort:r,limit:i}}function te({condition:t=_(),projection:e,sort:r,pagination:i=g}={}){return{condition:t,projection:e,sort:r,pagination:i}}const nt={total:0,list:[]};function ee({total:t,list:e=[]}=nt){return t===void 0&&(t=e.length),{total:t,list:e}}var W=(t=>(t.ASC="ASC",t.DESC="DESC",t))(W||{});function re(t){return{field:t,direction:"ASC"}}function ie(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.SPACE_ID="spaceId",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 q=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 C=l;var ne=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,v=(t,e,r,i)=>{for(var E=i>1?void 0:i?Ee(e,r):e,c=t.length-1,A;c>=0;c--)(A=t[c])&&(E=(i?A(e,r,E):A(E))||E);return i&&E&&ne(e,r,E),E},L=(t,e)=>(r,i)=>e(r,i,t);exports.EventStreamQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r,i){throw n.autoGeneratedError(e,r,i)}list(e,r,i){throw n.autoGeneratedError(e,r,i)}listStream(e,r,i){throw n.autoGeneratedError(e,r,i)}paged(e,r,i){throw n.autoGeneratedError(e,r,i)}};v([n.post(C.COUNT),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"count",1);v([n.post(C.LIST),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"list",1);v([n.post(C.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"listStream",1);v([n.post(C.PAGED),L(0,n.body()),L(1,n.attribute())],exports.EventStreamQueryClient.prototype,"paged",1);exports.EventStreamQueryClient=v([n.api()],exports.EventStreamQueryClient);const S=class S{};S.VERSION="version",S.TENANT_ID="tenantId",S.OWNER_ID="ownerId",S.SPACE_ID="spaceId",S.EVENT_ID="eventId",S.FIRST_EVENT_TIME="firstEventTime",S.EVENT_TIME="eventTime",S.FIRST_OPERATOR="firstOperator",S.OPERATOR="operator",S.SNAPSHOT_TIME="snapshotTime",S.TAGS="tags",S.DELETED="deleted",S.STATE="state";let j=S;const I=class I{};I.SNAPSHOT_RESOURCE_NAME="snapshot",I.COUNT=`${I.SNAPSHOT_RESOURCE_NAME}/count`,I.LIST=`${I.SNAPSHOT_RESOURCE_NAME}/list`,I.LIST_STATE=`${I.LIST}/state`,I.PAGED=`${I.SNAPSHOT_RESOURCE_NAME}/paged`,I.PAGED_STATE=`${I.PAGED}/state`,I.SINGLE=`${I.SNAPSHOT_RESOURCE_NAME}/single`,I.SINGLE_STATE=`${I.SINGLE}/state`;let R=I;var se=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,N=(t,e,r,i)=>{for(var E=i>1?void 0:i?oe(e,r):e,c=t.length-1,A;c>=0;c--)(A=t[c])&&(E=(i?A(e,r,E):A(E))||E);return i&&E&&se(e,r,E),E},u=(t,e)=>(r,i)=>e(r,i,t);exports.SnapshotQueryClient=class{constructor(e){this.apiMetadata=e}count(e,r,i){throw n.autoGeneratedError(e,r,i)}list(e,r,i){throw n.autoGeneratedError(e,r,i)}listStream(e,r,i){throw n.autoGeneratedError(e,r,i)}listState(e,r,i){throw n.autoGeneratedError(e,r,i)}listStateStream(e,r,i){throw n.autoGeneratedError(e,r,i)}paged(e,r,i){throw n.autoGeneratedError(e,r,i)}pagedState(e,r,i){throw n.autoGeneratedError(e,r,i)}single(e,r,i){throw n.autoGeneratedError(e,r,i)}singleState(e,r,i){throw n.autoGeneratedError(e,r,i)}getById(e,r,i){const E=F({condition:Y(e)});return this.single(E,r,i)}getStateById(e,r,i){const E=F({condition:Y(e)});return this.singleState(E,r,i)}getByIds(e,r,i){const E=x({condition:H(e),limit:e.length});return this.list(E,r,i)}getStateByIds(e,r,i){const E=x({condition:H(e),limit:e.length});return this.listState(E,r,i)}};N([n.post(R.COUNT),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"count",1);N([n.post(R.LIST),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"list",1);N([n.post(R.LIST,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"listStream",1);N([n.post(R.LIST_STATE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"listState",1);N([n.post(R.LIST_STATE,{headers:{Accept:f.ContentTypeValues.TEXT_EVENT_STREAM},resultExtractor:b.JsonEventStreamResultExtractor}),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"listStateStream",1);N([n.post(R.PAGED),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"paged",1);N([n.post(R.PAGED_STATE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"pagedState",1);N([n.post(R.SINGLE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"single",1);N([n.post(R.SINGLE_STATE),u(0,n.body()),u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"singleState",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getById",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getStateById",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getByIds",1);N([u(1,n.attribute())],exports.SnapshotQueryClient.prototype,"getStateByIds",1);exports.SnapshotQueryClient=N([n.api()],exports.SnapshotQueryClient);var Ae=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,V=(t,e,r,i)=>{for(var E=i>1?void 0:i?Te(e,r):e,c=t.length-1,A;c>=0;c--)(A=t[c])&&(E=(i?A(e,r,E):A(E))||E);return i&&E&&Ae(e,r,E),E},D=(t,e)=>(r,i)=>e(r,i,t);const h=class h{};h.LOAD="{id}/state",h.LOAD_VERSIONED=`${h.LOAD}/{version}`,h.LOAD_TIME_BASED=`${h.LOAD}/time/{createTime}`;let G=h;exports.LoadStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e,r,i){throw n.autoGeneratedError(e,r,i)}loadVersioned(e,r,i,E){throw n.autoGeneratedError(e,r,i,E)}loadTimeBased(e,r,i,E){throw n.autoGeneratedError(e,r,i,E)}};V([n.get(G.LOAD),D(0,n.path("id")),D(1,n.attribute())],exports.LoadStateAggregateClient.prototype,"load",1);V([n.get(G.LOAD_VERSIONED),D(0,n.path("id")),D(1,n.path("version")),D(2,n.attribute())],exports.LoadStateAggregateClient.prototype,"loadVersioned",1);V([n.get(G.LOAD_TIME_BASED),D(0,n.path("id")),D(1,n.path("createTime")),D(2,n.attribute())],exports.LoadStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadStateAggregateClient=V([n.api()],exports.LoadStateAggregateClient);var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,B=(t,e,r,i)=>{for(var E=i>1?void 0:i?ce(e,r):e,c=t.length-1,A;c>=0;c--)(A=t[c])&&(E=(i?A(e,r,E):A(E))||E);return i&&E&&ae(e,r,E),E},d=(t,e)=>(r,i)=>e(r,i,t);const p=class p{};p.LOAD="state",p.LOAD_VERSIONED=`${p.LOAD}/{version}`,p.LOAD_TIME_BASED=`${p.LOAD}/time/{createTime}`;let y=p;exports.LoadOwnerStateAggregateClient=class{constructor(e){this.apiMetadata=e}load(e,r){throw n.autoGeneratedError(e,r)}loadVersioned(e,r,i){throw n.autoGeneratedError(e,r,i)}loadTimeBased(e,r,i){throw n.autoGeneratedError(e,r,i)}};B([n.get(y.LOAD),d(0,n.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"load",1);B([n.get(y.LOAD_VERSIONED),d(0,n.path("version")),d(1,n.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadVersioned",1);B([n.get(y.LOAD_TIME_BASED),d(0,n.path("createTime")),d(1,n.attribute())],exports.LoadOwnerStateAggregateClient.prototype,"loadTimeBased",1);exports.LoadOwnerStateAggregateClient=B([n.api()],exports.LoadOwnerStateAggregateClient);const Et="~";function st({field:t,cursorId:e=Et,direction:r=W.DESC}){return r===W.ASC?tt(t,e):et(t,e)}function ot({field:t,direction:e=W.DESC}){return{field:t,direction:e}}function ue(t){const e=t.query,r=m(st(t),e.condition),i=ot(t);return{...e,condition:r,sort:[i]}}function M(t){let e=f.combineURLs(t.resourceAttribution??"",t.aggregateName??"");return t.contextAlias&&(e=f.combineURLs(t.contextAlias,e)),{...t,basePath:e}}class Ie{constructor(e){this.defaultOptions=e}createSnapshotQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.SnapshotQueryClient(r)}createLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadStateAggregateClient(r)}createOwnerLoadStateAggregateClient(e){const r=M({...this.defaultOptions,...e});return new exports.LoadOwnerStateAggregateClient(r)}createEventStreamQueryClient(e){const r=M({...this.defaultOptions,...e});return new exports.EventStreamQueryClient(r)}}const Se={},Ne=["*"];var At=(t=>(t.NONE="",t.TENANT="/tenant/{tenantId}",t.OWNER="/owner/{ownerId}",t.TENANT_OWNER="/tenant/{tenantId}/owner/{ownerId}",t))(At||{}),Tt=(t=>(t.RECOVERABLE="RECOVERABLE",t.UNKNOWN="UNKNOWN",t.UNRECOVERABLE="UNRECOVERABLE",t))(Tt||{});const 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.ILLEGAL_ACCESS_SPACE_AGGREGATE="IllegalAccessSpaceAggregate",a.INTERNAL_SERVER_ERROR="InternalServerError";let K=a;var at=(t=>(t.COMMAND="COMMAND",t.ERROR="ERROR",t.EVENT="EVENT",t.SOURCING="SOURCING",t.STATE_EVENT="STATE_EVENT",t))(at||{});const Re="";var ct=(t=>(t.MAP="MAP",t.STRING="STRING",t))(ct||{});function Oe(t,e,r){if(t==null)return r;const i=Array.isArray(e)?e:e.split(".").filter(Boolean);if(i.length===0)return t;let E=t;for(const c of i){if(Array.isArray(E)){const A=parseInt(c,10);if(isNaN(A)||A<0||!Number.isInteger(A))return r;E=E[A]}else if(typeof E=="object")E=E[c];else return r;if(E==null)return r}return E}exports.CURSOR_ID_START=Et;exports.CommandHeaders=X;exports.CommandStage=z;exports.ConditionOptionKey=Q;exports.DEFAULT_OWNER_ID=Re;exports.DEFAULT_PAGINATION=g;exports.DEFAULT_PROJECTION=rt;exports.DeletionState=Z;exports.DomainEventStreamMetadataFields=q;exports.EMPTY_ABAC_TAGS=Se;exports.EMPTY_PAGED_LIST=nt;exports.EMPTY_VALUE_OPERATORS=Nt;exports.ErrorCodes=K;exports.EventStreamQueryEndpointPaths=C;exports.FunctionKind=at;exports.LOGICAL_OPERATORS=St;exports.LoadOwnerStateAggregateEndpointPaths=y;exports.LoadStateAggregateEndpointPaths=G;exports.MessageHeaderSqlType=ct;exports.Operator=o;exports.QueryClientFactory=Ie;exports.RecoverableType=Tt;exports.ResourceAttributionPathSpec=At;exports.SnapshotMetadataFields=j;exports.SnapshotQueryEndpointPaths=R;exports.SortDirection=W;exports.WILDCARD_ABAC_TAG_VALUES=Ne;exports.active=pt;exports.aggregateId=Y;exports.aggregateIds=H;exports.all=_;exports.allIn=dt;exports.and=m;exports.asc=re;exports.beforeToday=Yt;exports.between=Wt;exports.contains=yt;exports.createQueryApiMetadata=M;exports.cursorCondition=st;exports.cursorQuery=ue;exports.cursorSort=ot;exports.dateOptions=O;exports.defaultProjection=it;exports.deleted=k;exports.desc=ie;exports.earlierDays=zt;exports.elemMatch=wt;exports.endsWith=Ut;exports.eq=Ct;exports.exists=Xt;exports.getPropertyValue=Oe;exports.gt=tt;exports.gte=ft;exports.id=lt;exports.ids=Dt;exports.ignoreCaseOptions=$;exports.isFalse=Bt;exports.isIn=Mt;exports.isNull=bt;exports.isTrue=Vt;exports.isValidateCondition=w;exports.lastMonth=Kt;exports.lastWeek=qt;exports.listQuery=x;exports.lt=et;exports.lte=Gt;exports.ne=gt;exports.nextWeek=xt;exports.nor=Ot;exports.notIn=Pt;exports.notNull=$t;exports.or=Rt;exports.ownerId=Lt;exports.pagedList=ee;exports.pagedQuery=te;exports.pagination=mt;exports.projection=kt;exports.raw=Zt;exports.recentDays=Jt;exports.singleQuery=F;exports.spaceId=ht;exports.startsWith=vt;exports.tenantId=_t;exports.thisMonth=jt;exports.thisWeek=Ft;exports.today=Qt;exports.tomorrow=Ht;
2
2
  //# sourceMappingURL=index.cjs.js.map