angular-odata 0.130.0 → 0.131.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 (159) hide show
  1. package/fesm2022/angular-odata.mjs +2298 -2162
  2. package/fesm2022/angular-odata.mjs.map +1 -1
  3. package/lib/api.d.ts +10 -11
  4. package/lib/cache/cache.d.ts +2 -2
  5. package/lib/cache/memory.d.ts +2 -2
  6. package/lib/cache/storage.d.ts +2 -2
  7. package/lib/loaders.d.ts +8 -8
  8. package/lib/metadata/csdl/csdl-annotation.d.ts +3 -3
  9. package/lib/metadata/csdl/csdl-entity-container.d.ts +2 -2
  10. package/lib/metadata/csdl/csdl-entity-set.d.ts +2 -2
  11. package/lib/metadata/csdl/csdl-enum-type.d.ts +3 -3
  12. package/lib/metadata/csdl/csdl-function-action.d.ts +4 -4
  13. package/lib/metadata/csdl/csdl-reference.d.ts +2 -2
  14. package/lib/metadata/csdl/csdl-schema.d.ts +2 -2
  15. package/lib/metadata/csdl/csdl-structural-property.d.ts +3 -3
  16. package/lib/metadata/csdl/csdl-structured-type.d.ts +3 -3
  17. package/lib/metadata/metadata.d.ts +2 -2
  18. package/lib/models/options.d.ts +2 -2
  19. package/lib/module.d.ts +3 -3
  20. package/lib/options.d.ts +3 -3
  21. package/lib/resources/query/expressions/apply.d.ts +1 -1
  22. package/lib/resources/query/expressions/compute.d.ts +1 -1
  23. package/lib/resources/query/expressions/count.d.ts +1 -1
  24. package/lib/resources/query/expressions/expand.d.ts +4 -3
  25. package/lib/resources/query/expressions/filter.d.ts +2 -1
  26. package/lib/resources/query/expressions/orderby.d.ts +2 -1
  27. package/lib/resources/query/expressions/search.d.ts +2 -1
  28. package/lib/resources/query/expressions/select.d.ts +2 -1
  29. package/lib/resources/query/handlers.d.ts +17 -5
  30. package/lib/resources/resource.d.ts +5 -5
  31. package/lib/resources/types/action.d.ts +2 -2
  32. package/lib/resources/types/entity-set.d.ts +2 -2
  33. package/lib/resources/types/navigation-property.d.ts +2 -2
  34. package/lib/resources/types/property.d.ts +2 -2
  35. package/lib/schema/annotation.d.ts +3 -3
  36. package/lib/schema/callable.d.ts +3 -3
  37. package/lib/schema/element.d.ts +3 -3
  38. package/lib/schema/entity-container.d.ts +2 -2
  39. package/lib/schema/entity-set.d.ts +2 -2
  40. package/lib/schema/enum-type.d.ts +2 -2
  41. package/lib/schema/parsers/callable.d.ts +4 -4
  42. package/lib/schema/parsers/enum-type.d.ts +3 -3
  43. package/lib/schema/parsers/structured-type.d.ts +4 -4
  44. package/lib/schema/schema.d.ts +3 -3
  45. package/lib/schema/singleton.d.ts +2 -2
  46. package/lib/schema/structured-type.d.ts +3 -3
  47. package/lib/services/entity.d.ts +1 -1
  48. package/lib/settings.d.ts +2 -2
  49. package/lib/types.d.ts +76 -74
  50. package/lib/utils/odata.d.ts +2 -2
  51. package/package.json +3 -5
  52. package/schematics/apigen/files/api-config/__fileName__.ts +4 -4
  53. package/esm2022/angular-odata.mjs +0 -5
  54. package/esm2022/lib/annotations.mjs +0 -146
  55. package/esm2022/lib/api.mjs +0 -439
  56. package/esm2022/lib/cache/cache.mjs +0 -177
  57. package/esm2022/lib/cache/index.mjs +0 -4
  58. package/esm2022/lib/cache/memory.mjs +0 -30
  59. package/esm2022/lib/cache/storage.mjs +0 -57
  60. package/esm2022/lib/client.mjs +0 -215
  61. package/esm2022/lib/constants.mjs +0 -95
  62. package/esm2022/lib/helper.mjs +0 -288
  63. package/esm2022/lib/index.mjs +0 -22
  64. package/esm2022/lib/loaders.mjs +0 -43
  65. package/esm2022/lib/metadata/csdl/csdl-annotation.mjs +0 -273
  66. package/esm2022/lib/metadata/csdl/csdl-entity-container.mjs +0 -59
  67. package/esm2022/lib/metadata/csdl/csdl-entity-set.mjs +0 -50
  68. package/esm2022/lib/metadata/csdl/csdl-enum-type.mjs +0 -74
  69. package/esm2022/lib/metadata/csdl/csdl-function-action.mjs +0 -204
  70. package/esm2022/lib/metadata/csdl/csdl-navigation-property-binding.mjs +0 -15
  71. package/esm2022/lib/metadata/csdl/csdl-reference.mjs +0 -76
  72. package/esm2022/lib/metadata/csdl/csdl-schema.mjs +0 -87
  73. package/esm2022/lib/metadata/csdl/csdl-singleton.mjs +0 -37
  74. package/esm2022/lib/metadata/csdl/csdl-structural-property.mjs +0 -145
  75. package/esm2022/lib/metadata/csdl/csdl-structured-type.mjs +0 -159
  76. package/esm2022/lib/metadata/csdl/csdl-type-definition.mjs +0 -46
  77. package/esm2022/lib/metadata/index.mjs +0 -3
  78. package/esm2022/lib/metadata/metadata.mjs +0 -41
  79. package/esm2022/lib/metadata/parser.mjs +0 -564
  80. package/esm2022/lib/models/collection.mjs +0 -816
  81. package/esm2022/lib/models/index.mjs +0 -4
  82. package/esm2022/lib/models/model.mjs +0 -577
  83. package/esm2022/lib/models/options.mjs +0 -1227
  84. package/esm2022/lib/module.mjs +0 -55
  85. package/esm2022/lib/options.mjs +0 -91
  86. package/esm2022/lib/resources/index.mjs +0 -7
  87. package/esm2022/lib/resources/options.mjs +0 -66
  88. package/esm2022/lib/resources/path/handlers.mjs +0 -81
  89. package/esm2022/lib/resources/path/index.mjs +0 -3
  90. package/esm2022/lib/resources/path/segments.mjs +0 -149
  91. package/esm2022/lib/resources/query/builder.mjs +0 -645
  92. package/esm2022/lib/resources/query/expressions/apply.mjs +0 -238
  93. package/esm2022/lib/resources/query/expressions/base.mjs +0 -26
  94. package/esm2022/lib/resources/query/expressions/compute.mjs +0 -55
  95. package/esm2022/lib/resources/query/expressions/count.mjs +0 -118
  96. package/esm2022/lib/resources/query/expressions/expand.mjs +0 -154
  97. package/esm2022/lib/resources/query/expressions/filter.mjs +0 -180
  98. package/esm2022/lib/resources/query/expressions/index.mjs +0 -10
  99. package/esm2022/lib/resources/query/expressions/orderby.mjs +0 -81
  100. package/esm2022/lib/resources/query/expressions/search.mjs +0 -144
  101. package/esm2022/lib/resources/query/expressions/select.mjs +0 -49
  102. package/esm2022/lib/resources/query/expressions/syntax.mjs +0 -770
  103. package/esm2022/lib/resources/query/handlers.mjs +0 -423
  104. package/esm2022/lib/resources/query/index.mjs +0 -5
  105. package/esm2022/lib/resources/query/options.mjs +0 -140
  106. package/esm2022/lib/resources/request.mjs +0 -210
  107. package/esm2022/lib/resources/resource.mjs +0 -316
  108. package/esm2022/lib/resources/response.mjs +0 -180
  109. package/esm2022/lib/resources/types/action.mjs +0 -118
  110. package/esm2022/lib/resources/types/batch.mjs +0 -428
  111. package/esm2022/lib/resources/types/count.mjs +0 -33
  112. package/esm2022/lib/resources/types/entity-set.mjs +0 -131
  113. package/esm2022/lib/resources/types/entity.mjs +0 -112
  114. package/esm2022/lib/resources/types/function.mjs +0 -149
  115. package/esm2022/lib/resources/types/index.mjs +0 -15
  116. package/esm2022/lib/resources/types/media.mjs +0 -44
  117. package/esm2022/lib/resources/types/metadata.mjs +0 -35
  118. package/esm2022/lib/resources/types/navigation-property.mjs +0 -246
  119. package/esm2022/lib/resources/types/options.mjs +0 -2
  120. package/esm2022/lib/resources/types/property.mjs +0 -187
  121. package/esm2022/lib/resources/types/reference.mjs +0 -87
  122. package/esm2022/lib/resources/types/singleton.mjs +0 -125
  123. package/esm2022/lib/resources/types/value.mjs +0 -48
  124. package/esm2022/lib/schema/annotation.mjs +0 -44
  125. package/esm2022/lib/schema/callable.mjs +0 -69
  126. package/esm2022/lib/schema/element.mjs +0 -70
  127. package/esm2022/lib/schema/entity-container.mjs +0 -13
  128. package/esm2022/lib/schema/entity-set.mjs +0 -11
  129. package/esm2022/lib/schema/enum-type.mjs +0 -69
  130. package/esm2022/lib/schema/index.mjs +0 -9
  131. package/esm2022/lib/schema/parsers/callable.mjs +0 -123
  132. package/esm2022/lib/schema/parsers/edm.mjs +0 -101
  133. package/esm2022/lib/schema/parsers/enum-type.mjs +0 -148
  134. package/esm2022/lib/schema/parsers/index.mjs +0 -5
  135. package/esm2022/lib/schema/parsers/structured-type.mjs +0 -548
  136. package/esm2022/lib/schema/schema.mjs +0 -52
  137. package/esm2022/lib/schema/singleton.mjs +0 -11
  138. package/esm2022/lib/schema/structured-type.mjs +0 -220
  139. package/esm2022/lib/services/base.mjs +0 -32
  140. package/esm2022/lib/services/entity-set.mjs +0 -161
  141. package/esm2022/lib/services/entity.mjs +0 -12
  142. package/esm2022/lib/services/factory.mjs +0 -39
  143. package/esm2022/lib/services/index.mjs +0 -5
  144. package/esm2022/lib/services/singleton.mjs +0 -55
  145. package/esm2022/lib/settings.mjs +0 -113
  146. package/esm2022/lib/types.mjs +0 -118
  147. package/esm2022/lib/utils/arraybuffers.mjs +0 -46
  148. package/esm2022/lib/utils/arrays.mjs +0 -10
  149. package/esm2022/lib/utils/dates.mjs +0 -18
  150. package/esm2022/lib/utils/durations.mjs +0 -40
  151. package/esm2022/lib/utils/enums.mjs +0 -61
  152. package/esm2022/lib/utils/http.mjs +0 -95
  153. package/esm2022/lib/utils/index.mjs +0 -10
  154. package/esm2022/lib/utils/objects.mjs +0 -204
  155. package/esm2022/lib/utils/odata.mjs +0 -22
  156. package/esm2022/lib/utils/strings.mjs +0 -20
  157. package/esm2022/lib/utils/types.mjs +0 -136
  158. package/esm2022/lib/utils/urls.mjs +0 -24
  159. package/esm2022/public-api.mjs +0 -5
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataApi } from '../../api';
3
3
  import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
