@nulledexp/translatable-criteria 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +89 -85
  2. package/dist/criteria/criteria-factory.d.ts +6 -5
  3. package/dist/criteria/criteria-factory.d.ts.map +1 -1
  4. package/dist/criteria/criteria-factory.js +8 -8
  5. package/dist/criteria/criteria-factory.js.map +1 -1
  6. package/dist/criteria/criteria-join-manager.js.map +1 -1
  7. package/dist/criteria/criteria.d.ts +45 -35
  8. package/dist/criteria/criteria.d.ts.map +1 -1
  9. package/dist/criteria/criteria.js +80 -69
  10. package/dist/criteria/criteria.js.map +1 -1
  11. package/dist/criteria/cursor.d.ts +15 -0
  12. package/dist/criteria/cursor.d.ts.map +1 -1
  13. package/dist/criteria/cursor.js +22 -0
  14. package/dist/criteria/cursor.js.map +1 -1
  15. package/dist/criteria/filter/filter-group.d.ts +7 -1
  16. package/dist/criteria/filter/filter-group.d.ts.map +1 -1
  17. package/dist/criteria/filter/filter-group.js +12 -3
  18. package/dist/criteria/filter/filter-group.js.map +1 -1
  19. package/dist/criteria/filter/filter.d.ts +3 -3
  20. package/dist/criteria/filter/filter.d.ts.map +1 -1
  21. package/dist/criteria/filter/filter.js +37 -14
  22. package/dist/criteria/filter/filter.js.map +1 -1
  23. package/dist/criteria/filter/types/filter-primitive.types.d.ts +16 -6
  24. package/dist/criteria/filter/types/filter-primitive.types.d.ts.map +1 -1
  25. package/dist/criteria/index.d.ts +2 -2
  26. package/dist/criteria/index.d.ts.map +1 -1
  27. package/dist/criteria/index.js.map +1 -1
  28. package/dist/criteria/join/inner.join-criteria.d.ts +10 -17
  29. package/dist/criteria/join/inner.join-criteria.d.ts.map +1 -1
  30. package/dist/criteria/join/inner.join-criteria.js +11 -18
  31. package/dist/criteria/join/inner.join-criteria.js.map +1 -1
  32. package/dist/criteria/join/left.join-criteria.d.ts +4 -4
  33. package/dist/criteria/join/left.join-criteria.d.ts.map +1 -1
  34. package/dist/criteria/join/left.join-criteria.js +5 -5
  35. package/dist/criteria/join/left.join-criteria.js.map +1 -1
  36. package/dist/criteria/join/outer.join-criteria.d.ts +13 -16
  37. package/dist/criteria/join/outer.join-criteria.d.ts.map +1 -1
  38. package/dist/criteria/join/outer.join-criteria.js +14 -17
  39. package/dist/criteria/join/outer.join-criteria.js.map +1 -1
  40. package/dist/criteria/order/order.d.ts +18 -1
  41. package/dist/criteria/order/order.d.ts.map +1 -1
  42. package/dist/criteria/order/order.js +21 -1
  43. package/dist/criteria/order/order.js.map +1 -1
  44. package/dist/criteria/root.criteria.d.ts +6 -16
  45. package/dist/criteria/root.criteria.d.ts.map +1 -1
  46. package/dist/criteria/root.criteria.js +4 -14
  47. package/dist/criteria/root.criteria.js.map +1 -1
  48. package/dist/criteria/translator/criteria-translator.d.ts +23 -32
  49. package/dist/criteria/translator/criteria-translator.d.ts.map +1 -1
  50. package/dist/criteria/translator/criteria-translator.js +5 -24
  51. package/dist/criteria/translator/criteria-translator.js.map +1 -1
  52. package/dist/criteria/types/criteria.interface.d.ts +35 -22
  53. package/dist/criteria/types/criteria.interface.d.ts.map +1 -1
  54. package/dist/criteria/types/criteria.interface.js.map +1 -1
  55. package/dist/criteria/types/join-parameter.types.d.ts +20 -4
  56. package/dist/criteria/types/join-parameter.types.d.ts.map +1 -1
  57. package/dist/criteria/types/join-utility.types.d.ts +25 -31
  58. package/dist/criteria/types/join-utility.types.d.ts.map +1 -1
  59. package/dist/criteria/types/manager.interface.d.ts +3 -3
  60. package/dist/criteria/types/manager.interface.d.ts.map +1 -1
  61. package/dist/criteria/types/operator.types.d.ts +92 -86
  62. package/dist/criteria/types/operator.types.d.ts.map +1 -1
  63. package/dist/criteria/types/operator.types.js +91 -85
  64. package/dist/criteria/types/operator.types.js.map +1 -1
  65. package/dist/criteria/types/schema.types.d.ts +107 -41
  66. package/dist/criteria/types/schema.types.d.ts.map +1 -1
  67. package/dist/criteria/types/schema.types.js +38 -11
  68. package/dist/criteria/types/schema.types.js.map +1 -1
  69. package/dist/criteria/types/visitor-interface.types.d.ts +33 -12
  70. package/dist/criteria/types/visitor-interface.types.d.ts.map +1 -1
  71. package/package.json +1 -1
