@sap-ux/ui-service-inquirer 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { TOptions } from 'i18next';
2
+ /**
3
+ * Initialize i18next with the translations for this module.
4
+ */
5
+ export declare function initI18n(): Promise<void>;
6
+ /**
7
+ * Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
8
+ *
9
+ * @param key i18n key
10
+ * @param options additional options
11
+ * @returns {string} localized string stored for the given key
12
+ */
13
+ export declare function t(key: string, options?: TOptions): string;
14
+ //# sourceMappingURL=i18n.d.ts.map
package/dist/i18n.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.t = exports.initI18n = void 0;
7
+ const i18next_1 = __importDefault(require("i18next"));
8
+ const ui_service_inquirer_i18n_json_1 = __importDefault(require("./translations/ui-service-inquirer.i18n.json"));
9
+ const uiServiceI18nNamespace = 'ui-service-inquirer';
10
+ /**
11
+ * Initialize i18next with the translations for this module.
12
+ */
13
+ async function initI18n() {
14
+ await i18next_1.default.init({ lng: 'en', fallbackLng: 'en' });
15
+ i18next_1.default.addResourceBundle('en', uiServiceI18nNamespace, ui_service_inquirer_i18n_json_1.default);
16
+ }
17
+ exports.initI18n = initI18n;
18
+ /**
19
+ * Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
20
+ *
21
+ * @param key i18n key
22
+ * @param options additional options
23
+ * @returns {string} localized string stored for the given key
24
+ */
25
+ function t(key, options) {
26
+ if (!options?.ns) {
27
+ options = Object.assign(options ?? {}, { ns: uiServiceI18nNamespace });
28
+ }
29
+ return i18next_1.default.t(key, options);
30
+ }
31
+ exports.t = t;
32
+ initI18n().catch(() => {
33
+ // Needed for lint
34
+ });
35
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export { getSystemSelectionPrompts, getConfigPrompts } from './prompts';
3
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
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
+ exports.getConfigPrompts = exports.getSystemSelectionPrompts = void 0;
18
+ __exportStar(require("./types"), exports);
19
+ var prompts_1 = require("./prompts");
20
+ Object.defineProperty(exports, "getSystemSelectionPrompts", { enumerable: true, get: function () { return prompts_1.getSystemSelectionPrompts; } });
21
+ Object.defineProperty(exports, "getConfigPrompts", { enumerable: true, get: function () { return prompts_1.getConfigPrompts; } });
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,20 @@
1
+ import { type Logger } from '@sap-ux/logger';
2
+ /**
3
+ * Static logger prevents passing of logger references through all functions, as this is a cross-cutting concern.
4
+ */
5
+ export default class LoggerHelper {
6
+ private static _logger;
7
+ /**
8
+ * Get the logger.
9
+ *
10
+ * @returns the logger
11
+ */
12
+ static get logger(): Logger;
13
+ /**
14
+ * Set the logger.
15
+ *
16
+ * @param value the logger to set
17
+ */
18
+ static set logger(value: Logger);
19
+ }
20
+ //# sourceMappingURL=logger-helper.d.ts.map
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const logger_1 = require("@sap-ux/logger");
4
+ /**
5
+ * Static logger prevents passing of logger references through all functions, as this is a cross-cutting concern.
6
+ */
7
+ class LoggerHelper {
8
+ static _logger = new logger_1.ToolsLogger({ logPrefix: '@sap-ux/ui-service-inquirer' });
9
+ /**
10
+ * Get the logger.
11
+ *
12
+ * @returns the logger
13
+ */
14
+ static get logger() {
15
+ return LoggerHelper._logger;
16
+ }
17
+ /**
18
+ * Set the logger.
19
+ *
20
+ * @param value the logger to set
21
+ */
22
+ static set logger(value) {
23
+ LoggerHelper._logger = value;
24
+ }
25
+ }
26
+ exports.default = LoggerHelper;
27
+ //# sourceMappingURL=logger-helper.js.map
@@ -0,0 +1,2 @@
1
+ export * from './questions';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
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("./questions"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,10 @@
1
+ import { type Logger } from '@sap-ux/logger';
2
+ import type { ServiceConfigQuestion } from '../../types';
3
+ /**
4
+ * Get the configuration questions.
5
+ *
6
+ * @param logger - logger instance to use for logging
7
+ * @returns the configuration questions
8
+ */
9
+ export declare function getConfigQuestions(logger: Logger): ServiceConfigQuestion[];
10
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfigQuestions = void 0;
4
+ const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
5
+ const abap_deploy_config_inquirer_1 = require("@sap-ux/abap-deploy-config-inquirer");
6
+ const i18n_1 = require("../../i18n");
7
+ const prompt_helper_1 = require("../prompt-helper");
8
+ const prompt_state_1 = require("../prompt-state");
9
+ /**
10
+ * Get the configuration questions.
11
+ *
12
+ * @param logger - logger instance to use for logging
13
+ * @returns the configuration questions
14
+ */
15
+ function getConfigQuestions(logger) {
16
+ prompt_state_1.PromptState.resetServiceConfig();
17
+ let draftEnabled = true;
18
+ const abapTarget = (0, prompt_helper_1.createAbapTarget)(prompt_state_1.PromptState.systemSelection.connectedSystem?.destination, prompt_state_1.PromptState.systemSelection.connectedSystem?.backendSystem);
19
+ const packagePrompts = (0, abap_deploy_config_inquirer_1.getPackagePrompts)({
20
+ packageAutocomplete: {
21
+ useAutocomplete: true
22
+ },
23
+ backendTarget: {
24
+ abapTarget: abapTarget,
25
+ serviceProvider: prompt_state_1.PromptState.systemSelection.connectedSystem?.serviceProvider
26
+ }
27
+ }, true, true);
28
+ const transportPrompts = (0, abap_deploy_config_inquirer_1.getTransportRequestPrompts)({
29
+ backendTarget: {
30
+ abapTarget: abapTarget,
31
+ serviceProvider: prompt_state_1.PromptState.systemSelection.connectedSystem?.serviceProvider
32
+ },
33
+ transportInputChoice: {
34
+ showCreateDuringDeploy: false
35
+ },
36
+ ui5AbapRepo: {
37
+ default: 'ztestapp'
38
+ }
39
+ }, true, true);
40
+ const configPrompts = [
41
+ {
42
+ when: async (answers) => {
43
+ if (!!answers.packageManual || !!answers.packageAutocomplete) {
44
+ try {
45
+ const packageValue = answers.packageManual ?? answers.packageAutocomplete ?? '';
46
+ prompt_state_1.PromptState.serviceConfig.content =
47
+ (await prompt_state_1.PromptState.systemSelection.objectGenerator?.getContent(packageValue)) ?? '';
48
+ const content = JSON.parse(prompt_state_1.PromptState.serviceConfig?.content);
49
+ content.businessObject.projectionBehavior.withDraft = true;
50
+ prompt_state_1.PromptState.serviceConfig.content = JSON.stringify(content);
51
+ prompt_state_1.PromptState.serviceConfig.serviceName =
52
+ content.businessService.serviceBinding.serviceBindingName;
53
+ }
54
+ catch (e) {
55
+ logger?.error(`${(0, i18n_1.t)('error.fetchingContentForServiceBinding')}: ${e.message}`);
56
+ }
57
+ }
58
+ return !!prompt_state_1.PromptState.serviceConfig.serviceName || !!prompt_state_1.PromptState.serviceConfig.content;
59
+ },
60
+ type: 'expand',
61
+ name: 'serviceName',
62
+ guiOptions: {
63
+ breadcrumb: (0, i18n_1.t)('prompts.serviceNameBreadcrumb')
64
+ },
65
+ message: (0, i18n_1.t)('prompts.serviceName'),
66
+ choices: () => (0, prompt_helper_1.getServiceNameChoices)(prompt_state_1.PromptState.serviceConfig.serviceName),
67
+ default: () => 0,
68
+ validate: async () => {
69
+ try {
70
+ const validation = await prompt_state_1.PromptState.systemSelection.objectGenerator?.validateContent(prompt_state_1.PromptState.serviceConfig.content);
71
+ if (validation?.severity === 'ERROR') {
72
+ return await (0, prompt_helper_1.getValidationErrorLink)();
73
+ }
74
+ return true;
75
+ }
76
+ catch (e) {
77
+ logger.error(`${(0, i18n_1.t)('error.validatingContent')}: ${e.message}`);
78
+ return await (0, prompt_helper_1.getValidationErrorLink)();
79
+ }
80
+ }
81
+ },
82
+ {
83
+ name: 'draftEnabled',
84
+ type: 'confirm',
85
+ message: (0, i18n_1.t)('prompts.draftEnabled'),
86
+ guiOptions: {
87
+ breadcrumb: true,
88
+ mandatory: true
89
+ },
90
+ default: true,
91
+ validate: async (input) => {
92
+ if (input !== draftEnabled && prompt_state_1.PromptState.serviceConfig.content) {
93
+ const content = JSON.parse(prompt_state_1.PromptState.serviceConfig.content);
94
+ content.businessObject.projectionBehavior.withDraft = input;
95
+ prompt_state_1.PromptState.serviceConfig.content = JSON.stringify(content);
96
+ try {
97
+ const validation = await prompt_state_1.PromptState.systemSelection.objectGenerator?.validateContent(prompt_state_1.PromptState.serviceConfig.content);
98
+ if (validation?.severity === 'ERROR') {
99
+ return (0, i18n_1.t)('error.validatingContent');
100
+ }
101
+ draftEnabled = input;
102
+ }
103
+ catch (error) {
104
+ logger.error(error.message);
105
+ }
106
+ draftEnabled = input;
107
+ }
108
+ return true;
109
+ }
110
+ },
111
+ {
112
+ name: 'launchAppGen',
113
+ type: 'confirm',
114
+ message: (0, i18n_1.t)('prompts.launchAppGen'),
115
+ guiOptions: {
116
+ breadcrumb: (0, i18n_1.t)('prompts.launchAppGenBreadcrumb')
117
+ },
118
+ additionalMessages: (val) => {
119
+ let additionalMessage;
120
+ if (val) {
121
+ additionalMessage = {
122
+ message: (0, i18n_1.t)('info.appGenLaunch'),
123
+ severity: yeoman_ui_types_1.Severity.information
124
+ };
125
+ }
126
+ return additionalMessage;
127
+ },
128
+ default: false
129
+ }
130
+ ];
131
+ return [...packagePrompts, ...transportPrompts, ...configPrompts];
132
+ }
133
+ exports.getConfigQuestions = getConfigQuestions;
134
+ //# sourceMappingURL=questions.js.map
@@ -0,0 +1,3 @@
1
+ export * from './prompts';
2
+ export * from './prompt-helper';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
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("./prompts"), exports);
18
+ __exportStar(require("./prompt-helper"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,42 @@
1
+ import type { AbapServiceProvider } from '@sap-ux/axios-extension';
2
+ import { type Destination } from '@sap-ux/btp-utils';
3
+ import type { ValidationLink } from '@sap-ux/inquirer-common';
4
+ import type { BackendSystem } from '@sap-ux/store';
5
+ import type { AbapTarget } from '@sap-ux/system-access';
6
+ import type { ListChoiceOptions } from 'inquirer';
7
+ /**
8
+ * Get the business objects.
9
+ *
10
+ * @param provider - the provider to get the business objects
11
+ * @returns the business objects
12
+ */
13
+ export declare function getBusinessObjects(provider: AbapServiceProvider): Promise<ListChoiceOptions[]>;
14
+ /**
15
+ * Get the ABAP CDS views.
16
+ *
17
+ * @param provider - the provider to get the ABAP CDS views
18
+ * @returns the ABAP CDS views
19
+ */
20
+ export declare function getAbapCDSViews(provider: AbapServiceProvider): Promise<ListChoiceOptions[]>;
21
+ /**
22
+ * Create an ABAP target from backend system or destination.
23
+ *
24
+ * @param destination - the destination
25
+ * @param backendSystem - the backend system
26
+ * @returns the ABAP target
27
+ */
28
+ export declare function createAbapTarget(destination?: Destination, backendSystem?: BackendSystem): AbapTarget;
29
+ /**
30
+ * Get the service name choices.
31
+ *
32
+ * @param serviceName - the service name
33
+ * @returns the service name choices
34
+ */
35
+ export declare function getServiceNameChoices(serviceName: string): ListChoiceOptions[];
36
+ /**
37
+ * Get the validation error link.
38
+ *
39
+ * @returns the validation error link
40
+ */
41
+ export declare function getValidationErrorLink(): Promise<ValidationLink>;
42
+ //# sourceMappingURL=prompt-helper.d.ts.map
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValidationErrorLink = exports.getServiceNameChoices = exports.createAbapTarget = exports.getAbapCDSViews = exports.getBusinessObjects = void 0;
4
+ const axios_extension_1 = require("@sap-ux/axios-extension");
5
+ const btp_utils_1 = require("@sap-ux/btp-utils");
6
+ const guided_answers_helper_1 = require("@sap-ux/guided-answers-helper");
7
+ const inquirer_common_1 = require("@sap-ux/inquirer-common");
8
+ const telemetry_1 = require("@sap-ux/telemetry");
9
+ const i18n_1 = require("../i18n");
10
+ /**
11
+ * Get the business objects.
12
+ *
13
+ * @param provider - the provider to get the business objects
14
+ * @returns the business objects
15
+ */
16
+ async function getBusinessObjects(provider) {
17
+ const businessObjectsService = await provider.getAdtService(axios_extension_1.BusinessObjectsService);
18
+ const businessObjects = await businessObjectsService?.getBusinessObjects();
19
+ return (businessObjects?.map((bo) => {
20
+ return { name: `${bo.name} (${bo.description})`, value: bo };
21
+ }) ?? []);
22
+ }
23
+ exports.getBusinessObjects = getBusinessObjects;
24
+ /**
25
+ * Get the ABAP CDS views.
26
+ *
27
+ * @param provider - the provider to get the ABAP CDS views
28
+ * @returns the ABAP CDS views
29
+ */
30
+ async function getAbapCDSViews(provider) {
31
+ const abapCDSViewsService = await provider.getAdtService(axios_extension_1.AbapCDSViewService);
32
+ const abapCDSViews = await abapCDSViewsService?.getAbapCDSViews();
33
+ return (abapCDSViews?.map((abapCDSView) => {
34
+ return { name: `${abapCDSView.name} (${abapCDSView.description})`, value: abapCDSView };
35
+ }) ?? []);
36
+ }
37
+ exports.getAbapCDSViews = getAbapCDSViews;
38
+ /**
39
+ * Create an ABAP target from backend system or destination.
40
+ *
41
+ * @param destination - the destination
42
+ * @param backendSystem - the backend system
43
+ * @returns the ABAP target
44
+ */
45
+ function createAbapTarget(destination, backendSystem) {
46
+ if ((0, btp_utils_1.isAppStudio)()) {
47
+ return { destination: destination?.Name };
48
+ }
49
+ else {
50
+ return { url: backendSystem?.url, client: backendSystem?.client };
51
+ }
52
+ }
53
+ exports.createAbapTarget = createAbapTarget;
54
+ /**
55
+ * Get the service name choices.
56
+ *
57
+ * @param serviceName - the service name
58
+ * @returns the service name choices
59
+ */
60
+ function getServiceNameChoices(serviceName) {
61
+ return [
62
+ {
63
+ name: serviceName,
64
+ value: serviceName
65
+ }
66
+ ];
67
+ }
68
+ exports.getServiceNameChoices = getServiceNameChoices;
69
+ /**
70
+ * Get the validation error link.
71
+ *
72
+ * @returns the validation error link
73
+ */
74
+ async function getValidationErrorLink() {
75
+ (0, inquirer_common_1.setTelemetryClient)(telemetry_1.ClientFactory.getTelemetryClient());
76
+ return inquirer_common_1.ErrorHandler.getHelpLink(guided_answers_helper_1.HELP_NODES.UI_SERVICE_GENERATOR, inquirer_common_1.ERROR_TYPE.INTERNAL_SERVER_ERROR, (0, i18n_1.t)('error.validatingContent'));
77
+ }
78
+ exports.getValidationErrorLink = getValidationErrorLink;
79
+ //# sourceMappingURL=prompt-helper.js.map
@@ -0,0 +1,39 @@
1
+ import type { ServiceConfig, SystemSelectionAnswers } from '../types';
2
+ /**
3
+ * Much of the values returned by the ui service inquirer prompting are derived from prompt answers and are not direct answer values.
4
+ * Since inquirer does not provide a way to return values that are not direct answers from prompts, this class will maintain the derived values
5
+ * across prompts statically for the lifespan of the prompting session.
6
+ *
7
+ */
8
+ export declare class PromptState {
9
+ private static _systemSelection;
10
+ private static _serviceConfig;
11
+ /**
12
+ * Returns the current state of the service config.
13
+ *
14
+ * @returns {ServiceConfig} service config
15
+ */
16
+ static get systemSelection(): SystemSelectionAnswers;
17
+ /**
18
+ * Set the state of the system selection.
19
+ *
20
+ * @param {SystemSelectionAnswers} value - system selection value
21
+ */
22
+ static set systemSelection(value: Partial<SystemSelectionAnswers>);
23
+ /**
24
+ * Returns the current state of the service config.
25
+ *
26
+ * @returns {ServiceConfig} service config
27
+ */
28
+ static get serviceConfig(): ServiceConfig;
29
+ /**
30
+ * Set the state of the service config.
31
+ *
32
+ * @param {ServiceConfig} value - service config value
33
+ */
34
+ static set serviceConfig(value: ServiceConfig);
35
+ static reset(): void;
36
+ static resetConnectedSystem(): void;
37
+ static resetServiceConfig(): void;
38
+ }
39
+ //# sourceMappingURL=prompt-state.d.ts.map
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PromptState = void 0;
4
+ /**
5
+ * Much of the values returned by the ui service inquirer prompting are derived from prompt answers and are not direct answer values.
6
+ * Since inquirer does not provide a way to return values that are not direct answers from prompts, this class will maintain the derived values
7
+ * across prompts statically for the lifespan of the prompting session.
8
+ *
9
+ */
10
+ class PromptState {
11
+ static _systemSelection = {};
12
+ static _serviceConfig;
13
+ /**
14
+ * Returns the current state of the service config.
15
+ *
16
+ * @returns {ServiceConfig} service config
17
+ */
18
+ static get systemSelection() {
19
+ return this._systemSelection;
20
+ }
21
+ /**
22
+ * Set the state of the system selection.
23
+ *
24
+ * @param {SystemSelectionAnswers} value - system selection value
25
+ */
26
+ static set systemSelection(value) {
27
+ this._systemSelection = value;
28
+ }
29
+ /**
30
+ * Returns the current state of the service config.
31
+ *
32
+ * @returns {ServiceConfig} service config
33
+ */
34
+ static get serviceConfig() {
35
+ return this._serviceConfig;
36
+ }
37
+ /**
38
+ * Set the state of the service config.
39
+ *
40
+ * @param {ServiceConfig} value - service config value
41
+ */
42
+ static set serviceConfig(value) {
43
+ this._serviceConfig = value;
44
+ }
45
+ static reset() {
46
+ PromptState.systemSelection = {};
47
+ PromptState.serviceConfig = {
48
+ content: '',
49
+ serviceName: ''
50
+ };
51
+ }
52
+ static resetConnectedSystem() {
53
+ PromptState.systemSelection = {};
54
+ }
55
+ static resetServiceConfig() {
56
+ PromptState.serviceConfig = {
57
+ content: '',
58
+ serviceName: ''
59
+ };
60
+ }
61
+ }
62
+ exports.PromptState = PromptState;
63
+ //# sourceMappingURL=prompt-state.js.map
@@ -0,0 +1,27 @@
1
+ import type { Logger } from '@sap-ux/logger';
2
+ import type { Question } from 'inquirer';
3
+ import type { ServiceConfig, ServiceConfigQuestion, SystemSelectionAnswers, UiServiceAnswers } from '../types';
4
+ /**
5
+ * Get the system selection prompts.
6
+ *
7
+ * @param answers - the answers to prepopulate the prompts
8
+ * @param systemName - the name of the system
9
+ * @param logger - optional logger instance to use for logging
10
+ * @returns the system selection prompts
11
+ */
12
+ export declare function getSystemSelectionPrompts(answers?: UiServiceAnswers, systemName?: string, logger?: Logger): Promise<{
13
+ prompts: Question<UiServiceAnswers>[];
14
+ answers: Partial<SystemSelectionAnswers>;
15
+ }>;
16
+ /**
17
+ * Get the configuration prompts.
18
+ *
19
+ * @param systemSelectionAnswers - the system selection answers to use if system selection prompting was skipped
20
+ * @param logger - optional logger instance to use for logging
21
+ * @returns the configuration prompts
22
+ */
23
+ export declare function getConfigPrompts(systemSelectionAnswers: SystemSelectionAnswers, logger?: Logger): {
24
+ prompts: ServiceConfigQuestion[];
25
+ answers: Partial<ServiceConfig>;
26
+ };
27
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getConfigPrompts = exports.getSystemSelectionPrompts = void 0;
7
+ const logger_helper_1 = __importDefault(require("../logger-helper"));
8
+ const questions_1 = require("./configuration/questions");
9
+ const prompt_state_1 = require("./prompt-state");
10
+ const questions_2 = require("./system-selection/questions");
11
+ /**
12
+ * Get the system selection prompts.
13
+ *
14
+ * @param answers - the answers to prepopulate the prompts
15
+ * @param systemName - the name of the system
16
+ * @param logger - optional logger instance to use for logging
17
+ * @returns the system selection prompts
18
+ */
19
+ async function getSystemSelectionPrompts(answers, systemName, logger) {
20
+ if (logger) {
21
+ logger_helper_1.default.logger = logger;
22
+ }
23
+ return {
24
+ prompts: await (0, questions_2.getSystemQuestions)(logger_helper_1.default.logger, answers, systemName),
25
+ answers: prompt_state_1.PromptState.systemSelection
26
+ };
27
+ }
28
+ exports.getSystemSelectionPrompts = getSystemSelectionPrompts;
29
+ /**
30
+ * Get the configuration prompts.
31
+ *
32
+ * @param systemSelectionAnswers - the system selection answers to use if system selection prompting was skipped
33
+ * @param logger - optional logger instance to use for logging
34
+ * @returns the configuration prompts
35
+ */
36
+ function getConfigPrompts(systemSelectionAnswers, logger) {
37
+ if (logger) {
38
+ logger_helper_1.default.logger = logger;
39
+ }
40
+ if (!prompt_state_1.PromptState.systemSelection.connectedSystem) {
41
+ Object.assign(prompt_state_1.PromptState.systemSelection, systemSelectionAnswers);
42
+ }
43
+ return {
44
+ prompts: (0, questions_1.getConfigQuestions)(logger_helper_1.default.logger),
45
+ answers: prompt_state_1.PromptState.serviceConfig
46
+ };
47
+ }
48
+ exports.getConfigPrompts = getConfigPrompts;
49
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1,2 @@
1
+ export * from './questions';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
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("./questions"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,13 @@
1
+ import type { Logger } from '@sap-ux/logger';
2
+ import type { Question } from 'yeoman-generator';
3
+ import { type UiServiceAnswers } from '../../types';
4
+ /**
5
+ * Get the system questions.
6
+ *
7
+ * @param logger - logger instance to use for logging
8
+ * @param previousAnswers - answers used to prepopulate the prompts
9
+ * @param systemName - the name of the system
10
+ * @returns the system questions
11
+ */
12
+ export declare function getSystemQuestions(logger: Logger, previousAnswers?: UiServiceAnswers, systemName?: string): Promise<Question<UiServiceAnswers>[]>;
13
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSystemQuestions = void 0;
4
+ const odata_service_inquirer_1 = require("@sap-ux/odata-service-inquirer");
5
+ const i18n_1 = require("../../i18n");
6
+ const types_1 = require("../../types");
7
+ const prompt_helper_1 = require("../prompt-helper");
8
+ const prompt_state_1 = require("../prompt-state");
9
+ /**
10
+ * Get the system questions.
11
+ *
12
+ * @param logger - logger instance to use for logging
13
+ * @param previousAnswers - answers used to prepopulate the prompts
14
+ * @param systemName - the name of the system
15
+ * @returns the system questions
16
+ */
17
+ async function getSystemQuestions(logger, previousAnswers, systemName) {
18
+ prompt_state_1.PromptState.reset();
19
+ const systemQuestions = await (0, odata_service_inquirer_1.getSystemSelectionQuestions)({
20
+ serviceSelection: { hide: true },
21
+ systemSelection: { defaultChoice: systemName }
22
+ }, true);
23
+ const objectQuestions = [
24
+ {
25
+ when: (answers) => {
26
+ if (answers[odata_service_inquirer_1.promptNames.systemSelection] && systemQuestions.answers.connectedSystem?.serviceProvider) {
27
+ prompt_state_1.PromptState.systemSelection.connectedSystem = systemQuestions.answers.connectedSystem;
28
+ return true;
29
+ }
30
+ return false;
31
+ },
32
+ type: 'list',
33
+ name: 'objectType',
34
+ guiOptions: {
35
+ breadcrumb: true
36
+ },
37
+ default: previousAnswers?.objectType ?? '',
38
+ message: (0, i18n_1.t)('prompts.objectTypeLabel'),
39
+ choices: () => [
40
+ { name: (0, i18n_1.t)('prompts.businessObjectInterfaceLabel'), value: types_1.ObjectType.BUSINESS_OBJECT },
41
+ { name: (0, i18n_1.t)('prompts.abapCdsServiceLabel'), value: types_1.ObjectType.CDS_VIEW }
42
+ ]
43
+ },
44
+ {
45
+ when: (previousAnswers) => previousAnswers.objectType === types_1.ObjectType.BUSINESS_OBJECT,
46
+ type: 'list',
47
+ name: 'businessObjectInterface',
48
+ guiOptions: {
49
+ breadcrumb: true,
50
+ applyDefaultWhenDirty: true
51
+ },
52
+ default: previousAnswers?.businessObjectInterface ?? '',
53
+ message: (0, i18n_1.t)('prompts.businessObjectInterfaceLabel'),
54
+ choices: async () => {
55
+ try {
56
+ return await (0, prompt_helper_1.getBusinessObjects)(prompt_state_1.PromptState.systemSelection.connectedSystem?.serviceProvider);
57
+ }
58
+ catch (error) {
59
+ logger.error((0, i18n_1.t)('error.fetchingBusinessObjects' + error.message));
60
+ return [];
61
+ }
62
+ },
63
+ validate: async (val) => {
64
+ if (val) {
65
+ try {
66
+ prompt_state_1.PromptState.systemSelection.objectGenerator = await (prompt_state_1.PromptState.systemSelection.connectedSystem?.serviceProvider).getUiServiceGenerator(val);
67
+ }
68
+ catch (error) {
69
+ logger.error((0, i18n_1.t)('error.fetchingGenerator', { error: error.message }));
70
+ }
71
+ return prompt_state_1.PromptState.systemSelection.objectGenerator ? true : (0, i18n_1.t)('error.noGeneratorFoundBo');
72
+ }
73
+ return false;
74
+ }
75
+ },
76
+ {
77
+ when: (previousAnswers) => previousAnswers.objectType === types_1.ObjectType.CDS_VIEW,
78
+ type: 'list',
79
+ name: 'abapCDSView',
80
+ guiOptions: {
81
+ breadcrumb: true,
82
+ applyDefaultWhenDirty: true
83
+ },
84
+ default: previousAnswers?.abapCDSView ?? '',
85
+ message: (0, i18n_1.t)('prompts.abapCdsServiceLabel'),
86
+ choices: async () => {
87
+ try {
88
+ return await (0, prompt_helper_1.getAbapCDSViews)(prompt_state_1.PromptState.systemSelection.connectedSystem?.serviceProvider);
89
+ }
90
+ catch (error) {
91
+ logger.error((0, i18n_1.t)('error.fetchingCdsViews', { error: error.message }));
92
+ return [];
93
+ }
94
+ },
95
+ validate: async (val) => {
96
+ if (val) {
97
+ try {
98
+ prompt_state_1.PromptState.systemSelection.objectGenerator = await (prompt_state_1.PromptState.systemSelection.connectedSystem?.serviceProvider).getUiServiceGenerator(val);
99
+ }
100
+ catch (error) {
101
+ logger.error((0, i18n_1.t)('error.fetchingGenerator', { error: error.message }));
102
+ }
103
+ return prompt_state_1.PromptState.systemSelection.objectGenerator ? true : (0, i18n_1.t)('error.noGeneratorFoundCdsService');
104
+ }
105
+ return false;
106
+ }
107
+ }
108
+ ];
109
+ return [
110
+ ...systemQuestions.prompts,
111
+ ...objectQuestions
112
+ ];
113
+ }
114
+ exports.getSystemQuestions = getSystemQuestions;
115
+ //# sourceMappingURL=questions.js.map
@@ -0,0 +1,24 @@
1
+ {
2
+ "prompts": {
3
+ "draftEnabled": "Draft Enabled",
4
+ "launchAppGen": "Do you want to create an SAP Fiori application with the newly generated service?",
5
+ "launchAppGenBreadcrumb": "Create SAP Fiori Application?",
6
+ "serviceNameBreadcrumb": "Service Name",
7
+ "serviceName": "Service Name (not editable)",
8
+ "objectTypeLabel": "Object Type",
9
+ "businessObjectInterfaceLabel": "Business Object Interface",
10
+ "abapCdsServiceLabel": "ABAP Core Data Service"
11
+ },
12
+ "error": {
13
+ "validatingContent": "There was a back-end validation error for the service content and package provided. Service generation cannot continue. Please try again or contact an admin for the back-end system.",
14
+ "fetchingContentForServiceBinding": "Error fetching content for service binding of the business object. Please try again or contact an admin for the back-end system.",
15
+ "fetchingBusinessObjects": "Error fetching business object interfaces from the back-end system. Please try again or contact an admin for the back-end system.",
16
+ "fetchingGenerator": "Error fetching generator: {{error}}",
17
+ "fetchingCdsViews": "Error fetching CDS views from back-end system: {{error}}",
18
+ "noGeneratorFoundBo": "No generator was found for the selected business object interface",
19
+ "noGeneratorFoundCdsService": "No generator was found for the selected ABAP CDS service"
20
+ },
21
+ "info": {
22
+ "appGenLaunch": "The SAP Fiori generator will launch after the UI service has been created"
23
+ }
24
+ }
@@ -0,0 +1,51 @@
1
+ import type { AbapDeployConfigAnswersInternal } from '@sap-ux/abap-deploy-config-inquirer';
2
+ import type { ServiceProvider, UiServiceGenerator } from '@sap-ux/axios-extension';
3
+ import type { Destination } from '@sap-ux/btp-utils';
4
+ import type { YUIQuestion } from '@sap-ux/inquirer-common';
5
+ import type { promptNames, SystemSelectionAnswerType } from '@sap-ux/odata-service-inquirer';
6
+ import type { BackendSystem } from '@sap-ux/store';
7
+ import type { Question } from 'inquirer';
8
+ export interface UiServiceAnswers extends AbapDeployConfigAnswersInternal {
9
+ [promptNames.systemSelection]?: SystemSelectionAnswerType;
10
+ businessObjectInterface?: string;
11
+ abapCDSView?: string;
12
+ objectType?: ObjectType;
13
+ serviceName?: string;
14
+ draftEnabled?: boolean;
15
+ launchAppGen?: boolean;
16
+ }
17
+ export interface ServiceConfig {
18
+ content: string;
19
+ serviceName: string;
20
+ }
21
+ export type SystemSelectionQuestion = Question<UiServiceAnswers>;
22
+ export type ServiceConfigQuestion = YUIQuestion<UiServiceAnswers>;
23
+ export interface SystemSelectionAnswers {
24
+ /**
25
+ * The connected system will allow downstream consumers to access the connected system without creating new connections.
26
+ *
27
+ */
28
+ connectedSystem?: {
29
+ /**
30
+ * Convienence property to pass the connected system
31
+ */
32
+ serviceProvider: ServiceProvider;
33
+ /**
34
+ * The persistable backend system representation of the connected service provider
35
+ * `newOrUpdated` is set to true if the system was newly created or updated during the connection validation process and should be considered for storage.
36
+ */
37
+ backendSystem?: BackendSystem & {
38
+ newOrUpdated?: boolean;
39
+ };
40
+ /**
41
+ * The destination information for the connected system
42
+ */
43
+ destination?: Destination;
44
+ };
45
+ objectGenerator?: UiServiceGenerator;
46
+ }
47
+ export declare enum ObjectType {
48
+ BUSINESS_OBJECT = "BusinessObject",
49
+ CDS_VIEW = "CDSView"
50
+ }
51
+ //# sourceMappingURL=types.d.ts.map
package/dist/types.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectType = void 0;
4
+ var ObjectType;
5
+ (function (ObjectType) {
6
+ ObjectType["BUSINESS_OBJECT"] = "BusinessObject";
7
+ ObjectType["CDS_VIEW"] = "CDSView";
8
+ })(ObjectType || (exports.ObjectType = ObjectType = {}));
9
+ //# sourceMappingURL=types.js.map
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@sap-ux/ui-service-inquirer",
3
+ "description": "Generator for creating UI Service",
4
+ "version": "0.0.1",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/SAP/open-ux-tools.git",
8
+ "directory": "packages/ui-service-inquirer"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue"
12
+ },
13
+ "license": "Apache-2.0",
14
+ "main": "dist/index.js",
15
+ "files": [
16
+ "LICENSE",
17
+ "dist",
18
+ "templates",
19
+ "!dist/*.map",
20
+ "!dist/**/*.map"
21
+ ],
22
+ "dependencies": {
23
+ "@sap-devx/yeoman-ui-types": "1.16.9",
24
+ "i18next": "23.5.1",
25
+ "yeoman-generator": "5.10.0",
26
+ "@sap-ux/abap-deploy-config-inquirer": "1.2.31",
27
+ "@sap-ux/axios-extension": "1.19.1",
28
+ "@sap-ux/btp-utils": "1.0.2",
29
+ "@sap-ux/guided-answers-helper": "0.2.1",
30
+ "@sap-ux/inquirer-common": "0.6.29",
31
+ "@sap-ux/logger": "0.6.0",
32
+ "@sap-ux/odata-service-inquirer": "2.2.21",
33
+ "@sap-ux/telemetry": "0.5.70"
34
+ },
35
+ "devDependencies": {
36
+ "@types/inquirer-autocomplete-prompt": "2.0.1",
37
+ "@types/inquirer": "8.2.6",
38
+ "@types/yeoman-environment": "2.10.11",
39
+ "@types/yeoman-generator": "5.2.11",
40
+ "@types/yeoman-test": "4.0.6",
41
+ "jest-extended": "4.0.2",
42
+ "inquirer": "8.2.6",
43
+ "nock": "13.5.6",
44
+ "rimraf": "5.0.5",
45
+ "typescript": "5.3.3",
46
+ "yeoman-test": "6.3.0",
47
+ "@sap-ux/jest-file-matchers": "0.2.1",
48
+ "@sap-ux/store": "1.0.0",
49
+ "@sap-ux/system-access": "0.5.33"
50
+ },
51
+ "engines": {
52
+ "node": ">=18.x"
53
+ },
54
+ "scripts": {
55
+ "build": "tsc --build",
56
+ "clean": "rimraf --glob dist test/test-output coverage *.tsbuildinfo",
57
+ "watch": "tsc --watch",
58
+ "lint": "eslint . --ext .ts",
59
+ "lint:fix": "eslint . --ext .ts --fix",
60
+ "test": "jest --ci --forceExit --detectOpenHandles --colors --passWithNoTests",
61
+ "test-u": "jest --ci --forceExit --detectOpenHandles --colors -u",
62
+ "link": "pnpm link --global",
63
+ "unlink": "pnpm unlink --global"
64
+ }
65
+ }