@ballistix.digital/odata-query-builder 0.5.0 → 0.7.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 (49) hide show
  1. package/dist/index.d.ts +5 -6
  2. package/dist/index.js +3 -3
  3. package/dist/index.js.map +1 -1
  4. package/dist/module/query/domain/chain/chain.model.d.ts +17 -2
  5. package/dist/module/query/domain/chain/expandChain.model.d.ts +16 -6
  6. package/dist/module/query/domain/chain/itemChain.model.d.ts +1 -2
  7. package/dist/module/query/domain/exceptionCode.model.js.map +1 -0
  8. package/dist/module/query/domain/exceptionDetail.model.js.map +1 -0
  9. package/dist/module/query/domain/filter/castable.model.d.ts +10 -1
  10. package/dist/module/{common/domain → query/domain/filter}/scalar.model.d.ts +4 -7
  11. package/dist/module/query/domain/filter/scalar.model.js +11 -0
  12. package/dist/module/query/domain/filter/scalar.model.js.map +1 -0
  13. package/dist/module/query/domain/filter/scope.model.d.ts +1 -1
  14. package/dist/module/query/exception/invalidFilter.exception.d.ts +1 -1
  15. package/dist/module/query/exception/invalidFilter.exception.js +2 -2
  16. package/dist/module/query/exception/invalidFilter.exception.js.map +1 -1
  17. package/dist/module/{common → query}/exception/queryBuilder.exception.d.ts +3 -2
  18. package/dist/module/{common → query}/exception/queryBuilder.exception.js +3 -2
  19. package/dist/module/{common → query}/exception/queryBuilder.exception.js.map +1 -1
  20. package/dist/module/query/exception/reservedName.exception.d.ts +1 -1
  21. package/dist/module/query/exception/reservedName.exception.js +2 -2
  22. package/dist/module/query/exception/reservedName.exception.js.map +1 -1
  23. package/dist/module/query/service/emit/emit.facade.d.ts +8 -0
  24. package/dist/module/query/service/emit/emit.facade.js +1 -9
  25. package/dist/module/query/service/emit/emit.facade.js.map +1 -1
  26. package/dist/module/query/service/filter/filter.facade.d.ts +11 -0
  27. package/dist/module/query/service/filter/filter.facade.js +1 -12
  28. package/dist/module/query/service/filter/filter.facade.js.map +1 -1
  29. package/dist/module/query/service/queryChain.service.d.ts +3 -3
  30. package/dist/module/query/util/emit/queryParts.util.js +4 -0
  31. package/dist/module/query/util/emit/queryParts.util.js.map +1 -1
  32. package/dist/module/{common/util → query/util/filter}/escape.util.d.ts +2 -3
  33. package/dist/module/{common/util → query/util/filter}/escape.util.js +2 -3
  34. package/dist/module/query/util/filter/escape.util.js.map +1 -0
  35. package/dist/module/query/util/filter/literal.util.js +1 -1
  36. package/dist/module/query/util/filter/literal.util.js.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/module/common/domain/exceptionCode.model.js.map +0 -1
  39. package/dist/module/common/domain/exceptionDetail.model.js.map +0 -1
  40. package/dist/module/common/domain/scalar.model.js +0 -14
  41. package/dist/module/common/domain/scalar.model.js.map +0 -1
  42. package/dist/module/common/util/escape.util.js.map +0 -1
  43. package/dist/module/query/domain/chain/expandNamespace.model.d.ts +0 -18
  44. package/dist/module/query/domain/chain/expandNamespace.model.js +0 -3
  45. package/dist/module/query/domain/chain/expandNamespace.model.js.map +0 -1
  46. /package/dist/module/{common → query}/domain/exceptionCode.model.d.ts +0 -0
  47. /package/dist/module/{common → query}/domain/exceptionCode.model.js +0 -0
  48. /package/dist/module/{common → query}/domain/exceptionDetail.model.d.ts +0 -0
  49. /package/dist/module/{common → query}/domain/exceptionDetail.model.js +0 -0
package/dist/index.d.ts CHANGED
@@ -6,14 +6,11 @@
6
6
  * 400 is deliberately absent, so it is a compile error rather than a runtime
7
7
  * failure.
8
8
  */
9
- import { QueryBuilderExceptionCode } from './module/common/domain/exceptionCode.model';
10
- import type { ExceptionDetail } from './module/common/domain/exceptionDetail.model';
11
- import type { Scalar, Unwrap } from './module/common/domain/scalar.model';
12
- import { QueryBuilderException } from './module/common/exception/queryBuilder.exception';
13
- import type { Chain, QueryParams } from './module/query/domain/chain/chain.model';
9
+ import type { Chain, ExpandKey, ExpandNamespace, QueryParams } from './module/query/domain/chain/chain.model';
14
10
  import type { ExpandChain } from './module/query/domain/chain/expandChain.model';
15
- import type { ExpandKey, ExpandNamespace } from './module/query/domain/chain/expandNamespace.model';
16
11
  import type { ItemChain } from './module/query/domain/chain/itemChain.model';
12
+ import { QueryBuilderExceptionCode } from './module/query/domain/exceptionCode.model';
13
+ import type { ExceptionDetail } from './module/query/domain/exceptionDetail.model';
17
14
  import type { BooleanExpr } from './module/query/domain/filter/booleanExpr.model';
18
15
  import type { Castable, CastResult, EdmTarget } from './module/query/domain/filter/castable.model';
19
16
  import type { Comparable } from './module/query/domain/filter/comparable.model';
@@ -21,9 +18,11 @@ import type { DateExpr, DateInput } from './module/query/domain/filter/dateExpr.
21
18
  import type { Node, Predicate } from './module/query/domain/filter/node.model';
22
19
  import type { NumberExpr } from './module/query/domain/filter/numberExpr.model';
23
20
  import type { Operators } from './module/query/domain/filter/operators.model';
