angular-odata 0.131.0 → 0.140.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 (139) hide show
  1. package/fesm2022/angular-odata.mjs +276 -543
  2. package/fesm2022/angular-odata.mjs.map +1 -1
  3. package/index.d.ts +6403 -3
  4. package/package.json +3 -3
  5. package/schematics/apigen/angular/base.js +2 -6
  6. package/schematics/apigen/angular/base.js.map +1 -1
  7. package/schematics/apigen/angular/entity.js +1 -2
  8. package/schematics/apigen/angular/entity.js.map +1 -1
  9. package/schematics/apigen/index.js +2 -6
  10. package/schematics/apigen/index.js.map +1 -1
  11. package/schematics/apigen/metadata/csdl/csdl-annotation.js +1 -2
  12. package/schematics/apigen/metadata/csdl/csdl-annotation.js.map +1 -1
  13. package/schematics/apigen/metadata/csdl/csdl-entity-container.js.map +1 -1
  14. package/schematics/apigen/metadata/csdl/csdl-entity-set.js.map +1 -1
  15. package/schematics/apigen/metadata/csdl/csdl-enum-type.d.ts +1 -1
  16. package/schematics/apigen/metadata/csdl/csdl-enum-type.js +1 -1
  17. package/schematics/apigen/metadata/csdl/csdl-enum-type.js.map +1 -1
  18. package/schematics/apigen/metadata/csdl/csdl-function-action.d.ts +1 -1
  19. package/schematics/apigen/metadata/csdl/csdl-reference.js +1 -2
  20. package/schematics/apigen/metadata/csdl/csdl-reference.js.map +1 -1
  21. package/schematics/apigen/metadata/csdl/csdl-schema.js +1 -2
  22. package/schematics/apigen/metadata/csdl/csdl-schema.js.map +1 -1
  23. package/schematics/apigen/metadata/csdl/csdl-singleton.js.map +1 -1
  24. package/schematics/apigen/metadata/csdl/csdl-structural-property.d.ts +1 -1
  25. package/schematics/apigen/metadata/csdl/csdl-structural-property.js +2 -3
  26. package/schematics/apigen/metadata/csdl/csdl-structural-property.js.map +1 -1
  27. package/schematics/apigen/metadata/csdl/csdl-structured-type.d.ts +1 -1
  28. package/schematics/apigen/metadata/csdl/csdl-structured-type.js +1 -2
  29. package/schematics/apigen/metadata/csdl/csdl-structured-type.js.map +1 -1
  30. package/schematics/apigen/metadata/parser.js +1 -3
  31. package/schematics/apigen/metadata/parser.js.map +1 -1
  32. package/schematics/apigen/utils.js +2 -4
  33. package/schematics/apigen/utils.js.map +1 -1
  34. package/lib/annotations.d.ts +0 -75
  35. package/lib/api.d.ts +0 -107
  36. package/lib/cache/cache.d.ts +0 -104
  37. package/lib/cache/index.d.ts +0 -3
  38. package/lib/cache/memory.d.ts +0 -19
  39. package/lib/cache/storage.d.ts +0 -35
  40. package/lib/client.d.ts +0 -613
  41. package/lib/constants.d.ts +0 -70
  42. package/lib/helper.d.ts +0 -75
  43. package/lib/index.d.ts +0 -14
  44. package/lib/loaders.d.ts +0 -21
  45. package/lib/metadata/csdl/csdl-annotation.d.ts +0 -159
  46. package/lib/metadata/csdl/csdl-entity-container.d.ts +0 -31
  47. package/lib/metadata/csdl/csdl-entity-set.d.ts +0 -25
  48. package/lib/metadata/csdl/csdl-enum-type.d.ts +0 -37
  49. package/lib/metadata/csdl/csdl-function-action.d.ts +0 -148
  50. package/lib/metadata/csdl/csdl-navigation-property-binding.d.ts +0 -12
  51. package/lib/metadata/csdl/csdl-reference.d.ts +0 -53
  52. package/lib/metadata/csdl/csdl-schema.d.ts +0 -37
  53. package/lib/metadata/csdl/csdl-singleton.d.ts +0 -21
  54. package/lib/metadata/csdl/csdl-structural-property.d.ts +0 -86
  55. package/lib/metadata/csdl/csdl-structured-type.d.ts +0 -94
  56. package/lib/metadata/csdl/csdl-type-definition.d.ts +0 -25
  57. package/lib/metadata/index.d.ts +0 -2
  58. package/lib/metadata/metadata.d.ts +0 -23
  59. package/lib/metadata/parser.d.ts +0 -110
  60. package/lib/models/collection.d.ts +0 -183
  61. package/lib/models/index.d.ts +0 -3
  62. package/lib/models/model.d.ts +0 -176
  63. package/lib/models/options.d.ts +0 -368
  64. package/lib/module.d.ts +0 -19
  65. package/lib/options.d.ts +0 -101
  66. package/lib/resources/index.d.ts +0 -6
  67. package/lib/resources/options.d.ts +0 -18
  68. package/lib/resources/path/handlers.d.ts +0 -29
  69. package/lib/resources/path/index.d.ts +0 -2
  70. package/lib/resources/path/segments.d.ts +0 -54
  71. package/lib/resources/query/builder.d.ts +0 -103
  72. package/lib/resources/query/expressions/apply.d.ts +0 -125
  73. package/lib/resources/query/expressions/base.d.ts +0 -25
  74. package/lib/resources/query/expressions/compute.d.ts +0 -39
  75. package/lib/resources/query/expressions/count.d.ts +0 -58
  76. package/lib/resources/query/expressions/expand.d.ts +0 -69
  77. package/lib/resources/query/expressions/filter.d.ts +0 -77
  78. package/lib/resources/query/expressions/index.d.ts +0 -9
  79. package/lib/resources/query/expressions/orderby.d.ts +0 -55
  80. package/lib/resources/query/expressions/search.d.ts +0 -63
  81. package/lib/resources/query/expressions/select.d.ts +0 -34
  82. package/lib/resources/query/expressions/syntax.d.ts +0 -313
  83. package/lib/resources/query/handlers.d.ts +0 -270
  84. package/lib/resources/query/index.d.ts +0 -4
  85. package/lib/resources/query/options.d.ts +0 -60
  86. package/lib/resources/request.d.ts +0 -64
  87. package/lib/resources/resource.d.ts +0 -161
  88. package/lib/resources/response.d.ts +0 -82
  89. package/lib/resources/types/action.d.ts +0 -84
  90. package/lib/resources/types/batch.d.ts +0 -62
  91. package/lib/resources/types/count.d.ts +0 -20
  92. package/lib/resources/types/entity-set.d.ts +0 -79
  93. package/lib/resources/types/entity.d.ts +0 -54
  94. package/lib/resources/types/function.d.ts +0 -108
  95. package/lib/resources/types/index.d.ts +0 -14
  96. package/lib/resources/types/media.d.ts +0 -28
  97. package/lib/resources/types/metadata.d.ts +0 -13
  98. package/lib/resources/types/navigation-property.d.ts +0 -157
  99. package/lib/resources/types/options.d.ts +0 -32
  100. package/lib/resources/types/property.d.ts +0 -115
  101. package/lib/resources/types/reference.d.ts +0 -74
  102. package/lib/resources/types/singleton.d.ts +0 -87
  103. package/lib/resources/types/value.d.ts +0 -19
  104. package/lib/schema/annotation.d.ts +0 -28
  105. package/lib/schema/callable.d.ts +0 -41
  106. package/lib/schema/element.d.ts +0 -52
  107. package/lib/schema/entity-container.d.ts +0 -10
  108. package/lib/schema/entity-set.d.ts +0 -10
  109. package/lib/schema/enum-type.d.ts +0 -55
  110. package/lib/schema/index.d.ts +0 -8
  111. package/lib/schema/parsers/callable.d.ts +0 -47
  112. package/lib/schema/parsers/edm.d.ts +0 -4
  113. package/lib/schema/parsers/enum-type.d.ts +0 -56
  114. package/lib/schema/parsers/index.d.ts +0 -4
  115. package/lib/schema/parsers/structured-type.d.ts +0 -172
  116. package/lib/schema/schema.d.ts +0 -26
  117. package/lib/schema/singleton.d.ts +0 -10
  118. package/lib/schema/structured-type.d.ts +0 -152
  119. package/lib/services/base.d.ts +0 -20
  120. package/lib/services/entity-set.d.ts +0 -120
  121. package/lib/services/entity.d.ts +0 -11
  122. package/lib/services/factory.d.ts +0 -33
  123. package/lib/services/index.d.ts +0 -4
  124. package/lib/services/singleton.d.ts +0 -44
  125. package/lib/settings.d.ts +0 -26
  126. package/lib/types.d.ts +0 -285
  127. package/lib/utils/arraybuffers.d.ts +0 -4
  128. package/lib/utils/arrays.d.ts +0 -3
  129. package/lib/utils/dates.d.ts +0 -3
  130. package/lib/utils/durations.d.ts +0 -14
  131. package/lib/utils/enums.d.ts +0 -23
  132. package/lib/utils/http.d.ts +0 -22
  133. package/lib/utils/index.d.ts +0 -9
  134. package/lib/utils/objects.d.ts +0 -37
  135. package/lib/utils/odata.d.ts +0 -4
  136. package/lib/utils/strings.d.ts +0 -7
  137. package/lib/utils/types.d.ts +0 -11
  138. package/lib/utils/urls.d.ts +0 -4
  139. package/public-api.d.ts +0 -1
