@sap-ux/fiori-app-sub-generator 0.0.2
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/generators/app/index.d.ts +3 -0
- package/generators/app/index.js +5 -0
- package/generators/app-headless/index.d.ts +34 -0
- package/generators/app-headless/index.js +75 -0
- package/generators/app-headless/transforms.d.ts +9 -0
- package/generators/app-headless/transforms.js +208 -0
- package/generators/fiori-app-generator/end.d.ts +49 -0
- package/generators/fiori-app-generator/end.js +105 -0
- package/generators/fiori-app-generator/fioriAppGenerator.d.ts +45 -0
- package/generators/fiori-app-generator/fioriAppGenerator.js +319 -0
- package/generators/fiori-app-generator/fioriAppGeneratorOptions.d.ts +94 -0
- package/generators/fiori-app-generator/fioriAppGeneratorOptions.js +3 -0
- package/generators/fiori-app-generator/index.d.ts +3 -0
- package/generators/fiori-app-generator/index.js +19 -0
- package/generators/fiori-app-generator/install.d.ts +34 -0
- package/generators/fiori-app-generator/install.js +80 -0
- package/generators/fiori-app-generator/prompting.d.ts +84 -0
- package/generators/fiori-app-generator/prompting.js +303 -0
- package/generators/fiori-app-generator/subgenHelpers.d.ts +43 -0
- package/generators/fiori-app-generator/subgenHelpers.js +71 -0
- package/generators/fiori-app-generator/transforms.d.ts +38 -0
- package/generators/fiori-app-generator/transforms.js +278 -0
- package/generators/fiori-app-generator/writing.d.ts +27 -0
- package/generators/fiori-app-generator/writing.js +94 -0
- package/generators/index.d.ts +6 -0
- package/generators/index.js +22 -0
- package/generators/translations/fioriAppSubGenerator.i18n.json +119 -0
- package/generators/types/common.d.ts +46 -0
- package/generators/types/common.js +3 -0
- package/generators/types/constants.d.ts +60 -0
- package/generators/types/constants.js +98 -0
- package/generators/types/external.d.ts +261 -0
- package/generators/types/external.js +88 -0
- package/generators/types/index.d.ts +7 -0
- package/generators/types/index.js +23 -0
- package/generators/types/state.d.ts +149 -0
- package/generators/types/state.js +35 -0
- package/generators/types/telemetryEvents.d.ts +61 -0
- package/generators/types/telemetryEvents.js +3 -0
- package/generators/types/yeomanUiStepConfig.d.ts +13 -0
- package/generators/types/yeomanUiStepConfig.js +3 -0
- package/generators/utils/appWizardCache.d.ts +40 -0
- package/generators/utils/appWizardCache.js +72 -0
- package/generators/utils/command-runner.d.ts +30 -0
- package/generators/utils/command-runner.js +88 -0
- package/generators/utils/common.d.ts +147 -0
- package/generators/utils/common.js +286 -0
- package/generators/utils/eventHooks.d.ts +29 -0
- package/generators/utils/eventHooks.js +48 -0
- package/generators/utils/i18n.d.ts +16 -0
- package/generators/utils/i18n.js +54 -0
- package/generators/utils/index.d.ts +9 -0
- package/generators/utils/index.js +25 -0
- package/generators/utils/sapuxLayer.d.ts +15 -0
- package/generators/utils/sapuxLayer.js +24 -0
- package/generators/utils/stepsHelper.d.ts +47 -0
- package/generators/utils/stepsHelper.js +161 -0
- package/generators/utils/telemetry.d.ts +16 -0
- package/generators/utils/telemetry.js +41 -0
- package/package.json +84 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Features = exports.defaultNavActionDisplay = exports.defaultNavActionTile = exports.minSupportedUi5VersionV4 = exports.minSupportedUi5Version = exports.FPM_DEFAULT_PAGE_NAME = exports.generatorName = exports.MAIN_MODEL_NAME = exports.MAIN_DATASOURCE_NAME = exports.DEFAULT_SERVICE_PATH = exports.DEFAULT_CAP_HOST = exports.DEFAULT_HOST = exports.FIORI_STEPS = exports.STEP_FLP_CONFIG = exports.STEP_DEPLOY_CONFIG = exports.STEP_PROJECT_ATTRIBUTES = exports.STEP_ENTITY = exports.STEP_DATASOURCE_AND_SERVICE = exports.STEP_FLOORPLAN = exports.API_HUB_TYPE = exports.API_HUB_API_KEY = exports.SAP_CLIENT_KEY = exports.UI5_VERSION_PROPS = exports.PLATFORMS = exports.LEGACY_CAP_TYPE_JAVA = exports.LEGACY_CAP_TYPE_NODE = void 0;
|
|
4
|
+
const i18n_1 = require("../utils/i18n");
|
|
5
|
+
exports.LEGACY_CAP_TYPE_NODE = 'capNode';
|
|
6
|
+
exports.LEGACY_CAP_TYPE_JAVA = 'capJava';
|
|
7
|
+
exports.PLATFORMS = {
|
|
8
|
+
VSCODE: {
|
|
9
|
+
name: 'Visual Studio Code',
|
|
10
|
+
technical: 'VSCode'
|
|
11
|
+
},
|
|
12
|
+
SBAS: {
|
|
13
|
+
name: 'SAP Business Application Studio',
|
|
14
|
+
technical: 'SBAS'
|
|
15
|
+
},
|
|
16
|
+
CLI: {
|
|
17
|
+
name: 'CLI',
|
|
18
|
+
technical: 'CLI'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.UI5_VERSION_PROPS = {
|
|
22
|
+
OFFICIAL_URL: 'https://ui5.sap.com',
|
|
23
|
+
BCP_OFFICIAL_URL: 'https://sapui5.hana.ondemand.com',
|
|
24
|
+
SNAPSHOT_URL: 'https://sapui5preview-sapui5.dispatcher.int.sap.eu2.hana.ondemand.com',
|
|
25
|
+
VERSIONS_FILE: 'neo-app.json'
|
|
26
|
+
};
|
|
27
|
+
exports.SAP_CLIENT_KEY = 'sap-client';
|
|
28
|
+
exports.API_HUB_API_KEY = 'API_HUB_API_KEY';
|
|
29
|
+
exports.API_HUB_TYPE = 'API_HUB_TYPE';
|
|
30
|
+
exports.STEP_FLOORPLAN = 'FLOORPLAN';
|
|
31
|
+
exports.STEP_DATASOURCE_AND_SERVICE = 'DATASOURCE_AND_SERVICE';
|
|
32
|
+
exports.STEP_ENTITY = 'ENTITY';
|
|
33
|
+
exports.STEP_PROJECT_ATTRIBUTES = 'PROJECT_ATTRIBUTES';
|
|
34
|
+
exports.STEP_DEPLOY_CONFIG = 'DEPLOY_CONFIG';
|
|
35
|
+
exports.STEP_FLP_CONFIG = 'FLP_CONFIG';
|
|
36
|
+
// All steps keyed on name
|
|
37
|
+
exports.FIORI_STEPS = [
|
|
38
|
+
{
|
|
39
|
+
key: exports.STEP_FLOORPLAN,
|
|
40
|
+
name: (0, i18n_1.t)('steps.templateSelection.title'),
|
|
41
|
+
description: (0, i18n_1.t)('steps.templateSelection.description'),
|
|
42
|
+
order: 0
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: exports.STEP_DATASOURCE_AND_SERVICE,
|
|
46
|
+
name: (0, i18n_1.t)('steps.datasourceAndServiceSelection.title'),
|
|
47
|
+
description: (0, i18n_1.t)('steps.datasourceAndServiceSelection.description'),
|
|
48
|
+
order: 1
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: exports.STEP_ENTITY,
|
|
52
|
+
name: (0, i18n_1.t)('steps.entityOrViewConfig.title'),
|
|
53
|
+
description: (0, i18n_1.t)('steps.entityOrViewConfig.description'),
|
|
54
|
+
order: 2
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: exports.STEP_PROJECT_ATTRIBUTES,
|
|
58
|
+
name: (0, i18n_1.t)('steps.projectAttributesConfig.title'),
|
|
59
|
+
description: (0, i18n_1.t)('steps.projectAttributesConfig.description'),
|
|
60
|
+
order: 3
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: exports.STEP_DEPLOY_CONFIG,
|
|
64
|
+
name: (0, i18n_1.t)('steps.deployConfig.title'),
|
|
65
|
+
description: (0, i18n_1.t)('steps.deployConfig.description'),
|
|
66
|
+
dependency: (0, i18n_1.t)('steps.projectAttributesConfig.title'),
|
|
67
|
+
order: 4
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: exports.STEP_FLP_CONFIG,
|
|
71
|
+
name: (0, i18n_1.t)('steps.flpConfig.title'),
|
|
72
|
+
description: (0, i18n_1.t)('steps.flpConfig.decription'),
|
|
73
|
+
dependency: (0, i18n_1.t)('steps.projectAttributesConfig.title'),
|
|
74
|
+
order: 5
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
exports.DEFAULT_HOST = 'http://localhost';
|
|
78
|
+
exports.DEFAULT_CAP_HOST = 'http://localhost:4004';
|
|
79
|
+
exports.DEFAULT_SERVICE_PATH = '/sap/opu/odata';
|
|
80
|
+
// Manifest constants
|
|
81
|
+
exports.MAIN_DATASOURCE_NAME = 'mainService';
|
|
82
|
+
exports.MAIN_MODEL_NAME = 'mainModel';
|
|
83
|
+
// The generator name to appear in README.md, telemetry events and logs
|
|
84
|
+
exports.generatorName = 'SAP Fiori Application Generator';
|
|
85
|
+
exports.FPM_DEFAULT_PAGE_NAME = 'Main';
|
|
86
|
+
// App gen specific (not writer specific) supported UI5 versions
|
|
87
|
+
exports.minSupportedUi5Version = '1.65.0';
|
|
88
|
+
exports.minSupportedUi5VersionV4 = '1.84.0';
|
|
89
|
+
exports.defaultNavActionTile = 'tile';
|
|
90
|
+
exports.defaultNavActionDisplay = 'display';
|
|
91
|
+
/**
|
|
92
|
+
* Represents a list of App Generator specific feature toggles.
|
|
93
|
+
*/
|
|
94
|
+
var Features;
|
|
95
|
+
(function (Features) {
|
|
96
|
+
Features["enableGAIntegration"] = "enableGAIntegration"; // Adds support for GA launch commands with GA links
|
|
97
|
+
})(Features || (exports.Features = Features = {}));
|
|
98
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import type { IPrompt as Step } from '@sap-devx/yeoman-ui-types';
|
|
2
|
+
import type { Annotations } from '@sap-ux/axios-extension';
|
|
3
|
+
import { TemplateType as FETemplateType } from '@sap-ux/fiori-elements-writer';
|
|
4
|
+
import { TemplateType as FFTemplateType } from '@sap-ux/fiori-freestyle-writer';
|
|
5
|
+
import type { PromptSeverityMessage } from '@sap-ux/inquirer-common';
|
|
6
|
+
import type { DeployConfig, FLPConfig } from '@sap-ux/fiori-generator-shared';
|
|
7
|
+
import type { CapRuntime, EntityRelatedAnswers } from '@sap-ux/odata-service-inquirer';
|
|
8
|
+
import { OdataVersion } from '@sap-ux/odata-service-inquirer';
|
|
9
|
+
import { promptNames as ui5AppInquirerPromptNames } from '@sap-ux/ui5-application-inquirer';
|
|
10
|
+
import type { Answers, Question } from 'inquirer';
|
|
11
|
+
import { type ALPOptions, type Project, type Service, type Floorplan, FloorplanFE, FloorplanFF } from './state';
|
|
12
|
+
export { Floorplan, FloorplanFE, FloorplanFF };
|
|
13
|
+
export type FloorplanKey = keyof typeof FloorplanFE | keyof typeof FloorplanFF;
|
|
14
|
+
type FloorplanAttributesType = {
|
|
15
|
+
[K in Floorplan]: {
|
|
16
|
+
supportedODataVersion: OdataVersion[];
|
|
17
|
+
deprecated?: boolean;
|
|
18
|
+
templateType: FETemplateType | FFTemplateType;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const FloorplanAttributes: FloorplanAttributesType;
|
|
22
|
+
/**
|
|
23
|
+
* Defines the external interface used to generate in headless mode (no prompts)
|
|
24
|
+
* This is a deliberate re-definition of internal interfaces to avoid consumers having
|
|
25
|
+
* to update when internal interfaces are changed
|
|
26
|
+
* NOTE: Any breaking changes to this interface require a version bump
|
|
27
|
+
*/
|
|
28
|
+
export interface AppConfig {
|
|
29
|
+
readonly version: string;
|
|
30
|
+
readonly floorplan: FloorplanKey;
|
|
31
|
+
project: {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
targetFolder?: string;
|
|
34
|
+
readonly namespace?: string;
|
|
35
|
+
readonly title?: string;
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
readonly ui5Theme?: string;
|
|
38
|
+
readonly ui5Version?: string;
|
|
39
|
+
readonly localUI5Version?: string;
|
|
40
|
+
readonly sapux?: boolean;
|
|
41
|
+
readonly skipAnnotations?: boolean;
|
|
42
|
+
readonly enableCodeAssist?: boolean;
|
|
43
|
+
readonly enableEslint?: boolean;
|
|
44
|
+
readonly enableTypeScript?: boolean;
|
|
45
|
+
};
|
|
46
|
+
service?: {
|
|
47
|
+
readonly host?: string;
|
|
48
|
+
readonly servicePath?: string;
|
|
49
|
+
readonly client?: string;
|
|
50
|
+
readonly scp?: boolean;
|
|
51
|
+
readonly destination?: string;
|
|
52
|
+
readonly destinationInstance?: string;
|
|
53
|
+
readonly edmx?: string;
|
|
54
|
+
readonly annotations?: Annotations | Annotations[];
|
|
55
|
+
readonly capService?: {
|
|
56
|
+
readonly projectPath: string;
|
|
57
|
+
readonly serviceName: string;
|
|
58
|
+
readonly serviceCdsPath: string;
|
|
59
|
+
readonly capType?: CapRuntime;
|
|
60
|
+
readonly appPath?: string;
|
|
61
|
+
};
|
|
62
|
+
readonly apiHubApiKey?: string;
|
|
63
|
+
};
|
|
64
|
+
deployConfig?: DeployConfig;
|
|
65
|
+
flpConfig?: FLPConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Adds telemetry data when passed to generator `@sap/generator-fiori:headless`
|
|
68
|
+
*/
|
|
69
|
+
telemetryData?: {
|
|
70
|
+
generationSourceName?: string;
|
|
71
|
+
generationSourceVersion?: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Defines the entity config property of the external app config interface used to generate in headless mode (no prompts)
|
|
76
|
+
*/
|
|
77
|
+
export interface EntityConfig {
|
|
78
|
+
mainEntity?: {
|
|
79
|
+
entityName: string;
|
|
80
|
+
type?: any;
|
|
81
|
+
};
|
|
82
|
+
filterEntityType?: string;
|
|
83
|
+
navigationEntity?: {
|
|
84
|
+
EntitySet: string;
|
|
85
|
+
Name: string;
|
|
86
|
+
Role?: string;
|
|
87
|
+
};
|
|
88
|
+
generateFormAnnotations?: boolean;
|
|
89
|
+
generateLROPAnnotations?: boolean;
|
|
90
|
+
qualifier?: string;
|
|
91
|
+
tableType?: EntityRelatedAnswers['tableType'];
|
|
92
|
+
hierarchyQualifier?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Defines the external interface used to generate in headless mode (no prompts)
|
|
96
|
+
* This is a deliberate re-definition of internal interfaces to avoid consumers having
|
|
97
|
+
* to update when internal interfaces are changed
|
|
98
|
+
* NOTE: Any breaking changes to this interface require a version bump
|
|
99
|
+
*/
|
|
100
|
+
export interface FEAppConfig extends AppConfig {
|
|
101
|
+
readonly entityConfig: EntityConfig;
|
|
102
|
+
readonly alpOptions?: ALPOptions;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Defines the external interface used to generate in headless mode (no prompts)
|
|
106
|
+
* This is a deliberate re-definition of internal interfaces to avoid consumers having
|
|
107
|
+
* to update when internal interfaces are changed
|
|
108
|
+
* NOTE: Any breaking changes to this interface require a version bump
|
|
109
|
+
*/
|
|
110
|
+
export interface FFAppConfig extends AppConfig {
|
|
111
|
+
project: AppConfig['project'] & {
|
|
112
|
+
readonly viewName?: string;
|
|
113
|
+
};
|
|
114
|
+
service?: AppConfig['service'];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Checks the capType provided for headless generation and converts
|
|
118
|
+
* to the new version (Node.js, Java) if required. Defaults to `Node.js` if not provided.
|
|
119
|
+
*
|
|
120
|
+
* @param capType - legacyCapType (capNode, capJava) OR cds runtime (Node.js, Java)
|
|
121
|
+
* @returns - CapRuntime (Node.js, Java)
|
|
122
|
+
*/
|
|
123
|
+
export declare function capTypeConversion(capType?: string): CapRuntime;
|
|
124
|
+
/**
|
|
125
|
+
* Externally configurable generator settings, can be passed as options or by providing _getSettings() in generator extensions
|
|
126
|
+
*
|
|
127
|
+
* @deprecated These are legacy settings and should be provided via generator extensions if they relate to S/4 explicitly.
|
|
128
|
+
* In some cases they should be directly set as prompt options (e.g. from adaptors).
|
|
129
|
+
* See for example: https://github.wdf.sap.corp/ux-engineering/s4-fiori-tools-extensions/issues/385 .
|
|
130
|
+
* We can directly set the hiding of ui5 version prompt from inquirer prompt options via the extensions interface instead of a specific setting.
|
|
131
|
+
*
|
|
132
|
+
* NOTE: Only options specific to FE/FF generators should be passed as options, all other options should be provided via generator extensions
|
|
133
|
+
*/
|
|
134
|
+
export interface FioriGeneratorSettings {
|
|
135
|
+
/**
|
|
136
|
+
* Toggles ui5 version prompting
|
|
137
|
+
*
|
|
138
|
+
* @deprecated Use extensions + prompt options (UI5ApplcationInquirer `ui5Version` options 'hide') to control this
|
|
139
|
+
*/
|
|
140
|
+
hideUI5VersionPrompt?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Toggles the generation of index.html and excludes the start-noflp script from package.json
|
|
143
|
+
*/
|
|
144
|
+
generateIndexHtml?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Entity passed in to be set as the default in the (FE) mainEntity prompt
|
|
147
|
+
*/
|
|
148
|
+
preselectedEntityName?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Toggles whether a warning is shown if the service is draft enabled but does not support collaborative draft.
|
|
151
|
+
*/
|
|
152
|
+
showCollabDraftWarning?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Toggles Table Type prompt and layout options for LROP, Worklist and ALP floorplans
|
|
155
|
+
*/
|
|
156
|
+
showLayoutPrompts?: boolean;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Defines the currently allowed extension points for a Fiori Generator prompt
|
|
160
|
+
* todo: Include open source inquirer prompt options (UI5ApplicationInquirer prompt options) also so extensions can directly use them
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
export type PromptExtension = {
|
|
164
|
+
[key in ui5AppInquirerPromptNames]?: {
|
|
165
|
+
validate?: Question['validate'];
|
|
166
|
+
default?: Question['default'];
|
|
167
|
+
additionalMessages?: PromptSeverityMessage;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export interface FioriGeneratorPromptExtension {
|
|
171
|
+
[generatorName: string]: PromptExtension;
|
|
172
|
+
}
|
|
173
|
+
export interface ConditionalStep extends Step {
|
|
174
|
+
/**
|
|
175
|
+
* Provide a function which returns true when a step should be added, answers to previous questions will be provided
|
|
176
|
+
*
|
|
177
|
+
* @param answers
|
|
178
|
+
* @returns
|
|
179
|
+
*/
|
|
180
|
+
when?: (answers?: Answers) => boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Defines the API to extend and customise the Fiori Generator
|
|
184
|
+
*
|
|
185
|
+
*/
|
|
186
|
+
export interface FioriGeneratorExtensionAPI {
|
|
187
|
+
/**
|
|
188
|
+
* Returns the settings to control some prompt and generation options
|
|
189
|
+
*/
|
|
190
|
+
_getSettings?: () => FioriGeneratorSettings;
|
|
191
|
+
/**
|
|
192
|
+
* Returns the extensions which extend existing Fiori generator prompts
|
|
193
|
+
*/
|
|
194
|
+
_getExtensions?: () => FioriGeneratorPromptExtension;
|
|
195
|
+
/**
|
|
196
|
+
* Returns the navigation steps which group new prompts provided in the prompting phase
|
|
197
|
+
*/
|
|
198
|
+
_getSteps?: () => ConditionalStep[];
|
|
199
|
+
/**
|
|
200
|
+
* Opt in for extension Telemetry
|
|
201
|
+
* Enabling this will result in SAP capturing extension name and version
|
|
202
|
+
*/
|
|
203
|
+
enableTelemetryData?: boolean;
|
|
204
|
+
}
|
|
205
|
+
export type RecursiveReadonly<T> = {
|
|
206
|
+
readonly [P in keyof T]: RecursiveReadonly<T[P]>;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Fiori Elements internal floorplan/template/project types
|
|
210
|
+
*
|
|
211
|
+
* @deprecated Use FloorplanFE instead, will be removed shortly
|
|
212
|
+
*/
|
|
213
|
+
export declare enum PROJECT_TYPE {
|
|
214
|
+
Worklist = "worklist",
|
|
215
|
+
OverviewPage = "ovp",
|
|
216
|
+
ListReportObjectPage = "lrop",
|
|
217
|
+
AnalyticalListPage = "alp",
|
|
218
|
+
FormEntryObjectPage = "feop",
|
|
219
|
+
FlexibleProgrammingModel = "fpm"
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Fiori Freestyle internal floorplan/template/project types
|
|
223
|
+
*
|
|
224
|
+
* @deprecated Use FloorplanFF instead, will be removed shortly
|
|
225
|
+
*/
|
|
226
|
+
export declare enum Template {
|
|
227
|
+
Simple = "basic"
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* To support deprecation of the project properties `projectType` from `@sap/generator-fiori-elements`
|
|
231
|
+
* and `template` from `@sap/generator-fiori-freestyle`, which used to be sub-generator specific, before merging the generators,
|
|
232
|
+
* adding the same properties to the exported ReadonlyState that is used by extensions to maintain compatibility with existing extensions.
|
|
233
|
+
* These will be removed in future.
|
|
234
|
+
*/
|
|
235
|
+
interface DeprecatedProjectProperties {
|
|
236
|
+
/**
|
|
237
|
+
* @deprecated Use ReadonlyState.floorplan instead
|
|
238
|
+
*/
|
|
239
|
+
projectType?: PROJECT_TYPE;
|
|
240
|
+
/**
|
|
241
|
+
* @deprecated Use ReadonlyState.floorplan instead
|
|
242
|
+
*/
|
|
243
|
+
template?: Template;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Export of internal Fiori generator state with all properties marked as readonly.
|
|
247
|
+
* For use with sub-generator extensions.
|
|
248
|
+
*/
|
|
249
|
+
export interface ReadonlyState {
|
|
250
|
+
readonly project: RecursiveReadonly<Partial<Project>> & DeprecatedProjectProperties;
|
|
251
|
+
readonly service: RecursiveReadonly<Partial<Service>>;
|
|
252
|
+
readonly entityRelatedConfig?: RecursiveReadonly<EntityRelatedAnswers>;
|
|
253
|
+
readonly floorplan: Floorplan;
|
|
254
|
+
}
|
|
255
|
+
export declare const defaultPromptValues: {
|
|
256
|
+
enableCodeAssist: boolean;
|
|
257
|
+
enableEslint: boolean;
|
|
258
|
+
skipAnnotations: boolean;
|
|
259
|
+
enableTypeScript: boolean;
|
|
260
|
+
};
|
|
261
|
+
//# sourceMappingURL=external.d.ts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultPromptValues = exports.Template = exports.PROJECT_TYPE = exports.FloorplanAttributes = exports.FloorplanFF = exports.FloorplanFE = void 0;
|
|
4
|
+
exports.capTypeConversion = capTypeConversion;
|
|
5
|
+
const fiori_elements_writer_1 = require("@sap-ux/fiori-elements-writer");
|
|
6
|
+
const fiori_freestyle_writer_1 = require("@sap-ux/fiori-freestyle-writer");
|
|
7
|
+
const odata_service_inquirer_1 = require("@sap-ux/odata-service-inquirer");
|
|
8
|
+
const ui5_application_inquirer_1 = require("@sap-ux/ui5-application-inquirer");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const state_1 = require("./state");
|
|
11
|
+
Object.defineProperty(exports, "FloorplanFE", { enumerable: true, get: function () { return state_1.FloorplanFE; } });
|
|
12
|
+
Object.defineProperty(exports, "FloorplanFF", { enumerable: true, get: function () { return state_1.FloorplanFF; } });
|
|
13
|
+
exports.FloorplanAttributes = {
|
|
14
|
+
[state_1.FloorplanFE.FE_LROP]: {
|
|
15
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v2, odata_service_inquirer_1.OdataVersion.v4],
|
|
16
|
+
templateType: fiori_elements_writer_1.TemplateType.ListReportObjectPage
|
|
17
|
+
},
|
|
18
|
+
[state_1.FloorplanFE.FE_ALP]: {
|
|
19
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v2, odata_service_inquirer_1.OdataVersion.v4],
|
|
20
|
+
templateType: fiori_elements_writer_1.TemplateType.AnalyticalListPage
|
|
21
|
+
},
|
|
22
|
+
[state_1.FloorplanFE.FE_WORKLIST]: {
|
|
23
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v2, odata_service_inquirer_1.OdataVersion.v4],
|
|
24
|
+
templateType: fiori_elements_writer_1.TemplateType.Worklist
|
|
25
|
+
},
|
|
26
|
+
[state_1.FloorplanFE.FE_FEOP]: {
|
|
27
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v4],
|
|
28
|
+
templateType: fiori_elements_writer_1.TemplateType.FormEntryObjectPage
|
|
29
|
+
},
|
|
30
|
+
[state_1.FloorplanFE.FE_OVP]: {
|
|
31
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v2, odata_service_inquirer_1.OdataVersion.v4],
|
|
32
|
+
templateType: fiori_elements_writer_1.TemplateType.OverviewPage
|
|
33
|
+
},
|
|
34
|
+
[state_1.FloorplanFE.FE_FPM]: {
|
|
35
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v4],
|
|
36
|
+
templateType: fiori_elements_writer_1.TemplateType.FlexibleProgrammingModel
|
|
37
|
+
},
|
|
38
|
+
[state_1.FloorplanFF.FF_SIMPLE]: {
|
|
39
|
+
supportedODataVersion: [odata_service_inquirer_1.OdataVersion.v2, odata_service_inquirer_1.OdataVersion.v4],
|
|
40
|
+
templateType: fiori_freestyle_writer_1.TemplateType.Basic
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Checks the capType provided for headless generation and converts
|
|
45
|
+
* to the new version (Node.js, Java) if required. Defaults to `Node.js` if not provided.
|
|
46
|
+
*
|
|
47
|
+
* @param capType - legacyCapType (capNode, capJava) OR cds runtime (Node.js, Java)
|
|
48
|
+
* @returns - CapRuntime (Node.js, Java)
|
|
49
|
+
*/
|
|
50
|
+
function capTypeConversion(capType) {
|
|
51
|
+
if (capType === constants_1.LEGACY_CAP_TYPE_NODE || capType === 'Node.js') {
|
|
52
|
+
return 'Node.js';
|
|
53
|
+
}
|
|
54
|
+
else if (capType === constants_1.LEGACY_CAP_TYPE_JAVA || capType === 'Java') {
|
|
55
|
+
return 'Java';
|
|
56
|
+
}
|
|
57
|
+
return 'Node.js';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Fiori Elements internal floorplan/template/project types
|
|
61
|
+
*
|
|
62
|
+
* @deprecated Use FloorplanFE instead, will be removed shortly
|
|
63
|
+
*/
|
|
64
|
+
var PROJECT_TYPE;
|
|
65
|
+
(function (PROJECT_TYPE) {
|
|
66
|
+
PROJECT_TYPE["Worklist"] = "worklist";
|
|
67
|
+
PROJECT_TYPE["OverviewPage"] = "ovp";
|
|
68
|
+
PROJECT_TYPE["ListReportObjectPage"] = "lrop";
|
|
69
|
+
PROJECT_TYPE["AnalyticalListPage"] = "alp";
|
|
70
|
+
PROJECT_TYPE["FormEntryObjectPage"] = "feop";
|
|
71
|
+
PROJECT_TYPE["FlexibleProgrammingModel"] = "fpm";
|
|
72
|
+
})(PROJECT_TYPE || (exports.PROJECT_TYPE = PROJECT_TYPE = {}));
|
|
73
|
+
/**
|
|
74
|
+
* Fiori Freestyle internal floorplan/template/project types
|
|
75
|
+
*
|
|
76
|
+
* @deprecated Use FloorplanFF instead, will be removed shortly
|
|
77
|
+
*/
|
|
78
|
+
var Template;
|
|
79
|
+
(function (Template) {
|
|
80
|
+
Template["Simple"] = "basic";
|
|
81
|
+
})(Template || (exports.Template = Template = {}));
|
|
82
|
+
exports.defaultPromptValues = {
|
|
83
|
+
[ui5_application_inquirer_1.promptNames.enableCodeAssist]: false,
|
|
84
|
+
[ui5_application_inquirer_1.promptNames.enableEslint]: false,
|
|
85
|
+
[ui5_application_inquirer_1.promptNames.skipAnnotations]: false,
|
|
86
|
+
[ui5_application_inquirer_1.promptNames.enableTypeScript]: false
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=external.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./state"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./common"), exports);
|
|
20
|
+
__exportStar(require("./yeomanUiStepConfig"), exports);
|
|
21
|
+
__exportStar(require("./external"), exports);
|
|
22
|
+
__exportStar(require("./telemetryEvents"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { Annotations } from '@sap-ux/axios-extension';
|
|
2
|
+
import type { CapServiceCdsInfo } from '@sap-ux/cap-config-writer';
|
|
3
|
+
import type { CdsUi5PluginInfo, UI5FlexLayer } from '@sap-ux/project-access';
|
|
4
|
+
import type { TableSelectionMode } from '@sap-ux/fiori-elements-writer';
|
|
5
|
+
import type { CapService, DatasourceType, EntityRelatedAnswers, OdataServiceAnswers, OdataVersion } from '@sap-ux/odata-service-inquirer';
|
|
6
|
+
import type { ApiHubType, SapSystemSourceType } from '../types/constants';
|
|
7
|
+
import type { Script } from './common';
|
|
8
|
+
export interface Project {
|
|
9
|
+
targetFolder: string;
|
|
10
|
+
addDeployConfig?: boolean;
|
|
11
|
+
addFlpConfig?: boolean;
|
|
12
|
+
name: string;
|
|
13
|
+
namespace?: string;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
ui5Theme: string;
|
|
17
|
+
ui5Version: string;
|
|
18
|
+
ui5FrameworkUrl?: string;
|
|
19
|
+
localUI5Version: string;
|
|
20
|
+
sapux?: boolean;
|
|
21
|
+
skipAnnotations?: boolean;
|
|
22
|
+
enableCodeAssist?: boolean;
|
|
23
|
+
enableEslint?: boolean;
|
|
24
|
+
enableTypeScript?: boolean;
|
|
25
|
+
formEntry?: boolean;
|
|
26
|
+
flpAppId?: string;
|
|
27
|
+
minSupportedUI5Version?: string;
|
|
28
|
+
manifestMinUI5Version?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface Credentials {
|
|
31
|
+
username: string;
|
|
32
|
+
password?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* To be replaced with `@sap-ux/odata-service-inquirer`'s `OdataService` type once all data source flows are migrated ro open-ux-tools
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export interface Service {
|
|
39
|
+
host?: string;
|
|
40
|
+
client?: string;
|
|
41
|
+
destinationName?: string;
|
|
42
|
+
servicePath?: string;
|
|
43
|
+
edmx?: string;
|
|
44
|
+
annotations?: Annotations[];
|
|
45
|
+
version?: OdataVersion;
|
|
46
|
+
/**
|
|
47
|
+
* While the required type `CapServiceCdsInfo` mandates `cdsUi5PluginInfo` when writing to cap config, this information is not intially available.
|
|
48
|
+
* So we make it optional here.
|
|
49
|
+
*/
|
|
50
|
+
capService?: Omit<CapServiceCdsInfo, 'cdsUi5PluginInfo'> & {
|
|
51
|
+
cdsUi5PluginInfo?: CdsUi5PluginInfo;
|
|
52
|
+
};
|
|
53
|
+
source: DatasourceType;
|
|
54
|
+
sapSystemSource?: SapSystemSourceType;
|
|
55
|
+
localEdmxFilePath?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Connected system information, used for preview settings and deploy configurations
|
|
58
|
+
*/
|
|
59
|
+
connectedSystem?: OdataServiceAnswers['connectedSystem'];
|
|
60
|
+
/**
|
|
61
|
+
* Only used by adaptors to specify the authentication type, use `connectedSystem.destination.Authentication` instead
|
|
62
|
+
*/
|
|
63
|
+
destinationAuthType?: string;
|
|
64
|
+
apiHubConfig?: ApiHubConfig;
|
|
65
|
+
ignoreCertError?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Defines the api hub service properties or enterprise and non-enterprise versions
|
|
69
|
+
*/
|
|
70
|
+
export interface ApiHubConfig {
|
|
71
|
+
apiHubKey: string;
|
|
72
|
+
apiHubType: ApiHubType;
|
|
73
|
+
}
|
|
74
|
+
export interface CapServiceCdsInfoInternal extends CapService {
|
|
75
|
+
capCdsInfo?: CdsUi5PluginInfo;
|
|
76
|
+
}
|
|
77
|
+
/** package.json interface */
|
|
78
|
+
export interface PackageJson {
|
|
79
|
+
name: string;
|
|
80
|
+
description: string;
|
|
81
|
+
startCommand: string;
|
|
82
|
+
startLocalCommand: string;
|
|
83
|
+
startNoFlpCommand: string;
|
|
84
|
+
startVariantsCommand: string;
|
|
85
|
+
addMockCommand?: boolean;
|
|
86
|
+
sapClientParam?: string;
|
|
87
|
+
flpAppId?: string;
|
|
88
|
+
devDependencies: {
|
|
89
|
+
[key: string]: string;
|
|
90
|
+
};
|
|
91
|
+
ui5Dependencies: string[];
|
|
92
|
+
sapux?: boolean;
|
|
93
|
+
startFile?: string;
|
|
94
|
+
localStartFile?: string;
|
|
95
|
+
runTasks?: Script[];
|
|
96
|
+
enableEslint: boolean;
|
|
97
|
+
sapuxLayer?: UI5FlexLayer;
|
|
98
|
+
}
|
|
99
|
+
export interface State {
|
|
100
|
+
project: Project;
|
|
101
|
+
service: Service;
|
|
102
|
+
/**
|
|
103
|
+
* Entity configuration for templates that require it
|
|
104
|
+
*/
|
|
105
|
+
entityRelatedConfig?: EntityRelatedAnswers;
|
|
106
|
+
/**
|
|
107
|
+
* View name for templates that require it (e.g. freestyle)
|
|
108
|
+
*/
|
|
109
|
+
viewName?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The template selected by the user, maybe FE or FF
|
|
112
|
+
*/
|
|
113
|
+
floorplan: Floorplan;
|
|
114
|
+
}
|
|
115
|
+
/** Only used by headless */
|
|
116
|
+
export interface ALPOptions {
|
|
117
|
+
qualifier: string;
|
|
118
|
+
multiSelect: boolean;
|
|
119
|
+
autoHide: boolean;
|
|
120
|
+
smartVariantManagement: boolean;
|
|
121
|
+
selectionMode: TableSelectionMode;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Due to ts(18033) we cannot use the type values directly here:
|
|
125
|
+
* FF_SIMPLE = FFTemplateType.Basic // Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove the hardcoded values and directly use the template values
|
|
126
|
+
*/
|
|
127
|
+
export declare enum FloorplanFF {
|
|
128
|
+
FF_SIMPLE = "basic"
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Due to ts(18033) we cannot use the type values directly here:
|
|
132
|
+
* Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove hardcoded values and directly use the template values
|
|
133
|
+
* FE_FPM = FETemplateType.FlexibleProgrammingModel,
|
|
134
|
+
* FE_LROP = FETemplateType.ListReportObjectPage,
|
|
135
|
+
* FE_OVP = FETemplateType.OverviewPage,
|
|
136
|
+
* FE_ALP = FETemplateType.AnalyticalListPage,
|
|
137
|
+
* FE_FEOP = FETemplateType.FormEntryObjectPage,
|
|
138
|
+
* FE_WORKLIST = FETemplateType.Worklist
|
|
139
|
+
*/
|
|
140
|
+
export declare enum FloorplanFE {
|
|
141
|
+
FE_FPM = "fpm",
|
|
142
|
+
FE_LROP = "lrop",
|
|
143
|
+
FE_OVP = "ovp",
|
|
144
|
+
FE_ALP = "alp",
|
|
145
|
+
FE_FEOP = "feop",
|
|
146
|
+
FE_WORKLIST = "worklist"
|
|
147
|
+
}
|
|
148
|
+
export type Floorplan = FloorplanFE | FloorplanFF;
|
|
149
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FloorplanFE = exports.FloorplanFF = void 0;
|
|
4
|
+
// Union types to expose a single interface property for Floorplan
|
|
5
|
+
// This provides a layer of abstraction to isolate internal changes from external headless API consumers
|
|
6
|
+
// Since these keys are used as an external API definiton they need to be meaningful
|
|
7
|
+
// Note that ordering here determines rendering order
|
|
8
|
+
/**
|
|
9
|
+
* Due to ts(18033) we cannot use the type values directly here:
|
|
10
|
+
* FF_SIMPLE = FFTemplateType.Basic // Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove the hardcoded values and directly use the template values
|
|
11
|
+
*/
|
|
12
|
+
var FloorplanFF;
|
|
13
|
+
(function (FloorplanFF) {
|
|
14
|
+
FloorplanFF["FF_SIMPLE"] = "basic";
|
|
15
|
+
})(FloorplanFF || (exports.FloorplanFF = FloorplanFF = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Due to ts(18033) we cannot use the type values directly here:
|
|
18
|
+
* Once https://github.com/microsoft/TypeScript/pull/59475 is merged we can remove hardcoded values and directly use the template values
|
|
19
|
+
* FE_FPM = FETemplateType.FlexibleProgrammingModel,
|
|
20
|
+
* FE_LROP = FETemplateType.ListReportObjectPage,
|
|
21
|
+
* FE_OVP = FETemplateType.OverviewPage,
|
|
22
|
+
* FE_ALP = FETemplateType.AnalyticalListPage,
|
|
23
|
+
* FE_FEOP = FETemplateType.FormEntryObjectPage,
|
|
24
|
+
* FE_WORKLIST = FETemplateType.Worklist
|
|
25
|
+
*/
|
|
26
|
+
var FloorplanFE;
|
|
27
|
+
(function (FloorplanFE) {
|
|
28
|
+
FloorplanFE["FE_FPM"] = "fpm";
|
|
29
|
+
FloorplanFE["FE_LROP"] = "lrop";
|
|
30
|
+
FloorplanFE["FE_OVP"] = "ovp";
|
|
31
|
+
FloorplanFE["FE_ALP"] = "alp";
|
|
32
|
+
FloorplanFE["FE_FEOP"] = "feop";
|
|
33
|
+
FloorplanFE["FE_WORKLIST"] = "worklist";
|
|
34
|
+
})(FloorplanFE || (exports.FloorplanFE = FloorplanFE = {}));
|
|
35
|
+
//# sourceMappingURL=state.js.map
|