-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathodata.d.ts
216 lines (186 loc) · 7.46 KB
/
odata.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// MOST Web Framework 2.0 Codename Blueshift BSD-3-Clause license Copyright (c) 2017-2022, THEMOST LP All rights reserved
import {DataContext} from "./types";
import {ConfigurationBase} from "@themost/common";
export declare interface SystemQueryOptions {
$filter?: string;
$select?: string;
$expand?: string;
$top?: number;
$skip?: number;
$orderby?: string;
$groupby?: string;
$inlinecount?:any;
$count?: any;
}
export declare class EdmType {
static EdmBinary: string;
static EdmBoolean: string;
static EdmByte: string;
static EdmDate: string;
static EdmDateTimeOffset: string;
static EdmDouble: string;
static EdmDecimal: string;
static EdmDuration: string;
static EdmGuid: string;
static EdmInt16: string;
static EdmInt32: string;
static EdmInt64: string;
static EdmSByte: string;
static EdmSingle: string;
static EdmStream: string;
static EdmString: string;
static EdmTimeOfDay: string;
static CollectionOf(type: string): string;
static IsCollection(type: string): boolean;
}
export declare class EdmMultiplicity {
static Many: string;
static One: string;
static Unknown: string;
static ZeroOrOne: string;
static parse(value: string): string;
}
export declare class EntitySetKind {
static EntitySet: string;
static Singleton: string;
static FunctionImport: string;
static ActionImport: string;
}
export class EdmMapping {
static entityType(name?: string): Function;
static action(name: string, returnType: any): Function;
static func(name: string, returnType: any): Function;
static param(name: string, type: string, nullable?: boolean, fromBody?: boolean): Function;
static navigationProperty(name: string, type: string, multiplicity: string): Function;
static property(name: string, type: string, nullable?: boolean): Function;
static hasOwnAction(obj: any, name: string): Function;
static hasOwnNavigationProperty(obj: any, name: string): any;
static hasOwnFunction(obj: any, name: string): Function;
static getOwnFunctions(obj: any): Array<Function>;
static getOwnActions(obj: any): Array<Function>;
}
export declare interface ProcedureParameter {
name: string;
type: string;
nullable?: boolean;
fromBody?: boolean;
}
export declare interface EntityTypeProperty {
name: string;
type: string;
nullable?: boolean;
}
export declare interface EntityTypeNavigationProperty {
name: string;
type: string;
}
export declare interface EntityContainerConfiguration {
name: string;
entitySet: Array<EntitySetConfiguration>;
}
export declare interface SchemaConfiguration {
namespace?: string;
alias?: string;
entityType: Array<EntityTypeConfiguration>;
entityContainer: EntityContainerConfiguration;
}
export declare class ProcedureConfiguration {
name: string;
parameters:Array<ProcedureParameter>;
isBound?: boolean;
isComposable?: boolean;
}
export declare class ActionConfiguration extends ProcedureConfiguration{
}
export declare class FunctionConfiguration extends ProcedureConfiguration{
}
export declare class EntityCollectionConfiguration {
actions: Array<ActionConfiguration>;
functions: Array<FunctionConfiguration>;
addAction(name: string): ActionConfiguration;
hasAction(name: string): ActionConfiguration;
addFunction(name: string): FunctionConfiguration;
hasFunction(name: string): FunctionConfiguration;
}
export declare class EntityTypeConfiguration {
constructor(builder: any, name: string);
getBuilder(): any;
readonly name: string;
property: Array<EntityTypeProperty>;
ignoredProperty: Array<any>;
navigationProperty: Array<EntityTypeNavigationProperty>;
actions: Array<ActionConfiguration>;
functions: Array<FunctionConfiguration>;
collection: any;
ignore(name: string): EntityTypeConfiguration;
derivesFrom(name: string): EntityTypeConfiguration;
addAction(name: string): ActionConfiguration;
hasAction(name: string): ActionConfiguration;
addFunction(name: string): FunctionConfiguration;
hasFunction(name: string): FunctionConfiguration;
addProperty (name: string, type: string, nullable?: boolean): EntityTypeConfiguration;
removeProperty(name: string): EntityTypeConfiguration;
addNavigationProperty(name: string, type: string, multiplicity: string): EntityTypeConfiguration;
removeNavigationProperty(name: string): EntityTypeConfiguration;
hasKey(name: string, type: string): EntityTypeConfiguration;
removeKey(name: string): EntityTypeConfiguration;
mapInstance(context: DataContext, any: any): any;
mapInstanceSet(context: DataContext, any: any): any;
}
export declare class EntitySetConfiguration {
constructor(builder: any, entityType: string, name: string);
name: string;
kind: string;
url: string;
readonly entityType: EntityTypeConfiguration;
hasUrl(url: string): void;
getUrl(): string;
getBuilder(): any;
getEntityTypePropertyList(): Map<string, EntityTypeProperty>;
getEntityTypeProperty(name: boolean, deep?: boolean): EntityTypeProperty;
getEntityTypeIgnoredPropertyList():Array<string>;
getEntityTypeNavigationProperty(name: string, deep?: boolean): EntityTypeNavigationProperty;
getEntityTypeNavigationPropertyList(): Map<string, EntityTypeNavigationProperty>;
hasContextLink(contextLinkFunc: (context: DataContext) => string): void;
hasIdLink(idLinkFunc: (context: DataContext) => string): void;
hasReadLink(readLinkFunc: (context: DataContext) => string): void;
hasEditLink(editLinkFunc: (context: DataContext) => string): void;
mapInstance(context: DataContext, any: any): any;
mapInstanceSet(context: DataContext, any: any): any;
mapInstanceProperty(context: DataContext, any: any): any;
}
export declare class SingletonConfiguration extends EntitySetConfiguration{
constructor(builder: any, entityType: string, name: string);
}
export declare interface ModelBuilderJsonFormatterOptions {
addContextAttribute?: boolean;
addCountAttribute?: boolean;
}
export declare class ODataModelBuilder {
constructor(configuration: ConfigurationBase);
serviceRoot: string;
defaultNamespace: string;
defaultAlias: string;
getEntity(name: string): EntityTypeConfiguration;
addEntity(name: string): EntityTypeConfiguration;
addSingleton(entityType: string, name: string): SingletonConfiguration;
getSingleton(name: string): SingletonConfiguration;
hasSingleton(name: string): boolean;
hasEntitySet(name: string): boolean;
addEntitySet(entityType: string, name: string): EntitySetConfiguration;
removeEntitySet(name: string): boolean;
getEntitySet(name: string): EntitySetConfiguration;
getEntityTypeEntitySet(entityName: string): EntitySetConfiguration;
ignore(name: string): ODataModelBuilder;
hasEntity(name: string): boolean;
getEdm(): Promise<SchemaConfiguration>;
clean(all?: boolean): ODataModelBuilder;
getEdmDocument(): Promise<any>;
hasContextLink(contextLinkFunc: (context: DataContext) => string): void;
hasJsonFormatter(jsonFormatterFunc: (context: DataContext, entitySet: EntitySetConfiguration, instance: any, options?: ModelBuilderJsonFormatterOptions)=> any): void;
}
export declare class EntityDataContext extends DataContext {
}
export declare class ODataConventionModelBuilder extends ODataModelBuilder{
}
export declare function defineDecorator(proto: Object|Function, key: string, decorator:Function): void;