angular-odata 0.121.0 → 0.123.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 (148) hide show
  1. package/esm2022/lib/client.mjs +253 -0
  2. package/esm2022/lib/models/collection.mjs +862 -0
  3. package/esm2022/lib/models/model.mjs +519 -0
  4. package/esm2022/lib/models/options.mjs +1110 -0
  5. package/esm2022/lib/module.mjs +43 -0
  6. package/esm2022/lib/resources/query/builder.mjs +619 -0
  7. package/{esm2020 → esm2022}/lib/resources/query/expressions/base.mjs +1 -1
  8. package/{esm2020 → esm2022}/lib/resources/query/expressions/compute.mjs +1 -1
  9. package/{esm2020 → esm2022}/lib/resources/query/expressions/count.mjs +1 -1
  10. package/esm2022/lib/resources/query/expressions/expand.mjs +119 -0
  11. package/esm2022/lib/resources/query/expressions/filter.mjs +161 -0
  12. package/{esm2020 → esm2022}/lib/resources/query/expressions/orderby.mjs +1 -1
  13. package/{esm2020 → esm2022}/lib/resources/query/expressions/search.mjs +1 -1
  14. package/{esm2020 → esm2022}/lib/resources/query/expressions/select.mjs +1 -1
  15. package/esm2022/lib/resources/query/expressions/syntax.mjs +409 -0
  16. package/{esm2020 → esm2022}/lib/resources/query/handlers.mjs +1 -1
  17. package/esm2022/lib/resources/query/options.mjs +115 -0
  18. package/esm2022/lib/resources/responses/metadata.mjs +548 -0
  19. package/esm2022/lib/schema/parsers/edm.mjs +99 -0
  20. package/{esm2020 → esm2022}/lib/schema/parsers/enum-type.mjs +2 -2
  21. package/esm2022/lib/services/factory.mjs +34 -0
  22. package/esm2022/lib/utils/enums.mjs +61 -0
  23. package/{fesm2020 → fesm2022}/angular-odata.mjs +643 -614
  24. package/fesm2022/angular-odata.mjs.map +1 -0
  25. package/lib/helper.d.ts +1 -1
  26. package/lib/models/model.d.ts +7 -16
  27. package/lib/models/options.d.ts +51 -33
  28. package/lib/resources/path/segments.d.ts +1 -1
  29. package/lib/resources/query/builder.d.ts +21 -20
  30. package/lib/resources/query/expressions/base.d.ts +3 -3
  31. package/lib/resources/query/expressions/compute.d.ts +2 -2
  32. package/lib/resources/query/expressions/count.d.ts +3 -3
  33. package/lib/resources/query/expressions/expand.d.ts +13 -12
  34. package/lib/resources/query/expressions/filter.d.ts +15 -15
  35. package/lib/resources/query/expressions/orderby.d.ts +3 -3
  36. package/lib/resources/query/expressions/search.d.ts +3 -3
  37. package/lib/resources/query/expressions/select.d.ts +2 -2
  38. package/lib/resources/query/expressions/syntax.d.ts +59 -58
  39. package/lib/resources/query/handlers.d.ts +2 -2
  40. package/lib/resources/query/options.d.ts +1 -1
  41. package/lib/resources/resource.d.ts +1 -1
  42. package/lib/resources/responses/types.d.ts +3 -3
  43. package/lib/resources/types/options.d.ts +7 -7
  44. package/lib/schema/parsers/structured-type.d.ts +5 -5
  45. package/lib/types.d.ts +15 -15
  46. package/lib/utils/durations.d.ts +1 -1
  47. package/lib/utils/enums.d.ts +3 -0
  48. package/package.json +9 -15
  49. package/esm2020/lib/client.mjs +0 -252
  50. package/esm2020/lib/models/collection.mjs +0 -857
  51. package/esm2020/lib/models/model.mjs +0 -518
  52. package/esm2020/lib/models/options.mjs +0 -1130
  53. package/esm2020/lib/module.mjs +0 -42
  54. package/esm2020/lib/resources/query/builder.mjs +0 -588
  55. package/esm2020/lib/resources/query/expressions/expand.mjs +0 -115
  56. package/esm2020/lib/resources/query/expressions/filter.mjs +0 -161
  57. package/esm2020/lib/resources/query/expressions/syntax.mjs +0 -409
  58. package/esm2020/lib/resources/query/options.mjs +0 -115
  59. package/esm2020/lib/resources/responses/metadata.mjs +0 -547
  60. package/esm2020/lib/schema/parsers/edm.mjs +0 -104
  61. package/esm2020/lib/services/factory.mjs +0 -33
  62. package/esm2020/lib/utils/enums.mjs +0 -45
  63. package/fesm2015/angular-odata.mjs +0 -11841
  64. package/fesm2015/angular-odata.mjs.map +0 -1
  65. package/fesm2020/angular-odata.mjs.map +0 -1
  66. /package/{esm2020 → esm2022}/angular-odata.mjs +0 -0
  67. /package/{esm2020 → esm2022}/lib/api.mjs +0 -0
  68. /package/{esm2020 → esm2022}/lib/cache/cache.mjs +0 -0
  69. /package/{esm2020 → esm2022}/lib/cache/index.mjs +0 -0
  70. /package/{esm2020 → esm2022}/lib/cache/memory.mjs +0 -0
  71. /package/{esm2020 → esm2022}/lib/cache/storage.mjs +0 -0
  72. /package/{esm2020 → esm2022}/lib/constants.mjs +0 -0
  73. /package/{esm2020 → esm2022}/lib/helper.mjs +0 -0
  74. /package/{esm2020 → esm2022}/lib/index.mjs +0 -0
  75. /package/{esm2020 → esm2022}/lib/loaders.mjs +0 -0
  76. /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
  77. /package/{esm2020 → esm2022}/lib/options.mjs +0 -0
  78. /package/{esm2020 → esm2022}/lib/resources/index.mjs +0 -0
  79. /package/{esm2020 → esm2022}/lib/resources/path/handlers.mjs +0 -0
  80. /package/{esm2020 → esm2022}/lib/resources/path/index.mjs +0 -0
  81. /package/{esm2020 → esm2022}/lib/resources/path/segments.mjs +0 -0
  82. /package/{esm2020 → esm2022}/lib/resources/query/expressions/index.mjs +0 -0
  83. /package/{esm2020 → esm2022}/lib/resources/query/index.mjs +0 -0
  84. /package/{esm2020 → esm2022}/lib/resources/request.mjs +0 -0
  85. /package/{esm2020 → esm2022}/lib/resources/resource.mjs +0 -0
  86. /package/{esm2020 → esm2022}/lib/resources/responses/annotations.mjs +0 -0
  87. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-annotation.mjs +0 -0
  88. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-container.mjs +0 -0
  89. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-entity-set.mjs +0 -0
  90. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-enum-type.mjs +0 -0
  91. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-function-action.mjs +0 -0
  92. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-navigation-property-binding.mjs +0 -0
  93. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-reference.mjs +0 -0
  94. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-schema.mjs +0 -0
  95. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-singleton.mjs +0 -0
  96. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structural-property.mjs +0 -0
  97. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-structured-type.mjs +0 -0
  98. /package/{esm2020 → esm2022}/lib/resources/responses/csdl/csdl-type-definition.mjs +0 -0
  99. /package/{esm2020 → esm2022}/lib/resources/responses/index.mjs +0 -0
  100. /package/{esm2020 → esm2022}/lib/resources/responses/options.mjs +0 -0
  101. /package/{esm2020 → esm2022}/lib/resources/responses/response.mjs +0 -0
  102. /package/{esm2020 → esm2022}/lib/resources/responses/types.mjs +0 -0
  103. /package/{esm2020 → esm2022}/lib/resources/types/action.mjs +0 -0
  104. /package/{esm2020 → esm2022}/lib/resources/types/batch.mjs +0 -0
  105. /package/{esm2020 → esm2022}/lib/resources/types/count.mjs +0 -0
  106. /package/{esm2020 → esm2022}/lib/resources/types/entity-set.mjs +0 -0
  107. /package/{esm2020 → esm2022}/lib/resources/types/entity.mjs +0 -0
  108. /package/{esm2020 → esm2022}/lib/resources/types/function.mjs +0 -0
  109. /package/{esm2020 → esm2022}/lib/resources/types/index.mjs +0 -0
  110. /package/{esm2020 → esm2022}/lib/resources/types/media.mjs +0 -0
  111. /package/{esm2020 → esm2022}/lib/resources/types/metadata.mjs +0 -0
  112. /package/{esm2020 → esm2022}/lib/resources/types/navigation-property.mjs +0 -0
  113. /package/{esm2020 → esm2022}/lib/resources/types/options.mjs +0 -0
  114. /package/{esm2020 → esm2022}/lib/resources/types/property.mjs +0 -0
  115. /package/{esm2020 → esm2022}/lib/resources/types/reference.mjs +0 -0
  116. /package/{esm2020 → esm2022}/lib/resources/types/singleton.mjs +0 -0
  117. /package/{esm2020 → esm2022}/lib/resources/types/value.mjs +0 -0
  118. /package/{esm2020 → esm2022}/lib/schema/annotation.mjs +0 -0
  119. /package/{esm2020 → esm2022}/lib/schema/callable.mjs +0 -0
  120. /package/{esm2020 → esm2022}/lib/schema/element.mjs +0 -0
  121. /package/{esm2020 → esm2022}/lib/schema/entity-container.mjs +0 -0
  122. /package/{esm2020 → esm2022}/lib/schema/entity-set.mjs +0 -0
  123. /package/{esm2020 → esm2022}/lib/schema/enum-type.mjs +0 -0
  124. /package/{esm2020 → esm2022}/lib/schema/index.mjs +0 -0
  125. /package/{esm2020 → esm2022}/lib/schema/parsers/callable.mjs +0 -0
  126. /package/{esm2020 → esm2022}/lib/schema/parsers/index.mjs +0 -0
  127. /package/{esm2020 → esm2022}/lib/schema/parsers/structured-type.mjs +0 -0
  128. /package/{esm2020 → esm2022}/lib/schema/schema.mjs +0 -0
  129. /package/{esm2020 → esm2022}/lib/schema/structured-type.mjs +0 -0
  130. /package/{esm2020 → esm2022}/lib/services/base.mjs +0 -0
  131. /package/{esm2020 → esm2022}/lib/services/entity-set.mjs +0 -0
  132. /package/{esm2020 → esm2022}/lib/services/entity.mjs +0 -0
  133. /package/{esm2020 → esm2022}/lib/services/index.mjs +0 -0
  134. /package/{esm2020 → esm2022}/lib/services/singleton.mjs +0 -0
  135. /package/{esm2020 → esm2022}/lib/settings.mjs +0 -0
  136. /package/{esm2020 → esm2022}/lib/types.mjs +0 -0
  137. /package/{esm2020 → esm2022}/lib/utils/arraybuffers.mjs +0 -0
  138. /package/{esm2020 → esm2022}/lib/utils/arrays.mjs +0 -0
  139. /package/{esm2020 → esm2022}/lib/utils/dates.mjs +0 -0
  140. /package/{esm2020 → esm2022}/lib/utils/durations.mjs +0 -0
  141. /package/{esm2020 → esm2022}/lib/utils/http.mjs +0 -0
  142. /package/{esm2020 → esm2022}/lib/utils/index.mjs +0 -0
  143. /package/{esm2020 → esm2022}/lib/utils/objects.mjs +0 -0
  144. /package/{esm2020 → esm2022}/lib/utils/odata.mjs +0 -0
  145. /package/{esm2020 → esm2022}/lib/utils/strings.mjs +0 -0
  146. /package/{esm2020 → esm2022}/lib/utils/types.mjs +0 -0
  147. /package/{esm2020 → esm2022}/lib/utils/urls.mjs +0 -0
  148. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