package/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  [![NPM Version](https://img.shields.io/npm/v/@nulledexp/translatable-criteria.svg)](https://www.npmjs.com/package/@nulledexp/translatable-criteria)
4
4
  ![NPM Downloads](https://img.shields.io/npm/dw/%40nulledexp%2Ftranslatable-criteria)
5
5
  [![Development Stage](https://img.shields.io/badge/Development-Active%20Development-green)]()
6
- [![Documentation](https://img.shields.io/badge/Documentation-EN/ES-blue)](./src/docs/introduction/en.md)
6
+ [![Documentation](https://img.shields.io/badge/Documentation-EN-blue)](./src/docs/introduction/en.md)
7
+ [![Documentation](https://img.shields.io/badge/Documentation-ES-blue)](./src/docs/introduction/es.md)
7
8
  [![CI](https://github.com/Techscq/translatable-criteria/actions/workflows/ci.yml/badge.svg)](https://github.com/Techscq/translatable-criteria/actions/workflows/ci.yml)
8
9
 
9
10
  A TypeScript library for building data-source agnostic, translatable query criteria. Define complex filtering, ordering, and join logic in a structured, type-safe way, then translate it to your specific data source using custom translators.
@@ -16,84 +17,88 @@ npm install @nulledexp/translatable-criteria
16
17
 
17
18
  ## Overview
18
19
 
19
- This library simplifies the construction of complex data queries by providing a consistent and abstract way to define filtering, ordering, field selection, pagination (offset and cursor-based), and relationship (joins) configurations. The core concept revolves around the `Criteria` object hierarchy, which allows developers to define sophisticated query specifications in a data source-agnostic manner. These `Criteria` objects can then be processed by a `CriteriaTranslator` (using the Visitor pattern) to generate queries for various data sources.
20
+ This library simplifies the construction of complex data queries by providing a consistent and abstract way to define filtering, ordering, field selection, pagination (offset and cursor-based), and relationship (joins) configurations. The core concept revolves around the `Criteria` object hierarchy, which allows developers to define sophisticated query specifications in a data source-agnostic manner, now with enhanced schema validation (including `identifier_field`) and richer context for translators (like `parent_identifier`). These `Criteria` objects can then be processed by a `CriteriaTranslator` to generate queries for various data sources.
20
21
 
21
22
  ## Key Features
22
23
 
23
- - **Enhanced Type-Safety:** Construct queries with a fluent, strongly-typed interface, benefiting from compile-time and runtime validation of field names, aliases, and join parameters based on your schemas.
24
- - **Powerful Filtering:** Define intricate filtering logic with multiple operators (including for JSON and arrays) and grouping. Filter groups are automatically normalized for consistency.
25
- - **Flexible Join System:** Support for various join types (inner, left, full outer) and pivot table configurations, with validation of join parameters according to the relation type.
26
- - **Default Join Field Selection:** When a join is added, if `setSelect()` is not explicitly called on the `JoinCriteria`, all fields from the joined schema will be automatically included in the main `SELECT` clause. This can be overridden by using `setSelect()` on the specific `JoinCriteria`.
27
- - **Field Selection:** Specify exactly which fields to retrieve using `setSelect()`. Use `resetSelect()` to select all fields (which is also the default behavior).
24
+ - **Enhanced Type-Safety:** Construct queries with a fluent, strongly-typed interface, benefiting from compile-time and runtime validation of field names (including `identifier_field`), aliases, and join parameters based on your schemas.
25
+ - **Powerful Filtering:** Define intricate filtering logic with multiple operators (including for JSON, arrays, sets, ranges, and regex) and grouping. Filter groups are automatically normalized for consistency.
26
+ - **Flexible Join System:** Support for various join types (inner, left, full outer) and pivot table configurations. Join parameters now include `parent_identifier` to provide richer context to translators for relationship inference (e.g., for `one_to_one`).
27
+ - **Granular Null-Value Sorting:** Explicitly control whether `NULL` values appear first or last in your ordered results.
28
+ - **Filter-Only Joins:** Improve query performance by creating joins solely for filtering, without including their fields in the final `SELECT` statement.
29
+ - **Field Selection & `identifier_field`:** Specify exactly which fields to retrieve using `setSelect()`. The `identifier_field` of an entity is automatically included when `setSelect()` is used. Use `resetSelect()` to select all fields (default behavior).
28
30
  - **Pagination:** Supports both offset-based (`setTake()`, `setSkip()`) and cursor-based (`setCursor()`) pagination.
29
- - **Visitor Pattern for Translation:** Criteria objects implement an `accept` method, allowing for clean and extensible translation logic via the Visitor pattern.
30
31
  - **Data Source Agnostic:** Design criteria independently of the underlying data source.
31
32
  - **Translator-Based Architecture:** The core library defines criteria; actual translation is handled by separate translator packages that implement the `CriteriaTranslator` interface.
32
33
  - **Full TypeScript Support:** Benefit from compile-time validation and autocompletion.
33
34
 
34
35
  ## Core Concepts
35
36
 
36
- The library is built upon a few fundamental concepts. For detailed explanations, please refer to our Core Concepts Documentation.
37
+ The library is built upon a few fundamental concepts. For detailed explanations, please refer to our documentation guides.
37
38
 
38
- - **`Criteria` Hierarchy:** Abstract base for query specifications (`RootCriteria`, `InnerJoinCriteria`, etc.). Learn more.
39
- - **`CriteriaFactory`:** Recommended utility for creating `Criteria` instances (e.g., `CriteriaFactory.GetCriteria(...)`, `CriteriaFactory.GetInnerJoinCriteria(...)`). Learn more.
40
- - **Schemas (`CriteriaSchema` & `GetTypedCriteriaSchema`):** Define your data entities' structure for type-safe criteria construction. Learn more.
41
- - **`CriteriaTranslator`:** Abstract class for converting `Criteria` objects into specific data source queries using the Visitor pattern. Learn more.
39
+ - [**`Criteria` Hierarchy:**](./src/docs/core-concepts/en.md#criteria-hierarchy) Abstract base for query specifications (`RootCriteria`, `InnerJoinCriteria`, etc.).
40
+ - [**`CriteriaFactory`:**](./src/docs/core-concepts/en.md#criteriafactory) Recommended utility for creating `Criteria` instances.
41
+ - [**Schemas (`CriteriaSchema` & `GetTypedCriteriaSchema`):**](./src/docs/guides/schema-definitions/en.md) Define your data entities' structure for type-safe criteria construction.
42
+ - [**`CriteriaTranslator`:**](./src/docs/guides/developing-translators/en.md) Abstract class responsible for converting `Criteria` objects into specific data source queries.
42
43
 
43
44
  ## Usage Example (Core Library)
44
45
 
45
- This package provides the tools to define your query criteria.
46
+ This package provides the tools to define your query criteria. The core philosophy is to define relationship logic **once** in the schema, and then simply reference it when building criteria.
46
47
 
47
48
  ### 1. Define Schemas
48
49
 
50
+ First, define your entity schemas using `GetTypedCriteriaSchema`. This is where you declare how entities are related by defining `local_field`, `relation_field`, etc.
51
+
49
52
  ```typescript
50
53
  import { GetTypedCriteriaSchema } from '@nulledexp/translatable-criteria';
51
54
 
52
55
  export const UserSchema = GetTypedCriteriaSchema({
53
- source_name: 'user',
54
- alias: ['users', 'user', 'publisher'],
55
- fields: ['uuid', 'email', 'username', 'created_at'],
56
- joins: [
57
- { alias: 'posts', relation_type: 'one_to_many' },
58
- // other joins like 'permissions', 'addresses' can be defined here
56
+ source_name: 'users',
57
+ alias: 'u',
58
+ fields: ['id', 'username', 'email', 'age', 'isActive', 'createdAt'],
59
+ identifier_field: 'id',
60
+ relations: [
61
+ {
62
+ relation_alias: 'posts',
63
+ target_source_name: 'posts',
64
+ relation_type: 'one_to_many',
65
+ local_field: 'id',
66
+ relation_field: 'userId',
67
+ },
59
68
  ],
60
69
  });
61
- export type UserSchema = typeof UserSchema;
62
70
 
63
71
  export const PostSchema = GetTypedCriteriaSchema({
64
- source_name: 'post',
65
- alias: ['posts', 'post'],
66
- fields: [
67
- 'uuid',
68
- 'title',
69
- 'body',
70
- 'user_uuid',
71
- 'created_at',
72
- 'categories', // Example: for array filters
73
- 'metadata', // Example: for JSON filters
74
- ],
75
- joins: [
76
- { alias: 'comments', relation_type: 'one_to_many' },
77
- { alias: 'publisher', relation_type: 'many_to_one' },
72
+ source_name: 'posts',
73
+ alias: 'p',
74
+ fields: ['id', 'title', 'content', 'userId', 'createdAt'],
75
+ identifier_field: 'id',
76
+ relations: [
77
+ {
78
+ relation_alias: 'user',
79
+ target_source_name: 'users',
80
+ relation_type: 'many_to_one',
81
+ local_field: 'userId',
82
+ relation_field: 'id',
83
+ },
78
84
  ],
79
85
  });
80
- export type PostSchema = typeof PostSchema;
81
-
82
- // Define other schemas (PermissionSchema, PostCommentSchema, AddressSchema) as needed for your application.
83
- // See the full documentation for more examples.
84
86
  ```
85
87
 
86
- ### 2. Create Criteria
88
+ ### 2. Create a Simple Criteria
89
+
90
+ Use `CriteriaFactory` to create a `Criteria` object and apply filters or ordering.
87
91
 
88
92
  ```typescript
89
93
  import {
90
94
  CriteriaFactory,
91
95
  FilterOperator,
96
+ OrderDirection,
92
97
  } from '@nulledexp/translatable-criteria';
93
- import { UserSchema } from './path/to/your/criteria/schemas'; // Adjust path
98
+ import { UserSchema } from './path/to/your/schemas'; // Adjust path
94
99
 
95
100
  // Create Criteria for the User entity
96
- const userCriteria = CriteriaFactory.GetCriteria(UserSchema, 'users');
101
+ const userCriteria = CriteriaFactory.GetCriteria(UserSchema);
97
102
 
98
103
  // Example: Add a simple filter
99
104
  userCriteria.where({
@@ -103,17 +108,45 @@ userCriteria.where({
103
108
  });
104
109
 
105
110
  // Example: Add ordering
106
- userCriteria.orderBy('created_at', 'DESC');
111
+ userCriteria.orderBy('createdAt', OrderDirection.DESC);
107
112
 
108
113
  // The 'userCriteria' object is now ready to be passed to a translator.
109
114
  ```
110
115
 
116
+ ### 3. Create Criteria with a Join
117
+
118
+ To add a join, simply call the `.join()` method with the `relation_alias` you defined in the schema. The library automatically uses the configuration you provided, eliminating the need for manual join parameters.
119
+
120
+ ```typescript
121
+ import {
122
+ CriteriaFactory,
123
+ FilterOperator,
124
+ } from '@nulledexp/translatable-criteria';
125
+ import { PostSchema, UserSchema } from './path/to/your/schemas'; // Adjust path
126
+
127
+ // Find posts from active users
128
+ const postCriteria = CriteriaFactory.GetCriteria(PostSchema);
129
+
130
+ const activeUserJoin = CriteriaFactory.GetInnerJoinCriteria(UserSchema).where({
131
+ field: 'isActive',
132
+ operator: FilterOperator.EQUALS,
133
+ value: true,
134
+ });
135
+
136
+ // The join is now declarative. Just provide the relation alias.
137
+ postCriteria.join('user', activeUserJoin);
138
+
139
+ // The 'postCriteria' object is now ready to be passed to a translator.
140
+ ```
141
+
142
+ ---
143
+
111
144
  ## Available Translators
112
145
 
113
- To interact with a database, you'll need a translator package.
146
+ To interact with a database, you'll need a translator package. You can either build your own following our Criteria Translator Development Guide or use one from the community.
114
147
 
115
148
  - **`@nulledexp/typeorm-mysql-criteria-translator`**:
116
- A translator for generating TypeORM `SelectQueryBuilder` instances for MySQL.
149
+ - A translator for generating TypeORM `SelectQueryBuilder` instances for MySQL.
117
150
  - **Author:** Nelson Cabrera
118
151
  - **Installation**:
119
152
 
@@ -121,58 +154,25 @@ To interact with a database, you'll need a translator package.
121
154
  npm install @nulledexp/typeorm-mysql-criteria-translator
122
155
  ```
123
156
 
124
- - **Usage (basic)**:
125
-
126
- ```typescript
127
- import {
128
- CriteriaFactory,
129
- FilterOperator,
130
- } from '@nulledexp/translatable-criteria';
131
- import { TypeOrmMysqlTranslator } from '@nulledexp/typeorm-mysql-criteria-translator'; // Using new suggested name
132
- import { UserSchema } from './path/to/your/criteria/schemas'; // Your Criteria Schema
133
- // import { YourTypeOrmUserEntity } from './path/to/your/typeorm/entities'; // Your actual TypeORM entity
134
- // import { DbDatasource } from './path-to-your-datasource-config'; // Your initialized TypeORM DataSource instance
135
-
136
- // 1. Define your Criteria using @nulledexp/translatable-criteria
137
- const criteria = CriteriaFactory.GetCriteria(UserSchema, 'users') // 'users' is an alias from UserSchema
138
- .where({
139
- field: 'username', // Field from UserSchema
140
- operator: FilterOperator.EQUALS,
141
- value: 'testuser',
142
- })
143
- .setTake(10);
144
-
145
- // 2. Use the translator with your TypeORM QueryBuilder
146
- // (Conceptual - assuming DbDatasource and YourTypeOrmUserEntity are set up)
147
-
148
- // const queryBuilder = DbDatasource.getRepository(YourTypeOrmUserEntity)
149
- // .createQueryBuilder(criteria.alias); // Alias must match root criteria alias
150
-
151
- // const translator = new TypeOrmMysqlTranslator<YourTypeOrmUserEntity>();
152
- // translator.translate(criteria, queryBuilder);
153
-
154
- // Now queryBuilder is populated with the translated criteria
155
- // console.log(queryBuilder.getSql(), queryBuilder.getParameters());
156
- // const results = await queryBuilder.getMany();
157
- ```
157
+ - **Usage:**
158
158
 
159
- - **Note:** This translator has been tested with integration tests. Please review its implementation at its repository (replace with actual repo link if different) to ensure it meets your specific project needs and production requirements. Contributions and bug reports are welcome!
159
+ - See the TypeORM Translator Usage Guide for detailed instructions.
160
160
 
161
161
  - **(More translators coming soon or can be created by the community)**
162
162
 
163
- ### Developing Custom Translators
164
-
165
- You can create your own translators by extending the abstract `CriteriaTranslator` class. See the Developing Custom Translators Guide for details.
163
+ **Important Note for Translator Developers:** Translators should be updated to handle the new `parent_identifier` in join parameters (especially for inferring `one_to_one` relationships) and to support the new filter operators. Refer to the Developing Custom Translators Guide for details.
166
164
 
167
165
  ## Type Safety Features
168
166
 
169
167
  - Compile-time validation of field names within criteria based on schemas.
168
+ - Validation of `identifier_field` definition within schemas.
170
169
  - Type-checked join configurations ensuring compatibility between schemas.
171
170
  - Autocomplete support for schema fields and defined join aliases.
172
171
  - Validation of alias usage in `Criteria` constructors.
173
172
  - Robust validation of join parameters based on `join_relation_type`.
174
173
  - Validation for selected fields, cursor fields, take/skip values.
175
174
  - Strictly typed filter values based on the `FilterOperator` used.
175
+ - Inclusion of `parent_identifier` in resolved join parameters for translator use.
176
176
 
177
177
  ## Roadmap (Core Library)
178
178
 
@@ -182,9 +182,13 @@ You can create your own translators by extending the abstract `CriteriaTranslato
182
182
  - [x] Implement `LIMIT` and `OFFSET` (take/skip) for pagination.
183
183
  - [x] Implement `PivotJoin` for many-to-many relationships.
184
184
  - [x] Strictly typed filter values based on operator.
185
- - [x] New filter operators (JSON, Array, Set).
186
- - [x] Enhanced documentation with detailed examples for translator development.
185
+ - [x] New filter operators (JSON, Array, Set, Range, Regex, ILIKE).
187
186
  - [x] `OuterJoinCriteria` support in the core logic.
187
+ - [x] Introduce `identifier_field` in schemas and `parent_identifier` in join parameters.
188
+ - [x] Enforce stricter schema validation at type level.
189
+ - [x] Implement `NULLS FIRST/LAST` ordering.
190
+ - [x] Implement filter-only joins (`withSelect`).
191
+ - [x] Enhanced documentation with detailed examples for translator development.
188
192
  - [ ] Explore utility functions to simplify translator development.
189
193
  - [ ] Explore utility functions to simplify schema development.
190
194
  - [ ] Add more comprehensive unit test coverage for criteria construction and edge cases.
@@ -1,8 +1,9 @@
1
1
  import { RootCriteria } from './root.criteria.js';
2
- import type { CriteriaSchema, SelectedAliasOf } from './types/schema.types.js';
2
+ import type { CriteriaSchema } from './types/schema.types.js';
3
3
  import { InnerJoinCriteria } from './join/inner.join-criteria.js';
4
4
  import { LeftJoinCriteria } from './join/left.join-criteria.js';
5
5
  import { OuterJoinCriteria } from './join/outer.join-criteria.js';
6
+ import type { ValidSchema } from './criteria.js';
6
7
  /**
7
8
  * Provides static methods for creating instances of different types of `Criteria`.
8
9
  * This simplifies the creation of `Criteria` objects and ensures they are instantiated
@@ -22,7 +23,7 @@ export declare class CriteriaFactory {
22
23
  *
23
24
  * const userCriteria = CriteriaFactory.GetCriteria(UserSchema, 'users');
24
25
  */
25
- static GetCriteria<CSchema extends CriteriaSchema, Alias extends SelectedAliasOf<CSchema>>(schema: CSchema, alias: Alias): RootCriteria<CSchema, Alias>;
26
+ static GetCriteria<CSchema extends CriteriaSchema>(schema: ValidSchema<CSchema>): RootCriteria<CSchema>;
26
27
  /**
27
28
  * Creates an instance of `InnerJoinCriteria`. Used to define an `INNER JOIN` in a query.
28
29
  * @template CSchema - The type of the `CriteriaSchema` for the entity to be joined.
@@ -37,7 +38,7 @@ export declare class CriteriaFactory {
37
38
  * const postJoinCriteria = CriteriaFactory.GetInnerJoinCriteria(PostSchema, 'posts');
38
39
  * // postJoinCriteria can then be used in the .join() method of another Criteria
39
40
  */
40
- static GetInnerJoinCriteria<CSchema extends CriteriaSchema, Alias extends SelectedAliasOf<CSchema>>(schema: CSchema, alias: Alias): InnerJoinCriteria<CSchema, Alias>;
41
+ static GetInnerJoinCriteria<CSchema extends CriteriaSchema>(schema: ValidSchema<CSchema>): InnerJoinCriteria<CSchema>;
41
42
  /**
42
43
  * Creates an instance of `LeftJoinCriteria`. Used to define a `LEFT JOIN` in a query.
43
44
  * @template CSchema - The type of the `CriteriaSchema` for the entity to be joined.
@@ -51,7 +52,7 @@ export declare class CriteriaFactory {
51
52
  *
52
53
  * const commentJoinCriteria = CriteriaFactory.GetLeftJoinCriteria(CommentSchema, 'comments');
53
54
  */
54
- static GetLeftJoinCriteria<CSchema extends CriteriaSchema, Alias extends SelectedAliasOf<CSchema>>(schema: CSchema, alias: Alias): LeftJoinCriteria<CSchema, Alias>;
55
+ static GetLeftJoinCriteria<CSchema extends CriteriaSchema>(schema: ValidSchema<CSchema>): LeftJoinCriteria<CSchema>;
55
56
  /**
56
57
  * Creates an instance of `OuterJoinCriteria`. Used to define a `FULL OUTER JOIN` in a query.
57
58
  * @template CSchema - The type of the `CriteriaSchema` for the entity to be joined.
@@ -65,6 +66,6 @@ export declare class CriteriaFactory {
65
66
  *
66
67
  * const profileJoinCriteria = CriteriaFactory.GetOuterJoinCriteria(ProfileSchema, 'profiles');
67
68
  */
68
- static GetOuterJoinCriteria<CSchema extends CriteriaSchema, Alias extends SelectedAliasOf<CSchema>>(schema: CSchema, alias: Alias): OuterJoinCriteria<CSchema, Alias>;
69
+ static GetOuterJoinCriteria<CSchema extends CriteriaSchema>(schema: ValidSchema<CSchema>): OuterJoinCriteria<CSchema>;
69
70
  }
70
71
  //# sourceMappingURL=criteria-factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"criteria-factory.d.ts","sourceRoot":"","sources":["../../src/criteria/criteria-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;;GAIG;AACH,qBAAa,eAAe;IAC1B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,WAAW,CAChB,OAAO,SAAS,cAAc,EAC9B,KAAK,SAAS,eAAe,CAAC,OAAO,CAAC,EACtC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,YAAY,CAAC,OAAO,EAAE,KAAK,CA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AC;IAIxB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,SAAS,cAAc,EACxD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAC3B,iBAAiB,CAAC,OAAO,CAAC;IAI7B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CAAC,OAAO,SAAS,cAAc,EACvD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAC3B,gBAAgB,CAAC,OAAO,CAAC;IAI5B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,SAAS,cAAc,EACxD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAC3B,iBAAiB,CAAC,OAAO,CAAC;CAG9B"}
@@ -21,8 +21,8 @@ export class CriteriaFactory {
21
21
  *
22
22
  * const userCriteria = CriteriaFactory.GetCriteria(UserSchema, 'users');
23
23
  */
24
- static GetCriteria(schema, alias) {
25
- return new RootCriteria(schema, alias);
24
+ static GetCriteria(schema) {
25
+ return new RootCriteria(schema);
26
26
  }
27
27
  /**
28
28
  * Creates an instance of `InnerJoinCriteria`. Used to define an `INNER JOIN` in a query.
@@ -38,8 +38,8 @@ export class CriteriaFactory {
38
38
  * const postJoinCriteria = CriteriaFactory.GetInnerJoinCriteria(PostSchema, 'posts');
39
39
  * // postJoinCriteria can then be used in the .join() method of another Criteria
40
40
  */
41
- static GetInnerJoinCriteria(schema, alias) {
42
- return new InnerJoinCriteria(schema, alias);
41
+ static GetInnerJoinCriteria(schema) {
42
+ return new InnerJoinCriteria(schema);
43
43
  }
44
44
  /**
45
45
  * Creates an instance of `LeftJoinCriteria`. Used to define a `LEFT JOIN` in a query.
@@ -54,8 +54,8 @@ export class CriteriaFactory {
54
54
  *
55
55
  * const commentJoinCriteria = CriteriaFactory.GetLeftJoinCriteria(CommentSchema, 'comments');
56
56
  */
57
- static GetLeftJoinCriteria(schema, alias) {
58
- return new LeftJoinCriteria(schema, alias);
57
+ static GetLeftJoinCriteria(schema) {
58
+ return new LeftJoinCriteria(schema);
59
59
  }
60
60
  /**
61
61
  * Creates an instance of `OuterJoinCriteria`. Used to define a `FULL OUTER JOIN` in a query.
@@ -70,8 +70,8 @@ export class CriteriaFactory {
70
70
  *
71
71
  * const profileJoinCriteria = CriteriaFactory.GetOuterJoinCriteria(ProfileSchema, 'profiles');
72
72
  */
73
- static GetOuterJoinCriteria(schema, alias) {
74
- return new OuterJoinCriteria(schema, alias);
73
+ static GetOuterJoinCriteria(schema) {
74
+ return new OuterJoinCriteria(schema);
75
75
  }
76
76
  }
77
77
  //# sourceMappingURL=criteria-factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"criteria-factory.js","sourceRoot":"","sources":["../../src/criteria/criteria-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;;GAIG;AACH,MAAM,OAAO,eAAe;IAC1B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,WAAW,CAGhB,MAAe,EAAE,KAAY;QAC7B,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,oBAAoB,CAGzB,MAAe,EAAE,KAAY;QAC7B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CAGxB,MAAe,EAAE,KAAY;QAC7B,OAAO,IAAI,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,oBAAoB,CAGzB,MAAe,EAAE,KAAY;QAC7B,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;CACF"}
1
+ {"version":3,"file":"criteria-factory.js","sourceRoot":"","sources":["../../src/criteria/criteria-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE;;;;GAIG;AACH,MAAM,OAAO,eAAe;IAC1B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,WAAW,CAChB,MAA4B;QAE5B,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,oBAAoB,CACzB,MAA4B;QAE5B,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CACxB,MAA4B;QAE5B,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,oBAAoB,CACzB,MAA4B;QAE5B,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"criteria-join-manager.js","sourceRoot":"","sources":["../../src/criteria/criteria-join-manager.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,mBAAmB;IAGtB,MAAM,GAA4C,IAAI,GAAG,EAAE,CAAC;IAEpE,OAAO,CACL,cAA2C,EAC3C,aAEqD;QAErD,MAAM,WAAW,GAA+B;YAC9C,UAAU,EAAE,aAAa;YACzB,QAAQ,EAAE,cAAc;SACzB,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF"}
1
+ {"version":3,"file":"criteria-join-manager.js","sourceRoot":"","sources":["../../src/criteria/criteria-join-manager.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,mBAAmB;IAGtB,MAAM,GAA4C,IAAI,GAAG,EAAE,CAAC;IAEpE,OAAO,CACL,cAA2C,EAC3C,aAEqD;QAErD,MAAM,WAAW,GAA+B;YAC9C,UAAU,EAAE,aAAa;YACzB,QAAQ,EAAE,cAAiD;SAC5D,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -1,22 +1,20 @@
1
- import type { CriteriaSchema, FieldOfSchema, SelectedAliasOf } from './types/schema.types.js';
1
+ import type { CriteriaSchema, FieldOfSchema } from './types/schema.types.js';
2
2
  import { Cursor } from './cursor.js';
3
3
  import { Order, OrderDirection } from './order/order.js';
4
4
  import type { FilterPrimitive } from './filter/types/filter-primitive.types.js';
5
5
  import type { ICriteriaBase } from './types/criteria.interface.js';
6
- import type { JoinCriteriaParameterType, JoinParameterType, SpecificMatchingJoinConfig, StoredJoinDetails } from './types/join-utility.types.js';
6
+ import type { JoinCriteriaType, StoredJoinDetails } from './types/join-utility.types.js';
7
7
  import { FilterOperator } from './types/operator.types.js';
8
8
  import type { FilterGroup } from './filter/filter-group.js';
9
+ export type ValidSchema<CSchema extends CriteriaSchema> = CSchema['identifier_field'] extends CSchema['fields'][number] ? CSchema : `Schema identifier_field '${CSchema['identifier_field']}' must be one of the schema's defined fields. Schema: ${CSchema['source_name']}`;
9
10
  /**
10
11
  * Abstract base class for constructing query criteria.
11
12
  * It provides a fluent API for defining filters, joins, selections, ordering, and pagination.
12
13
  * Concrete criteria types (e.g., RootCriteria, JoinCriteria) will extend this class.
13
14
  *
14
15
  * @template TSchema - The schema definition for the entity this criteria operates on.
15
- * @template CurrentAlias - The selected alias for the entity from its schema.
16
16
  */
17
- export declare abstract class Criteria<TSchema extends CriteriaSchema, CurrentAlias extends SelectedAliasOf<TSchema> = SelectedAliasOf<TSchema>> implements ICriteriaBase<TSchema, CurrentAlias> {
18
- protected readonly schema: TSchema;
19
- protected _alias: CurrentAlias;
17
+ export declare abstract class Criteria<const TSchema extends CriteriaSchema> implements ICriteriaBase<TSchema> {
20
18
  private readonly _filterManager;
21
19
  private readonly _joinManager;
22
20
  private readonly _source_name;
@@ -33,24 +31,37 @@ export declare abstract class Criteria<TSchema extends CriteriaSchema, CurrentAl
33
31
  * @protected
34
32
  */
35
33
  protected _cursor: Cursor<FieldOfSchema<TSchema>, FilterOperator.GREATER_THAN | FilterOperator.LESS_THAN> | undefined;
34
+ protected readonly _schema: TSchema;
36
35
  /**
37
36
  * Initializes a new instance of the Criteria class.
38
- * @param {TSchema} schema - The schema definition for the entity.
39
- * @param {CurrentAlias} _alias - The alias to use for this entity in the query.
40
- * @throws {Error} If the provided alias is not supported by the schema.
37
+ * @param {ValidSchema<TSchema>} schema - The schema definition for the entity.
38
+ * @throws {Error} If the schema's identifier_field is not one of its defined fields.
41
39
  * @protected
42
40
  */
43
- constructor(schema: TSchema, _alias: CurrentAlias);
41
+ constructor(schema: ValidSchema<TSchema>);
42
+ get schema(): TSchema;
43
+ /**
44
+ * Gets the metadata associated with the root schema of this criteria.
45
+ * @returns {TSchema['metadata']} The metadata object from the schema, which can be undefined.
46
+ * @remarks This is intended primarily for use by translators.
47
+ */
48
+ get schemaMetadata(): TSchema['metadata'];
49
+ /**
50
+ * Gets the name of the identifier field for the current schema.
51
+ * @returns {FieldOfSchema<TSchema>} The name of the identifier field.
52
+ */
53
+ get identifierField(): FieldOfSchema<TSchema>;
44
54
  /**
45
55
  * Gets the currently selected fields.
46
- * If `_selectAll` is true, it returns all fields from the schema.
47
- * Otherwise, it returns the fields explicitly set via `setSelect`.
56
+ * If `_selectAll` is true (default or after `resetSelect()`), it returns all fields from the schema.
57
+ * If `_selectAll` is false (after `setSelect()`), it returns the fields explicitly set by the user,
58
+ * plus the schema's `identifier_field` (which is added implicitly by `setSelect`).
48
59
  * @returns {Array<FieldOfSchema<TSchema>>} An array of selected field names.
49
60
  */
50
61
  get select(): Array<FieldOfSchema<TSchema>>;
51
62
  /**
52
63
  * Resets the selection to include all fields from the schema.
53
- * Subsequent calls to `get select()` will return all schema fields
64
+ * Later calls to `get select()` will return all schema fields
54
65
  * until `setSelect()` is called again.
55
66
  * @returns {this} The current criteria instance for chaining.
56
67
  */
@@ -63,6 +74,9 @@ export declare abstract class Criteria<TSchema extends CriteriaSchema, CurrentAl
63
74
  /**
64
75
  * Specifies which fields to select for the entity.
65
76
  * Calling this method sets `selectAll` to false.
77
+ * The schema's `identifier_field` will always be included in the selection
78
+ * if it's not already present in `selectFields`.
79
+ * If `selectFields` is empty, only the `identifier_field` will be selected.
66
80
  * @param {Array<FieldOfSchema<TSchema>>} selectFields - An array of field names to select.
67
81
  * @returns {this} The current criteria instance for chaining.
68
82
  * @throws {Error} If any of the specified fields are not defined in the schema.
@@ -104,7 +118,7 @@ export declare abstract class Criteria<TSchema extends CriteriaSchema, CurrentAl
104
118
  * Gets the alias used for the entity of this criteria.
105
119
  * @returns {CurrentAlias} The alias string.
106
120
  */
107
- get alias(): CurrentAlias;
121
+ get alias(): TSchema['alias'];
108
122
  /**
109
123
  * Sets the maximum number of records to return (LIMIT).
110
124
  * @param {number} amount - The number of records to take. Must be non-negative.
@@ -128,16 +142,17 @@ export declare abstract class Criteria<TSchema extends CriteriaSchema, CurrentAl
128
142
  * @param {FieldOfSchema<TSchema>} field - The field name to validate.
129
143
  * @throws {Error} If the field is not defined in the schema.
130
144
  */
131
- protected assetFieldOnSchema(field: FieldOfSchema<TSchema>): void;
145
+ protected assetFieldOnSchema(field: TSchema['fields'][number]): void;
132
146
  /**
133
147
  * Adds an ordering rule to the criteria.
134
148
  * Multiple calls will append new ordering rules.
135
149
  * @param {FieldOfSchema<TSchema>} field - The field to order by.
136
150
  * @param {OrderDirection} direction - The direction of the ordering (ASC or DESC).
151
+ * @param {boolean} [nullFirst=false] - If true, null values will be ordered first.
137
152
  * @returns {this} The current criteria instance for chaining.
138
153
  * @throws {Error} If the specified field is not defined in the schema.
139
154
  */
140
- orderBy(field: FieldOfSchema<TSchema>, direction: OrderDirection): this;
155
+ orderBy(field: FieldOfSchema<TSchema>, direction: OrderDirection, nullFirst?: boolean): this;
141
156
  /**
142
157
  * Initializes the filter criteria with a single filter primitive.
143
158
  * This replaces any existing filters in the root filter group.
@@ -168,27 +183,22 @@ export declare abstract class Criteria<TSchema extends CriteriaSchema, CurrentAl
168
183
  */
169
184
  orWhere<Operator extends FilterOperator>(filterPrimitive: FilterPrimitive<FieldOfSchema<TSchema>, Operator>): this;
170
185
  /**
171
- * Adds a join to another criteria.
186
+ * Adds a join to another criteria. This method is fully type-safe.
187
+ * The `joinAlias` argument provides autocompletion for all valid relation aliases defined in the schema.
188
+ * The `criteriaToJoin` argument is then validated to ensure its `source_name` matches the one
189
+ * configured for the chosen `joinAlias`, providing clear, compile-time error messages if they mismatch.
190
+ *
172
191
  * @template TJoinSchema - The schema of the entity to join.
173
- * @template TJoinedCriteriaAlias - The alias for the joined entity.
174
- * @template TMatchingJoinConfig - The specific join configuration from the parent schema that matches the joined
175
- * alias.
176
- * @param {JoinCriteriaParameterType<TSchema, TJoinSchema, TJoinedCriteriaAlias, TMatchingJoinConfig>} criteriaToJoin
177
- * The criteria instance representing the entity to join (e.g., `InnerJoinCriteria`, `LeftJoinCriteria`).
178
- * @param {JoinParameterType<TSchema, TJoinSchema, TMatchingJoinConfig>} joinParameter
179
- * The parameters defining how the join should be performed (e.g., fields for simple join, pivot table details for
180
- * many-to-many).
192
+ * @template SpecificRelationAlias - The literal type of the relation alias being used for the join.
193
+ * @param {SpecificRelationAlias} joinAlias - The specific alias defined in the parent schema's `relations` array for
194
+ * this relation.
195
+ * @param {JoinCriteriaType<TSchema, TJoinSchema, SpecificRelationAlias>} criteriaToJoin - The criteria instance
196
+ * representing the entity to join (e.g., `InnerJoinCriteria`).
197
+ * @param {boolean} [withSelect=true] - If true (default), the joined entity's fields will be included in the final
198
+ * selection. If false, the join will only be used for filtering and its fields will not be selected.
181
199
  * @returns {this} The current criteria instance for chaining.
182
- * @throws {Error} If `criteriaToJoin` is a string (which is invalid).
183
- * @throws {Error} If `parent_field` in `joinParameter` (or `parent_field.reference` for pivot joins) is not defined
184
- * in the parent schema.
185
- * @throws {Error} If the join configuration for the given `criteriaToJoin.alias` is not found in the parent schema's
186
- * `joins` array.
187
- * @throws {Error} If `joinParameter` is invalid for the `relation_type` defined in the schema (e.g., using
188
- * simple join input for many-to-many or vice-versa).
189
- */
190
- join<TJoinSchema extends CriteriaSchema, TJoinedCriteriaAlias extends SelectedAliasOf<TJoinSchema>, TMatchingJoinConfig extends SpecificMatchingJoinConfig<TSchema, TJoinedCriteriaAlias>>(criteriaToJoin: JoinCriteriaParameterType<TSchema, TJoinSchema, TJoinedCriteriaAlias, TMatchingJoinConfig>, joinParameter: JoinParameterType<TSchema, TJoinSchema, TMatchingJoinConfig>): this;
191
- private assertIsValidJoinOptions;
200
+ */
201
+ join<const TJoinSchema extends CriteriaSchema, const SpecificRelationAlias extends TSchema['relations'][number]['relation_alias']>(joinAlias: SpecificRelationAlias, criteriaToJoin: JoinCriteriaType<TSchema, TJoinSchema, SpecificRelationAlias>, withSelect?: boolean): this;
192
202
  /**
193
203
  * Gets the current cursor configuration, if set.
194
204
  * @returns {Cursor<FieldOfSchema<TSchema>, FilterOperator.GREATER_THAN | FilterOperator.LESS_THAN> | undefined}
@@ -1 +1 @@
1
- {"version":3,"file":"criteria.d.ts","sourceRoot":"","sources":["../../src/criteria/criteria.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAEb,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAO3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D;;;;;;;GAOG;AACH,8BAAsB,QAAQ,CAC5B,OAAO,SAAS,cAAc,EAC9B,YAAY,SAAS,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,CACxE,YAAW,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC;IA+B7C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO;IAClC,SAAS,CAAC,MAAM,EAAE,YAAY;IA9BhC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwC;IACvE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsC;IACnE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAyB;IACtD,OAAO,CAAC,KAAK,CAAa;IAC1B;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAe;IAC7D,OAAO,CAAC,UAAU,CAAiB;IACnC;;;OAGG;IAC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