@ahoo-wang/fetcher-wow 0.11.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/@ahoo-wang/fetcher-wow)
|
|
9
9
|
[](https://deepwiki.com/Ahoo-Wang/fetcher)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
the Wow CQRS/DDD framework.
|
|
11
|
+
Provides TypeScript types and utilities for working with the [Wow](https://github.com/Ahoo-Wang/Wow) CQRS/DDD framework.
|
|
13
12
|
|
|
14
13
|
## 🌟 Features
|
|
15
14
|
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/command/commandHeaders.ts","../src/command/types.ts","../src/query/operator.ts","../src/query/condition.ts","../src/query/queryable.ts","../src/types/error.ts","../src/types/function.ts","../src/types/modeling.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command Header Constants\n *\n * Defines standard HTTP header constants used in command processing within the Wow framework.\n * These headers are used to pass metadata and control information between services.\n *\n * @example\n * ```typescript\n * // Using header constants in a request\n * const request = {\n * method: 'POST',\n * headers: {\n * [CommandHeaders.TENANT_ID]: 'tenant-123',\n * [CommandHeaders.AGGREGATE_ID]: 'aggregate-456',\n * [CommandHeaders.REQUEST_ID]: 'request-789'\n * },\n * body: JSON.stringify(command)\n * };\n * ```\n */\nexport class CommandHeaders {\n /**\n * Prefix for all command-related headers\n */\n static readonly COMMAND_HEADERS_PREFIX = 'Command-';\n\n /**\n * Tenant identifier header\n * Used to identify the tenant context for the command\n */\n static readonly TENANT_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Tenant-Id`;\n\n /**\n * Owner identifier header\n * Used to identify the owner context for the command\n */\n static readonly OWNER_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Owner-Id`;\n\n /**\n * Aggregate identifier header\n * Used to identify the aggregate root for the command\n */\n static readonly AGGREGATE_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Id`;\n\n /**\n * Aggregate version header\n * Used to specify the expected version of the aggregate root\n */\n static readonly AGGREGATE_VERSION = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Version`;\n\n /**\n * Wait prefix for wait-related headers\n */\n static readonly WAIT_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Wait-`;\n\n /**\n * Wait timeout header\n * Specifies the maximum time to wait for command processing\n */\n static readonly WAIT_TIME_OUT = `${CommandHeaders.WAIT_PREFIX}Timeout`;\n\n // region Wait Stage\n /**\n * Wait stage header\n * Specifies the processing stage to wait for\n */\n static readonly WAIT_STAGE = `${CommandHeaders.WAIT_PREFIX}Stage`;\n\n /**\n * Wait context header\n * Specifies the bounded context to wait for\n */\n static readonly WAIT_CONTEXT = `${CommandHeaders.WAIT_PREFIX}Context`;\n\n /**\n * Wait processor header\n * Specifies the processor to wait for\n */\n static readonly WAIT_PROCESSOR = `${CommandHeaders.WAIT_PREFIX}Processor`;\n\n /**\n * Wait function header\n * Specifies the function to wait for\n */\n static readonly WAIT_FUNCTION = `${CommandHeaders.WAIT_PREFIX}Function`;\n // endregion\n\n // region Wait Chain Tail\n /**\n * Wait tail prefix for wait chain tail-related headers\n */\n static readonly WAIT_TAIL_PREFIX = `${CommandHeaders.WAIT_PREFIX}Tail-`;\n\n /**\n * Wait tail stage header\n * Specifies the tail processing stage to wait for\n */\n static readonly WAIT_TAIL_STAGE = `${CommandHeaders.WAIT_TAIL_PREFIX}Stage`;\n\n /**\n * Wait tail context header\n * Specifies the tail bounded context to wait for\n */\n static readonly WAIT_TAIL_CONTEXT = `${CommandHeaders.WAIT_TAIL_PREFIX}Context`;\n\n /**\n * Wait tail processor header\n * Specifies the tail processor to wait for\n */\n static readonly WAIT_TAIL_PROCESSOR = `${CommandHeaders.WAIT_TAIL_PREFIX}Processor`;\n\n /**\n * Wait tail function header\n * Specifies the tail function to wait for\n */\n static readonly WAIT_TAIL_FUNCTION = `${CommandHeaders.WAIT_TAIL_PREFIX}Function`;\n // endregion\n\n /**\n * Request identifier header\n * Used to track the request ID for correlation\n */\n static readonly REQUEST_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Request-Id`;\n\n /**\n * Local first header\n * Indicates whether to prefer local processing\n */\n static readonly LOCAL_FIRST = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Local-First`;\n\n /**\n * Command aggregate context header\n * Specifies the bounded context of the aggregate\n */\n static readonly COMMAND_AGGREGATE_CONTEXT = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Context`;\n\n /**\n * Command aggregate name header\n * Specifies the name of the aggregate\n */\n static readonly COMMAND_AGGREGATE_NAME = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Name`;\n\n /**\n * Command type header\n * Specifies the type of the command\n */\n static readonly COMMAND_TYPE = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Type`;\n\n /**\n * Command header prefix for custom headers\n * Used to prefix custom command headers\n */\n static readonly COMMAND_HEADER_X_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Header-`;\n}","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command identifier interface\n *\n * Represents the unique identifier for a command.\n */\nexport interface CommandId {\n commandId: string;\n}\n\n/**\n * Wait command identifier capable interface\n *\n * Represents the identifier of the command being waited for.\n */\nexport interface WaitCommandIdCapable {\n waitCommandId: string;\n}\n\n/**\n * Request identifier interface\n *\n * Represents the unique identifier for a request, used for idempotency control.\n */\nexport interface RequestId {\n requestId: string;\n}\n\n/**\n * Command execution stage enum\n *\n * Represents the different stages of command execution lifecycle.\n */\nexport enum CommandStage {\n /**\n * When the command is published to the command bus/queue, a completion signal is generated.\n */\n SENT = 'SENT',\n\n /**\n * When the command is processed by the aggregate root, a completion signal is generated.\n */\n PROCESSED = 'PROCESSED',\n\n /**\n * When the snapshot is generated, a completion signal is generated.\n */\n SNAPSHOT = 'SNAPSHOT',\n\n /**\n * When the events generated by the command are *projected*, a completion signal is generated.\n */\n PROJECTED = 'PROJECTED',\n\n /**\n * When the events generated by the command are processed by *event handlers*, a completion signal is generated.\n */\n EVENT_HANDLED = 'EVENT_HANDLED',\n\n /**\n * When the events generated by the command are processed by *Saga*, a completion signal is generated.\n */\n SAGA_HANDLED = 'SAGA_HANDLED',\n}\n\n/**\n * Command stage capable interface\n *\n * Represents an object that has a command execution stage.\n */\nexport interface CommandStageCapable {\n stage: CommandStage;\n}\n\n/**\n * Command result capable interface\n *\n * Represents an object that contains command execution results.\n */\nexport interface CommandResultCapable {\n result: Record<string, any>;\n}\n\n/**\n * Signal time capable interface\n *\n * Represents an object that has a signal time (timestamp).\n */\nexport interface SignalTimeCapable {\n signalTime: number;\n}\n\n/**\n * Nullable aggregate version capable interface\n *\n * Represents an object that may have an aggregate version for optimistic concurrency control.\n */\nexport interface NullableAggregateVersionCapable {\n /**\n * The aggregate version of the aggregate.\n */\n aggregateVersion?: number;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum Operator {\n /**\n * Performs logical AND on the provided condition list\n */\n AND = 'AND',\n\n /**\n * Performs logical OR on the provided condition list\n */\n OR = 'OR',\n\n /**\n * Performs logical NOR on the provided condition list\n */\n NOR = 'NOR',\n\n /**\n * Matches all documents where the `id` field value equals the specified value\n */\n ID = 'ID',\n\n /**\n * Matches all documents where the `id` field value equals any value in the specified list\n */\n IDS = 'IDS',\n\n /**\n * Matches documents where the aggregate root ID equals the specified value\n */\n AGGREGATE_ID = 'AGGREGATE_ID',\n\n /**\n * Matches all documents where the aggregate root ID equals any value in the specified list\n */\n AGGREGATE_IDS = 'AGGREGATE_IDS',\n\n /**\n * Matches all documents where the `tenantId` field value equals the specified value\n */\n TENANT_ID = 'TENANT_ID',\n\n /**\n * Matches all documents where the `ownerId` field value equals the specified value\n */\n OWNER_ID = 'OWNER_ID',\n\n /**\n * Matches all documents where the `deleted` field value equals the specified value\n */\n DELETED = 'DELETED',\n\n /**\n * Matches all documents\n */\n ALL = 'ALL',\n\n /**\n * Matches all documents where the field name value equals the specified value\n */\n EQ = 'EQ',\n\n /**\n * Matches all documents where the field name value does not equal the specified value\n */\n NE = 'NE',\n\n /**\n * Matches all documents where the given field's value is greater than the specified value\n */\n GT = 'GT',\n\n /**\n * Matches all documents where the given field's value is less than the specified value\n */\n LT = 'LT',\n\n /**\n * Matches all documents where the given field's value is greater than or equal to the specified value\n */\n GTE = 'GTE',\n\n /**\n * Matches all documents where the given field's value is less than or equal to the specified value\n */\n LTE = 'LTE',\n\n /**\n * Matches all documents where the given field's value contains the specified value\n */\n CONTAINS = 'CONTAINS',\n\n /**\n * Matches all documents where the field value equals any value in the specified list\n */\n IN = 'IN',\n\n /**\n * Matches all documents where the field value does not equal any specified value or does not exist\n */\n NOT_IN = 'NOT_IN',\n\n /**\n * Matches all documents where the field value is within the specified range\n */\n BETWEEN = 'BETWEEN',\n\n /**\n * Matches all documents where the field value is an array containing all specified values\n */\n ALL_IN = 'ALL_IN',\n\n /**\n * Matches documents where the field value starts with the specified string\n */\n STARTS_WITH = 'STARTS_WITH',\n\n /**\n * Matches documents where the field value ends with the specified string\n */\n ENDS_WITH = 'ENDS_WITH',\n\n /**\n * Matches all documents where the condition includes an array field,\n * and at least one member of the array matches the given condition.\n */\n ELEM_MATCH = 'ELEM_MATCH',\n\n /**\n * Matches all documents where the field value is `null`\n */\n NULL = 'NULL',\n\n /**\n * Matches all documents where the field value is not `null`\n */\n NOT_NULL = 'NOT_NULL',\n\n /**\n * Matches all documents where the field value is `true`\n */\n TRUE = 'TRUE',\n\n /**\n * Matches all documents where the field value is `false`\n */\n FALSE = 'FALSE',\n\n /**\n * Matches documents based on whether the field exists\n */\n EXISTS = 'EXISTS',\n\n // #region Date filtering conditions, field requirement: `long` type timestamp in milliseconds\n /**\n * Matches all documents where the field is within today's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-06 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n */\n TODAY = 'TODAY',\n\n /**\n * Matches all documents where the field is before today\n */\n BEFORE_TODAY = 'BEFORE_TODAY',\n\n /**\n * Matches all documents where the field is within yesterday's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-05 00:00:00.000` ~ `2024-06-05 23:59:59.999`\n */\n TOMORROW = 'TOMORROW',\n\n /**\n * Matches all documents where the field is within this week's range\n */\n THIS_WEEK = 'THIS_WEEK',\n\n /**\n * Matches all documents where the field is within next week's range\n */\n NEXT_WEEK = 'NEXT_WEEK',\n\n /**\n * Matches all documents where the field is within last week's range\n */\n LAST_WEEK = 'LAST_WEEK',\n\n /**\n * Matches all documents where the field is within this month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-01 00:00:00.000` ~ `2024-06-30 23:59:59.999`\n */\n THIS_MONTH = 'THIS_MONTH',\n\n /**\n * Matches all documents where the field is within last month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-05-01 00:00:00.000` ~ `2024-05-31 23:59:59.999`\n */\n LAST_MONTH = 'LAST_MONTH',\n\n /**\n * Matches all documents where the field is within the specified number of recent days\n * > For example: last 3 days\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-04 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n * - That is: today, yesterday, the day before yesterday\n */\n RECENT_DAYS = 'RECENT_DAYS',\n\n /**\n * Matches all documents where the field is before the specified number of days\n *\n * > For example: before 3 days\n * - `today`: `2024-06-06`\n * - Matching range: all documents less than `2024-06-04 00:00:00.000`\n */\n EARLIER_DAYS = 'EARLIER_DAYS',\n // #endregion\n\n /**\n * Raw operator, uses the condition value directly as the raw database query condition\n */\n RAW = 'RAW',\n}","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Operator } from './operator';\n\n/**\n * Condition option keys enumeration\n *\n * Defines standard option keys used in query conditions for special handling.\n */\nexport enum ConditionOptionKey {\n /**\n * Ignore case option key for string comparisons\n */\n IGNORE_CASE_OPTION_KEY = 'ignoreCase',\n\n /**\n * Time zone ID option key for date operations\n */\n ZONE_ID_OPTION_KEY = 'zoneId',\n\n /**\n * Date pattern option key for date formatting\n */\n DATE_PATTERN_OPTION_KEY = 'datePattern',\n}\n\n/**\n * Condition options interface\n *\n * Represents additional options that can be applied to query conditions,\n * such as case sensitivity, date patterns, and time zones.\n */\nexport interface ConditionOptions {\n /**\n * Whether to ignore case in string comparisons\n */\n ignoreCase?: boolean;\n\n /**\n * Date pattern for date formatting\n */\n datePattern?: string;\n\n /**\n * Time zone ID for date operations\n */\n zoneId?: string;\n\n /**\n * Additional custom options\n */\n [key: string]: any;\n}\n\n/**\n * Helper function to create condition options with ignoreCase flag.\n *\n * @param ignoreCase - Whether to ignore case\n * @returns Condition options or undefined if ignoreCase is undefined\n */\nexport function ignoreCaseOptions(\n ignoreCase?: boolean,\n): ConditionOptions | undefined {\n if (typeof ignoreCase === 'undefined') {\n return undefined;\n }\n return { ignoreCase };\n}\n\n/**\n * Helper function to create condition options with date pattern and zone ID.\n *\n * @param datePattern - Date pattern\n * @param zoneId - Time zone ID\n * @returns Condition options or undefined if both parameters are undefined\n */\nexport function dateOptions(\n datePattern?: string,\n zoneId?: string,\n): ConditionOptions | undefined {\n if (typeof datePattern === 'undefined' && typeof zoneId === 'undefined') {\n return undefined;\n }\n const options: ConditionOptions = {};\n if (typeof datePattern !== 'undefined') {\n options.datePattern = datePattern;\n }\n if (typeof zoneId !== 'undefined') {\n options.zoneId = zoneId;\n }\n return options;\n}\n\n/**\n * Interface for query conditions.\n *\n * When `operator` is `AND` or `OR` or `NOR`, `children` cannot be empty.\n */\nexport interface Condition {\n /**\n * Field name for the condition\n */\n field?: string;\n\n /**\n * Operator for the condition\n */\n operator?: Operator;\n\n /**\n * Value for the condition\n */\n value?: any;\n\n /**\n * Child conditions for logical operators (AND, OR, NOR)\n */\n children?: Condition[];\n\n /**\n * Additional options for the condition\n */\n options?: ConditionOptions;\n}\n\n/**\n * Interface for objects that have a condition.\n */\nexport interface ConditionCapable {\n condition: Condition;\n}\n\n/**\n * Deletion state enumeration\n *\n * Represents the different states of deletion for entities.\n */\nexport enum DeletionState {\n /**\n * Active state - entity is not deleted\n */\n ACTIVE = 'ACTIVE',\n\n /**\n * Deleted state - entity is deleted\n */\n DELETED = 'DELETED',\n\n /**\n * All state - includes both active and deleted entities\n */\n ALL = 'ALL',\n}\n\n/**\n * Creates an AND condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with AND\n * @returns A condition with AND operator\n */\nexport function and(...conditions: Condition[]): Condition {\n return { operator: Operator.AND, children: conditions };\n}\n\n/**\n * Creates an OR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with OR\n * @returns A condition with OR operator\n */\nexport function or(...conditions: Condition[]): Condition {\n return { operator: Operator.OR, children: conditions };\n}\n\n/**\n * Creates a NOR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with NOR\n * @returns A condition with NOR operator\n */\nexport function nor(...conditions: Condition[]): Condition {\n return { operator: Operator.NOR, children: conditions };\n}\n\n/**\n * Creates an ID condition with the specified value.\n *\n * @param value - The ID value to match\n * @returns A condition with ID operator\n */\nexport function id(value: string): Condition {\n return { operator: Operator.ID, value: value };\n}\n\n/**\n * Creates an IDS condition with the specified values.\n *\n * @param value - The ID values to match\n * @returns A condition with IDS operator\n */\nexport function ids(value: string[]): Condition {\n return { operator: Operator.IDS, value: value };\n}\n\n/**\n * Creates an AGGREGATE_ID condition with the specified value.\n *\n * @param value - The aggregate ID value to match\n * @returns A condition with AGGREGATE_ID operator\n */\nexport function aggregateId(value: string): Condition {\n return { operator: Operator.AGGREGATE_ID, value: value };\n}\n\n/**\n * Creates an AGGREGATE_IDS condition with the specified values.\n *\n * @param value - The aggregate ID values to match\n * @returns A condition with AGGREGATE_IDS operator\n */\nexport function aggregateIds(...value: string[]): Condition {\n return { operator: Operator.AGGREGATE_IDS, value: value };\n}\n\n/**\n * Creates a TENANT_ID condition with the specified value.\n *\n * @param value - The tenant ID value to match\n * @returns A condition with TENANT_ID operator\n */\nexport function tenantId(value: string): Condition {\n return { operator: Operator.TENANT_ID, value: value };\n}\n\n/**\n * Creates an OWNER_ID condition with the specified value.\n *\n * @param value - The owner ID value to match\n * @returns A condition with OWNER_ID operator\n */\nexport function ownerId(value: string): Condition {\n return { operator: Operator.OWNER_ID, value: value };\n}\n\n/**\n * Creates a DELETED condition with the specified value.\n *\n * @param value - The deletion state value to match\n * @returns A condition with DELETED operator\n */\nexport function deleted(value: DeletionState): Condition {\n return { operator: Operator.DELETED, value: value };\n}\n\n/**\n * Creates an ACTIVE deletion state condition.\n *\n * @returns A condition with DELETED operator set to ACTIVE\n */\nexport function active(): Condition {\n return deleted(DeletionState.ACTIVE);\n}\n\n/**\n * Creates an ALL condition.\n *\n * @returns A condition with ALL operator\n */\nexport function all(): Condition {\n return {\n operator: Operator.ALL,\n };\n}\n\n/**\n * Creates an EQ (equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with EQ operator\n */\nexport function eq(field: string, value: any): Condition {\n return { field, operator: Operator.EQ, value };\n}\n\n/**\n * Creates a NE (not equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with NE operator\n */\nexport function ne(field: string, value: any): Condition {\n return { field, operator: Operator.NE, value };\n}\n\n/**\n * Creates a GT (greater than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GT operator\n */\nexport function gt(field: string, value: any): Condition {\n return { field, operator: Operator.GT, value };\n}\n\n/**\n * Creates a LT (less than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LT operator\n */\nexport function lt(field: string, value: any): Condition {\n return { field, operator: Operator.LT, value };\n}\n\n/**\n * Creates a GTE (greater than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GTE operator\n */\nexport function gte(field: string, value: any): Condition {\n return { field, operator: Operator.GTE, value };\n}\n\n/**\n * Creates a LTE (less than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LTE operator\n */\nexport function lte(field: string, value: any): Condition {\n return { field, operator: Operator.LTE, value };\n}\n\n/**\n * Creates a CONTAINS condition with the specified field and value.\n *\n * @param field - The field name to search in\n * @param value - The value to search for\n * @param ignoreCase - Whether to ignore case in the search\n * @returns A condition with CONTAINS operator\n */\nexport function contains(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.CONTAINS, value, options };\n}\n\n/**\n * Creates an IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with IN operator\n */\nexport function isIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.IN, value };\n}\n\n/**\n * Creates a NOT_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with NOT_IN operator\n */\nexport function notIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.NOT_IN, value };\n}\n\n/**\n * Creates a BETWEEN condition with the specified field and range.\n *\n * @param field - The field name to compare\n * @param start - The start value of the range\n * @param end - The end value of the range\n * @returns A condition with BETWEEN operator\n */\nexport function between(field: string, start: any, end: any): Condition {\n return { field, operator: Operator.BETWEEN, value: [start, end] };\n}\n\n/**\n * Creates an ALL_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with ALL_IN operator\n */\nexport function allIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.ALL_IN, value };\n}\n\n/**\n * Creates a STARTS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with STARTS_WITH operator\n */\nexport function startsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.STARTS_WITH, value, options };\n}\n\n/**\n * Creates an ENDS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with ENDS_WITH operator\n */\nexport function endsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.ENDS_WITH, value, options };\n}\n\n/**\n * Creates an ELEM_MATCH condition with the specified field and child condition.\n *\n * @param field - The field name to match elements in\n * @param value - The condition to match elements against\n * @returns A condition with ELEM_MATCH operator\n */\nexport function elemMatch(field: string, value: Condition): Condition {\n return { field, operator: Operator.ELEM_MATCH, children: [value] };\n}\n\n/**\n * Creates a NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NULL operator\n */\nexport function isNull(field: string): Condition {\n return { field, operator: Operator.NULL };\n}\n\n/**\n * Creates a NOT_NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NOT_NULL operator\n */\nexport function notNull(field: string): Condition {\n return { field, operator: Operator.NOT_NULL };\n}\n\n/**\n * Creates a TRUE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with TRUE operator\n */\nexport function isTrue(field: string): Condition {\n return { field, operator: Operator.TRUE };\n}\n\n/**\n * Creates a FALSE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with FALSE operator\n */\nexport function isFalse(field: string): Condition {\n return { field, operator: Operator.FALSE };\n}\n\n/**\n * Creates an EXISTS condition with the specified field and existence flag.\n *\n * @param field - The field name to check\n * @param exists - Whether the field should exist (default: true)\n * @returns A condition with EXISTS operator\n */\nexport function exists(field: string, exists: boolean = true): Condition {\n return { field, operator: Operator.EXISTS, value: exists };\n}\n\n/**\n * Creates a TODAY condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TODAY operator\n */\nexport function today(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TODAY, options };\n}\n\n/**\n * Creates a BEFORE_TODAY condition with the specified field and time.\n *\n * @param field - The field name to check\n * @param time - The time to compare against\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with BEFORE_TODAY operator\n */\nexport function beforeToday(\n field: string,\n time: any,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.BEFORE_TODAY, value: time, options };\n}\n\n/**\n * Creates a TOMORROW condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TOMORROW operator\n */\nexport function tomorrow(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TOMORROW, options };\n}\n\n/**\n * Creates a THIS_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_WEEK operator\n */\nexport function thisWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_WEEK, options };\n}\n\n/**\n * Creates a NEXT_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with NEXT_WEEK operator\n */\nexport function nextWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.NEXT_WEEK, options };\n}\n\n/**\n * Creates a LAST_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_WEEK operator\n */\nexport function lastWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_WEEK, options };\n}\n\n/**\n * Creates a THIS_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_MONTH operator\n */\nexport function thisMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_MONTH, options };\n}\n\n/**\n * Creates a LAST_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_MONTH operator\n */\nexport function lastMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_MONTH, options };\n}\n\n/**\n * Creates a RECENT_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of recent days to include\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with RECENT_DAYS operator\n */\nexport function recentDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.RECENT_DAYS, value: days, options };\n}\n\n/**\n * Creates an EARLIER_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of days to look back\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with EARLIER_DAYS operator\n */\nexport function earlierDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.EARLIER_DAYS, value: days, options };\n}\n\n/**\n * Creates a RAW condition with the specified raw value.\n *\n * @param raw - The raw condition value\n * @returns A condition with RAW operator\n */\nexport function raw(raw: any): Condition {\n return { operator: Operator.RAW, value: raw };\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionCapable } from './condition';\n\nexport enum SortDirection {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/**\n * Interface for sort criteria.\n */\nexport interface Sort {\n field: string;\n direction: SortDirection;\n}\n\n/**\n * Interface for objects that support sorting.\n */\nexport interface SortCapable {\n sort?: Sort[];\n}\n\n/**\n * Interface for pagination information.\n *\n * Page number, starting from 1\n * Page size\n */\nexport interface Pagination {\n index: number;\n size: number;\n}\n\nexport const DEFAULT_PAGINATION: Pagination = {\n index: 1,\n size: 10,\n};\n\n/**\n * Interface for field projection.\n */\nexport interface Projection {\n include?: string[];\n exclude?: string[];\n}\n\nexport const DEFAULT_PROJECTION: Projection = {};\n\n/**\n * Interface for objects that support field projection.\n */\nexport interface ProjectionCapable {\n projection?: Projection;\n}\n\n/**\n * Interface for queryable objects that support conditions, projection, and sorting.\n */\nexport interface Queryable\n extends ConditionCapable,\n ProjectionCapable,\n SortCapable {}\n\n/**\n * Interface for single query objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface SingleQuery extends Queryable {}\n\n/**\n * Interface for list query objects.\n *\n * Limit the number of results. Default: DEFAULT_PAGINATION.size\n */\nexport interface ListQuery extends Queryable {\n limit?: number;\n}\n\n/**\n * Interface for paged query objects.\n */\nexport interface PagedQuery extends Queryable {\n pagination?: Pagination;\n}\n\n/**\n * Interface for paged list results.\n */\nexport interface PagedList<T> {\n total: number;\n list: T[];\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Enumerates the types of recoverability for errors or operations, allowing for classification and handling based on whether an error is transient and can be resolved by retrying.\n *\n * The [RecoverableType] enum provides a way to categorize errors into three distinct categories: [RECOVERABLE], [UNRECOVERABLE], and [UNKNOWN].\n * This categorization is essential for implementing robust error handling and retry mechanisms in applications,\n * ensuring that temporary issues are retried while permanent or unknown issues are handled appropriately.\n *\n */\nexport enum RecoverableType {\n /**\n * Represents an error type that indicates the operation or error can be retried.\n *\n * This enum value is used to classify errors in a way that allows for the implementation of retry logic. When an error\n * is marked as [RECOVERABLE], it signifies that the error condition is temporary and might be resolved upon retrying the\n * operation. This is particularly useful in scenarios where network issues, transient server errors, or other temporary\n * conditions may cause an operation to fail, but with a high likelihood of success on subsequent attempts.\n */\n RECOVERABLE = 'RECOVERABLE',\n /**\n * Represents an error type that indicates the operation or error cannot be retried.\n *\n * This enum value is used to classify errors in a way that signifies the error condition is permanent and retrying the operation will not resolve the issue. It is particularly\n * useful for handling errors where the underlying problem is fundamental and cannot be resolved by simply retrying, such as invalid input, resource exhaustion, or other non-transient\n * issues.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * Represents an unknown type of recoverability for an error or operation.\n * This is used when the recoverability of an error cannot be determined or is not specified.\n */\n UNRECOVERABLE = 'UNRECOVERABLE',\n}\n\n/**\n * Represents an error that occurs during the binding process, typically when data is being mapped to or from an object.\n * This class extends the [Named] interface, inheriting the `name` property which can be used to identify the source or context of the error.\n *\n * @param name The name or identifier for the context in which the error occurred.\n * @param msg A message describing the error.\n */\nexport interface BindingError {\n name: string;\n msg: string;\n}\n\n/**\n * Represents the information about an error, including whether the operation succeeded, the error code, and any associated messages or binding errors.\n *\n * This interface is designed to provide a standardized way of handling and representing errors across different parts of an application. It includes methods to check if the operation was successful, retrieve the error code\n * , and access any additional error details such as messages or binding errors.\n */\nexport interface ErrorInfo {\n /**\n * Represents the error code associated with an error. This value is used to identify the type of error that has occurred,\n * which can be useful for debugging, logging, and handling errors in a standardized way.\n */\n errorCode: string;\n /**\n * Represents the message associated with an error. This message provides a human-readable description of the error, which can be used for logging, debugging, or displaying to the user\n * .\n */\n errorMsg: string;\n /**\n * Provides a list of [BindingError] instances that occurred during the binding process.\n * Each [BindingError] contains information about the error, including its name and a message describing the issue.\n * This property returns an empty list if no binding errors are present.\n */\n bindingErrors?: BindingError[];\n}\n\nexport class ErrorCodes {\n /**\n * A constant representing a successful operation or status.\n * This value is typically used in the context of error handling and response descriptions to indicate that an operation has been completed successfully.\n */\n static readonly SUCCEEDED = 'Ok';\n static readonly SUCCEEDED_MESSAGE = '';\n\n /**\n * Error code for when a requested resource is not found.\n */\n static readonly NOT_FOUND = 'NotFound';\n\n /**\n * Default message for NOT_FOUND error code.\n */\n static readonly NOT_FOUND_MESSAGE = 'Not found resource!';\n\n /**\n * Error code for bad request errors.\n */\n static readonly BAD_REQUEST = 'BadRequest';\n\n /**\n * Error code for illegal argument errors.\n */\n static readonly ILLEGAL_ARGUMENT = 'IllegalArgument';\n\n /**\n * Error code for illegal state errors.\n */\n static readonly ILLEGAL_STATE = 'IllegalState';\n\n /**\n * Error code for request timeout errors.\n */\n static readonly REQUEST_TIMEOUT = 'RequestTimeout';\n\n /**\n * Error code for too many requests errors (rate limiting).\n */\n static readonly TOO_MANY_REQUESTS = 'TooManyRequests';\n\n /**\n * Error code for duplicate request ID errors.\n */\n static readonly DUPLICATE_REQUEST_ID = 'DuplicateRequestId';\n\n /**\n * Error code for command validation errors.\n */\n static readonly COMMAND_VALIDATION = 'CommandValidation';\n\n /**\n * Error code for when no command is found to rewrite.\n */\n static readonly REWRITE_NO_COMMAND = 'RewriteNoCommand';\n\n /**\n * Error code for event version conflicts.\n */\n static readonly EVENT_VERSION_CONFLICT = 'EventVersionConflict';\n\n /**\n * Error code for duplicate aggregate ID errors.\n */\n static readonly DUPLICATE_AGGREGATE_ID = 'DuplicateAggregateId';\n\n /**\n * Error code for command expected version conflicts.\n */\n static readonly COMMAND_EXPECT_VERSION_CONFLICT =\n 'CommandExpectVersionConflict';\n\n /**\n * Error code for sourcing version conflicts.\n */\n static readonly SOURCING_VERSION_CONFLICT = 'SourcingVersionConflict';\n\n /**\n * Error code for illegal access to deleted aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_DELETED_AGGREGATE =\n 'IllegalAccessDeletedAggregate';\n\n /**\n * Error code for illegal access to owner aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_OWNER_AGGREGATE =\n 'IllegalAccessOwnerAggregate';\n\n /**\n * Error code for internal server errors.\n */\n static readonly INTERNAL_SERVER_ERROR = 'InternalServerError';\n\n /**\n * Checks if the provided error code represents a successful operation.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is 'Ok', false otherwise\n */\n static isSucceeded(errorCode: string): boolean {\n return errorCode === ErrorCodes.SUCCEEDED;\n }\n\n /**\n * Checks if the provided error code represents an error condition.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is not 'Ok', false otherwise\n */\n static isError(errorCode: string): boolean {\n return !ErrorCodes.isSucceeded(errorCode);\n }\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Function kind enum\n *\n * Represents the different types of functions in the system.\n */\nexport enum FunctionKind {\n /**\n * Command function kind\n */\n COMMAND = 'COMMAND',\n\n /**\n * Error function kind\n */\n ERROR = 'ERROR',\n\n /**\n * Event function kind\n */\n EVENT = 'EVENT',\n\n /**\n * Sourcing function kind\n */\n SOURCING = 'SOURCING',\n\n /**\n * State event function kind\n */\n STATE_EVENT = 'STATE_EVENT',\n}\n\n/**\n * Interface for function information.\n */\nexport interface FunctionInfo {\n functionKind: FunctionKind;\n contextName: string;\n processorName: string;\n name: string;\n}\n\n/**\n * Interface for objects that have function information.\n */\nexport interface FunctionInfoCapable {\n function: FunctionInfo;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { NamedBoundedContext } from './naming.ts';\n\n/**\n * Interface for classes that have a creation time.\n */\nexport interface CreateTimeCapable {\n /**\n * Gets the creation time in milliseconds since the Unix epoch.\n */\n createTime: number;\n}\n\n/**\n * Interface for objects that track deletion status.\n */\nexport interface DeletedCapable {\n /**\n * Whether the aggregate is deleted.\n */\n deleted: boolean;\n}\n\n/**\n * Interface for objects that track event IDs.\n */\nexport interface EventIdCapable {\n /**\n * The event id of the aggregate.\n */\n eventId: string;\n}\n\n/**\n * Interface for objects that track event times.\n */\nexport interface EventTimeCapable {\n /**\n * The last event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n eventTime: number;\n}\n\n/**\n * Interface for objects that track the first event time.\n */\nexport interface FirstEventTimeCapable {\n /**\n * The first event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n firstEventTime: number;\n}\n\n/**\n * Interface for objects that track the first operator.\n */\nexport interface FirstOperatorCapable {\n /**\n * The first operator of the aggregate.\n */\n firstOperator: string;\n}\n\n/**\n * Interface for objects that have an aggregate name.\n */\nexport interface AggregateNameCapable {\n /**\n * The name of the aggregate.\n */\n aggregateName: string;\n}\n\n/**\n * Interface for named aggregates that belong to a bounded context.\n */\nexport interface NamedAggregate\n extends NamedBoundedContext,\n AggregateNameCapable {}\n\n/**\n * Interface for aggregate IDs that combine tenant and named aggregate information.\n */\nexport interface AggregateId extends TenantId, NamedAggregate {\n aggregateId: string;\n}\n\n/**\n * Interface for objects that track the last operator.\n */\nexport interface OperatorCapable {\n /**\n * The last operator of the aggregate.\n */\n operator: string;\n}\n\nexport const DEFAULT_OWNER_ID = '';\n\n/**\n * Interface for identifying resource owners.\n */\nexport interface OwnerId {\n /**\n * Unique identifier of the resource owner.\n */\n ownerId: string;\n}\n\n/**\n * Interface for objects that track snapshot times.\n */\nexport interface SnapshotTimeCapable {\n /**\n * The snapshot time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n snapshotTime: number;\n}\n\nexport const DEFAULT_TENANT_ID = '(0)';\n\n/**\n * Interface for objects that have a tenant ID.\n */\nexport interface TenantId {\n tenantId: string;\n}\n\n/**\n * Interface for objects that hold state.\n */\nexport interface StateCapable<S> {\n state: S;\n}\n"],"names":["_CommandHeaders","CommandHeaders","CommandStage","Operator","ConditionOptionKey","ignoreCaseOptions","ignoreCase","dateOptions","datePattern","zoneId","options","DeletionState","and","conditions","or","nor","id","value","ids","aggregateId","aggregateIds","tenantId","ownerId","deleted","active","all","eq","field","ne","gt","lt","gte","lte","contains","isIn","notIn","between","start","end","allIn","startsWith","endsWith","elemMatch","isNull","notNull","isTrue","isFalse","exists","today","beforeToday","time","tomorrow","thisWeek","nextWeek","lastWeek","thisMonth","lastMonth","recentDays","days","earlierDays","raw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AQ,SAKRA,EAAA,WAAW,YAKXA,EAAA,cAAc,eAxBJA,IAAAA,KAAA,CAAA,CAAA;AC2FL,MAAMC,KAAmB,IAsBnBC,KAAoB;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/command/commandHeaders.ts","../src/command/types.ts","../src/query/operator.ts","../src/query/condition.ts","../src/query/queryable.ts","../src/types/error.ts","../src/types/function.ts","../src/types/modeling.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command Header Constants\n *\n * Defines standard HTTP header constants used in command processing within the Wow framework.\n * These headers are used to pass metadata and control information between services.\n *\n * @example\n * ```typescript\n * // Using header constants in a request\n * const request = {\n * method: 'POST',\n * headers: {\n * [CommandHeaders.TENANT_ID]: 'tenant-123',\n * [CommandHeaders.AGGREGATE_ID]: 'aggregate-456',\n * [CommandHeaders.REQUEST_ID]: 'request-789'\n * },\n * body: JSON.stringify(command)\n * };\n * ```\n */\nexport class CommandHeaders {\n /**\n * Prefix for all command-related headers\n */\n static readonly COMMAND_HEADERS_PREFIX = 'Command-';\n\n /**\n * Tenant identifier header\n * Used to identify the tenant context for the command\n */\n static readonly TENANT_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Tenant-Id`;\n\n /**\n * Owner identifier header\n * Used to identify the owner context for the command\n */\n static readonly OWNER_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Owner-Id`;\n\n /**\n * Aggregate identifier header\n * Used to identify the aggregate root for the command\n */\n static readonly AGGREGATE_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Id`;\n\n /**\n * Aggregate version header\n * Used to specify the expected version of the aggregate root\n */\n static readonly AGGREGATE_VERSION = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Version`;\n\n /**\n * Wait prefix for wait-related headers\n */\n static readonly WAIT_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Wait-`;\n\n /**\n * Wait timeout header\n * Specifies the maximum time to wait for command processing\n */\n static readonly WAIT_TIME_OUT = `${CommandHeaders.WAIT_PREFIX}Timeout`;\n\n // region Wait Stage\n /**\n * Wait stage header\n * Specifies the processing stage to wait for\n */\n static readonly WAIT_STAGE = `${CommandHeaders.WAIT_PREFIX}Stage`;\n\n /**\n * Wait context header\n * Specifies the bounded context to wait for\n */\n static readonly WAIT_CONTEXT = `${CommandHeaders.WAIT_PREFIX}Context`;\n\n /**\n * Wait processor header\n * Specifies the processor to wait for\n */\n static readonly WAIT_PROCESSOR = `${CommandHeaders.WAIT_PREFIX}Processor`;\n\n /**\n * Wait function header\n * Specifies the function to wait for\n */\n static readonly WAIT_FUNCTION = `${CommandHeaders.WAIT_PREFIX}Function`;\n // endregion\n\n // region Wait Chain Tail\n /**\n * Wait tail prefix for wait chain tail-related headers\n */\n static readonly WAIT_TAIL_PREFIX = `${CommandHeaders.WAIT_PREFIX}Tail-`;\n\n /**\n * Wait tail stage header\n * Specifies the tail processing stage to wait for\n */\n static readonly WAIT_TAIL_STAGE = `${CommandHeaders.WAIT_TAIL_PREFIX}Stage`;\n\n /**\n * Wait tail context header\n * Specifies the tail bounded context to wait for\n */\n static readonly WAIT_TAIL_CONTEXT = `${CommandHeaders.WAIT_TAIL_PREFIX}Context`;\n\n /**\n * Wait tail processor header\n * Specifies the tail processor to wait for\n */\n static readonly WAIT_TAIL_PROCESSOR = `${CommandHeaders.WAIT_TAIL_PREFIX}Processor`;\n\n /**\n * Wait tail function header\n * Specifies the tail function to wait for\n */\n static readonly WAIT_TAIL_FUNCTION = `${CommandHeaders.WAIT_TAIL_PREFIX}Function`;\n // endregion\n\n /**\n * Request identifier header\n * Used to track the request ID for correlation\n */\n static readonly REQUEST_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Request-Id`;\n\n /**\n * Local first header\n * Indicates whether to prefer local processing\n */\n static readonly LOCAL_FIRST = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Local-First`;\n\n /**\n * Command aggregate context header\n * Specifies the bounded context of the aggregate\n */\n static readonly COMMAND_AGGREGATE_CONTEXT = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Context`;\n\n /**\n * Command aggregate name header\n * Specifies the name of the aggregate\n */\n static readonly COMMAND_AGGREGATE_NAME = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Name`;\n\n /**\n * Command type header\n * Specifies the type of the command\n */\n static readonly COMMAND_TYPE = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Type`;\n\n /**\n * Command header prefix for custom headers\n * Used to prefix custom command headers\n */\n static readonly COMMAND_HEADER_X_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Header-`;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command identifier interface\n *\n * Represents the unique identifier for a command.\n */\nexport interface CommandId {\n commandId: string;\n}\n\n/**\n * Wait command identifier capable interface\n *\n * Represents the identifier of the command being waited for.\n */\nexport interface WaitCommandIdCapable {\n waitCommandId: string;\n}\n\n/**\n * Request identifier interface\n *\n * Represents the unique identifier for a request, used for idempotency control.\n */\nexport interface RequestId {\n requestId: string;\n}\n\n/**\n * Command execution stage enum\n *\n * Represents the different stages of command execution lifecycle.\n */\nexport enum CommandStage {\n /**\n * When the command is published to the command bus/queue, a completion signal is generated.\n */\n SENT = 'SENT',\n\n /**\n * When the command is processed by the aggregate root, a completion signal is generated.\n */\n PROCESSED = 'PROCESSED',\n\n /**\n * When the snapshot is generated, a completion signal is generated.\n */\n SNAPSHOT = 'SNAPSHOT',\n\n /**\n * When the events generated by the command are *projected*, a completion signal is generated.\n */\n PROJECTED = 'PROJECTED',\n\n /**\n * When the events generated by the command are processed by *event handlers*, a completion signal is generated.\n */\n EVENT_HANDLED = 'EVENT_HANDLED',\n\n /**\n * When the events generated by the command are processed by *Saga*, a completion signal is generated.\n */\n SAGA_HANDLED = 'SAGA_HANDLED',\n}\n\n/**\n * Command stage capable interface\n *\n * Represents an object that has a command execution stage.\n */\nexport interface CommandStageCapable {\n stage: CommandStage;\n}\n\n/**\n * Command result capable interface\n *\n * Represents an object that contains command execution results.\n */\nexport interface CommandResultCapable {\n result: Record<string, any>;\n}\n\n/**\n * Signal time capable interface\n *\n * Represents an object that has a signal time (timestamp).\n */\nexport interface SignalTimeCapable {\n signalTime: number;\n}\n\n/**\n * Nullable aggregate version capable interface\n *\n * Represents an object that may have an aggregate version for optimistic concurrency control.\n */\nexport interface NullableAggregateVersionCapable {\n /**\n * The aggregate version of the aggregate.\n */\n aggregateVersion?: number;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum Operator {\n /**\n * Performs logical AND on the provided condition list\n */\n AND = 'AND',\n\n /**\n * Performs logical OR on the provided condition list\n */\n OR = 'OR',\n\n /**\n * Performs logical NOR on the provided condition list\n */\n NOR = 'NOR',\n\n /**\n * Matches all documents where the `id` field value equals the specified value\n */\n ID = 'ID',\n\n /**\n * Matches all documents where the `id` field value equals any value in the specified list\n */\n IDS = 'IDS',\n\n /**\n * Matches documents where the aggregate root ID equals the specified value\n */\n AGGREGATE_ID = 'AGGREGATE_ID',\n\n /**\n * Matches all documents where the aggregate root ID equals any value in the specified list\n */\n AGGREGATE_IDS = 'AGGREGATE_IDS',\n\n /**\n * Matches all documents where the `tenantId` field value equals the specified value\n */\n TENANT_ID = 'TENANT_ID',\n\n /**\n * Matches all documents where the `ownerId` field value equals the specified value\n */\n OWNER_ID = 'OWNER_ID',\n\n /**\n * Matches all documents where the `deleted` field value equals the specified value\n */\n DELETED = 'DELETED',\n\n /**\n * Matches all documents\n */\n ALL = 'ALL',\n\n /**\n * Matches all documents where the field name value equals the specified value\n */\n EQ = 'EQ',\n\n /**\n * Matches all documents where the field name value does not equal the specified value\n */\n NE = 'NE',\n\n /**\n * Matches all documents where the given field's value is greater than the specified value\n */\n GT = 'GT',\n\n /**\n * Matches all documents where the given field's value is less than the specified value\n */\n LT = 'LT',\n\n /**\n * Matches all documents where the given field's value is greater than or equal to the specified value\n */\n GTE = 'GTE',\n\n /**\n * Matches all documents where the given field's value is less than or equal to the specified value\n */\n LTE = 'LTE',\n\n /**\n * Matches all documents where the given field's value contains the specified value\n */\n CONTAINS = 'CONTAINS',\n\n /**\n * Matches all documents where the field value equals any value in the specified list\n */\n IN = 'IN',\n\n /**\n * Matches all documents where the field value does not equal any specified value or does not exist\n */\n NOT_IN = 'NOT_IN',\n\n /**\n * Matches all documents where the field value is within the specified range\n */\n BETWEEN = 'BETWEEN',\n\n /**\n * Matches all documents where the field value is an array containing all specified values\n */\n ALL_IN = 'ALL_IN',\n\n /**\n * Matches documents where the field value starts with the specified string\n */\n STARTS_WITH = 'STARTS_WITH',\n\n /**\n * Matches documents where the field value ends with the specified string\n */\n ENDS_WITH = 'ENDS_WITH',\n\n /**\n * Matches all documents where the condition includes an array field,\n * and at least one member of the array matches the given condition.\n */\n ELEM_MATCH = 'ELEM_MATCH',\n\n /**\n * Matches all documents where the field value is `null`\n */\n NULL = 'NULL',\n\n /**\n * Matches all documents where the field value is not `null`\n */\n NOT_NULL = 'NOT_NULL',\n\n /**\n * Matches all documents where the field value is `true`\n */\n TRUE = 'TRUE',\n\n /**\n * Matches all documents where the field value is `false`\n */\n FALSE = 'FALSE',\n\n /**\n * Matches documents based on whether the field exists\n */\n EXISTS = 'EXISTS',\n\n // #region Date filtering conditions, field requirement: `long` type timestamp in milliseconds\n /**\n * Matches all documents where the field is within today's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-06 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n */\n TODAY = 'TODAY',\n\n /**\n * Matches all documents where the field is before today\n */\n BEFORE_TODAY = 'BEFORE_TODAY',\n\n /**\n * Matches all documents where the field is within yesterday's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-05 00:00:00.000` ~ `2024-06-05 23:59:59.999`\n */\n TOMORROW = 'TOMORROW',\n\n /**\n * Matches all documents where the field is within this week's range\n */\n THIS_WEEK = 'THIS_WEEK',\n\n /**\n * Matches all documents where the field is within next week's range\n */\n NEXT_WEEK = 'NEXT_WEEK',\n\n /**\n * Matches all documents where the field is within last week's range\n */\n LAST_WEEK = 'LAST_WEEK',\n\n /**\n * Matches all documents where the field is within this month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-01 00:00:00.000` ~ `2024-06-30 23:59:59.999`\n */\n THIS_MONTH = 'THIS_MONTH',\n\n /**\n * Matches all documents where the field is within last month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-05-01 00:00:00.000` ~ `2024-05-31 23:59:59.999`\n */\n LAST_MONTH = 'LAST_MONTH',\n\n /**\n * Matches all documents where the field is within the specified number of recent days\n * > For example: last 3 days\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-04 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n * - That is: today, yesterday, the day before yesterday\n */\n RECENT_DAYS = 'RECENT_DAYS',\n\n /**\n * Matches all documents where the field is before the specified number of days\n *\n * > For example: before 3 days\n * - `today`: `2024-06-06`\n * - Matching range: all documents less than `2024-06-04 00:00:00.000`\n */\n EARLIER_DAYS = 'EARLIER_DAYS',\n // #endregion\n\n /**\n * Raw operator, uses the condition value directly as the raw database query condition\n */\n RAW = 'RAW',\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Operator } from './operator';\n\n/**\n * Condition option keys enumeration\n *\n * Defines standard option keys used in query conditions for special handling.\n */\nexport enum ConditionOptionKey {\n /**\n * Ignore case option key for string comparisons\n */\n IGNORE_CASE_OPTION_KEY = 'ignoreCase',\n\n /**\n * Time zone ID option key for date operations\n */\n ZONE_ID_OPTION_KEY = 'zoneId',\n\n /**\n * Date pattern option key for date formatting\n */\n DATE_PATTERN_OPTION_KEY = 'datePattern',\n}\n\n/**\n * Condition options interface\n *\n * Represents additional options that can be applied to query conditions,\n * such as case sensitivity, date patterns, and time zones.\n */\nexport interface ConditionOptions {\n /**\n * Whether to ignore case in string comparisons\n */\n ignoreCase?: boolean;\n\n /**\n * Date pattern for date formatting\n */\n datePattern?: string;\n\n /**\n * Time zone ID for date operations\n */\n zoneId?: string;\n\n /**\n * Additional custom options\n */\n [key: string]: any;\n}\n\n/**\n * Helper function to create condition options with ignoreCase flag.\n *\n * @param ignoreCase - Whether to ignore case\n * @returns Condition options or undefined if ignoreCase is undefined\n */\nexport function ignoreCaseOptions(\n ignoreCase?: boolean,\n): ConditionOptions | undefined {\n if (typeof ignoreCase === 'undefined') {\n return undefined;\n }\n return { ignoreCase };\n}\n\n/**\n * Helper function to create condition options with date pattern and zone ID.\n *\n * @param datePattern - Date pattern\n * @param zoneId - Time zone ID\n * @returns Condition options or undefined if both parameters are undefined\n */\nexport function dateOptions(\n datePattern?: string,\n zoneId?: string,\n): ConditionOptions | undefined {\n if (typeof datePattern === 'undefined' && typeof zoneId === 'undefined') {\n return undefined;\n }\n const options: ConditionOptions = {};\n if (typeof datePattern !== 'undefined') {\n options.datePattern = datePattern;\n }\n if (typeof zoneId !== 'undefined') {\n options.zoneId = zoneId;\n }\n return options;\n}\n\n/**\n * Interface for query conditions.\n *\n * When `operator` is `AND` or `OR` or `NOR`, `children` cannot be empty.\n */\nexport interface Condition {\n /**\n * Field name for the condition\n */\n field?: string;\n\n /**\n * Operator for the condition\n */\n operator?: Operator;\n\n /**\n * Value for the condition\n */\n value?: any;\n\n /**\n * Child conditions for logical operators (AND, OR, NOR)\n */\n children?: Condition[];\n\n /**\n * Additional options for the condition\n */\n options?: ConditionOptions;\n}\n\n/**\n * Interface for objects that have a condition.\n */\nexport interface ConditionCapable {\n condition: Condition;\n}\n\n/**\n * Deletion state enumeration\n *\n * Represents the different states of deletion for entities.\n */\nexport enum DeletionState {\n /**\n * Active state - entity is not deleted\n */\n ACTIVE = 'ACTIVE',\n\n /**\n * Deleted state - entity is deleted\n */\n DELETED = 'DELETED',\n\n /**\n * All state - includes both active and deleted entities\n */\n ALL = 'ALL',\n}\n\n/**\n * Creates an AND condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with AND\n * @returns A condition with AND operator\n */\nexport function and(...conditions: Condition[]): Condition {\n return { operator: Operator.AND, children: conditions };\n}\n\n/**\n * Creates an OR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with OR\n * @returns A condition with OR operator\n */\nexport function or(...conditions: Condition[]): Condition {\n return { operator: Operator.OR, children: conditions };\n}\n\n/**\n * Creates a NOR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with NOR\n * @returns A condition with NOR operator\n */\nexport function nor(...conditions: Condition[]): Condition {\n return { operator: Operator.NOR, children: conditions };\n}\n\n/**\n * Creates an ID condition with the specified value.\n *\n * @param value - The ID value to match\n * @returns A condition with ID operator\n */\nexport function id(value: string): Condition {\n return { operator: Operator.ID, value: value };\n}\n\n/**\n * Creates an IDS condition with the specified values.\n *\n * @param value - The ID values to match\n * @returns A condition with IDS operator\n */\nexport function ids(value: string[]): Condition {\n return { operator: Operator.IDS, value: value };\n}\n\n/**\n * Creates an AGGREGATE_ID condition with the specified value.\n *\n * @param value - The aggregate ID value to match\n * @returns A condition with AGGREGATE_ID operator\n */\nexport function aggregateId(value: string): Condition {\n return { operator: Operator.AGGREGATE_ID, value: value };\n}\n\n/**\n * Creates an AGGREGATE_IDS condition with the specified values.\n *\n * @param value - The aggregate ID values to match\n * @returns A condition with AGGREGATE_IDS operator\n */\nexport function aggregateIds(...value: string[]): Condition {\n return { operator: Operator.AGGREGATE_IDS, value: value };\n}\n\n/**\n * Creates a TENANT_ID condition with the specified value.\n *\n * @param value - The tenant ID value to match\n * @returns A condition with TENANT_ID operator\n */\nexport function tenantId(value: string): Condition {\n return { operator: Operator.TENANT_ID, value: value };\n}\n\n/**\n * Creates an OWNER_ID condition with the specified value.\n *\n * @param value - The owner ID value to match\n * @returns A condition with OWNER_ID operator\n */\nexport function ownerId(value: string): Condition {\n return { operator: Operator.OWNER_ID, value: value };\n}\n\n/**\n * Creates a DELETED condition with the specified value.\n *\n * @param value - The deletion state value to match\n * @returns A condition with DELETED operator\n */\nexport function deleted(value: DeletionState): Condition {\n return { operator: Operator.DELETED, value: value };\n}\n\n/**\n * Creates an ACTIVE deletion state condition.\n *\n * @returns A condition with DELETED operator set to ACTIVE\n */\nexport function active(): Condition {\n return deleted(DeletionState.ACTIVE);\n}\n\n/**\n * Creates an ALL condition.\n *\n * @returns A condition with ALL operator\n */\nexport function all(): Condition {\n return {\n operator: Operator.ALL,\n };\n}\n\n/**\n * Creates an EQ (equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with EQ operator\n */\nexport function eq(field: string, value: any): Condition {\n return { field, operator: Operator.EQ, value };\n}\n\n/**\n * Creates a NE (not equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with NE operator\n */\nexport function ne(field: string, value: any): Condition {\n return { field, operator: Operator.NE, value };\n}\n\n/**\n * Creates a GT (greater than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GT operator\n */\nexport function gt(field: string, value: any): Condition {\n return { field, operator: Operator.GT, value };\n}\n\n/**\n * Creates a LT (less than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LT operator\n */\nexport function lt(field: string, value: any): Condition {\n return { field, operator: Operator.LT, value };\n}\n\n/**\n * Creates a GTE (greater than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GTE operator\n */\nexport function gte(field: string, value: any): Condition {\n return { field, operator: Operator.GTE, value };\n}\n\n/**\n * Creates a LTE (less than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LTE operator\n */\nexport function lte(field: string, value: any): Condition {\n return { field, operator: Operator.LTE, value };\n}\n\n/**\n * Creates a CONTAINS condition with the specified field and value.\n *\n * @param field - The field name to search in\n * @param value - The value to search for\n * @param ignoreCase - Whether to ignore case in the search\n * @returns A condition with CONTAINS operator\n */\nexport function contains(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.CONTAINS, value, options };\n}\n\n/**\n * Creates an IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with IN operator\n */\nexport function isIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.IN, value };\n}\n\n/**\n * Creates a NOT_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with NOT_IN operator\n */\nexport function notIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.NOT_IN, value };\n}\n\n/**\n * Creates a BETWEEN condition with the specified field and range.\n *\n * @param field - The field name to compare\n * @param start - The start value of the range\n * @param end - The end value of the range\n * @returns A condition with BETWEEN operator\n */\nexport function between(field: string, start: any, end: any): Condition {\n return { field, operator: Operator.BETWEEN, value: [start, end] };\n}\n\n/**\n * Creates an ALL_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with ALL_IN operator\n */\nexport function allIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.ALL_IN, value };\n}\n\n/**\n * Creates a STARTS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with STARTS_WITH operator\n */\nexport function startsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.STARTS_WITH, value, options };\n}\n\n/**\n * Creates an ENDS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with ENDS_WITH operator\n */\nexport function endsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.ENDS_WITH, value, options };\n}\n\n/**\n * Creates an ELEM_MATCH condition with the specified field and child condition.\n *\n * @param field - The field name to match elements in\n * @param value - The condition to match elements against\n * @returns A condition with ELEM_MATCH operator\n */\nexport function elemMatch(field: string, value: Condition): Condition {\n return { field, operator: Operator.ELEM_MATCH, children: [value] };\n}\n\n/**\n * Creates a NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NULL operator\n */\nexport function isNull(field: string): Condition {\n return { field, operator: Operator.NULL };\n}\n\n/**\n * Creates a NOT_NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NOT_NULL operator\n */\nexport function notNull(field: string): Condition {\n return { field, operator: Operator.NOT_NULL };\n}\n\n/**\n * Creates a TRUE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with TRUE operator\n */\nexport function isTrue(field: string): Condition {\n return { field, operator: Operator.TRUE };\n}\n\n/**\n * Creates a FALSE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with FALSE operator\n */\nexport function isFalse(field: string): Condition {\n return { field, operator: Operator.FALSE };\n}\n\n/**\n * Creates an EXISTS condition with the specified field and existence flag.\n *\n * @param field - The field name to check\n * @param exists - Whether the field should exist (default: true)\n * @returns A condition with EXISTS operator\n */\nexport function exists(field: string, exists: boolean = true): Condition {\n return { field, operator: Operator.EXISTS, value: exists };\n}\n\n/**\n * Creates a TODAY condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TODAY operator\n */\nexport function today(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TODAY, options };\n}\n\n/**\n * Creates a BEFORE_TODAY condition with the specified field and time.\n *\n * @param field - The field name to check\n * @param time - The time to compare against\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with BEFORE_TODAY operator\n */\nexport function beforeToday(\n field: string,\n time: any,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.BEFORE_TODAY, value: time, options };\n}\n\n/**\n * Creates a TOMORROW condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TOMORROW operator\n */\nexport function tomorrow(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TOMORROW, options };\n}\n\n/**\n * Creates a THIS_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_WEEK operator\n */\nexport function thisWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_WEEK, options };\n}\n\n/**\n * Creates a NEXT_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with NEXT_WEEK operator\n */\nexport function nextWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.NEXT_WEEK, options };\n}\n\n/**\n * Creates a LAST_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_WEEK operator\n */\nexport function lastWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_WEEK, options };\n}\n\n/**\n * Creates a THIS_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_MONTH operator\n */\nexport function thisMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_MONTH, options };\n}\n\n/**\n * Creates a LAST_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_MONTH operator\n */\nexport function lastMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_MONTH, options };\n}\n\n/**\n * Creates a RECENT_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of recent days to include\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with RECENT_DAYS operator\n */\nexport function recentDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.RECENT_DAYS, value: days, options };\n}\n\n/**\n * Creates an EARLIER_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of days to look back\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with EARLIER_DAYS operator\n */\nexport function earlierDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.EARLIER_DAYS, value: days, options };\n}\n\n/**\n * Creates a RAW condition with the specified raw value.\n *\n * @param raw - The raw condition value\n * @returns A condition with RAW operator\n */\nexport function raw(raw: any): Condition {\n return { operator: Operator.RAW, value: raw };\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionCapable } from './condition';\n\nexport enum SortDirection {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/**\n * Interface for sort criteria.\n */\nexport interface Sort {\n field: string;\n direction: SortDirection;\n}\n\n/**\n * Interface for objects that support sorting.\n */\nexport interface SortCapable {\n sort?: Sort[];\n}\n\n/**\n * Interface for pagination information.\n *\n * Page number, starting from 1\n * Page size\n */\nexport interface Pagination {\n index: number;\n size: number;\n}\n\nexport const DEFAULT_PAGINATION: Pagination = {\n index: 1,\n size: 10,\n};\n\n/**\n * Interface for field projection.\n */\nexport interface Projection {\n include?: string[];\n exclude?: string[];\n}\n\nexport const DEFAULT_PROJECTION: Projection = {};\n\n/**\n * Interface for objects that support field projection.\n */\nexport interface ProjectionCapable {\n projection?: Projection;\n}\n\n/**\n * Interface for queryable objects that support conditions, projection, and sorting.\n */\nexport interface Queryable\n extends ConditionCapable,\n ProjectionCapable,\n SortCapable {}\n\n/**\n * Interface for single query objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface SingleQuery extends Queryable {}\n\n/**\n * Interface for list query objects.\n *\n * Limit the number of results. Default: DEFAULT_PAGINATION.size\n */\nexport interface ListQuery extends Queryable {\n limit?: number;\n}\n\n/**\n * Interface for paged query objects.\n */\nexport interface PagedQuery extends Queryable {\n pagination?: Pagination;\n}\n\n/**\n * Interface for paged list results.\n */\nexport interface PagedList<T> {\n total: number;\n list: T[];\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Enumerates the types of recoverability for errors or operations, allowing for classification and handling based on whether an error is transient and can be resolved by retrying.\n *\n * The [RecoverableType] enum provides a way to categorize errors into three distinct categories: [RECOVERABLE], [UNRECOVERABLE], and [UNKNOWN].\n * This categorization is essential for implementing robust error handling and retry mechanisms in applications,\n * ensuring that temporary issues are retried while permanent or unknown issues are handled appropriately.\n *\n */\nexport enum RecoverableType {\n /**\n * Represents an error type that indicates the operation or error can be retried.\n *\n * This enum value is used to classify errors in a way that allows for the implementation of retry logic. When an error\n * is marked as [RECOVERABLE], it signifies that the error condition is temporary and might be resolved upon retrying the\n * operation. This is particularly useful in scenarios where network issues, transient server errors, or other temporary\n * conditions may cause an operation to fail, but with a high likelihood of success on subsequent attempts.\n */\n RECOVERABLE = 'RECOVERABLE',\n /**\n * Represents an error type that indicates the operation or error cannot be retried.\n *\n * This enum value is used to classify errors in a way that signifies the error condition is permanent and retrying the operation will not resolve the issue. It is particularly\n * useful for handling errors where the underlying problem is fundamental and cannot be resolved by simply retrying, such as invalid input, resource exhaustion, or other non-transient\n * issues.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * Represents an unknown type of recoverability for an error or operation.\n * This is used when the recoverability of an error cannot be determined or is not specified.\n */\n UNRECOVERABLE = 'UNRECOVERABLE',\n}\n\n/**\n * Represents an error that occurs during the binding process, typically when data is being mapped to or from an object.\n * This class extends the [Named] interface, inheriting the `name` property which can be used to identify the source or context of the error.\n *\n * @param name The name or identifier for the context in which the error occurred.\n * @param msg A message describing the error.\n */\nexport interface BindingError {\n name: string;\n msg: string;\n}\n\n/**\n * Represents the information about an error, including whether the operation succeeded, the error code, and any associated messages or binding errors.\n *\n * This interface is designed to provide a standardized way of handling and representing errors across different parts of an application. It includes methods to check if the operation was successful, retrieve the error code\n * , and access any additional error details such as messages or binding errors.\n */\nexport interface ErrorInfo {\n /**\n * Represents the error code associated with an error. This value is used to identify the type of error that has occurred,\n * which can be useful for debugging, logging, and handling errors in a standardized way.\n */\n errorCode: string;\n /**\n * Represents the message associated with an error. This message provides a human-readable description of the error, which can be used for logging, debugging, or displaying to the user\n * .\n */\n errorMsg: string;\n /**\n * Provides a list of [BindingError] instances that occurred during the binding process.\n * Each [BindingError] contains information about the error, including its name and a message describing the issue.\n * This property returns an empty list if no binding errors are present.\n */\n bindingErrors?: BindingError[];\n}\n\nexport class ErrorCodes {\n /**\n * A constant representing a successful operation or status.\n * This value is typically used in the context of error handling and response descriptions to indicate that an operation has been completed successfully.\n */\n static readonly SUCCEEDED = 'Ok';\n static readonly SUCCEEDED_MESSAGE = '';\n\n /**\n * Error code for when a requested resource is not found.\n */\n static readonly NOT_FOUND = 'NotFound';\n\n /**\n * Default message for NOT_FOUND error code.\n */\n static readonly NOT_FOUND_MESSAGE = 'Not found resource!';\n\n /**\n * Error code for bad request errors.\n */\n static readonly BAD_REQUEST = 'BadRequest';\n\n /**\n * Error code for illegal argument errors.\n */\n static readonly ILLEGAL_ARGUMENT = 'IllegalArgument';\n\n /**\n * Error code for illegal state errors.\n */\n static readonly ILLEGAL_STATE = 'IllegalState';\n\n /**\n * Error code for request timeout errors.\n */\n static readonly REQUEST_TIMEOUT = 'RequestTimeout';\n\n /**\n * Error code for too many requests errors (rate limiting).\n */\n static readonly TOO_MANY_REQUESTS = 'TooManyRequests';\n\n /**\n * Error code for duplicate request ID errors.\n */\n static readonly DUPLICATE_REQUEST_ID = 'DuplicateRequestId';\n\n /**\n * Error code for command validation errors.\n */\n static readonly COMMAND_VALIDATION = 'CommandValidation';\n\n /**\n * Error code for when no command is found to rewrite.\n */\n static readonly REWRITE_NO_COMMAND = 'RewriteNoCommand';\n\n /**\n * Error code for event version conflicts.\n */\n static readonly EVENT_VERSION_CONFLICT = 'EventVersionConflict';\n\n /**\n * Error code for duplicate aggregate ID errors.\n */\n static readonly DUPLICATE_AGGREGATE_ID = 'DuplicateAggregateId';\n\n /**\n * Error code for command expected version conflicts.\n */\n static readonly COMMAND_EXPECT_VERSION_CONFLICT =\n 'CommandExpectVersionConflict';\n\n /**\n * Error code for sourcing version conflicts.\n */\n static readonly SOURCING_VERSION_CONFLICT = 'SourcingVersionConflict';\n\n /**\n * Error code for illegal access to deleted aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_DELETED_AGGREGATE =\n 'IllegalAccessDeletedAggregate';\n\n /**\n * Error code for illegal access to owner aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_OWNER_AGGREGATE =\n 'IllegalAccessOwnerAggregate';\n\n /**\n * Error code for internal server errors.\n */\n static readonly INTERNAL_SERVER_ERROR = 'InternalServerError';\n\n /**\n * Checks if the provided error code represents a successful operation.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is 'Ok', false otherwise\n */\n static isSucceeded(errorCode: string): boolean {\n return errorCode === ErrorCodes.SUCCEEDED;\n }\n\n /**\n * Checks if the provided error code represents an error condition.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is not 'Ok', false otherwise\n */\n static isError(errorCode: string): boolean {\n return !ErrorCodes.isSucceeded(errorCode);\n }\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Function kind enum\n *\n * Represents the different types of functions in the system.\n */\nexport enum FunctionKind {\n /**\n * Command function kind\n */\n COMMAND = 'COMMAND',\n\n /**\n * Error function kind\n */\n ERROR = 'ERROR',\n\n /**\n * Event function kind\n */\n EVENT = 'EVENT',\n\n /**\n * Sourcing function kind\n */\n SOURCING = 'SOURCING',\n\n /**\n * State event function kind\n */\n STATE_EVENT = 'STATE_EVENT',\n}\n\n/**\n * Interface for function information.\n */\nexport interface FunctionInfo {\n functionKind: FunctionKind;\n contextName: string;\n processorName: string;\n name: string;\n}\n\n/**\n * Interface for objects that have function information.\n */\nexport interface FunctionInfoCapable {\n function: FunctionInfo;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { NamedBoundedContext } from './naming.ts';\n\n/**\n * Interface for classes that have a creation time.\n */\nexport interface CreateTimeCapable {\n /**\n * Gets the creation time in milliseconds since the Unix epoch.\n */\n createTime: number;\n}\n\n/**\n * Interface for objects that track deletion status.\n */\nexport interface DeletedCapable {\n /**\n * Whether the aggregate is deleted.\n */\n deleted: boolean;\n}\n\n/**\n * Interface for objects that track event IDs.\n */\nexport interface EventIdCapable {\n /**\n * The event id of the aggregate.\n */\n eventId: string;\n}\n\n/**\n * Interface for objects that track event times.\n */\nexport interface EventTimeCapable {\n /**\n * The last event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n eventTime: number;\n}\n\n/**\n * Interface for objects that track the first event time.\n */\nexport interface FirstEventTimeCapable {\n /**\n * The first event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n firstEventTime: number;\n}\n\n/**\n * Interface for objects that track the first operator.\n */\nexport interface FirstOperatorCapable {\n /**\n * The first operator of the aggregate.\n */\n firstOperator: string;\n}\n\n/**\n * Interface for objects that have an aggregate name.\n */\nexport interface AggregateNameCapable {\n /**\n * The name of the aggregate.\n */\n aggregateName: string;\n}\n\n/**\n * Interface for named aggregates that belong to a bounded context.\n */\nexport interface NamedAggregate\n extends NamedBoundedContext,\n AggregateNameCapable {}\n\n/**\n * Interface for aggregate IDs that combine tenant and named aggregate information.\n */\nexport interface AggregateId extends TenantId, NamedAggregate {\n aggregateId: string;\n}\n\n/**\n * Interface for objects that track the last operator.\n */\nexport interface OperatorCapable {\n /**\n * The last operator of the aggregate.\n */\n operator: string;\n}\n\nexport const DEFAULT_OWNER_ID = '';\n\n/**\n * Interface for identifying resource owners.\n */\nexport interface OwnerId {\n /**\n * Unique identifier of the resource owner.\n */\n ownerId: string;\n}\n\n/**\n * Interface for objects that track snapshot times.\n */\nexport interface SnapshotTimeCapable {\n /**\n * The snapshot time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n snapshotTime: number;\n}\n\nexport const DEFAULT_TENANT_ID = '(0)';\n\n/**\n * Interface for objects that have a tenant ID.\n */\nexport interface TenantId {\n tenantId: string;\n}\n\n/**\n * Interface for objects that hold state.\n */\nexport interface StateCapable<S> {\n state: S;\n}\n"],"names":["_CommandHeaders","CommandHeaders","CommandStage","Operator","ConditionOptionKey","ignoreCaseOptions","ignoreCase","dateOptions","datePattern","zoneId","options","DeletionState","and","conditions","or","nor","id","value","ids","aggregateId","aggregateIds","tenantId","ownerId","deleted","active","all","eq","field","ne","gt","lt","gte","lte","contains","isIn","notIn","between","start","end","allIn","startsWith","endsWith","elemMatch","isNull","notNull","isTrue","isFalse","exists","today","beforeToday","time","tomorrow","thisWeek","nextWeek","lastWeek","thisMonth","lastMonth","recentDays","days","earlierDays","raw","SortDirection","DEFAULT_PAGINATION","DEFAULT_PROJECTION","RecoverableType","_ErrorCodes","errorCode","ErrorCodes","FunctionKind","DEFAULT_OWNER_ID","DEFAULT_TENANT_ID"],"mappings":"AAiCO,MAAMA,IAAN,MAAMA,EAAe;AAqI5B;AAjIEA,EAAgB,yBAAyB,YAMzCA,EAAgB,YAAY,GAAGA,EAAe,sBAAsB,aAMpEA,EAAgB,WAAW,GAAGA,EAAe,sBAAsB,YAMnEA,EAAgB,eAAe,GAAGA,EAAe,sBAAsB,gBAMvEA,EAAgB,oBAAoB,GAAGA,EAAe,sBAAsB,qBAK5EA,EAAgB,cAAc,GAAGA,EAAe,sBAAsB,SAMtEA,EAAgB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MAAMA,EAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsGtB,OAAO,YAAYC,GAA4B;AAC7C,WAAOA,MAAcD,EAAW;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,QAAQC,GAA4B;AACzC,WAAO,CAACD,EAAW,YAAYC,CAAS;AAAA,EAC1C;AACF;AA9GED,EAAgB,YAAY,MAC5BA,EAAgB,oBAAoB,IAKpCA,EAAgB,YAAY,YAK5BA,EAAgB,oBAAoB,uBAKpCA,EAAgB,cAAc,cAK9BA,EAAgB,mBAAmB,mBAKnCA,EAAgB,gBAAgB,gBAKhCA,EAAgB,kBAAkB,kBAKlCA,EAAgB,oBAAoB,mBAKpCA,EAAgB,uBAAuB,sBAKvCA,EAAgB,qBAAqB,qBAKrCA,EAAgB,qBAAqB,oBAKrCA,EAAgB,yBAAyB,wBAKzCA,EAAgB,yBAAyB,wBAKzCA,EAAgB,kCACd,gCAKFA,EAAgB,4BAA4B,2BAK5CA,EAAgB,mCACd,iCAKFA,EAAgB,iCACd,+BAKFA,EAAgB,wBAAwB;AA9FnC,IAAME,IAANF;AClEA,IAAKG,sBAAAA,OAIVA,EAAA,UAAU,WAKVA,EAAA,QAAQ,SAKRA,EAAA,QAAQ,SAKRA,EAAA,WAAW,YAKXA,EAAA,cAAc,eAxBJA,IAAAA,KAAA,CAAA,CAAA;AC2FL,MAAMC,KAAmB,IAsBnBC,KAAoB;"}
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/command/commandHeaders.ts","../src/command/types.ts","../src/query/operator.ts","../src/query/condition.ts","../src/query/queryable.ts","../src/types/error.ts","../src/types/function.ts","../src/types/modeling.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command Header Constants\n *\n * Defines standard HTTP header constants used in command processing within the Wow framework.\n * These headers are used to pass metadata and control information between services.\n *\n * @example\n * ```typescript\n * // Using header constants in a request\n * const request = {\n * method: 'POST',\n * headers: {\n * [CommandHeaders.TENANT_ID]: 'tenant-123',\n * [CommandHeaders.AGGREGATE_ID]: 'aggregate-456',\n * [CommandHeaders.REQUEST_ID]: 'request-789'\n * },\n * body: JSON.stringify(command)\n * };\n * ```\n */\nexport class CommandHeaders {\n /**\n * Prefix for all command-related headers\n */\n static readonly COMMAND_HEADERS_PREFIX = 'Command-';\n\n /**\n * Tenant identifier header\n * Used to identify the tenant context for the command\n */\n static readonly TENANT_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Tenant-Id`;\n\n /**\n * Owner identifier header\n * Used to identify the owner context for the command\n */\n static readonly OWNER_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Owner-Id`;\n\n /**\n * Aggregate identifier header\n * Used to identify the aggregate root for the command\n */\n static readonly AGGREGATE_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Id`;\n\n /**\n * Aggregate version header\n * Used to specify the expected version of the aggregate root\n */\n static readonly AGGREGATE_VERSION = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Version`;\n\n /**\n * Wait prefix for wait-related headers\n */\n static readonly WAIT_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Wait-`;\n\n /**\n * Wait timeout header\n * Specifies the maximum time to wait for command processing\n */\n static readonly WAIT_TIME_OUT = `${CommandHeaders.WAIT_PREFIX}Timeout`;\n\n // region Wait Stage\n /**\n * Wait stage header\n * Specifies the processing stage to wait for\n */\n static readonly WAIT_STAGE = `${CommandHeaders.WAIT_PREFIX}Stage`;\n\n /**\n * Wait context header\n * Specifies the bounded context to wait for\n */\n static readonly WAIT_CONTEXT = `${CommandHeaders.WAIT_PREFIX}Context`;\n\n /**\n * Wait processor header\n * Specifies the processor to wait for\n */\n static readonly WAIT_PROCESSOR = `${CommandHeaders.WAIT_PREFIX}Processor`;\n\n /**\n * Wait function header\n * Specifies the function to wait for\n */\n static readonly WAIT_FUNCTION = `${CommandHeaders.WAIT_PREFIX}Function`;\n // endregion\n\n // region Wait Chain Tail\n /**\n * Wait tail prefix for wait chain tail-related headers\n */\n static readonly WAIT_TAIL_PREFIX = `${CommandHeaders.WAIT_PREFIX}Tail-`;\n\n /**\n * Wait tail stage header\n * Specifies the tail processing stage to wait for\n */\n static readonly WAIT_TAIL_STAGE = `${CommandHeaders.WAIT_TAIL_PREFIX}Stage`;\n\n /**\n * Wait tail context header\n * Specifies the tail bounded context to wait for\n */\n static readonly WAIT_TAIL_CONTEXT = `${CommandHeaders.WAIT_TAIL_PREFIX}Context`;\n\n /**\n * Wait tail processor header\n * Specifies the tail processor to wait for\n */\n static readonly WAIT_TAIL_PROCESSOR = `${CommandHeaders.WAIT_TAIL_PREFIX}Processor`;\n\n /**\n * Wait tail function header\n * Specifies the tail function to wait for\n */\n static readonly WAIT_TAIL_FUNCTION = `${CommandHeaders.WAIT_TAIL_PREFIX}Function`;\n // endregion\n\n /**\n * Request identifier header\n * Used to track the request ID for correlation\n */\n static readonly REQUEST_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Request-Id`;\n\n /**\n * Local first header\n * Indicates whether to prefer local processing\n */\n static readonly LOCAL_FIRST = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Local-First`;\n\n /**\n * Command aggregate context header\n * Specifies the bounded context of the aggregate\n */\n static readonly COMMAND_AGGREGATE_CONTEXT = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Context`;\n\n /**\n * Command aggregate name header\n * Specifies the name of the aggregate\n */\n static readonly COMMAND_AGGREGATE_NAME = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Name`;\n\n /**\n * Command type header\n * Specifies the type of the command\n */\n static readonly COMMAND_TYPE = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Type`;\n\n /**\n * Command header prefix for custom headers\n * Used to prefix custom command headers\n */\n static readonly COMMAND_HEADER_X_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Header-`;\n}","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command identifier interface\n *\n * Represents the unique identifier for a command.\n */\nexport interface CommandId {\n commandId: string;\n}\n\n/**\n * Wait command identifier capable interface\n *\n * Represents the identifier of the command being waited for.\n */\nexport interface WaitCommandIdCapable {\n waitCommandId: string;\n}\n\n/**\n * Request identifier interface\n *\n * Represents the unique identifier for a request, used for idempotency control.\n */\nexport interface RequestId {\n requestId: string;\n}\n\n/**\n * Command execution stage enum\n *\n * Represents the different stages of command execution lifecycle.\n */\nexport enum CommandStage {\n /**\n * When the command is published to the command bus/queue, a completion signal is generated.\n */\n SENT = 'SENT',\n\n /**\n * When the command is processed by the aggregate root, a completion signal is generated.\n */\n PROCESSED = 'PROCESSED',\n\n /**\n * When the snapshot is generated, a completion signal is generated.\n */\n SNAPSHOT = 'SNAPSHOT',\n\n /**\n * When the events generated by the command are *projected*, a completion signal is generated.\n */\n PROJECTED = 'PROJECTED',\n\n /**\n * When the events generated by the command are processed by *event handlers*, a completion signal is generated.\n */\n EVENT_HANDLED = 'EVENT_HANDLED',\n\n /**\n * When the events generated by the command are processed by *Saga*, a completion signal is generated.\n */\n SAGA_HANDLED = 'SAGA_HANDLED',\n}\n\n/**\n * Command stage capable interface\n *\n * Represents an object that has a command execution stage.\n */\nexport interface CommandStageCapable {\n stage: CommandStage;\n}\n\n/**\n * Command result capable interface\n *\n * Represents an object that contains command execution results.\n */\nexport interface CommandResultCapable {\n result: Record<string, any>;\n}\n\n/**\n * Signal time capable interface\n *\n * Represents an object that has a signal time (timestamp).\n */\nexport interface SignalTimeCapable {\n signalTime: number;\n}\n\n/**\n * Nullable aggregate version capable interface\n *\n * Represents an object that may have an aggregate version for optimistic concurrency control.\n */\nexport interface NullableAggregateVersionCapable {\n /**\n * The aggregate version of the aggregate.\n */\n aggregateVersion?: number;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum Operator {\n /**\n * Performs logical AND on the provided condition list\n */\n AND = 'AND',\n\n /**\n * Performs logical OR on the provided condition list\n */\n OR = 'OR',\n\n /**\n * Performs logical NOR on the provided condition list\n */\n NOR = 'NOR',\n\n /**\n * Matches all documents where the `id` field value equals the specified value\n */\n ID = 'ID',\n\n /**\n * Matches all documents where the `id` field value equals any value in the specified list\n */\n IDS = 'IDS',\n\n /**\n * Matches documents where the aggregate root ID equals the specified value\n */\n AGGREGATE_ID = 'AGGREGATE_ID',\n\n /**\n * Matches all documents where the aggregate root ID equals any value in the specified list\n */\n AGGREGATE_IDS = 'AGGREGATE_IDS',\n\n /**\n * Matches all documents where the `tenantId` field value equals the specified value\n */\n TENANT_ID = 'TENANT_ID',\n\n /**\n * Matches all documents where the `ownerId` field value equals the specified value\n */\n OWNER_ID = 'OWNER_ID',\n\n /**\n * Matches all documents where the `deleted` field value equals the specified value\n */\n DELETED = 'DELETED',\n\n /**\n * Matches all documents\n */\n ALL = 'ALL',\n\n /**\n * Matches all documents where the field name value equals the specified value\n */\n EQ = 'EQ',\n\n /**\n * Matches all documents where the field name value does not equal the specified value\n */\n NE = 'NE',\n\n /**\n * Matches all documents where the given field's value is greater than the specified value\n */\n GT = 'GT',\n\n /**\n * Matches all documents where the given field's value is less than the specified value\n */\n LT = 'LT',\n\n /**\n * Matches all documents where the given field's value is greater than or equal to the specified value\n */\n GTE = 'GTE',\n\n /**\n * Matches all documents where the given field's value is less than or equal to the specified value\n */\n LTE = 'LTE',\n\n /**\n * Matches all documents where the given field's value contains the specified value\n */\n CONTAINS = 'CONTAINS',\n\n /**\n * Matches all documents where the field value equals any value in the specified list\n */\n IN = 'IN',\n\n /**\n * Matches all documents where the field value does not equal any specified value or does not exist\n */\n NOT_IN = 'NOT_IN',\n\n /**\n * Matches all documents where the field value is within the specified range\n */\n BETWEEN = 'BETWEEN',\n\n /**\n * Matches all documents where the field value is an array containing all specified values\n */\n ALL_IN = 'ALL_IN',\n\n /**\n * Matches documents where the field value starts with the specified string\n */\n STARTS_WITH = 'STARTS_WITH',\n\n /**\n * Matches documents where the field value ends with the specified string\n */\n ENDS_WITH = 'ENDS_WITH',\n\n /**\n * Matches all documents where the condition includes an array field,\n * and at least one member of the array matches the given condition.\n */\n ELEM_MATCH = 'ELEM_MATCH',\n\n /**\n * Matches all documents where the field value is `null`\n */\n NULL = 'NULL',\n\n /**\n * Matches all documents where the field value is not `null`\n */\n NOT_NULL = 'NOT_NULL',\n\n /**\n * Matches all documents where the field value is `true`\n */\n TRUE = 'TRUE',\n\n /**\n * Matches all documents where the field value is `false`\n */\n FALSE = 'FALSE',\n\n /**\n * Matches documents based on whether the field exists\n */\n EXISTS = 'EXISTS',\n\n // #region Date filtering conditions, field requirement: `long` type timestamp in milliseconds\n /**\n * Matches all documents where the field is within today's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-06 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n */\n TODAY = 'TODAY',\n\n /**\n * Matches all documents where the field is before today\n */\n BEFORE_TODAY = 'BEFORE_TODAY',\n\n /**\n * Matches all documents where the field is within yesterday's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-05 00:00:00.000` ~ `2024-06-05 23:59:59.999`\n */\n TOMORROW = 'TOMORROW',\n\n /**\n * Matches all documents where the field is within this week's range\n */\n THIS_WEEK = 'THIS_WEEK',\n\n /**\n * Matches all documents where the field is within next week's range\n */\n NEXT_WEEK = 'NEXT_WEEK',\n\n /**\n * Matches all documents where the field is within last week's range\n */\n LAST_WEEK = 'LAST_WEEK',\n\n /**\n * Matches all documents where the field is within this month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-01 00:00:00.000` ~ `2024-06-30 23:59:59.999`\n */\n THIS_MONTH = 'THIS_MONTH',\n\n /**\n * Matches all documents where the field is within last month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-05-01 00:00:00.000` ~ `2024-05-31 23:59:59.999`\n */\n LAST_MONTH = 'LAST_MONTH',\n\n /**\n * Matches all documents where the field is within the specified number of recent days\n * > For example: last 3 days\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-04 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n * - That is: today, yesterday, the day before yesterday\n */\n RECENT_DAYS = 'RECENT_DAYS',\n\n /**\n * Matches all documents where the field is before the specified number of days\n *\n * > For example: before 3 days\n * - `today`: `2024-06-06`\n * - Matching range: all documents less than `2024-06-04 00:00:00.000`\n */\n EARLIER_DAYS = 'EARLIER_DAYS',\n // #endregion\n\n /**\n * Raw operator, uses the condition value directly as the raw database query condition\n */\n RAW = 'RAW',\n}","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Operator } from './operator';\n\n/**\n * Condition option keys enumeration\n *\n * Defines standard option keys used in query conditions for special handling.\n */\nexport enum ConditionOptionKey {\n /**\n * Ignore case option key for string comparisons\n */\n IGNORE_CASE_OPTION_KEY = 'ignoreCase',\n\n /**\n * Time zone ID option key for date operations\n */\n ZONE_ID_OPTION_KEY = 'zoneId',\n\n /**\n * Date pattern option key for date formatting\n */\n DATE_PATTERN_OPTION_KEY = 'datePattern',\n}\n\n/**\n * Condition options interface\n *\n * Represents additional options that can be applied to query conditions,\n * such as case sensitivity, date patterns, and time zones.\n */\nexport interface ConditionOptions {\n /**\n * Whether to ignore case in string comparisons\n */\n ignoreCase?: boolean;\n\n /**\n * Date pattern for date formatting\n */\n datePattern?: string;\n\n /**\n * Time zone ID for date operations\n */\n zoneId?: string;\n\n /**\n * Additional custom options\n */\n [key: string]: any;\n}\n\n/**\n * Helper function to create condition options with ignoreCase flag.\n *\n * @param ignoreCase - Whether to ignore case\n * @returns Condition options or undefined if ignoreCase is undefined\n */\nexport function ignoreCaseOptions(\n ignoreCase?: boolean,\n): ConditionOptions | undefined {\n if (typeof ignoreCase === 'undefined') {\n return undefined;\n }\n return { ignoreCase };\n}\n\n/**\n * Helper function to create condition options with date pattern and zone ID.\n *\n * @param datePattern - Date pattern\n * @param zoneId - Time zone ID\n * @returns Condition options or undefined if both parameters are undefined\n */\nexport function dateOptions(\n datePattern?: string,\n zoneId?: string,\n): ConditionOptions | undefined {\n if (typeof datePattern === 'undefined' && typeof zoneId === 'undefined') {\n return undefined;\n }\n const options: ConditionOptions = {};\n if (typeof datePattern !== 'undefined') {\n options.datePattern = datePattern;\n }\n if (typeof zoneId !== 'undefined') {\n options.zoneId = zoneId;\n }\n return options;\n}\n\n/**\n * Interface for query conditions.\n *\n * When `operator` is `AND` or `OR` or `NOR`, `children` cannot be empty.\n */\nexport interface Condition {\n /**\n * Field name for the condition\n */\n field?: string;\n\n /**\n * Operator for the condition\n */\n operator?: Operator;\n\n /**\n * Value for the condition\n */\n value?: any;\n\n /**\n * Child conditions for logical operators (AND, OR, NOR)\n */\n children?: Condition[];\n\n /**\n * Additional options for the condition\n */\n options?: ConditionOptions;\n}\n\n/**\n * Interface for objects that have a condition.\n */\nexport interface ConditionCapable {\n condition: Condition;\n}\n\n/**\n * Deletion state enumeration\n *\n * Represents the different states of deletion for entities.\n */\nexport enum DeletionState {\n /**\n * Active state - entity is not deleted\n */\n ACTIVE = 'ACTIVE',\n\n /**\n * Deleted state - entity is deleted\n */\n DELETED = 'DELETED',\n\n /**\n * All state - includes both active and deleted entities\n */\n ALL = 'ALL',\n}\n\n/**\n * Creates an AND condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with AND\n * @returns A condition with AND operator\n */\nexport function and(...conditions: Condition[]): Condition {\n return { operator: Operator.AND, children: conditions };\n}\n\n/**\n * Creates an OR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with OR\n * @returns A condition with OR operator\n */\nexport function or(...conditions: Condition[]): Condition {\n return { operator: Operator.OR, children: conditions };\n}\n\n/**\n * Creates a NOR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with NOR\n * @returns A condition with NOR operator\n */\nexport function nor(...conditions: Condition[]): Condition {\n return { operator: Operator.NOR, children: conditions };\n}\n\n/**\n * Creates an ID condition with the specified value.\n *\n * @param value - The ID value to match\n * @returns A condition with ID operator\n */\nexport function id(value: string): Condition {\n return { operator: Operator.ID, value: value };\n}\n\n/**\n * Creates an IDS condition with the specified values.\n *\n * @param value - The ID values to match\n * @returns A condition with IDS operator\n */\nexport function ids(value: string[]): Condition {\n return { operator: Operator.IDS, value: value };\n}\n\n/**\n * Creates an AGGREGATE_ID condition with the specified value.\n *\n * @param value - The aggregate ID value to match\n * @returns A condition with AGGREGATE_ID operator\n */\nexport function aggregateId(value: string): Condition {\n return { operator: Operator.AGGREGATE_ID, value: value };\n}\n\n/**\n * Creates an AGGREGATE_IDS condition with the specified values.\n *\n * @param value - The aggregate ID values to match\n * @returns A condition with AGGREGATE_IDS operator\n */\nexport function aggregateIds(...value: string[]): Condition {\n return { operator: Operator.AGGREGATE_IDS, value: value };\n}\n\n/**\n * Creates a TENANT_ID condition with the specified value.\n *\n * @param value - The tenant ID value to match\n * @returns A condition with TENANT_ID operator\n */\nexport function tenantId(value: string): Condition {\n return { operator: Operator.TENANT_ID, value: value };\n}\n\n/**\n * Creates an OWNER_ID condition with the specified value.\n *\n * @param value - The owner ID value to match\n * @returns A condition with OWNER_ID operator\n */\nexport function ownerId(value: string): Condition {\n return { operator: Operator.OWNER_ID, value: value };\n}\n\n/**\n * Creates a DELETED condition with the specified value.\n *\n * @param value - The deletion state value to match\n * @returns A condition with DELETED operator\n */\nexport function deleted(value: DeletionState): Condition {\n return { operator: Operator.DELETED, value: value };\n}\n\n/**\n * Creates an ACTIVE deletion state condition.\n *\n * @returns A condition with DELETED operator set to ACTIVE\n */\nexport function active(): Condition {\n return deleted(DeletionState.ACTIVE);\n}\n\n/**\n * Creates an ALL condition.\n *\n * @returns A condition with ALL operator\n */\nexport function all(): Condition {\n return {\n operator: Operator.ALL,\n };\n}\n\n/**\n * Creates an EQ (equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with EQ operator\n */\nexport function eq(field: string, value: any): Condition {\n return { field, operator: Operator.EQ, value };\n}\n\n/**\n * Creates a NE (not equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with NE operator\n */\nexport function ne(field: string, value: any): Condition {\n return { field, operator: Operator.NE, value };\n}\n\n/**\n * Creates a GT (greater than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GT operator\n */\nexport function gt(field: string, value: any): Condition {\n return { field, operator: Operator.GT, value };\n}\n\n/**\n * Creates a LT (less than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LT operator\n */\nexport function lt(field: string, value: any): Condition {\n return { field, operator: Operator.LT, value };\n}\n\n/**\n * Creates a GTE (greater than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GTE operator\n */\nexport function gte(field: string, value: any): Condition {\n return { field, operator: Operator.GTE, value };\n}\n\n/**\n * Creates a LTE (less than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LTE operator\n */\nexport function lte(field: string, value: any): Condition {\n return { field, operator: Operator.LTE, value };\n}\n\n/**\n * Creates a CONTAINS condition with the specified field and value.\n *\n * @param field - The field name to search in\n * @param value - The value to search for\n * @param ignoreCase - Whether to ignore case in the search\n * @returns A condition with CONTAINS operator\n */\nexport function contains(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.CONTAINS, value, options };\n}\n\n/**\n * Creates an IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with IN operator\n */\nexport function isIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.IN, value };\n}\n\n/**\n * Creates a NOT_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with NOT_IN operator\n */\nexport function notIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.NOT_IN, value };\n}\n\n/**\n * Creates a BETWEEN condition with the specified field and range.\n *\n * @param field - The field name to compare\n * @param start - The start value of the range\n * @param end - The end value of the range\n * @returns A condition with BETWEEN operator\n */\nexport function between(field: string, start: any, end: any): Condition {\n return { field, operator: Operator.BETWEEN, value: [start, end] };\n}\n\n/**\n * Creates an ALL_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with ALL_IN operator\n */\nexport function allIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.ALL_IN, value };\n}\n\n/**\n * Creates a STARTS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with STARTS_WITH operator\n */\nexport function startsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.STARTS_WITH, value, options };\n}\n\n/**\n * Creates an ENDS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with ENDS_WITH operator\n */\nexport function endsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.ENDS_WITH, value, options };\n}\n\n/**\n * Creates an ELEM_MATCH condition with the specified field and child condition.\n *\n * @param field - The field name to match elements in\n * @param value - The condition to match elements against\n * @returns A condition with ELEM_MATCH operator\n */\nexport function elemMatch(field: string, value: Condition): Condition {\n return { field, operator: Operator.ELEM_MATCH, children: [value] };\n}\n\n/**\n * Creates a NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NULL operator\n */\nexport function isNull(field: string): Condition {\n return { field, operator: Operator.NULL };\n}\n\n/**\n * Creates a NOT_NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NOT_NULL operator\n */\nexport function notNull(field: string): Condition {\n return { field, operator: Operator.NOT_NULL };\n}\n\n/**\n * Creates a TRUE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with TRUE operator\n */\nexport function isTrue(field: string): Condition {\n return { field, operator: Operator.TRUE };\n}\n\n/**\n * Creates a FALSE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with FALSE operator\n */\nexport function isFalse(field: string): Condition {\n return { field, operator: Operator.FALSE };\n}\n\n/**\n * Creates an EXISTS condition with the specified field and existence flag.\n *\n * @param field - The field name to check\n * @param exists - Whether the field should exist (default: true)\n * @returns A condition with EXISTS operator\n */\nexport function exists(field: string, exists: boolean = true): Condition {\n return { field, operator: Operator.EXISTS, value: exists };\n}\n\n/**\n * Creates a TODAY condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TODAY operator\n */\nexport function today(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TODAY, options };\n}\n\n/**\n * Creates a BEFORE_TODAY condition with the specified field and time.\n *\n * @param field - The field name to check\n * @param time - The time to compare against\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with BEFORE_TODAY operator\n */\nexport function beforeToday(\n field: string,\n time: any,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.BEFORE_TODAY, value: time, options };\n}\n\n/**\n * Creates a TOMORROW condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TOMORROW operator\n */\nexport function tomorrow(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TOMORROW, options };\n}\n\n/**\n * Creates a THIS_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_WEEK operator\n */\nexport function thisWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_WEEK, options };\n}\n\n/**\n * Creates a NEXT_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with NEXT_WEEK operator\n */\nexport function nextWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.NEXT_WEEK, options };\n}\n\n/**\n * Creates a LAST_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_WEEK operator\n */\nexport function lastWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_WEEK, options };\n}\n\n/**\n * Creates a THIS_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_MONTH operator\n */\nexport function thisMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_MONTH, options };\n}\n\n/**\n * Creates a LAST_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_MONTH operator\n */\nexport function lastMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_MONTH, options };\n}\n\n/**\n * Creates a RECENT_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of recent days to include\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with RECENT_DAYS operator\n */\nexport function recentDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.RECENT_DAYS, value: days, options };\n}\n\n/**\n * Creates an EARLIER_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of days to look back\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with EARLIER_DAYS operator\n */\nexport function earlierDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.EARLIER_DAYS, value: days, options };\n}\n\n/**\n * Creates a RAW condition with the specified raw value.\n *\n * @param raw - The raw condition value\n * @returns A condition with RAW operator\n */\nexport function raw(raw: any): Condition {\n return { operator: Operator.RAW, value: raw };\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionCapable } from './condition';\n\nexport enum SortDirection {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/**\n * Interface for sort criteria.\n */\nexport interface Sort {\n field: string;\n direction: SortDirection;\n}\n\n/**\n * Interface for objects that support sorting.\n */\nexport interface SortCapable {\n sort?: Sort[];\n}\n\n/**\n * Interface for pagination information.\n *\n * Page number, starting from 1\n * Page size\n */\nexport interface Pagination {\n index: number;\n size: number;\n}\n\nexport const DEFAULT_PAGINATION: Pagination = {\n index: 1,\n size: 10,\n};\n\n/**\n * Interface for field projection.\n */\nexport interface Projection {\n include?: string[];\n exclude?: string[];\n}\n\nexport const DEFAULT_PROJECTION: Projection = {};\n\n/**\n * Interface for objects that support field projection.\n */\nexport interface ProjectionCapable {\n projection?: Projection;\n}\n\n/**\n * Interface for queryable objects that support conditions, projection, and sorting.\n */\nexport interface Queryable\n extends ConditionCapable,\n ProjectionCapable,\n SortCapable {}\n\n/**\n * Interface for single query objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface SingleQuery extends Queryable {}\n\n/**\n * Interface for list query objects.\n *\n * Limit the number of results. Default: DEFAULT_PAGINATION.size\n */\nexport interface ListQuery extends Queryable {\n limit?: number;\n}\n\n/**\n * Interface for paged query objects.\n */\nexport interface PagedQuery extends Queryable {\n pagination?: Pagination;\n}\n\n/**\n * Interface for paged list results.\n */\nexport interface PagedList<T> {\n total: number;\n list: T[];\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Enumerates the types of recoverability for errors or operations, allowing for classification and handling based on whether an error is transient and can be resolved by retrying.\n *\n * The [RecoverableType] enum provides a way to categorize errors into three distinct categories: [RECOVERABLE], [UNRECOVERABLE], and [UNKNOWN].\n * This categorization is essential for implementing robust error handling and retry mechanisms in applications,\n * ensuring that temporary issues are retried while permanent or unknown issues are handled appropriately.\n *\n */\nexport enum RecoverableType {\n /**\n * Represents an error type that indicates the operation or error can be retried.\n *\n * This enum value is used to classify errors in a way that allows for the implementation of retry logic. When an error\n * is marked as [RECOVERABLE], it signifies that the error condition is temporary and might be resolved upon retrying the\n * operation. This is particularly useful in scenarios where network issues, transient server errors, or other temporary\n * conditions may cause an operation to fail, but with a high likelihood of success on subsequent attempts.\n */\n RECOVERABLE = 'RECOVERABLE',\n /**\n * Represents an error type that indicates the operation or error cannot be retried.\n *\n * This enum value is used to classify errors in a way that signifies the error condition is permanent and retrying the operation will not resolve the issue. It is particularly\n * useful for handling errors where the underlying problem is fundamental and cannot be resolved by simply retrying, such as invalid input, resource exhaustion, or other non-transient\n * issues.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * Represents an unknown type of recoverability for an error or operation.\n * This is used when the recoverability of an error cannot be determined or is not specified.\n */\n UNRECOVERABLE = 'UNRECOVERABLE',\n}\n\n/**\n * Represents an error that occurs during the binding process, typically when data is being mapped to or from an object.\n * This class extends the [Named] interface, inheriting the `name` property which can be used to identify the source or context of the error.\n *\n * @param name The name or identifier for the context in which the error occurred.\n * @param msg A message describing the error.\n */\nexport interface BindingError {\n name: string;\n msg: string;\n}\n\n/**\n * Represents the information about an error, including whether the operation succeeded, the error code, and any associated messages or binding errors.\n *\n * This interface is designed to provide a standardized way of handling and representing errors across different parts of an application. It includes methods to check if the operation was successful, retrieve the error code\n * , and access any additional error details such as messages or binding errors.\n */\nexport interface ErrorInfo {\n /**\n * Represents the error code associated with an error. This value is used to identify the type of error that has occurred,\n * which can be useful for debugging, logging, and handling errors in a standardized way.\n */\n errorCode: string;\n /**\n * Represents the message associated with an error. This message provides a human-readable description of the error, which can be used for logging, debugging, or displaying to the user\n * .\n */\n errorMsg: string;\n /**\n * Provides a list of [BindingError] instances that occurred during the binding process.\n * Each [BindingError] contains information about the error, including its name and a message describing the issue.\n * This property returns an empty list if no binding errors are present.\n */\n bindingErrors?: BindingError[];\n}\n\nexport class ErrorCodes {\n /**\n * A constant representing a successful operation or status.\n * This value is typically used in the context of error handling and response descriptions to indicate that an operation has been completed successfully.\n */\n static readonly SUCCEEDED = 'Ok';\n static readonly SUCCEEDED_MESSAGE = '';\n\n /**\n * Error code for when a requested resource is not found.\n */\n static readonly NOT_FOUND = 'NotFound';\n\n /**\n * Default message for NOT_FOUND error code.\n */\n static readonly NOT_FOUND_MESSAGE = 'Not found resource!';\n\n /**\n * Error code for bad request errors.\n */\n static readonly BAD_REQUEST = 'BadRequest';\n\n /**\n * Error code for illegal argument errors.\n */\n static readonly ILLEGAL_ARGUMENT = 'IllegalArgument';\n\n /**\n * Error code for illegal state errors.\n */\n static readonly ILLEGAL_STATE = 'IllegalState';\n\n /**\n * Error code for request timeout errors.\n */\n static readonly REQUEST_TIMEOUT = 'RequestTimeout';\n\n /**\n * Error code for too many requests errors (rate limiting).\n */\n static readonly TOO_MANY_REQUESTS = 'TooManyRequests';\n\n /**\n * Error code for duplicate request ID errors.\n */\n static readonly DUPLICATE_REQUEST_ID = 'DuplicateRequestId';\n\n /**\n * Error code for command validation errors.\n */\n static readonly COMMAND_VALIDATION = 'CommandValidation';\n\n /**\n * Error code for when no command is found to rewrite.\n */\n static readonly REWRITE_NO_COMMAND = 'RewriteNoCommand';\n\n /**\n * Error code for event version conflicts.\n */\n static readonly EVENT_VERSION_CONFLICT = 'EventVersionConflict';\n\n /**\n * Error code for duplicate aggregate ID errors.\n */\n static readonly DUPLICATE_AGGREGATE_ID = 'DuplicateAggregateId';\n\n /**\n * Error code for command expected version conflicts.\n */\n static readonly COMMAND_EXPECT_VERSION_CONFLICT =\n 'CommandExpectVersionConflict';\n\n /**\n * Error code for sourcing version conflicts.\n */\n static readonly SOURCING_VERSION_CONFLICT = 'SourcingVersionConflict';\n\n /**\n * Error code for illegal access to deleted aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_DELETED_AGGREGATE =\n 'IllegalAccessDeletedAggregate';\n\n /**\n * Error code for illegal access to owner aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_OWNER_AGGREGATE =\n 'IllegalAccessOwnerAggregate';\n\n /**\n * Error code for internal server errors.\n */\n static readonly INTERNAL_SERVER_ERROR = 'InternalServerError';\n\n /**\n * Checks if the provided error code represents a successful operation.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is 'Ok', false otherwise\n */\n static isSucceeded(errorCode: string): boolean {\n return errorCode === ErrorCodes.SUCCEEDED;\n }\n\n /**\n * Checks if the provided error code represents an error condition.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is not 'Ok', false otherwise\n */\n static isError(errorCode: string): boolean {\n return !ErrorCodes.isSucceeded(errorCode);\n }\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Function kind enum\n *\n * Represents the different types of functions in the system.\n */\nexport enum FunctionKind {\n /**\n * Command function kind\n */\n COMMAND = 'COMMAND',\n\n /**\n * Error function kind\n */\n ERROR = 'ERROR',\n\n /**\n * Event function kind\n */\n EVENT = 'EVENT',\n\n /**\n * Sourcing function kind\n */\n SOURCING = 'SOURCING',\n\n /**\n * State event function kind\n */\n STATE_EVENT = 'STATE_EVENT',\n}\n\n/**\n * Interface for function information.\n */\nexport interface FunctionInfo {\n functionKind: FunctionKind;\n contextName: string;\n processorName: string;\n name: string;\n}\n\n/**\n * Interface for objects that have function information.\n */\nexport interface FunctionInfoCapable {\n function: FunctionInfo;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { NamedBoundedContext } from './naming.ts';\n\n/**\n * Interface for classes that have a creation time.\n */\nexport interface CreateTimeCapable {\n /**\n * Gets the creation time in milliseconds since the Unix epoch.\n */\n createTime: number;\n}\n\n/**\n * Interface for objects that track deletion status.\n */\nexport interface DeletedCapable {\n /**\n * Whether the aggregate is deleted.\n */\n deleted: boolean;\n}\n\n/**\n * Interface for objects that track event IDs.\n */\nexport interface EventIdCapable {\n /**\n * The event id of the aggregate.\n */\n eventId: string;\n}\n\n/**\n * Interface for objects that track event times.\n */\nexport interface EventTimeCapable {\n /**\n * The last event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n eventTime: number;\n}\n\n/**\n * Interface for objects that track the first event time.\n */\nexport interface FirstEventTimeCapable {\n /**\n * The first event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n firstEventTime: number;\n}\n\n/**\n * Interface for objects that track the first operator.\n */\nexport interface FirstOperatorCapable {\n /**\n * The first operator of the aggregate.\n */\n firstOperator: string;\n}\n\n/**\n * Interface for objects that have an aggregate name.\n */\nexport interface AggregateNameCapable {\n /**\n * The name of the aggregate.\n */\n aggregateName: string;\n}\n\n/**\n * Interface for named aggregates that belong to a bounded context.\n */\nexport interface NamedAggregate\n extends NamedBoundedContext,\n AggregateNameCapable {}\n\n/**\n * Interface for aggregate IDs that combine tenant and named aggregate information.\n */\nexport interface AggregateId extends TenantId, NamedAggregate {\n aggregateId: string;\n}\n\n/**\n * Interface for objects that track the last operator.\n */\nexport interface OperatorCapable {\n /**\n * The last operator of the aggregate.\n */\n operator: string;\n}\n\nexport const DEFAULT_OWNER_ID = '';\n\n/**\n * Interface for identifying resource owners.\n */\nexport interface OwnerId {\n /**\n * Unique identifier of the resource owner.\n */\n ownerId: string;\n}\n\n/**\n * Interface for objects that track snapshot times.\n */\nexport interface SnapshotTimeCapable {\n /**\n * The snapshot time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n snapshotTime: number;\n}\n\nexport const DEFAULT_TENANT_ID = '(0)';\n\n/**\n * Interface for objects that have a tenant ID.\n */\nexport interface TenantId {\n tenantId: string;\n}\n\n/**\n * Interface for objects that hold state.\n */\nexport interface StateCapable<S> {\n state: S;\n}\n"],"names":["_CommandHeaders","CommandHeaders","CommandStage","Operator","ConditionOptionKey","ignoreCaseOptions","ignoreCase","dateOptions","datePattern","zoneId","options","DeletionState","and","conditions","or","nor","id","value","ids","aggregateId","aggregateIds","tenantId","ownerId","deleted","active","all","eq","field","ne","gt","lt","gte","lte","contains","isIn","notIn","between","start","end","allIn","startsWith","endsWith","elemMatch","isNull","notNull","isTrue","isFalse","exists","today","beforeToday","time","tomorrow","thisWeek","nextWeek","lastWeek","thisMonth","lastMonth","recentDays","days","earlierDays","raw","SortDirection","DEFAULT_PAGINATION","DEFAULT_PROJECTION","RecoverableType","_ErrorCodes","errorCode","ErrorCodes","FunctionKind","DEFAULT_OWNER_ID","DEFAULT_TENANT_ID"],"mappings":"mOAiCO,MAAMA,EAAN,MAAMA,CAAe,CAqI5B,EAjIEA,EAAgB,uBAAyB,WAMzCA,EAAgB,UAAY,GAAGA,EAAe,sBAAsB,YAMpEA,EAAgB,SAAW,GAAGA,EAAe,sBAAsB,WAMnEA,EAAgB,aAAe,GAAGA,EAAe,sBAAsB,eAMvEA,EAAgB,kBAAoB,GAAGA,EAAe,sBAAsB,oBAK5EA,EAAgB,YAAc,GAAGA,EAAe,sBAAsB,QAMtEA,EAAgB,cAAgB,GAAGA,EAAe,WAAW,UAO7DA,EAAgB,WAAa,GAAGA,EAAe,WAAW,QAM1DA,EAAgB,aAAe,GAAGA,EAAe,WAAW,UAM5DA,EAAgB,eAAiB,GAAGA,EAAe,WAAW,YAM9DA,EAAgB,cAAgB,GAAGA,EAAe,WAAW,WAO7DA,EAAgB,iBAAmB,GAAGA,EAAe,WAAW,QAMhEA,EAAgB,gBAAkB,GAAGA,EAAe,gBAAgB,QAMpEA,EAAgB,kBAAoB,GAAGA,EAAe,gBAAgB,UAMtEA,EAAgB,oBAAsB,GAAGA,EAAe,gBAAgB,YAMxEA,EAAgB,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gB,uBAAyB,uBAKzCA,EAAgB,uBAAyB,uBAKzCA,EAAgB,gCACd,+BAKFA,EAAgB,0BAA4B,0BAK5CA,EAAgB,iCACd,gCAKFA,EAAgB,+BACd,8BAKFA,EAAgB,sBAAwB,sBA9FnC,IAAME,EAANF,EClEA,IAAKG,GAAAA,IAIVA,EAAA,QAAU,UAKVA,EAAA,MAAQ,QAKRA,EAAA,MAAQ,QAKRA,EAAA,SAAW,WAKXA,EAAA,YAAc,cAxBJA,IAAAA,GAAA,CAAA,CAAA,EC2FL,MAAMC,GAAmB,GAsBnBC,GAAoB"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/command/commandHeaders.ts","../src/command/types.ts","../src/query/operator.ts","../src/query/condition.ts","../src/query/queryable.ts","../src/types/error.ts","../src/types/function.ts","../src/types/modeling.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command Header Constants\n *\n * Defines standard HTTP header constants used in command processing within the Wow framework.\n * These headers are used to pass metadata and control information between services.\n *\n * @example\n * ```typescript\n * // Using header constants in a request\n * const request = {\n * method: 'POST',\n * headers: {\n * [CommandHeaders.TENANT_ID]: 'tenant-123',\n * [CommandHeaders.AGGREGATE_ID]: 'aggregate-456',\n * [CommandHeaders.REQUEST_ID]: 'request-789'\n * },\n * body: JSON.stringify(command)\n * };\n * ```\n */\nexport class CommandHeaders {\n /**\n * Prefix for all command-related headers\n */\n static readonly COMMAND_HEADERS_PREFIX = 'Command-';\n\n /**\n * Tenant identifier header\n * Used to identify the tenant context for the command\n */\n static readonly TENANT_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Tenant-Id`;\n\n /**\n * Owner identifier header\n * Used to identify the owner context for the command\n */\n static readonly OWNER_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Owner-Id`;\n\n /**\n * Aggregate identifier header\n * Used to identify the aggregate root for the command\n */\n static readonly AGGREGATE_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Id`;\n\n /**\n * Aggregate version header\n * Used to specify the expected version of the aggregate root\n */\n static readonly AGGREGATE_VERSION = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Version`;\n\n /**\n * Wait prefix for wait-related headers\n */\n static readonly WAIT_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Wait-`;\n\n /**\n * Wait timeout header\n * Specifies the maximum time to wait for command processing\n */\n static readonly WAIT_TIME_OUT = `${CommandHeaders.WAIT_PREFIX}Timeout`;\n\n // region Wait Stage\n /**\n * Wait stage header\n * Specifies the processing stage to wait for\n */\n static readonly WAIT_STAGE = `${CommandHeaders.WAIT_PREFIX}Stage`;\n\n /**\n * Wait context header\n * Specifies the bounded context to wait for\n */\n static readonly WAIT_CONTEXT = `${CommandHeaders.WAIT_PREFIX}Context`;\n\n /**\n * Wait processor header\n * Specifies the processor to wait for\n */\n static readonly WAIT_PROCESSOR = `${CommandHeaders.WAIT_PREFIX}Processor`;\n\n /**\n * Wait function header\n * Specifies the function to wait for\n */\n static readonly WAIT_FUNCTION = `${CommandHeaders.WAIT_PREFIX}Function`;\n // endregion\n\n // region Wait Chain Tail\n /**\n * Wait tail prefix for wait chain tail-related headers\n */\n static readonly WAIT_TAIL_PREFIX = `${CommandHeaders.WAIT_PREFIX}Tail-`;\n\n /**\n * Wait tail stage header\n * Specifies the tail processing stage to wait for\n */\n static readonly WAIT_TAIL_STAGE = `${CommandHeaders.WAIT_TAIL_PREFIX}Stage`;\n\n /**\n * Wait tail context header\n * Specifies the tail bounded context to wait for\n */\n static readonly WAIT_TAIL_CONTEXT = `${CommandHeaders.WAIT_TAIL_PREFIX}Context`;\n\n /**\n * Wait tail processor header\n * Specifies the tail processor to wait for\n */\n static readonly WAIT_TAIL_PROCESSOR = `${CommandHeaders.WAIT_TAIL_PREFIX}Processor`;\n\n /**\n * Wait tail function header\n * Specifies the tail function to wait for\n */\n static readonly WAIT_TAIL_FUNCTION = `${CommandHeaders.WAIT_TAIL_PREFIX}Function`;\n // endregion\n\n /**\n * Request identifier header\n * Used to track the request ID for correlation\n */\n static readonly REQUEST_ID = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Request-Id`;\n\n /**\n * Local first header\n * Indicates whether to prefer local processing\n */\n static readonly LOCAL_FIRST = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Local-First`;\n\n /**\n * Command aggregate context header\n * Specifies the bounded context of the aggregate\n */\n static readonly COMMAND_AGGREGATE_CONTEXT = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Context`;\n\n /**\n * Command aggregate name header\n * Specifies the name of the aggregate\n */\n static readonly COMMAND_AGGREGATE_NAME = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Aggregate-Name`;\n\n /**\n * Command type header\n * Specifies the type of the command\n */\n static readonly COMMAND_TYPE = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Type`;\n\n /**\n * Command header prefix for custom headers\n * Used to prefix custom command headers\n */\n static readonly COMMAND_HEADER_X_PREFIX = `${CommandHeaders.COMMAND_HEADERS_PREFIX}Header-`;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Command identifier interface\n *\n * Represents the unique identifier for a command.\n */\nexport interface CommandId {\n commandId: string;\n}\n\n/**\n * Wait command identifier capable interface\n *\n * Represents the identifier of the command being waited for.\n */\nexport interface WaitCommandIdCapable {\n waitCommandId: string;\n}\n\n/**\n * Request identifier interface\n *\n * Represents the unique identifier for a request, used for idempotency control.\n */\nexport interface RequestId {\n requestId: string;\n}\n\n/**\n * Command execution stage enum\n *\n * Represents the different stages of command execution lifecycle.\n */\nexport enum CommandStage {\n /**\n * When the command is published to the command bus/queue, a completion signal is generated.\n */\n SENT = 'SENT',\n\n /**\n * When the command is processed by the aggregate root, a completion signal is generated.\n */\n PROCESSED = 'PROCESSED',\n\n /**\n * When the snapshot is generated, a completion signal is generated.\n */\n SNAPSHOT = 'SNAPSHOT',\n\n /**\n * When the events generated by the command are *projected*, a completion signal is generated.\n */\n PROJECTED = 'PROJECTED',\n\n /**\n * When the events generated by the command are processed by *event handlers*, a completion signal is generated.\n */\n EVENT_HANDLED = 'EVENT_HANDLED',\n\n /**\n * When the events generated by the command are processed by *Saga*, a completion signal is generated.\n */\n SAGA_HANDLED = 'SAGA_HANDLED',\n}\n\n/**\n * Command stage capable interface\n *\n * Represents an object that has a command execution stage.\n */\nexport interface CommandStageCapable {\n stage: CommandStage;\n}\n\n/**\n * Command result capable interface\n *\n * Represents an object that contains command execution results.\n */\nexport interface CommandResultCapable {\n result: Record<string, any>;\n}\n\n/**\n * Signal time capable interface\n *\n * Represents an object that has a signal time (timestamp).\n */\nexport interface SignalTimeCapable {\n signalTime: number;\n}\n\n/**\n * Nullable aggregate version capable interface\n *\n * Represents an object that may have an aggregate version for optimistic concurrency control.\n */\nexport interface NullableAggregateVersionCapable {\n /**\n * The aggregate version of the aggregate.\n */\n aggregateVersion?: number;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum Operator {\n /**\n * Performs logical AND on the provided condition list\n */\n AND = 'AND',\n\n /**\n * Performs logical OR on the provided condition list\n */\n OR = 'OR',\n\n /**\n * Performs logical NOR on the provided condition list\n */\n NOR = 'NOR',\n\n /**\n * Matches all documents where the `id` field value equals the specified value\n */\n ID = 'ID',\n\n /**\n * Matches all documents where the `id` field value equals any value in the specified list\n */\n IDS = 'IDS',\n\n /**\n * Matches documents where the aggregate root ID equals the specified value\n */\n AGGREGATE_ID = 'AGGREGATE_ID',\n\n /**\n * Matches all documents where the aggregate root ID equals any value in the specified list\n */\n AGGREGATE_IDS = 'AGGREGATE_IDS',\n\n /**\n * Matches all documents where the `tenantId` field value equals the specified value\n */\n TENANT_ID = 'TENANT_ID',\n\n /**\n * Matches all documents where the `ownerId` field value equals the specified value\n */\n OWNER_ID = 'OWNER_ID',\n\n /**\n * Matches all documents where the `deleted` field value equals the specified value\n */\n DELETED = 'DELETED',\n\n /**\n * Matches all documents\n */\n ALL = 'ALL',\n\n /**\n * Matches all documents where the field name value equals the specified value\n */\n EQ = 'EQ',\n\n /**\n * Matches all documents where the field name value does not equal the specified value\n */\n NE = 'NE',\n\n /**\n * Matches all documents where the given field's value is greater than the specified value\n */\n GT = 'GT',\n\n /**\n * Matches all documents where the given field's value is less than the specified value\n */\n LT = 'LT',\n\n /**\n * Matches all documents where the given field's value is greater than or equal to the specified value\n */\n GTE = 'GTE',\n\n /**\n * Matches all documents where the given field's value is less than or equal to the specified value\n */\n LTE = 'LTE',\n\n /**\n * Matches all documents where the given field's value contains the specified value\n */\n CONTAINS = 'CONTAINS',\n\n /**\n * Matches all documents where the field value equals any value in the specified list\n */\n IN = 'IN',\n\n /**\n * Matches all documents where the field value does not equal any specified value or does not exist\n */\n NOT_IN = 'NOT_IN',\n\n /**\n * Matches all documents where the field value is within the specified range\n */\n BETWEEN = 'BETWEEN',\n\n /**\n * Matches all documents where the field value is an array containing all specified values\n */\n ALL_IN = 'ALL_IN',\n\n /**\n * Matches documents where the field value starts with the specified string\n */\n STARTS_WITH = 'STARTS_WITH',\n\n /**\n * Matches documents where the field value ends with the specified string\n */\n ENDS_WITH = 'ENDS_WITH',\n\n /**\n * Matches all documents where the condition includes an array field,\n * and at least one member of the array matches the given condition.\n */\n ELEM_MATCH = 'ELEM_MATCH',\n\n /**\n * Matches all documents where the field value is `null`\n */\n NULL = 'NULL',\n\n /**\n * Matches all documents where the field value is not `null`\n */\n NOT_NULL = 'NOT_NULL',\n\n /**\n * Matches all documents where the field value is `true`\n */\n TRUE = 'TRUE',\n\n /**\n * Matches all documents where the field value is `false`\n */\n FALSE = 'FALSE',\n\n /**\n * Matches documents based on whether the field exists\n */\n EXISTS = 'EXISTS',\n\n // #region Date filtering conditions, field requirement: `long` type timestamp in milliseconds\n /**\n * Matches all documents where the field is within today's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-06 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n */\n TODAY = 'TODAY',\n\n /**\n * Matches all documents where the field is before today\n */\n BEFORE_TODAY = 'BEFORE_TODAY',\n\n /**\n * Matches all documents where the field is within yesterday's range\n * > For example: if `today` is `2024-06-06`, matches documents in the range\n * `2024-06-05 00:00:00.000` ~ `2024-06-05 23:59:59.999`\n */\n TOMORROW = 'TOMORROW',\n\n /**\n * Matches all documents where the field is within this week's range\n */\n THIS_WEEK = 'THIS_WEEK',\n\n /**\n * Matches all documents where the field is within next week's range\n */\n NEXT_WEEK = 'NEXT_WEEK',\n\n /**\n * Matches all documents where the field is within last week's range\n */\n LAST_WEEK = 'LAST_WEEK',\n\n /**\n * Matches all documents where the field is within this month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-01 00:00:00.000` ~ `2024-06-30 23:59:59.999`\n */\n THIS_MONTH = 'THIS_MONTH',\n\n /**\n * Matches all documents where the field is within last month's range\n * > For example:\n * - `today`: `2024-06-06`\n * - Matching range: `2024-05-01 00:00:00.000` ~ `2024-05-31 23:59:59.999`\n */\n LAST_MONTH = 'LAST_MONTH',\n\n /**\n * Matches all documents where the field is within the specified number of recent days\n * > For example: last 3 days\n * - `today`: `2024-06-06`\n * - Matching range: `2024-06-04 00:00:00.000` ~ `2024-06-06 23:59:59.999`\n * - That is: today, yesterday, the day before yesterday\n */\n RECENT_DAYS = 'RECENT_DAYS',\n\n /**\n * Matches all documents where the field is before the specified number of days\n *\n * > For example: before 3 days\n * - `today`: `2024-06-06`\n * - Matching range: all documents less than `2024-06-04 00:00:00.000`\n */\n EARLIER_DAYS = 'EARLIER_DAYS',\n // #endregion\n\n /**\n * Raw operator, uses the condition value directly as the raw database query condition\n */\n RAW = 'RAW',\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Operator } from './operator';\n\n/**\n * Condition option keys enumeration\n *\n * Defines standard option keys used in query conditions for special handling.\n */\nexport enum ConditionOptionKey {\n /**\n * Ignore case option key for string comparisons\n */\n IGNORE_CASE_OPTION_KEY = 'ignoreCase',\n\n /**\n * Time zone ID option key for date operations\n */\n ZONE_ID_OPTION_KEY = 'zoneId',\n\n /**\n * Date pattern option key for date formatting\n */\n DATE_PATTERN_OPTION_KEY = 'datePattern',\n}\n\n/**\n * Condition options interface\n *\n * Represents additional options that can be applied to query conditions,\n * such as case sensitivity, date patterns, and time zones.\n */\nexport interface ConditionOptions {\n /**\n * Whether to ignore case in string comparisons\n */\n ignoreCase?: boolean;\n\n /**\n * Date pattern for date formatting\n */\n datePattern?: string;\n\n /**\n * Time zone ID for date operations\n */\n zoneId?: string;\n\n /**\n * Additional custom options\n */\n [key: string]: any;\n}\n\n/**\n * Helper function to create condition options with ignoreCase flag.\n *\n * @param ignoreCase - Whether to ignore case\n * @returns Condition options or undefined if ignoreCase is undefined\n */\nexport function ignoreCaseOptions(\n ignoreCase?: boolean,\n): ConditionOptions | undefined {\n if (typeof ignoreCase === 'undefined') {\n return undefined;\n }\n return { ignoreCase };\n}\n\n/**\n * Helper function to create condition options with date pattern and zone ID.\n *\n * @param datePattern - Date pattern\n * @param zoneId - Time zone ID\n * @returns Condition options or undefined if both parameters are undefined\n */\nexport function dateOptions(\n datePattern?: string,\n zoneId?: string,\n): ConditionOptions | undefined {\n if (typeof datePattern === 'undefined' && typeof zoneId === 'undefined') {\n return undefined;\n }\n const options: ConditionOptions = {};\n if (typeof datePattern !== 'undefined') {\n options.datePattern = datePattern;\n }\n if (typeof zoneId !== 'undefined') {\n options.zoneId = zoneId;\n }\n return options;\n}\n\n/**\n * Interface for query conditions.\n *\n * When `operator` is `AND` or `OR` or `NOR`, `children` cannot be empty.\n */\nexport interface Condition {\n /**\n * Field name for the condition\n */\n field?: string;\n\n /**\n * Operator for the condition\n */\n operator?: Operator;\n\n /**\n * Value for the condition\n */\n value?: any;\n\n /**\n * Child conditions for logical operators (AND, OR, NOR)\n */\n children?: Condition[];\n\n /**\n * Additional options for the condition\n */\n options?: ConditionOptions;\n}\n\n/**\n * Interface for objects that have a condition.\n */\nexport interface ConditionCapable {\n condition: Condition;\n}\n\n/**\n * Deletion state enumeration\n *\n * Represents the different states of deletion for entities.\n */\nexport enum DeletionState {\n /**\n * Active state - entity is not deleted\n */\n ACTIVE = 'ACTIVE',\n\n /**\n * Deleted state - entity is deleted\n */\n DELETED = 'DELETED',\n\n /**\n * All state - includes both active and deleted entities\n */\n ALL = 'ALL',\n}\n\n/**\n * Creates an AND condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with AND\n * @returns A condition with AND operator\n */\nexport function and(...conditions: Condition[]): Condition {\n return { operator: Operator.AND, children: conditions };\n}\n\n/**\n * Creates an OR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with OR\n * @returns A condition with OR operator\n */\nexport function or(...conditions: Condition[]): Condition {\n return { operator: Operator.OR, children: conditions };\n}\n\n/**\n * Creates a NOR condition with the specified conditions.\n *\n * @param conditions - Conditions to combine with NOR\n * @returns A condition with NOR operator\n */\nexport function nor(...conditions: Condition[]): Condition {\n return { operator: Operator.NOR, children: conditions };\n}\n\n/**\n * Creates an ID condition with the specified value.\n *\n * @param value - The ID value to match\n * @returns A condition with ID operator\n */\nexport function id(value: string): Condition {\n return { operator: Operator.ID, value: value };\n}\n\n/**\n * Creates an IDS condition with the specified values.\n *\n * @param value - The ID values to match\n * @returns A condition with IDS operator\n */\nexport function ids(value: string[]): Condition {\n return { operator: Operator.IDS, value: value };\n}\n\n/**\n * Creates an AGGREGATE_ID condition with the specified value.\n *\n * @param value - The aggregate ID value to match\n * @returns A condition with AGGREGATE_ID operator\n */\nexport function aggregateId(value: string): Condition {\n return { operator: Operator.AGGREGATE_ID, value: value };\n}\n\n/**\n * Creates an AGGREGATE_IDS condition with the specified values.\n *\n * @param value - The aggregate ID values to match\n * @returns A condition with AGGREGATE_IDS operator\n */\nexport function aggregateIds(...value: string[]): Condition {\n return { operator: Operator.AGGREGATE_IDS, value: value };\n}\n\n/**\n * Creates a TENANT_ID condition with the specified value.\n *\n * @param value - The tenant ID value to match\n * @returns A condition with TENANT_ID operator\n */\nexport function tenantId(value: string): Condition {\n return { operator: Operator.TENANT_ID, value: value };\n}\n\n/**\n * Creates an OWNER_ID condition with the specified value.\n *\n * @param value - The owner ID value to match\n * @returns A condition with OWNER_ID operator\n */\nexport function ownerId(value: string): Condition {\n return { operator: Operator.OWNER_ID, value: value };\n}\n\n/**\n * Creates a DELETED condition with the specified value.\n *\n * @param value - The deletion state value to match\n * @returns A condition with DELETED operator\n */\nexport function deleted(value: DeletionState): Condition {\n return { operator: Operator.DELETED, value: value };\n}\n\n/**\n * Creates an ACTIVE deletion state condition.\n *\n * @returns A condition with DELETED operator set to ACTIVE\n */\nexport function active(): Condition {\n return deleted(DeletionState.ACTIVE);\n}\n\n/**\n * Creates an ALL condition.\n *\n * @returns A condition with ALL operator\n */\nexport function all(): Condition {\n return {\n operator: Operator.ALL,\n };\n}\n\n/**\n * Creates an EQ (equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with EQ operator\n */\nexport function eq(field: string, value: any): Condition {\n return { field, operator: Operator.EQ, value };\n}\n\n/**\n * Creates a NE (not equals) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with NE operator\n */\nexport function ne(field: string, value: any): Condition {\n return { field, operator: Operator.NE, value };\n}\n\n/**\n * Creates a GT (greater than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GT operator\n */\nexport function gt(field: string, value: any): Condition {\n return { field, operator: Operator.GT, value };\n}\n\n/**\n * Creates a LT (less than) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LT operator\n */\nexport function lt(field: string, value: any): Condition {\n return { field, operator: Operator.LT, value };\n}\n\n/**\n * Creates a GTE (greater than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with GTE operator\n */\nexport function gte(field: string, value: any): Condition {\n return { field, operator: Operator.GTE, value };\n}\n\n/**\n * Creates a LTE (less than or equal) condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @returns A condition with LTE operator\n */\nexport function lte(field: string, value: any): Condition {\n return { field, operator: Operator.LTE, value };\n}\n\n/**\n * Creates a CONTAINS condition with the specified field and value.\n *\n * @param field - The field name to search in\n * @param value - The value to search for\n * @param ignoreCase - Whether to ignore case in the search\n * @returns A condition with CONTAINS operator\n */\nexport function contains(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.CONTAINS, value, options };\n}\n\n/**\n * Creates an IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with IN operator\n */\nexport function isIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.IN, value };\n}\n\n/**\n * Creates a NOT_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with NOT_IN operator\n */\nexport function notIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.NOT_IN, value };\n}\n\n/**\n * Creates a BETWEEN condition with the specified field and range.\n *\n * @param field - The field name to compare\n * @param start - The start value of the range\n * @param end - The end value of the range\n * @returns A condition with BETWEEN operator\n */\nexport function between(field: string, start: any, end: any): Condition {\n return { field, operator: Operator.BETWEEN, value: [start, end] };\n}\n\n/**\n * Creates an ALL_IN condition with the specified field and values.\n *\n * @param field - The field name to compare\n * @param value - The values to compare against\n * @returns A condition with ALL_IN operator\n */\nexport function allIn(field: string, ...value: any[]): Condition {\n return { field, operator: Operator.ALL_IN, value };\n}\n\n/**\n * Creates a STARTS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with STARTS_WITH operator\n */\nexport function startsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.STARTS_WITH, value, options };\n}\n\n/**\n * Creates an ENDS_WITH condition with the specified field and value.\n *\n * @param field - The field name to compare\n * @param value - The value to compare against\n * @param ignoreCase - Whether to ignore case in the comparison\n * @returns A condition with ENDS_WITH operator\n */\nexport function endsWith(\n field: string,\n value: any,\n ignoreCase?: boolean,\n): Condition {\n const options: Record<string, any> | undefined =\n ignoreCaseOptions(ignoreCase);\n return { field, operator: Operator.ENDS_WITH, value, options };\n}\n\n/**\n * Creates an ELEM_MATCH condition with the specified field and child condition.\n *\n * @param field - The field name to match elements in\n * @param value - The condition to match elements against\n * @returns A condition with ELEM_MATCH operator\n */\nexport function elemMatch(field: string, value: Condition): Condition {\n return { field, operator: Operator.ELEM_MATCH, children: [value] };\n}\n\n/**\n * Creates a NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NULL operator\n */\nexport function isNull(field: string): Condition {\n return { field, operator: Operator.NULL };\n}\n\n/**\n * Creates a NOT_NULL condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with NOT_NULL operator\n */\nexport function notNull(field: string): Condition {\n return { field, operator: Operator.NOT_NULL };\n}\n\n/**\n * Creates a TRUE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with TRUE operator\n */\nexport function isTrue(field: string): Condition {\n return { field, operator: Operator.TRUE };\n}\n\n/**\n * Creates a FALSE condition with the specified field.\n *\n * @param field - The field name to check\n * @returns A condition with FALSE operator\n */\nexport function isFalse(field: string): Condition {\n return { field, operator: Operator.FALSE };\n}\n\n/**\n * Creates an EXISTS condition with the specified field and existence flag.\n *\n * @param field - The field name to check\n * @param exists - Whether the field should exist (default: true)\n * @returns A condition with EXISTS operator\n */\nexport function exists(field: string, exists: boolean = true): Condition {\n return { field, operator: Operator.EXISTS, value: exists };\n}\n\n/**\n * Creates a TODAY condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TODAY operator\n */\nexport function today(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TODAY, options };\n}\n\n/**\n * Creates a BEFORE_TODAY condition with the specified field and time.\n *\n * @param field - The field name to check\n * @param time - The time to compare against\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with BEFORE_TODAY operator\n */\nexport function beforeToday(\n field: string,\n time: any,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.BEFORE_TODAY, value: time, options };\n}\n\n/**\n * Creates a TOMORROW condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with TOMORROW operator\n */\nexport function tomorrow(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.TOMORROW, options };\n}\n\n/**\n * Creates a THIS_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_WEEK operator\n */\nexport function thisWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_WEEK, options };\n}\n\n/**\n * Creates a NEXT_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with NEXT_WEEK operator\n */\nexport function nextWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.NEXT_WEEK, options };\n}\n\n/**\n * Creates a LAST_WEEK condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_WEEK operator\n */\nexport function lastWeek(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_WEEK, options };\n}\n\n/**\n * Creates a THIS_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with THIS_MONTH operator\n */\nexport function thisMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.THIS_MONTH, options };\n}\n\n/**\n * Creates a LAST_MONTH condition with the specified field.\n *\n * @param field - The field name to check\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with LAST_MONTH operator\n */\nexport function lastMonth(\n field: string,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.LAST_MONTH, options };\n}\n\n/**\n * Creates a RECENT_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of recent days to include\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with RECENT_DAYS operator\n */\nexport function recentDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.RECENT_DAYS, value: days, options };\n}\n\n/**\n * Creates an EARLIER_DAYS condition with the specified field and number of days.\n *\n * @param field - The field name to check\n * @param days - The number of days to look back\n * @param datePattern - The date pattern to use\n * @param zoneId - The time zone ID to use\n * @returns A condition with EARLIER_DAYS operator\n */\nexport function earlierDays(\n field: string,\n days: number,\n datePattern?: string,\n zoneId?: string,\n): Condition {\n const options = dateOptions(datePattern, zoneId);\n return { field, operator: Operator.EARLIER_DAYS, value: days, options };\n}\n\n/**\n * Creates a RAW condition with the specified raw value.\n *\n * @param raw - The raw condition value\n * @returns A condition with RAW operator\n */\nexport function raw(raw: any): Condition {\n return { operator: Operator.RAW, value: raw };\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConditionCapable } from './condition';\n\nexport enum SortDirection {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/**\n * Interface for sort criteria.\n */\nexport interface Sort {\n field: string;\n direction: SortDirection;\n}\n\n/**\n * Interface for objects that support sorting.\n */\nexport interface SortCapable {\n sort?: Sort[];\n}\n\n/**\n * Interface for pagination information.\n *\n * Page number, starting from 1\n * Page size\n */\nexport interface Pagination {\n index: number;\n size: number;\n}\n\nexport const DEFAULT_PAGINATION: Pagination = {\n index: 1,\n size: 10,\n};\n\n/**\n * Interface for field projection.\n */\nexport interface Projection {\n include?: string[];\n exclude?: string[];\n}\n\nexport const DEFAULT_PROJECTION: Projection = {};\n\n/**\n * Interface for objects that support field projection.\n */\nexport interface ProjectionCapable {\n projection?: Projection;\n}\n\n/**\n * Interface for queryable objects that support conditions, projection, and sorting.\n */\nexport interface Queryable\n extends ConditionCapable,\n ProjectionCapable,\n SortCapable {}\n\n/**\n * Interface for single query objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface SingleQuery extends Queryable {}\n\n/**\n * Interface for list query objects.\n *\n * Limit the number of results. Default: DEFAULT_PAGINATION.size\n */\nexport interface ListQuery extends Queryable {\n limit?: number;\n}\n\n/**\n * Interface for paged query objects.\n */\nexport interface PagedQuery extends Queryable {\n pagination?: Pagination;\n}\n\n/**\n * Interface for paged list results.\n */\nexport interface PagedList<T> {\n total: number;\n list: T[];\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Enumerates the types of recoverability for errors or operations, allowing for classification and handling based on whether an error is transient and can be resolved by retrying.\n *\n * The [RecoverableType] enum provides a way to categorize errors into three distinct categories: [RECOVERABLE], [UNRECOVERABLE], and [UNKNOWN].\n * This categorization is essential for implementing robust error handling and retry mechanisms in applications,\n * ensuring that temporary issues are retried while permanent or unknown issues are handled appropriately.\n *\n */\nexport enum RecoverableType {\n /**\n * Represents an error type that indicates the operation or error can be retried.\n *\n * This enum value is used to classify errors in a way that allows for the implementation of retry logic. When an error\n * is marked as [RECOVERABLE], it signifies that the error condition is temporary and might be resolved upon retrying the\n * operation. This is particularly useful in scenarios where network issues, transient server errors, or other temporary\n * conditions may cause an operation to fail, but with a high likelihood of success on subsequent attempts.\n */\n RECOVERABLE = 'RECOVERABLE',\n /**\n * Represents an error type that indicates the operation or error cannot be retried.\n *\n * This enum value is used to classify errors in a way that signifies the error condition is permanent and retrying the operation will not resolve the issue. It is particularly\n * useful for handling errors where the underlying problem is fundamental and cannot be resolved by simply retrying, such as invalid input, resource exhaustion, or other non-transient\n * issues.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * Represents an unknown type of recoverability for an error or operation.\n * This is used when the recoverability of an error cannot be determined or is not specified.\n */\n UNRECOVERABLE = 'UNRECOVERABLE',\n}\n\n/**\n * Represents an error that occurs during the binding process, typically when data is being mapped to or from an object.\n * This class extends the [Named] interface, inheriting the `name` property which can be used to identify the source or context of the error.\n *\n * @param name The name or identifier for the context in which the error occurred.\n * @param msg A message describing the error.\n */\nexport interface BindingError {\n name: string;\n msg: string;\n}\n\n/**\n * Represents the information about an error, including whether the operation succeeded, the error code, and any associated messages or binding errors.\n *\n * This interface is designed to provide a standardized way of handling and representing errors across different parts of an application. It includes methods to check if the operation was successful, retrieve the error code\n * , and access any additional error details such as messages or binding errors.\n */\nexport interface ErrorInfo {\n /**\n * Represents the error code associated with an error. This value is used to identify the type of error that has occurred,\n * which can be useful for debugging, logging, and handling errors in a standardized way.\n */\n errorCode: string;\n /**\n * Represents the message associated with an error. This message provides a human-readable description of the error, which can be used for logging, debugging, or displaying to the user\n * .\n */\n errorMsg: string;\n /**\n * Provides a list of [BindingError] instances that occurred during the binding process.\n * Each [BindingError] contains information about the error, including its name and a message describing the issue.\n * This property returns an empty list if no binding errors are present.\n */\n bindingErrors?: BindingError[];\n}\n\nexport class ErrorCodes {\n /**\n * A constant representing a successful operation or status.\n * This value is typically used in the context of error handling and response descriptions to indicate that an operation has been completed successfully.\n */\n static readonly SUCCEEDED = 'Ok';\n static readonly SUCCEEDED_MESSAGE = '';\n\n /**\n * Error code for when a requested resource is not found.\n */\n static readonly NOT_FOUND = 'NotFound';\n\n /**\n * Default message for NOT_FOUND error code.\n */\n static readonly NOT_FOUND_MESSAGE = 'Not found resource!';\n\n /**\n * Error code for bad request errors.\n */\n static readonly BAD_REQUEST = 'BadRequest';\n\n /**\n * Error code for illegal argument errors.\n */\n static readonly ILLEGAL_ARGUMENT = 'IllegalArgument';\n\n /**\n * Error code for illegal state errors.\n */\n static readonly ILLEGAL_STATE = 'IllegalState';\n\n /**\n * Error code for request timeout errors.\n */\n static readonly REQUEST_TIMEOUT = 'RequestTimeout';\n\n /**\n * Error code for too many requests errors (rate limiting).\n */\n static readonly TOO_MANY_REQUESTS = 'TooManyRequests';\n\n /**\n * Error code for duplicate request ID errors.\n */\n static readonly DUPLICATE_REQUEST_ID = 'DuplicateRequestId';\n\n /**\n * Error code for command validation errors.\n */\n static readonly COMMAND_VALIDATION = 'CommandValidation';\n\n /**\n * Error code for when no command is found to rewrite.\n */\n static readonly REWRITE_NO_COMMAND = 'RewriteNoCommand';\n\n /**\n * Error code for event version conflicts.\n */\n static readonly EVENT_VERSION_CONFLICT = 'EventVersionConflict';\n\n /**\n * Error code for duplicate aggregate ID errors.\n */\n static readonly DUPLICATE_AGGREGATE_ID = 'DuplicateAggregateId';\n\n /**\n * Error code for command expected version conflicts.\n */\n static readonly COMMAND_EXPECT_VERSION_CONFLICT =\n 'CommandExpectVersionConflict';\n\n /**\n * Error code for sourcing version conflicts.\n */\n static readonly SOURCING_VERSION_CONFLICT = 'SourcingVersionConflict';\n\n /**\n * Error code for illegal access to deleted aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_DELETED_AGGREGATE =\n 'IllegalAccessDeletedAggregate';\n\n /**\n * Error code for illegal access to owner aggregate errors.\n */\n static readonly ILLEGAL_ACCESS_OWNER_AGGREGATE =\n 'IllegalAccessOwnerAggregate';\n\n /**\n * Error code for internal server errors.\n */\n static readonly INTERNAL_SERVER_ERROR = 'InternalServerError';\n\n /**\n * Checks if the provided error code represents a successful operation.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is 'Ok', false otherwise\n */\n static isSucceeded(errorCode: string): boolean {\n return errorCode === ErrorCodes.SUCCEEDED;\n }\n\n /**\n * Checks if the provided error code represents an error condition.\n *\n * @param errorCode The error code to check\n * @returns true if the error code is not 'Ok', false otherwise\n */\n static isError(errorCode: string): boolean {\n return !ErrorCodes.isSucceeded(errorCode);\n }\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Function kind enum\n *\n * Represents the different types of functions in the system.\n */\nexport enum FunctionKind {\n /**\n * Command function kind\n */\n COMMAND = 'COMMAND',\n\n /**\n * Error function kind\n */\n ERROR = 'ERROR',\n\n /**\n * Event function kind\n */\n EVENT = 'EVENT',\n\n /**\n * Sourcing function kind\n */\n SOURCING = 'SOURCING',\n\n /**\n * State event function kind\n */\n STATE_EVENT = 'STATE_EVENT',\n}\n\n/**\n * Interface for function information.\n */\nexport interface FunctionInfo {\n functionKind: FunctionKind;\n contextName: string;\n processorName: string;\n name: string;\n}\n\n/**\n * Interface for objects that have function information.\n */\nexport interface FunctionInfoCapable {\n function: FunctionInfo;\n}\n","/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { NamedBoundedContext } from './naming.ts';\n\n/**\n * Interface for classes that have a creation time.\n */\nexport interface CreateTimeCapable {\n /**\n * Gets the creation time in milliseconds since the Unix epoch.\n */\n createTime: number;\n}\n\n/**\n * Interface for objects that track deletion status.\n */\nexport interface DeletedCapable {\n /**\n * Whether the aggregate is deleted.\n */\n deleted: boolean;\n}\n\n/**\n * Interface for objects that track event IDs.\n */\nexport interface EventIdCapable {\n /**\n * The event id of the aggregate.\n */\n eventId: string;\n}\n\n/**\n * Interface for objects that track event times.\n */\nexport interface EventTimeCapable {\n /**\n * The last event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n eventTime: number;\n}\n\n/**\n * Interface for objects that track the first event time.\n */\nexport interface FirstEventTimeCapable {\n /**\n * The first event time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n firstEventTime: number;\n}\n\n/**\n * Interface for objects that track the first operator.\n */\nexport interface FirstOperatorCapable {\n /**\n * The first operator of the aggregate.\n */\n firstOperator: string;\n}\n\n/**\n * Interface for objects that have an aggregate name.\n */\nexport interface AggregateNameCapable {\n /**\n * The name of the aggregate.\n */\n aggregateName: string;\n}\n\n/**\n * Interface for named aggregates that belong to a bounded context.\n */\nexport interface NamedAggregate\n extends NamedBoundedContext,\n AggregateNameCapable {}\n\n/**\n * Interface for aggregate IDs that combine tenant and named aggregate information.\n */\nexport interface AggregateId extends TenantId, NamedAggregate {\n aggregateId: string;\n}\n\n/**\n * Interface for objects that track the last operator.\n */\nexport interface OperatorCapable {\n /**\n * The last operator of the aggregate.\n */\n operator: string;\n}\n\nexport const DEFAULT_OWNER_ID = '';\n\n/**\n * Interface for identifying resource owners.\n */\nexport interface OwnerId {\n /**\n * Unique identifier of the resource owner.\n */\n ownerId: string;\n}\n\n/**\n * Interface for objects that track snapshot times.\n */\nexport interface SnapshotTimeCapable {\n /**\n * The snapshot time of the aggregate, represented as a Unix timestamp in milliseconds.\n */\n snapshotTime: number;\n}\n\nexport const DEFAULT_TENANT_ID = '(0)';\n\n/**\n * Interface for objects that have a tenant ID.\n */\nexport interface TenantId {\n tenantId: string;\n}\n\n/**\n * Interface for objects that hold state.\n */\nexport interface StateCapable<S> {\n state: S;\n}\n"],"names":["_CommandHeaders","CommandHeaders","CommandStage","Operator","ConditionOptionKey","ignoreCaseOptions","ignoreCase","dateOptions","datePattern","zoneId","options","DeletionState","and","conditions","or","nor","id","value","ids","aggregateId","aggregateIds","tenantId","ownerId","deleted","active","all","eq","field","ne","gt","lt","gte","lte","contains","isIn","notIn","between","start","end","allIn","startsWith","endsWith","elemMatch","isNull","notNull","isTrue","isFalse","exists","today","beforeToday","time","tomorrow","thisWeek","nextWeek","lastWeek","thisMonth","lastMonth","recentDays","days","earlierDays","raw","SortDirection","DEFAULT_PAGINATION","DEFAULT_PROJECTION","RecoverableType","_ErrorCodes","errorCode","ErrorCodes","FunctionKind","DEFAULT_OWNER_ID","DEFAULT_TENANT_ID"],"mappings":"mOAiCO,MAAMA,EAAN,MAAMA,CAAe,CAqI5B,EAjIEA,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iC,CAC5C,MAAO,EACP,KAAM,EACR,EAUaC,GAAiC,CAAA,ECtCvC,IAAKC,GAAAA,IASVA,EAAA,YAAc,cAQdA,EAAA,QAAU,UAMVA,EAAA,cAAgB,gBAvBNA,IAAAA,GAAA,CAAA,CAAA,EA+DL,MAAMC,EAAN,MAAMA,CAAW,CAsGtB,OAAO,YAAYC,EAA4B,CAC7C,OAAOA,IAAcD,EAAW,SAClC,CAQA,OAAO,QAAQC,EAA4B,CACzC,MAAO,CAACD,EAAW,YAAYC,CAAS,CAC1C,CACF,EA9GED,EAAgB,UAAY,KAC5BA,EAAgB,kBAAoB,GAKpCA,EAAgB,UAAY,WAK5BA,EAAgB,kBAAoB,sBAKpCA,EAAgB,YAAc,aAK9BA,EAAgB,iBAAmB,kBAKnCA,EAAgB,cAAgB,eAKhCA,EAAgB,gBAAkB,iBAKlCA,EAAgB,kBAAoB,kBAKpCA,EAAgB,qBAAuB,qBAKvCA,EAAgB,mBAAqB,oBAKrCA,EAAgB,mBAAqB,mBAKrCA,EAAgB,uBAAyB,uBAKzCA,EAAgB,uBAAyB,uBAKzCA,EAAgB,gCACd,+BAKFA,EAAgB,0BAA4B,0BAK5CA,EAAgB,iCACd,gCAKFA,EAAgB,+BACd,8BAKFA,EAAgB,sBAAwB,sBA9FnC,IAAME,EAANF,EClEA,IAAKG,GAAAA,IAIVA,EAAA,QAAU,UAKVA,EAAA,MAAQ,QAKRA,EAAA,MAAQ,QAKRA,EAAA,SAAW,WAKXA,EAAA,YAAc,cAxBJA,IAAAA,GAAA,CAAA,CAAA,EC2FL,MAAMC,GAAmB,GAsBnBC,GAAoB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahoo-wang/fetcher-wow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Support for Wow(https://github.com/Ahoo-Wang/Wow) in Fetcher",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@ahoo-wang/fetcher": "0.
|
|
42
|
-
"@ahoo-wang/fetcher
|
|
41
|
+
"@ahoo-wang/fetcher-eventstream": "1.0.0",
|
|
42
|
+
"@ahoo-wang/fetcher": "1.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@vitest/coverage-v8": "^3.2.4",
|