angular-odata 0.100.1 → 0.102.5

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 (88) hide show
  1. package/esm2020/lib/api.mjs +84 -64
  2. package/esm2020/lib/cache/cache.mjs +56 -4
  3. package/esm2020/lib/cache/memory.mjs +16 -6
  4. package/esm2020/lib/cache/storage.mjs +23 -4
  5. package/esm2020/lib/client.mjs +3 -3
  6. package/esm2020/lib/constants.mjs +2 -1
  7. package/esm2020/lib/models/collection.mjs +103 -43
  8. package/esm2020/lib/models/model.mjs +17 -4
  9. package/esm2020/lib/models/options.mjs +200 -122
  10. package/esm2020/lib/module.mjs +5 -5
  11. package/esm2020/lib/options.mjs +3 -8
  12. package/esm2020/lib/resources/query/builder.mjs +1 -1
  13. package/esm2020/lib/resources/query/expressions/compute.mjs +5 -5
  14. package/esm2020/lib/resources/query/expressions/expand.mjs +6 -6
  15. package/esm2020/lib/resources/query/expressions/filter.mjs +9 -9
  16. package/esm2020/lib/resources/query/expressions/index.mjs +3 -1
  17. package/esm2020/lib/resources/query/expressions/orderby.mjs +5 -5
  18. package/esm2020/lib/resources/query/expressions/search.mjs +3 -3
  19. package/esm2020/lib/resources/query/expressions/select.mjs +7 -7
  20. package/esm2020/lib/resources/query/expressions/syntax.mjs +1 -1
  21. package/esm2020/lib/resources/query/handlers.mjs +208 -22
  22. package/esm2020/lib/resources/query/options.mjs +16 -13
  23. package/esm2020/lib/resources/request.mjs +31 -36
  24. package/esm2020/lib/resources/resource.mjs +27 -11
  25. package/esm2020/lib/resources/responses/annotations.mjs +1 -1
  26. package/esm2020/lib/resources/responses/metadata.mjs +1 -1
  27. package/esm2020/lib/resources/responses/options.mjs +1 -1
  28. package/esm2020/lib/resources/responses/response.mjs +2 -2
  29. package/esm2020/lib/resources/types/batch.mjs +108 -97
  30. package/esm2020/lib/resources/types/navigation-property.mjs +5 -3
  31. package/esm2020/lib/resources/types/options.mjs +1 -1
  32. package/esm2020/lib/resources/types/property.mjs +4 -4
  33. package/esm2020/lib/schema/callable.mjs +3 -3
  34. package/esm2020/lib/schema/enum-type.mjs +13 -26
  35. package/esm2020/lib/schema/parsers/callable.mjs +15 -20
  36. package/esm2020/lib/schema/parsers/enum-type.mjs +35 -18
  37. package/esm2020/lib/schema/parsers/structured-type.mjs +132 -66
  38. package/esm2020/lib/schema/structured-type.mjs +31 -39
  39. package/esm2020/lib/services/base.mjs +1 -1
  40. package/esm2020/lib/services/factory.mjs +3 -3
  41. package/esm2020/lib/types.mjs +1 -1
  42. package/esm2020/lib/utils/arrays.mjs +10 -0
  43. package/esm2020/lib/utils/enums.mjs +3 -3
  44. package/esm2020/lib/utils/objects.mjs +11 -6
  45. package/esm2020/lib/utils/types.mjs +6 -7
  46. package/fesm2015/angular-odata.mjs +3451 -2918
  47. package/fesm2015/angular-odata.mjs.map +1 -1
  48. package/fesm2020/angular-odata.mjs +3454 -2919
  49. package/fesm2020/angular-odata.mjs.map +1 -1
  50. package/{angular-odata.d.ts → index.d.ts} +0 -0
  51. package/lib/api.d.ts +2 -4
  52. package/lib/cache/cache.d.ts +62 -1
  53. package/lib/cache/memory.d.ts +10 -0
  54. package/lib/cache/storage.d.ts +19 -0
  55. package/lib/constants.d.ts +1 -0
  56. package/lib/models/collection.d.ts +14 -9
  57. package/lib/models/model.d.ts +10 -7
  58. package/lib/models/options.d.ts +31 -22
  59. package/lib/options.d.ts +3 -7
  60. package/lib/resources/query/builder.d.ts +1 -1
  61. package/lib/resources/query/expressions/compute.d.ts +7 -6
  62. package/lib/resources/query/expressions/expand.d.ts +17 -32
  63. package/lib/resources/query/expressions/filter.d.ts +11 -10
  64. package/lib/resources/query/expressions/index.d.ts +2 -0
  65. package/lib/resources/query/expressions/orderby.d.ts +7 -6
  66. package/lib/resources/query/expressions/search.d.ts +5 -4
  67. package/lib/resources/query/expressions/select.d.ts +7 -6
  68. package/lib/resources/query/handlers.d.ts +158 -33
  69. package/lib/resources/query/options.d.ts +14 -12
  70. package/lib/resources/request.d.ts +2 -1
  71. package/lib/resources/resource.d.ts +7 -6
  72. package/lib/resources/responses/options.d.ts +2 -2
  73. package/lib/resources/types/batch.d.ts +8 -11
  74. package/lib/resources/types/options.d.ts +4 -2
  75. package/lib/schema/callable.d.ts +4 -4
  76. package/lib/schema/enum-type.d.ts +11 -23
  77. package/lib/schema/parsers/callable.d.ts +11 -10
  78. package/lib/schema/parsers/enum-type.d.ts +22 -14
  79. package/lib/schema/parsers/structured-type.d.ts +58 -14
  80. package/lib/schema/structured-type.d.ts +23 -23
  81. package/lib/services/base.d.ts +9 -9
  82. package/lib/types.d.ts +11 -13
  83. package/lib/utils/arrays.d.ts +3 -0
  84. package/lib/utils/enums.d.ts +2 -2
  85. package/lib/utils/objects.d.ts +1 -1
  86. package/lib/utils/strings.d.ts +1 -1
  87. package/lib/utils/types.d.ts +1 -1
  88. package/package.json +5 -5
