@entity-access/entity-access 1.2.29 → 1.2.30

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 (205) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/common/CIMap.d.ts +16 -0
  3. package/dist/common/CIMap.d.ts.map +1 -0
  4. package/dist/common/CustomEvent.d.ts +12 -0
  5. package/dist/common/CustomEvent.d.ts.map +1 -0
  6. package/dist/common/EALogger.d.ts +4 -0
  7. package/dist/common/EALogger.d.ts.map +1 -0
  8. package/dist/common/EntityAccessError.d.ts +7 -0
  9. package/dist/common/EntityAccessError.d.ts.map +1 -0
  10. package/dist/common/ErrorModel.d.ts +14 -0
  11. package/dist/common/ErrorModel.d.ts.map +1 -0
  12. package/dist/common/EventSet.d.ts +20 -0
  13. package/dist/common/EventSet.d.ts.map +1 -0
  14. package/dist/common/IColumnSchema.d.ts +21 -0
  15. package/dist/common/IColumnSchema.d.ts.map +1 -0
  16. package/dist/common/IDisposable.d.ts +7 -0
  17. package/dist/common/IDisposable.d.ts.map +1 -0
  18. package/dist/common/ImmutableObject.d.ts +5 -0
  19. package/dist/common/ImmutableObject.d.ts.map +1 -0
  20. package/dist/common/JsonGenerator.d.ts +11 -0
  21. package/dist/common/JsonGenerator.d.ts.map +1 -0
  22. package/dist/common/Logger.d.ts +33 -0
  23. package/dist/common/Logger.d.ts.map +1 -0
  24. package/dist/common/ObjectPool.d.ts +61 -0
  25. package/dist/common/ObjectPool.d.ts.map +1 -0
  26. package/dist/common/TypeInfo.d.ts +4 -0
  27. package/dist/common/TypeInfo.d.ts.map +1 -0
  28. package/dist/common/cache/InstanceCache.d.ts +2 -0
  29. package/dist/common/cache/InstanceCache.d.ts.map +1 -0
  30. package/dist/common/cache/TimedCache.d.ts +33 -0
  31. package/dist/common/cache/TimedCache.d.ts.map +1 -0
  32. package/dist/common/cloner.d.ts +4 -0
  33. package/dist/common/cloner.d.ts.map +1 -0
  34. package/dist/common/sleep.d.ts +2 -0
  35. package/dist/common/sleep.d.ts.map +1 -0
  36. package/dist/common/symbols/symbols.d.ts +8 -0
  37. package/dist/common/symbols/symbols.d.ts.map +1 -0
  38. package/dist/common/usingAsync.d.ts +15 -0
  39. package/dist/common/usingAsync.d.ts.map +1 -0
  40. package/dist/compiler/ISqlHelpers.d.ts +12 -0
  41. package/dist/compiler/ISqlHelpers.d.ts.map +1 -0
  42. package/dist/compiler/NamingConventions.d.ts +8 -0
  43. package/dist/compiler/NamingConventions.d.ts.map +1 -0
  44. package/dist/compiler/QueryCompiler.d.ts +45 -0
  45. package/dist/compiler/QueryCompiler.d.ts.map +1 -0
  46. package/dist/compiler/RawQuery.d.ts +9 -0
  47. package/dist/compiler/RawQuery.d.ts.map +1 -0
  48. package/dist/compiler/postgres/PostgreSqlMethodTransformer.d.ts +4 -0
  49. package/dist/compiler/postgres/PostgreSqlMethodTransformer.d.ts.map +1 -0
  50. package/dist/compiler/sql-server/SqlServerSqlMethodTransformer.d.ts +4 -0
  51. package/dist/compiler/sql-server/SqlServerSqlMethodTransformer.d.ts.map +1 -0
  52. package/dist/decorators/CheckConstraint.d.ts +4 -0
  53. package/dist/decorators/CheckConstraint.d.ts.map +1 -0
  54. package/dist/decorators/Column.d.ts +10 -0
  55. package/dist/decorators/Column.d.ts.map +1 -0
  56. package/dist/decorators/ForeignKey.d.ts +10 -0
  57. package/dist/decorators/ForeignKey.d.ts.map +1 -0
  58. package/dist/decorators/ICheckConstraint.d.ts +5 -0
  59. package/dist/decorators/ICheckConstraint.d.ts.map +1 -0
  60. package/dist/decorators/IClassOf.d.ts +3 -0
  61. package/dist/decorators/IClassOf.d.ts.map +1 -0
  62. package/dist/decorators/IColumn.d.ts +87 -0
  63. package/dist/decorators/IColumn.d.ts.map +1 -0
  64. package/dist/decorators/IForeignKeyConstraint.d.ts +12 -0
  65. package/dist/decorators/IForeignKeyConstraint.d.ts.map +1 -0
  66. package/dist/decorators/IIndex.d.ts +30 -0
  67. package/dist/decorators/IIndex.d.ts.map +1 -0
  68. package/dist/decorators/ISqlType.d.ts +61 -0
  69. package/dist/decorators/ISqlType.d.ts.map +1 -0
  70. package/dist/decorators/Index.d.ts +4 -0
  71. package/dist/decorators/Index.d.ts.map +1 -0
  72. package/dist/decorators/Relate.d.ts +37 -0
  73. package/dist/decorators/Relate.d.ts.map +1 -0
  74. package/dist/decorators/SchemaRegistry.d.ts +9 -0
  75. package/dist/decorators/SchemaRegistry.d.ts.map +1 -0
  76. package/dist/decorators/Table.d.ts +9 -0
  77. package/dist/decorators/Table.d.ts.map +1 -0
  78. package/dist/decorators/parser/NameParser.d.ts +4 -0
  79. package/dist/decorators/parser/NameParser.d.ts.map +1 -0
  80. package/dist/di/di.d.ts +49 -0
  81. package/dist/di/di.d.ts.map +1 -0
  82. package/dist/drivers/base/BaseDriver.d.ts +134 -0
  83. package/dist/drivers/base/BaseDriver.d.ts.map +1 -0
  84. package/dist/drivers/base/ExistingSchema.d.ts +14 -0
  85. package/dist/drivers/base/ExistingSchema.d.ts.map +1 -0
  86. package/dist/drivers/base/ReaderQueue.d.ts +17 -0
  87. package/dist/drivers/base/ReaderQueue.d.ts.map +1 -0
  88. package/dist/drivers/postgres/PostgreSqlDriver.d.ts +29 -0
  89. package/dist/drivers/postgres/PostgreSqlDriver.d.ts.map +1 -0
  90. package/dist/drivers/sql-server/ExpressionToSqlServer.d.ts +14 -0
  91. package/dist/drivers/sql-server/ExpressionToSqlServer.d.ts.map +1 -0
  92. package/dist/drivers/sql-server/SqlServerDriver.d.ts +30 -0
  93. package/dist/drivers/sql-server/SqlServerDriver.d.ts.map +1 -0
  94. package/dist/drivers/sql-server/SqlServerLiteral.d.ts +5 -0
  95. package/dist/drivers/sql-server/SqlServerLiteral.d.ts.map +1 -0
  96. package/dist/drivers/sql-server/SqlServerQueryCompiler.d.ts +5 -0
  97. package/dist/drivers/sql-server/SqlServerQueryCompiler.d.ts.map +1 -0
  98. package/dist/entity-query/EntityType.d.ts +78 -0
  99. package/dist/entity-query/EntityType.d.ts.map +1 -0
  100. package/dist/index.d.ts +22 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/migrations/Migrations.d.ts +44 -0
  103. package/dist/migrations/Migrations.d.ts.map +1 -0
  104. package/dist/migrations/postgres/PostgresAutomaticMigrations.d.ts +19 -0
  105. package/dist/migrations/postgres/PostgresAutomaticMigrations.d.ts.map +1 -0
  106. package/dist/migrations/postgres/PostgresMigrations.d.ts +11 -0
  107. package/dist/migrations/postgres/PostgresMigrations.d.ts.map +1 -0
  108. package/dist/migrations/sql-server/SqlServerAutomaticMigrations.d.ts +19 -0
  109. package/dist/migrations/sql-server/SqlServerAutomaticMigrations.d.ts.map +1 -0
  110. package/dist/migrations/sql-server/SqlServerMigrations.d.ts +12 -0
  111. package/dist/migrations/sql-server/SqlServerMigrations.d.ts.map +1 -0
  112. package/dist/model/EntityContext.d.ts +36 -0
  113. package/dist/model/EntityContext.d.ts.map +1 -0
  114. package/dist/model/EntityModel.d.ts +13 -0
  115. package/dist/model/EntityModel.d.ts.map +1 -0
  116. package/dist/model/EntityQuery.d.ts +64 -0
  117. package/dist/model/EntityQuery.d.ts.map +1 -0
  118. package/dist/model/EntitySource.d.ts +86 -0
  119. package/dist/model/EntitySource.d.ts.map +1 -0
  120. package/dist/model/IFilterWithParameter.d.ts +80 -0
  121. package/dist/model/IFilterWithParameter.d.ts.map +1 -0
  122. package/dist/model/SourceExpression.d.ts +2 -0
  123. package/dist/model/SourceExpression.d.ts.map +1 -0
  124. package/dist/model/changes/ChangeEntry.d.ts +61 -0
  125. package/dist/model/changes/ChangeEntry.d.ts.map +1 -0
  126. package/dist/model/changes/ChangeSet.d.ts +31 -0
  127. package/dist/model/changes/ChangeSet.d.ts.map +1 -0
  128. package/dist/model/events/ContextEvents.d.ts +11 -0
  129. package/dist/model/events/ContextEvents.d.ts.map +1 -0
  130. package/dist/model/events/EntityEvents.d.ts +39 -0
  131. package/dist/model/events/EntityEvents.d.ts.map +1 -0
  132. package/dist/model/events/FilteredExpression.d.ts +11 -0
  133. package/dist/model/events/FilteredExpression.d.ts.map +1 -0
  134. package/dist/model/identity/IdentityMap.d.ts +23 -0
  135. package/dist/model/identity/IdentityMap.d.ts.map +1 -0
  136. package/dist/model/identity/IdentityService.d.ts +5 -0
  137. package/dist/model/identity/IdentityService.d.ts.map +1 -0
  138. package/dist/model/identity/RelationMapper.d.ts +11 -0
  139. package/dist/model/identity/RelationMapper.d.ts.map +1 -0
  140. package/dist/model/identity/SearchIndex.d.ts +17 -0
  141. package/dist/model/identity/SearchIndex.d.ts.map +1 -0
  142. package/dist/model/symbols.d.ts +2 -0
  143. package/dist/model/symbols.d.ts.map +1 -0
  144. package/dist/model/verification/VerificationSession.d.ts +27 -0
  145. package/dist/model/verification/VerificationSession.d.ts.map +1 -0
  146. package/dist/query/Query.d.ts +29 -0
  147. package/dist/query/Query.d.ts.map +1 -0
  148. package/dist/query/ast/DebugStringVisitor.d.ts +40 -0
  149. package/dist/query/ast/DebugStringVisitor.d.ts.map +1 -0
  150. package/dist/query/ast/ExpressionToSql.d.ts +67 -0
  151. package/dist/query/ast/ExpressionToSql.d.ts.map +1 -0
  152. package/dist/query/ast/Expressions.d.ts +255 -0
  153. package/dist/query/ast/Expressions.d.ts.map +1 -0
  154. package/dist/query/ast/IStringTransformer.d.ts +27 -0
  155. package/dist/query/ast/IStringTransformer.d.ts.map +1 -0
  156. package/dist/query/ast/ParameterScope.d.ts +25 -0
  157. package/dist/query/ast/ParameterScope.d.ts.map +1 -0
  158. package/dist/query/ast/ReplaceParameter.d.ts +6 -0
  159. package/dist/query/ast/ReplaceParameter.d.ts.map +1 -0
  160. package/dist/query/ast/SqlLiteral.d.ts +4 -0
  161. package/dist/query/ast/SqlLiteral.d.ts.map +1 -0
  162. package/dist/query/ast/Types.d.ts +2 -0
  163. package/dist/query/ast/Types.d.ts.map +1 -0
  164. package/dist/query/ast/Visitor.d.ts +40 -0
  165. package/dist/query/ast/Visitor.d.ts.map +1 -0
  166. package/dist/query/expander/QueryExpander.d.ts +12 -0
  167. package/dist/query/expander/QueryExpander.d.ts.map +1 -0
  168. package/dist/query/parser/ArrowToExpression.d.ts +58 -0
  169. package/dist/query/parser/ArrowToExpression.d.ts.map +1 -0
  170. package/dist/query/parser/BabelVisitor.d.ts +24 -0
  171. package/dist/query/parser/BabelVisitor.d.ts.map +1 -0
  172. package/dist/query/parser/NotSupportedError.d.ts +5 -0
  173. package/dist/query/parser/NotSupportedError.d.ts.map +1 -0
  174. package/dist/query/parser/Restructure.d.ts +20 -0
  175. package/dist/query/parser/Restructure.d.ts.map +1 -0
  176. package/dist/query/parser/TransformVisitor.d.ts +25 -0
  177. package/dist/query/parser/TransformVisitor.d.ts.map +1 -0
  178. package/dist/sql/ISql.d.ts +160 -0
  179. package/dist/sql/ISql.d.ts.map +1 -0
  180. package/dist/sql/Sql.d.ts +4 -0
  181. package/dist/sql/Sql.d.ts.map +1 -0
  182. package/dist/types/DateTime.d.ts +168 -0
  183. package/dist/types/DateTime.d.ts.map +1 -0
  184. package/dist/types/TimeSpan.d.ts +40 -0
  185. package/dist/types/TimeSpan.d.ts.map +1 -0
  186. package/dist/workflows/ActivitySuspendedError.d.ts +6 -0
  187. package/dist/workflows/ActivitySuspendedError.d.ts.map +1 -0
  188. package/dist/workflows/Waiter.d.ts +10 -0
  189. package/dist/workflows/Waiter.d.ts.map +1 -0
  190. package/dist/workflows/Workflow.d.ts +47 -0
  191. package/dist/workflows/Workflow.d.ts.map +1 -0
  192. package/dist/workflows/WorkflowClock.d.ts +5 -0
  193. package/dist/workflows/WorkflowClock.d.ts.map +1 -0
  194. package/dist/workflows/WorkflowContext.d.ts +52 -0
  195. package/dist/workflows/WorkflowContext.d.ts.map +1 -0
  196. package/dist/workflows/WorkflowDbContext.d.ts +32 -0
  197. package/dist/workflows/WorkflowDbContext.d.ts.map +1 -0
  198. package/dist/workflows/WorkflowRegistry.d.ts +13 -0
  199. package/dist/workflows/WorkflowRegistry.d.ts.map +1 -0
  200. package/dist/workflows/WorkflowStorage.d.ts +72 -0
  201. package/dist/workflows/WorkflowStorage.d.ts.map +1 -0
  202. package/dist/workflows/WorkflowTask.d.ts +13 -0
  203. package/dist/workflows/WorkflowTask.d.ts.map +1 -0
  204. package/package.json +1 -1
  205. package/tsconfig.json +2 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextEvents.d.ts","sourceRoot":"","sources":["../../../src/model/events/ContextEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAGlD,MAAM,CAAC,OAAO,OAAO,aAAa;IAE9B,OAAO,CAAC,GAAG,CAAoD;IAExD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,UAAO,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAWjE,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAKhE,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,EAAE;CAOzF"}
