@sap-ux/odata-vocabularies 0.1.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/LICENSE +201 -0
- package/README.md +66 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +26 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/loader.d.ts +16 -0
- package/dist/src/loader.d.ts.map +1 -0
- package/dist/src/loader.js +513 -0
- package/dist/src/loader.js.map +1 -0
- package/dist/src/resources/Org.OData.Aggregation.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Aggregation.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Aggregation.V1.js +642 -0
- package/dist/src/resources/Org.OData.Aggregation.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Authorization.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Authorization.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Authorization.V1.js +179 -0
- package/dist/src/resources/Org.OData.Authorization.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Capabilities.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Capabilities.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Capabilities.V1.js +1320 -0
- package/dist/src/resources/Org.OData.Capabilities.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Core.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Core.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Core.V1.js +655 -0
- package/dist/src/resources/Org.OData.Core.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.JSON.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.JSON.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.JSON.V1.js +49 -0
- package/dist/src/resources/Org.OData.JSON.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Measures.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Measures.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Measures.V1.js +90 -0
- package/dist/src/resources/Org.OData.Measures.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Repeatability.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Repeatability.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Repeatability.V1.js +58 -0
- package/dist/src/resources/Org.OData.Repeatability.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Temporal.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Temporal.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Temporal.V1.js +219 -0
- package/dist/src/resources/Org.OData.Temporal.V1.js.map +1 -0
- package/dist/src/resources/Org.OData.Validation.V1.d.ts +4 -0
- package/dist/src/resources/Org.OData.Validation.V1.d.ts.map +1 -0
- package/dist/src/resources/Org.OData.Validation.V1.js +176 -0
- package/dist/src/resources/Org.OData.Validation.V1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Analytics.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.Analytics.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Analytics.v1.js +204 -0
- package/dist/src/resources/com.sap.vocabularies.Analytics.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.CDS.v1.d.ts +154 -0
- package/dist/src/resources/com.sap.vocabularies.CDS.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.CDS.v1.js +287 -0
- package/dist/src/resources/com.sap.vocabularies.CDS.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.CodeList.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.CodeList.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.CodeList.v1.js +88 -0
- package/dist/src/resources/com.sap.vocabularies.CodeList.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Common.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.Common.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Common.v1.js +1418 -0
- package/dist/src/resources/com.sap.vocabularies.Common.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Communication.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.Communication.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Communication.v1.js +482 -0
- package/dist/src/resources/com.sap.vocabularies.Communication.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.DataIntegration.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.DataIntegration.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.DataIntegration.v1.js +90 -0
- package/dist/src/resources/com.sap.vocabularies.DataIntegration.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.DirectEdit.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.DirectEdit.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.DirectEdit.v1.js +72 -0
- package/dist/src/resources/com.sap.vocabularies.DirectEdit.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Graph.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.Graph.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Graph.v1.js +90 -0
- package/dist/src/resources/com.sap.vocabularies.Graph.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.HTML5.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.HTML5.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.HTML5.v1.js +98 -0
- package/dist/src/resources/com.sap.vocabularies.HTML5.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Hierarchy.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.Hierarchy.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Hierarchy.v1.js +285 -0
- package/dist/src/resources/com.sap.vocabularies.Hierarchy.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.ODM.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.ODM.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.ODM.v1.js +88 -0
- package/dist/src/resources/com.sap.vocabularies.ODM.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.PDF.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.PDF.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.PDF.v1.js +136 -0
- package/dist/src/resources/com.sap.vocabularies.PDF.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.PersonalData.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.PersonalData.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.PersonalData.v1.js +169 -0
- package/dist/src/resources/com.sap.vocabularies.PersonalData.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Session.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.Session.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.Session.v1.js +89 -0
- package/dist/src/resources/com.sap.vocabularies.Session.v1.js.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.UI.v1.d.ts +4 -0
- package/dist/src/resources/com.sap.vocabularies.UI.v1.d.ts.map +1 -0
- package/dist/src/resources/com.sap.vocabularies.UI.v1.js +2021 -0
- package/dist/src/resources/com.sap.vocabularies.UI.v1.js.map +1 -0
- package/dist/src/resources/index.d.ts +12 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +110 -0
- package/dist/src/resources/index.js.map +1 -0
- package/dist/src/types/base-types.d.ts +47 -0
- package/dist/src/types/base-types.d.ts.map +1 -0
- package/dist/src/types/base-types.js +34 -0
- package/dist/src/types/base-types.js.map +1 -0
- package/dist/src/types/index.d.ts +4 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +20 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/names.d.ts +133 -0
- package/dist/src/types/names.d.ts.map +1 -0
- package/dist/src/types/names.js +136 -0
- package/dist/src/types/names.js.map +1 -0
- package/dist/src/types/vocabulary-service.d.ts +164 -0
- package/dist/src/types/vocabulary-service.d.ts.map +1 -0
- package/dist/src/types/vocabulary-service.js +19 -0
- package/dist/src/types/vocabulary-service.js.map +1 -0
- package/dist/src/vocabulary-service.d.ts +251 -0
- package/dist/src/vocabulary-service.d.ts.map +1 -0
- package/dist/src/vocabulary-service.js +732 -0
- package/dist/src/vocabulary-service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.loadVocabulariesInformation = exports.parseEnumTypeDefinition = void 0;
|
|
27
|
+
const resources_1 = __importStar(require("./resources"));
|
|
28
|
+
const types_1 = require("./types");
|
|
29
|
+
const PROPERTY_PATTERN = /^(\w){1,128}$/;
|
|
30
|
+
const SUPPORTED_VOCABULARY_NAMESPACES = new Set([
|
|
31
|
+
'Org.OData.Aggregation.V1',
|
|
32
|
+
'Org.OData.Authorization.V1',
|
|
33
|
+
'Org.OData.Capabilities.V1',
|
|
34
|
+
'Org.OData.Core.V1',
|
|
35
|
+
'Org.OData.Measures.V1',
|
|
36
|
+
'Org.OData.Repeatability.V1',
|
|
37
|
+
'Org.OData.Temporal.V1',
|
|
38
|
+
'Org.OData.Validation.V1',
|
|
39
|
+
'Org.OData.JSON.V1',
|
|
40
|
+
'com.sap.vocabularies.Analytics.v1',
|
|
41
|
+
'com.sap.vocabularies.CDS.v1',
|
|
42
|
+
'com.sap.vocabularies.CodeList.v1',
|
|
43
|
+
'com.sap.vocabularies.Common.v1',
|
|
44
|
+
'com.sap.vocabularies.Communication.v1',
|
|
45
|
+
'com.sap.vocabularies.DataIntegration.v1',
|
|
46
|
+
'com.sap.vocabularies.DirectEdit.v1',
|
|
47
|
+
'com.sap.vocabularies.Graph.v1',
|
|
48
|
+
'com.sap.vocabularies.ODM.v1',
|
|
49
|
+
'com.sap.vocabularies.PDF.v1',
|
|
50
|
+
'com.sap.vocabularies.PersonalData.v1',
|
|
51
|
+
'com.sap.vocabularies.Hierarchy.v1',
|
|
52
|
+
'com.sap.vocabularies.Session.v1',
|
|
53
|
+
'com.sap.vocabularies.UI.v1',
|
|
54
|
+
'com.sap.vocabularies.HTML5.v1'
|
|
55
|
+
]);
|
|
56
|
+
let vocabulariesInformationStatic;
|
|
57
|
+
let vocabulariesInformationStaticCds;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param base Vocabulary object
|
|
61
|
+
* @param raw CSDL object
|
|
62
|
+
* @param prefix Annotation prefix
|
|
63
|
+
*/
|
|
64
|
+
function fillBaseProperties(base, raw, prefix = '') {
|
|
65
|
+
var _a;
|
|
66
|
+
const description = raw[`${prefix}@Org.OData.Core.V1.Description`];
|
|
67
|
+
if (description !== undefined) {
|
|
68
|
+
base.description = description;
|
|
69
|
+
}
|
|
70
|
+
const longDescription = raw[`${prefix}@Org.OData.Core.V1.LongDescription`];
|
|
71
|
+
if (longDescription !== undefined) {
|
|
72
|
+
base.longDescription = longDescription;
|
|
73
|
+
}
|
|
74
|
+
const experimental = raw[`${prefix}@com.sap.vocabularies.Common.v1.Experimental`];
|
|
75
|
+
if (experimental !== undefined) {
|
|
76
|
+
base.experimental = experimental;
|
|
77
|
+
}
|
|
78
|
+
// deprecated status
|
|
79
|
+
const revisions = (_a = raw[`${prefix}@Org.OData.Core.V1.Revisions`]) !== null && _a !== void 0 ? _a : [];
|
|
80
|
+
const deprecatedRevisions = revisions.find((revision) => revision.Kind === 'Deprecated');
|
|
81
|
+
if (deprecatedRevisions) {
|
|
82
|
+
base.deprecated = true;
|
|
83
|
+
base.deprecatedDescription = deprecatedRevisions.Description;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @param primitiveType Vocabulary Object
|
|
89
|
+
* @param raw CSDL Object
|
|
90
|
+
*/
|
|
91
|
+
function fillPrimitiveTypeProperties(primitiveType, raw) {
|
|
92
|
+
fillBaseProperties(primitiveType, raw);
|
|
93
|
+
if (raw.$UnderlyingType !== undefined) {
|
|
94
|
+
primitiveType.underlyingType = raw.$UnderlyingType;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @param raw CSDL Object
|
|
100
|
+
* @returns Facets
|
|
101
|
+
*/
|
|
102
|
+
function getFacets(raw) {
|
|
103
|
+
const facets = {};
|
|
104
|
+
if (raw.$Nullable !== undefined) {
|
|
105
|
+
facets.isNullable = !!raw.$Nullable;
|
|
106
|
+
}
|
|
107
|
+
if (raw.$Precision !== undefined && Number.isInteger(raw.$Precision)) {
|
|
108
|
+
facets.precision = raw.$Precision;
|
|
109
|
+
}
|
|
110
|
+
return Object.keys(facets).length ? facets : undefined;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param raw CSDL Object
|
|
115
|
+
* @returns Allowed values
|
|
116
|
+
*/
|
|
117
|
+
function parseAllowedValues(raw) {
|
|
118
|
+
const rawAllowedValue = raw['@Org.OData.Validation.V1.AllowedValues'];
|
|
119
|
+
if (rawAllowedValue === null || rawAllowedValue === void 0 ? void 0 : rawAllowedValue.length) {
|
|
120
|
+
return rawAllowedValue.map((rawValue) => {
|
|
121
|
+
var _a;
|
|
122
|
+
return ({
|
|
123
|
+
value: rawValue.Value,
|
|
124
|
+
description: rawValue['@Org.OData.Core.V1.Description'],
|
|
125
|
+
longDescription: (_a = rawValue['@Org.OData.Core.V1.LongDescription']) !== null && _a !== void 0 ? _a : ''
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @param key string
|
|
134
|
+
* @returns boolean
|
|
135
|
+
*/
|
|
136
|
+
const isValidKey = (key) => {
|
|
137
|
+
const maxLength = 512;
|
|
138
|
+
if (key.startsWith('$') && key.length <= maxLength) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
if (key.indexOf('@') >= 0 && key.length <= maxLength) {
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
return false;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
* @param raw CSDL Object
|
|
149
|
+
* @returns Constraints
|
|
150
|
+
*/
|
|
151
|
+
function getConstraints(raw) {
|
|
152
|
+
const constraints = {};
|
|
153
|
+
const allowedValues = parseAllowedValues(raw);
|
|
154
|
+
if (allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.length) {
|
|
155
|
+
constraints.allowedValues = allowedValues;
|
|
156
|
+
}
|
|
157
|
+
const allowedTerms = raw['@Org.OData.Validation.V1.AllowedTerms'];
|
|
158
|
+
if (allowedTerms === null || allowedTerms === void 0 ? void 0 : allowedTerms.length) {
|
|
159
|
+
constraints.allowedTerms = allowedTerms.map(getFullyQualifiedAllowedTermName);
|
|
160
|
+
}
|
|
161
|
+
const isLanguageDependent = raw['@Org.OData.Core.V1.IsLanguageDependent'];
|
|
162
|
+
if (isLanguageDependent !== undefined) {
|
|
163
|
+
constraints.isLanguageDependent = !!isLanguageDependent;
|
|
164
|
+
}
|
|
165
|
+
const requiresType = raw['@Org.OData.Core.V1.RequiresType'];
|
|
166
|
+
if (requiresType) {
|
|
167
|
+
constraints.requiresType = requiresType;
|
|
168
|
+
}
|
|
169
|
+
const openPropertyTypeConstraints = raw['@Org.OData.Validation.V1.OpenPropertyTypeConstraint'];
|
|
170
|
+
if (openPropertyTypeConstraints) {
|
|
171
|
+
constraints.openPropertyTypeConstraints = openPropertyTypeConstraints;
|
|
172
|
+
}
|
|
173
|
+
return constraints;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @param name Name of the type definition
|
|
178
|
+
* @param raw CSDL Object
|
|
179
|
+
* @returns Vocabulary Object
|
|
180
|
+
*/
|
|
181
|
+
function parseTypeDefinition(name, raw) {
|
|
182
|
+
const typeDef = { kind: types_1.TYPE_DEFINITION_KIND, name: name };
|
|
183
|
+
fillPrimitiveTypeProperties(typeDef, raw);
|
|
184
|
+
const facets = getFacets(raw);
|
|
185
|
+
if (facets) {
|
|
186
|
+
typeDef.facets = facets;
|
|
187
|
+
}
|
|
188
|
+
// constraints
|
|
189
|
+
const constraints = getConstraints(raw);
|
|
190
|
+
if (Object.keys(constraints).length) {
|
|
191
|
+
typeDef.constraints = constraints;
|
|
192
|
+
}
|
|
193
|
+
return typeDef;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
* @param name Name of the enum
|
|
198
|
+
* @param raw CSDL Object
|
|
199
|
+
* @returns Vocabulary Object
|
|
200
|
+
*/
|
|
201
|
+
function parseEnumTypeDefinition(name, raw) {
|
|
202
|
+
const enumType = {
|
|
203
|
+
kind: types_1.ENUM_TYPE_KIND,
|
|
204
|
+
name: name,
|
|
205
|
+
isFlags: false,
|
|
206
|
+
values: [],
|
|
207
|
+
deprecated: false
|
|
208
|
+
};
|
|
209
|
+
try {
|
|
210
|
+
fillPrimitiveTypeProperties(enumType, raw);
|
|
211
|
+
enumType.isFlags = raw.$IsFlags === true;
|
|
212
|
+
// scan for enum values
|
|
213
|
+
enumType.values = Object.keys(raw)
|
|
214
|
+
.filter((key) => !isValidKey(key))
|
|
215
|
+
.map((key) => {
|
|
216
|
+
const value = parseInt(raw[key], 10);
|
|
217
|
+
const enumValue = {
|
|
218
|
+
kind: types_1.ENUM_VALUE_KIND,
|
|
219
|
+
name: key,
|
|
220
|
+
value
|
|
221
|
+
};
|
|
222
|
+
fillBaseProperties(enumValue, raw, key);
|
|
223
|
+
return enumValue;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
catch (e) {
|
|
227
|
+
return enumType;
|
|
228
|
+
}
|
|
229
|
+
return enumType;
|
|
230
|
+
}
|
|
231
|
+
exports.parseEnumTypeDefinition = parseEnumTypeDefinition;
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
* @param name Name of the complex type
|
|
235
|
+
* @param raw CSDL Object
|
|
236
|
+
* @returns Vocabulary Object
|
|
237
|
+
*/
|
|
238
|
+
function parseComplexType(name, raw) {
|
|
239
|
+
const complexType = { kind: types_1.COMPLEX_TYPE_KIND, name: name, properties: new Map() };
|
|
240
|
+
fillPrimitiveTypeProperties(complexType, raw);
|
|
241
|
+
if (raw.$BaseType !== undefined) {
|
|
242
|
+
complexType.baseType = raw.$BaseType;
|
|
243
|
+
}
|
|
244
|
+
if (raw.$Abstract !== undefined) {
|
|
245
|
+
complexType.isAbstract = !!raw.$Abstract;
|
|
246
|
+
}
|
|
247
|
+
if (raw.$OpenType !== undefined) {
|
|
248
|
+
complexType.isOpenType = !!raw.$OpenType;
|
|
249
|
+
}
|
|
250
|
+
// collect properties
|
|
251
|
+
Object.keys(raw)
|
|
252
|
+
.filter((key) => !isValidKey(key))
|
|
253
|
+
.forEach((key) => {
|
|
254
|
+
var _a;
|
|
255
|
+
const propRaw = raw[key];
|
|
256
|
+
const property = {
|
|
257
|
+
kind: types_1.PROPERTY_KIND,
|
|
258
|
+
name: key,
|
|
259
|
+
type: (_a = propRaw.$Type) !== null && _a !== void 0 ? _a : 'Edm.String',
|
|
260
|
+
isCollection: !!propRaw.$Collection
|
|
261
|
+
};
|
|
262
|
+
fillBaseProperties(property, propRaw);
|
|
263
|
+
if (propRaw.$DefaultValue !== undefined) {
|
|
264
|
+
property.defaultValue = propRaw.$DefaultValue;
|
|
265
|
+
}
|
|
266
|
+
// facets
|
|
267
|
+
const facets = getFacets(propRaw);
|
|
268
|
+
if (facets) {
|
|
269
|
+
property.facets = facets;
|
|
270
|
+
}
|
|
271
|
+
// constraints
|
|
272
|
+
const constraints = getConstraints(propRaw);
|
|
273
|
+
const derivedTypeConstraints = propRaw['@Org.OData.Validation.V1.DerivedTypeConstraint'];
|
|
274
|
+
if (derivedTypeConstraints === null || derivedTypeConstraints === void 0 ? void 0 : derivedTypeConstraints.length) {
|
|
275
|
+
constraints.derivedTypeConstraints = derivedTypeConstraints;
|
|
276
|
+
}
|
|
277
|
+
if (Object.keys(constraints).length) {
|
|
278
|
+
property.constraints = constraints;
|
|
279
|
+
}
|
|
280
|
+
complexType.properties.set(property.name, property);
|
|
281
|
+
});
|
|
282
|
+
return complexType;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
*
|
|
286
|
+
* @param name Name of the term
|
|
287
|
+
* @param raw CSDL Object
|
|
288
|
+
* @returns Vocabulary Object
|
|
289
|
+
*/
|
|
290
|
+
function parseTerm(name, raw) {
|
|
291
|
+
var _a;
|
|
292
|
+
const term = {
|
|
293
|
+
kind: types_1.TERM_KIND,
|
|
294
|
+
name: name,
|
|
295
|
+
type: (_a = raw.$Type) !== null && _a !== void 0 ? _a : 'Edm.String',
|
|
296
|
+
isCollection: !!raw.$Collection
|
|
297
|
+
};
|
|
298
|
+
fillBaseProperties(term, raw);
|
|
299
|
+
if (raw.$DefaultValue !== undefined) {
|
|
300
|
+
term.defaultValue = raw.$DefaultValue;
|
|
301
|
+
}
|
|
302
|
+
if (raw.$AppliesTo !== undefined) {
|
|
303
|
+
term.appliesTo = raw.$AppliesTo;
|
|
304
|
+
}
|
|
305
|
+
if (raw.$BaseTerm !== undefined) {
|
|
306
|
+
term.baseTerm = raw.$BaseTerm;
|
|
307
|
+
}
|
|
308
|
+
if (raw.$CdsName !== undefined) {
|
|
309
|
+
term.cdsName = raw.$CdsName;
|
|
310
|
+
}
|
|
311
|
+
// facets
|
|
312
|
+
const facets = getFacets(raw);
|
|
313
|
+
if (facets) {
|
|
314
|
+
term.facets = facets;
|
|
315
|
+
}
|
|
316
|
+
// constraints
|
|
317
|
+
const constraints = getConstraints(raw);
|
|
318
|
+
if (Object.keys(constraints).length) {
|
|
319
|
+
term.constraints = constraints;
|
|
320
|
+
}
|
|
321
|
+
return term;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
*
|
|
325
|
+
* @param identifier Name
|
|
326
|
+
* @param element CSDL Object
|
|
327
|
+
* @returns Vocabulary Object
|
|
328
|
+
*/
|
|
329
|
+
function parseSchemaElements(identifier, element) {
|
|
330
|
+
if (element.$Kind !== undefined) {
|
|
331
|
+
switch (element.$Kind) {
|
|
332
|
+
case 'EnumType':
|
|
333
|
+
return parseEnumTypeDefinition(identifier, element);
|
|
334
|
+
case 'TypeDefinition':
|
|
335
|
+
return parseTypeDefinition(identifier, element);
|
|
336
|
+
case 'ComplexType':
|
|
337
|
+
return parseComplexType(identifier, element);
|
|
338
|
+
case 'Term':
|
|
339
|
+
return parseTerm(identifier, element);
|
|
340
|
+
default:
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
*
|
|
347
|
+
* @param includeCds Flag indicating if CDS vocabularies should be loaded
|
|
348
|
+
* @returns Vocabularies
|
|
349
|
+
*/
|
|
350
|
+
const loadVocabulariesInformation = (includeCds) => {
|
|
351
|
+
var _a, _b, _c, _d, _e, _f;
|
|
352
|
+
// try to use cache
|
|
353
|
+
if (includeCds && vocabulariesInformationStaticCds) {
|
|
354
|
+
return vocabulariesInformationStaticCds;
|
|
355
|
+
}
|
|
356
|
+
else if (!includeCds && vocabulariesInformationStatic) {
|
|
357
|
+
return vocabulariesInformationStatic;
|
|
358
|
+
}
|
|
359
|
+
const dictionary = new Map();
|
|
360
|
+
const byTarget = new Map();
|
|
361
|
+
const supportedVocabularies = new Map();
|
|
362
|
+
const namespaceByDefaultAlias = new Map();
|
|
363
|
+
const derivedTypesPerType = new Map();
|
|
364
|
+
const upperCaseNameMap = new Map();
|
|
365
|
+
const addToUpperCaseNameMap = (name, propertyName) => {
|
|
366
|
+
const upperCaseName = name.toUpperCase();
|
|
367
|
+
const currentEntry = upperCaseNameMap.get(upperCaseName);
|
|
368
|
+
if (!propertyName) {
|
|
369
|
+
if (!currentEntry || typeof currentEntry === 'string') {
|
|
370
|
+
upperCaseNameMap.set(upperCaseName, name);
|
|
371
|
+
}
|
|
372
|
+
else if (typeof currentEntry === 'object') {
|
|
373
|
+
upperCaseNameMap.set(upperCaseName, Object.assign(currentEntry, { $Self: name }));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
const upperCasePropName = propertyName.toUpperCase();
|
|
378
|
+
if (!currentEntry) {
|
|
379
|
+
upperCaseNameMap.set(upperCaseName, new Map([['$Self', name]]));
|
|
380
|
+
}
|
|
381
|
+
else if (typeof currentEntry === 'string') {
|
|
382
|
+
upperCaseNameMap.set(upperCaseName, new Map([['$Self', currentEntry]]));
|
|
383
|
+
}
|
|
384
|
+
upperCaseNameMap.get(upperCaseName).set(upperCasePropName, propertyName);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
const getVocabularyUri = (vocabulary) => {
|
|
388
|
+
var _a, _b, _c;
|
|
389
|
+
const links = (_a = vocabulary === null || vocabulary === void 0 ? void 0 : vocabulary['@Org.OData.Core.V1.Links']) !== null && _a !== void 0 ? _a : [];
|
|
390
|
+
const linkMap = new Map();
|
|
391
|
+
for (const link of links) {
|
|
392
|
+
linkMap.set((_b = link.rel) !== null && _b !== void 0 ? _b : '', (_c = link.href) !== null && _c !== void 0 ? _c : '');
|
|
393
|
+
}
|
|
394
|
+
// get url pointing to latest version xml - if not available use alternative
|
|
395
|
+
const latestVersion = linkMap.get('latest-version');
|
|
396
|
+
const alternate = linkMap.get('alternate');
|
|
397
|
+
if (latestVersion === null || latestVersion === void 0 ? void 0 : latestVersion.endsWith('.xml')) {
|
|
398
|
+
return latestVersion;
|
|
399
|
+
}
|
|
400
|
+
else if (alternate === null || alternate === void 0 ? void 0 : alternate.endsWith('.xml')) {
|
|
401
|
+
return alternate;
|
|
402
|
+
}
|
|
403
|
+
else if (latestVersion) {
|
|
404
|
+
return latestVersion;
|
|
405
|
+
}
|
|
406
|
+
else if (alternate) {
|
|
407
|
+
return alternate;
|
|
408
|
+
}
|
|
409
|
+
return '';
|
|
410
|
+
};
|
|
411
|
+
resources_1.NAMESPACE_TO_ALIAS.forEach((alias, namespace) => {
|
|
412
|
+
if (!includeCds && alias === types_1.CDS_VOCABULARY_ALIAS) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
addToUpperCaseNameMap(alias);
|
|
416
|
+
addToUpperCaseNameMap(namespace);
|
|
417
|
+
namespaceByDefaultAlias.set(alias, namespace);
|
|
418
|
+
});
|
|
419
|
+
for (const namespace of SUPPORTED_VOCABULARY_NAMESPACES) {
|
|
420
|
+
if (!includeCds && namespace === types_1.CDS_VOCABULARY_NAMESPACE) {
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
const alias = resources_1.NAMESPACE_TO_ALIAS.get(namespace);
|
|
424
|
+
if (alias) {
|
|
425
|
+
const document = resources_1.default[alias];
|
|
426
|
+
if (document) {
|
|
427
|
+
const vocabulary = document[namespace];
|
|
428
|
+
supportedVocabularies.set(namespace, {
|
|
429
|
+
namespace: namespace,
|
|
430
|
+
defaultAlias: alias,
|
|
431
|
+
defaultUri: getVocabularyUri(vocabulary)
|
|
432
|
+
});
|
|
433
|
+
const properties = Object.keys(vocabulary);
|
|
434
|
+
for (const identifier of properties.filter((property) => PROPERTY_PATTERN.test(property))) {
|
|
435
|
+
const fqName = namespace + '.' + identifier;
|
|
436
|
+
const element = vocabulary[identifier];
|
|
437
|
+
const vocabularyObject = parseSchemaElements(fqName, element);
|
|
438
|
+
if (vocabularyObject) {
|
|
439
|
+
dictionary.set(fqName, vocabularyObject);
|
|
440
|
+
addToUpperCaseNameMap(fqName);
|
|
441
|
+
if (vocabularyObject.kind === types_1.TERM_KIND) {
|
|
442
|
+
for (const targetKind of (_a = vocabularyObject.appliesTo) !== null && _a !== void 0 ? _a : ['']) {
|
|
443
|
+
byTarget.set(targetKind, (_b = byTarget.get(targetKind)) !== null && _b !== void 0 ? _b : new Set());
|
|
444
|
+
(_c = byTarget.get(targetKind)) === null || _c === void 0 ? void 0 : _c.add(fqName);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
else if (vocabularyObject.kind === types_1.COMPLEX_TYPE_KIND) {
|
|
448
|
+
vocabularyObject.properties.forEach((property) => {
|
|
449
|
+
addToUpperCaseNameMap(fqName, property.name);
|
|
450
|
+
});
|
|
451
|
+
const baseType = vocabularyObject.baseType;
|
|
452
|
+
if (baseType) {
|
|
453
|
+
const baseName = (_d = baseType.split('.').pop()) !== null && _d !== void 0 ? _d : '';
|
|
454
|
+
const baseElement = vocabulary[baseName];
|
|
455
|
+
if (baseElement) {
|
|
456
|
+
const vocabularyBaseObject = parseSchemaElements(baseType, baseElement);
|
|
457
|
+
// add property of baseType to fqName
|
|
458
|
+
if ((vocabularyBaseObject === null || vocabularyBaseObject === void 0 ? void 0 : vocabularyBaseObject.kind) === types_1.COMPLEX_TYPE_KIND) {
|
|
459
|
+
vocabularyBaseObject.properties.forEach((property) => {
|
|
460
|
+
addToUpperCaseNameMap(fqName, property.name);
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
derivedTypesPerType.set(baseType, (_e = derivedTypesPerType.get(baseType)) !== null && _e !== void 0 ? _e : new Map());
|
|
465
|
+
(_f = derivedTypesPerType.get(baseType)) === null || _f === void 0 ? void 0 : _f.set(fqName, !!vocabularyObject.isAbstract);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (vocabularyObject.kind === types_1.ENUM_TYPE_KIND) {
|
|
469
|
+
vocabularyObject.values.forEach((value) => {
|
|
470
|
+
addToUpperCaseNameMap(fqName, value.name);
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
const vocabulariesInformation = {
|
|
479
|
+
dictionary,
|
|
480
|
+
byTarget,
|
|
481
|
+
derivedTypesPerType,
|
|
482
|
+
supportedVocabularies,
|
|
483
|
+
namespaceByDefaultAlias,
|
|
484
|
+
upperCaseNameMap
|
|
485
|
+
};
|
|
486
|
+
// fill cache
|
|
487
|
+
if (includeCds) {
|
|
488
|
+
vocabulariesInformationStaticCds = vocabulariesInformation;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
vocabulariesInformationStatic = vocabulariesInformation;
|
|
492
|
+
}
|
|
493
|
+
return vocabulariesInformation;
|
|
494
|
+
};
|
|
495
|
+
exports.loadVocabulariesInformation = loadVocabulariesInformation;
|
|
496
|
+
/**
|
|
497
|
+
*
|
|
498
|
+
* @param allowedTerm Term name
|
|
499
|
+
* @returns fully qualified term name
|
|
500
|
+
*/
|
|
501
|
+
function getFullyQualifiedAllowedTermName(allowedTerm) {
|
|
502
|
+
const segments = allowedTerm.split('.');
|
|
503
|
+
if (segments.length !== 2) {
|
|
504
|
+
return allowedTerm;
|
|
505
|
+
}
|
|
506
|
+
const namespace = resources_1.ALIAS_TO_NAMESPACE.get(segments[0]);
|
|
507
|
+
if (!namespace) {
|
|
508
|
+
return allowedTerm;
|
|
509
|
+
}
|
|
510
|
+
segments[0] = namespace;
|
|
511
|
+
return segments.join('.');
|
|
512
|
+
}
|
|
513
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,yDAAmF;AAmBnF,mCASiB;AAEjB,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,MAAM,+BAA+B,GAA6B,IAAI,GAAG,CAAC;IACtE,0BAA0B;IAC1B,4BAA4B;IAC5B,2BAA2B;IAC3B,mBAAmB;IACnB,uBAAuB;IACvB,4BAA4B;IAC5B,uBAAuB;IACvB,yBAAyB;IACzB,mBAAmB;IACnB,mCAAmC;IACnC,6BAA6B;IAC7B,kCAAkC;IAClC,gCAAgC;IAChC,uCAAuC;IACvC,yCAAyC;IACzC,oCAAoC;IACpC,+BAA+B;IAC/B,6BAA6B;IAC7B,6BAA6B;IAC7B,sCAAsC;IACtC,mCAAmC;IACnC,iCAAiC;IACjC,4BAA4B;IAC5B,+BAA+B;CAClC,CAAC,CAAC;AAEH,IAAI,6BAAkE,CAAC;AACvE,IAAI,gCAAqE,CAAC;AAE1E;;;;;GAKG;AACH,SAAS,kBAAkB,CACvB,IAA0B,EAC1B,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