@sap/cds-dk 10.0.5 → 10.0.7

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 (58) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/bin/export.js +1 -1
  3. package/bin/version.js +7 -3
  4. package/lib/build/plugins/hana/index.js +19 -2
  5. package/lib/import/asyncapi/parserContext.js +136 -54
  6. package/lib/init/projectReader.js +4 -2
  7. package/lib/init/template/ams/files/package.json.hbs +1 -1
  8. package/lib/init/template/nodejs/index.js +4 -2
  9. package/lib/init/template/test/files/test/test.xs.hbs +3 -2
  10. package/lib/init/template/xsuaa/index.js +11 -7
  11. package/node_modules/@cap-js/openapi/lib/compile/csdl.js +3 -3
  12. package/node_modules/@cap-js/openapi/lib/compile/csdl2openapi.js +111 -103
  13. package/node_modules/@cap-js/openapi/lib/compile/diagram.js +4 -4
  14. package/node_modules/@cap-js/openapi/lib/compile/types.d.ts +3 -1
  15. package/node_modules/@cap-js/openapi/package.json +3 -3
  16. package/node_modules/@sap/cds/CHANGELOG.md +16 -0
  17. package/node_modules/@sap/cds/lib/compile/for/nodejs.js +1 -0
  18. package/node_modules/@sap/cds/lib/env/defaults.js +1 -0
  19. package/node_modules/@sap/cds/lib/plugins.js +4 -2
  20. package/node_modules/@sap/cds/lib/srv/srv-handlers.js +1 -1
  21. package/node_modules/@sap/cds/libx/_runtime/common/Service.js +1 -1
  22. package/node_modules/@sap/cds/libx/_runtime/messaging/common-utils/authorizedRequest.js +3 -2
  23. package/node_modules/@sap/cds/libx/_runtime/remote/Service.js +1 -1
  24. package/node_modules/@sap/cds/package.json +1 -1
  25. package/node_modules/@sap/cds-compiler/CHANGELOG.md +12 -0
  26. package/node_modules/@sap/cds-compiler/lib/compiler/populate.js +1 -0
  27. package/node_modules/@sap/cds-compiler/lib/compiler/resolve.js +1 -1
  28. package/node_modules/@sap/cds-compiler/lib/model/csnUtils.js +13 -8
  29. package/node_modules/@sap/cds-compiler/package.json +1 -1
  30. package/node_modules/@sap/cds-mtxs/CHANGELOG.md +36 -0
  31. package/node_modules/@sap/cds-mtxs/bin/cds-mtx-migrate.js +32 -48
  32. package/node_modules/@sap/cds-mtxs/bin/cds-mtx.js +1 -0
  33. package/node_modules/@sap/cds-mtxs/cds-plugin.js +18 -0
  34. package/node_modules/@sap/cds-mtxs/lib/migration/migration.js +3 -408
  35. package/node_modules/@sap/cds-mtxs/package.json +1 -1
  36. package/node_modules/@sap/cds-mtxs/srv/cf/abstract-provisioning-service.js +5 -6
  37. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/annotations.js +5 -2
  38. package/node_modules/@sap/cds-mtxs/srv/extensibility/linter/index.js +6 -5
  39. package/node_modules/@sap/cds-mtxs/srv/extensibility-service.cds +0 -11
  40. package/node_modules/@sap/cds-mtxs/srv/extensibility-service.js +12 -22
  41. package/node_modules/@sap/cds-mtxs/srv/jobs-service.js +30 -24
  42. package/node_modules/@sap/cds-mtxs/srv/model-provider.js +2 -2
  43. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/ctnr-mgr-base.js +5 -2
  44. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/hdi.js +5 -3
  45. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/srv-mgr.js +3 -2
  46. package/node_modules/@sap/cds-mtxs/srv/plugins/hana/tms.js +17 -0
  47. package/node_modules/@sap/cds-mtxs/srv/plugins/hana.js +14 -13
  48. package/node_modules/media-typer/README.md +15 -14
  49. package/node_modules/media-typer/index.js +0 -8
  50. package/node_modules/media-typer/package.json +16 -12
  51. package/node_modules/sax/lib/sax.js +27 -9
  52. package/node_modules/sax/package.json +1 -1
  53. package/node_modules/ws/package.json +1 -1
  54. package/package.json +4 -4
  55. package/lib/init/template/nodejs/files/.gitignore.hbs +0 -34
  56. package/node_modules/@sap/cds-mtxs/lib/migration/extension-project-builder.js +0 -129
  57. package/node_modules/@sap/cds-mtxs/lib/migration/extension-project.js +0 -89
  58. package/node_modules/@sap/cds-mtxs/lib/migration/mtx-adapter.js +0 -230