@@ -0,0 +1,39 @@
1
+ import type EntityType from "../../entity-query/EntityType.js";
2
+ import type EntityContext from "../EntityContext.js";
3
+ import { IEntityQuery } from "../IFilterWithParameter.js";
4
+ import ChangeEntry from "../changes/ChangeEntry.js";
5
+ export declare const entityNameSymbol: unique symbol;
6
+ export declare class ForeignKeyFilter<T = any, TE = any> {
7
+ readonly type: EntityType;
8
+ readonly name: string;
9
+ readonly fkName: string;
10
+ readonly entity: TE;
11
+ private events;
12
+ private context;
13
+ constructor(p: Partial<ForeignKeyFilter> & {
14
+ context: EntityContext;
15
+ events: EntityEvents<any>;
16
+ });
17
+ is<TR>(fx: (x: T) => TR): this is ForeignKeyFilter<T, TR> & boolean;
18
+ read(): IEntityQuery<TE>;
19
+ unfiltered(): IEntityQuery<TE>;
20
+ modify(): IEntityQuery<TE>;
21
+ }
22
+ export default class EntityEvents<T> {
23
+ readonly entityName: any;
24
+ get verify(): boolean;
25
+ constructor(entityName?: any);
26
+ filter(query: IEntityQuery<T>): IEntityQuery<T>;
27
+ includeFilter(query: IEntityQuery<T>, type?: any, key?: string): IEntityQuery<T>;
28
+ modify(query: IEntityQuery<T>): IEntityQuery<T>;
29
+ delete(query: IEntityQuery<T>): IEntityQuery<T>;
30
+ beforeInsert(entity: T, entry: ChangeEntry): void | Promise<void>;
31
+ onForeignKeyFilter(filter: ForeignKeyFilter<T>): IEntityQuery<any>;
32
+ afterInsert(entity: T, entry: ChangeEntry<T>): void | Promise<void>;
33
+ beforeUpdate(entity: T, entry: ChangeEntry<T>): void | Promise<void>;
34
+ afterUpdate(entity: T, entry: ChangeEntry<T>): void | Promise<void>;
35
+ beforeDelete(entity: T, entry: ChangeEntry<T>): void | Promise<void>;
36
+ afterDelete(entity: T, entry: ChangeEntry<T>): void | Promise<void>;
37
+ preJson(entity: T): T;
38
+ }
39
+ //# sourceMappingURL=EntityEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityEvents.d.ts","sourceRoot":"","sources":["../../../src/model/events/EntityEvents.ts"],"names":[],"mappings":"AACA,OAAO,KAAM,UAAU,MAAM,kCAAkC,CAAC;AAChE,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,2BAA2B,CAAC;AAIpD,eAAO,MAAM,gBAAgB,eAAwB,CAAC;AAEtD,qBAAa,gBAAgB,CAAC,CAAC,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG;IAE3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AK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE,OAAO,CAAC,MAAM,EAAE,CAAC;CAIpB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * When an expression is already filtered, we should assume that
3
+ * Events author has taken care of filtering and does not require
4
+ * nested filtering.
5
+ */
6
+ export declare const filteredSymbol: unique symbol;
7
+ export declare const FilteredExpression: {
8
+ isFiltered(fx: any): boolean;
9
+ markAsFiltered(fx: any): any;
10
+ };
11
+ //# sourceMappingURL=FilteredExpression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilteredExpression.d.ts","sourceRoot":"","sources":["../../../src/model/events/FilteredExpression.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,cAAc,eAAqB,CAAC;AAGjD,eAAO,MAAM,kBAAkB;yBACX,OAAO;;CAmB1B,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { IColumn } from "../../decorators/IColumn.js";
2
+ import type EntityType from "../../entity-query/EntityType.js";
3
+ /**
4
+ * Locally cache uniquely identifiable entities
5
+ */
6
+ export default class IdentityMap {
7
+ get indexedColumns(): MapIterator<IColumn>;
8
+ private map;
9
+ private keys;
10
+ delete(jsonKey: any): void;
11
+ get(jsonKeys: any): any;
12
+ set(jsonKey: any, entity: any, type: EntityType): void;
13
+ clear(): void;
14
+ build(key: IColumn): Map<any, any[]>;
15
+ searchByKeys(pairs: {
16
+ key: IColumn;
17
+ value: any;
18
+ }[], create?: boolean): any;
19
+ private getAll;
20
+ private getKeyEntry;
21
+ private updateSearchIndex;
22
+ }
23
+ //# sourceMappingURL=IdentityMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityMap.d.ts","sourceRoot":"","sources":["../../../src/model/identity/IdentityMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAE5B,IAAW,cAAc,yBAExB;IAED,OAAO,CAAC,GAAG,CAA0B;IAErC,OAAO,CAAC,IAAI,CAAuC;IAE5C,MAAM,CAAC,OAAO,KAAA;IA0Bd,GAAG,CAAC,QAAQ,KAAA;IAIZ,GAAG,CAAC,OAAO,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,EAAE,UAAU;IAMrC,KAAK;IAKL,KAAK,CAAC,GAAG,EAAE,OAAO;IAIzB,YAAY,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,OAAO,CAAC;QAAC,KAAK,MAAA;KAAC,EAAE,EAAE,MAAM,UAAO;IAsB3D,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,iBAAiB;CAsB5B"}
@@ -0,0 +1,5 @@
1
+ import type EntityType from "../../entity-query/EntityType.js";
2
+ export default class IdentityService {
3
+ static getIdentity(entityType: EntityType, entity: any): any;
4
+ }
5
+ //# sourceMappingURL=IdentityService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityService.d.ts","sourceRoot":"","sources":["../../../src/model/identity/IdentityService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,eAAe;WAElB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,KAAA;CAyB3D"}
@@ -0,0 +1,11 @@
1
+ import type ChangeEntry from "../changes/ChangeEntry.js";
2
+ import type ChangeSet from "../changes/ChangeSet.js";
3
+ export default class RelationMapper {
4
+ private identityMap;
5
+ private events;
6
+ constructor(changeSet: ChangeSet, identityMap?: import("./IdentityMap.js").default);
7
+ push(id: string, fx: () => any): void;
8
+ emit(id: string): void;
9
+ fix(entry: ChangeEntry, nest?: boolean): void;
10
+ }
11
+ //# sourceMappingURL=RelationMapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationMapper.d.ts","sourceRoot":"","sources":["../../../src/model/identity/RelationMapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AAOrD,MAAM,CAAC,OAAO,OAAO,cAAc;IAW3B,OAAO,CAAC,WAAW;IAJvB,OAAO,CAAC,MAAM,CAAsC;gBAGhD,SAAS,EAAE,SAAS,EACZ,WAAW,qCAA+B;IAatD,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG;IAgB9B,IAAI,CAAC,EAAE,EAAE,MAAM;IAUf,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,UAAO;CA2FtC"}
@@ -0,0 +1,17 @@
1
+ import type { IColumn } from "../../decorators/IColumn.js";
2
+ import type ChangeEntry from "../changes/ChangeEntry.js";
3
+ export default class SearchIndex {
4
+ private entries;
5
+ private keys;
6
+ constructor(entries: ChangeEntry[]);
7
+ getByKeys(pairs: {
8
+ key: any;
9
+ value: any;
10
+ }[], create?: boolean): any[];
11
+ getAll(key: string, value: any, create?: boolean): any[];
12
+ delete(entry: any): void;
13
+ get(keys: IColumn[], entry: any): any;
14
+ update(keys: IColumn[], entry: any): void;
15
+ private getKeyEntry;
16
+ }
17
+ //# sourceMappingURL=SearchIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchIndex.d.ts","sourceRoot":"","sources":["../../../src/model/identity/SearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,WAAW;IAIhB,OAAO,CAAC,OAAO;IAF3B,OAAO,CAAC,IAAI,CAAsC;gBAE9B,OAAO,EAAE,WAAW,EAAE;IAI1C,SAAS,CAAC,KAAK,EAAE;QAAE,GAAG,MAAC;QAAC,KAAK,MAAA;KAAC,EAAE,EAAE,MAAM,UAAO;IAsB/C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,UAAO;IAK7C,MAAM,CAAC,KAAK,KAAA;IAeZ,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,KAAA;IAsB1B,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,KAAA;IAmB7B,OAAO,CAAC,WAAW;CAyBtB"}
@@ -0,0 +1,2 @@
1
+ export declare const existsQuery: unique symbol;
2
+ //# sourceMappingURL=symbols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/model/symbols.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,eAAwB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { IEntityRelation } from "../../decorators/IColumn.js";
2
+ import { Expression } from "../../query/ast/Expressions.js";
3
+ import EntityContext from "../EntityContext.js";
4
+ import EntityQuery from "../EntityQuery.js";
5
+ import ChangeEntry from "../changes/ChangeEntry.js";
6
+ import EntityEvents from "../events/EntityEvents.js";
7
+ type KeyValueArray = [string, any][];
8
+ /**
9
+ * It is not good to verify all entities at once, but rather
10
+ * single entity as it would reduce the query to single row
11
+ * and avoid unnecessary joins.
12
+ *
13
+ * First failure will stop any further query evaluation.
14
+ */
15
+ export default class VerificationSession {
16
+ private context;
17
+ private field;
18
+ private verificationSets;
19
+ constructor(context: EntityContext);
20
+ queueVerification(change: ChangeEntry, events: EntityEvents<any>): void;
21
+ queueEntityForeignKey(change: ChangeEntry, relation: IEntityRelation, fkColumn: any, relatedKeyColumn: any, value: any): void;
22
+ queueEntityKey(change: ChangeEntry, keys: KeyValueArray, events: EntityEvents<any>): void;
23
+ verifyAsync(): Promise<any>;
24
+ addError(query: EntityQuery, compare: Expression, error: string): void;
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=VerificationSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationSession.d.ts","sourceRoot":"","sources":["../../../src/model/verification/VerificationSession.ts"],"names":[],"mappings":"AAGA,OAAO,EAAW,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAA2C,UAAU,EAAwE,MAAM,gCAAgC,CAAC;AAC3K,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,YAAkC,MAAM,2BAA2B,CAAC;AAE3E,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;AAgBrC;;;;;;GAMG;AAEH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IASxB,OAAO,CAAC,OAAO;IAL3B,OAAO,CAAC,KAAK,CAA0B;IAEvC,OAAO,CAAC,gBAAgB,CAAqB;gBAGzB,OAAO,EAAE,aAAa;IAM1C,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC;IAoEhE,qBAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,KAAA,EAAE,gBAAgB,KAAA,EAAE,KAAK,KAAA;IA+BvG,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC;IAsB5E,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC;IAiCjC,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM;CAsBlE"}
@@ -0,0 +1,29 @@
1
+ export declare const queryItem: unique symbol;
2
+ export declare class QueryPart {
3
+ static from(a: Partial<QueryPart>): QueryPart;
4
+ name: string;
5
+ literal: boolean;
6
+ quoted: boolean;
7
+ value: any;
8
+ toString(): string;
9
+ }
10
+ export type IQuery = string | QueryPart;
11
+ export declare class Query {
12
+ readonly parts: IQuery[];
13
+ static empty: Query;
14
+ static literal: (name: any) => QueryPart;
15
+ static quotedLiteral: (...names: string[]) => QueryPart[];
16
+ static join(queries: Query[], separator?: string): Query;
17
+ static create(t: TemplateStringsArray, ...a: any[]): Query;
18
+ constructor(parts?: IQuery[]);
19
+ append(t: TemplateStringsArray, ...a: []): Query;
20
+ appendLiteral(text: any): Query;
21
+ appendQuotedLiteral(text: any): Query;
22
+ appendParameter(value: any, name?: any): Query;
23
+ toString(): string;
24
+ toQuery(naming?: (name: string, index: number) => string, quote?: (name: string) => string): {
25
+ text: string;
26
+ values: any[];
27
+ };
28
+ }
29
+ //# sourceMappingURL=Query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/query/Query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAAsB,CAAC;AAE7C,qBAAa,SAAS;WAEJ,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAExB,SAAS;IAGlB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC;IAEX,QAAQ;CAOlB;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAExC,qBAAa,KAAK;aAiFc,KAAK,EAAE,MAAM,EAAE;IA/E3C,OAAc,KAAK,QAAiB;IAEpC,OAAc,OAAO,GAAI,SAAI,KAAG,SAAS,CAA4C;IAErF,OAAc,aAAa,GAAI,GAAG,OAAQ,MAAM,EAAG,KAAG,SAAS,EAAE,CAA+E;WAElI,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,GAAE,MAAa;WAW/C,MAAM,CAAC,CAAC,EAAE,oBAAoB,EAAE,GAAI,CAAC,EAAE,GAAG,EAAE;gBA8D9B,KAAK,GAAE,MAAM,EAAO;IAIhD,MAAM,CAAC,CAAC,EAAE,oBAAoB,EAAE,GAAI,CAAC,EAAE,EAAE;IAIzC,aAAa,CAAC,IAAI,KAAA;IAIlB,mBAAmB,CAAC,IAAI,KAAA;IAIxB,eAAe,CAAC,KAAK,KAAA,EAAE,IAAI,CAAC,KAAA;IAK5B,QAAQ;IAIR,OAAO,CACH,MAAM,GAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAA6B,EACtE,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAuC;;;;CAwBvE"}
@@ -0,0 +1,40 @@
1
+ import { ArrayExpression, ArrowFunctionExpression, BigIntLiteral, BinaryExpression, BooleanLiteral, BracketExpression, CallExpression, CoalesceExpression, ConditionalExpression, Constant, DeleteStatement, ExistsExpression, Expression, ExpressionAs, Identifier, InsertStatement, JoinExpression, MemberExpression, NegateExpression, NewObjectExpression, NotExits, NullExpression, NumberLiteral, OrderByExpression, ParameterExpression, ReturnUpdated, SelectStatement, StringLiteral, TableLiteral, TemplateElement, TemplateLiteral, UnionStatement, UpdateStatement, ValuesStatement } from "./Expressions.js";
2
+ import Visitor from "./Visitor.js";
3
+ export default class DebugStringVisitor extends Visitor<string> {
4
+ static expressionToString(e: Expression): string;
5
+ visitArrowFunctionExpression(e: ArrowFunctionExpression): string;
6
+ visitArrayExpression(e: ArrayExpression): string;
7
+ visitBigIntLiteral(e: BigIntLiteral): string;
8
+ visitBinaryExpression(e: BinaryExpression): string;
9
+ visitBooleanLiteral(e: BooleanLiteral): string;
10
+ visitCallExpression(e: CallExpression): string;
11
+ visitCoalesceExpression(e: CoalesceExpression): string;
12
+ visitConditionalExpression(e: ConditionalExpression): string;
13
+ visitConstant(e: Constant): string;
14
+ visitBracketExpression(e: BracketExpression): string;
15
+ visitExpressionAs(e: ExpressionAs): string;
16
+ visitIdentifier(e: Identifier): string;
17
+ visitMemberExpression(e: MemberExpression): string;
18
+ visitTableLiteral(e: TableLiteral): string;
19
+ visitNewObjectExpression(e: NewObjectExpression): string;
20
+ visitNullExpression(e: NullExpression): string;
21
+ visitNumberLiteral(e: NumberLiteral): string;
22
+ visitParameterExpression(e: ParameterExpression): string;
23
+ visitStringLiteral(e: StringLiteral): string;
24
+ visitTemplateElement(e: TemplateElement): string;
25
+ visitTemplateLiteral(e: TemplateLiteral): string;
26
+ visitDeleteStatement(e: DeleteStatement): string;
27
+ visitNegateExpression(e: NegateExpression): string;
28
+ visitExistsExpression(e: ExistsExpression): string;
29
+ visitInsertStatement(e: InsertStatement): string;
30
+ visitJoinExpression(e: JoinExpression): string;
31
+ visitOrderByExpression(e: OrderByExpression): string;
32
+ visitReturnUpdated(e: ReturnUpdated): string;
33
+ visitValuesStatement(e: ValuesStatement): string;
34
+ visitSelectStatement(e: SelectStatement): string;
35
+ visitUpdateStatement(e: UpdateStatement): string;
36
+ visitNotExists(e: NotExits): string;
37
+ visitUnionStatement(e: UnionStatement): string;
38
+ private visitArray;
39
+ }
40
+ //# sourceMappingURL=DebugStringVisitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugStringVisitor.d.ts","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
+ import QueryCompiler from "../../compiler/QueryCompiler.js";
2
+ import EntityType, { IEntityProperty } from "../../entity-query/EntityType.js";
3
+ import EntityQuery from "../../model/EntityQuery.js";
4
+ import { ArrowFunctionExpression, BigIntLiteral, BinaryExpression, BooleanLiteral, CallExpression, CoalesceExpression, ConditionalExpression, Constant, DeleteStatement, ExistsExpression, Expression, ExpressionAs, Identifier, InsertStatement, JoinExpression, MemberExpression, UpsertStatement, NewObjectExpression, NotExits, NullExpression, NumberLiteral, OrderByExpression, ParameterExpression, ReturnUpdated, SelectStatement, StringLiteral, TableLiteral, TemplateLiteral, UnionStatement, UpdateStatement, ValuesStatement, NotExpression, BracketExpression, NegateExpression } from "./Expressions.js";
5
+ import { ITextQuery } from "./IStringTransformer.js";
6
+ import ParameterScope from "./ParameterScope.js";
7
+ import Visitor from "./Visitor.js";
8
+ export interface IMappingModel {
9
+ parameter: ParameterExpression;
10
+ model?: EntityType;
11
+ selectStatement?: SelectStatement;
12
+ name: string;
13
+ }
14
+ export default class ExpressionToSql extends Visitor<ITextQuery> {
15
+ private source;
16
+ root: ParameterExpression;
17
+ target: ParameterExpression;
18
+ private compiler;
19
+ protected readonly scope: ParameterScope;
20
+ private readonly selectStack;
21
+ constructor(source: EntityQuery, root: ParameterExpression, target: ParameterExpression, compiler: QueryCompiler);
22
+ visit(e1: Expression): ITextQuery;
23
+ visitArray(e: Expression[], sep?: string): ITextQuery;
24
+ visitValuesStatement(e: ValuesStatement): ITextQuery;
25
+ visitTableLiteral(e: TableLiteral): ITextQuery;
26
+ visitSelectStatement(e: SelectStatement): ITextQuery;
27
+ prepareStatement(e: SelectStatement): void;
28
+ visitExpressionAs(e: ExpressionAs): ITextQuery;
29
+ visitConstant({ value }: Constant): ITextQuery;
30
+ visitBigIntLiteral({ value }: BigIntLiteral): ITextQuery;
31
+ visitNumberLiteral({ value }: NumberLiteral): ITextQuery;
32
+ visitStringLiteral({ value }: StringLiteral): ITextQuery;
33
+ visitBooleanLiteral({ value }: BooleanLiteral): ITextQuery;
34
+ visitNotExpression(e: NotExpression): ITextQuery;
35
+ visitNegateExpression(e: NegateExpression): ITextQuery;
36
+ visitTemplateLiteral(e: TemplateLiteral): ITextQuery;
37
+ visitBracketExpression(e: BracketExpression): ITextQuery;
38
+ visitCallExpression(e: CallExpression): ITextQuery;
39
+ expandCollection(relation: IEntityProperty, e: CallExpression, parameter: ParameterExpression, targetType: EntityType): SelectStatement;
40
+ expandSome(body: ArrowFunctionExpression, relation: IEntityProperty, e: CallExpression, parameter: ParameterExpression, targetType: EntityType): ExistsExpression;
41
+ visitIdentifier(e: Identifier): ITextQuery;
42
+ visitParameterExpression(pe: ParameterExpression): ITextQuery;
43
+ visitMemberExpression(me: MemberExpression): ITextQuery;
44
+ visitNotExists(e: NotExits): ITextQuery;
45
+ visitNullExpression(e: NullExpression): ITextQuery;
46
+ visitBinaryExpression(e: BinaryExpression): ITextQuery;
47
+ visitConditionalExpression(e: ConditionalExpression): ITextQuery;
48
+ visitCoalesceExpression(e: CoalesceExpression): ITextQuery;
49
+ visitReturnUpdated(e: ReturnUpdated): ITextQuery;
50
+ visitInsertStatement(e: InsertStatement): ITextQuery;
51
+ visitUpdateStatement(e: UpdateStatement): ITextQuery;
52
+ visitUpsertStatement(e: UpsertStatement): ITextQuery;
53
+ visitNewObjectExpression(e: NewObjectExpression): ITextQuery;
54
+ visitDeleteStatement(e: DeleteStatement): ITextQuery;
55
+ visitJoinExpression(e: JoinExpression): ITextQuery;
56
+ visitOrderByExpression(e: OrderByExpression): ITextQuery;
57
+ visitExistsExpression(e: ExistsExpression): ITextQuery;
58
+ visitUnionStatement(e: UnionStatement): ITextQuery;
59
+ private resolveExpression;
60
+ /**
61
+ * This will also create and replace joins if query is provided.
62
+ * @param x MemberExpression
63
+ * @returns Property Chain
64
+ */
65
+ private getPropertyChain;
66
+ }
67
+ //# sourceMappingURL=ExpressionToSql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionToSql.d.ts","source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ason we are using our own Expression type is to keep
5
+ * our expressions small and independent of JavaScript ESTree style.
6
+ *
7
+ * Reason is simple, our visitor pattern can be small and can stay
8
+ * independent of any other extra expression types.
9
+ *
10
+ * We will cache our expressions, to avoid parsing them multiple times.
11
+ * Our expressions do not need to store exact line numbers, comments,
12
+ * extra annotations. We can add some shortcut optimizations which might
13
+ * not be possible with outer libraries unless they support it.
14
+ *
15
+ * In future, we might make our own expression parser as we only need
16
+ * handful of features to keep it small and faster. Or we can swap some
17
+ * other JavaScript parser without affecting our code generation process.
18
+ */
19
+ export declare abstract class Expression {
20
+ static callExpression(callee: string | Expression, ...args: Expression[]): CallExpression;
21
+ static array(elements: Expression[]): ArrayExpression;
22
+ static as(expression: Expression, alias: Identifier | string): ExpressionAs;
23
+ static templateLiteral(value: Expression[]): TemplateLiteral;
24
+ static constant(value: string): Constant;
25
+ static parameter(name: string, model?: EntityType): ParameterExpression;
26
+ static identifier(name: string): Identifier;
27
+ static quotedIdentifier(name: string): Identifier;
28
+ static logicalAnd(left: Expression, right: Expression): BinaryExpression;
29
+ static logicalOr(left: Expression, right: Expression): BinaryExpression;
30
+ static member(target: Expression, identifier: string | Expression): MemberExpression;
31
+ static equal(left: Expression, right: Expression): BinaryExpression;
32
+ static less(left: Expression, right: Expression): BinaryExpression;
33
+ static lessOrEqual(left: Expression, right: Expression): BinaryExpression;
34
+ static assign(left: Expression, right: Expression): BinaryExpression;
35
+ static union(...queries: Expression[]): UnionStatement;
36
+ static unionAll(...queries: Expression[]): UnionStatement;
37
+ static create<T extends Expression>(this: IClassOf<T>, p: Partial<Omit<T, "type">>): T;
38
+ static clone<T extends Expression>(expression: T): T;
39
+ readonly type: ExpressionType["type"];
40
+ }
41
+ export declare class ArrayExpression extends Expression {
42
+ readonly type = "ArrayExpression";
43
+ elements: Expression[];
44
+ }
45
+ export declare class BinaryExpression extends Expression {
46
+ readonly type = "BinaryExpression";
47
+ left: Expression;
48
+ right: Expression;
49
+ operator: string;
50
+ assign?: boolean;
51
+ }
52
+ export declare class CoalesceExpression extends Expression {
53
+ readonly type = "CoalesceExpression";
54
+ left: Expression;
55
+ right: Expression;
56
+ }
57
+ export declare class ValuesStatement extends Expression {
58
+ readonly type = "ValuesStatement";
59
+ as: Identifier;
60
+ fields: Identifier[];
61
+ values: Expression[][];
62
+ }
63
+ export declare class OrderByExpression extends Expression {
64
+ readonly type = "OrderByExpression";
65
+ target: Expression;
66
+ descending: boolean;
67
+ }
68
+ export declare class NotExits extends Expression {
69
+ readonly type = "NotExists";
70
+ target: Expression;
71
+ }
72
+ export declare class NotExpression extends Expression {
73
+ readonly type = "NotExpression";
74
+ expression: Expression;
75
+ }
76
+ export declare class NegateExpression extends Expression {
77
+ readonly type = "NegateExpression";
78
+ expression: Expression;
79
+ }
80
+ export declare class ExistsExpression extends Expression {
81
+ readonly type = "ExistsExpression";
82
+ target: Expression;
83
+ }
84
+ export declare class CallExpression extends Expression {
85
+ readonly type = "CallExpression";
86
+ callee: Expression;
87
+ arguments: Expression[];
88
+ collectionMethod: string;
89
+ castMethod: string;
90
+ }
91
+ export declare class BracketExpression extends Expression {
92
+ readonly type = "BracketExpression";
93
+ target: Expression;
94
+ }
95
+ export declare class ParameterExpression extends Expression {
96
+ readonly type = "ParameterExpression";
97
+ name: string;
98
+ /**
99
+ * Default value if any...
100
+ */
101
+ value: any;
102
+ /**
103
+ * Entity Model representing the variable
104
+ */
105
+ model: EntityType;
106
+ quotedLiteral: (x: string) => string;
107
+ get id(): any;
108
+ toString(): string;
109
+ }
110
+ export declare class MemberExpression extends Expression {
111
+ readonly type = "MemberExpression";
112
+ target: Expression;
113
+ property: Expression;
114
+ computed: boolean;
115
+ isCollectionMethod: boolean;
116
+ }
117
+ export declare class ArrowFunctionExpression extends Expression {
118
+ readonly type = "ArrowFunctionExpression";
119
+ params: ParameterExpression[];
120
+ body: Expression;
121
+ }
122
+ export type TableSource = SelectStatement | Identifier | ExpressionAs | TableLiteral;
123
+ export type Expand = {
124
+ [key: string]: string | Expand;
125
+ };
126
+ export declare class SelectStatement extends Expression {
127
+ readonly type = "SelectStatement";
128
+ preferLeftJoins: boolean;
129
+ source: TableSource | ValuesStatement;
130
+ sourceParameter: ParameterExpression;
131
+ fields: (Expression | Identifier | ExpressionAs)[];
132
+ where: Expression;
133
+ orderBy: OrderByExpression[];
134
+ joins: JoinExpression[];
135
+ limit: number;
136
+ offset: number;
137
+ model: EntityType;
138
+ skipLocked?: boolean;
139
+ }
140
+ export declare class NewObjectExpression extends Expression {
141
+ readonly type = "NewObjectExpression";
142
+ properties: ExpressionAs[];
143
+ }
144
+ export declare class ConditionalExpression extends Expression {
145
+ readonly type = "ConditionalExpression";
146
+ test: Expression;
147
+ consequent: Expression;
148
+ alternate: Expression;
149
+ }
150
+ export declare class JoinExpression extends Expression {
151
+ readonly type = "JoinExpression";
152
+ joinType: "LEFT" | "INNER";
153
+ forceJoinType: "LEFT" | "INNER";
154
+ source: SelectStatement | Identifier | ExpressionAs | TableLiteral;
155
+ as: Identifier | ParameterExpression;
156
+ where: Expression;
157
+ model: EntityType;
158
+ path: string;
159
+ }
160
+ export declare class ReturnUpdated extends Expression {
161
+ readonly type = "ReturnUpdated";
162
+ fields: Identifier[];
163
+ changes: "INSERTED" | "DELETED" | "UPDATED";
164
+ }
165
+ export declare class Constant extends Expression {
166
+ readonly type = "Constant";
167
+ value: any;
168
+ }
169
+ export declare class Identifier extends Expression {
170
+ readonly type = "Identifier";
171
+ value: string;
172
+ quoted: boolean;
173
+ }
174
+ export declare class NullExpression extends Expression {
175
+ readonly type = "NullExpression";
176
+ }
177
+ export declare class StringLiteral extends Expression {
178
+ readonly type = "StringLiteral";
179
+ value: string;
180
+ }
181
+ export declare class BooleanLiteral extends Expression {
182
+ readonly type = "BooleanLiteral";
183
+ value: boolean;
184
+ }
185
+ export declare class NumberLiteral extends Expression {
186
+ static one: NumberLiteral;
187
+ static zero: NumberLiteral;
188
+ readonly type = "NumberLiteral";
189
+ value: number;
190
+ }
191
+ export declare class BigIntLiteral extends Expression {
192
+ readonly type = "BigIntLiteral";
193
+ value: bigint;
194
+ }
195
+ export declare class TemplateElement extends Expression {
196
+ readonly type = "TemplateElement";
197
+ value: {
198
+ raw: string;
199
+ cooked: string;
200
+ };
201
+ }
202
+ export declare class TemplateLiteral extends Expression {
203
+ readonly type = "TemplateLiteral";
204
+ quasis: TemplateElement[];
205
+ value: Expression[];
206
+ }
207
+ export declare class ExpressionAs extends Expression {
208
+ readonly type = "ExpressionAs";
209
+ expression: Expression;
210
+ alias: Identifier;
211
+ }
212
+ export declare class TableLiteral extends Expression {
213
+ readonly type = "TableLiteral";
214
+ schema: Identifier;
215
+ name: Identifier;
216
+ }
217
+ export declare class InsertStatement extends Expression {
218
+ readonly type = "InsertStatement";
219
+ table: TableLiteral;
220
+ values: ValuesStatement | SelectStatement;
221
+ returnValues: ReturnUpdated;
222
+ }
223
+ export declare class UpdateStatement extends Expression {
224
+ readonly type = "UpdateStatement";
225
+ table: TableSource;
226
+ sourceParameter: ParameterExpression;
227
+ model: EntityType;
228
+ set: BinaryExpression[];
229
+ where: Expression;
230
+ join: JoinExpression;
231
+ returnUpdated: ExpressionAs[];
232
+ }
233
+ export declare class UpsertStatement extends Expression {
234
+ readonly type = "UpsertStatement";
235
+ table: TableLiteral | Identifier;
236
+ insert: BinaryExpression[];
237
+ update: BinaryExpression[];
238
+ keys: BinaryExpression[];
239
+ returnUpdated: ReturnUpdated;
240
+ }
241
+ export declare class UnionStatement extends Expression {
242
+ readonly type = "UnionStatement";
243
+ all: boolean;
244
+ queries: Expression[];
245
+ }
246
+ export declare class DeleteStatement extends Expression {
247
+ readonly type = "DeleteStatement";
248
+ table: TableSource;
249
+ model: EntityType;
250
+ where: Expression;
251
+ sourceParameter: ParameterExpression;
252
+ join: JoinExpression;
253
+ }
254
+ export type ExpressionType = BinaryExpression | ValuesStatement | SelectStatement | Constant | ExpressionAs | TableLiteral | InsertStatement | UpdateStatement | DeleteStatement | UpsertStatement | ReturnUpdated | OrderByExpression | JoinExpression | NullExpression | StringLiteral | NumberLiteral | BigIntLiteral | BooleanLiteral | TemplateLiteral | MemberExpression | CallExpression | CoalesceExpression | ExistsExpression | Identifier | ArrowFunctionExpression | ConditionalExpression | NewObjectExpression | ParameterExpression | ArrayExpression | NotExits | UnionStatement | NotExpression | NegateExpression | BracketExpression | TemplateElement;
255
+ //# sourceMappingURL=Expressions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expressions.d.ts","sourceRoot":"","sources":["../../../src/query/ast/Expressions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAG/D;;;;;;;;;;;;;;;GAeG;AAEH,8BAAsB,UAAU;IAE5B,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,GAAI,IAAI,EAAE,UAAU,EAAE;IAUzE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE;IAInC,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM;IAU5D,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE;IAK1C,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAI7B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU;IAIjD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM;IAI9B,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM;IAIpC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,gBAAgB;IAIxE,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,gBAAgB;IAIvE,MAAM,CAAC,MAAM,CAAC,MAAM,EAA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ElB,IAAI,EAAE,cAAc,CAAC;IAErB,aAAa,EAAE,YAAY,EAAE,CAAC;CAEjC;AAED,qBAAa,eAAgB,SAAQ,UAAU;IAC3C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,KAAK,EAAE,YAAY,GAAG,UAAU,CAAC;IACjC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;CAChC;AAED,qBAAa,cAAe,SAAQ,UAAU;IAC1C,QAAQ,CAAC,IAAI,oBAAoB;IACjC,GAAG,UAAS;IACZ,OAAO,EAAE,UAAU,EAAE,CAAC;CACzB;AAED,qBAAa,eAAgB,SAAQ,UAAU;IAC3C,QAAQ,CAAC,IAAI,qBAAqB;IAClC,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAElB,eAAe,EAAE,mBAAmB,CAAC;IACrC,IAAI,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,QAAQ,GAER,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,GACb,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,aAAa,GACb,aAAa,GACb,aAAa,GACb,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,gBAAgB,GAChB,UAAU,GACV,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,GACf,QAAQ,GACR,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,CAClB"}
@@ -0,0 +1,27 @@
1
+ import type QueryCompiler from "../../compiler/QueryCompiler.js";
2
+ export type ITextQueryFragment = string | ((p: any) => any) | {
3
+ toString(): string;
4
+ };
5
+ export type ITextQuery = ITextQueryFragment[];
6
+ export type IStringTransformer = (s: string) => string;
7
+ export type ISqlMethodTransformer = (compiler: QueryCompiler, method: string, args: string[]) => string;
8
+ export declare class QueryParameter {
9
+ name: () => string;
10
+ static create(name: () => string): QueryParameter;
11
+ constructor(name: () => string);
12
+ toString(): string;
13
+ }
14
+ export declare const expandParamArray: ({ sep, input, prefix, suffix, emptyResult, fx }: {
15
+ sep?: string;
16
+ input: any;
17
+ prefix?: any[];
18
+ suffix?: any[];
19
+ emptyResult?: string[];
20
+ fx?: (xi: any) => (() => any)[];
21
+ }) => any;
22
+ export declare const joinMap: (sep: string, input: any, a: any, fx?: ((item: any) => any)) => any[];
23
+ export declare const prepareAny: (a: TemplateStringsArray, ...p: any[]) => string[];
24
+ export declare const prepare: (a: TemplateStringsArray, ...p: (ITextQueryFragment | ITextQuery)[]) => ITextQuery;
25
+ export declare const prepareJoin: (a: (ITextQueryFragment | ITextQuery)[], sep?: string) => ITextQuery;
26
+ export declare const joinAny: (...a: any[]) => any;
27
+ //# sourceMappingURL=IStringTransformer.d.ts.map