4
- import { QueryOption, StructuredTypeFieldConfig } from '../../types';
4
+ import { QueryOption, ODataStructuredTypeFieldConfig } from '../../types';
5
5
  import { ApplyExpression, ApplyExpressionBuilder, ODataQueryOptions } from '../query';
6
6
  import { ODataResource } from '../resource';
7
7
  import { ODataActionResource } from './action';
@@ -20,7 +20,7 @@ export declare class ODataEntitySetResource<T> extends ODataResource<T> {
20
20
  transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
21
21
  type?: string;
22
22
  fields?: {
23
- [name: string]: StructuredTypeFieldConfig;
23
+ [name: string]: ODataStructuredTypeFieldConfig;
24
24
  };
25
25
  }): ODataEntitySetResource<R>;
26
26
  entity(key?: any): ODataEntityResource<T>;
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataApi } from '../../api';
3
3
  import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
4
- import { QueryOption, StructuredTypeFieldConfig } from '../../types';
4
+ import { QueryOption, ODataStructuredTypeFieldConfig } from '../../types';
5
5
  import { ODataPathSegments } from '../path';
6
6
  import { ApplyExpression, ApplyExpressionBuilder } from '../query';
7
7
  import { ODataResource } from '../resource';
@@ -28,7 +28,7 @@ export declare class ODataNavigationPropertyResource<T> extends ODataResource<T>
28
28
  transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
