angular-odata 0.100.0 → 0.100.1

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.
package/lib/helper.d.ts CHANGED
@@ -17,81 +17,52 @@ export interface ODataVersionHelper {
17
17
  ODATA_ANNOTATION_PREFIX: string;
18
18
  ODATA_FUNCTION_PREFIX: string;
19
19
  ODATA_ID: string;
20
+ ODATA_TYPE: string;
20
21
  ODATA_COUNT: string;
21
22
  ODATA_ETAG: string;
22
23
  ODATA_CONTEXT: string;
23
24
  ODATA_MEDIA_ETAG: string;
24
25
  entity(value: {
25
- [name: string]: any;
26
+ [key: string]: any;
26
27
  }): any;
27
28
  entities(value: {
28
- [name: string]: any;
29
+ [key: string]: any;
29
30
  }): any;
30
31
  property(value: {
31
- [name: string]: any;
32
+ [key: string]: any;
32
33
  }): any;
33
34
  annotations(value: {
34
- [name: string]: any;
35
- }): {
36
- [name: string]: any;
37
- };
35
+ [key: string]: any;
36
+ }): Map<string, any>;
38
37
  attributes(value: {
39
- [name: string]: any;
38
+ [key: string]: any;
40
39
  }, metadata: ODataMetadataType): any;
