@steedos/odata-v4-parser 3.0.13-beta.9 → 3.0.13
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/expressions.js +131 -131
- package/lib/expressions.js.map +1 -1
- package/lib/json.js +69 -69
- package/lib/json.js.map +1 -1
- package/lib/lexer.js +30 -25
- package/lib/lexer.js.map +1 -1
- package/lib/nameOrIdentifier.js +180 -218
- package/lib/nameOrIdentifier.js.map +1 -1
- package/lib/odataUri.js +7 -7
- package/lib/odataUri.js.map +1 -1
- package/lib/parser.js +18 -21
- package/lib/parser.js.map +1 -1
- package/lib/primitiveLiteral.js +129 -129
- package/lib/primitiveLiteral.js.map +1 -1
- package/lib/query.js +162 -162
- package/lib/query.js.map +1 -1
- package/lib/resourcePath.js +65 -65
- package/lib/resourcePath.js.map +1 -1
- package/lib/utils.js +3 -3
- package/package.json +2 -2
- package/tsconfig.json +3 -7
package/lib/nameOrIdentifier.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NameOrIdentifier = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const lexer_1 = require("./lexer");
|
|
6
|
+
const primitiveLiteral_1 = require("./primitiveLiteral");
|
|
7
7
|
var NameOrIdentifier;
|
|
8
8
|
(function (NameOrIdentifier) {
|
|
9
9
|
function enumeration(value, index) {
|
|
10
|
-
|
|
10
|
+
let type = qualifiedEnumTypeName(value, index);
|
|
11
11
|
if (!type)
|
|
12
12
|
return;
|
|
13
|
-
|
|
13
|
+
let start = index;
|
|
14
14
|
index = type.next;
|
|
15
|
-
|
|
15
|
+
let squote = lexer_1.default.SQUOTE(value, index);
|
|
16
16
|
if (!squote)
|
|
17
17
|
return;
|
|
18
18
|
index = squote;
|
|
19
|
-
|
|
19
|
+
let enumVal = NameOrIdentifier.enumValue(value, index);
|
|
20
20
|
if (!enumVal)
|
|
21
21
|
return;
|
|
22
22
|
index = enumVal.next;
|
|
@@ -31,15 +31,15 @@ var NameOrIdentifier;
|
|
|
31
31
|
}
|
|
32
32
|
NameOrIdentifier.enumeration = enumeration;
|
|
33
33
|
function enumValue(value, index) {
|
|
34
|
-
|
|
34
|
+
let val = NameOrIdentifier.singleEnumValue(value, index);
|
|
35
35
|
if (!val)
|
|
36
36
|
return;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
let start = index;
|
|
38
|
+
let arr = [];
|
|
39
39
|
while (val) {
|
|
40
40
|
arr.push(val);
|
|
41
41
|
index = val.next;
|
|
42
|
-
|
|
42
|
+
let comma = lexer_1.default.COMMA(value, val.next);
|
|
43
43
|
if (comma) {
|
|
44
44
|
index = comma;
|
|
45
45
|
val = NameOrIdentifier.singleEnumValue(value, index);
|
|
@@ -56,7 +56,7 @@ var NameOrIdentifier;
|
|
|
56
56
|
}
|
|
57
57
|
NameOrIdentifier.singleEnumValue = singleEnumValue;
|
|
58
58
|
function enumMemberValue(value, index) {
|
|
59
|
-
|
|
59
|
+
let token = primitiveLiteral_1.default.int64Value(value, index);
|
|
60
60
|
if (token) {
|
|
61
61
|
token.type = lexer_1.default.TokenType.EnumMemberValue;
|
|
62
62
|
return token;
|
|
@@ -73,13 +73,13 @@ var NameOrIdentifier;
|
|
|
73
73
|
NameOrIdentifier.singleQualifiedTypeName = singleQualifiedTypeName;
|
|
74
74
|
function qualifiedTypeName(value, index) {
|
|
75
75
|
if (utils_1.default.equals(value, index, "Collection")) {
|
|
76
|
-
|
|
76
|
+
let start = index;
|
|
77
77
|
index += 10;
|
|
78
|
-
|
|
78
|
+
let squote = lexer_1.default.SQUOTE(value, index);
|
|
79
79
|
if (!squote)
|
|
80
80
|
return;
|
|
81
81
|
index = squote;
|
|
82
|
-
|
|
82
|
+
let token = NameOrIdentifier.singleQualifiedTypeName(value, index);
|
|
83
83
|
if (!token)
|
|
84
84
|
return;
|
|
85
85
|
else
|
|
@@ -98,15 +98,15 @@ var NameOrIdentifier;
|
|
|
98
98
|
}
|
|
99
99
|
NameOrIdentifier.qualifiedTypeName = qualifiedTypeName;
|
|
100
100
|
function qualifiedEntityTypeName(value, index, metadataContext) {
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
let start = index;
|
|
102
|
+
let namespaceNext = NameOrIdentifier.namespace(value, index);
|
|
103
103
|
if (namespaceNext === index || value[namespaceNext] !== 0x2e)
|
|
104
104
|
return;
|
|
105
|
-
|
|
105
|
+
let schema;
|
|
106
106
|
if (typeof metadataContext === "object") {
|
|
107
|
-
schema = NameOrIdentifier.getMetadataRoot(metadataContext).schemas.filter(
|
|
107
|
+
schema = NameOrIdentifier.getMetadataRoot(metadataContext).schemas.filter(it => it.namespace === utils_1.default.stringify(value, start, namespaceNext))[0];
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
let name = NameOrIdentifier.entityTypeName(value, namespaceNext + 1, schema);
|
|
110
110
|
if (!name)
|
|
111
111
|
return;
|
|
112
112
|
name.value.namespace = utils_1.default.stringify(value, start, namespaceNext);
|
|
@@ -114,15 +114,15 @@ var NameOrIdentifier;
|
|
|
114
114
|
}
|
|
115
115
|
NameOrIdentifier.qualifiedEntityTypeName = qualifiedEntityTypeName;
|
|
116
116
|
function qualifiedComplexTypeName(value, index, metadataContext) {
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
let start = index;
|
|
118
|
+
let namespaceNext = NameOrIdentifier.namespace(value, index);
|
|
119
119
|
if (namespaceNext === index || value[namespaceNext] !== 0x2e)
|
|
120
120
|
return;
|
|
121
|
-
|
|
121
|
+
let schema;
|
|
122
122
|
if (typeof metadataContext === "object") {
|
|
123
|
-
schema = NameOrIdentifier.getMetadataRoot(metadataContext).schemas.filter(
|
|
123
|
+
schema = NameOrIdentifier.getMetadataRoot(metadataContext).schemas.filter(it => it.namespace === utils_1.default.stringify(value, start, namespaceNext))[0];
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
let name = NameOrIdentifier.complexTypeName(value, namespaceNext + 1, schema);
|
|
126
126
|
if (!name)
|
|
127
127
|
return;
|
|
128
128
|
name.value.namespace = utils_1.default.stringify(value, start, namespaceNext);
|
|
@@ -130,29 +130,29 @@ var NameOrIdentifier;
|
|
|
130
130
|
}
|
|
131
131
|
NameOrIdentifier.qualifiedComplexTypeName = qualifiedComplexTypeName;
|
|
132
132
|
function qualifiedTypeDefinitionName(value, index) {
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
let start = index;
|
|
134
|
+
let namespaceNext = NameOrIdentifier.namespace(value, index);
|
|
135
135
|
if (namespaceNext === index || value[namespaceNext] !== 0x2e)
|
|
136
136
|
return;
|
|
137
|
-
|
|
137
|
+
let nameNext = NameOrIdentifier.typeDefinitionName(value, namespaceNext + 1);
|
|
138
138
|
if (nameNext && nameNext.next === namespaceNext + 1)
|
|
139
139
|
return;
|
|
140
140
|
return lexer_1.default.tokenize(value, start, nameNext.next, "TypeDefinitionName", lexer_1.default.TokenType.Identifier);
|
|
141
141
|
}
|
|
142
142
|
NameOrIdentifier.qualifiedTypeDefinitionName = qualifiedTypeDefinitionName;
|
|
143
143
|
function qualifiedEnumTypeName(value, index) {
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
let start = index;
|
|
145
|
+
let namespaceNext = NameOrIdentifier.namespace(value, index);
|
|
146
146
|
if (namespaceNext === index || value[namespaceNext] !== 0x2e)
|
|
147
147
|
return;
|
|
148
|
-
|
|
148
|
+
let nameNext = NameOrIdentifier.enumerationTypeName(value, namespaceNext + 1);
|
|
149
149
|
if (nameNext && nameNext.next === namespaceNext + 1)
|
|
150
150
|
return;
|
|
151
151
|
return lexer_1.default.tokenize(value, start, nameNext.next, "EnumTypeName", lexer_1.default.TokenType.Identifier);
|
|
152
152
|
}
|
|
153
153
|
NameOrIdentifier.qualifiedEnumTypeName = qualifiedEnumTypeName;
|
|
154
154
|
function namespace(value, index) {
|
|
155
|
-
|
|
155
|
+
let part = NameOrIdentifier.namespacePart(value, index);
|
|
156
156
|
while (part && part.next > index) {
|
|
157
157
|
index = part.next;
|
|
158
158
|
if (value[part.next] === 0x2e) {
|
|
@@ -166,7 +166,7 @@ var NameOrIdentifier;
|
|
|
166
166
|
}
|
|
167
167
|
NameOrIdentifier.namespace = namespace;
|
|
168
168
|
function odataIdentifier(value, index, tokenType) {
|
|
169
|
-
|
|
169
|
+
let start = index;
|
|
170
170
|
if (lexer_1.default.identifierLeadingCharacter(value[index])) {
|
|
171
171
|
index++;
|
|
172
172
|
while (index < value.length && (index - start < 128) && lexer_1.default.identifierCharacter(value[index])) {
|
|
@@ -180,29 +180,29 @@ var NameOrIdentifier;
|
|
|
180
180
|
function namespacePart(value, index) { return NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.NamespacePart); }
|
|
181
181
|
NameOrIdentifier.namespacePart = namespacePart;
|
|
182
182
|
function entitySetName(value, index, metadataContext) {
|
|
183
|
-
|
|
183
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntitySetName);
|
|
184
184
|
if (!token)
|
|
185
185
|
return;
|
|
186
186
|
if (typeof metadataContext === "object") {
|
|
187
|
-
|
|
188
|
-
metadataContext.dataServices.schemas.forEach(
|
|
189
|
-
|
|
187
|
+
let entitySet;
|
|
188
|
+
metadataContext.dataServices.schemas.forEach(schema => schema.entityContainer.forEach(container => container.entitySets.filter((set) => {
|
|
189
|
+
let eq = set.name === token.raw;
|
|
190
190
|
if (eq)
|
|
191
|
-
|
|
191
|
+
entitySet = set;
|
|
192
192
|
return eq;
|
|
193
|
-
})
|
|
194
|
-
if (!
|
|
193
|
+
})));
|
|
194
|
+
if (!entitySet)
|
|
195
195
|
return;
|
|
196
|
-
|
|
197
|
-
metadataContext.dataServices.schemas.forEach(
|
|
198
|
-
|
|
196
|
+
let entityType;
|
|
197
|
+
metadataContext.dataServices.schemas.forEach(schema => entitySet.entityType.indexOf(schema.namespace + ".") === 0 && schema.entityTypes.filter((type) => {
|
|
198
|
+
let eq = type.name === entitySet.entityType.replace(schema.namespace + ".", "");
|
|
199
199
|
if (eq)
|
|
200
|
-
|
|
200
|
+
entityType = type;
|
|
201
201
|
return eq;
|
|
202
|
-
})
|
|
203
|
-
if (!
|
|
202
|
+
}));
|
|
203
|
+
if (!entityType)
|
|
204
204
|
return;
|
|
205
|
-
token.metadata =
|
|
205
|
+
token.metadata = entityType;
|
|
206
206
|
}
|
|
207
207
|
return token;
|
|
208
208
|
}
|
|
@@ -210,11 +210,11 @@ var NameOrIdentifier;
|
|
|
210
210
|
function singletonEntity(value, index) { return NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.SingletonEntity); }
|
|
211
211
|
NameOrIdentifier.singletonEntity = singletonEntity;
|
|
212
212
|
function entityTypeName(value, index, schema) {
|
|
213
|
-
|
|
213
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityTypeName);
|
|
214
214
|
if (!token)
|
|
215
215
|
return;
|
|
216
216
|
if (typeof schema === "object") {
|
|
217
|
-
|
|
217
|
+
let type = schema.entityTypes.filter(it => it.name === token.raw)[0];
|
|
218
218
|
if (!type)
|
|
219
219
|
return;
|
|
220
220
|
token.metadata = type;
|
|
@@ -223,11 +223,11 @@ var NameOrIdentifier;
|
|
|
223
223
|
}
|
|
224
224
|
NameOrIdentifier.entityTypeName = entityTypeName;
|
|
225
225
|
function complexTypeName(value, index, schema) {
|
|
226
|
-
|
|
226
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexTypeName);
|
|
227
227
|
if (!token)
|
|
228
228
|
return;
|
|
229
229
|
if (typeof schema === "object") {
|
|
230
|
-
|
|
230
|
+
let type = schema.complexTypes.filter(it => it.name === token.raw)[0];
|
|
231
231
|
if (!type)
|
|
232
232
|
return;
|
|
233
233
|
token.metadata = type;
|
|
@@ -246,9 +246,9 @@ var NameOrIdentifier;
|
|
|
246
246
|
function primitiveTypeName(value, index) {
|
|
247
247
|
if (!utils_1.default.equals(value, index, "Edm."))
|
|
248
248
|
return;
|
|
249
|
-
|
|
249
|
+
let start = index;
|
|
250
250
|
index += 4;
|
|
251
|
-
|
|
251
|
+
let end = index + (utils_1.default.equals(value, index, "Binary") ||
|
|
252
252
|
utils_1.default.equals(value, index, "Boolean") ||
|
|
253
253
|
utils_1.default.equals(value, index, "Byte") ||
|
|
254
254
|
utils_1.default.equals(value, index, "Date") ||
|
|
@@ -283,16 +283,16 @@ var NameOrIdentifier;
|
|
|
283
283
|
return lexer_1.default.tokenize(value, start, end, "PrimitiveTypeName", lexer_1.default.TokenType.Identifier);
|
|
284
284
|
}
|
|
285
285
|
NameOrIdentifier.primitiveTypeName = primitiveTypeName;
|
|
286
|
-
|
|
286
|
+
const primitiveTypes = [
|
|
287
287
|
"Edm.Binary", "Edm.Boolean", "Edm.Byte", "Edm.Date", "Edm.DateTimeOffset", "Edm.Decimal", "Edm.Double", "Edm.Duration", "Edm.Guid",
|
|
288
288
|
"Edm.Int16", "Edm.Int32", "Edm.Int64", "Edm.SByte", "Edm.Single", "Edm.Stream", "Edm.String", "Edm.Array", "Edm.TimeOfDay",
|
|
289
289
|
"Edm.GeographyCollection", "Edm.GeographyLineString", "Edm.GeographyMultiLineString", "Edm.GeographyMultiPoint", "Edm.GeographyMultiPolygon", "Edm.GeographyPoint", "Edm.GeographyPolygon",
|
|
290
290
|
"Edm.GeometryCollection", "Edm.GeometryLineString", "Edm.GeometryMultiLineString", "Edm.GeometryMultiPoint", "Edm.GeometryMultiPolygon", "Edm.GeometryPoint", "Edm.GeometryPolygon"
|
|
291
291
|
];
|
|
292
292
|
function isPrimitiveTypeName(type, metadataContext) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
let root = NameOrIdentifier.getMetadataRoot(metadataContext);
|
|
294
|
+
let schemas = root.schemas || (root.dataServices && root.dataServices.schemas) || [];
|
|
295
|
+
let schema = schemas.filter(function (it) { return type.indexOf(it.namespace + ".") === 0; })[0];
|
|
296
296
|
if (schema) {
|
|
297
297
|
return ((schema.enumTypes && schema.enumTypes.filter(function (it) { return it.name === type.split(".").pop(); })[0]) ||
|
|
298
298
|
(schema.typeDefinitions && schema.typeDefinitions.filter(function (it) { return it.name === type.split(".").pop(); })[0])) &&
|
|
@@ -303,7 +303,7 @@ var NameOrIdentifier;
|
|
|
303
303
|
}
|
|
304
304
|
NameOrIdentifier.isPrimitiveTypeName = isPrimitiveTypeName;
|
|
305
305
|
function getMetadataRoot(metadataContext) {
|
|
306
|
-
|
|
306
|
+
let root = metadataContext;
|
|
307
307
|
while (root.parent) {
|
|
308
308
|
root = root.parent;
|
|
309
309
|
}
|
|
@@ -311,28 +311,21 @@ var NameOrIdentifier;
|
|
|
311
311
|
}
|
|
312
312
|
NameOrIdentifier.getMetadataRoot = getMetadataRoot;
|
|
313
313
|
function primitiveProperty(value, index, metadataContext) {
|
|
314
|
-
|
|
314
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.PrimitiveProperty);
|
|
315
315
|
if (!token)
|
|
316
316
|
return;
|
|
317
317
|
if (typeof metadataContext === "object") {
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
for (let i = 0; i < metadataContext.properties.length; i++) {
|
|
319
|
+
let prop = metadataContext.properties[i];
|
|
320
320
|
if (prop.name === token.raw) {
|
|
321
321
|
if (prop.type.indexOf("Collection") === 0 || !NameOrIdentifier.isPrimitiveTypeName(prop.type, metadataContext))
|
|
322
|
-
return
|
|
322
|
+
return;
|
|
323
323
|
token.metadata = prop;
|
|
324
|
-
if (metadataContext.key && metadataContext.key.propertyRefs.filter(
|
|
324
|
+
if (metadataContext.key && metadataContext.key.propertyRefs.filter(it => it.name === prop.name).length > 0) {
|
|
325
325
|
token.type = lexer_1.default.TokenType.PrimitiveKeyProperty;
|
|
326
326
|
}
|
|
327
|
-
return "break";
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
for (var i = 0; i < metadataContext.properties.length; i++) {
|
|
331
|
-
var state_1 = _loop_1(i);
|
|
332
|
-
if (typeof state_1 === "object")
|
|
333
|
-
return state_1.value;
|
|
334
|
-
if (state_1 === "break")
|
|
335
327
|
break;
|
|
328
|
+
}
|
|
336
329
|
}
|
|
337
330
|
if (!token.metadata)
|
|
338
331
|
return;
|
|
@@ -341,40 +334,33 @@ var NameOrIdentifier;
|
|
|
341
334
|
}
|
|
342
335
|
NameOrIdentifier.primitiveProperty = primitiveProperty;
|
|
343
336
|
function primitiveKeyProperty(value, index, metadataContext) {
|
|
344
|
-
|
|
337
|
+
let token = NameOrIdentifier.primitiveProperty(value, index, metadataContext);
|
|
345
338
|
if (token && token.type === lexer_1.default.TokenType.PrimitiveKeyProperty)
|
|
346
339
|
return token;
|
|
347
340
|
}
|
|
348
341
|
NameOrIdentifier.primitiveKeyProperty = primitiveKeyProperty;
|
|
349
342
|
function primitiveNonKeyProperty(value, index, metadataContext) {
|
|
350
|
-
|
|
343
|
+
let token = NameOrIdentifier.primitiveProperty(value, index, metadataContext);
|
|
351
344
|
if (token && token.type === lexer_1.default.TokenType.PrimitiveProperty)
|
|
352
345
|
return token;
|
|
353
346
|
}
|
|
354
347
|
NameOrIdentifier.primitiveNonKeyProperty = primitiveNonKeyProperty;
|
|
355
348
|
function primitiveColProperty(value, index, metadataContext) {
|
|
356
|
-
|
|
349
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.PrimitiveCollectionProperty);
|
|
357
350
|
if (!token)
|
|
358
351
|
return;
|
|
359
352
|
if (typeof metadataContext === "object") {
|
|
360
|
-
|
|
361
|
-
|
|
353
|
+
for (let i = 0; i < metadataContext.properties.length; i++) {
|
|
354
|
+
let prop = metadataContext.properties[i];
|
|
362
355
|
if (prop.name === token.raw) {
|
|
363
356
|
if (prop.type.indexOf("Collection") === -1 || !NameOrIdentifier.isPrimitiveTypeName(prop.type.slice(11, -1), metadataContext))
|
|
364
|
-
return
|
|
357
|
+
return;
|
|
365
358
|
token.metadata = prop;
|
|
366
|
-
if (metadataContext.key.propertyRefs.filter(
|
|
359
|
+
if (metadataContext.key.propertyRefs.filter(it => it.name === prop.name).length > 0) {
|
|
367
360
|
token.type = lexer_1.default.TokenType.PrimitiveKeyProperty;
|
|
368
361
|
}
|
|
369
|
-
return "break";
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
for (var i = 0; i < metadataContext.properties.length; i++) {
|
|
373
|
-
var state_2 = _loop_2(i);
|
|
374
|
-
if (typeof state_2 === "object")
|
|
375
|
-
return state_2.value;
|
|
376
|
-
if (state_2 === "break")
|
|
377
362
|
break;
|
|
363
|
+
}
|
|
378
364
|
}
|
|
379
365
|
if (!token.metadata)
|
|
380
366
|
return;
|
|
@@ -383,32 +369,25 @@ var NameOrIdentifier;
|
|
|
383
369
|
}
|
|
384
370
|
NameOrIdentifier.primitiveColProperty = primitiveColProperty;
|
|
385
371
|
function complexProperty(value, index, metadataContext) {
|
|
386
|
-
|
|
372
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexProperty);
|
|
387
373
|
if (!token)
|
|
388
374
|
return;
|
|
389
375
|
if (typeof metadataContext === "object") {
|
|
390
|
-
|
|
391
|
-
|
|
376
|
+
for (let i = 0; i < metadataContext.properties.length; i++) {
|
|
377
|
+
let prop = metadataContext.properties[i];
|
|
392
378
|
if (prop.name === token.raw) {
|
|
393
379
|
if (prop.type.indexOf("Collection") === 0 || NameOrIdentifier.isPrimitiveTypeName(prop.type, metadataContext))
|
|
394
|
-
return
|
|
395
|
-
|
|
396
|
-
|
|
380
|
+
return;
|
|
381
|
+
let root = NameOrIdentifier.getMetadataRoot(metadataContext);
|
|
382
|
+
let schema = root.schemas.filter(it => prop.type.indexOf(it.namespace + ".") === 0)[0];
|
|
397
383
|
if (!schema)
|
|
398
|
-
return
|
|
399
|
-
|
|
384
|
+
return;
|
|
385
|
+
let complexType = schema.complexTypes.filter(it => it.name === prop.type.split(".").pop())[0];
|
|
400
386
|
if (!complexType)
|
|
401
|
-
return
|
|
387
|
+
return;
|
|
402
388
|
token.metadata = complexType;
|
|
403
|
-
return "break";
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
for (var i = 0; i < metadataContext.properties.length; i++) {
|
|
407
|
-
var state_3 = _loop_3(i);
|
|
408
|
-
if (typeof state_3 === "object")
|
|
409
|
-
return state_3.value;
|
|
410
|
-
if (state_3 === "break")
|
|
411
389
|
break;
|
|
390
|
+
}
|
|
412
391
|
}
|
|
413
392
|
if (!token.metadata)
|
|
414
393
|
return;
|
|
@@ -417,32 +396,25 @@ var NameOrIdentifier;
|
|
|
417
396
|
}
|
|
418
397
|
NameOrIdentifier.complexProperty = complexProperty;
|
|
419
398
|
function complexColProperty(value, index, metadataContext) {
|
|
420
|
-
|
|
399
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexCollectionProperty);
|
|
421
400
|
if (!token)
|
|
422
401
|
return;
|
|
423
402
|
if (typeof metadataContext === "object") {
|
|
424
|
-
|
|
425
|
-
|
|
403
|
+
for (let i = 0; i < metadataContext.properties.length; i++) {
|
|
404
|
+
let prop = metadataContext.properties[i];
|
|
426
405
|
if (prop.name === token.raw) {
|
|
427
406
|
if (prop.type.indexOf("Collection") === -1 || NameOrIdentifier.isPrimitiveTypeName(prop.type.slice(11, -1), metadataContext))
|
|
428
|
-
return
|
|
429
|
-
|
|
430
|
-
|
|
407
|
+
return;
|
|
408
|
+
let root = NameOrIdentifier.getMetadataRoot(metadataContext);
|
|
409
|
+
let schema = root.schemas.filter(it => prop.type.slice(11, -1).indexOf(it.namespace + ".") === 0)[0];
|
|
431
410
|
if (!schema)
|
|
432
|
-
return
|
|
433
|
-
|
|
411
|
+
return;
|
|
412
|
+
let complexType = schema.complexTypes.filter(it => it.name === prop.type.slice(11, -1).split(".").pop())[0];
|
|
434
413
|
if (!complexType)
|
|
435
|
-
return
|
|
414
|
+
return;
|
|
436
415
|
token.metadata = complexType;
|
|
437
|
-
return "break";
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
for (var i = 0; i < metadataContext.properties.length; i++) {
|
|
441
|
-
var state_4 = _loop_4(i);
|
|
442
|
-
if (typeof state_4 === "object")
|
|
443
|
-
return state_4.value;
|
|
444
|
-
if (state_4 === "break")
|
|
445
416
|
break;
|
|
417
|
+
}
|
|
446
418
|
}
|
|
447
419
|
if (!token.metadata)
|
|
448
420
|
return;
|
|
@@ -451,12 +423,12 @@ var NameOrIdentifier;
|
|
|
451
423
|
}
|
|
452
424
|
NameOrIdentifier.complexColProperty = complexColProperty;
|
|
453
425
|
function streamProperty(value, index, metadataContext) {
|
|
454
|
-
|
|
426
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.StreamProperty);
|
|
455
427
|
if (!token)
|
|
456
428
|
return;
|
|
457
429
|
if (typeof metadataContext === "object") {
|
|
458
|
-
for (
|
|
459
|
-
|
|
430
|
+
for (let i = 0; i < metadataContext.properties.length; i++) {
|
|
431
|
+
let prop = metadataContext.properties[i];
|
|
460
432
|
if (prop.name === token.raw) {
|
|
461
433
|
if (prop.type !== "Edm.Stream")
|
|
462
434
|
return;
|
|
@@ -476,27 +448,22 @@ var NameOrIdentifier;
|
|
|
476
448
|
}
|
|
477
449
|
NameOrIdentifier.navigationProperty = navigationProperty;
|
|
478
450
|
function entityNavigationProperty(value, index, metadataContext) {
|
|
479
|
-
|
|
451
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityNavigationProperty);
|
|
480
452
|
if (!token)
|
|
481
453
|
return;
|
|
482
454
|
if (typeof metadataContext === "object") {
|
|
483
|
-
|
|
484
|
-
|
|
455
|
+
for (let i = 0; i < metadataContext.navigationProperties.length; i++) {
|
|
456
|
+
let prop = metadataContext.navigationProperties[i];
|
|
485
457
|
if (prop.name === token.raw && prop.type.indexOf("Collection") === -1 && !NameOrIdentifier.isPrimitiveTypeName(prop.type.slice(11, -1), metadataContext)) {
|
|
486
|
-
|
|
487
|
-
|
|
458
|
+
let root = NameOrIdentifier.getMetadataRoot(metadataContext);
|
|
459
|
+
let schema = root.schemas.filter(it => prop.type.indexOf(it.namespace + ".") === 0)[0];
|
|
488
460
|
if (!schema)
|
|
489
|
-
return
|
|
490
|
-
|
|
461
|
+
return;
|
|
462
|
+
let entityType = schema.entityTypes.filter(it => it.name === prop.type.split(".").pop())[0];
|
|
491
463
|
if (!entityType)
|
|
492
|
-
return
|
|
464
|
+
return;
|
|
493
465
|
token.metadata = entityType;
|
|
494
466
|
}
|
|
495
|
-
};
|
|
496
|
-
for (var i = 0; i < metadataContext.navigationProperties.length; i++) {
|
|
497
|
-
var state_5 = _loop_5(i);
|
|
498
|
-
if (typeof state_5 === "object")
|
|
499
|
-
return state_5.value;
|
|
500
467
|
}
|
|
501
468
|
if (!token.metadata)
|
|
502
469
|
return;
|
|
@@ -505,27 +472,22 @@ var NameOrIdentifier;
|
|
|
505
472
|
}
|
|
506
473
|
NameOrIdentifier.entityNavigationProperty = entityNavigationProperty;
|
|
507
474
|
function entityColNavigationProperty(value, index, metadataContext) {
|
|
508
|
-
|
|
475
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityCollectionNavigationProperty);
|
|
509
476
|
if (!token)
|
|
510
477
|
return;
|
|
511
478
|
if (typeof metadataContext === "object") {
|
|
512
|
-
|
|
513
|
-
|
|
479
|
+
for (let i = 0; i < metadataContext.navigationProperties.length; i++) {
|
|
480
|
+
let prop = metadataContext.navigationProperties[i];
|
|
514
481
|
if (prop.name === token.raw && prop.type.indexOf("Collection") === 0 && !NameOrIdentifier.isPrimitiveTypeName(prop.type.slice(11, -1), metadataContext)) {
|
|
515
|
-
|
|
516
|
-
|
|
482
|
+
let root = NameOrIdentifier.getMetadataRoot(metadataContext);
|
|
483
|
+
let schema = root.schemas.filter(it => prop.type.slice(11, -1).indexOf(it.namespace + ".") === 0)[0];
|
|
517
484
|
if (!schema)
|
|
518
|
-
return
|
|
519
|
-
|
|
485
|
+
return;
|
|
486
|
+
let entityType = schema.entityTypes.filter(it => it.name === prop.type.slice(11, -1).split(".").pop())[0];
|
|
520
487
|
if (!entityType)
|
|
521
|
-
return
|
|
488
|
+
return;
|
|
522
489
|
token.metadata = entityType;
|
|
523
490
|
}
|
|
524
|
-
};
|
|
525
|
-
for (var i = 0; i < metadataContext.navigationProperties.length; i++) {
|
|
526
|
-
var state_6 = _loop_6(i);
|
|
527
|
-
if (typeof state_6 === "object")
|
|
528
|
-
return state_6.value;
|
|
529
491
|
}
|
|
530
492
|
if (!token.metadata)
|
|
531
493
|
return;
|
|
@@ -534,11 +496,11 @@ var NameOrIdentifier;
|
|
|
534
496
|
}
|
|
535
497
|
NameOrIdentifier.entityColNavigationProperty = entityColNavigationProperty;
|
|
536
498
|
function action(value, index, isCollection, metadataContext) {
|
|
537
|
-
|
|
499
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.Action);
|
|
538
500
|
if (!token)
|
|
539
501
|
return;
|
|
540
502
|
if (typeof metadataContext === "object") {
|
|
541
|
-
|
|
503
|
+
let type = NameOrIdentifier.getOperationType("action", metadataContext, token, isCollection, false, false, "entityTypes");
|
|
542
504
|
if (!type)
|
|
543
505
|
return;
|
|
544
506
|
}
|
|
@@ -546,11 +508,11 @@ var NameOrIdentifier;
|
|
|
546
508
|
}
|
|
547
509
|
NameOrIdentifier.action = action;
|
|
548
510
|
function actionImport(value, index, metadataContext) {
|
|
549
|
-
|
|
511
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ActionImport);
|
|
550
512
|
if (!token)
|
|
551
513
|
return;
|
|
552
514
|
if (typeof metadataContext === "object") {
|
|
553
|
-
|
|
515
|
+
let type = NameOrIdentifier.getOperationImportType("action", metadataContext, token);
|
|
554
516
|
if (!type)
|
|
555
517
|
return;
|
|
556
518
|
}
|
|
@@ -567,18 +529,18 @@ var NameOrIdentifier;
|
|
|
567
529
|
}
|
|
568
530
|
NameOrIdentifier.odataFunction = odataFunction;
|
|
569
531
|
function getOperationType(operation, metadataContext, token, isBoundCollection, isCollection, isPrimitive, types) {
|
|
570
|
-
|
|
532
|
+
let bindingParameterType = metadataContext.parent.namespace + "." + metadataContext.name;
|
|
571
533
|
if (isBoundCollection)
|
|
572
534
|
bindingParameterType = "Collection(" + bindingParameterType + ")";
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
for (
|
|
576
|
-
|
|
577
|
-
for (
|
|
578
|
-
|
|
535
|
+
let fnDef;
|
|
536
|
+
let root = NameOrIdentifier.getMetadataRoot(metadataContext);
|
|
537
|
+
for (let i = 0; i < root.schemas.length; i++) {
|
|
538
|
+
let schema = root.schemas[i];
|
|
539
|
+
for (let j = 0; j < schema[operation + "s"].length; j++) {
|
|
540
|
+
let fn = schema[operation + "s"][j];
|
|
579
541
|
if (fn.name === token.raw && fn.isBound) {
|
|
580
|
-
for (
|
|
581
|
-
|
|
542
|
+
for (let k = 0; k < fn.parameters.length; k++) {
|
|
543
|
+
let param = fn.parameters[k];
|
|
582
544
|
if (param.name === "bindingParameter" && param.type === bindingParameterType) {
|
|
583
545
|
fnDef = fn;
|
|
584
546
|
break;
|
|
@@ -597,21 +559,21 @@ var NameOrIdentifier;
|
|
|
597
559
|
return fnDef;
|
|
598
560
|
if (fnDef.returnType.type.indexOf("Collection") === isCollection ? -1 : 0)
|
|
599
561
|
return;
|
|
600
|
-
|
|
562
|
+
let elementType = isCollection ? fnDef.returnType.type.slice(11, -1) : fnDef.returnType.type;
|
|
601
563
|
if (NameOrIdentifier.isPrimitiveTypeName(elementType, metadataContext) && !isPrimitive)
|
|
602
564
|
return;
|
|
603
565
|
if (!NameOrIdentifier.isPrimitiveTypeName(elementType, metadataContext) && isPrimitive)
|
|
604
566
|
return;
|
|
605
567
|
if (isPrimitive)
|
|
606
568
|
return elementType;
|
|
607
|
-
|
|
608
|
-
for (
|
|
609
|
-
|
|
569
|
+
let type;
|
|
570
|
+
for (let i = 0; i < root.schemas.length; i++) {
|
|
571
|
+
let schema = root.schemas[i];
|
|
610
572
|
if (elementType.indexOf(schema.namespace + ".") === 0) {
|
|
611
|
-
for (
|
|
612
|
-
|
|
613
|
-
if (schema.namespace + "." +
|
|
614
|
-
type =
|
|
573
|
+
for (let j = 0; j < schema[types].length; j++) {
|
|
574
|
+
let it = schema[types][j];
|
|
575
|
+
if (schema.namespace + "." + it.name === elementType) {
|
|
576
|
+
type = it;
|
|
615
577
|
break;
|
|
616
578
|
}
|
|
617
579
|
}
|
|
@@ -623,11 +585,11 @@ var NameOrIdentifier;
|
|
|
623
585
|
}
|
|
624
586
|
NameOrIdentifier.getOperationType = getOperationType;
|
|
625
587
|
function entityFunction(value, index, isCollection, metadataContext) {
|
|
626
|
-
|
|
588
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityFunction);
|
|
627
589
|
if (!token)
|
|
628
590
|
return;
|
|
629
591
|
if (typeof metadataContext === "object") {
|
|
630
|
-
|
|
592
|
+
let type = NameOrIdentifier.getOperationType("function", metadataContext, token, isCollection, false, false, "entityTypes");
|
|
631
593
|
if (!type)
|
|
632
594
|
return;
|
|
633
595
|
token.metadata = type;
|
|
@@ -636,11 +598,11 @@ var NameOrIdentifier;
|
|
|
636
598
|
}
|
|
637
599
|
NameOrIdentifier.entityFunction = entityFunction;
|
|
638
600
|
function entityColFunction(value, index, isCollection, metadataContext) {
|
|
639
|
-
|
|
601
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityCollectionFunction);
|
|
640
602
|
if (!token)
|
|
641
603
|
return;
|
|
642
604
|
if (typeof metadataContext === "object") {
|
|
643
|
-
|
|
605
|
+
let type = NameOrIdentifier.getOperationType("function", metadataContext, token, isCollection, true, false, "entityTypes");
|
|
644
606
|
if (!type)
|
|
645
607
|
return;
|
|
646
608
|
token.metadata = type;
|
|
@@ -649,11 +611,11 @@ var NameOrIdentifier;
|
|
|
649
611
|
}
|
|
650
612
|
NameOrIdentifier.entityColFunction = entityColFunction;
|
|
651
613
|
function complexFunction(value, index, isCollection, metadataContext) {
|
|
652
|
-
|
|
614
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexFunction);
|
|
653
615
|
if (!token)
|
|
654
616
|
return;
|
|
655
617
|
if (typeof metadataContext === "object") {
|
|
656
|
-
|
|
618
|
+
let type = NameOrIdentifier.getOperationType("function", metadataContext, token, isCollection, false, false, "complexTypes");
|
|
657
619
|
if (!type)
|
|
658
620
|
return;
|
|
659
621
|
token.metadata = type;
|
|
@@ -662,11 +624,11 @@ var NameOrIdentifier;
|
|
|
662
624
|
}
|
|
663
625
|
NameOrIdentifier.complexFunction = complexFunction;
|
|
664
626
|
function complexColFunction(value, index, isCollection, metadataContext) {
|
|
665
|
-
|
|
627
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexCollectionFunction);
|
|
666
628
|
if (!token)
|
|
667
629
|
return;
|
|
668
630
|
if (typeof metadataContext === "object") {
|
|
669
|
-
|
|
631
|
+
let type = NameOrIdentifier.getOperationType("function", metadataContext, token, isCollection, true, false, "complexTypes");
|
|
670
632
|
if (!type)
|
|
671
633
|
return;
|
|
672
634
|
token.metadata = type;
|
|
@@ -675,11 +637,11 @@ var NameOrIdentifier;
|
|
|
675
637
|
}
|
|
676
638
|
NameOrIdentifier.complexColFunction = complexColFunction;
|
|
677
639
|
function primitiveFunction(value, index, isCollection, metadataContext) {
|
|
678
|
-
|
|
640
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.PrimitiveFunction);
|
|
679
641
|
if (!token)
|
|
680
642
|
return;
|
|
681
643
|
if (typeof metadataContext === "object") {
|
|
682
|
-
|
|
644
|
+
let type = NameOrIdentifier.getOperationType("function", metadataContext, token, isCollection, false, true);
|
|
683
645
|
if (!type)
|
|
684
646
|
return;
|
|
685
647
|
token.metadata = type;
|
|
@@ -688,11 +650,11 @@ var NameOrIdentifier;
|
|
|
688
650
|
}
|
|
689
651
|
NameOrIdentifier.primitiveFunction = primitiveFunction;
|
|
690
652
|
function primitiveColFunction(value, index, isCollection, metadataContext) {
|
|
691
|
-
|
|
653
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.PrimitiveCollectionFunction);
|
|
692
654
|
if (!token)
|
|
693
655
|
return;
|
|
694
656
|
if (typeof metadataContext === "object") {
|
|
695
|
-
|
|
657
|
+
let type = NameOrIdentifier.getOperationType("function", metadataContext, token, isCollection, true, true);
|
|
696
658
|
if (!type)
|
|
697
659
|
return;
|
|
698
660
|
token.metadata = type;
|
|
@@ -701,15 +663,15 @@ var NameOrIdentifier;
|
|
|
701
663
|
}
|
|
702
664
|
NameOrIdentifier.primitiveColFunction = primitiveColFunction;
|
|
703
665
|
function getOperationImportType(operation, metadataContext, token, isCollection, isPrimitive, types) {
|
|
704
|
-
|
|
705
|
-
for (
|
|
706
|
-
|
|
707
|
-
for (
|
|
708
|
-
|
|
709
|
-
for (
|
|
710
|
-
|
|
711
|
-
if (
|
|
712
|
-
fnImport =
|
|
666
|
+
let fnImport;
|
|
667
|
+
for (let i = 0; i < metadataContext.dataServices.schemas.length; i++) {
|
|
668
|
+
let schema = metadataContext.dataServices.schemas[i];
|
|
669
|
+
for (let j = 0; j < schema.entityContainer.length; j++) {
|
|
670
|
+
let container = schema.entityContainer[j];
|
|
671
|
+
for (let k = 0; k < container[operation + "Imports"].length; k++) {
|
|
672
|
+
let it = container[operation + "Imports"][k];
|
|
673
|
+
if (it.name === token.raw) {
|
|
674
|
+
fnImport = it;
|
|
713
675
|
break;
|
|
714
676
|
}
|
|
715
677
|
}
|
|
@@ -721,14 +683,14 @@ var NameOrIdentifier;
|
|
|
721
683
|
}
|
|
722
684
|
if (!fnImport)
|
|
723
685
|
return;
|
|
724
|
-
|
|
725
|
-
for (
|
|
726
|
-
|
|
686
|
+
let fn;
|
|
687
|
+
for (let i = 0; i < metadataContext.dataServices.schemas.length; i++) {
|
|
688
|
+
let schema = metadataContext.dataServices.schemas[i];
|
|
727
689
|
if (fnImport[operation].indexOf(schema.namespace + ".") === 0) {
|
|
728
|
-
for (
|
|
729
|
-
|
|
730
|
-
if (
|
|
731
|
-
fn =
|
|
690
|
+
for (let j = 0; j < schema[operation + "s"].length; j++) {
|
|
691
|
+
let it = schema[operation + "s"][j];
|
|
692
|
+
if (it.name === fnImport.name) {
|
|
693
|
+
fn = it;
|
|
732
694
|
break;
|
|
733
695
|
}
|
|
734
696
|
}
|
|
@@ -742,21 +704,21 @@ var NameOrIdentifier;
|
|
|
742
704
|
return fn;
|
|
743
705
|
if (fn.returnType.type.indexOf("Collection") === isCollection ? -1 : 0)
|
|
744
706
|
return;
|
|
745
|
-
|
|
707
|
+
let elementType = isCollection ? fn.returnType.type.slice(11, -1) : fn.returnType.type;
|
|
746
708
|
if (NameOrIdentifier.isPrimitiveTypeName(elementType, metadataContext) && !isPrimitive)
|
|
747
709
|
return;
|
|
748
710
|
if (!NameOrIdentifier.isPrimitiveTypeName(elementType, metadataContext) && isPrimitive)
|
|
749
711
|
return;
|
|
750
712
|
if (isPrimitive)
|
|
751
713
|
return elementType;
|
|
752
|
-
|
|
753
|
-
for (
|
|
754
|
-
|
|
714
|
+
let type;
|
|
715
|
+
for (let i = 0; i < metadataContext.dataServices.schemas.length; i++) {
|
|
716
|
+
let schema = metadataContext.dataServices.schemas[i];
|
|
755
717
|
if (elementType.indexOf(schema.namespace + ".") === 0) {
|
|
756
|
-
for (
|
|
757
|
-
|
|
758
|
-
if (schema.namespace + "." +
|
|
759
|
-
type =
|
|
718
|
+
for (let j = 0; j < schema[types].length; j++) {
|
|
719
|
+
let it = schema[types][j];
|
|
720
|
+
if (schema.namespace + "." + it.name === elementType) {
|
|
721
|
+
type = it;
|
|
760
722
|
break;
|
|
761
723
|
}
|
|
762
724
|
}
|
|
@@ -768,11 +730,11 @@ var NameOrIdentifier;
|
|
|
768
730
|
}
|
|
769
731
|
NameOrIdentifier.getOperationImportType = getOperationImportType;
|
|
770
732
|
function entityFunctionImport(value, index, metadataContext) {
|
|
771
|
-
|
|
733
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityFunctionImport);
|
|
772
734
|
if (!token)
|
|
773
735
|
return;
|
|
774
736
|
if (typeof metadataContext === "object") {
|
|
775
|
-
|
|
737
|
+
let type = NameOrIdentifier.getOperationImportType("function", metadataContext, token, false, false, "entityTypes");
|
|
776
738
|
if (!type)
|
|
777
739
|
return;
|
|
778
740
|
token.metadata = type;
|
|
@@ -781,11 +743,11 @@ var NameOrIdentifier;
|
|
|
781
743
|
}
|
|
782
744
|
NameOrIdentifier.entityFunctionImport = entityFunctionImport;
|
|
783
745
|
function entityColFunctionImport(value, index, metadataContext) {
|
|
784
|
-
|
|
746
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.EntityCollectionFunctionImport);
|
|
785
747
|
if (!token)
|
|
786
748
|
return;
|
|
787
749
|
if (typeof metadataContext === "object") {
|
|
788
|
-
|
|
750
|
+
let type = NameOrIdentifier.getOperationImportType("function", metadataContext, token, true, false, "entityTypes");
|
|
789
751
|
if (!type)
|
|
790
752
|
return;
|
|
791
753
|
token.metadata = type;
|
|
@@ -794,11 +756,11 @@ var NameOrIdentifier;
|
|
|
794
756
|
}
|
|
795
757
|
NameOrIdentifier.entityColFunctionImport = entityColFunctionImport;
|
|
796
758
|
function complexFunctionImport(value, index, metadataContext) {
|
|
797
|
-
|
|
759
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexFunctionImport);
|
|
798
760
|
if (!token)
|
|
799
761
|
return;
|
|
800
762
|
if (typeof metadataContext === "object") {
|
|
801
|
-
|
|
763
|
+
let type = NameOrIdentifier.getOperationImportType("function", metadataContext, token, false, false, "complexTypes");
|
|
802
764
|
if (!type)
|
|
803
765
|
return;
|
|
804
766
|
token.metadata = type;
|
|
@@ -807,11 +769,11 @@ var NameOrIdentifier;
|
|
|
807
769
|
}
|
|
808
770
|
NameOrIdentifier.complexFunctionImport = complexFunctionImport;
|
|
809
771
|
function complexColFunctionImport(value, index, metadataContext) {
|
|
810
|
-
|
|
772
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.ComplexCollectionFunctionImport);
|
|
811
773
|
if (!token)
|
|
812
774
|
return;
|
|
813
775
|
if (typeof metadataContext === "object") {
|
|
814
|
-
|
|
776
|
+
let type = NameOrIdentifier.getOperationImportType("function", metadataContext, token, true, false, "complexTypes");
|
|
815
777
|
if (!type)
|
|
816
778
|
return;
|
|
817
779
|
token.metadata = type;
|
|
@@ -820,11 +782,11 @@ var NameOrIdentifier;
|
|
|
820
782
|
}
|
|
821
783
|
NameOrIdentifier.complexColFunctionImport = complexColFunctionImport;
|
|
822
784
|
function primitiveFunctionImport(value, index, metadataContext) {
|
|
823
|
-
|
|
785
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.PrimitiveFunctionImport);
|
|
824
786
|
if (!token)
|
|
825
787
|
return;
|
|
826
788
|
if (typeof metadataContext === "object") {
|
|
827
|
-
|
|
789
|
+
let type = NameOrIdentifier.getOperationImportType("function", metadataContext, token, false, true);
|
|
828
790
|
if (!type)
|
|
829
791
|
return;
|
|
830
792
|
token.metadata = type;
|
|
@@ -833,11 +795,11 @@ var NameOrIdentifier;
|
|
|
833
795
|
}
|
|
834
796
|
NameOrIdentifier.primitiveFunctionImport = primitiveFunctionImport;
|
|
835
797
|
function primitiveColFunctionImport(value, index, metadataContext) {
|
|
836
|
-
|
|
798
|
+
let token = NameOrIdentifier.odataIdentifier(value, index, lexer_1.default.TokenType.PrimitiveCollectionFunctionImport);
|
|
837
799
|
if (!token)
|
|
838
800
|
return;
|
|
839
801
|
if (typeof metadataContext === "object") {
|
|
840
|
-
|
|
802
|
+
let type = NameOrIdentifier.getOperationImportType("function", metadataContext, token, true, true);
|
|
841
803
|
if (!type)
|
|
842
804
|
return;
|
|
843
805
|
token.metadata = type;
|