21
+ import type { Scalar, Unwrap } from './module/query/domain/filter/scalar.model';
24
22
  import type { EmbeddedObjectKeys, EmbeddedOf, ExprFor, LambdaNamespace, OwnKeys, PrimitiveArrayKeys, PrimitiveLambdaNamespace, Relation, ScalarFieldKeys, Scope, ToManyKeys, ToOneKeys } from './module/query/domain/filter/scope.model';
25
23
  import type { StringExpr } from './module/query/domain/filter/stringExpr.model';
26
24
  import { InvalidFilterError } from './module/query/exception/invalidFilter.exception';
25
+ import { QueryBuilderException } from './module/query/exception/queryBuilder.exception';
27
26
  import { ReservedNameError } from './module/query/exception/reservedName.exception';
28
27
  import { and, maxdatetime, mindatetime, not, now, or, raw } from './module/query/service/filter/filter.facade';
29
28
  import { odataItem, odataQuery } from './module/query/service/queryChain.service';
package/dist/index.js CHANGED
@@ -9,12 +9,12 @@
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.raw = exports.or = exports.odataQuery = exports.odataItem = exports.now = exports.not = exports.mindatetime = exports.maxdatetime = exports.and = exports.ReservedNameError = exports.QueryBuilderExceptionCode = exports.QueryBuilderException = exports.InvalidFilterError = void 0;
12
- const exceptionCode_model_1 = require("./module/common/domain/exceptionCode.model");
12
+ const exceptionCode_model_1 = require("./module/query/domain/exceptionCode.model");
13
13
  Object.defineProperty(exports, "QueryBuilderExceptionCode", { enumerable: true, get: function () { return exceptionCode_model_1.QueryBuilderExceptionCode; } });
14
- const queryBuilder_exception_1 = require("./module/common/exception/queryBuilder.exception");
15
- Object.defineProperty(exports, "QueryBuilderException", { enumerable: true, get: function () { return queryBuilder_exception_1.QueryBuilderException; } });
16
14
  const invalidFilter_exception_1 = require("./module/query/exception/invalidFilter.exception");
17
15
  Object.defineProperty(exports, "InvalidFilterError", { enumerable: true, get: function () { return invalidFilter_exception_1.InvalidFilterError; } });
16
+ const queryBuilder_exception_1 = require("./module/query/exception/queryBuilder.exception");
17
+ Object.defineProperty(exports, "QueryBuilderException", { enumerable: true, get: function () { return queryBuilder_exception_1.QueryBuilderException; } });
18
18
  const reservedName_exception_1 = require("./module/query/exception/reservedName.exception");
19
19
  Object.defineProperty(exports, "ReservedNameError", { enumerable: true, get: function () { return reservedName_exception_1.ReservedNameError; } });
20
20
  const filter_facade_1 = require("./module/query/service/filter/filter.facade");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,oFAAuF;AA8DtF,0GA9DQ,+CAAyB,OA8DR;AA3D1B,6FAAyF;AA0DxF,sGA1DQ,8CAAqB,OA0DR;AAlBtB,8FAAsF;AAiBrF,mGAjBQ,4CAAkB,OAiBR;AAhBnB,4FAAoF;AAmBnF,kGAnBQ,0CAAiB,OAmBR;AAlBlB,+EAQqD;AAWpD,oFAlBA,mBAAG,OAkBA;AACH,4FAlBA,2BAAW,OAkBA;AACX,4FAlBA,2BAAW,OAkBA;AACX,oFAlBA,mBAAG,OAkBA;AACH,oFAlBA,mBAAG,OAkBA;AAGH,mFApBA,kBAAE,OAoBA;AACF,oFApBA,mBAAG,OAoBA;AAlBJ,kFAGmD;AAYlD,0FAdA,8BAAS,OAcA;AACT,2FAdA,+BAAU,OAcA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAUH,mFAAsF;AAoDrF,0GApDQ,+CAAyB,OAoDR;AApB1B,8FAAsF;AAkBrF,mGAlBQ,4CAAkB,OAkBR;AAjBnB,4FAAwF;AAkBvF,sGAlBQ,8CAAqB,OAkBR;AAjBtB,4FAAoF;AAmBnF,kGAnBQ,0CAAiB,OAmBR;AAlBlB,+EAQqD;AAWpD,oFAlBA,mBAAG,OAkBA;AACH,4FAlBA,2BAAW,OAkBA;AACX,4FAlBA,2BAAW,OAkBA;AACX,oFAlBA,mBAAG,OAkBA;AACH,oFAlBA,mBAAG,OAkBA;AAGH,mFApBA,kBAAE,OAoBA;AACF,oFApBA,mBAAG,OAoBA;AAlBJ,kFAGmD;AAYlD,0FAdA,8BAAS,OAcA;AACT,2FAdA,+BAAU,OAcA"}
@@ -3,14 +3,29 @@
3
3
  *
4
4
  * The builder produces a query STRING. It does not fetch, and it does not know
5
5
  * about the `_embedded` / `_page` response envelope.
6
+ *
7
+ * `ExpandNamespace` is the type of the `expand` member of all three chain
8
+ * types. It holds one function per relation of the DTO, typed from
9
+ * `_embedded`: `q.expand.` lists exactly the relations `_embedded` declares,
10
+ * and each callback is typed to the entity that relation reaches. There is no
11
+ * build step and no `$metadata` document.
6
12
  */
7
13
  import type { Predicate } from '../filter/node.model';
8
14
  import type { Operators } from '../filter/operators.model';
9
- import type { ColumnExpr, ScalarFieldKeys, Scope, SelectScope } from '../filter/scope.model';
15
+ import type { ColumnExpr, Relation, ScalarFieldKeys, Scope, SelectScope, ToManyKeys, ToOneKeys } from '../filter/scope.model';
10
16
  import type { StringExpr } from '../filter/stringExpr.model';
11
- import type { ExpandNamespace } from './expandNamespace.model';
17
+ import type { ExpandChain } from './expandChain.model';
12
18
  /** A flat `{ $option: value }` map, for a caller that serialises its own URL. */