@@ -88,7 +88,7 @@ const ER_ANNOTATIONS = Object.freeze(
88
88
  * Construct an OpenAPI description from a CSDL document
89
89
  * @param {CSDL} csdl CSDL document
90
90
  * @param {{ url?: string, servers?: object, odataVersion?: string, scheme?: string, host?: string, basePath?: string, diagram?: boolean, maxLevels?: number, shortActionPaths?: boolean }} options Optional parameters
91
- * @return {object} OpenAPI description
91
+ * @return {*} OpenAPI description
92
92
  */
93
93
  module.exports.csdl2openapi = function (
94
94
  csdl,
@@ -271,8 +271,8 @@ module.exports.csdl2openapi = function (
271
271
  /**
272
272
  * Construct the Info Object
273
273
  * @param {CSDL} csdl CSDL document
274
- * @param {object} entityContainer Entity Container object
275
- * @return {object} Info Object
274
+ * @param {*} entityContainer Entity Container object
275
+ * @return {*} Info Object
276
276
  */
277
277
  function getInfo(csdl, entityContainer) {
278
278
  const containerSchema = getContainerSchema(csdl)
@@ -310,7 +310,7 @@ module.exports.csdl2openapi = function (
310
310
  /**
311
311
  * Construct the externalDocs Object
312
312
  * @param {CSDL} csdl CSDL document
313
- * @return {object} externalDocs Object
313
+ * @return {*} externalDocs Object
314
314
  */
315
315
  function getExternalDoc(csdl) {
316
316
  const containerSchema = getContainerSchema(csdl)
@@ -327,7 +327,7 @@ module.exports.csdl2openapi = function (
327
327
  /**
328
328
  * Construct the short text
329
329
  * @param {CSDL} csdl CSDL document
330
- * @param {object} entityContainer Entity Container object
330
+ * @param {*} entityContainer Entity Container object
331
331
  * @return {string} short text
332
332
  */
333
333
  function getShortText(csdl, entityContainer) {
@@ -347,8 +347,8 @@ module.exports.csdl2openapi = function (
347
347
 
348
348
  /**
349
349
  * Construct an array of Server Objects
350
- * @param {object} serviceRoot The service root
351
- * @param {object} serversObject Input servers object
350
+ * @param {*} serviceRoot The service root
351
+ * @param {*} serversObject Input servers object
352
352
  * @return {{url: string}[]} The list of servers
353
353
  */
354
354
  function getServers(serviceRoot, serversObject) {
@@ -371,7 +371,7 @@ module.exports.csdl2openapi = function (
371
371
 
372
372
  /**
373
373
  * Construct an array of Tag Objects from the entity container
374
- * @param {object} container The entity container
374
+ * @param {*} container The entity container
375
375
  * @return {Array} The list of tags
376
376
  */
377
377
  function getTags(container) {
@@ -417,7 +417,7 @@ module.exports.csdl2openapi = function (
417
417
 
418
418
  /**
419
419
  * Construct the Paths Object from the entity container
420
- * @param {object} container Entity container
420
+ * @param {*} container Entity container
421
421
  * @return {Paths} Paths Object
422
422
  */
423
423
  function getPaths(container) {
@@ -464,8 +464,8 @@ module.exports.csdl2openapi = function (
464
464
  * @param {Paths} options.paths Paths Object to augment
465
465
  * @param {string} options.prefix Prefix for path
466
466
  * @param {Array} options.prefixParameters Parameter Objects for prefix
467
- * @param {object} options.element Model element of navigation segment
468
- * @param {object} options.root Root model element
467
+ * @param {*} options.element Model element of navigation segment
468
+ * @param {*} options.root Root model element
469
469
  * @param {string} options.sourceName Name of path source
470
470
  * @param {string} options.targetName Name of path target
471
471
  * @param {null | TargetRestrictions} options.target Target container child of path
@@ -544,7 +544,7 @@ module.exports.csdl2openapi = function (
544
544
 
545
545
  /**
546
546
  * Find navigation restrictions for a navigation path
547
- * @param {object} root Root model element
547
+ * @param {*} root Root model element
548
548
  * @param {string} navigationPath Path for finding navigation restrictions
549
549
  * @return Navigation property restrictions of navigation segment
550
550
  */
@@ -556,7 +556,7 @@ module.exports.csdl2openapi = function (
556
556
 
557
557
  /**
558
558
  * Find non-expandable properties for a navigation path
559
- * @param {object} root Root model element
559
+ * @param {*} root Root model element
560
560
  * @param {string} navigationPath Path for finding navigation restrictions
561
561
  * @return Navigation property restrictions of navigation segment
562
562
  */
@@ -579,14 +579,14 @@ module.exports.csdl2openapi = function (
579
579
  * @param {Paths} options.paths Paths Object to augment
580
580
  * @param {string} options.prefix Prefix for path
581
581
  * @param {Array} options.prefixParameters Parameter Objects for prefix
582
- * @param {object} options.element Model element of navigation segment
583
- * @param {object} options.root Root model element
582
+ * @param {*} options.element Model element of navigation segment
583
+ * @param {*} options.root Root model element
584
584
  * @param {string} options.sourceName Name of path source
585
585
  * @param {string} options.targetName Name of path target
586
586
  * @param {null | object} options.target Target container child of path
587
587
  * @param {number} options.level Number of navigation segments so far
588
588
  * @param {string} options.navigationPath Path for finding navigation restrictions
589
- * @param {object} options.restrictions Navigation property restrictions of navigation segment
589
+ * @param {*} options.restrictions Navigation property restrictions of navigation segment
590
590
  * @param {array} options.nonExpandable Non-expandable navigation properties
591
591
  */
592
592
  function pathItemsWithKey({ paths, prefix, prefixParameters, element, root, sourceName, targetName, target, level, navigationPath, restrictions, nonExpandable }) {
@@ -665,14 +665,14 @@ module.exports.csdl2openapi = function (
665
665
  /**
666
666
  * Construct Operation Object for create
667
667
  * @param {object} options
668
- * @param {object} options.pathItem Path Item Object to augment
669
- * @param {object} options.element Model element of navigation segment
668
+ * @param {*} options.pathItem Path Item Object to augment
669
+ * @param {*} options.element Model element of navigation segment
670
670
  * @param {string} options.name Name of navigation segment
671
671
  * @param {string} options.sourceName Name of path source
672
672
  * @param {string} options.targetName Name of path target
673
673
  * @param {null | TargetRestrictions} options.target Target container child of path
674
674
  * @param {number} options.level Number of navigation segments so far
675
- * @param {object} options.restrictions Navigation property restrictions of navigation segment
675
+ * @param {*} options.restrictions Navigation property restrictions of navigation segment
676
676
  */
677
677
  function operationCreate({ pathItem, element, name, sourceName, targetName, target, level, restrictions }) {
678
678
  const insertRestrictions = restrictions.InsertRestrictions || target?.[meta.voc.Capabilities.InsertRestrictions] || {};
@@ -739,14 +739,14 @@ module.exports.csdl2openapi = function (
739
739
  /**
740
740
  * Construct Operation Object for read
741
741
  * @param {object} options
742
- * @param {object} options.pathItem Path Item Object to augment
743
- * @param {object} options.element Model element of navigation segment
742
+ * @param {*} options.pathItem Path Item Object to augment
743
+ * @param {*} options.element Model element of navigation segment
744
744
  * @param {string} options.name Name of navigation segment
745
745
  * @param {string} options.sourceName Name of path source
746
746
  * @param {string} options.targetName Name of path target
747
747
  * @param {null | TargetRestrictions} options.target Target container child of path
748
748
  * @param {number} options.level Number of navigation segments so far
749
- * @param {object} options.restrictions Navigation property restrictions of navigation segment
749
+ * @param {*} options.restrictions Navigation property restrictions of navigation segment
750
750
  * @param {boolean} options.byKey Read by key
751
751
  * @param {array} options.nonExpandable Non-expandable navigation properties
752
752
  */
@@ -815,8 +815,8 @@ module.exports.csdl2openapi = function (
815
815
 
816
816
  /**
817
817
  * Add custom headers and query options
818
- * @param {object} operation Operation object to augment
819
- * @param {object} restrictions Restrictions for operation
818
+ * @param {*} operation Operation object to augment
819
+ * @param {*} restrictions Restrictions for operation
820
820
  */
821
821
  function customParameters(operation, restrictions) {
822
822
  if (
@@ -835,7 +835,7 @@ module.exports.csdl2openapi = function (
835
835
 
836
836
  /**
837
837
  * Construct custom parameter
838
- * @param {object} custom custom parameter in OData format
838
+ * @param {*} custom custom parameter in OData format
839
839
  * @param {string} location "header" or "query"
840
840
  */
841
841
  function customParameter(custom, location) {
@@ -876,7 +876,7 @@ module.exports.csdl2openapi = function (
876
876
  /**
877
877
  * Add parameter for query option $expand
878
878
  * @param {Array} parameters Array of parameters to augment
879
- * @param {object} element Model element of navigation segment
879
+ * @param {*} element Model element of navigation segment
880
880
  * @param {null | TargetRestrictions} target Target container child of path
881
881
  * @param {array} nonExpandable Non-expandable navigation properties
882
882
  */
@@ -910,7 +910,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
910
910
 
911
911
  /**
912
912
  * Collect navigation paths of a navigation segment and its potentially structured components
913
- * @param {object} element Model element of navigation segment
913
+ * @param {*} element Model element of navigation segment
914
914
  * @param {string} prefix Navigation prefix
915
915
  * @param {number} level Number of navigation segments so far
916
916
  * @return {Array} Array of navigation property paths
@@ -933,7 +933,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
933
933
  * Add parameter for query option $filter
934
934
  * @param {Array} parameters Array of parameters to augment
935
935
  * @param {null | TargetRestrictions} target Target container child of path
936
- * @param {object} restrictions Navigation property restrictions of navigation segment
936
+ * @param {*} restrictions Navigation property restrictions of navigation segment
937
937
  */
938
938
  function optionFilter(parameters, target, restrictions) {
939
939
  const filterRestrictions = restrictions.FilterRestrictions || target?.[meta.voc.Capabilities.FilterRestrictions] || {};
@@ -963,9 +963,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
963
963
  /**
964
964
  * Add parameter for query option $orderby
965
965
  * @param {Array} parameters Array of parameters to augment
966
- * @param {object} element Model element of navigation segment
966
+ * @param {*} element Model element of navigation segment
967
967
  * @param {null | TargetRestrictions} target Target container child of path
968
- * @param {object} restrictions Navigation property restrictions of navigation segment
968
+ * @param {*} restrictions Navigation property restrictions of navigation segment
969
969
  */
970
970
  function optionOrderBy(parameters, element, target, restrictions) {
971
971
  const sortRestrictions = restrictions.SortRestrictions || target?.[meta.voc.Capabilities.SortRestrictions] || {};
@@ -1002,8 +1002,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1002
1002
 
1003
1003
  /**
1004
1004
  * Unpack EnumMember value if it uses CSDL JSON CS01 style, like CAP does
1005
- * @param {string | object} member Qualified name of referenced type
1006
- * @return {object} Reference Object
1005
+ * @param {string | *} member Qualified name of referenced type
1006
+ * @return {*} Reference Object
1007
1007
  */
1008
1008
  function enumMember(member) {
1009
1009
  if (typeof member == 'string')
@@ -1014,8 +1014,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1014
1014
 
1015
1015
  /**
1016
1016
  * Unpack NavigationPropertyPath value if it uses CSDL JSON CS01 style, like CAP does
1017
- * @param {string | object} path Qualified name of referenced type
1018
- * @return {object} Reference Object
1017
+ * @param {string | *} path Qualified name of referenced type
1018
+ * @return {*} Reference Object
1019
1019
  */
1020
1020
  function navigationPropertyPath(path) {
1021
1021
  if (typeof path == 'string')
@@ -1025,8 +1025,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1025
1025
 
1026
1026
  /**
1027
1027
  * Unpack PropertyPath value if it uses CSDL JSON CS01 style, like CAP does
1028
- * @param {string | object} path Qualified name of referenced type
1029
- * @return {object} Reference Object
1028
+ * @param {string | *} path Qualified name of referenced type
1029
+ * @return {*} Reference Object
1030
1030
  */
1031
1031
  function propertyPath(path) {
1032
1032
  if (typeof path == 'string')
@@ -1036,7 +1036,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1036
1036
 
1037
1037
  /**
1038
1038
  * Collect primitive paths of a navigation segment and its potentially structured components
1039
- * @param {object} element Model element of navigation segment
1039
+ * @param {*} element Model element of navigation segment
1040
1040
  * @param {string} prefix Navigation prefix
1041
1041
  * @return {Array} Array of primitive property paths
1042
1042
  */
@@ -1117,7 +1117,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1117
1117
  * Add parameter for query option $search
1118
1118
  * @param {Array} parameters Array of parameters to augment
1119
1119
  * @param {null | TargetRestrictions} target Target container child of path
1120
- * @param {object} restrictions Navigation property restrictions of navigation segment
1120
+ * @param {*} restrictions Navigation property restrictions of navigation segment
1121
1121
  */
1122
1122
  function optionSearch(parameters, target, restrictions) {
1123
1123
  const searchRestrictions = restrictions.SearchRestrictions ?? target?.[meta.voc.Capabilities.SearchRestrictions] ?? {};
@@ -1139,9 +1139,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1139
1139
  /**
1140
1140
  * Add parameter for query option $select
1141
1141
  * @param {Array} parameters Array of parameters to augment
1142
- * @param {object} element Model element of navigation segment
1142
+ * @param {*} element Model element of navigation segment
1143
1143
  * @param {null | TargetRestrictions} target Target container child of path
1144
- * @param {object} restrictions Navigation property restrictions of navigation segment
1144
+ * @param {*} restrictions Navigation property restrictions of navigation segment
1145
1145
  */
1146
1146
  function optionSelect(parameters, element, target, restrictions) {
1147
1147
  const selectSupport = restrictions.SelectSupport ?? target?.[meta.voc.Capabilities.SelectSupport] ?? {};
@@ -1176,7 +1176,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1176
1176
  * Add parameter for query option $skip
1177
1177
  * @param {Array} parameters Array of parameters to augment
1178
1178
  * @param {null | TargetRestrictions} target Target container child of path
1179
- * @param {object} restrictions Navigation property restrictions of navigation segment
1179
+ * @param {*} restrictions Navigation property restrictions of navigation segment
1180
1180
  */
1181
1181
  function optionSkip(parameters, target, restrictions) {
1182
1182
  const supported = restrictions.SkipSupported !== undefined
@@ -1194,7 +1194,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1194
1194
  * Add parameter for query option $top
1195
1195
  * @param {Array} parameters Array of parameters to augment
1196
1196
  * @param {null | TargetRestrictions} target Target container child of path
1197
- * @param {object} restrictions Navigation property restrictions of navigation segment
1197
+ * @param {*} restrictions Navigation property restrictions of navigation segment
1198
1198
  */
1199
1199
  function optionTop(parameters, target, restrictions) {
1200
1200
  const supported = restrictions.TopSupported !== undefined
@@ -1211,13 +1211,13 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1211
1211
  /**
1212
1212
  * Construct Operation Object for update
1213
1213
  * @param {object} options
1214
- * @param {object} options.pathItem Path Item Object to augment
1215
- * @param {object} options.element Model element of navigation segment
1214
+ * @param {*} options.pathItem Path Item Object to augment
1215
+ * @param {*} options.element Model element of navigation segment
1216
1216
  * @param {string} options.name Name of navigation segment
1217
1217
  * @param {string} options.sourceName Name of path source
1218
1218
  * @param {null | TargetRestrictions} options.target Target container child of path
1219
1219
  * @param {number} options.level Number of navigation segments so far
1220
- * @param {object} options.restrictions Navigation property restrictions of navigation segment
1220
+ * @param {*} options.restrictions Navigation property restrictions of navigation segment
1221
1221
  * @param {boolean} [options.byKey=false] Update by key
1222
1222
  */
1223
1223
  function operationUpdate({ pathItem, element, name, sourceName, target, level, restrictions, byKey = false }) {
@@ -1263,13 +1263,13 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1263
1263
  /**
1264
1264
  * Construct Operation Object for delete
1265
1265
  * @param {object} options
1266
- * @param {object} options.pathItem Path Item Object to augment
1267
- * @param {object} options.element Model element of navigation segment
1266
+ * @param {*} options.pathItem Path Item Object to augment
1267
+ * @param {*} options.element Model element of navigation segment
1268
1268
  * @param {string} options.name Name of navigation segment
1269
1269
  * @param {string} options.sourceName Name of path source
1270
1270
  * @param {null | TargetRestrictions} options.target Target container child of path
1271
1271
  * @param {number} options.level Number of navigation segments so far
1272
- * @param {object} options.restrictions Navigation property restrictions of navigation segment
1272
+ * @param {*} options.restrictions Navigation property restrictions of navigation segment
1273
1273
  * @param {boolean} [options.byKey=false] Delete by key
1274
1274
  */
1275
1275
  function operationDelete({ pathItem, element, name, sourceName, target, level, restrictions, byKey = false }) {
@@ -1302,10 +1302,10 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1302
1302
  /**
1303
1303
  * Add path and Path Item Object for media stream access ($value) and stream properties of an entity type
1304
1304
  * @param {object} options
1305
- * @param {object} options.paths The Paths Object to augment
1305
+ * @param {*} options.paths The Paths Object to augment
1306
1306
  * @param {string} options.prefix Prefix for path (the key-qualified entity path)
1307
1307
  * @param {Array} options.prefixParameters Parameter Objects for prefix
1308
- * @param {object} options.type Entity type object
1308
+ * @param {*} options.type Entity type object
1309
1309
  * @param {string} options.name Name of the entity set
1310
1310
  * @param {string} options.sourceName Name of path source
1311
1311
  */
@@ -1387,11 +1387,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1387
1387
  /**
1388
1388
  * Add paths and Path Item Objects for navigation segments
1389
1389
  * @param {object} options
1390
- * @param {object} options.paths The Paths Object to augment
1390
+ * @param {*} options.paths The Paths Object to augment
1391
1391
  * @param {string} options.prefix Prefix for path
1392
1392
  * @param {Array} options.prefixParameters Parameter Objects for prefix
1393
- * @param {object} options.type Entity type object of navigation segment
1394
- * @param {object} options.root Root element
1393
+ * @param {*} options.type Entity type object of navigation segment
1394
+ * @param {*} options.root Root element
1395
1395
  * @param {string} options.sourceName Name of path source
1396
1396
  * @param {number} options.level Number of navigation segments so far
1397
1397
  * @param {string} options.navigationPrefix Path for finding navigation restrictions
@@ -1435,11 +1435,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1435
1435
 
1436
1436
  /**
1437
1437
  * Collect navigation paths of a navigation segment and its potentially structured components
1438
- * @param {object} type Structured type
1439
- * @param {object} map Map of navigation property paths and their types
1438
+ * @param {*} type Structured type
1439
+ * @param {*} map Map of navigation property paths and their types
1440
1440
  * @param {string} prefix Navigation prefix
1441
1441
  * @param {number} level Number of navigation segments so far
1442
- * @return {object} Map of navigation property paths and their types
1442
+ * @return {*} Map of navigation property paths and their types
1443
1443
  */
1444
1444
  function navigationPathMap(type, map = {}, prefix = '', level = 0) {
1445
1445
  const properties = propertiesOfStructuredType(type);
@@ -1455,8 +1455,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1455
1455
 
1456
1456
  /**
1457
1457
  * Construct map of key names for an entity type
1458
- * @param {object} type Entity type object
1459
- * @return {object} Map of key names
1458
+ * @param {*} type Entity type object
1459
+ * @return {*} Map of key names
1460
1460
  */
1461
1461
  function keyMap(type) {
1462
1462
  const map = {};
@@ -1472,8 +1472,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1472
1472
 
1473
1473
  /**
1474
1474
  * Key for path item
1475
- * @param {object} entityType Entity Type object
1476
- * @return {array} Key of entity type or null
1475
+ * @param {*} entityType Entity Type object
1476
+ * @return {array | null} Key of entity type or null
1477
1477
  */
1478
1478
  function getKey(entityType) {
1479
1479
  let type = entityType;
@@ -1488,7 +1488,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1488
1488
 
1489
1489
  /**
1490
1490
  * Get description with fallback
1491
- * @param {object} element Model element
1491
+ * @param {*} element Model element
1492
1492
  * @param {string} [fallback] Optional fallback text
1493
1493
  * @return {string} Description text
1494
1494
  */
@@ -1500,9 +1500,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1500
1500
 
1501
1501
  /**
1502
1502
  * Key for path item
1503
- * @param {object} entityType Entity Type object
1503
+ * @param {*} entityType Entity Type object
1504
1504
  * @param {number} level Number of navigation segments so far
1505
- * @return {object} key: Key segment, parameters: key parameters
1505
+ * @return {*} key: Key segment, parameters: key parameters
1506
1506
  */
1507
1507
  function entityKey(entityType, level) {
1508
1508
  let segment = '';
@@ -1579,7 +1579,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1579
1579
  * @param {Paths} options.paths Paths Object to augment
1580
1580
  * @param {string} options.prefix Prefix for path
1581
1581
  * @param {Array} options.prefixParameters Parameter Objects for prefix
1582
- * @param {object} options.element Model element the operations are bound to
1582
+ * @param {*} options.element Model element the operations are bound to
1583
1583
  * @param {string} options.sourceName Name of path source
1584
1584
  * @param {boolean} [options.byKey=false] Read by key
1585
1585
  */
@@ -1615,7 +1615,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1615
1615
  * Add path and Path Item Object for an action import
1616
1616
  * @param {Paths} paths Paths Object to augment
1617
1617
  * @param {string} name Name of action import
1618
- * @param {object} child Action import object
1618
+ * @param {*} child Action import object
1619
1619
  */
1620
1620
  function pathItemActionImport(paths, name, child) {
1621
1621
  const overload = meta.modelElement(child.$Action).find(pOverload => !pOverload.$IsBound);
@@ -1637,9 +1637,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1637
1637
  * @param {string} options.prefix Prefix for path
1638
1638
  * @param {Array} options.prefixParameters Parameter Objects for prefix
1639
1639
  * @param {string} options.actionName Qualified name of function
1640
- * @param {object} options.overload Function overload
1640
+ * @param {*} options.overload Function overload
1641
1641
  * @param {string} options.sourceName Name of path source
1642
- * @param {object} [options.actionImport={}] Action import
1642
+ * @param {*} [options.actionImport={}] Action import
1643
1643
  */
1644
1644
  function pathItemAction({ paths, prefix, prefixParameters, actionName, overload, sourceName, actionImport = {} }) {
1645
1645
  const name = actionName.indexOf('.') === -1 ? actionName : nameParts(actionName).name;
@@ -1704,7 +1704,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1704
1704
  * Add path and Path Item Object for an action import
1705
1705
  * @param {Paths} paths Paths Object to augment
1706
1706
  * @param {string} name Name of function import
1707
- * @param {object} child Function import object
1707
+ * @param {*} child Function import object
1708
1708
  */
1709
1709
  function pathItemFunctionImport(paths, name, child) {
1710
1710
  const overloads = meta.modelElement(child.$Function);
@@ -1727,9 +1727,9 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1727
1727
  * @param {string} options.prefix Prefix for path
1728
1728
  * @param {Array} options.prefixParameters Parameter Objects for prefix
1729
1729
  * @param {string} options.functionName Qualified name of function
1730
- * @param {object} options.overload Function overload
1730
+ * @param {*} options.overload Function overload
1731
1731
  * @param {string} options.sourceName Name of path source
1732
- * @param {object} [options.functionImport={}] Function Import
1732
+ * @param {*} [options.functionImport={}] Function Import
1733
1733
  */
1734
1734
  function pathItemFunction({ paths, prefix, prefixParameters, functionName, overload, sourceName, functionImport = {} }) {
1735
1735
  const name = functionName.indexOf('.') === -1 ? functionName : nameParts(functionName).name;
@@ -1827,7 +1827,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1827
1827
  /**
1828
1828
  * Add path and Path Item Object for batch requests
1829
1829
  * @param {Paths} paths Paths Object to augment
1830
- * @param {object} container Entity container
1830
+ * @param {*} container Entity container
1831
1831
  */
1832
1832
  function pathItemBatch(paths, container) {
1833
1833
  const batchSupport = container[meta.voc.Capabilities.BatchSupport] || {};
@@ -1890,7 +1890,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1890
1890
  * @param {object} options
1891
1891
  * @param {string | number} options.code HTTP response code
1892
1892
  * @param {string} options.description Description
1893
- * @param {object} options.type Response type object
1893
+ * @param {*} options.type Response type object
1894
1894
  * @param {array} options.errors Array of operation-specific status codes with descriptions
1895
1895
  * @param {boolean} [options.isCount=true]
1896
1896
  * @returns {Record<string, Response>}
@@ -1959,8 +1959,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1959
1959
  /**
1960
1960
  * Construct the Components Object from the types of the CSDL document
1961
1961
  * @param {CSDL} csdl CSDL document
1962
- * @param {object} entityContainer Entity Container object
1963
- * @return {object} Components Object
1962
+ * @param {*} entityContainer Entity Container object
1963
+ * @return {*} Components Object
1964
1964
  */
1965
1965
  function getComponents(csdl, entityContainer) {
1966
1966
  const c = {
@@ -1989,7 +1989,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
1989
1989
  /**
1990
1990
  * Construct Schema Objects from the types of the CSDL document
1991
1991
  * @param {CSDL} csdl CSDL document
1992
- * @return {object} Map of Schema Objects
1992
+ * @return {*} Map of Schema Objects
1993
1993
  */
1994
1994
  function getSchemas(csdl) {
1995
1995
  const unordered = {};
@@ -2044,7 +2044,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2044
2044
 
2045
2045
  /**
2046
2046
  * Construct Schema Objects from the types of the CSDL document
2047
- * @param {object} schemas Map of Schema Objects to augment
2047
+ * @param {*} schemas Map of Schema Objects to augment
2048
2048
  */
2049
2049
  function inlineTypes(schemas) {
2050
2050
  if (typesToInline.geoPoint) {
@@ -2072,11 +2072,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2072
2072
 
2073
2073
  /**
2074
2074
  * Construct Schema Objects for an enumeration type
2075
- * @param {object} schemas Map of Schema Objects to augment
2075
+ * @param {*} schemas Map of Schema Objects to augment
2076
2076
  * @param {string} qualifier Qualifier for structured type
2077
2077
  * @param {string} name Simple name of structured type
2078
- * @param {object} type Structured type
2079
- * @return {object} Map of Schemas Objects
2078
+ * @param {*} type Structured type
2079
+ * @return {*} Map of Schemas Objects
2080
2080
  */
2081
2081
  function schemaForEnumerationType(schemas, qualifier, name, type) {
2082
2082
  const members = [];
@@ -2096,11 +2096,11 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2096
2096
 
2097
2097
  /**
2098
2098
  * Construct Schema Objects for a type definition
2099
- * @param {object} schemas Map of Schema Objects to augment
2099
+ * @param {*} schemas Map of Schema Objects to augment
2100
2100
  * @param {string} qualifier Qualifier for structured type
2101
2101
  * @param {string} name Simple name of structured type
2102
- * @param {object} type Structured type
2103
- * @return {object} Map of Schemas Objects
2102
+ * @param {*} type Structured type
2103
+ * @return {*} Map of Schemas Objects
2104
2104
  */
2105
2105
  function schemaForTypeDefinition(schemas, qualifier, name, type) {
2106
2106
  const s = getSchema({$Type: type.$UnderlyingType, ...type});
@@ -2113,12 +2113,12 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2113
2113
  /**
2114
2114
  * Construct Schema Objects for a structured type
2115
2115
  * @param {object} options
2116
- * @param {object} options.schemas Map of Schema Objects to augment
2116
+ * @param {*} options.schemas Map of Schema Objects to augment
2117
2117
  * @param {string} options.qualifier Qualifier for structured type
2118
2118
  * @param {string} options.name Simple name of structured type
2119
- * @param {object} options.type Structured type
2119
+ * @param {*} options.type Structured type
2120
2120
  * @param {string} options.suffix Suffix for read/create/update
2121
- * @return {object} Map of Schemas Objects
2121
+ * @return {*} Map of Schemas Objects
2122
2122
  */
2123
2123
  function schemasForStructuredType({ schemas, qualifier, name, type, suffix }) {
2124
2124
  const schemaName = `${qualifier}.${name}${suffix}`;
@@ -2200,8 +2200,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2200
2200
 
2201
2201
  /**
2202
2202
  * Add ODM extensions to OpenAPI schema for a structured type
2203
- * @param {object} type Structured type
2204
- * @param {object} schema OpenAPI schema to augment
2203
+ * @param {*} type Structured type
2204
+ * @param {*} schema OpenAPI schema to augment
2205
2205
  */
2206
2206
  function odmExtensions(type, schema) {
2207
2207
  for (const [annotation, openApiExtension] of Object.entries(ODM_ANNOTATIONS)) {
@@ -2211,8 +2211,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2211
2211
 
2212
2212
  /**
2213
2213
  * Add entity relationship extensions to OpenAPI schema for a structured type
2214
- * @param {object} type Structured type
2215
- * @param {object} schema OpenAPI schema to augment
2214
+ * @param {*} type Structured type
2215
+ * @param {*} schema OpenAPI schema to augment
2216
2216
  */
2217
2217
  function erExtensions(type, schema) {
2218
2218
  for (const [annotation, openApiExtension] of Object.entries(ER_ANNOTATIONS)) {
@@ -2222,8 +2222,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2222
2222
 
2223
2223
  /**
2224
2224
  * Collect all properties of a structured type along the inheritance hierarchy
2225
- * @param {object} type Structured type
2226
- * @return {object} Map of properties
2225
+ * @param {*} type Structured type
2226
+ * @return {*} Map of properties
2227
2227
  */
2228
2228
  function propertiesOfStructuredType(type) {
2229
2229
  const properties = (type && type.$BaseType) ? propertiesOfStructuredType(meta.modelElement(type.$BaseType)) : {};
@@ -2237,7 +2237,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2237
2237
 
2238
2238
  /**
2239
2239
  * Construct Parameter Objects for type-independent OData system query options
2240
- * @return {object} Map of Parameter Objects
2240
+ * @return {*} Map of Parameter Objects
2241
2241
  */
2242
2242
  function getParameters() {
2243
2243
  const param = {
@@ -2350,8 +2350,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2350
2350
 
2351
2351
  /**
2352
2352
  * Construct Schema Object for model object referencing a type
2353
- * @param {object} element referencing a type
2354
- * @return {object} Schema Object
2353
+ * @param {*} element referencing a type
2354
+ * @return {*} Schema Object
2355
2355
  */
2356
2356
  function getSchema(element, suffix = '', forParameter = false, forFunction = false) {
2357
2357
 
@@ -2574,20 +2574,24 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2574
2574
  }
2575
2575
  }
2576
2576
 
2577
- if (element[meta.voc.Validation.Maximum] != undefined) {
2577
+ if (element[meta.voc.Validation.Maximum] !== undefined) {
2578
2578
  if (s.$ref) s = { allOf: [s] };
2579
2579
  if (isAnyOfSchema(s) && isNumberSchema(s.anyOf[0])) {
2580
2580
  s.anyOf[0].maximum = element[meta.voc.Validation.Maximum];
2581
+ } else if (isNumberSchema(s)) {
2582
+ s.maximum = element[meta.voc.Validation.Maximum];
2581
2583
  }
2582
2584
  // TODO: this implies that we could be handling an AnyOfSchema here. So exclusiveMinimum is attach to that? Or to its first element, as above?
2583
2585
  // @ts-expect-error
2584
2586
  if (element[meta.voc.Validation.Maximum + meta.voc.Validation.Exclusive]) s.exclusiveMaximum = true;
2585
2587
  }
2586
2588
 
2587
- if (element[meta.voc.Validation.Minimum] != undefined) {
2589
+ if (element[meta.voc.Validation.Minimum] !== undefined) {
2588
2590
  if (s.$ref) s = { allOf: [s] };
2589
2591
  if (isAnyOfSchema(s) && isNumberSchema(s.anyOf[0])) {
2590
2592
  s.anyOf[0].minimum = element[meta.voc.Validation.Minimum];
2593
+ } else if (isNumberSchema(s)) {
2594
+ s.minimum = element[meta.voc.Validation.Minimum];
2591
2595
  }
2592
2596
  // TODO: see above
2593
2597
  // @ts-expect-error
@@ -2599,6 +2603,10 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2599
2603
  type: 'array',
2600
2604
  items: s
2601
2605
  };
2606
+ if (element[meta.voc.Validation.MinItems] !== undefined)
2607
+ s.minItems = element[meta.voc.Validation.MinItems];
2608
+ if (element[meta.voc.Validation.MaxItems] !== undefined)
2609
+ s.maxItems = element[meta.voc.Validation.MaxItems];
2602
2610
  }
2603
2611
 
2604
2612
  const description = forParameter ? undefined : (element[meta.voc.Core.LongDescription] || element[meta.voc.Core.Description]);
@@ -2621,8 +2629,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2621
2629
 
2622
2630
  /**
2623
2631
  * Add allowed values enum to Schema Object for string-like model element
2624
- * @param {object} schema Schema Object to augment
2625
- * @param {object} element Model element
2632
+ * @param {*} schema Schema Object to augment
2633
+ * @param {*} element Model element
2626
2634
  */
2627
2635
  function allowedValues(schema, element) {
2628
2636
  const values = element[meta.voc.Validation.AllowedValues];
@@ -2633,7 +2641,7 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2633
2641
  * Construct Reference Object for a type
2634
2642
  * @param {string} typename Qualified name of referenced type
2635
2643
  * @param {string} suffix Optional suffix for referenced schema
2636
- * @return {object} Reference Object
2644
+ * @return {*} Reference Object
2637
2645
  */
2638
2646
  function ref(typename, suffix = '') {
2639
2647
  let name = typename;
@@ -2658,8 +2666,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2658
2666
 
2659
2667
  /**
2660
2668
  * Augment Components Object with map of Security Scheme Objects
2661
- * @param {object} components Components Object to augment
2662
- * @param {object} entityContainer Entity Container object
2669
+ * @param {*} components Components Object to augment
2670
+ * @param {*} entityContainer Entity Container object
2663
2671
  */
2664
2672
  function getSecuritySchemes(components, entityContainer) {
2665
2673
  const authorizations = entityContainer && entityContainer[meta.voc.Authorization.Authorizations] ? entityContainer[meta.voc.Authorization.Authorizations] : [];
@@ -2734,8 +2742,8 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot
2734
2742
 
2735
2743
  /**
2736
2744
  * Augment OpenAPI document with Security Requirements Object
2737
- * @param {object} openapi OpenAPI document to augment
2738
- * @param {object} entityContainer Entity Container object
2745
+ * @param {*} openapi OpenAPI document to augment
2746
+ * @param {*} entityContainer Entity Container object
2739
2747
  */
2740
2748
  function security(openapi, entityContainer) {
2741
2749
  const securitySchemes = entityContainer && entityContainer[meta.voc.Authorization.SecuritySchemes] ? entityContainer[meta.voc.Authorization.SecuritySchemes] : [];