29
29
  type?: string;
30
30
  fields?: {
31
- [name: string]: StructuredTypeFieldConfig;
31
+ [name: string]: ODataStructuredTypeFieldConfig;
32
32
  };
33
33
  }): ODataNavigationPropertyResource<R>;
34
34
  key(value: any): ODataNavigationPropertyResource<T>;
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataApi } from '../../api';
3
3
  import type { ModelInterface, ODataCollection, ODataModel } from '../../models';
4
- import { QueryOption, StructuredTypeFieldConfig } from '../../types';
4
+ import { QueryOption, ODataStructuredTypeFieldConfig } from '../../types';
5
5
  import { ODataPathSegments } from '../path';
6
6
  import { ApplyExpression, ApplyExpressionBuilder } from '../query';
7
7
  import { ODataResource } from '../resource';
@@ -21,7 +21,7 @@ export declare class ODataPropertyResource<T> extends ODataResource<T> {
21
21
  transform<R>(opts: (builder: ApplyExpressionBuilder<T>, current?: ApplyExpression<T>) => ApplyExpression<T>, { type, fields, }?: {
22
22
  type?: string;
23
23
  fields?: {
24
- [name: string]: StructuredTypeFieldConfig;
24
+ [name: string]: ODataStructuredTypeFieldConfig;
25
25
  };
26
26
  }): ODataPropertyResource<R>;
27
27
  key(value: any): ODataPropertyResource<T>;
@@ -1,4 +1,4 @@
1
- import { AnnotationConfig } from '../types';
1
+ import { ODataAnnotationConfig } from '../types';
2
2
  export declare class ODataAnnotation {
3
3
  term: string;
4
4
  string?: string;
@@ -6,12 +6,12 @@ export declare class ODataAnnotation {
6
6
  int?: number;
7
7
  permissions?: string[];
8
8
  properties?: string[];
9
- constructor(annot: AnnotationConfig);
9
+ constructor(annot: ODataAnnotationConfig);
10
10
  }
11
11
  export declare class ODataAnnotatable {
12
12
  annotations: ODataAnnotation[];
13
13
  constructor(config: {
14
- annotations?: AnnotationConfig[];
14
+ annotations?: ODataAnnotationConfig[];
15
15
  });
16
16
  /**
17
17
  * Find an annotation inside the annotatable.
@@ -1,4 +1,4 @@
1
- import { CallableConfig, ParserOptions } from '../types';
1
+ import { ODataCallableConfig, ParserOptions } from '../types';
2
2
  import { ODataParserSchemaElement } from './element';
3
3
  import { ODataCallableParser } from './parsers';
4
4
  import { ODataSchema } from './schema';
@@ -6,7 +6,7 @@ export declare class ODataCallable<R> extends ODataParserSchemaElement<R, ODataC
6
6
  entitySetPath?: string;
7
7
  bound?: boolean;
8
8
  composable?: boolean;
9
- constructor(config: CallableConfig, schema: ODataSchema);
9
+ constructor(config: ODataCallableConfig, schema: ODataSchema);
10
10
  path(): string;
11
11
  configure({ options }: {
12
12
  options: ParserOptions;
@@ -36,6 +36,6 @@ export declare class ODataCallable<R> extends ODataParserSchemaElement<R, ODataC
36
36
  * Returns the binding parameter of the callable.
37
37
  * @returns The binding parameter of the callable.
38
38
  */
39
- binding(): import("./parsers").ODataParameterParser<any> | undefined;
39
+ binding(): import("angular-odata").ODataParameterParser<any> | undefined;
40
40
  returnType(): string | undefined;
41
41
  }
@@ -1,11 +1,11 @@
1
- import { AnnotationConfig, Parser } from '../types';
1
+ import { ODataAnnotationConfig, Parser } from '../types';
2
2
  import { ODataAnnotatable } from './annotation';
3
3
  import { ODataSchema } from './schema';
4
4
  export declare class ODataSchemaElement extends ODataAnnotatable {
5
5
  name: string;
6
6
  schema: ODataSchema;
7
7
  constructor(config: {
8
- annotations?: AnnotationConfig[];
8
+ annotations?: ODataAnnotationConfig[];
9
9
  name: string;
10
10
  }, schema: ODataSchema);
11
11
  get api(): import("angular-odata").ODataApi;
@@ -46,7 +46,7 @@ export declare class ODataSchemaElement extends ODataAnnotatable {
46
46
  export declare class ODataParserSchemaElement<E, P extends Parser<E>> extends ODataSchemaElement {
47
47
  parser: P;
48
48
  constructor(config: {
49
- annotations?: AnnotationConfig[];
49
+ annotations?: ODataAnnotationConfig[];
50
50
  name: string;
51
51
  }, schema: ODataSchema, parser: P);
52
52
  }
@@ -1,4 +1,4 @@
1
- import { EntityContainerConfig } from '../types';
1
+ import { ODataEntityContainerConfig } from '../types';
2
2
  import { ODataSchemaElement } from './element';
3
3
  import { ODataEntitySet } from './entity-set';
4
4
  import { ODataSchema } from './schema';
@@ -6,5 +6,5 @@ import { ODataSingleton } from './singleton';
6
6
  export declare class ODataEntityContainer extends ODataSchemaElement {
7
7
  entitySets: ODataEntitySet[];
8
8
  singletons: ODataSingleton[];
9
- constructor(config: EntityContainerConfig, schema: ODataSchema);
9
+ constructor(config: ODataEntityContainerConfig, schema: ODataSchema);
10
10
  }
@@ -1,4 +1,4 @@
1
- import { EntitySetConfig } from '../types';
1
+ import { ODataEntitySetConfig } from '../types';
2
2
  import { ODataSchemaElement } from './element';
3
3
  import { ODataSchema } from './schema';
4
4
  export declare class ODataEntitySet extends ODataSchemaElement {
@@ -6,5 +6,5 @@ export declare class ODataEntitySet extends ODataSchemaElement {
6
6
  service: {
7
7
  new (...params: any[]): any;
8
8
  };
9
- constructor(config: EntitySetConfig, schema: ODataSchema);
9
+ constructor(config: ODataEntitySetConfig, schema: ODataSchema);
10
10
  }
@@ -1,4 +1,4 @@
1
- import { EnumTypeConfig, ParserOptions } from '../types';
1
+ import { ODataEnumTypeConfig, ParserOptions } from '../types';
2
2
  import { ODataParserSchemaElement } from './element';
3
3
  import { ODataEnumTypeFieldParser, ODataEnumTypeParser } from './parsers';
4
4
  import { ODataSchema } from './schema';
@@ -8,7 +8,7 @@ export declare class ODataEnumType<E> extends ODataParserSchemaElement<E, ODataE
8
8
  } | {
9
9
  [value: number]: string;
10
10
  };
11
- constructor(config: EnumTypeConfig, schema: ODataSchema);
11
+ constructor(config: ODataEnumTypeConfig, schema: ODataSchema);
12
12
  configure({ options }: {
13
13
  options: ParserOptions;
14
14
  }): void;
@@ -1,4 +1,4 @@
1
- import { CallableConfig, ParserOptions, ParameterConfig, Parser } from '../../types';
1
+ import { ODataCallableConfig, ParserOptions, ODataParameterConfig, Parser } from '../../types';
2
2
  import { ODataEnumTypeParser } from './enum-type';
3
3
  import { ODataStructuredTypeParser } from './structured-type';
4
4
  export declare class ODataParameterParser<T> {
@@ -8,7 +8,7 @@ export declare class ODataParameterParser<T> {
8
8
  collection?: boolean;
9
9
  nullable?: boolean;
10
10
  parserOptions?: ParserOptions;
11
- constructor(name: string, parameter: ParameterConfig);
11
+ constructor(name: string, parameter: ODataParameterConfig);
12
12
  serialize(value: T, options?: ParserOptions): any;
13
13
  encode(value: any, options?: ParserOptions): string;
14
14
  configure({ options, parserForType, }: {
@@ -20,7 +20,7 @@ export declare class ODataParameterParser<T> {
20
20
  enumType(): ODataEnumTypeParser<T>;
21
21
  isStructuredType(): boolean;
22
22
  structuredType(): ODataStructuredTypeParser<T>;
23
- field<F>(name: string): import("./structured-type").ODataStructuredTypeFieldParser<F>;
23
+ field<F>(name: string): import("angular-odata").ODataStructuredTypeFieldParser<F>;
24
24
  }
25
25
  export declare class ODataCallableParser<R> implements Parser<R> {
26
26
  name: string;
@@ -33,7 +33,7 @@ export declare class ODataCallableParser<R> implements Parser<R> {
33
33
  parser: Parser<any>;
34
34
  parameters: ODataParameterParser<any>[];
35
35
  parserOptions?: ParserOptions;
36
- constructor(config: CallableConfig, namespace: string, alias?: string);
36
+ constructor(config: ODataCallableConfig, namespace: string, alias?: string);
37
37
  isTypeOf(type: string): boolean;
38
38
  deserialize(value: any, options?: ParserOptions): R;
39
39
  serialize(params: any, options?: ParserOptions): any;
@@ -1,9 +1,9 @@
1
- import { EnumTypeConfig, EnumTypeFieldConfig, ParserOptions, FieldParser, JsonType } from '../../types';
1
+ import { ODataEnumTypeConfig, ODataEnumTypeFieldConfig, ParserOptions, FieldParser, JsonType } from '../../types';
2
2
  import { ODataAnnotatable } from '../annotation';
3
3
  export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
4
4
  name: string;
5
5
  value: number;
6
- constructor(name: string, field: EnumTypeFieldConfig);
6
+ constructor(name: string, field: ODataEnumTypeFieldConfig);
7
7
  titleize(term?: string | RegExp): string;
8
8
  }
9
9
  export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements FieldParser<E> {
@@ -18,7 +18,7 @@ export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements
18
18
  };
19
19
  private _fields;
20
20
  parserOptions?: ParserOptions;
21
- constructor(config: EnumTypeConfig, namespace: string, alias?: string);
21
+ constructor(config: ODataEnumTypeConfig, namespace: string, alias?: string);
22
22
  configure({ options }: {
23
23
  options: ParserOptions;
24
24
  }): void;
@@ -1,4 +1,4 @@
1
- import { ParserOptions, Parser, StructuredTypeConfig, StructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
1
+ import { ParserOptions, Parser, ODataStructuredTypeConfig, ODataStructuredTypeFieldConfig, FieldParser, EdmType } from '../../types';
2
2
  import { ODataAnnotatable } from '../annotation';
3
3
  import { ODataEnumTypeParser } from './enum-type';
4
4
  type JsonSchemaSelect<T> = Array<keyof T>;
@@ -47,7 +47,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
47
47
  scale?: number | 'variable';
48
48
  referentials: ODataReferential[];
49
49
  parserOptions?: ParserOptions;
50
- constructor(name: string, structured: ODataStructuredTypeParser<any>, field: StructuredTypeFieldConfig);
50
+ constructor(name: string, structured: ODataStructuredTypeParser<any>, field: ODataStructuredTypeFieldConfig);
51
51
  validate(value: any, { method, navigation, }?: {
52
52
  method?: 'create' | 'update' | 'modify';
53
53
  navigation?: boolean;
@@ -86,8 +86,8 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
86
86
  private _keys?;
87
87
  private _fields;
88
88
  parserOptions?: ParserOptions;
89
- constructor(config: StructuredTypeConfig, namespace: string, alias?: string);
90
- addField<F>(name: string, config: StructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
89
+ constructor(config: ODataStructuredTypeConfig, namespace: string, alias?: string);
90
+ addField<F>(name: string, config: ODataStructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
91
91
  /**
92
92
  * Create a nicer looking title.
93
93
  * Titleize is meant for creating pretty output.
@@ -1,5 +1,5 @@
1
1
  import { ODataApi } from '../api';
2
- import { ParserOptions, SchemaConfig, StructuredTypeConfig } from '../types';
2
+ import { ParserOptions, ODataSchemaConfig, ODataStructuredTypeConfig } from '../types';
3
3
  import { ODataAnnotatable } from './annotation';
4
4
  import { ODataCallable } from './callable';
5
5
  import { ODataEntityContainer } from './entity-container';
@@ -15,11 +15,11 @@ export declare class ODataSchema extends ODataAnnotatable {
15
15
  entities: ODataStructuredType<any>[];
16
16
  callables: ODataCallable<any>[];
17
17
  containers: ODataEntityContainer[];
18
- constructor(config: SchemaConfig, api: ODataApi);
18
+ constructor(config: ODataSchemaConfig, api: ODataApi);
19
19
  isNamespaceOf(type: string): boolean;
20
20
  get entitySets(): ODataEntitySet[];
21
21
  get singletons(): ODataSingleton[];
22
- createStructuredType<T>(config: StructuredTypeConfig): ODataStructuredType<T>;
22
+ createStructuredType<T>(config: ODataStructuredTypeConfig): ODataStructuredType<T>;
23
23
  configure({ options }: {
24
24
  options: ParserOptions;
25
25
  }): void;
@@ -1,4 +1,4 @@
1
- import { SingletonConfig } from '../types';
1
+ import { ODataSingletonConfig } from '../types';
2
2
  import { ODataSchemaElement } from './element';
3
3
  import { ODataSchema } from './schema';
4
4
  export declare class ODataSingleton extends ODataSchemaElement {
@@ -6,5 +6,5 @@ export declare class ODataSingleton extends ODataSchemaElement {
6
6
  service: {
7
7
  new (...params: any[]): any;
8
8
  };
9
- constructor(config: SingletonConfig, schema: ODataSchema);
9
+ constructor(config: ODataSingletonConfig, schema: ODataSchema);
10
10
  }
@@ -1,6 +1,6 @@
1
1
  import { ODataCollection } from '../models/collection';
2
2
  import { ODataModel } from '../models/model';
3
- import { ParserOptions, StructuredTypeConfig, StructuredTypeFieldConfig } from '../types';
3
+ import { ParserOptions, ODataStructuredTypeConfig, ODataStructuredTypeFieldConfig } from '../types';
4
4
  import { ODataParserSchemaElement } from './element';
5
5
  import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
6
6
  import { ODataSchema } from './schema';
@@ -10,7 +10,7 @@ export declare class ODataStructuredType<T> extends ODataParserSchemaElement<T,
10
10
  children: ODataStructuredType<any>[];
11
11
  model?: typeof ODataModel;
12
12
  collection?: typeof ODataCollection;
13
- constructor(config: StructuredTypeConfig, schema: ODataSchema);
13
+ constructor(config: ODataStructuredTypeConfig, schema: ODataSchema);
14
14
  configure({ options }: {
15
15
  options: ParserOptions;
16
16
  }): void;
@@ -45,7 +45,7 @@ export declare class ODataStructuredType<T> extends ODataParserSchemaElement<T,
45
45
  * @returns The field parser
46
46
  */
47
47
  field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
48
- addField<F>(name: string, config: StructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
48
+ addField<F>(name: string, config: ODataStructuredTypeFieldConfig): ODataStructuredTypeFieldParser<F>;
49
49
  /**
50
50
  * Find a parent schema of the structured type.
51
51
  * @param predicate Function for evaluate the schemas in the hierarchy.
@@ -7,5 +7,5 @@ export declare abstract class ODataEntityService<T> extends ODataBaseService {
7
7
  /**
8
8
  * The schema for the structured type.
9
9
  */
10
- get structuredTypeSchema(): import("angular-odata").ODataStructuredType<T> | undefined;
10
+ get structuredTypeSchema(): import("angular-odata").ODataStructuredType<any> | import("angular-odata").ODataStructuredType<T> | undefined;
11
11
  }
package/lib/settings.d.ts CHANGED
@@ -3,10 +3,10 @@ import { ODataApi } from './api';
3
3
  import { ODataCollection, ODataModel } from './models';
4
4
  import { ODataRequest } from './resources';
5
5
  import { ODataCallable, ODataEntitySet, ODataEnumType, ODataStructuredType } from './schema';
6
- import { ApiConfig, EdmType, Parser } from './types';
6
+ import { ODataApiConfig, EdmType, Parser } from './types';
7
7
  export declare class ODataSettings {
8
8
  apis: ODataApi[];
9
- constructor(configs: ApiConfig[]);
9
+ constructor(configs: ODataApiConfig[]);
10
10
  configure(settings: {
11
11
  requester?: (request: ODataRequest<any>) => Observable<any>;
12
12
  }): void;
package/lib/types.d.ts CHANGED
@@ -77,7 +77,43 @@ export declare enum JsonType {
77
77
  boolean = "boolean",
78
78
  null = "null"
79
79
  }
80
- export interface ApiOptions {
80
+ export interface ParserOptions {
81
+ version?: ODataVersion;
82
+ exponentialDecimals?: boolean;
83
+ metadata?: ODataMetadataType;
84
+ ieee754Compatible?: boolean;
85
+ streaming?: boolean;
86
+ stringAsEnum?: boolean;
87
+ deleteRefBy?: 'path' | 'id';
88
+ nonParenthesisForEmptyParameterFunction?: boolean;
89
+ }
90
+ export interface ResponseOptions extends ParserOptions {
91
+ cacheability?: CacheCacheability;
92
+ maxAge?: number;
93
+ }
94
+ export interface StructuredTypeFieldOptions extends ParserOptions {
95
+ field: ODataStructuredTypeFieldConfig;
96
+ }
97
+ export interface Parser<T> {
98
+ deserialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): T;
99
+ serialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
100
+ encode(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
101
+ }
102
+ export interface FieldParser<T> extends Parser<T> {
103
+ nullable?: boolean;
104
+ default?: any;
105
+ maxLength?: number;
106
+ precision?: number;
107
+ scale?: number | 'variable';
108
+ }
109
+ export declare const NONE_PARSER: Parser<any>;
110
+ export interface ODataCache {
111
+ put<T>(key: string, payload: T, ...opts: any[]): void;
112
+ get<T>(key: string, ...opts: any[]): T | undefined;
113
+ handleRequest(req: any, res$: Observable<any>): Observable<any>;
114
+ flush(): void;
115
+ }
116
+ export interface ODataApiConfigOptions {
81
117
  version?: ODataVersion;
82
118
  params?: {
83
119
  [param: string]: string | string[];
@@ -111,57 +147,23 @@ export interface ApiOptions {
111
147
  jsonBatchFormat?: boolean;
112
148
  relativeUrls?: boolean;
113
149
  }
114
- export interface ParserOptions {
115
- version?: ODataVersion;
116
- exponentialDecimals?: boolean;
117
- metadata?: ODataMetadataType;
118
- ieee754Compatible?: boolean;
119
- streaming?: boolean;
120
- stringAsEnum?: boolean;
121
- deleteRefBy?: 'path' | 'id';
122
- nonParenthesisForEmptyParameterFunction?: boolean;
123
- }
124
- export interface ResponseOptions extends ParserOptions {
125
- cacheability?: CacheCacheability;
126
- maxAge?: number;
127
- }
128
- export interface StructuredTypeFieldOptions extends ParserOptions {
129
- field: StructuredTypeFieldConfig;
130
- }
131
- export interface Parser<T> {
132
- deserialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): T;
133
- serialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
134
- encode(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
135
- }
136
- export interface FieldParser<T> extends Parser<T> {
137
- nullable?: boolean;
138
- default?: any;
139
- maxLength?: number;
140
- precision?: number;
141
- scale?: number | 'variable';
142
- }
143
- export declare const NONE_PARSER: Parser<any>;
144
- export interface Cache {
145
- put<T>(key: string, payload: T, ...opts: any[]): void;
146
- get<T>(key: string, ...opts: any[]): T | undefined;
147
- }
148
- export type ApiConfig = {
150
+ export type ODataApiConfig = {
149
151
  serviceRootUrl: string;
150
152
  metadataUrl?: string;
151
153
  name?: string;
152
154
  version?: ODataVersion;
153
155
  default?: boolean;
154
156
  creation?: Date;
155
- cache?: Cache;
157
+ cache?: ODataCache;
156
158
  errorHandler?: (error: any, caught: Observable<any>) => Observable<never>;
157
- options?: ApiOptions;
159
+ options?: ODataApiConfigOptions;
158
160
  parsers?: {
159
161
  [type: string]: Parser<any>;
160
162
  };
161
- schemas?: SchemaConfig[];
162
- references?: ReferenceConfig[];
163
+ schemas?: ODataSchemaConfig[];
164
+ references?: ODataReferenceConfig[];
163
165
  };
164
- export type AnnotationConfig = {
166
+ export type ODataAnnotationConfig = {
165
167
  term: string;
166
168
  string?: string;
167
169
  bool?: boolean;
@@ -169,48 +171,48 @@ export type AnnotationConfig = {
169
171
  permissions?: string[];
170
172
  properties?: string[];
171
173
  };
172
- export type ReferenceConfig = {
174
+ export type ODataReferenceConfig = {
173
175
  uri: string;
174
176
  includes?: string;
175
- annotations?: AnnotationConfig[];
176
- enums?: EnumTypeConfig[];
177
- entities?: StructuredTypeConfig[];
178
- callables?: CallableConfig[];
179
- containers?: EntityContainerConfig[];
177
+ annotations?: ODataAnnotationConfig[];
178
+ enums?: ODataEnumTypeConfig[];
179
+ entities?: ODataStructuredTypeConfig[];
180
+ callables?: ODataCallableConfig[];
181
+ containers?: ODataEntityContainerConfig[];
180
182
  };
181
- export type SchemaConfig = {
183
+ export type ODataSchemaConfig = {
182
184
  namespace: string;
183
185
  alias?: string;
184
- annotations?: AnnotationConfig[];
185
- enums?: EnumTypeConfig[];
186
- entities?: StructuredTypeConfig[];
187
- callables?: CallableConfig[];
188
- containers?: EntityContainerConfig[];
186
+ annotations?: ODataAnnotationConfig[];
187
+ enums?: ODataEnumTypeConfig[];
188
+ entities?: ODataStructuredTypeConfig[];
189
+ callables?: ODataCallableConfig[];
190
+ containers?: ODataEntityContainerConfig[];
189
191
  };
190
- export type EntityContainerConfig = {
192
+ export type ODataEntityContainerConfig = {
191
193
  name: string;
192
- annotations?: AnnotationConfig[];
193
- entitySets?: EntitySetConfig[];
194
- singletons?: SingletonConfig[];
194
+ annotations?: ODataAnnotationConfig[];
195
+ entitySets?: ODataEntitySetConfig[];
196
+ singletons?: ODataSingletonConfig[];
195
197
  };
196
- export type EnumTypeFieldConfig = {
198
+ export type ODataEnumTypeFieldConfig = {
197
199
  value: number;
198
- annotations?: AnnotationConfig[];
200
+ annotations?: ODataAnnotationConfig[];
199
201
  };
200
- export type EnumTypeConfig = {
202
+ export type ODataEnumTypeConfig = {
201
203
  name: string;
202
204
  flags?: boolean;
203
- annotations?: AnnotationConfig[];
205
+ annotations?: ODataAnnotationConfig[];
204
206
  members: {
205
207
  [name: string]: number;
206
208
  } | {
207
209
  [value: number]: string;
208
210
  };
209
211
  fields: {
210
- [member: string]: EnumTypeFieldConfig;
212
+ [member: string]: ODataEnumTypeFieldConfig;
211
213
  };
212
214
  };
213
- export type StructuredTypeFieldConfig = {
215
+ export type ODataStructuredTypeFieldConfig = {
214
216
  type: string;
215
217
  default?: any;
216
218
  maxLength?: number;
@@ -219,7 +221,7 @@ export type StructuredTypeFieldConfig = {
219
221
  nullable?: boolean;
220
222
  navigation?: boolean;
221
223
  precision?: number;
222
- annotations?: AnnotationConfig[];
224
+ annotations?: ODataAnnotationConfig[];
223
225
  scale?: number | 'variable';
224
226
  referentials?: {
225
227
  property: string;
@@ -228,7 +230,7 @@ export type StructuredTypeFieldConfig = {
228
230
  referential?: string;
229
231
  referenced?: string;
230
232
  };
231
- export type StructuredTypeConfig = {
233
+ export type ODataStructuredTypeConfig = {
232
234
  name: string;
233
235
  base?: string;
234
236
  open?: boolean;
@@ -238,46 +240,46 @@ export type StructuredTypeConfig = {
238
240
  collection?: {
239
241
  new (...params: any[]): any;
240
242
  };
241
- annotations?: AnnotationConfig[];
243
+ annotations?: ODataAnnotationConfig[];
242
244
  keys?: {
243
245
  name: string;
244
246
  alias?: string;
245
247
  }[];
246
248
  fields?: {
247
- [name: string]: StructuredTypeFieldConfig;
249
+ [name: string]: ODataStructuredTypeFieldConfig;
248
250
  };
249
251
  };
250
- export type ParameterConfig = {
252
+ export type ODataParameterConfig = {
251
253
  type: string;
252
254
  nullable?: boolean;
253
255
  collection?: boolean;
254
256
  };
255
- export type CallableConfig = {
257
+ export type ODataCallableConfig = {
256
258
  name: string;
257
259
  entitySetPath?: string;
258
260
  bound?: boolean;
259
261
  composable?: boolean;
260
262
  parameters?: {
261
- [name: string]: ParameterConfig;
263
+ [name: string]: ODataParameterConfig;
262
264
  };
263
265
  return?: {
264
266
  type: string;
265
267
  collection?: boolean;
266
268
  };
267
269
  };
268
- export type EntitySetConfig = {
270
+ export type ODataEntitySetConfig = {
269
271
  name: string;
270
272
  entityType: string;
271
273
  service: {
272
274
  new (...params: any[]): any;
273
275
  };
274
- annotations?: AnnotationConfig[];
276
+ annotations?: ODataAnnotationConfig[];
275
277
  };
276
- export type SingletonConfig = {
278
+ export type ODataSingletonConfig = {
277
279
  name: string;
278
280
  type: string;
279
281
  service: {
280
282
  new (...params: any[]): any;
281
283
  };
282
- annotations?: AnnotationConfig[];
284
+ annotations?: ODataAnnotationConfig[];
283
285
  };
@@ -1,4 +1,4 @@
1
- import { CallableConfig } from '../types';
1
+ import { ODataCallableConfig } from '../types';
2
2
  export declare const OData: {
3
- mergeCallableParameters(callables: CallableConfig[]): CallableConfig[];
3
+ mergeCallableParameters(callables: ODataCallableConfig[]): ODataCallableConfig[];
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.130.0",
3
+ "version": "0.131.0",
4
4
  "license": "MIT",
5
5
  "description": "Client side OData typescript library for Angular",
6
6
  "repository": {
@@ -25,8 +25,8 @@
25
25
  "homepage": "https://github.com/diegomvh/angular-odata",
26
26
  "private": false,
27
27
  "peerDependencies": {
28
- "@angular/common": ">=14.0.0",
29
- "@angular/core": ">=14.0.0"
28
+ "@angular/common": ">=16.0.0",
29
+ "@angular/core": ">=16.0.0"
30
30
  },
31
31
  "schematics": "./schematics/collection.json",
32
32
  "ng-add": {
@@ -44,8 +44,6 @@
44
44
  },
45
45
  ".": {
46
46
  "types": "./index.d.ts",
47
- "esm2022": "./esm2022/angular-odata.mjs",
48
- "esm": "./esm2022/angular-odata.mjs",
49
47
  "default": "./fesm2022/angular-odata.mjs"
50
48
  }
51
49
  }
@@ -1,11 +1,11 @@
1
- import { ApiConfig, EDM_PARSERS, ODataMetadata, ODataVersion } from 'angular-odata';
1
+ import { ODataApiConfig, EDM_PARSERS, ODataMetadata, ODataVersion } from 'angular-odata';
2
2
  import * as json from './metadata.json';
3
3
 
4
4
  export const <%= classify(name) %> = ODataMetadata.fromJson(json).toConfig({
5
- serviceRootUrl: '<%= serviceRootUrl %>',
6
- metadataUrl: '<%= metadataUrl %>',
5
+ serviceRootUrl: '<%= serviceRootUrl %>',
6
+ metadataUrl: '<%= metadataUrl %>',
7
7
  name: '<%= apiConfigName %>',
8
8
  version: '<%= version %>' as ODataVersion,
9
9
  creation: new Date('<%= creation.toISOString() %>'),
10
10
  parsers: EDM_PARSERS
11
- }) as ApiConfig;
11
+ }) as ODataApiConfig;
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci1vZGF0YS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2FuZ3VsYXItb2RhdGEvc3JjL2FuZ3VsYXItb2RhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==