@@ -1,4 +1,5 @@
1
1
  import type { QueryCustomType } from '../builder';
2
+ export type Normalize = 'all' | 'right' | 'left' | 'none';
2
3
  export interface Renderable {
3
4
  render({ aliases, escape, prefix, }: {
4
5
  aliases?: QueryCustomType[];
@@ -25,15 +26,15 @@ export declare function render(value: any, { aliases, normalize, escape, prefix,
25
26
  export declare class Function<T> implements Renderable {
26
27
  protected name: string;
27
28
  protected values: any[];
28
- protected normalize: boolean;
29
+ protected normalize: Normalize;
29
30
  protected escape: boolean;
30
- constructor(name: string, values: any[], normalize?: boolean, escape?: boolean);
31
+ constructor(name: string, values: any[], normalize: Normalize, escape?: boolean);
31
32
  get [Symbol.toStringTag](): string;
32
33
  toJSON(): {
33
34
  $type: string;
34
35
  name: string;
35
36
  values: any[];
36
- normalize: boolean;
37
+ normalize: Normalize;
37
38
  };
38
39
  render({ aliases, escape, prefix, }: {
39
40
  aliases?: QueryCustomType[];
@@ -43,68 +44,68 @@ export declare class Function<T> implements Renderable {
43
44
  clone(): Function<T>;
44
45
  }
45
46
  export declare class StringAndCollectionFunctions<T> {
46
- concat(field: any, value: any, normalize?: boolean): Function<T>;
47
- contains(field: any, value: any, normalize?: boolean): Function<T>;
48
- endsWith(field: any, value: any, normalize?: boolean): Function<T>;
49
- indexOf(field: any, value: any, normalize?: boolean): Function<T>;
50
- length(value: any, normalize?: boolean): Function<T>;
51
- startsWith(field: any, value: any, normalize?: boolean): Function<T>;
52
- subString(field: any, start: number, length?: number): Function<T>;
47
+ concat(left: any, right: any, normalize?: Normalize): Function<T>;
48
+ contains(left: any, right: any, normalize?: Normalize): Function<T>;
49
+ endsWith(left: any, right: any, normalize?: Normalize): Function<T>;
50
+ indexOf(left: any, right: any, normalize?: Normalize): Function<T>;
51
+ length(left: any, normalize?: Normalize): Function<T>;
52
+ startsWith(left: any, right: any, normalize?: Normalize): Function<T>;
53
+ subString(left: any, right: number, length?: number, normalize?: Normalize): Function<T>;
53
54
  }
54
55
  export declare class CollectionFunctions<T> {
55
- hasSubset(s1: T, s2: any): Function<T>;
56
- hasSubsequence(s1: T, s2: any): Function<T>;
56
+ hasSubset(left: T, right: any, normalize?: Normalize): Function<T>;
57
+ hasSubsequence(left: T, right: any, normalize?: Normalize): Function<T>;
57
58
  }
58
59
  export declare class StringFunctions<T> {
59
- matchesPattern(value: T | string, pattern: string): Function<T>;
60
- toLower(value: T): Function<T>;
61
- toUpper(value: T): Function<T>;
62
- trim(value: T): Function<T>;
60
+ matchesPattern(left: any | string, pattern: string, normalize?: Normalize): Function<T>;
61
+ toLower(left: any, normalize?: Normalize): Function<T>;
62
+ toUpper(left: any, normalize?: Normalize): Function<T>;
63
+ trim(left: any, normalize?: Normalize): Function<T>;
63
64
  }
64
65
  export declare class DateAndTimeFunctions<T> {
65
- date(value: any): Function<T>;
66
- day(value: any): Function<T>;
67
- fractionalseconds(value: any): Function<T>;
68
- hour(value: any): Function<T>;
69
- maxdatetime(value: any): Function<T>;
70
- mindatetime(value: any): Function<T>;
71
- minute(value: any): Function<T>;
72
- month(value: any): Function<T>;
66
+ date(left: any, normalize?: Normalize): Function<T>;
67
+ day(left: any, normalize?: Normalize): Function<T>;
68
+ fractionalseconds(left: any, normalize?: Normalize): Function<T>;
69
+ hour(left: any, normalize?: Normalize): Function<T>;
70
+ maxdatetime(left: any, normalize?: Normalize): Function<T>;
71
+ mindatetime(left: any, normalize?: Normalize): Function<T>;
72
+ minute(left: any, normalize?: Normalize): Function<T>;
73
+ month(left: any, normalize?: Normalize): Function<T>;
73
74
  now(): Function<T>;
74
- second(value: any): Function<T>;
75
- time(value: any): Function<T>;
76
- totaloffsetminutes(value: any): Function<T>;
77
- totalseconds(value: any): Function<T>;
78
- year(value: any): Function<T>;
75
+ second(left: any, normalize?: Normalize): Function<T>;
76
+ time(left: any, normalize?: Normalize): Function<T>;
77
+ totaloffsetminutes(left: any, normalize?: Normalize): Function<T>;
78
+ totalseconds(left: any, normalize?: Normalize): Function<T>;
79
+ year(left: any, normalize?: Normalize): Function<T>;
79
80
  }
80
81
  export declare class ArithmeticFunctions<T> {
81
- ceiling(value: T | string): Function<T>;
82
- floor(value: T | string): Function<T>;
83
- round(value: T | string): Function<T>;
82
+ ceiling(left: T | string, normalize?: Normalize): Function<T>;
83
+ floor(left: T | string, normalize?: Normalize): Function<T>;
84
+ round(left: T | string, normalize?: Normalize): Function<T>;
84
85
  }
85
86
  export declare class TypeFunctions<T> {
86
- cast(value: T | string, type?: string): Function<T>;
87
- isof(value: T | string, type?: string): Function<T>;
87
+ cast(left: T | string, right?: string, normalize?: Normalize): Function<T>;
88
+ isof(left: T | string, right?: string, normalize?: Normalize): Function<T>;
88
89
  }
89
90
  export declare class GeoFunctions<T> {
90
- geoDistance(value: T, point: string, normalize?: boolean): Function<T>;
91
- geoIntersects(value: T, polygon: string, normalize?: boolean): Function<T>;
92
- geoLength(line: T, normalize?: boolean): Function<T>;
91
+ geoDistance(left: T, right: string, normalize?: Normalize): Function<T>;
92
+ geoIntersects(left: T, right: string, normalize?: Normalize): Function<T>;
93
+ geoLength(left: T, normalize?: Normalize): Function<T>;
93
94
  }
94
95
  export declare class ConditionalFunctions<T> {
95
- case(condition: T | string, value: any): Function<T>;
96
+ case(left: T | string, right: any, normalize?: Normalize): Function<T>;
96
97
  }
97
98
  export declare class Operator<T> implements Renderable {
98
99
  protected op: string;
99
100
  protected values: any[];
100
- protected normalize: boolean;
101
- constructor(op: string, values: any[], normalize?: boolean);
101
+ protected normalize: Normalize;
102
+ constructor(op: string, values: any[], normalize: Normalize);
102
103
  get [Symbol.toStringTag](): string;
103
104
  toJSON(): {
104
105
  $type: string;
105
106
  op: string;
106
107
  values: any[];
107
- normalize: boolean;
108
+ normalize: Normalize;
108
109
  };
109
110
  render({ aliases, escape, prefix, }: {
110
111
  aliases?: QueryCustomType[];
@@ -114,23 +115,23 @@ export declare class Operator<T> implements Renderable {
114
115
  clone(): Operator<unknown>;
115
116
  }
116
117
  export declare class LogicalOperators<T> {
117
- eq(left: any, right: any, normalize?: boolean): Operator<unknown>;
118
- ne(left: any, right: any, normalize?: boolean): Operator<unknown>;
119
- gt(left: any, right: any, normalize?: boolean): Operator<unknown>;
120
- ge(left: any, right: any, normalize?: boolean): Operator<unknown>;
121
- lt(left: any, right: any, normalize?: boolean): Operator<unknown>;
122
- le(left: any, right: any, normalize?: boolean): Operator<unknown>;
123
- not(value: any, normalize?: boolean): Operator<T>;
124
- has(left: any, right: any, normalize?: boolean): Operator<unknown>;
125
- in(left: any, right: any, normalize?: boolean): Operator<unknown>;
118
+ eq(left: any, right: any, normalize?: Normalize): Operator<unknown>;
119
+ ne(left: any, right: any, normalize?: Normalize): Operator<unknown>;
120
+ gt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
121
+ ge(left: any, right: any, normalize?: Normalize): Operator<unknown>;
122
+ lt(left: any, right: any, normalize?: Normalize): Operator<unknown>;
123
+ le(left: any, right: any, normalize?: Normalize): Operator<unknown>;
124
+ not(left: any, normalize?: Normalize): Operator<T>;
125
+ has(left: any, right: any, normalize?: Normalize): Operator<unknown>;
126
+ in(left: any, right: any, normalize?: Normalize): Operator<unknown>;
126
127
  }
127
128
  export declare class ArithmeticOperators<T> {
128
- add(left: any, right: any, normalize?: boolean): Operator<T>;
129
- sub(left: any, right: any, normalize?: boolean): Operator<unknown>;
130
- mul(left: any, right: any, normalize?: boolean): Operator<unknown>;
131
- div(left: any, right: any, normalize?: boolean): Operator<unknown>;
132
- mod(left: any, right: any, normalize?: boolean): Operator<unknown>;
133
- neg(value: any, normalize?: boolean): Operator<unknown>;
129
+ add(left: any, right: any, normalize?: Normalize): Operator<T>;
130
+ sub(left: any, right: any, normalize?: Normalize): Operator<unknown>;
131
+ mul(left: any, right: any, normalize?: Normalize): Operator<unknown>;
132
+ div(left: any, right: any, normalize?: Normalize): Operator<unknown>;
133
+ mod(left: any, right: any, normalize?: Normalize): Operator<unknown>;
134
+ neg(value: any, normalize?: Normalize): Operator<unknown>;
134
135
  }
135
136
  export declare class Grouping<T> implements Renderable {
136
137
  protected group: Renderable;
@@ -167,8 +168,8 @@ export declare class Lambda<T> implements Renderable {
167
168
  clone(): Lambda<unknown>;
168
169
  }
169
170
  export declare class LambdaOperators<T> {
170
- any(field: T, value: any, alias?: string): Lambda<unknown>;
171
- all(field: T, value: any, alias?: string): Lambda<unknown>;
171
+ any(left: T, right: any, alias?: string): Lambda<unknown>;
172
+ all(left: T, right: any, alias?: string): Lambda<unknown>;
172
173
  }
173
174
  export declare class ODataOperators<T> {
174
175
  }
@@ -126,7 +126,7 @@ export declare class ODataQueryOptionsHandler<T> {
126
126
  * If opts is given then set te value as new value for $select.
127
127
  * @param opts Select<T> value or builder function for SelectExpression<T>
128
128
  */
129
- select(opts: SelectExpressionBuilder<T>): SelectExpression<T>;
129
+ select(opts: (builder: SelectExpressionBuilder<T>, current?: SelectExpression<T>) => SelectExpression<T>): SelectExpression<T>;
130
130
  select(opts: Select<T>): ODataQueryOptionHandler<T>;
131
131
  select(): ODataQueryOptionHandler<T>;
132
132
  /**
@@ -134,7 +134,7 @@ export declare class ODataQueryOptionsHandler<T> {
134
134
  * If opts is given then set te value as new value for $expand.
135
135
  * @param opts Expand<T> value or builder function for ExpandExpression<T>
136
136
  */
137
- expand(opts: ExpandExpressionBuilder<T>): ExpandExpression<T>;
137
+ expand(opts: (builder: ExpandExpressionBuilder<T>, current?: ExpandExpression<T>) => ExpandExpression<T>): ExpandExpression<T>;
138
138
  expand(opts: Expand<T>): ODataQueryOptionHandler<T>;
139
139
  expand(): ODataQueryOptionHandler<T>;
140
140
  /**
@@ -4,7 +4,7 @@ import { ComputeExpression, Expression, FilterExpression, OrderByExpression, Sea
4
4
  import { ExpandExpression } from './expressions/expand';
5
5
  import { SelectExpression } from './expressions/select';
6
6
  import { ODataQueryOptionHandler } from './handlers';
7
- export declare type ODataQueryArguments<T> = {
7
+ export type ODataQueryArguments<T> = {
8
8
  [QueryOption.select]?: Select<T> | SelectExpression<T> | null;
9
9
  [QueryOption.expand]?: Expand<T> | ExpandExpression<T> | null;
10
10
  [QueryOption.compute]?: string | ComputeExpression<T> | null;
@@ -8,7 +8,7 @@ import { ODataPathSegments, ODataPathSegmentsHandler } from './path';
8
8
  import { ODataQueryOptions, ODataQueryOptionsHandler, QueryCustomType } from './query';
9
9
  import { ODataEntitiesAnnotations, ODataEntityAnnotations } from './responses/index';
10
10
  import { ODataOptions } from './types';
11
- export declare type EntityKey<T> = {
11
+ export type EntityKey<T> = {
12
12
  readonly [P in keyof T]?: T[P];
13
13
  } | QueryCustomType | string | number;
14
14
  export declare class ODataResource<T> {
@@ -1,13 +1,13 @@
1
1
  import { ODataEntitiesAnnotations, ODataEntityAnnotations, ODataPropertyAnnotations } from './annotations';
2
- export declare type ODataEntity<T> = {
2
+ export type ODataEntity<T> = {
3
3
  entity: T | null;
4
4
  annots: ODataEntityAnnotations<T>;
5
5
  };
6
- export declare type ODataEntities<T> = {
6
+ export type ODataEntities<T> = {
7
7
  entities: T[] | null;
8
8
  annots: ODataEntitiesAnnotations<T>;
9
9
  };
10
- export declare type ODataProperty<T> = {
10
+ export type ODataProperty<T> = {
11
11
  property: T | null;
12
12
  annots: ODataPropertyAnnotations<T>;
13
13
  };
@@ -1,7 +1,7 @@
1
1
  import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
2
2
  import { FetchPolicy } from '../../types';
3
3
  import { ODataQueryArguments } from '../query';
4
- export declare type ODataOptions = {
4
+ export type ODataOptions = {
5
5
  etag?: string;
6
6
  context?: HttpContext;
7
7
  headers?: HttpHeaders | {
@@ -14,18 +14,18 @@ export declare type ODataOptions = {
14
14
  withCredentials?: boolean;
15
15
  fetchPolicy?: FetchPolicy;
16
16
  };
17
- export declare type ODataEntityOptions = ODataOptions & {
17
+ export type ODataEntityOptions = ODataOptions & {
18
18
  responseType?: 'entity';
19
19
  };
20
- export declare type ODataEntitiesOptions = ODataOptions & {
20
+ export type ODataEntitiesOptions = ODataOptions & {
21
21
  responseType?: 'entities';
22
22
  withCount?: boolean;
23
23
  };
24
- export declare type ODataPropertyOptions = ODataOptions & {
24
+ export type ODataPropertyOptions = ODataOptions & {
25
25
  responseType?: 'property';
26
26
  };
27
- export declare type ODataQueryArgumentsOptions<T> = ODataOptions & ODataQueryArguments<T>;
28
- export declare type ODataActionOptions<T> = ODataQueryArgumentsOptions<T>;
29
- export declare type ODataFunctionOptions<T> = ODataQueryArgumentsOptions<T> & {
27
+ export type ODataQueryArgumentsOptions<T> = ODataOptions & ODataQueryArguments<T>;
28
+ export type ODataActionOptions<T> = ODataQueryArgumentsOptions<T>;
29
+ export type ODataFunctionOptions<T> = ODataQueryArgumentsOptions<T> & {
30
30
  alias?: boolean;
31
31
  };
@@ -1,17 +1,17 @@
1
1
  import { ParserOptions, Parser, StructuredTypeConfig, StructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
2
2
  import { ODataAnnotatable } from '../annotation';
3
3
  import { ODataEnumTypeParser } from './enum-type';
4
- declare type JsonSchemaSelect<T> = Array<keyof T>;
5
- declare type JsonSchemaCustom<T> = {
4
+ type JsonSchemaSelect<T> = Array<keyof T>;
5
+ type JsonSchemaCustom<T> = {
6
6
  [P in keyof T]?: (schema: any, field: ODataStructuredTypeFieldParser<T[P]>) => any;
7
7
  };
8
- declare type JsonSchemaExpand<T> = {
8
+ type JsonSchemaExpand<T> = {
9
9
  [P in keyof T]?: JsonSchemaOptions<T[P]>;
10
10
  };
11
- declare type JsonSchemaRequired<T> = {
11
+ type JsonSchemaRequired<T> = {
12
12
  [P in keyof T]?: boolean;
13
13
  };
14
- export declare type JsonSchemaOptions<T> = {
14
+ export type JsonSchemaOptions<T> = {
15
15
  select?: JsonSchemaSelect<T>;
16
16
  custom?: JsonSchemaCustom<T>;
17
17
  expand?: JsonSchemaExpand<T>;
package/lib/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- export declare type ODataVersion = '2.0' | '3.0' | '4.0';
3
- export declare type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
4
- export declare type ODataMetadataType = 'minimal' | 'full' | 'none';
5
- export declare type CacheCacheability = 'public' | 'private' | 'no-cache' | 'no-store';
2
+ export type ODataVersion = '2.0' | '3.0' | '4.0';
3
+ export type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
4
+ export type ODataMetadataType = 'minimal' | 'full' | 'none';
5
+ export type CacheCacheability = 'public' | 'private' | 'no-cache' | 'no-store';
6
6
  export declare enum PathSegment {
7
7
  batch = "batch",
8
8
  metadata = "metadata",
@@ -134,7 +134,7 @@ export interface Cache {
134
134
  put<T>(key: string, payload: T, ...opts: any[]): void;
135
135
  get<T>(key: string, ...opts: any[]): T | undefined;
136
136
  }
137
- export declare type ApiConfig = {
137
+ export type ApiConfig = {
138
138
  serviceRootUrl: string;
139
139
  name?: string;
140
140
  version?: ODataVersion;
@@ -148,7 +148,7 @@ export declare type ApiConfig = {
148
148
  };
149
149
  schemas?: SchemaConfig[];
150
150
  };
151
- export declare type AnnotationConfig = {
151
+ export type AnnotationConfig = {
152
152
  term: string;
153
153
  string?: string;
154
154
  bool?: boolean;
@@ -156,7 +156,7 @@ export declare type AnnotationConfig = {
156
156
  permissions?: string[];
157
157
  properties?: string[];
158
158
  };
159
- export declare type SchemaConfig = {
159
+ export type SchemaConfig = {
160
160
  namespace: string;
161
161
  alias?: string;
162
162
  annotations?: AnnotationConfig[];
@@ -165,16 +165,16 @@ export declare type SchemaConfig = {
165
165
  callables?: CallableConfig[];
166
166
  containers?: EntityContainerConfig[];
167
167
  };
168
- export declare type EntityContainerConfig = {
168
+ export type EntityContainerConfig = {
169
169
  name: string;
170
170
  annotations?: AnnotationConfig[];
171
171
  entitySets?: EntitySetConfig[];
172
172
  };
173
- export declare type EnumTypeFieldConfig<E> = {
173
+ export type EnumTypeFieldConfig<E> = {
174
174
  value: E;
175
175
  annotations?: AnnotationConfig[];
176
176
  };
177
- export declare type EnumTypeConfig<E> = {
177
+ export type EnumTypeConfig<E> = {
178
178
  name: string;
179
179
  flags?: boolean;
180
180
  annotations?: AnnotationConfig[];
@@ -187,7 +187,7 @@ export declare type EnumTypeConfig<E> = {
187
187
  [member: string]: EnumTypeFieldConfig<E>;
188
188
  };
189
189
  };
190
- export declare type StructuredTypeFieldConfig = {
190
+ export type StructuredTypeFieldConfig = {
191
191
  type: string;
192
192
  default?: any;
193
193
  maxLength?: number;
@@ -205,7 +205,7 @@ export declare type StructuredTypeFieldConfig = {
205
205
  referential?: string;
206
206
  referenced?: string;
207
207
  };
208
- export declare type StructuredTypeConfig<T> = {
208
+ export type StructuredTypeConfig<T> = {
209
209
  name: string;
210
210
  base?: string;
211
211
  open?: boolean;
@@ -224,12 +224,12 @@ export declare type StructuredTypeConfig<T> = {
224
224
  [P in keyof T]?: StructuredTypeFieldConfig;
225
225
  };
226
226
  };
227
- export declare type Parameter = {
227
+ export type Parameter = {
228
228
  type: string;
229
229
  nullable?: boolean;
230
230
  collection?: boolean;
231
231
  };
232
- export declare type CallableConfig = {
232
+ export type CallableConfig = {
233
233
  name: string;
234
234
  entitySetPath?: string;
235
235
  bound?: boolean;
@@ -242,7 +242,7 @@ export declare type CallableConfig = {
242
242
  collection?: boolean;
243
243
  };
244
244
  };
245
- export declare type EntitySetConfig = {
245
+ export type EntitySetConfig = {
246
246
  name: string;
247
247
  entityType: string;
248
248
  service: {
@@ -1,4 +1,4 @@
1
- export declare type Duration = {
1
+ export type Duration = {
2
2
  sign?: 1 | -1;
3
3
  years?: number;
4
4
  months?: number;
@@ -17,4 +17,7 @@ export declare const Enums: {
17
17
  toNames<E_5 extends {
18
18
  [key: string]: any;
19
19
  }>(enums: E_5, value: any): string[];
20
+ toFlags<E_6 extends {
21
+ [key: string]: any;
22
+ }>(enums: E_6, value: any): string[];
20
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.121.0",
3
+ "version": "0.123.0",
4
4
  "license": "MIT",
5
5
  "description": "Client side OData typescript library for Angular",
6
6
  "repository": {
@@ -25,17 +25,14 @@
25
25
  "homepage": "https://github.com/diegomvh/angular-odata",
26
26
  "private": false,
27
27
  "peerDependencies": {
28
- "@angular/common": ">=13.0.0",
29
- "@angular/core": ">=13.0.0"
28
+ "@angular/common": ">=14.0.0",
29
+ "@angular/core": ">=14.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0"
33
33
  },
34
- "module": "fesm2015/angular-odata.mjs",
35
- "es2020": "fesm2020/angular-odata.mjs",
36
- "esm2020": "esm2020/angular-odata.mjs",
37
- "fesm2020": "fesm2020/angular-odata.mjs",
38
- "fesm2015": "fesm2015/angular-odata.mjs",
34
+ "sideEffects": false,
35
+ "module": "fesm2022/angular-odata.mjs",
39
36
  "typings": "index.d.ts",
40
37
  "exports": {
41
38
  "./package.json": {
@@ -43,12 +40,9 @@
43
40
  },
44
41
  ".": {
45
42
  "types": "./index.d.ts",
46
- "esm2020": "./esm2020/angular-odata.mjs",
47
- "es2020": "./fesm2020/angular-odata.mjs",
48
- "es2015": "./fesm2015/angular-odata.mjs",
49
- "node": "./fesm2015/angular-odata.mjs",
50
- "default": "./fesm2020/angular-odata.mjs"
43
+ "esm2022": "./esm2022/angular-odata.mjs",
44
+ "esm": "./esm2022/angular-odata.mjs",
45
+ "default": "./fesm2022/angular-odata.mjs"
51
46
  }
52
- },
53
- "sideEffects": false
47
+ }
54
48
  }