@sap/ux-specification 1.84.82 → 1.84.84
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/CHANGELOG.md +48 -4
- package/README.md +16 -17
- package/dist/documentation/runDocu-min.js +5 -5
- package/dist/documentation/runDocu-min.js.map +4 -4
- package/dist/documentation/styleDocu.css +2 -1
- package/dist/documentation/v2/v2-AnalyticalListPage.html +2 -2
- package/dist/documentation/v2/v2-ApplicationV2.html +2 -2
- package/dist/documentation/v2/v2-ListReport.html +2 -2
- package/dist/documentation/v2/v2-ObjectPage.html +2 -2
- package/dist/documentation/v2/v2-OverviewPage.html +2 -2
- package/dist/documentation/v4/v4-ApplicationV4.html +2 -2
- package/dist/documentation/v4/v4-ListReport.html +2 -2
- package/dist/documentation/v4/v4-ObjectPage.html +2 -2
- package/dist/index-min.js +44 -44
- package/dist/index-min.js.map +4 -4
- package/dist/package.json +5 -5
- package/dist/schemas/v2/ObjectPageConfig.json +113 -8
- package/dist/src/api.d.ts +20 -3
- package/dist/src/api.d.ts.map +1 -1
- package/dist/src/api.js +59 -4
- package/dist/src/api.js.map +1 -1
- package/dist/src/specification/schemaAccess.d.ts +1 -0
- package/dist/src/specification/schemaAccess.d.ts.map +1 -1
- package/dist/src/specification/schemaAccess.js +1 -0
- package/dist/src/specification/schemaAccess.js.map +1 -1
- package/dist/src/sync/common/utils.d.ts +17 -5
- package/dist/src/sync/common/utils.d.ts.map +1 -1
- package/dist/src/sync/common/utils.js +57 -13
- package/dist/src/sync/common/utils.js.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/Fragment.js +11 -2
- package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js +10 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderSection.d.ts +20 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderSection.d.ts.map +1 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderSection.js +127 -0
- package/dist/src/sync/v2/export/controls/ObjectPageHeaderSection.js.map +1 -0
- package/dist/src/sync/v2/export/controls/index.d.ts +1 -0
- package/dist/src/sync/v2/export/controls/index.d.ts.map +1 -1
- package/dist/src/sync/v2/export/controls/index.js +1 -0
- package/dist/src/sync/v2/export/controls/index.js.map +1 -1
- package/dist/src/sync/v2/export/export.d.ts +3 -1
- package/dist/src/sync/v2/export/export.d.ts.map +1 -1
- package/dist/src/sync/v2/export/export.js +37 -14
- package/dist/src/sync/v2/export/export.js.map +1 -1
- package/dist/src/sync/v2/export/exportPage.d.ts +40 -4
- package/dist/src/sync/v2/export/exportPage.d.ts.map +1 -1
- package/dist/src/sync/v2/export/exportPage.js +106 -43
- package/dist/src/sync/v2/export/exportPage.js.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/objectPage.js +107 -14
- package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
- package/dist/src/sync/v2/generate/utils.d.ts +9 -1
- package/dist/src/sync/v2/generate/utils.d.ts.map +1 -1
- package/dist/src/sync/v2/generate/utils.js +45 -26
- package/dist/src/sync/v2/generate/utils.js.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.d.ts.map +1 -1
- package/dist/src/sync/v2/import/pages/objectPage.js +61 -8
- package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
- package/dist/src/sync/v2/types.d.ts +10 -1
- package/dist/src/sync/v2/types.d.ts.map +1 -1
- package/dist/src/sync/v2/types.js +7 -0
- package/dist/src/sync/v2/types.js.map +1 -1
- package/dist/src/sync/v4/export/export.d.ts +12 -6
- package/dist/src/sync/v4/export/export.d.ts.map +1 -1
- package/dist/src/sync/v4/export/export.js +171 -134
- package/dist/src/sync/v4/export/export.js.map +1 -1
- package/dist/src/sync/v4/export/types.d.ts +4 -1
- package/dist/src/sync/v4/export/types.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/ux-specification",
|
|
3
|
-
"version": "1.84.
|
|
3
|
+
"version": "1.84.84",
|
|
4
4
|
"displayName": "SAP Fiori tools - Specification",
|
|
5
5
|
"description": "SAP Fiori tools - Specification",
|
|
6
6
|
"files": [
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"publisher": "SAPSE",
|
|
51
51
|
"license": "SEE LICENSE IN LICENSE",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@sap-ux/vocabularies-types": "0.10.
|
|
53
|
+
"@sap-ux/vocabularies-types": "0.10.5"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@sap-ux/annotation-converter": "0.8.
|
|
56
|
+
"@sap-ux/annotation-converter": "0.8.6",
|
|
57
57
|
"@sap-ux/edmx-parser": "0.7.0",
|
|
58
|
-
"@sap/ux-specification-types": "1.84.
|
|
59
|
-
"@sapui5/ts-types": "1.84.
|
|
58
|
+
"@sap/ux-specification-types": "1.84.84",
|
|
59
|
+
"@sapui5/ts-types": "1.84.42",
|
|
60
60
|
"@types/d3": "7.4.3",
|
|
61
61
|
"@types/jquery": "3.5.29",
|
|
62
62
|
"@ui5/flexibility-utils": "0.1.3",
|
|
@@ -171,6 +171,15 @@
|
|
|
171
171
|
"actions": {
|
|
172
172
|
"$ref": "#/definitions/GenericActions",
|
|
173
173
|
"description": "Set properties of actions on Object Page Header"
|
|
174
|
+
},
|
|
175
|
+
"showHeaderAsCarouselOnDesktop": {
|
|
176
|
+
"description": "Enable the carousel header on the desktop",
|
|
177
|
+
"descriptionSrcURL": "https://ui5.sap.com/#/topic/17dbd5b7a61e4cdcb079062e976cd63f",
|
|
178
|
+
"type": "boolean",
|
|
179
|
+
"artifactType": "Manifest"
|
|
180
|
+
},
|
|
181
|
+
"sections": {
|
|
182
|
+
"$ref": "#/definitions/HeaderSections"
|
|
174
183
|
}
|
|
175
184
|
},
|
|
176
185
|
"additionalProperties": false
|
|
@@ -295,6 +304,110 @@
|
|
|
295
304
|
},
|
|
296
305
|
"additionalProperties": false
|
|
297
306
|
},
|
|
307
|
+
"HeaderSections": {
|
|
308
|
+
"description": "Header Sections",
|
|
309
|
+
"isViewNode": true,
|
|
310
|
+
"type": "object",
|
|
311
|
+
"additionalProperties": {
|
|
312
|
+
"anyOf": [
|
|
313
|
+
{
|
|
314
|
+
"$ref": "#/definitions/CommonHeaderFacetSettings"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"$ref": "#/definitions/ObjectPageHeaderSection"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"$ref": "#/definitions/ObjectPageCustomHeaderSectionFragment"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"CommonHeaderFacetSettings": {
|
|
326
|
+
"type": "object",
|
|
327
|
+
"properties": {
|
|
328
|
+
"visible": {
|
|
329
|
+
"pattern": "^(false|true)$|^{[A-Za-z0-9{}&$!@#%? _|,<>'()[\\]\\/:=.]+}$",
|
|
330
|
+
"anyOf": [
|
|
331
|
+
{
|
|
332
|
+
"enum": [
|
|
333
|
+
false,
|
|
334
|
+
true,
|
|
335
|
+
"{ui>/editable}",
|
|
336
|
+
"{= !${ui>/editable}}"
|
|
337
|
+
]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"type": "string"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"description": "Specifies whether the facet is visible or not",
|
|
344
|
+
"artifactType": "FlexChange",
|
|
345
|
+
"controlType": "sap.m.VBox"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"additionalProperties": false
|
|
349
|
+
},
|
|
350
|
+
"ObjectPageHeaderSection": {
|
|
351
|
+
"description": "Subsection",
|
|
352
|
+
"isViewNode": true,
|
|
353
|
+
"type": "object",
|
|
354
|
+
"properties": {
|
|
355
|
+
"subsections": {
|
|
356
|
+
"$ref": "#/definitions/HeaderSections"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"additionalProperties": false
|
|
360
|
+
},
|
|
361
|
+
"ObjectPageCustomHeaderSectionFragment": {
|
|
362
|
+
"description": "Custom Section fragment",
|
|
363
|
+
"isViewNode": true,
|
|
364
|
+
"type": "object",
|
|
365
|
+
"properties": {
|
|
366
|
+
"className": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"const": "sap.ui.core.Fragment"
|
|
369
|
+
},
|
|
370
|
+
"fragmentName": {
|
|
371
|
+
"type": "string"
|
|
372
|
+
},
|
|
373
|
+
"type": {
|
|
374
|
+
"type": "string",
|
|
375
|
+
"const": "XML"
|
|
376
|
+
},
|
|
377
|
+
"relatedFacet": {
|
|
378
|
+
"type": "string"
|
|
379
|
+
},
|
|
380
|
+
"relativePosition": {
|
|
381
|
+
"$ref": "#/definitions/SectionPosition"
|
|
382
|
+
},
|
|
383
|
+
"title": {
|
|
384
|
+
"description": "The label of the custom section, preferably as an i18n key",
|
|
385
|
+
"i18nClassification": "TIT: Custom section title",
|
|
386
|
+
"type": "string"
|
|
387
|
+
},
|
|
388
|
+
"visible": {
|
|
389
|
+
"description": "Specifies whether the facet is visible or not",
|
|
390
|
+
"type": "boolean"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"additionalProperties": false,
|
|
394
|
+
"required": [
|
|
395
|
+
"className",
|
|
396
|
+
"fragmentName",
|
|
397
|
+
"relatedFacet",
|
|
398
|
+
"relativePosition",
|
|
399
|
+
"title",
|
|
400
|
+
"type"
|
|
401
|
+
]
|
|
402
|
+
},
|
|
403
|
+
"SectionPosition": {
|
|
404
|
+
"enum": [
|
|
405
|
+
"AfterFacet",
|
|
406
|
+
"BeforeFacet",
|
|
407
|
+
"ReplaceFacet"
|
|
408
|
+
],
|
|
409
|
+
"type": "string"
|
|
410
|
+
},
|
|
298
411
|
"ObjectPageLayout": {
|
|
299
412
|
"description": "Page Layout",
|
|
300
413
|
"isViewNode": true,
|
|
@@ -1662,14 +1775,6 @@
|
|
|
1662
1775
|
],
|
|
1663
1776
|
"type": "string"
|
|
1664
1777
|
},
|
|
1665
|
-
"SectionPosition": {
|
|
1666
|
-
"enum": [
|
|
1667
|
-
"AfterFacet",
|
|
1668
|
-
"BeforeFacet",
|
|
1669
|
-
"ReplaceFacet"
|
|
1670
|
-
],
|
|
1671
|
-
"type": "string"
|
|
1672
|
-
},
|
|
1673
1778
|
"ObjectPageCustomSectionFragment": {
|
|
1674
1779
|
"description": "Fragment",
|
|
1675
1780
|
"isViewNode": true,
|
package/dist/src/api.d.ts
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
import type { ExportResults, File, GenerateSchemaParameters, ExportConfigParameters, ImportConfigParameters, ImportProjectParameters, ApiVersion } from '@sap/ux-specification-types';
|
|
1
|
+
import type { ExportResults, File, GenerateSchemaParameters, ExportConfigParameters, ImportConfigParameters, ImportProjectParameters, ApiVersion, ExportConfigWithPath } from '@sap/ux-specification-types';
|
|
2
2
|
/**
|
|
3
3
|
* Return the generic (project independent) JSON schema
|
|
4
4
|
* @param specification - reference to spec
|
|
5
5
|
* @param version - Fiori elements version (v2 or v4)
|
|
6
6
|
* @param schemaType - type of the schema, e.g. ListReport, ObjectPage
|
|
7
|
+
* @returns the generic schema for the given Fiori Elements version and schema type
|
|
7
8
|
*/
|
|
8
9
|
export { getGenericSchema } from './specification/schemaAccess';
|
|
9
10
|
/**
|
|
10
11
|
* Generate JSON schema for a given Fiori elements version and page type
|
|
11
12
|
* @param generateParameters: the input structure that contains the version, schema type, and parameters
|
|
13
|
+
* @returns the app-specific schema for the given schema type and page
|
|
12
14
|
*/
|
|
13
15
|
export declare function generateSchema(generateParameters: GenerateSchemaParameters): object;
|
|
14
16
|
/**
|
|
15
|
-
* Exports
|
|
17
|
+
* Exports the whole config (src/*.json, src/pages/*.json) to flex changes and/or manifest settings
|
|
16
18
|
* @param exportParameters - parameters to control the export
|
|
19
|
+
* @returns a bundle of all actual objects of any artifact type
|
|
17
20
|
*/
|
|
18
21
|
export declare function exportConfig(exportParameters: ExportConfigParameters): ExportResults;
|
|
22
|
+
/**
|
|
23
|
+
* Exports a part of the config, specifified by a propertyPath, to flex changes and/or manifest settings
|
|
24
|
+
* @param exportParameters - parameters to control the export
|
|
25
|
+
* @returns a bundle of all changed objects of any artifact type
|
|
26
|
+
*/
|
|
27
|
+
export declare function exportConfigEntityByPath(exportParameters: ExportConfigWithPath): ExportResults;
|
|
28
|
+
/**
|
|
29
|
+
* Exports a part of the config, specifified by a propertyPath, to flex changes and/or manifest settings
|
|
30
|
+
* @param exportParameters - parameters to control the export
|
|
31
|
+
* @returns a bundle of all changed objects of any artifact type
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare function deleteConfigEntityByPath(exportParameters: ExportConfigWithPath): ExportResults;
|
|
19
35
|
/**
|
|
20
36
|
* Imports manifest settings and flex changes to a config (src/*.json, src/pages/*.json)
|
|
21
37
|
* @param importParameters - parameters to control the import
|
|
38
|
+
* @returns the generated config json file
|
|
22
39
|
*/
|
|
23
40
|
export declare function importConfig(importParameters: ImportConfigParameters): object | undefined;
|
|
24
41
|
/**
|
|
@@ -35,7 +52,7 @@ export declare function importProject(importParameters: ImportProjectParameters)
|
|
|
35
52
|
export declare function importProjectSchema(importParameters: ImportProjectParameters): Promise<File[]>;
|
|
36
53
|
/**
|
|
37
54
|
* Returns specification API version.
|
|
38
|
-
* @
|
|
55
|
+
* @returns {ApiVersion} Object of API version.
|
|
39
56
|
*/
|
|
40
57
|
export declare function getApiVersion(): ApiVersion;
|
|
41
58
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/src/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,aAAa,EACb,IAAI,EACJ,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,UAAU,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,aAAa,EACb,IAAI,EACJ,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,UAAU,EAEV,oBAAoB,EACvB,MAAM,6BAA6B,CAAC;AAuBrC;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,kBAAkB,EAAE,wBAAwB,GAAG,MAAM,CAyEnF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,aAAa,CAiBpF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,aAAa,CAkB9F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,aAAa,CAkB9F;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,MAAM,GAAG,SAAS,CA8BzF;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAE9F;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,gBAAgB,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAEpG;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAI1C"}
|
package/dist/src/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getApiVersion = exports.importProjectSchema = exports.importProject = exports.importConfig = exports.exportConfig = exports.generateSchema = exports.getGenericSchema = void 0;
|
|
3
|
+
exports.getApiVersion = exports.importProjectSchema = exports.importProject = exports.importConfig = exports.deleteConfigEntityByPath = exports.exportConfigEntityByPath = exports.exportConfig = exports.generateSchema = exports.getGenericSchema = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* This file implements the interface 'Specification' from ./types and serves as API to specification
|
|
6
6
|
*/
|
|
@@ -17,12 +17,14 @@ const common_1 = require("./sync/common");
|
|
|
17
17
|
* @param specification - reference to spec
|
|
18
18
|
* @param version - Fiori elements version (v2 or v4)
|
|
19
19
|
* @param schemaType - type of the schema, e.g. ListReport, ObjectPage
|
|
20
|
+
* @returns the generic schema for the given Fiori Elements version and schema type
|
|
20
21
|
*/
|
|
21
22
|
var schemaAccess_1 = require("./specification/schemaAccess");
|
|
22
23
|
Object.defineProperty(exports, "getGenericSchema", { enumerable: true, get: function () { return schemaAccess_1.getGenericSchema; } });
|
|
23
24
|
/**
|
|
24
25
|
* Generate JSON schema for a given Fiori elements version and page type
|
|
25
26
|
* @param generateParameters: the input structure that contains the version, schema type, and parameters
|
|
27
|
+
* @returns the app-specific schema for the given schema type and page
|
|
26
28
|
*/
|
|
27
29
|
function generateSchema(generateParameters) {
|
|
28
30
|
let schema;
|
|
@@ -75,8 +77,9 @@ function generateSchema(generateParameters) {
|
|
|
75
77
|
}
|
|
76
78
|
exports.generateSchema = generateSchema;
|
|
77
79
|
/**
|
|
78
|
-
* Exports
|
|
80
|
+
* Exports the whole config (src/*.json, src/pages/*.json) to flex changes and/or manifest settings
|
|
79
81
|
* @param exportParameters - parameters to control the export
|
|
82
|
+
* @returns a bundle of all actual objects of any artifact type
|
|
80
83
|
*/
|
|
81
84
|
function exportConfig(exportParameters) {
|
|
82
85
|
let exportResults;
|
|
@@ -98,9 +101,61 @@ function exportConfig(exportParameters) {
|
|
|
98
101
|
return exportResults;
|
|
99
102
|
}
|
|
100
103
|
exports.exportConfig = exportConfig;
|
|
104
|
+
/**
|
|
105
|
+
* Exports a part of the config, specifified by a propertyPath, to flex changes and/or manifest settings
|
|
106
|
+
* @param exportParameters - parameters to control the export
|
|
107
|
+
* @returns a bundle of all changed objects of any artifact type
|
|
108
|
+
*/
|
|
109
|
+
function exportConfigEntityByPath(exportParameters) {
|
|
110
|
+
let exportResults = ux_specification_types_1.defaultExportResult;
|
|
111
|
+
const ui5Config = { ui5Version: exportParameters.ui5Version, layer: exportParameters.layer };
|
|
112
|
+
if (exportParameters[ux_specification_types_1.FioriElementsVersion.v2]) {
|
|
113
|
+
/**
|
|
114
|
+
* Handle v2 export
|
|
115
|
+
*/
|
|
116
|
+
const v2Params = exportParameters[ux_specification_types_1.FioriElementsVersion.v2];
|
|
117
|
+
exportResults = (0, exportPage_1.exportConfigEntityByPathV2)(v2Params, ui5Config);
|
|
118
|
+
}
|
|
119
|
+
else if (exportParameters[ux_specification_types_1.FioriElementsVersion.v4]) {
|
|
120
|
+
/**
|
|
121
|
+
* Handle v4 export
|
|
122
|
+
*/
|
|
123
|
+
const v4Params = exportParameters[ux_specification_types_1.FioriElementsVersion.v4];
|
|
124
|
+
exportResults = (0, export_1.exportConfigEntityByPathV4)(v4Params, ui5Config);
|
|
125
|
+
}
|
|
126
|
+
return exportResults;
|
|
127
|
+
}
|
|
128
|
+
exports.exportConfigEntityByPath = exportConfigEntityByPath;
|
|
129
|
+
/**
|
|
130
|
+
* Exports a part of the config, specifified by a propertyPath, to flex changes and/or manifest settings
|
|
131
|
+
* @param exportParameters - parameters to control the export
|
|
132
|
+
* @returns a bundle of all changed objects of any artifact type
|
|
133
|
+
*
|
|
134
|
+
*/
|
|
135
|
+
function deleteConfigEntityByPath(exportParameters) {
|
|
136
|
+
let exportResults = ux_specification_types_1.defaultExportResult;
|
|
137
|
+
const ui5Config = { ui5Version: exportParameters.ui5Version, layer: exportParameters.layer };
|
|
138
|
+
if (exportParameters[ux_specification_types_1.FioriElementsVersion.v2]) {
|
|
139
|
+
/**
|
|
140
|
+
* Handle v2 export
|
|
141
|
+
*/
|
|
142
|
+
const v2Params = exportParameters[ux_specification_types_1.FioriElementsVersion.v2];
|
|
143
|
+
exportResults = (0, exportPage_1.exportConfigEntityByPathV2)(v2Params, ui5Config, true);
|
|
144
|
+
}
|
|
145
|
+
else if (exportParameters[ux_specification_types_1.FioriElementsVersion.v4]) {
|
|
146
|
+
/**
|
|
147
|
+
* Handle v4 export
|
|
148
|
+
*/
|
|
149
|
+
const v4Params = exportParameters[ux_specification_types_1.FioriElementsVersion.v4];
|
|
150
|
+
exportResults = (0, export_1.exportConfigEntityByPathV4)(v4Params, ui5Config, true);
|
|
151
|
+
}
|
|
152
|
+
return exportResults;
|
|
153
|
+
}
|
|
154
|
+
exports.deleteConfigEntityByPath = deleteConfigEntityByPath;
|
|
101
155
|
/**
|
|
102
156
|
* Imports manifest settings and flex changes to a config (src/*.json, src/pages/*.json)
|
|
103
157
|
* @param importParameters - parameters to control the import
|
|
158
|
+
* @returns the generated config json file
|
|
104
159
|
*/
|
|
105
160
|
function importConfig(importParameters) {
|
|
106
161
|
let config;
|
|
@@ -160,11 +215,11 @@ async function importProjectSchema(importParameters) {
|
|
|
160
215
|
exports.importProjectSchema = importProjectSchema;
|
|
161
216
|
/**
|
|
162
217
|
* Returns specification API version.
|
|
163
|
-
* @
|
|
218
|
+
* @returns {ApiVersion} Object of API version.
|
|
164
219
|
*/
|
|
165
220
|
function getApiVersion() {
|
|
166
221
|
return {
|
|
167
|
-
version: '
|
|
222
|
+
version: '14'
|
|
168
223
|
};
|
|
169
224
|
}
|
|
170
225
|
exports.getApiVersion = getApiVersion;
|
package/dist/src/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";;;AAAA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AAoB,CAAC,EAAE,CAAC,EAAE;QAClD;;WAEG;QACH,MAAM,QAAQ,GAAG,gBAAgB,CAAC,6CAAoB,CAAC,EAAE,CAAC,CAAC;QAC3D,IAAI,QAAQ,CAAC,mCAAU,CAAC,UAAU,CAAC,EAAE;YACjC,MAAM,GAAG,IAAA,+BAAwB,EAAC,QAAQ,CAAC,mCAAU,CAAC,UAAU,CAAC,EAAE,mCAAU,CAAC,UAAU,CAAC,CAAC;SAC7F;aAAM,IAAI,QAAQ,CAAC,mCAAU,CAAC,UAAU,CAAC,EAAE;YACxC,MAAM,GAAG,IAAA,iCAAwB,EAAC,QAAQ,CAAC,mCAAU,CAAC,UAAU,CAAC,CAAC,CAAC;SACtE;aAAM,IAAI,QAAQ,CAAC,mCAAU,CAAC,kBAAkB,CAAC,EAAE;YAChD,MAAM,GAAG,IAAA,+BAAwB,EAAC,QAAQ,CAAC,mCAAU,CAAC,kBAAkB,CAAC,EAAE,mCAAU,CAAC,kBAAkB,CAAC,CAAC;SAC7G;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AA9BD,oCA8BC;AAED;;;;GAIG;AACI,KAAK,UAAU,aAAa,CAAC,gBAAyC;IACzE,OAAO,IAAA,qCAA4B,EAAC,gBAAgB,CAAC,CAAC;AAC1D,CAAC;AAFD,sCAEC;AAED;;;;GAIG;AACI,KAAK,UAAU,mBAAmB,CAAC,gBAAyC;IAC/E,OAAO,IAAA,4BAAuB,EAAC,gBAAgB,CAAC,CAAC;AACrD,CAAC;AAFD,kDAEC;AAED;;;GAGG;AACH,SAAgB,aAAa;IACzB,OAAO;QACH,OAAO,EAAE,IAAI;KAChB,CAAC;AACN,CAAC;AAJD,sCAIC"}
|
|
@@ -10,6 +10,7 @@ export declare const getPathToGenericSchema: (version: FioriElementsVersion, sch
|
|
|
10
10
|
* Return the generic schema for a given version and type
|
|
11
11
|
* @param version - Fiori elements version, e.g. v2 or v4
|
|
12
12
|
* @param schemaType - Type of the schema, e.g Application, ListReport, ObjectPage, ...
|
|
13
|
+
* @returns the generic schema for the given Fiori Elements version and schema type
|
|
13
14
|
*/
|
|
14
15
|
export declare const getGenericSchema: (version: FioriElementsVersion, schemaType: SchemaType) => Promise<JSON>;
|
|
15
16
|
//# sourceMappingURL=schemaAccess.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaAccess.d.ts","sourceRoot":"","sources":["../../../src/specification/schemaAccess.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,YACtB,oBAAoB,cACjB,UAAU,cACX,MAAM,KAClB,MAAM,GAAG,SAgBX,CAAC;AAkBF
|
|
1
|
+
{"version":3,"file":"schemaAccess.d.ts","sourceRoot":"","sources":["../../../src/specification/schemaAccess.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,YACtB,oBAAoB,cACjB,UAAU,cACX,MAAM,KAClB,MAAM,GAAG,SAgBX,CAAC;AAkBF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,YAAmB,oBAAoB,cAAc,UAAU,KAAG,QAAQ,IAAI,CAO1G,CAAC"}
|
|
@@ -49,6 +49,7 @@ const readJsonSchema = async (path) => {
|
|
|
49
49
|
* Return the generic schema for a given version and type
|
|
50
50
|
* @param version - Fiori elements version, e.g. v2 or v4
|
|
51
51
|
* @param schemaType - Type of the schema, e.g Application, ListReport, ObjectPage, ...
|
|
52
|
+
* @returns the generic schema for the given Fiori Elements version and schema type
|
|
52
53
|
*/
|
|
53
54
|
const getGenericSchema = async (version, schemaType) => {
|
|
54
55
|
try {
|
|
@@ -1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C;AAEF;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAA6B,EAAE,UAAsB,EAAiB,EAAE;IAC3G,IAAI;QACA,MAAM,IAAI,GAAG,IAAA,8BAAsB,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,iCAAiC,UAAU,cAAc,OAAO,eAAe,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KACnH;AACL,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B"}
|
|
@@ -6,6 +6,7 @@ import type { DataField, DataFieldAbstractTypes, FacetTypes } from '@sap-ux/voca
|
|
|
6
6
|
import type { ConvertedMetadata, EntityType, PropertyPath, PropertyAnnotationValue } from '@sap-ux/vocabularies-types';
|
|
7
7
|
import type { PropertyAnnotations } from '@sap-ux/vocabularies-types/vocabularies/Edm_Types';
|
|
8
8
|
export declare const DEFINITION_LINK_PREFIX = "#/definitions/";
|
|
9
|
+
export declare const arrayIncludes: (arr: string[], target: string[]) => boolean;
|
|
9
10
|
/**
|
|
10
11
|
* Function returns annotation path for schema based on received params.
|
|
11
12
|
* @param entityTypeName - Entity type name.
|
|
@@ -175,12 +176,15 @@ export declare function createDefaultSection(appSchema: Definition, facet: Facet
|
|
|
175
176
|
export declare function getObjectPageFacetSection(entityType: EntityType, oDataServiceAVT: ConvertedMetadata, logger?: ExtensionLogger, oDataVersion?: FioriElementsVersion, checkUnresolvableFacets?: boolean): FacetSection[];
|
|
176
177
|
/**
|
|
177
178
|
* Cleans empty sub-structures from the export result for manifest
|
|
178
|
-
* @param manifest - manifest.json part of the export result
|
|
179
|
-
* @param path - path in the manifest
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
179
|
+
* @param {object} manifest - manifest.json part of the export result
|
|
180
|
+
* @param {string} path - path in the manifest
|
|
181
|
+
* @param {boolean} deletionRequest - if set to true, any manifest setting specified by entityPath gets deleted even if it comprises any unknown property
|
|
182
|
+
* @param {string[]} entityPathArray (optional) - array of elements, describing a path to a subsection of the config.
|
|
183
|
+
* If specified, only elements from this subsection are getting deleted
|
|
184
|
+
* @param {string} targetAnnotation (optional) - target annotation (optional, in case of sections, subsections)
|
|
185
|
+
* @param {string} targetAnnotationEncoded (optional) - encoded version of the target annotation, as represented in the manifest
|
|
182
186
|
*/
|
|
183
|
-
export declare const deleteEmptyStructure: (manifest: object, path: string, targetAnnotation?: string, targetAnnotationEncoded?: string) => void;
|
|
187
|
+
export declare const deleteEmptyStructure: (manifest: object, path: string, deletionRequest: boolean, entityPathArray?: string[], targetAnnotation?: string, targetAnnotationEncoded?: string) => void;
|
|
184
188
|
/**
|
|
185
189
|
* Method which returns schema file name and path depending on passed schema or page type.
|
|
186
190
|
* @param {SchemaType | PageTypeV2} schemaType Schema type or Page type.
|
|
@@ -203,6 +207,14 @@ export type NextDefinition = {
|
|
|
203
207
|
targetDefinition?: object;
|
|
204
208
|
title?: string;
|
|
205
209
|
};
|
|
210
|
+
/**
|
|
211
|
+
* Method finds matching objects against passed interface of 'additionalProperties' and returns array of matching object keys.
|
|
212
|
+
* @param {Definition} appSchema - App-specific JSON schema.
|
|
213
|
+
* @param {Definition} additionalProperties - Allowed additional properties.
|
|
214
|
+
* @param {object} configObject -Container object to find matching childs.
|
|
215
|
+
* @returns {string[]} Array of matching object keys
|
|
216
|
+
*/
|
|
217
|
+
export declare function findMatchingKeysByAdditionalProperties(appSchema: Definition, additionalProperties: Definition, configObject: object): string[];
|
|
206
218
|
/**
|
|
207
219
|
* Recursive function to determine the next config part, next definition in the app schema and the title
|
|
208
220
|
* @param appSchema - app-specific JSON schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/sync/common/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE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D,SAAS,EAAE,UAAU,EACrB,oBAAoB,EAAE,UAAU,EAChC,YAAY,EAAE,MAAM,GACrB,MAAM,EAAE,CA0BV;AA8HD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,MAAM,EAC3B,kBAAkB,EAAE,MAAM,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,yBAAyB,EAClC,QAAQ,EAAE,UAAU,GAAG,UAAU,GAClC,cAAc,CA6BhB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,8CAA8B,MAAM,EAYjE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,KAAA,EAAE,UAAU,KAAA,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAK/E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAM/E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIrD"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.replaceNamespaces = exports.removeNamespaces = exports.updatePropertyIndices = exports.getDefinitionKey = exports.convertActionKeyToStableId = exports.convertEnumToCSV = exports.arrayCombineMerge = exports.getNextTargetDefinition = exports.generatePageId = exports.getSchemaFilePath = exports.deleteEmptyStructure = exports.getObjectPageFacetSection = exports.createDefaultSection = exports.addTargetTitleAndSectionDescription = exports.addSectionTitleAndDescription = exports.getTemplateTypeFromManifest = exports.determineV4Template = exports.determineV4PageTemplateType = exports.determineV2Template = exports.getVersionFromManifest = exports.getObjectPageFacets = exports.getObjectPageHeaderFacets = exports.getSchemaKeyOfLineItemRecord = exports.getManifestSectionByPathV4 = exports.getSectionFacet = exports.findAlias = exports.getPageTypeV4 = exports.getPageTypeV2 = exports.prepareRef = exports.getDataFieldDescription = exports.getLabelForDataField = exports.getLabelForPropertyPath = exports.evaluateCommonLabel = exports.getAnnotationPropertyValue = exports.parseAndMergeAndConvert = exports.createAnnotationPath = exports.DEFINITION_LINK_PREFIX = void 0;
|
|
6
|
+
exports.replaceNamespaces = exports.removeNamespaces = exports.updatePropertyIndices = exports.getDefinitionKey = exports.convertActionKeyToStableId = exports.convertEnumToCSV = exports.arrayCombineMerge = exports.getNextTargetDefinition = exports.findMatchingKeysByAdditionalProperties = exports.generatePageId = exports.getSchemaFilePath = exports.deleteEmptyStructure = exports.getObjectPageFacetSection = exports.createDefaultSection = exports.addTargetTitleAndSectionDescription = exports.addSectionTitleAndDescription = exports.getTemplateTypeFromManifest = exports.determineV4Template = exports.determineV4PageTemplateType = exports.determineV2Template = exports.getVersionFromManifest = exports.getObjectPageFacets = exports.getObjectPageHeaderFacets = exports.getSchemaKeyOfLineItemRecord = exports.getManifestSectionByPathV4 = exports.getSectionFacet = exports.findAlias = exports.getPageTypeV4 = exports.getPageTypeV2 = exports.prepareRef = exports.getDataFieldDescription = exports.getLabelForDataField = exports.getLabelForPropertyPath = exports.evaluateCommonLabel = exports.getAnnotationPropertyValue = exports.parseAndMergeAndConvert = exports.createAnnotationPath = exports.arrayIncludes = exports.DEFINITION_LINK_PREFIX = void 0;
|
|
7
7
|
const ux_specification_types_1 = require("@sap/ux-specification-types");
|
|
8
8
|
const i18next_1 = __importDefault(require("i18next"));
|
|
9
9
|
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
@@ -11,6 +11,8 @@ const annotation_converter_1 = require("@sap-ux/annotation-converter");
|
|
|
11
11
|
const edmx_parser_1 = require("@sap-ux/edmx-parser");
|
|
12
12
|
const extensionLogger_1 = require("../../extensionLogger");
|
|
13
13
|
exports.DEFINITION_LINK_PREFIX = '#/definitions/';
|
|
14
|
+
const arrayIncludes = (arr, target) => target.every((v) => arr.includes(v));
|
|
15
|
+
exports.arrayIncludes = arrayIncludes;
|
|
14
16
|
/**
|
|
15
17
|
* Function returns annotation path for schema based on received params.
|
|
16
18
|
* @param entityTypeName - Entity type name.
|
|
@@ -944,15 +946,18 @@ exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
|
|
|
944
946
|
*/
|
|
945
947
|
function addTargetTitleAndSectionDescription(facet, section, facetKey) {
|
|
946
948
|
addSectionTitleAndDescription(facet, section, facetKey);
|
|
947
|
-
if (facet?.Label) {
|
|
948
|
-
|
|
949
|
+
if (facet?.ID || facet?.Label) {
|
|
950
|
+
return;
|
|
949
951
|
}
|
|
950
|
-
|
|
951
|
-
section.description = facet
|
|
952
|
+
if (facet?.Title) {
|
|
953
|
+
section.description = facet.Title;
|
|
952
954
|
}
|
|
953
955
|
else if (facet?.target?.['Title']) {
|
|
954
956
|
section.description = facet.target['Title'];
|
|
955
957
|
}
|
|
958
|
+
else if (facet?.target?.['Label']) {
|
|
959
|
+
section.description = facet.target['Label'];
|
|
960
|
+
}
|
|
956
961
|
}
|
|
957
962
|
exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
|
|
958
963
|
/**
|
|
@@ -978,7 +983,7 @@ function createDefaultSection(appSchema, facet, facetKey) {
|
|
|
978
983
|
section[ux_specification_types_1.SchemaTag.isViewNode] = true;
|
|
979
984
|
}
|
|
980
985
|
section[ux_specification_types_1.SchemaTag.annotationPath] = facet.annotationPath;
|
|
981
|
-
|
|
986
|
+
addTargetTitleAndSectionDescription(facet, section, facetKey);
|
|
982
987
|
return section;
|
|
983
988
|
}
|
|
984
989
|
exports.createDefaultSection = createDefaultSection;
|
|
@@ -1014,12 +1019,15 @@ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVer
|
|
|
1014
1019
|
exports.getObjectPageFacetSection = getObjectPageFacetSection;
|
|
1015
1020
|
/**
|
|
1016
1021
|
* Cleans empty sub-structures from the export result for manifest
|
|
1017
|
-
* @param manifest - manifest.json part of the export result
|
|
1018
|
-
* @param path - path in the manifest
|
|
1019
|
-
* @param
|
|
1020
|
-
* @param
|
|
1022
|
+
* @param {object} manifest - manifest.json part of the export result
|
|
1023
|
+
* @param {string} path - path in the manifest
|
|
1024
|
+
* @param {boolean} deletionRequest - if set to true, any manifest setting specified by entityPath gets deleted even if it comprises any unknown property
|
|
1025
|
+
* @param {string[]} entityPathArray (optional) - array of elements, describing a path to a subsection of the config.
|
|
1026
|
+
* If specified, only elements from this subsection are getting deleted
|
|
1027
|
+
* @param {string} targetAnnotation (optional) - target annotation (optional, in case of sections, subsections)
|
|
1028
|
+
* @param {string} targetAnnotationEncoded (optional) - encoded version of the target annotation, as represented in the manifest
|
|
1021
1029
|
*/
|
|
1022
|
-
const deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
|
|
1030
|
+
const deleteEmptyStructure = (manifest, path, deletionRequest, entityPathArray, targetAnnotation, targetAnnotationEncoded) => {
|
|
1023
1031
|
if (!path) {
|
|
1024
1032
|
return;
|
|
1025
1033
|
}
|
|
@@ -1032,7 +1040,9 @@ const deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotation
|
|
|
1032
1040
|
if (!manifestSection[decodedElement]) {
|
|
1033
1041
|
return;
|
|
1034
1042
|
}
|
|
1035
|
-
if (Object.keys(manifestSection[decodedElement]).length === 0
|
|
1043
|
+
if (Object.keys(manifestSection[decodedElement]).length === 0 ||
|
|
1044
|
+
//deletion explicitly requested by using entityPath
|
|
1045
|
+
(entityPathArray && entityPathArray[entityPathArray.length - 1] === decodedElement && deletionRequest)) {
|
|
1036
1046
|
if (Array.isArray(manifestSection)) {
|
|
1037
1047
|
manifestSection.splice(Number(decodedElement), 1);
|
|
1038
1048
|
}
|
|
@@ -1040,7 +1050,7 @@ const deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotation
|
|
|
1040
1050
|
delete manifestSection[decodedElement];
|
|
1041
1051
|
}
|
|
1042
1052
|
pathArray.pop();
|
|
1043
|
-
(0, exports.deleteEmptyStructure)(manifest, pathArray.join('/'), targetAnnotation, targetAnnotationEncoded);
|
|
1053
|
+
(0, exports.deleteEmptyStructure)(manifest, pathArray.join('/'), deletionRequest, entityPathArray, targetAnnotation, targetAnnotationEncoded);
|
|
1044
1054
|
return;
|
|
1045
1055
|
}
|
|
1046
1056
|
manifestSection = manifestSection && manifestSection[decodedElement];
|
|
@@ -1125,6 +1135,40 @@ function generatePageId(pageType, entitySet, viewId, pageName) {
|
|
|
1125
1135
|
return parts.join('_');
|
|
1126
1136
|
}
|
|
1127
1137
|
exports.generatePageId = generatePageId;
|
|
1138
|
+
/**
|
|
1139
|
+
* Method finds matching objects against passed interface of 'additionalProperties' and returns array of matching object keys.
|
|
1140
|
+
* @param {Definition} appSchema - App-specific JSON schema.
|
|
1141
|
+
* @param {Definition} additionalProperties - Allowed additional properties.
|
|
1142
|
+
* @param {object} configObject -Container object to find matching childs.
|
|
1143
|
+
* @returns {string[]} Array of matching object keys
|
|
1144
|
+
*/
|
|
1145
|
+
function findMatchingKeysByAdditionalProperties(appSchema, additionalProperties, configObject) {
|
|
1146
|
+
let properties = additionalProperties?.properties;
|
|
1147
|
+
let required = additionalProperties?.required;
|
|
1148
|
+
if (!properties && additionalProperties?.$ref) {
|
|
1149
|
+
const reference = additionalProperties?.$ref;
|
|
1150
|
+
const definition = appSchema.definitions[reference.split(exports.DEFINITION_LINK_PREFIX)[1]];
|
|
1151
|
+
if (typeof definition === 'object') {
|
|
1152
|
+
properties = definition.properties;
|
|
1153
|
+
required = definition.required;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
if (!properties || Object.keys(properties).length === 0) {
|
|
1157
|
+
return [];
|
|
1158
|
+
}
|
|
1159
|
+
const result = [];
|
|
1160
|
+
required = required || [];
|
|
1161
|
+
// Merge new entries for creation into list
|
|
1162
|
+
for (const key in configObject) {
|
|
1163
|
+
const entry = configObject[key];
|
|
1164
|
+
// Check if interface of config entry matches additionalProperties - all required properties should exist in entry
|
|
1165
|
+
if (typeof entry === 'object' && required.every((property) => entry[property])) {
|
|
1166
|
+
result.push(key);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return result;
|
|
1170
|
+
}
|
|
1171
|
+
exports.findMatchingKeysByAdditionalProperties = findMatchingKeysByAdditionalProperties;
|
|
1128
1172
|
function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
|
|
1129
1173
|
const $ref = element.$ref;
|
|
1130
1174
|
if ($ref) {
|