41
- id(value: {
42
- [name: string]: any;
43
- }, id?: string): string | undefined;
44
- etag(value: {
45
- [name: string]: any;
46
- }, etag?: string): string | undefined;
47
- type(value: {
48
- [name: string]: any;
49
- }, type?: string): string | undefined;
50
- count(value: {
51
- [name: string]: any;
52
- }): number | undefined;
53
- context(value: {
54
- [name: string]: any;
40
+ context(annots: Map<string, any> | {
41
+ [key: string]: any;
55
42
  }): ODataContext;
56
- functions(value: {
57
- [name: string]: any;
58
- }): {
59
- [name: string]: any;
60
- };
61
- properties(value: {
62
- [name: string]: any;
63
- }): {
64
- [name: string]: any;
65
- };
66
- mediaEtag(value: {
67
- [name: string]: any;
68
- }): string | undefined;
69
- metadataEtag(value: {
70
- [name: string]: any;
71
- }): string | undefined;
72
- nextLink(value: {
73
- [name: string]: any;
74
- }): string | undefined;
75
- readLink(value: {
76
- [name: string]: any;
77
- }): string | undefined;
78
- mediaReadLink(value: {
79
- [name: string]: any;
80
- }): string | undefined;
81
- editLink(value: {
82
- [name: string]: any;
83
- }): string | undefined;
84
- mediaEditLink(value: {
85
- [name: string]: any;
43
+ id(annots: Map<string, any> | {
44
+ [key: string]: any;
86
45
  }): string | undefined;
87
- mediaContentType(value: {
88
- [name: string]: any;
46
+ etag(annots: Map<string, any> | {
47
+ [key: string]: any;
89
48
  }): string | undefined;
90
- deltaLink(value: {
91
- [name: string]: any;
49
+ type(annots: Map<string, any> | {
50
+ [key: string]: any;
92
51
  }): string | undefined;
52
+ count(annots: Map<string, any>): number | undefined;
53
+ functions(annots: Map<string, any>): Map<string, any>;
54
+ properties(annots: Map<string, any>): Map<string, Map<string, any>>;
55
+ mediaEtag(annots: Map<string, any>): string | undefined;
56
+ metadataEtag(annots: Map<string, any>): string | undefined;
57
+ nextLink(annots: Map<string, any>): string | undefined;
58
+ readLink(annots: Map<string, any>): string | undefined;
59
+ mediaReadLink(annots: Map<string, any>): string | undefined;
60
+ editLink(annots: Map<string, any>): string | undefined;
61
+ mediaEditLink(annots: Map<string, any>): string | undefined;
62
+ mediaContentType(annots: Map<string, any>): string | undefined;
63
+ deltaLink(annots: Map<string, any>): string | undefined;
93
64
  countParam(): {
94
- [name: string]: string;
65
+ [key: string]: string;
95
66
  };
96
67
  }
97
68
  export declare const ODataHelper: {
@@ -15,15 +15,9 @@ export declare class ODataModel<T> {
15
15
  ODataModel<any> | ODataCollection<any, ODataModel<any>>,
16
16
  ODataModelField<any> | null
17
17
  ] | null;
18
- _attributes: {
19
- [name: string]: any;
20
- };
21
- _changes: {
22
- [name: string]: any;
23
- };
24
- _relations: {
25
- [name: string]: ODataModelRelation<any>;
26
- };
18
+ _attributes: Map<string, any>;
19
+ _changes: Map<string, any>;
20
+ _relations: Map<string, ODataModelRelation<any>>;
27
21
  _resource: ODataResource<T> | null;
28
22
  _annotations: ODataEntityAnnotations;
29
23
  _reset: boolean;
@@ -91,7 +91,7 @@ export default function <T>({ select, search, skiptoken, format, top, skip, filt
91
91
  export declare function buildPathAndQuery<T>({ select, search, skiptoken, format, top, skip, filter, transform, orderBy, key, count, expand, action, func, aliases, escape, }?: Partial<QueryOptions<T>>): [string, {
92
92
  [name: string]: any;
93
93
  }];
94
- export declare function normalizeValue(value: Value, { aliases, escape }: {
94
+ export declare function normalizeValue(value: Value, { aliases, escape, }?: {
95
95
  aliases?: QueryCustomType[];
96
96
  escape?: boolean;
97
97
  }): any;
@@ -7,9 +7,7 @@ import type { ODataQueryArguments, ODataQueryOptions } from './options';
7
7
  export declare class ODataQueryOptionHandler<T> {
8
8
  private o;
9
9
  private n;
10
- constructor(o: {
11
- [name: string]: any;
12
- }, n: QueryOptionNames);
10
+ constructor(o: Map<QueryOptionNames, any>, n: QueryOptionNames);
13
11
  get name(): QueryOptionNames;
14
12
  toJSON(): any;
15
13
  empty(): boolean;
@@ -39,6 +37,12 @@ export declare class ODataQueryOptionsHandler<T> {
39
37
  * @returns The alias
40
38
  */
41
39
  alias(value: any, name?: string): import("./builder").QueryCustomType;
40
+ /**
41
+ * Normalize the given value to a valid odata value
42
+ * @param value The value to normalize
43
+ * @returns The normalized value
44
+ */
45
+ normalize(value: any): any;
42
46
  select(opts: (builder: {
43
47
  s: T;
44
48
  e: () => SelectExpression<T>;
@@ -18,10 +18,8 @@ export declare type ODataQueryArguments<T> = {
18
18
  [QueryOptionNames.format]?: string;
19
19
  };
20
20
  export declare class ODataQueryOptions<T> {
21
- values: {
22
- [name: string]: any;
23
- };
24
- constructor(options?: {
21
+ values: Map<QueryOptionNames, any>;
22
+ constructor(values?: Map<QueryOptionNames, any> | {
25
23
  [name: string]: any;
26
24
  });
27
25
  pathAndParams(escape?: boolean): [string, {
@@ -31,10 +29,10 @@ export declare class ODataQueryOptions<T> {
31
29
  toJSON(): {};
32
30
  toQueryArguments(): ODataQueryArguments<T>;
33
31
  clone<O>(): ODataQueryOptions<O>;
34
- expression(name: QueryOptionNames, exp?: Expression<T>): any;
35
- option<O>(name: QueryOptionNames, opts?: O): ODataQueryOptionHandler<O>;
36
- has(name: QueryOptionNames): boolean;
37
- remove(...names: QueryOptionNames[]): void;
38
- keep(...names: QueryOptionNames[]): void;
32
+ expression(key: QueryOptionNames, exp?: Expression<T>): any;
33
+ option<O>(key: QueryOptionNames, opts?: O): ODataQueryOptionHandler<O>;
34
+ has(key: QueryOptionNames): boolean;
35
+ remove(...keys: QueryOptionNames[]): void;
36
+ keep(...keys: QueryOptionNames[]): void;
39
37
  clear(): void;
40
38
  }
@@ -2,35 +2,31 @@ import { ODataContext, ODataVersionHelper } from '../../helper';
2
2
  import { ODataMetadataType } from '../../types';
3
3
  export declare abstract class ODataAnnotations {
4
4
  helper: ODataVersionHelper;
5
- protected annotations: {
6
- [annot: string]: any;
7
- };
5
+ protected annotations: Map<string, any>;
8
6
  protected context?: ODataContext | undefined;
9
- constructor(helper: ODataVersionHelper, annotations?: {
10
- [annot: string]: any;
11
- }, context?: ODataContext | undefined);
7
+ constructor(helper: ODataVersionHelper, annotations?: Map<string, any>, context?: ODataContext | undefined);
12
8
  attributes<T>(data: {
13
- [name: string]: any;
9
+ [key: string]: any;
14
10
  }, metadata: ODataMetadataType): T;
15
11
  get entitySet(): string | undefined;
16
12
  get type(): string | undefined;
17
13
  abstract clone(): ODataAnnotations;
18
14
  abstract data(data: {
19
- [name: string]: any;
15
+ [key: string]: any;
20
16
  }): {
21
- [name: string]: any;
17
+ [key: string]: any;
22
18
  };
23
19
  }
24
20
  export declare class ODataPropertyAnnotations extends ODataAnnotations {
25
21
  clone(): ODataPropertyAnnotations;
26
22
  data(data: {
27
- [name: string]: any;
23
+ [key: string]: any;
28
24
  }): any;
29
25
  }
30
26
  export declare class ODataEntityAnnotations extends ODataAnnotations {
31
27
  clone(): ODataEntityAnnotations;
32
28
  data(data: {
33
- [name: string]: any;
29
+ [key: string]: any;
34
30
  }): any;
35
31
  get id(): string | undefined;
36
32
  get etag(): string | undefined;
@@ -42,20 +38,18 @@ export declare class ODataEntityAnnotations extends ODataAnnotations {
42
38
  get mediaEditLink(): string | undefined;
43
39
  get mediaContentType(): string | undefined;
44
40
  private _properties?;
45
- get properties(): {
46
- [name: string]: any;
47
- };
48
- property(name: string): any;
41
+ get properties(): Map<string, Map<string, any>>;
42
+ property(name: string): Map<string, any> | undefined;
49
43
  private _functions?;
50
44
  get functions(): {
51
- [name: string]: any;
45
+ [key: string]: any;
52
46
  };
53
47
  function(name: string): any;
54
48
  }
55
49
  export declare class ODataEntitiesAnnotations extends ODataAnnotations {
56
50
  clone(): ODataEntitiesAnnotations;
57
51
  data(data: {
58
- [name: string]: any;
52
+ [key: string]: any;
59
53
  }): any;
60
54
  get readLink(): string | undefined;
61
55
  get count(): number | undefined;
@@ -66,7 +60,7 @@ export declare class ODataEntitiesAnnotations extends ODataAnnotations {
66
60
  get skiptoken(): string | undefined;
67
61
  private _functions?;
68
62
  get functions(): {
69
- [name: string]: any;
63
+ [key: string]: any;
70
64
  };
71
65
  function(name: string): any;
72
66
  }
@@ -46,9 +46,7 @@ export declare class ODataResponse<T> extends HttpResponse<T> {
46
46
  private _context?;
47
47
  get context(): ODataContext;
48
48
  private _annotations?;
49
- get annotations(): {
50
- [name: string]: any;
51
- };
49
+ get annotations(): Map<string, any>;
52
50
  /**
53
51
  * Handle the response body as an entity
54
52
  * @returns
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-odata",
3
- "version": "0.100.0",
3
+ "version": "0.100.1",
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.1.0",
29
- "@angular/core": "^13.1.0"
28
+ "@angular/common": "^13.3.0",
29
+ "@angular/core": "^13.3.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0"