@@ -1,25 +1,25 @@
1
- import { EnumTypeConfig, EnumTypeFieldConfig, OptionsHelper, Parser } from '../../types';
1
+ import { EnumTypeConfig, EnumTypeFieldConfig, ParserOptions, Parser } from '../../types';
2
2
  import { ODataAnnotatable } from '../annotation';
3
- export declare class ODataEnumTypeFieldParser extends ODataAnnotatable {
3
+ export declare class ODataEnumTypeFieldParser<E> extends ODataAnnotatable {
4
4
  name: string;
5
- value: number;
6
- constructor(name: string, field: EnumTypeFieldConfig);
5
+ value: E;
6
+ constructor(name: string, field: EnumTypeFieldConfig<E>);
7
7
  titleize(term?: string | RegExp): string;
8
8
  }
9
- export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements Parser<T> {
9
+ export declare class ODataEnumTypeParser<E> extends ODataAnnotatable implements Parser<E> {
10
10
  name: string;
11
11
  namespace: string;
12
12
  alias?: string;
13
13
  flags?: boolean;
14
14
  members: {
15
- [name: string]: number;
15
+ [name: string]: E;
16
16
  } | {
17
17
  [value: number]: string;
18
18
  };
19
- fields: ODataEnumTypeFieldParser[];
19
+ private _fields;
20
20
  stringAsEnum?: boolean;
21
- optionsHelper?: OptionsHelper;
22
- constructor(config: EnumTypeConfig<T>, namespace: string, alias?: string);
21
+ parserOptions?: ParserOptions;
22
+ constructor(config: EnumTypeConfig<E>, namespace: string, alias?: string);
23
23
  /**
24
24
  * Create a nicer looking title.
25
25
  * Titleize is meant for creating pretty output.
@@ -27,14 +27,22 @@ export declare class ODataEnumTypeParser<T> extends ODataAnnotatable implements
27
27
  * @returns The titleized string.
28
28
  */
29
29
  ttitelize(term?: string | RegExp): string;
30
- configure({ stringAsEnum, options }: {
30
+ configure({ stringAsEnum, options, }: {
31
31
  stringAsEnum: boolean;
32
- options: OptionsHelper;
32
+ options: ParserOptions;
33
33
  }): void;
34
34
  isTypeOf(type: string): boolean;
35
- deserialize(value: string, options?: OptionsHelper): T;
36
- serialize(value: T, options?: OptionsHelper): string;
37
- encode(value: T, options?: OptionsHelper): any;
35
+ fields(value?: E): ODataEnumTypeFieldParser<E>[];
36
+ field(nameValue: string | E): ODataEnumTypeFieldParser<E>;
37
+ /**
38
+ * Map the fields of the enum type.
39
+ * @param mapper Function that maps the value to the new value
40
+ * @returns The fields mapped by the mapper
41
+ */
42
+ mapFields<R>(mapper: (field: ODataEnumTypeFieldParser<E>) => R): R[];
43
+ deserialize(value: string, options?: ParserOptions): E;
44
+ serialize(value: E, options?: ParserOptions): string | undefined;
45
+ encode(value: E, options?: ParserOptions): any;
38
46
  toJsonSchema(): any;
39
47
  validate(member: string | number, { method, navigation, }?: {
40
48
  method?: 'create' | 'update' | 'modify';
@@ -1,4 +1,4 @@
1
- import { OptionsHelper, Parser, StructuredTypeConfig, StructuredTypeFieldConfig } from '../../types';
1
+ import { ParserOptions, Parser, StructuredTypeConfig, StructuredTypeFieldConfig } from '../../types';
2
2
  import { ODataAnnotatable } from '../annotation';
3
3
  import { ODataEnumTypeParser } from './enum-type';
4
4
  declare type JsonSchemaSelect<T> = Array<keyof T>;
@@ -46,7 +46,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
46
46
  precision?: number;
47
47
  scale?: number;
48
48
  referentials: ODataReferential[];
49
- optionsHelper?: OptionsHelper;
49
+ parserOptions?: ParserOptions;
50
50
  constructor(name: string, structuredType: ODataStructuredTypeParser<any>, field: StructuredTypeFieldConfig);
51
51
  validate(value: any, { method, navigation, }?: {
52
52
  method?: 'create' | 'update' | 'modify';
@@ -57,13 +57,13 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
57
57
  [name: string]: any;
58
58
  }[] | string[] | undefined;
59
59
  private parse;
60
- deserialize(value: any, options?: OptionsHelper): T;
60
+ deserialize(value: any, options?: ParserOptions): T;
61
61
  private toJson;
62
- serialize(value: T, options?: OptionsHelper): any;
63
- encode(value: T, options?: OptionsHelper): string;
62
+ serialize(value: T, options?: ParserOptions): any;
63
+ encode(value: T, options?: ParserOptions): string;
64
64
  configure({ parserForType, options, }: {
65
65
  parserForType: (type: string) => Parser<any>;
66
- options: OptionsHelper;
66
+ options: ParserOptions;
67
67
  }): void;
68
68
  toJsonSchema(options?: JsonSchemaOptions<T>): any;
69
69
  isKey(): boolean;
@@ -73,6 +73,7 @@ export declare class ODataStructuredTypeFieldParser<T> extends ODataAnnotatable
73
73
  enum(): ODataEnumTypeParser<T>;
74
74
  isStructuredType(): boolean;
75
75
  structured(): ODataStructuredTypeParser<T>;
76
+ field<F>(name: string): ODataStructuredTypeFieldParser<F>;
76
77
  }
77
78
  export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable implements Parser<T> {
78
79
  name: string;
@@ -82,9 +83,9 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
82
83
  alias?: string;
83
84
  base?: string;
84
85
  parent?: ODataStructuredTypeParser<any>;
85
- keys?: ODataEntityTypeKey[];
86
- fields: ODataStructuredTypeFieldParser<any>[];
87
- optionsHelper?: OptionsHelper;
86
+ private _keys?;
87
+ private _fields;
88
+ parserOptions?: ParserOptions;
88
89
  constructor(config: StructuredTypeConfig<T>, namespace: string, alias?: string);
89
90
  /**
90
91
  * Create a nicer looking title.
@@ -97,14 +98,57 @@ export declare class ODataStructuredTypeParser<T> extends ODataAnnotatable imple
97
98
  isSubtypeOf(type: string): boolean;
98
99
  findChildParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): ODataStructuredTypeParser<any> | undefined;
99
100
  childParser(predicate: (p: ODataStructuredTypeParser<any>) => boolean): Parser<any>;
100
- deserialize(value: any, options?: OptionsHelper): T;
101
- serialize(value: T, options?: OptionsHelper): any;
102
- encode(value: T, options?: OptionsHelper): any;
101
+ deserialize(value: any, options?: ParserOptions): T;
102
+ serialize(value: T, options?: ParserOptions): any;
103
+ encode(value: T, options?: ParserOptions): any;
103
104
  configure({ parserForType, options, }: {
104
105
  parserForType: (type: string) => Parser<any>;
105
- options: OptionsHelper;
106
+ options: ParserOptions;
106
107
  }): void;
107
- resolveKey(value: any): any;
108
+ /**
109
+ * Returns all fields of the structured type.
110
+ * @param include_navigation Include navigation properties in the result.
111
+ * @param include_parents Include the parent types in the result.
112
+ * @returns All fields of the structured type.
113
+ */
114
+ fields({ include_navigation, include_parents, }: {
115
+ include_parents: boolean;
116
+ include_navigation: boolean;
117
+ }): ODataStructuredTypeFieldParser<any>[];
118
+ /**
119
+ * Returns the keys of the structured type.
120
+ * @param include_parents Include the parent fields
121
+ * @returns The keys of the structured type
122
+ */
123
+ keys({ include_parents, }: {
124
+ include_parents: boolean;
125
+ }): ODataEntityTypeKey[];
126
+ /**
127
+ * Find the field parser for the given field name.
128
+ * @param name Name of the field
129
+ * @returns The field parser
130
+ */
131
+ field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
132
+ /**
133
+ * Picks the fields from attributes.
134
+ * @param attrs
135
+ * @param include_parents Include the parent fields
136
+ * @param include_navigation Include the navigation fields
137
+ * @param include_etag Include the etag field
138
+ * @returns The picked fields
139
+ */
140
+ pick(attrs: {
141
+ [name: string]: any;
142
+ }, { include_parents, include_navigation, include_etag, options, }?: {
143
+ include_parents?: boolean;
144
+ include_navigation?: boolean;
145
+ include_etag?: boolean;
146
+ options?: ParserOptions;
147
+ }): Partial<T>;
148
+ resolveKey(value: any, { resolve, single, }?: {
149
+ resolve?: boolean;
150
+ single?: boolean;
151
+ }): any;
108
152
  defaults(): {
109
153
  [name: string]: any;
110
154
  };
@@ -1,6 +1,6 @@
1
1
  import { ODataCollection } from '../models';
2
2
  import { ODataModel } from '../models/model';
3
- import { OptionsHelper, StructuredTypeConfig } from '../types';
3
+ import { ParserOptions, StructuredTypeConfig } from '../types';
4
4
  import { ODataSchemaElement } from './element';
5
5
  import { JsonSchemaOptions, ODataEntityTypeKey, ODataStructuredTypeFieldParser, ODataStructuredTypeParser } from './parsers';
6
6
  import { ODataSchema } from './schema';
@@ -44,7 +44,7 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
44
44
  * @param name Name of the field
45
45
  * @returns The field parser
46
46
  */
47
- findFieldByName<F>(name: keyof T): ODataStructuredTypeFieldParser<F> | undefined;
47
+ field<F>(name: keyof T): ODataStructuredTypeFieldParser<F>;
48
48
  /**
49
49
  * Find a parent schema of the structured type.
50
50
  * @param predicate Function for evaluate the schemas in the hierarchy.
@@ -57,24 +57,6 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
57
57
  * @returns The schema of the field
58
58
  */
59
59
  findSchemaForField<E>(field: ODataStructuredTypeFieldParser<any>): ODataStructuredType<E>;
60
- /**
61
- * Returns all fields of the structured type.
62
- * @param include_navigation Include navigation properties in the result.
63
- * @param include_parents Include the parent types in the result.
64
- * @returns All fields of the structured type.
65
- */
66
- fields({ include_navigation, include_parents, }: {
67
- include_parents: boolean;
68
- include_navigation: boolean;
69
- }): ODataStructuredTypeFieldParser<any>[];
70
- /**
71
- * Returns the keys of the structured type.
72
- * @param include_parents Include the parent fields
73
- * @returns The keys of the structured type
74
- */
75
- keys({ include_parents, }?: {
76
- include_parents?: boolean;
77
- }): ODataEntityTypeKey[];
78
60
  /**
79
61
  * Picks the fields from attributes.
80
62
  * @param attrs
@@ -96,21 +78,39 @@ export declare class ODataStructuredType<T> extends ODataSchemaElement {
96
78
  * @param options Options for deserialization
97
79
  * @returns Deserialized value
98
80
  */
99
- deserialize(value: any, options?: OptionsHelper): T;
81
+ deserialize(value: any, options?: ParserOptions): T;
100
82
  /**
101
83
  * Serialize the given value for the structured type.
102
84
  * @param value Value to serialize
103
85
  * @param options Options for serialization
104
86
  * @returns Serialized value
105
87
  */
106
- serialize(value: T, options?: OptionsHelper): any;
88
+ serialize(value: T, options?: ParserOptions): any;
107
89
  /**
108
90
  * Encode the given value for the structured type.
109
91
  * @param value Value to encode
110
92
  * @param options Options for encoding
111
93
  * @returns Encoded value
112
94
  */
113
- encode(value: T, options?: OptionsHelper): any;
95
+ encode(value: T, options?: ParserOptions): any;
96
+ /**
97
+ * Returns all fields of the structured type.
98
+ * @param include_navigation Include navigation properties in the result.
99
+ * @param include_parents Include the parent types in the result.
100
+ * @returns All fields of the structured type.
101
+ */
102
+ fields({ include_navigation, include_parents, }: {
103
+ include_parents: boolean;
104
+ include_navigation: boolean;
105
+ }): ODataStructuredTypeFieldParser<any>[];
106
+ /**
107
+ * Returns the keys of the structured type.
108
+ * @param include_parents Include the parent fields
109
+ * @returns The keys of the structured type
110
+ */
111
+ keys({ include_parents, }?: {
112
+ include_parents?: boolean;
113
+ }): ODataEntityTypeKey[];
114
114
  /**
115
115
  * Resolve the key of the structured type for the given value.
116
116
  * @param attrs Attributes of the value
@@ -1,20 +1,20 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ODataClient } from '../client';
3
- import { ODataActionResource, ODataEntities, ODataEntity, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
3
+ import { ODataActionOptions, ODataActionResource, ODataEntities, ODataEntity, ODataFunctionOptions, ODataFunctionResource, ODataNavigationPropertyResource, ODataProperty, ODataQueryArgumentsOptions } from '../resources';
4
4
  export declare abstract class ODataBaseService {
5
5
  protected client: ODataClient;
6
6
  protected name: string;
7
7
  protected apiNameOrEntityType?: string | undefined;
8
8
  constructor(client: ODataClient, name: string, apiNameOrEntityType?: string | undefined);
9
9
  get api(): import("angular-odata").ODataApi;
10
- protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entity', options?: ODataQueryArgumentsOptions<R>): Observable<ODataEntity<R>>;
11
- protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entities', options?: ODataQueryArgumentsOptions<R>): Observable<ODataEntities<R>>;
12
- protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'property', options?: ODataQueryArgumentsOptions<R>): Observable<ODataProperty<R>>;
13
- protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'none', options?: ODataQueryArgumentsOptions<R>): Observable<null>;
14
- protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entity', options?: ODataQueryArgumentsOptions<R>): Observable<ODataEntity<R>>;
15
- protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entities', options?: ODataQueryArgumentsOptions<R>): Observable<ODataEntities<R>>;
16
- protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'property', options?: ODataQueryArgumentsOptions<R>): Observable<ODataProperty<R>>;
17
- protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'none', options?: ODataQueryArgumentsOptions<R>): Observable<null>;
10
+ protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entity', options?: ODataFunctionOptions<R>): Observable<ODataEntity<R>>;
11
+ protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'entities', options?: ODataFunctionOptions<R>): Observable<ODataEntities<R>>;
12
+ protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'property', options?: ODataFunctionOptions<R>): Observable<ODataProperty<R>>;
13
+ protected callFunction<P, R>(params: P | null, resource: ODataFunctionResource<P, R>, responseType: 'none', options?: ODataFunctionOptions<R>): Observable<null>;
14
+ protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entity', options?: ODataActionOptions<R>): Observable<ODataEntity<R>>;
15
+ protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'entities', options?: ODataActionOptions<R>): Observable<ODataEntities<R>>;
16
+ protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'property', options?: ODataActionOptions<R>): Observable<ODataProperty<R>>;
17
+ protected callAction<P, R>(params: P | null, resource: ODataActionResource<P, R>, responseType: 'none', options?: ODataActionOptions<R>): Observable<null>;
18
18
  protected fetchNavigationProperty<S>(resource: ODataNavigationPropertyResource<S>, responseType: 'entity', options?: ODataQueryArgumentsOptions<S>): Observable<ODataEntity<S>>;
19
19
  protected fetchNavigationProperty<S>(resource: ODataNavigationPropertyResource<S>, responseType: 'entities', options?: ODataQueryArgumentsOptions<S>): Observable<ODataEntities<S>>;
20
20
  }
package/lib/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { ODataVersionHelper } from './helper';
2
1
  import { Observable } from 'rxjs';
3
2
  export declare type ODataVersion = '2.0' | '3.0' | '4.0';
4
3
  export declare type FetchPolicy = 'cache-first' | 'cache-and-network' | 'network-only' | 'no-cache' | 'cache-only';
@@ -65,25 +64,24 @@ export interface ApiOptions {
65
64
  deleteRefBy?: 'path' | 'id';
66
65
  nonParenthesisForEmptyParameterFunction?: boolean;
67
66
  }
68
- export interface OptionsHelper {
67
+ export interface ParserOptions {
69
68
  version?: ODataVersion;
70
- helper: ODataVersionHelper;
71
69
  exponentialDecimals?: boolean;
72
70
  metadata?: ODataMetadataType;
73
71
  ieee754Compatible?: boolean;
74
72
  streaming?: boolean;
75
73
  }
76
- export interface ResponseOptions extends OptionsHelper {
74
+ export interface ResponseOptions extends ParserOptions {
77
75
  cacheability?: CacheCacheability;
78
76
  maxAge?: number;
79
77
  }
80
- export interface StructuredTypeFieldOptions extends OptionsHelper {
78
+ export interface StructuredTypeFieldOptions extends ParserOptions {
81
79
  field: StructuredTypeFieldConfig;
82
80
  }
83
81
  export interface Parser<T> {
84
- deserialize(value: any, options?: OptionsHelper | StructuredTypeFieldOptions): T;
85
- serialize(value: any, options?: OptionsHelper | StructuredTypeFieldOptions): any;
86
- encode(value: any, options?: OptionsHelper | StructuredTypeFieldOptions): any;
82
+ deserialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): T;
83
+ serialize(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
84
+ encode(value: any, options?: ParserOptions | StructuredTypeFieldOptions): any;
87
85
  }
88
86
  export declare const NONE_PARSER: Parser<any>;
89
87
  export interface Cache {
@@ -126,21 +124,21 @@ export declare type EntityContainerConfig = {
126
124
  annotations?: AnnotationConfig[];
127
125
  entitySets?: EntitySetConfig[];
128
126
  };
129
- export declare type EnumTypeFieldConfig = {
130
- value: number;
127
+ export declare type EnumTypeFieldConfig<E> = {
128
+ value: E;
131
129
  annotations?: AnnotationConfig[];
132
130
  };
133
- export declare type EnumTypeConfig<T> = {
131
+ export declare type EnumTypeConfig<E> = {
134
132
  name: string;
135
133
  flags?: boolean;
136
134
  annotations?: AnnotationConfig[];
137
135
  members: {
138
- [name: string]: number;
136
+ [name: string]: E;
139
137
  } | {
140
138
  [value: number]: string;
141
139
  };
142
140
  fields: {
143
- [member: string]: EnumTypeFieldConfig;
141
+ [member: string]: EnumTypeFieldConfig<E>;
144
142
  };
145
143
  };
146
144
  export declare type StructuredTypeFieldConfig = {
@@ -0,0 +1,3 @@
1
+ export declare const Arrays: {
2
+ zip: (...arrays: any[][]) => any[][];
3
+ };
@@ -1,8 +1,8 @@
1
1
  export declare const Enums: {
2
2
  names<E>(Enum: E): string[];
3
3
  values<E_1>(Enum: E_1): number[];
4
- toValue<E_2>(Enum: E_2, value: any): number;
4
+ toValue<E_2>(Enum: E_2, value: any): number | undefined;
5
5
  toValues<E_3>(Enum: E_3, value: any): number[];
6
- toName<E_4>(Enum: E_4, value: any): string;
6
+ toName<E_4>(Enum: E_4, value: any): string | undefined;
7
7
  toNames<E_5>(Enum: E_5, value: any): string[];
8
8
  };
@@ -19,5 +19,5 @@ export declare const Objects: {
19
19
  resolveKey(key: any, { single }?: {
20
20
  single?: boolean | undefined;
21
21
  }): any;
22
- clone(target: any, map?: WeakMap<object, any> | undefined): any;
22
+ clone(target: any, map?: WeakMap<object, any>): any;
23
23
  };
@@ -1,4 +1,4 @@
1
1
  export declare const Strings: {
2
- uniqueId(prefix?: string | undefined, suffix?: string | undefined): string;
2
+ uniqueId(prefix?: string, suffix?: string): string;
3
3
  titleCase(text: string): string;
4
4
  };
@@ -1,9 +1,9 @@
1
1
  export declare const Types: {
2
2
  rawType(value: any): string;
3
- isObject(value: any): boolean;
4
3
  isPlainObject(value: any): boolean;
5
4
  isFunction(value: any): boolean;
6
5
  isArray(value: any): boolean;
6
+ isMap(value: any): boolean;
7
7
  isEmpty(value: any): boolean;
8
8
  isEqual(value1: any, value2: any): boolean;
9
9
  clone(target: any): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.100.1",
3
+ "version": "0.102.5",
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": "^13.3.0",
29
- "@angular/core": "^13.3.0"
28
+ "@angular/common": ">=13.0.0",
29
+ "@angular/core": ">=13.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0"
@@ -36,13 +36,13 @@
36
36
  "esm2020": "esm2020/angular-odata.mjs",
37
37
  "fesm2020": "fesm2020/angular-odata.mjs",
38
38
  "fesm2015": "fesm2015/angular-odata.mjs",
39
- "typings": "angular-odata.d.ts",
39
+ "typings": "index.d.ts",
40
40
  "exports": {
41
41
  "./package.json": {
42
42
  "default": "./package.json"
43
43
  },
44
44
  ".": {
45
- "types": "./angular-odata.d.ts",
45
+ "types": "./index.d.ts",
46
46
  "esm2020": "./esm2020/angular-odata.mjs",
47
47
  "es2020": "./fesm2020/angular-odata.mjs",
48
48
  "es2015": "./fesm2015/angular-odata.mjs",