@@ -1,18 +0,0 @@
1
- import { ODataMetadataType, ODataVersion, ParserOptions, ResponseOptions } from '../types';
2
- export declare class ODataResponseOptions implements ResponseOptions {
3
- version: ODataVersion;
4
- streaming?: boolean;
5
- metadata?: ODataMetadataType;
6
- ieee754Compatible?: boolean;
7
- location?: string;
8
- cacheability?: 'public' | 'private' | 'no-cache' | 'no-store';
9
- maxAge?: number;
10
- constructor(config: ParserOptions);
11
- get helper(): import("../helper").ODataVersionHelper;
12
- clone(): ODataResponseOptions;
13
- setFeatures(features: string): void;
14
- setVersion(version: string): void;
15
- setLocation(location: string): void;
16
- setPreferenceApplied(preference: string): void;
17
- setCache(cacheControl: string): void;
18
- }
@@ -1,29 +0,0 @@
1
- import { PathSegment } from '../../types';
2
- import { EntityKey } from '../resource';
3
- import { ODataPathSegments, ODataSegment } from './segments';
4
- export declare class SegmentHandler {
5
- private segment;
6
- constructor(segment: ODataSegment);
7
- get name(): PathSegment;
8
- outgoingType(value?: string): string | undefined;
9
- incomingType(value?: string): string | undefined;
10
- bindingType(value?: string): string | undefined;
11
- path(value?: string): string;
12
- key<T>(value?: EntityKey<T>): EntityKey<T>;
13
- hasKey(): boolean;
14
- clearKey(): void;
15
- parameters<T>(value?: T): T;
16
- hasParameters(): boolean;
17
- clearParameters(): void;
18
- }
19
- export declare class ODataPathSegmentsHandler<T> {
20
- protected segments: ODataPathSegments;
21
- constructor(segments: ODataPathSegments);
22
- entitySet(): SegmentHandler;
23
- singleton(): SegmentHandler;
24
- action(): SegmentHandler;
25
- function(): SegmentHandler;
26
- keys(values?: (EntityKey<T> | undefined)[]): (EntityKey<any> | undefined)[];
27
- property(): SegmentHandler;
28
- navigationProperty(): SegmentHandler;
29
- }
@@ -1,2 +0,0 @@
1
- export * from './segments';
2
- export * from './handlers';
@@ -1,54 +0,0 @@
1
- import { Parser, ParserOptions, PathSegment } from '../../types';
2
- import { EntityKey } from '../resource';
3
- import { SegmentHandler } from './handlers';
4
- export type ODataSegment = {
5
- name: PathSegment;
6
- path: string;
7
- outgoingType?: string;
8
- incomingType?: string;
9
- bindingType?: string;
10
- key?: any;
11
- parameters?: any;
12
- };
13
- export declare const pathAndParamsFromSegments: (segments: ODataSegment[], { escape, parser, options, }?: {
14
- escape?: boolean;
15
- parser?: Parser<any>;
16
- options?: ParserOptions;
17
- }) => [string, {
18
- [name: string]: any;
19
- }];
20
- export declare class ODataPathSegments {
21
- private _segments;
22
- constructor(segments?: ODataSegment[]);
23
- pathAndParams({ escape, parser, options, }?: {
24
- escape?: boolean;
25
- parser?: Parser<any>;
26
- options?: ParserOptions;
27
- }): [string, {
28
- [name: string]: any;
29
- }];
30
- types({ key }?: {
31
- key?: boolean;
32
- }): string[];
33
- keys(values?: (EntityKey<any> | undefined)[]): (EntityKey<any> | undefined)[];
34
- toString({ escape }?: {
35
- escape?: boolean;
36
- }): string;
37
- toJson(): any[];
38
- static fromJson(json: {
39
- [name: string]: any;
40
- }[]): ODataPathSegments;
41
- clone(): ODataPathSegments;
42
- find(predicate: (segment: ODataSegment) => boolean): ODataSegment | undefined;
43
- segments({ key }?: {
44
- key?: boolean;
45
- }): SegmentHandler[];
46
- first({ key }?: {
47
- key?: boolean;
48
- }): SegmentHandler | undefined;
49
- last({ key }?: {
50
- key?: boolean;
51
- }): SegmentHandler | undefined;
52
- add(name: string, path: string): SegmentHandler;
53
- get(name: string): SegmentHandler;
54
- }
@@ -1,103 +0,0 @@
1
- export type Unpacked<T> = T extends (infer U)[] ? U : T;
2
- export type Select<T> = SelectType<T> | SelectType<T>[];
3
- export type SelectType<T> = string | keyof T;
4
- export type Filter<T> = FilterType | FilterType[];
5
- export type FilterType = string | {
6
- [name: string]: any;
7
- };
8
- export declare enum StandardAggregateMethods {
9
- sum = "sum",
10
- min = "min",
11
- max = "max",
12
- average = "average",
13
- countdistinct = "countdistinct"
14
- }
15
- export type AggregateType = string | {
16
- [propertyName: string]: {
17
- with: StandardAggregateMethods;
18
- as: string;
19
- };
20
- };
21
- export type OrderBy<T> = OrderByType<T> | OrderByType<T>[];
22
- export type OrderByType<T> = string | OrderByObject<T>;
23
- export type OrderByObject<T> = keyof T | [keyof T | string, 'asc' | 'desc'] | NestedOrderBy<T>;
24
- export type NestedOrderBy<T> = {
25
- [P in keyof T]?: T[P] extends Array<infer E> ? OrderBy<E> : OrderBy<T[P]>;
26
- };
27
- export type Expand<T> = ExpandType<T> | ExpandType<T>[];
28
- export type ExpandType<T> = string | ExpandObject<T>;
29
- export type ExpandObject<T> = keyof T | NestedExpandOptions<T>;
30
- export type NestedExpandOptions<T> = {
31
- [P in keyof T]?: ExpandOptions<Unpacked<T[P]>>;
32
- };
33
- export type ExpandOptions<T> = {
34
- select?: Select<T>;
35
- filter?: Filter<T>;
36
- orderBy?: OrderBy<T>;
37
- top?: number;
38
- skip?: number;
39
- levels?: number | 'max';
40
- count?: boolean | Filter<T>;
41
- expand?: Expand<T>;
42
- };
43
- export type Transform<T> = {
44
- aggregate?: AggregateType | Array<AggregateType>;
45
- filter?: Filter<T>;
46
- groupBy?: GroupByType<T>;
47
- };
48
- export type GroupByType<T> = {
49
- properties: Array<keyof T>;
50
- transform?: Transform<T>;
51
- };
52
- export declare enum QueryCustomTypes {
53
- Raw = 0,
54
- Alias = 1,
55
- Duration = 2,
56
- Binary = 3
57
- }
58
- export type QueryCustomType = {
59
- type: QueryCustomTypes;
60
- value: any;
61
- name?: string;
62
- };
63
- export type Value = string | Date | number | boolean | QueryCustomType;
64
- export declare const raw: (value: string) => QueryCustomType;
65
- export declare const alias: (value: any, name?: string) => QueryCustomType;
66
- export declare const duration: (value: string) => QueryCustomType;
67
- export declare const binary: (value: string) => QueryCustomType;
68
- export declare const isQueryCustomType: (value: any) => boolean;
69
- export declare const isRawType: (value: any) => boolean;
70
- export type QueryOptions<T> = ExpandOptions<T> & {
71
- search: string;
72
- apply: string;
73
- transform: {
74
- [name: string]: any;
75
- } | {
76
- [name: string]: any;
77
- }[];
78
- compute: string;
79
- skip: number;
80
- skiptoken: string;
81
- key: string | number | {
82
- [name: string]: any;
83
- };
84
- count: boolean | Filter<T>;
85
- action: string;
86
- func: string | {
87
- [functionName: string]: {
88
- [parameterName: string]: any;
89
- };
90
- };
91
- format: string;
92
- aliases: QueryCustomType[];
93
- escape: boolean;
94
- };
95
- export declare const ITEM_ROOT = "";
96
- export default function <T>({ select, search, skiptoken, format, top, skip, filter, transform, compute, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): string;
97
- export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, apply, transform, compute, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
98
- [name: string]: any;
99
- }];
100
- export declare function normalizeValue(value: Value, { aliases, escape, }?: {
101
- aliases?: QueryCustomType[];
102
- escape?: boolean;
103
- }): any;
@@ -1,125 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType } from '../builder';
3
- import { Expression } from './base';
4
- import { FilterConnector, FilterExpression } from './filter';
5
- import { SearchConnector, SearchExpression } from './search';
6
- import { ODataFunctions, ODataOperators, Renderable, AggregateMethod } from './syntax';
7
- export declare class GroupByTransformations<T> extends Expression<T> {
8
- protected methods: (AggregateMethod | string)[];
9
- protected aliases: string[];
10
- constructor({ children, methods, aliases, }?: {
11
- children?: Renderable[];
12
- methods?: (AggregateMethod | string)[];
13
- aliases?: string[];
14
- });
15
- get [Symbol.toStringTag](): string;
16
- toJson(): {
17
- $type: string;
18
- children: any[];
19
- } & {
20
- methods: string[];
21
- aliases: string[];
22
- };
23
- static fromJson<T>(json: {
24
- [name: string]: any;
25
- }): GroupByTransformations<T>;
26
- render({ aliases, escape, prefix, parser, options, }?: {
27
- aliases?: QueryCustomType[];
28
- escape?: boolean;
29
- prefix?: string;
30
- parser?: Parser<T>;
31
- options?: ParserOptions;
32
- }): string;
33
- clone(): GroupByTransformations<T>;
34
- private _add;
35
- aggregate(value: any, method: AggregateMethod | string, alias: string): GroupByTransformations<T>;
36
- sum(value: any, alias: string): GroupByTransformations<T>;
37
- min(value: any, alias: string): GroupByTransformations<T>;
38
- max(value: any, alias: string): GroupByTransformations<T>;
39
- average(value: any, alias: string): GroupByTransformations<T>;
40
- countdistinct(value: any, alias: string): GroupByTransformations<T>;
41
- count(alias: string): GroupByTransformations<T>;
42
- }
43
- export type ApplyExpressionBuilder<T> = {
44
- t: Required<T>;
45
- e: () => ApplyExpression<T>;
46
- };
47
- export declare class ApplyExpression<T> extends Expression<T> {
48
- constructor({ children, }?: {
49
- children?: Renderable[];
50
- });
51
- get [Symbol.toStringTag](): string;
52
- static factory<T>(opts: (builder: ApplyExpressionBuilder<T>, current: ApplyExpression<T>) => ApplyExpression<T>, current?: ApplyExpression<T>): ApplyExpression<T>;
53
- toJson(): {
54
- $type: string;
55
- children: any[];
56
- };
57
- static fromJson<T>(json: {
58
- [name: string]: any;
59
- }): ApplyExpression<T>;
60
- render({ aliases, escape, prefix, parser, options, }?: {
61
- aliases?: QueryCustomType[];
62
- escape?: boolean;
63
- prefix?: string;
64
- parser?: Parser<T>;
65
- options?: ParserOptions;
66
- }): string;
67
- clone(): ApplyExpression<T>;
68
- private _add;
69
- aggregate(value: any, method: AggregateMethod, alias: string): ApplyExpression<T>;
70
- topCount(opts: (e: {
71
- o: ODataOperators<T>;
72
- f: ODataFunctions<T>;
73
- }) => Renderable): ApplyExpression<T>;
74
- topSum(opts: (e: {
75
- o: ODataOperators<T>;
76
- f: ODataFunctions<T>;
77
- }) => Renderable): ApplyExpression<T>;
78
- topPercent(opts: (e: {
79
- o: ODataOperators<T>;
80
- f: ODataFunctions<T>;
81
- }) => Renderable): ApplyExpression<T>;
82
- bottomCount(opts: (e: {
83
- o: ODataOperators<T>;
84
- f: ODataFunctions<T>;
85
- }) => Renderable): ApplyExpression<T>;
86
- bottomSum(opts: (e: {
87
- o: ODataOperators<T>;
88
- f: ODataFunctions<T>;
89
- }) => Renderable): ApplyExpression<T>;
90
- bottomPercent(opts: (e: {
91
- o: ODataOperators<T>;
92
- f: ODataFunctions<T>;
93
- }) => Renderable): ApplyExpression<T>;
94
- identity(opts: (e: {
95
- o: ODataOperators<T>;
96
- f: ODataFunctions<T>;
97
- }) => Renderable): ApplyExpression<T>;
98
- concat(opts: (e: {
99
- o: ODataOperators<T>;
100
- f: ODataFunctions<T>;
101
- }) => Renderable): ApplyExpression<T>;
102
- groupBy(props: (e: {
103
- rollup: (f: any) => any;
104
- }) => any | any[], opts?: (e: GroupByTransformations<T>) => GroupByTransformations<T>): ApplyExpression<T>;
105
- filter(opts: (e: {
106
- t: T;
107
- e: (connector?: FilterConnector) => FilterExpression<T>;
108
- o: ODataOperators<T>;
109
- f: ODataFunctions<T>;
110
- }) => FilterExpression<T>): ApplyExpression<T>;
111
- expand(opts: (e: {
112
- o: ODataOperators<T>;
113
- f: ODataFunctions<T>;
114
- }) => Renderable): ApplyExpression<T>;
115
- search(opts: (e: {
116
- t: T;
117
- e: (connector?: SearchConnector) => SearchExpression<T>;
118
- o: ODataOperators<T>;
119
- f: ODataFunctions<T>;
120
- }) => SearchExpression<T>): ApplyExpression<T>;
121
- compute(opts: (e: {
122
- o: ODataOperators<T>;
123
- f: ODataFunctions<T>;
124
- }) => Renderable): ApplyExpression<T>;
125
- }
@@ -1,25 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType } from '../builder';
3
- import { Renderable } from './syntax';
4
- export declare abstract class Expression<T> implements Renderable {
5
- protected _children: Renderable[];
6
- constructor({ children, }?: {
7
- children?: Renderable[];
8
- });
9
- get [Symbol.toStringTag](): string;
10
- abstract render({ aliases, escape, prefix, parser, options, }: {
11
- aliases?: QueryCustomType[];
12
- escape?: boolean;
13
- prefix?: string;
14
- parser?: Parser<T>;
15
- options?: ParserOptions;
16
- }): string;
17
- abstract clone(): Expression<T>;
18
- children(): Renderable[];
19
- length(): number;
20
- toJson(): {
21
- $type: string;
22
- children: any[];
23
- };
24
- resolve(parser: any): any;
25
- }
@@ -1,39 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType } from '../builder';
3
- import { Expression } from './base';
4
- import { ODataFunctions, ODataOperators, Renderable } from './syntax';
5
- export type ComputeExpressionBuilder<T> = {
6
- t: Required<T>;
7
- e: () => ComputeExpression<T>;
8
- };
9
- export declare class ComputeExpression<T> extends Expression<T> {
10
- protected names: string[];
11
- constructor({ children, names, }?: {
12
- children?: Renderable[];
13
- names?: string[];
14
- });
15
- get [Symbol.toStringTag](): string;
16
- static factory<T>(opts: (builder: ComputeExpressionBuilder<T>, current: ComputeExpression<T>) => ComputeExpression<T>, current?: ComputeExpression<T>): ComputeExpression<T>;
17
- toJson(): {
18
- $type: string;
19
- children: any[];
20
- } & {
21
- names: string[];
22
- };
23
- static fromJson<T>(json: {
24
- [name: string]: any;
25
- }): ComputeExpression<T>;
26
- render({ aliases, escape, prefix, parser, options, }?: {
27
- aliases?: QueryCustomType[];
28
- escape?: boolean;
29
- prefix?: string;
30
- parser?: Parser<T>;
31
- options?: ParserOptions;
32
- }): string;
33
- clone(): ComputeExpression<T>;
34
- private _add;
35
- field<T>(name: string, opts: (e: {
36
- o: ODataOperators<T>;
37
- f: ODataFunctions<T>;
38
- }) => Renderable): ComputeExpression<T>;
39
- }
@@ -1,58 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType } from '../builder';
3
- import { Expression } from './base';
4
- import { FilterExpression, FilterExpressionBuilder } from './filter';
5
- import { Renderable } from './syntax';
6
- export declare class CountField<T> implements Renderable {
7
- protected field: any;
8
- private values;
9
- constructor(field: any, values?: {
10
- [name: string]: any;
11
- });
12
- get [Symbol.toStringTag](): string;
13
- toJson(): {
14
- field: any;
15
- };
16
- render({ aliases, escape, prefix, parser, options, }: {
17
- aliases?: QueryCustomType[];
18
- escape?: boolean;
19
- prefix?: string;
20
- parser?: Parser<T>;
21
- options?: ParserOptions;
22
- }): string;
23
- filter(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): any;
24
- clone(): CountField<T>;
25
- resolve(parser: any): any;
26
- private option;
27
- }
28
- export type CountExpressionBuilder<T> = {
29
- t: Required<T>;
30
- e: () => CountExpression<T>;
31
- };
32
- export declare class CountExpression<T> extends Expression<T> {
33
- constructor({ children, }?: {
34
- children?: Renderable[];
35
- });
36
- get [Symbol.toStringTag](): string;
37
- static factory<T>(opts: (builder: CountExpressionBuilder<T>, current: CountExpression<T>) => CountExpression<T>, current?: CountExpression<T>): CountExpression<T>;
38
- private _add;
39
- toJson(): {
40
- $type: string;
41
- children: any[];
42
- };
43
- static fromJson<T>(json: {
44
- [name: string]: any;
45
- }): CountExpression<T>;
46
- render({ aliases, escape, prefix, parser, options, }?: {
47
- aliases?: QueryCustomType[];
48
- escape?: boolean;
49
- prefix?: string;
50
- parser?: Parser<T>;
51
- options?: ParserOptions;
52
- }): string;
53
- clone(): CountExpression<T>;
54
- field<F>(field: F[], opts?: (e: {
55
- t: F;
56
- f: CountField<F>;
57
- }) => CountExpression<F>): CountExpression<F>;
58
- }
@@ -1,69 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType, Unpacked } from '../builder';
3
- import { Expression } from './base';
4
- import { ComputeExpression, ComputeExpressionBuilder } from './compute';
5
- import { FilterExpression, FilterExpressionBuilder } from './filter';
6
- import { OrderByExpression, OrderByExpressionBuilder } from './orderby';
7
- import { SearchExpression, SearchExpressionBuilder } from './search';
8
- import { SelectExpression, SelectExpressionBuilder } from './select';
9
- import { Renderable } from './syntax';
10
- export declare class ExpandField<T> implements Renderable {
11
- protected field: any;
12
- private values;
13
- constructor(field: any, values?: {
14
- [name: string]: any;
15
- });
16
- get [Symbol.toStringTag](): string;
17
- toJson(): {
18
- field: any;
19
- };
20
- render({ aliases, escape, prefix, parser, options, }: {
21
- aliases?: QueryCustomType[];
22
- escape?: boolean;
23
- prefix?: string;
24
- parser?: Parser<T>;
25
- options?: ParserOptions;
26
- }): string;
27
- clone(): ExpandField<T>;
28
- resolve(parser: any): any;
29
- select(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
30
- expand(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
31
- filter(opts: (builder: FilterExpressionBuilder<T>, current?: FilterExpression<T>) => FilterExpression<T>): FilterExpression<T>;
32
- search(opts: (builder: SearchExpressionBuilder<T>) => SearchExpression<T>): SearchExpression<T>;
33
- orderBy(opts: (builder: OrderByExpressionBuilder<T>, current: OrderByExpression<T>) => OrderByExpression<T>): OrderByExpression<T>;
34
- compute(opts: (builder: ComputeExpressionBuilder<T>, current: ComputeExpression<T>) => ComputeExpression<T>): ComputeExpression<T>;
35
- skip(n: number): number;
36
- top(n: number): number;
37
- levels(n: number | 'max'): number | "max";
38
- count(): boolean;
39
- private option;
40
- }
41
- export type ExpandExpressionBuilder<T> = {
42
- t: Required<T>;
43
- e: () => ExpandExpression<T>;
44
- };
45
- export declare class ExpandExpression<T> extends Expression<T> {
46
- constructor({ children, }?: {
47
- children?: Renderable[];
48
- });
49
- get [Symbol.toStringTag](): string;
50
- static factory<T>(opts: (builder: ExpandExpressionBuilder<T>, current: ExpandExpression<T>) => ExpandExpression<T>, current?: ExpandExpression<T>): ExpandExpression<T>;
51
- toJson(): {
52
- $type: string;
53
- children: any[];
54
- };
55
- static fromJson<T>(json: {
56
- [name: string]: any;
57
- }): ExpandExpression<T>;
58
- render({ aliases, escape, prefix, parser, options, }?: {
59
- aliases?: QueryCustomType[];
60
- escape?: boolean;
61
- prefix?: string;
62
- parser?: Parser<T>;
63
- options?: ParserOptions;
64
- }): string;
65
- clone(): ExpandExpression<T>;
66
- private _add;
67
- field<F>(field: F, opts?: (e: ExpandField<Unpacked<F>>) => void): ExpandExpression<T>;
68
- combine(expression: ExpandExpression<T>): ExpandExpression<T>;
69
- }
@@ -1,77 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType } from '../builder';
3
- import { Expression } from './base';
4
- import { CountExpression, CountField } from './count';
5
- import { Normalize, ODataFunctions, ODataOperators, Renderable } from './syntax';
6
- export type FilterConnector = 'and' | 'or';
7
- export type FilterExpressionBuilder<T> = {
8
- t: Required<T>;
9
- e: (connector?: FilterConnector) => FilterExpression<T>;
10
- o: ODataOperators<T>;
11
- f: ODataFunctions<T>;
12
- };
13
- export declare class FilterExpression<F> extends Expression<F> {
14
- private _connector;
15
- private _negated;
16
- constructor({ children, connector, negated, }?: {
17
- children?: Renderable[];
18
- connector?: FilterConnector;
19
- negated?: boolean;
20
- });
21
- get [Symbol.toStringTag](): string;
22
- static factory<T>(opts: (builder: FilterExpressionBuilder<T>, current: FilterExpression<T>) => FilterExpression<T>, current?: FilterExpression<T>): FilterExpression<T>;
23
- toJson(): {
24
- $type: string;
25
- children: any[];
26
- } & {
27
- connector: FilterConnector;
28
- negated: boolean;
29
- };
30
- static fromJson<T>(json: {
31
- [name: string]: any;
32
- }): FilterExpression<T>;
33
- connector(): FilterConnector;
34
- negated(): boolean;
35
- render({ aliases, escape, prefix, parser, options, }?: {
36
- aliases?: QueryCustomType[];
37
- escape?: boolean;
38
- prefix?: string;
39
- parser?: Parser<any>;
40
- options?: ParserOptions;
41
- }): string;
42
- clone(): FilterExpression<F>;
43
- private _add;
44
- or(exp: FilterExpression<F>): FilterExpression<F>;
45
- and(exp: FilterExpression<F>): FilterExpression<F>;
46
- not(exp: FilterExpression<F>): FilterExpression<F>;
47
- eq(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
48
- ne(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
49
- gt(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
50
- ge(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
51
- lt(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
52
- le(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
53
- has(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
54
- in(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
55
- contains(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
56
- startsWith(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
57
- endsWith(left: any, right: any, normalize?: Normalize): FilterExpression<F>;
58
- any<N>(left: N[], opts?: (e: {
59
- e: (connector?: FilterConnector) => FilterExpression<N>;
60
- t: N;
61
- o: ODataOperators<N>;
62
- f: ODataFunctions<N>;
63
- }) => FilterExpression<N>, alias?: string): FilterExpression<F>;
64
- all<N>(left: N[], opts?: (e: {
65
- t: N;
66
- e: (connector?: FilterConnector) => FilterExpression<N>;
67
- o: ODataOperators<N>;
68
- f: ODataFunctions<N>;
69
- }) => FilterExpression<N>, alias?: string): FilterExpression<F>;
70
- count<N>(left: N[], opts?: (e: {
71
- t: N;
72
- f: CountField<N>;
73
- }) => CountExpression<N>): FilterExpression<F>;
74
- isof(type: string): FilterExpression<F>;
75
- isof(left: F, type: string): FilterExpression<F>;
76
- combine(exp: FilterExpression<F>, connector?: FilterConnector): FilterExpression<F>;
77
- }
@@ -1,9 +0,0 @@
1
- export * from './base';
2
- export * from './compute';
3
- export * from './apply';
4
- export * from './filter';
5
- export * from './orderby';
6
- export * from './search';
7
- export * from './select';
8
- export * from './syntax';
9
- export * from './expand';
@@ -1,55 +0,0 @@
1
- import { Parser, ParserOptions } from '../../../types';
2
- import { QueryCustomType } from '../builder';
3
- import { Expression } from './base';
4
- import { Renderable } from './syntax';
5
- export type OrderAttribute = 'asc' | 'desc';
6
- export declare class OrderByField implements Renderable {
7
- protected field: Renderable;
8
- protected order: OrderAttribute;
9
- constructor(field: Renderable, order: OrderAttribute);
10
- get [Symbol.toStringTag](): string;
11
- toJson(): {
12
- $type: string;
13
- field: any;
14
- order: OrderAttribute;
15
- };
16
- render({ aliases, escape, prefix, parser, options, }: {
17
- aliases?: QueryCustomType[];
18
- escape?: boolean;
19
- prefix?: string;
20
- parser?: Parser<any>;
21
- options?: ParserOptions;
22
- }): string;
23
- clone(): OrderByField;
24
- resolve(parser: any): any;
25
- }
26
- export type OrderByExpressionBuilder<T> = {
27
- t: Required<T>;
28
- e: () => OrderByExpression<T>;
29
- };
30
- export declare class OrderByExpression<T> extends Expression<T> {
31
- constructor({ children, }?: {
32
- children?: Renderable[];
33
- });
34
- get [Symbol.toStringTag](): string;
35
- static factory<T>(opts: (builder: OrderByExpressionBuilder<T>, current: OrderByExpression<T>) => OrderByExpression<T>, current?: OrderByExpression<T>): OrderByExpression<T>;
36
- private _add;
37
- toJson(): {
38
- $type: string;
39
- children: any[];
40
- };
41
- static fromJson<T>(json: {
42
- [name: string]: any;
43
- }): OrderByExpression<T>;
44
- render({ aliases, escape, prefix, parser, options, }?: {
45
- aliases?: QueryCustomType[];
46
- escape?: boolean;
47
- prefix?: string;
48
- parser?: Parser<T>;
49
- options?: ParserOptions;
50
- }): string;
51
- clone(): OrderByExpression<T>;
52
- ascending(field: any): OrderByExpression<T>;
53
- descending(field: any): OrderByExpression<T>;
54
- combine(expression: OrderByExpression<T>): OrderByExpression<T>;
55
- }