13
19
  export type QueryParams = Record<string, string>;
20
+ /** Every expandable relation name of a DTO. A real allowlist. */
21
+ export type ExpandKey<T> = ToOneKeys<T> | ToManyKeys<T>;
22
+ /**
23
+ * `Self` is the chain the call returns, so `expand.a(...).expand.b(...)`
24
+ * chains at whatever level it is written.
25
+ */
26
+ export type ExpandNamespace<T, Self> = {
27
+ readonly [K in ExpandKey<T>]: (build?: (chain: ExpandChain<Relation<T, K>>) => unknown) => Self;
28
+ };
14
29
  export interface Chain<T> {
15
30
  readonly expand: ExpandNamespace<T, Chain<T>>;
16
31
  /** Own columns, by name. */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * What a nested `$expand` may carry: `$filter`, `$select` and a further
3
- * `$expand`, and nothing else.
2
+ * What a nested `$expand` may carry: `$filter`, `$select`, a further
3
+ * `$expand`, `$top` and `$skip`, and nothing else.
4
4
  *
5
- * `$orderby`, `$top`, `$skip`, `$count` and `$levels` inside `$expand` are
6
- * still an `UnsupportedFeatureError` from the server, so they are absent from
7
- * this type — a 400 stays a red squiggle.
5
+ * `$orderby`, `$count` and `$levels` inside `$expand` are an
6
+ * `UnsupportedFeatureError` from the server, so they are absent from this
7
+ * type — a 400 stays a red squiggle.
8
8
  *
9
9
  * FILTERED EXPANSIONS
10
10
  * -------------------
@@ -16,7 +16,7 @@
16
16
  import type { Predicate } from '../filter/node.model';
17
17
  import type { Operators } from '../filter/operators.model';
18
18
  import type { ColumnExpr, ScalarFieldKeys, Scope, SelectScope } from '../filter/scope.model';
19
- import type { ExpandNamespace } from './expandNamespace.model';
19
+ import type { ExpandNamespace } from './chain.model';
20
20
  export interface ExpandChain<T> {
21
21
  readonly expand: ExpandNamespace<T, ExpandChain<T>>;
22
22
  /** Own columns, by name. */
@@ -28,4 +28,14 @@ export interface ExpandChain<T> {
28
28
  * written relative to it, not to the root. Repeated calls AND together.
29
29
  */
30
30
  filter(build: (scope: Scope<T>, operators: Operators) => Predicate): ExpandChain<T>;
31
+ /**
32
+ * `$expand=rel($top=…)`. The server applies it per parent row; it needs
33
+ * @ballistix.digital/typeorm-extensions 3.13.0.
34
+ */
35
+ top(count: number): ExpandChain<T>;
36
+ /**
37
+ * `$expand=rel($skip=…)`. The server applies it per parent row; it needs
38
+ * @ballistix.digital/typeorm-extensions 3.13.0.
39
+ */
40
+ skip(count: number): ExpandChain<T>;
31
41
  }
@@ -6,8 +6,7 @@
6
6
  * offered.
7
7
  */
8
8
  import type { ColumnExpr, ScalarFieldKeys, SelectScope } from '../filter/scope.model';
9
- import type { QueryParams } from './chain.model';
10
- import type { ExpandNamespace } from './expandNamespace.model';
9
+ import type { ExpandNamespace, QueryParams } from './chain.model';
11
10
  export interface ItemChain<T> {
12
11
  readonly expand: ExpandNamespace<T, ItemChain<T>>;
13
12
  /** Own columns, by name. */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptionCode.model.js","sourceRoot":"","sources":["../../../../src/module/query/domain/exceptionCode.model.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACpC,4DAA+B,CAAA;IAC/B,8DAAiC,CAAA;AAClC,CAAC,EAHW,yBAAyB,yCAAzB,yBAAyB,QAGpC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptionDetail.model.js","sourceRoot":"","sources":["../../../../src/module/query/domain/exceptionDetail.model.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
@@ -9,7 +9,16 @@ import type { BooleanExpr } from './booleanExpr.model';
9
9
  import type { DateExpr } from './dateExpr.model';
10
10
  import type { NumberExpr } from './numberExpr.model';
11
11
  import type { StringExpr } from './stringExpr.model';
12
- /** The 13 Edm targets the server maps onto a Postgres type. */
12
+ /**
13
+ * The 13 Edm targets the server maps onto a Postgres type: the OData v4
14
+ * primitive type names that typeorm-extensions can cast to (`CAST_TARGETS`).
15
+ *
16
+ * ```ts
17
+ * odataQuery<ProjectDto>().filter((v) => v.budget.cast('Edm.Int64').gt(1000)).toQueryString();
18
+ * // $filter=cast(budget,Edm.Int64) gt 1000
19
+ * ```
20
+ * The server runs it as `CAST(budget AS bigint) > 1000`.
21
+ */
13
22
  export type EdmTarget = 'Edm.String' | 'Edm.Int16' | 'Edm.Int32' | 'Edm.Int64' | 'Edm.Single' | 'Edm.Double' | 'Edm.Decimal' | 'Edm.Boolean' | 'Edm.Date' | 'Edm.DateTimeOffset' | 'Edm.TimeOfDay' | 'Edm.Guid' | 'Edm.Duration';
14
23
  export type CastResult<T extends EdmTarget> = T extends 'Edm.Boolean' ? BooleanExpr : T extends 'Edm.Int16' | 'Edm.Int32' | 'Edm.Int64' | 'Edm.Single' | 'Edm.Double' | 'Edm.Decimal' ? NumberExpr : T extends 'Edm.Date' | 'Edm.DateTimeOffset' ? DateExpr : StringExpr;
15
24
  export interface Castable {
@@ -1,13 +1,10 @@
1
1
  /**
2
- * The two type primitives every other module reads a DTO with.
3
- *
4
- * They live in `common` because both the filter module (which turns a DTO into
5
- * a filter scope) and the query module (which turns a DTO into a select/expand
6
- * namespace) need the same answer to "is this a column or a relation".
2
+ * The two type primitives `Scope` (in `scope.model.ts`) reads a DTO with, to
3
+ * answer "is this a column or a relation".
7
4
  *
8
5
  * `Scalar` admits only the five shapes the dialect can compare, sort or
9
- * select directly; an object or array field never matches it, so those two
10
- * modules route it through `Unwrap` and the embedding types instead.
6
+ * select directly; an object or array field never matches it, so `Scope`
7
+ * routes it through `Unwrap` and the embedding types instead.
11
8
  */
12
9
  /** A DTO property this dialect can compare, sort or select. */
13
10
  export type Scalar = string | number | boolean | bigint | Date;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * The two type primitives `Scope` (in `scope.model.ts`) reads a DTO with, to
4
+ * answer "is this a column or a relation".
5
+ *
6
+ * `Scalar` admits only the five shapes the dialect can compare, sort or
7
+ * select directly; an object or array field never matches it, so `Scope`
8
+ * routes it through `Unwrap` and the embedding types instead.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ //# sourceMappingURL=scalar.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scalar.model.js","sourceRoot":"","sources":["../../../../../src/module/query/domain/filter/scalar.model.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
@@ -12,11 +12,11 @@
12
12
  * keeps every self-reference in a mapped type's value position, where
13
13
  * instantiation is deferred until a property is actually read.
14
14
  */
15
- import type { Scalar, Unwrap } from '../../../common/domain/scalar.model';
16
15
  import type { BooleanExpr } from './booleanExpr.model';
17
16
  import type { DateExpr } from './dateExpr.model';
18
17
  import type { Predicate } from './node.model';
19
18
  import type { NumberExpr } from './numberExpr.model';
19
+ import type { Scalar, Unwrap } from './scalar.model';
20
20
  import type { StringExpr } from './stringExpr.model';
21
21
  /** The expression type a column of type `V` is read as. */
22
22
  export type ExprFor<V> = [NonNullable<V>] extends [never] ? never : NonNullable<V> extends boolean ? BooleanExpr : NonNullable<V> extends Date ? DateExpr : NonNullable<V> extends number | bigint ? NumberExpr<NonNullable<V>> : NonNullable<V> extends string ? StringExpr<NonNullable<V>> : never;
@@ -1,4 +1,4 @@
1
- import { QueryBuilderException } from '../../common/exception/queryBuilder.exception';
1
+ import { QueryBuilderException } from './queryBuilder.exception';
2
2
  export declare class InvalidFilterError extends QueryBuilderException {
3
3
  constructor(reason: string, subject?: string);
4
4
  }
@@ -8,8 +8,8 @@ exports.InvalidFilterError = void 0;
8
8
  * this covers what only the runtime can see — an empty `in()` list, a NaN
9
9
  * literal, a callback that returns a column instead of a predicate.
10
10
  */
11
- const exceptionCode_model_1 = require("../../common/domain/exceptionCode.model");
12
- const queryBuilder_exception_1 = require("../../common/exception/queryBuilder.exception");
11
+ const exceptionCode_model_1 = require("../domain/exceptionCode.model");
12
+ const queryBuilder_exception_1 = require("./queryBuilder.exception");
13
13
  class InvalidFilterError extends queryBuilder_exception_1.QueryBuilderException {
14
14
  constructor(reason, subject) {
15
15
  super(exceptionCode_model_1.QueryBuilderExceptionCode.INVALID_FILTER, reason, [
@@ -1 +1 @@
1
- {"version":3,"file":"invalidFilter.exception.js","sourceRoot":"","sources":["../../../../src/module/query/exception/invalidFilter.exception.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,iFAAoF;AACpF,0FAAsF;AAEtF,MAAa,kBAAmB,SAAQ,8CAAqB;IAC5D,YAAY,MAAc,EAAE,OAAgB;QAC3C,KAAK,CAAC,+CAAyB,CAAC,cAAc,EAAE,MAAM,EAAE;YACvD,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE;SACxD,CAAC,CAAC;IACJ,CAAC;CACD;AAND,gDAMC"}
1
+ {"version":3,"file":"invalidFilter.exception.js","sourceRoot":"","sources":["../../../../src/module/query/exception/invalidFilter.exception.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,uEAA0E;AAC1E,qEAAiE;AAEjE,MAAa,kBAAmB,SAAQ,8CAAqB;IAC5D,YAAY,MAAc,EAAE,OAAgB;QAC3C,KAAK,CAAC,+CAAyB,CAAC,cAAc,EAAE,MAAM,EAAE;YACvD,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE;SACxD,CAAC,CAAC;IACJ,CAAC;CACD;AAND,gDAMC"}
@@ -9,8 +9,9 @@
9
9
  * type: that package exports its own, unrelated `LibraryException` and
10
10
  * `ExceptionCode`, so this class is never an `instanceof` that one.
11
11
  *
12
- * The envelope lives in `common` because every area raises it. Nothing here
13
- * depends on a framework, and nothing here depends on another area.
12
+ * Every error class in `exception/` extends it. It imports only its two
13
+ * envelope types, `QueryBuilderExceptionCode` and `ExceptionDetail`, and
14
+ * depends on no framework.
14
15
  */
15
16
  import type { QueryBuilderExceptionCode } from '../domain/exceptionCode.model';
16
17
  import type { ExceptionDetail } from '../domain/exceptionDetail.model';
@@ -10,8 +10,9 @@
10
10
  * type: that package exports its own, unrelated `LibraryException` and
11
11
  * `ExceptionCode`, so this class is never an `instanceof` that one.
12
12
  *
13
- * The envelope lives in `common` because every area raises it. Nothing here
14
- * depends on a framework, and nothing here depends on another area.
13
+ * Every error class in `exception/` extends it. It imports only its two
14
+ * envelope types, `QueryBuilderExceptionCode` and `ExceptionDetail`, and
15
+ * depends on no framework.
15
16
  */
16
17
  Object.defineProperty(exports, "__esModule", { value: true });
17
18
  exports.QueryBuilderException = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"queryBuilder.exception.js","sourceRoot":"","sources":["../../../../src/module/common/exception/queryBuilder.exception.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAKH,MAAsB,qBAAsB,SAAQ,KAAK;IACxD,sDAAsD;IAC7C,MAAM,CAAS;IACxB,8DAA8D;IACrD,UAAU,CAAS;IAC5B,0DAA0D;IACjD,IAAI,CAA4B;IACzC,qEAAqE;IAC5D,MAAM,CAAoB;IAEnC,YACC,IAA+B,EAC/B,OAAe,EACf,MAAyB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAtBD,sDAsBC"}
1
+ {"version":3,"file":"queryBuilder.exception.js","sourceRoot":"","sources":["../../../../src/module/query/exception/queryBuilder.exception.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,MAAsB,qBAAsB,SAAQ,KAAK;IACxD,sDAAsD;IAC7C,MAAM,CAAS;IACxB,8DAA8D;IACrD,UAAU,CAAS;IAC5B,0DAA0D;IACjD,IAAI,CAA4B;IACzC,qEAAqE;IAC5D,MAAM,CAAoB;IAEnC,YACC,IAA+B,EAC/B,OAAe,EACf,MAAyB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAtBD,sDAsBC"}
@@ -1,4 +1,4 @@
1
- import { QueryBuilderException } from '../../common/exception/queryBuilder.exception';
1
+ import { QueryBuilderException } from './queryBuilder.exception';
2
2
  export declare class ReservedNameError extends QueryBuilderException {
3
3
  readonly reservedName: string;
4
4
  constructor(reservedName: string);
@@ -8,8 +8,8 @@ exports.ReservedNameError = void 0;
8
8
  * thenable and hang; reading `toJSON` would make `JSON.stringify(q)` produce
9
9
  * silent nonsense. Both throw instead of returning a value.
10
10
  */
11
- const exceptionCode_model_1 = require("../../common/domain/exceptionCode.model");
12
- const queryBuilder_exception_1 = require("../../common/exception/queryBuilder.exception");
11
+ const exceptionCode_model_1 = require("../domain/exceptionCode.model");
12
+ const queryBuilder_exception_1 = require("./queryBuilder.exception");
13
13
  class ReservedNameError extends queryBuilder_exception_1.QueryBuilderException {
14
14
  reservedName;
15
15
  constructor(reservedName) {
@@ -1 +1 @@
1
- {"version":3,"file":"reservedName.exception.js","sourceRoot":"","sources":["../../../../src/module/query/exception/reservedName.exception.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,iFAAoF;AACpF,0FAAsF;AAEtF,MAAa,iBAAkB,SAAQ,8CAAqB;IACtC;IAArB,YAAqB,YAAoB;QACxC,KAAK,CACJ,+CAAyB,CAAC,aAAa,EACvC,IAAI,YAAY,wDAAwD;YACvE,iEAAiE,EAClE;YACC;gBACC,MAAM,EAAE,yCAAyC;gBACjD,OAAO,EAAE,YAAY;aACrB;SACD,CACD,CAAC;QAXkB,iBAAY,GAAZ,YAAY,CAAQ;IAYzC,CAAC;CACD;AAdD,8CAcC"}
1
+ {"version":3,"file":"reservedName.exception.js","sourceRoot":"","sources":["../../../../src/module/query/exception/reservedName.exception.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,uEAA0E;AAC1E,qEAAiE;AAEjE,MAAa,iBAAkB,SAAQ,8CAAqB;IACtC;IAArB,YAAqB,YAAoB;QACxC,KAAK,CACJ,+CAAyB,CAAC,aAAa,EACvC,IAAI,YAAY,wDAAwD;YACvE,iEAAiE,EAClE;YACC;gBACC,MAAM,EAAE,yCAAyC;gBACjD,OAAO,EAAE,YAAY;aACrB;SACD,CACD,CAAC;QAXkB,iBAAY,GAAZ,YAAY,CAAQ;IAYzC,CAAC;CACD;AAdD,8CAcC"}
@@ -1,3 +1,11 @@
1
+ /**
2
+ * The only file that other code imports from the emit stage: a `QueryState`
3
+ * in, the query text out.
4
+ *
5
+ * Both entry functions read the same ordered parts, so the string form and the
6
+ * map form can never disagree about what the query says — they differ only in
7
+ * the transport escaping each one leaves in place.
8
+ */
1
9
  import type { QueryState } from '../../domain/queryState.model';
2
10
  export declare const emitQueryString: (queryState: QueryState) => string;
3
11
  /**
@@ -1,16 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.emitQueryParams = exports.emitQueryString = void 0;
4
- /**
5
- * The only file that other code imports from the emit stage: a `QueryState`
6
- * in, the query text out.
7
- *
8
- * Both entry functions read the same ordered parts, so the string form and the
9
- * map form can never disagree about what the query says — they differ only in
10
- * the transport escaping each one leaves in place.
11
- */
12
- const escape_util_1 = require("../../../common/util/escape.util");
13
4
  const queryParts_util_1 = require("../../util/emit/queryParts.util");
5
+ const escape_util_1 = require("../../util/filter/escape.util");
14
6
  const emitQueryString = (queryState) => (0, queryParts_util_1.toQueryParts)(queryState)
15
7
  .map(([key, value]) => `${key}=${value}`)
16
8
  .join('&');
@@ -1 +1 @@
1
- {"version":3,"file":"emit.facade.js","sourceRoot":"","sources":["../../../../../src/module/query/service/emit/emit.facade.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,kEAAsE;AAEtE,qEAA+D;AAExD,MAAM,eAAe,GAAG,CAAC,UAAsB,EAAU,EAAE,CACjE,IAAA,8BAAY,EAAC,UAAU,CAAC;KACtB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;KACxC,IAAI,CAAC,GAAG,CAAC,CAAC;AAHA,QAAA,eAAe,mBAGf;AAEb;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAC9B,UAAsB,EACG,EAAE;IAC3B,MAAM,WAAW,GAA2B,EAAE,CAAC;IAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAA,8BAAY,EAAC,UAAU,CAAC,EAAE,CAAC;QACrD,WAAW,CAAC,GAAG,CAAC,GAAG,IAAA,gCAAkB,EAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B"}
1
+ {"version":3,"file":"emit.facade.js","sourceRoot":"","sources":["../../../../../src/module/query/service/emit/emit.facade.ts"],"names":[],"mappings":";;;AASA,qEAA+D;AAC/D,+DAAmE;AAE5D,MAAM,eAAe,GAAG,CAAC,UAAsB,EAAU,EAAE,CACjE,IAAA,8BAAY,EAAC,UAAU,CAAC;KACtB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;KACxC,IAAI,CAAC,GAAG,CAAC,CAAC;AAHA,QAAA,eAAe,mBAGf;AAEb;;;;GAIG;AACI,MAAM,eAAe,GAAG,CAC9B,UAAsB,EACG,EAAE;IAC3B,MAAM,WAAW,GAA2B,EAAE,CAAC;IAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAA,8BAAY,EAAC,UAAU,CAAC,EAAE,CAAC;QACrD,WAAW,CAAC,GAAG,CAAC,GAAG,IAAA,gCAAkB,EAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B"}
@@ -1,3 +1,14 @@
1
+ /**
2
+ * The only file that other code imports from the filter stage: the combinators
3
+ * a caller writes, and the four entry functions that run a caller's callback
4
+ * against a fresh scope.
5
+ *
6
+ * A scope proxy never leaves this stage as itself. `buildFilterPredicate`
7
+ * hands one to the callback and returns the predicate that comes back;
8
+ * `pickSearchColumns`, `pickOrderColumn` and `pickSelectColumns` hand one out
9
+ * and return plain text. Nothing outside the stage therefore has to know that
10
+ * a scope is a Proxy at all.
11
+ */
1
12
  import type { Node, Predicate } from '../../domain/filter/node.model';
2
13
  import type { DateExpr } from '../../domain/filter/dateExpr.model';
3
14
  import type { Operators } from '../../domain/filter/operators.model';
@@ -1,19 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pickSelectColumns = exports.pickOrderColumn = exports.pickSearchColumns = exports.buildFilterPredicate = exports.raw = exports.mindatetime = exports.maxdatetime = exports.now = exports.not = exports.or = exports.and = void 0;
4
- /**
5
- * The only file that other code imports from the filter stage: the combinators
6
- * a caller writes, and the four entry functions that run a caller's callback
7
- * against a fresh scope.
8
- *
9
- * A scope proxy never leaves this stage as itself. `buildFilterPredicate`
10
- * hands one to the callback and returns the predicate that comes back;
11
- * `pickSearchColumns`, `pickOrderColumn` and `pickSelectColumns` hand one out
12
- * and return plain text. Nothing outside the stage therefore has to know that
13
- * a scope is a Proxy at all.
14
- */
15
- const escape_util_1 = require("../../../common/util/escape.util");
16
4
  const invalidFilter_exception_1 = require("../../exception/invalidFilter.exception");
5
+ const escape_util_1 = require("../../util/filter/escape.util");
17
6
  const literal_util_1 = require("../../util/filter/literal.util");
18
7
  const predicate_util_1 = require("../../util/filter/predicate.util");
19
8
  const scopeProxy_util_1 = require("../../util/filter/scopeProxy.util");
@@ -1 +1 @@
1
- {"version":3,"file":"filter.facade.js","sourceRoot":"","sources":["../../../../../src/module/query/service/filter/filter.facade.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,kEAAmE;AAKnE,qFAA6E;AAC7E,iEAAgE;AAChE,qEAA0E;AAC1E,uEAI2C;AAEpC,MAAM,GAAG,GAAG,CAAC,GAAG,UAAuB,EAAa,EAAE,CAC5D,IAAA,wBAAO,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AADf,QAAA,GAAG,OACY;AACrB,MAAM,EAAE,GAAG,CAAC,GAAG,UAAuB,EAAa,EAAE,CAC3D,IAAA,wBAAO,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AADd,QAAA,EAAE,MACY;AACpB,MAAM,GAAG,GAAG,CAAC,SAAoB,EAAa,EAAE;AACtD,wEAAwE;AACxE,IAAI,8BAAa,CAAC,QAAQ,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC;AAFjC,QAAA,GAAG,OAE8B;AACvC,MAAM,GAAG,GAAG,GAAa,EAAE,CAAC,IAAA,8BAAY,EAAC,IAAI,6BAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAAnE,QAAA,GAAG,OAAgE;AACzE,MAAM,WAAW,GAAG,GAAa,EAAE,CACzC,IAAA,8BAAY,EAAC,IAAI,6BAAc,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;AADzC,QAAA,WAAW,eAC8B;AAC/C,MAAM,WAAW,GAAG,GAAa,EAAE,CACzC,IAAA,8BAAY,EAAC,IAAI,6BAAc,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;AADzC,QAAA,WAAW,eAC8B;AAC/C,MAAM,GAAG,GAAG,CAAC,eAAuB,EAAa,EAAE,C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AAiB,GAAG,CAChC,OAAoC,EACzB,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,IAAA,2BAAS,GAAE,CAAC,EAAE,SAAS,CAAC,CAAC;AAF/C,QAAA,iBAAiB,qBAE8B;AAI5D,8DAA8D;AAC9D,MAAM,WAAW,GAAG,CAAC,MAAe,EAAE,MAAkB,EAAY,EAAE,CACrE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1D,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAC1B,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,KAAc,EAAE,MAAkB,EAAU,EAAE;IACjE,MAAM,IAAI,GAAG,IAAA,wBAAM,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACrE,MAAM,IAAI,4CAAkB,CAC3B,GAAG,MAAM,6CAA6C,CACtD,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC"}
1
+ {"version":3,"file":"filter.facade.js","sourceRoot":"","sources":["../../../../../src/module/query/service/filter/filter.facade.ts"],"names":[],"mappings":";;;AAeA,qFAA6E;AAC7E,+DAAgE;AAChE,iEAAgE;AAChE,qEAA0E;AAC1E,uEAI2C;AAEpC,MAAM,GAAG,GAAG,CAAC,GAAG,UAAuB,EAAa,EAAE,CAC5D,IAAA,wBAAO,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AADf,QAAA,GAAG,OACY;AACrB,MAAM,EAAE,GAAG,CAAC,GAAG,UAAuB,EAAa,EAAE,CAC3D,IAAA,wBAAO,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AADd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AC3B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACrE,MAAM,IAAI,4CAAkB,CAC3B,GAAG,MAAM,6CAA6C,CACtD,CAAC;IACH,OAAO,IAAI,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC"}
@@ -14,9 +14,9 @@
14
14
  * `Chain<T>`, `ItemChain<T>` and `ExpandChain<T>` are three interfaces over
15
15
  * this one class. Only the type that a factory returns differs. `Chain<T>`
16
16
  * has every member. `ItemChain<T>` has `select`, `expand`, `toQueryString()`
17
- * and `toParams()`. `ExpandChain<T>` has `select`, `expand` and `filter`, the
18
- * three options that the server accepts inside `$expand`. At runtime, every
19
- * instance has every member.
17
+ * and `toParams()`. `ExpandChain<T>` has `select`, `expand`, `filter`, `top`
18
+ * and `skip`, the options that the server accepts inside `$expand`. At
19
+ * runtime, every instance has every member.
20
20
  */
21
21
  import type { Chain, QueryParams } from '../domain/chain/chain.model';
22
22
  import type { ItemChain } from '../domain/chain/itemChain.model';
@@ -16,6 +16,10 @@ const nestedParts = (queryState) => {
16
16
  parts.push(`$select=${queryState.select.join(',')}`);
17
17
  if (queryState.expand.length)
18
18
  parts.push(`$expand=${expandList(queryState)}`);
19
+ if (queryState.top !== undefined)
20
+ parts.push(`$top=${queryState.top}`);
21
+ if (queryState.skip !== undefined)
22
+ parts.push(`$skip=${queryState.skip}`);
19
23
  return parts;
20
24
  };
21
25
  /** `a($select=x),b` — a relation with no options of its own prints bare. */
@@ -1 +1 @@
1
- {"version":3,"file":"queryParts.util.js","sourceRoot":"","sources":["../../../../../src/module/query/util/emit/queryParts.util.ts"],"names":[],"mappings":";;;AAUA,6DAAmD;AAEnD,+CAA+C;AAC/C,MAAM,UAAU,GAAG,CAAC,UAAsB,EAAU,EAAE,CACrD,IAAA,wBAAO,EAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,IA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,UAAU,CAAC,IAAI,KAAK,SAAS;QAChC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChD,IAAI,UAAU,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAnBW,QAAA,YAAY,gBAmBvB"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Literal escaping: the one mechanism that makes a value safe inside a query
3
- * string. It sits in `common` because two areas need the same answer — filter
4
- * quotes literals and search terms with it, and emit undoes its escapes for
5
- * `toParams()`.
3
+ * string. The filter stage quotes literals and search terms with it, and
4
+ * `emit.facade.ts` undoes its escapes for `toParams()`. It imports nothing.
6
5
  *
7
6
  * These seven rules are EMITTER GUARANTEES, each one measured by feeding the
8
7
  * emitted string back through the server's own parser and reading the literal
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  /**
3
3
  * Literal escaping: the one mechanism that makes a value safe inside a query
4
- * string. It sits in `common` because two areas need the same answer — filter
5
- * quotes literals and search terms with it, and emit undoes its escapes for
6
- * `toParams()`.
4
+ * string. The filter stage quotes literals and search terms with it, and
5
+ * `emit.facade.ts` undoes its escapes for `toParams()`. It imports nothing.
7
6
  *
8
7
  * These seven rules are EMITTER GUARANTEES, each one measured by feeding the
9
8
  * emitted string back through the server's own parser and reading the literal
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escape.util.js","sourceRoot":"","sources":["../../../../../src/module/query/util/filter/escape.util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;AAEH,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;KACf,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;IAClB,MAAM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AE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAXX,QAAA,kBAAkB,sBAWP"}
@@ -10,8 +10,8 @@ exports.literal = exports.parenthesiseArithmetic = exports.ExpressionNode = void
10
10
  * (`mul`), so `(a add 1) mul 2` parses the way the caller wrote it rather than
11
11
  * as `a add (1 mul 2)`.
12
12
  */
13
- const escape_util_1 = require("../../../common/util/escape.util");
14
13
  const invalidFilter_exception_1 = require("../../exception/invalidFilter.exception");
14
+ const escape_util_1 = require("./escape.util");
15
15
  const scopeProxy_util_1 = require("./scopeProxy.util");
16
16
  class ExpressionNode {
17
17
  text;
@@ -1 +1 @@
1
- {"version":3,"file":"literal.util.js","sourceRoot":"","sources":["../../../../../src/module/query/util/filter/literal.util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,kEAAyD;AACzD,qFAA6E;AAC7E,uDAA2C;AAE3C,MAAa,cAAc;IAEhB;IAEA;IAEA;IALV,YACU,IAAY;IACrB,4DAA4D;IACnD,KAAa;IACtB,oEAAoE;IAC3D,aAAsB,KAAK;QAJ3B,SAAI,GAAJ,IAAI,CAAQ;QAEZ,UAAK,GAAL,KAAK,CAAQ;QAEb,eAAU,GAAV,UAAU,CAAiB;IAClC,CAAC;CACJ;AARD,wCAQC;AAED,qEAAqE;AAC9D,MAAM,sBAAsB,GAAG,CAAC,IAAoB,EAAU,EAAE,CACtE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AADnC,QAAA,sBAAsB,0BACa;AAEhD,MAAM,WAAW,GAAG,CAAC,KAAc,EAAuC,EAAE,CAC3E,OAAO,KAAK,KAAK,QAAQ;IACz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AAA,mBAAK,EAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,OAAO,KAAK,IAAI;YACnB,MAAM,IAAI,4CAAkB,CAAC,wCAAwC,CAAC,CAAC;QACxE,OAAO,IAAA,mBAAK,EAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IACD,MAAM,IAAI,4CAAkB,CAC3B,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAClE,CAAC;AACH,CAAC,CAAC;AAtCW,QAAA,OAAO,WAsClB"}
1
+ {"version":3,"file":"literal.util.js","sourceRoot":"","sources":["../../../../../src/module/query/util/filter/literal.util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,qFAA6E;AAC7E,+CAAsC;AACtC,uDAA2C;AAE3C,MAAa,cAAc;IAEhB;IAEA;IAEA;IALV,YACU,IAAY;IACrB,4DAA4D;IACnD,KAAa;IACtB,oEAAoE;IAC3D,aAAsB,KAAK;QAJ3B,SAAI,GAAJ,IAAI,CAAQ;QAEZ,UAAK,GAAL,KAAK,CAAQ;QAEb,eAAU,GAAV,UAAU,CAAiB;IAClC,CAAC;CACJ;AARD,wCAQC;AAED,qEAAqE;AAC9D,MAAM,sBAAsB,GAAG,CAAC,IAAoB,EAAU,EAAE,CACtE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AADnC,QAAA,sBAAsB,0BACa;AAEhD,MAAM,WAAW,GAAG,CAAC,KAAc,EAAuC,EAAE,CAC3E,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,OAAQ,KAA6B,CAAC,KAAK,KAAK,UAAU,C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;IACD,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,OAAO,KAAK,IAAI;YACnB,MAAM,IAAI,4CAAkB,CAAC,wCAAwC,CAAC,CAAC;QACxE,OAAO,IAAA,mBAAK,EAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IACD,MAAM,IAAI,4CAAkB,CAC3B,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAClE,CAAC;AACH,CAAC,CAAC;AAtCW,QAAA,OAAO,WAsClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ballistix.digital/odata-query-builder",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Typed, fluent OData v4 query-string builder for the dialect @ballistix.digital/typeorm-extensions serves.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"exceptionCode.model.js","sourceRoot":"","sources":["../../../../src/module/common/domain/exceptionCode.model.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACpC,4DAA+B,CAAA;IAC/B,8DAAiC,CAAA;AAClC,CAAC,EAHW,yBAAyB,yCAAzB,yBAAyB,QAGpC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"exceptionDetail.model.js","sourceRoot":"","sources":["../../../../src/module/common/domain/exceptionDetail.model.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- /**
3
- * The two type primitives every other module reads a DTO with.
4
- *
5
- * They live in `common` because both the filter module (which turns a DTO into
6
- * a filter scope) and the query module (which turns a DTO into a select/expand
7
- * namespace) need the same answer to "is this a column or a relation".
8
- *
9
- * `Scalar` admits only the five shapes the dialect can compare, sort or
10
- * select directly; an object or array field never matches it, so those two
11
- * modules route it through `Unwrap` and the embedding types instead.
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- //# sourceMappingURL=scalar.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scalar.model.js","sourceRoot":"","sources":["../../../../src/module/common/domain/scalar.model.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"escape.util.js","sourceRoot":"","sources":["../../../../src/module/common/util/escape.util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;;;AAEH,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;KACf,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;IAClB,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrC,gDAAgD;IAChD,OAAO,IAAI,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI;QAClC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;QACxD,CAAC,CAAC,SAAS,CAAC;AACd,CAAC,CAAC;KACD,IAAI,CAAC,EAAE,CAAC,CAAC;AAEZ,wFAAwF;AACjF,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE,CACxD,uBAAuB,CACtB,KAAK;KACH,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;KACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;KACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;KACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;KACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CACtB,CAAC;AARU,QAAA,eAAe,mBAQzB;AAEH;;;GAGG;AACI,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CACtD,IAAA,uBAAe,EAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAD/B,QAAA,aAAa,iBACkB;AAErC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,IAAA,qBAAa,EAAC,KAAK,CAAC,GAAG,CAAC;AAA/D,QAAA,KAAK,SAA0D;AAE5E;;;;;;;GAOG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE,CAC3D,KAAK;KACH,OAAO,CACP,qCAAqC,EACrC,CAAC,MAAM,EAAE,SAAiB,EAAE,EAAE,CAC7B,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAC7C;KACA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;KACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAXX,QAAA,kBAAkB,sBAWP"}
@@ -1,18 +0,0 @@
1
- /**
2
- * The `expand` namespace: one call signature per relation of a DTO.
3
- *
4
- * This mapped type is the whole "codegen". `q.expand.` lists exactly the
5
- * relations `_embedded` declares, each callback typed to the entity that
6
- * relation reaches, with no build step and no `$metadata` document.
7
- */
8
- import type { Relation, ToManyKeys, ToOneKeys } from '../filter/scope.model';
9
- import type { ExpandChain } from './expandChain.model';
10
- /** Every expandable relation name of a DTO. A real allowlist. */
11
- export type ExpandKey<T> = ToOneKeys<T> | ToManyKeys<T>;
12
- /**
13
- * `Self` is the chain the call returns, so `expand.a(...).expand.b(...)`
14
- * chains at whatever level it is written.
15
- */
16
- export type ExpandNamespace<T, Self> = {
17
- readonly [K in ExpandKey<T>]: (build?: (chain: ExpandChain<Relation<T, K>>) => unknown) => Self;
18
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=expandNamespace.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expandNamespace.model.js","sourceRoot":"","sources":["../../../../../src/module/query/domain/chain/expandNamespace.model.ts"],"names":[],"mappings":""}