@sap-ux/abap-deploy-config-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 +201 -0
- package/README.md +93 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/error-handler.d.ts +13 -0
- package/dist/error-handler.d.ts.map +1 -0
- package/dist/error-handler.js +33 -0
- package/dist/error-handler.js.map +1 -0
- package/dist/i18n.d.ts +14 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +34 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/logger-helper.d.ts +20 -0
- package/dist/logger-helper.d.ts.map +1 -0
- package/dist/logger-helper.js +27 -0
- package/dist/logger-helper.js.map +1 -0
- package/dist/prompts/conditions.d.ts +117 -0
- package/dist/prompts/conditions.d.ts.map +1 -0
- package/dist/prompts/conditions.js +299 -0
- package/dist/prompts/conditions.js.map +1 -0
- package/dist/prompts/defaults.d.ts +45 -0
- package/dist/prompts/defaults.d.ts.map +1 -0
- package/dist/prompts/defaults.js +91 -0
- package/dist/prompts/defaults.js.map +1 -0
- package/dist/prompts/helpers.d.ts +54 -0
- package/dist/prompts/helpers.d.ts.map +1 -0
- package/dist/prompts/helpers.js +234 -0
- package/dist/prompts/helpers.js.map +1 -0
- package/dist/prompts/index.d.ts +9 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +30 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/prompt-state.d.ts +38 -0
- package/dist/prompts/prompt-state.d.ts.map +1 -0
- package/dist/prompts/prompt-state.js +59 -0
- package/dist/prompts/prompt-state.js.map +1 -0
- package/dist/prompts/questions/abap-target.d.ts +10 -0
- package/dist/prompts/questions/abap-target.d.ts.map +1 -0
- package/dist/prompts/questions/abap-target.js +219 -0
- package/dist/prompts/questions/abap-target.js.map +1 -0
- package/dist/prompts/questions/auth.d.ts +10 -0
- package/dist/prompts/questions/auth.d.ts.map +1 -0
- package/dist/prompts/questions/auth.js +55 -0
- package/dist/prompts/questions/auth.js.map +1 -0
- package/dist/prompts/questions/config/app.d.ts +10 -0
- package/dist/prompts/questions/config/app.d.ts.map +1 -0
- package/dist/prompts/questions/config/app.js +68 -0
- package/dist/prompts/questions/config/app.js.map +1 -0
- package/dist/prompts/questions/config/index.d.ts +4 -0
- package/dist/prompts/questions/config/index.d.ts.map +1 -0
- package/dist/prompts/questions/config/index.js +20 -0
- package/dist/prompts/questions/config/index.js.map +1 -0
- package/dist/prompts/questions/config/package.d.ts +10 -0
- package/dist/prompts/questions/config/package.d.ts.map +1 -0
- package/dist/prompts/questions/config/package.js +91 -0
- package/dist/prompts/questions/config/package.js.map +1 -0
- package/dist/prompts/questions/config/transport.d.ts +10 -0
- package/dist/prompts/questions/config/transport.d.ts.map +1 -0
- package/dist/prompts/questions/config/transport.js +91 -0
- package/dist/prompts/questions/config/transport.js.map +1 -0
- package/dist/prompts/questions/confirm.d.ts +10 -0
- package/dist/prompts/questions/confirm.d.ts.map +1 -0
- package/dist/prompts/questions/confirm.js +55 -0
- package/dist/prompts/questions/confirm.js.map +1 -0
- package/dist/prompts/questions/index.d.ts +5 -0
- package/dist/prompts/questions/index.d.ts.map +1 -0
- package/dist/prompts/questions/index.js +21 -0
- package/dist/prompts/questions/index.js.map +1 -0
- package/dist/prompts/validators.d.ts +138 -0
- package/dist/prompts/validators.d.ts.map +1 -0
- package/dist/prompts/validators.js +459 -0
- package/dist/prompts/validators.js.map +1 -0
- package/dist/service-provider-utils/abap-service-provider.d.ts +19 -0
- package/dist/service-provider-utils/abap-service-provider.d.ts.map +1 -0
- package/dist/service-provider-utils/abap-service-provider.js +89 -0
- package/dist/service-provider-utils/abap-service-provider.js.map +1 -0
- package/dist/service-provider-utils/create-transport.d.ts +12 -0
- package/dist/service-provider-utils/create-transport.d.ts.map +1 -0
- package/dist/service-provider-utils/create-transport.js +35 -0
- package/dist/service-provider-utils/create-transport.js.map +1 -0
- package/dist/service-provider-utils/index.d.ts +6 -0
- package/dist/service-provider-utils/index.d.ts.map +1 -0
- package/dist/service-provider-utils/index.js +22 -0
- package/dist/service-provider-utils/index.js.map +1 -0
- package/dist/service-provider-utils/list-packages.d.ts +11 -0
- package/dist/service-provider-utils/list-packages.d.ts.map +1 -0
- package/dist/service-provider-utils/list-packages.js +37 -0
- package/dist/service-provider-utils/list-packages.js.map +1 -0
- package/dist/service-provider-utils/transport-config.d.ts +18 -0
- package/dist/service-provider-utils/transport-config.d.ts.map +1 -0
- package/dist/service-provider-utils/transport-config.js +211 -0
- package/dist/service-provider-utils/transport-config.js.map +1 -0
- package/dist/service-provider-utils/transport-list.d.ts +16 -0
- package/dist/service-provider-utils/transport-list.d.ts.map +1 -0
- package/dist/service-provider-utils/transport-list.js +56 -0
- package/dist/service-provider-utils/transport-list.js.map +1 -0
- package/dist/translations/abap-deploy-config-inquirer.i18n.json +146 -0
- package/dist/types.d.ts +165 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +46 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +90 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +233 -0
- package/dist/utils.js.map +1 -0
- package/dist/validator-utils.d.ts +75 -0
- package/dist/validator-utils.d.ts.map +1 -0
- package/dist/validator-utils.js +172 -0
- package/dist/validator-utils.js.map +1 -0
- package/package.json +48 -0
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/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @sap-ux/abap-deploy-config-inquirer
|
|
2
|
+
|
|
3
|
+
Provides Inquirer based end-user prompting to retrieve the ABAP deployment configuration for an application. This involves acquiring a connection to the chosen backend system and retrieving the associated packages and transport requests for the system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
Npm
|
|
7
|
+
`npm install --save @sap-ux/abap-deploy-config-inquirer`
|
|
8
|
+
|
|
9
|
+
Yarn
|
|
10
|
+
`yarn add @sap-ux/abap-deploy-config-inquirer`
|
|
11
|
+
|
|
12
|
+
Pnpm
|
|
13
|
+
`pnpm add @sap-ux/abap-deploy-config-inquirer`
|
|
14
|
+
|
|
15
|
+
## Explainer
|
|
16
|
+
|
|
17
|
+
Prompts may be retrieved using `getPrompts` and then executed in another prompting module that supports `inquirer` type prompts.
|
|
18
|
+
|
|
19
|
+
`getPrompts` is provided to allow consumers to access prompts. There may be cases where these can be transformed to support other prompting frameworks. Most prompt configuration is possible via `AbapDeployConfigPromptOptions` and calling `prompt`. This is the recommended approach.
|
|
20
|
+
|
|
21
|
+
Configurability of prompts is entirely controlled using the `AbapDeployConfigPromptOptions` parameter.
|
|
22
|
+
|
|
23
|
+
See [Inquirer.js](https://www.npmjs.com/package/inquirer) for valid default properties.
|
|
24
|
+
|
|
25
|
+
### ABAP Deploy Config Inquirer usage example:
|
|
26
|
+
|
|
27
|
+
```TypeScript
|
|
28
|
+
import type { InquirerAdapter } from '@sap-ux/inquirer-common';
|
|
29
|
+
import type { AbapDeployConfigAnswers, AbapDeployConfigPromptOptions } from '@sap-ux/abap-deploy-config-inquirer';
|
|
30
|
+
import { prompt as abapDeployConfigPrompt } from '@sap-ux/abap-deploy-config-inquirer';
|
|
31
|
+
import { generate as generateAbapDeployConfig } from '@sap-ux/odata-service-writer'
|
|
32
|
+
|
|
33
|
+
const promptOptions = {
|
|
34
|
+
backendTarget: {
|
|
35
|
+
abapTarget: {
|
|
36
|
+
url: 'https://example.com',
|
|
37
|
+
client: '100',
|
|
38
|
+
scp: false
|
|
39
|
+
},
|
|
40
|
+
serviceProvider: serviceProvider, // connected abap service provider
|
|
41
|
+
type: 'application'
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Pass an Inquirer prompt function https://www.npmjs.com/package/inquirer#methods
|
|
47
|
+
*/
|
|
48
|
+
const inqAdaptor = {
|
|
49
|
+
prompt: this.prompt.bind(this) // the inquirer prompting function, here we use the generators reference
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const abapDeployConfigAnswers: AbapDeployConfigAnswers = await abapDeployConfigPrompt(
|
|
53
|
+
inqAdaptor as InquirerAdapter,
|
|
54
|
+
promptOpts
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const projectDir = join(__dirname, 'testapp');
|
|
58
|
+
await generateAbapDeployConfig(
|
|
59
|
+
projectDir,
|
|
60
|
+
{
|
|
61
|
+
target: {
|
|
62
|
+
url: abapDeployConfigAnswers.url,
|
|
63
|
+
client: abapDeployConfigAnswers.client,
|
|
64
|
+
scp: abapDeployConfigAnswers.scp,
|
|
65
|
+
destination: abapDeployConfigAnswers.destination
|
|
66
|
+
},
|
|
67
|
+
app: {
|
|
68
|
+
name: abapDeployConfigAnswers.name,
|
|
69
|
+
description: abapDeployConfigAnswers.description,
|
|
70
|
+
package: abapDeployConfigAnswers.package,
|
|
71
|
+
transport: abapDeployConfigAnswers.transport
|
|
72
|
+
},
|
|
73
|
+
index: abapDeployConfigAnswers.index
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
baseFile: '/path/to/base/config', // e.g ui5.yaml
|
|
77
|
+
deployFile: '/path/to/deploy/config', // e.g ui5-deploy.yaml
|
|
78
|
+
},
|
|
79
|
+
this.fs
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
Read [License](./LICENSE).
|
|
87
|
+
|
|
88
|
+
## Keywords
|
|
89
|
+
SAP UI5 Application
|
|
90
|
+
Inquirer
|
|
91
|
+
Prompting
|
|
92
|
+
Generator
|
|
93
|
+
Deployment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAClD,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAC3C,eAAO,MAAM,uBAAuB,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CREATE_TR_DURING_DEPLOY = exports.DEFAULT_PACKAGE_ABAP = exports.ABAP_PACKAGE_SEARCH_MAX_RESULTS = void 0;
|
|
4
|
+
exports.ABAP_PACKAGE_SEARCH_MAX_RESULTS = 50;
|
|
5
|
+
exports.DEFAULT_PACKAGE_ABAP = '$tmp';
|
|
6
|
+
exports.CREATE_TR_DURING_DEPLOY = 'REPLACE_WITH_TRANSPORT';
|
|
7
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,+BAA+B,GAAG,EAAE,CAAC;AACrC,QAAA,oBAAoB,GAAG,MAAM,CAAC;AAC9B,QAAA,uBAAuB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throws error message to end prompting in cli.
|
|
3
|
+
*
|
|
4
|
+
* @param errorMessage - error message
|
|
5
|
+
*/
|
|
6
|
+
export declare function bail(errorMessage: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Handles error message.
|
|
9
|
+
*
|
|
10
|
+
* @param errorMsg - error message
|
|
11
|
+
*/
|
|
12
|
+
export declare function handleTransportConfigError(errorMsg: string): void;
|
|
13
|
+
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../src/error-handler.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAOjE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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.handleTransportConfigError = exports.bail = void 0;
|
|
7
|
+
const prompt_state_1 = require("./prompts/prompt-state");
|
|
8
|
+
const logger_helper_1 = __importDefault(require("./logger-helper"));
|
|
9
|
+
/**
|
|
10
|
+
* Throws error message to end prompting in cli.
|
|
11
|
+
*
|
|
12
|
+
* @param errorMessage - error message
|
|
13
|
+
*/
|
|
14
|
+
function bail(errorMessage) {
|
|
15
|
+
throw new Error(errorMessage);
|
|
16
|
+
}
|
|
17
|
+
exports.bail = bail;
|
|
18
|
+
/**
|
|
19
|
+
* Handles error message.
|
|
20
|
+
*
|
|
21
|
+
* @param errorMsg - error message
|
|
22
|
+
*/
|
|
23
|
+
function handleTransportConfigError(errorMsg) {
|
|
24
|
+
if (!prompt_state_1.PromptState.isYUI) {
|
|
25
|
+
bail(errorMsg);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
prompt_state_1.PromptState.transportAnswers.transportConfigError = errorMsg;
|
|
29
|
+
logger_helper_1.default.logger.debug(errorMsg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.handleTransportConfigError = handleTransportConfigError;
|
|
33
|
+
//# sourceMappingURL=error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../src/error-handler.ts"],"names":[],"mappings":";;;;;;AAAA,yDAAqD;AACrD,oEAA2C;AAE3C;;;;GAIG;AACH,SAAgB,IAAI,CAAC,YAAoB;IACrC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC;AAFD,oBAEC;AAED;;;;GAIG;AACH,SAAgB,0BAA0B,CAAC,QAAgB;IACvD,IAAI,CAAC,0BAAW,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC;SAAM,CAAC;QACJ,0BAAW,CAAC,gBAAgB,CAAC,oBAAoB,GAAG,QAAQ,CAAC;QAC7D,uBAAY,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;AACL,CAAC;AAPD,gEAOC"}
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC;;GAEG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAI9C;AAED;;;;;;GAMG;AACH,wBAAgB,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAKzD"}
|
package/dist/i18n.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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 abap_deploy_config_inquirer_i18n_json_1 = __importDefault(require("./translations/abap-deploy-config-inquirer.i18n.json"));
|
|
9
|
+
const abapDeployConfigInquirerNs = 'abap-deploy-config-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' }, () => i18next_1.default.addResourceBundle('en', abapDeployConfigInquirerNs, abap_deploy_config_inquirer_i18n_json_1.default));
|
|
15
|
+
}
|
|
16
|
+
exports.initI18n = initI18n;
|
|
17
|
+
/**
|
|
18
|
+
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
19
|
+
*
|
|
20
|
+
* @param key i18n key
|
|
21
|
+
* @param options additional options
|
|
22
|
+
* @returns {string} localized string stored for the given key
|
|
23
|
+
*/
|
|
24
|
+
function t(key, options) {
|
|
25
|
+
if (!options?.ns) {
|
|
26
|
+
options = Object.assign(options ?? {}, { ns: abapDeployConfigInquirerNs });
|
|
27
|
+
}
|
|
28
|
+
return i18next_1.default.t(key, options);
|
|
29
|
+
}
|
|
30
|
+
exports.t = t;
|
|
31
|
+
initI18n().catch(() => {
|
|
32
|
+
// Needed for lint
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=i18n.js.map
|
package/dist/i18n.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":";;;;;;AACA,sDAA8B;AAC9B,iIAAgF;AAEhF,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AACjE;;GAEG;AACI,KAAK,UAAU,QAAQ;IAC1B,MAAM,iBAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CACtD,iBAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,0BAA0B,EAAE,+CAAY,CAAC,CAC5E,CAAC;AACN,CAAC;AAJD,4BAIC;AAED;;;;;;GAMG;AACH,SAAgB,CAAC,CAAC,GAAW,EAAE,OAAkB;IAC7C,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC;QACf,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,iBAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AALD,cAKC;AAED,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;IAClB,kBAAkB;AACtB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Logger } from '@sap-ux/logger';
|
|
2
|
+
import type { InquirerAdapter } from '@sap-ux/inquirer-common';
|
|
3
|
+
import { PackageInputChoices, TargetSystemType, TransportChoices, type AbapDeployConfigAnswers, type AbapDeployConfigPromptOptions, type AbapDeployConfigQuestion } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Get the inquirer prompts for abap deploy config.
|
|
6
|
+
*
|
|
7
|
+
* @param promptOptions - options that can control some of the prompt behavior. See {@link AbapDeployConfigPromptOptions} for details
|
|
8
|
+
* @param logger - a logger compatible with the {@link Logger} interface
|
|
9
|
+
* @param isYUI - if true, the prompt is being called from the Yeoman UI extension host
|
|
10
|
+
* @returns the prompts used to provide input for abap deploy config generation and a reference to the answers object which will be populated with the user's responses once `inquirer.prompt` returns
|
|
11
|
+
*/
|
|
12
|
+
declare function getPrompts(promptOptions?: AbapDeployConfigPromptOptions, logger?: Logger, isYUI?: boolean): Promise<{
|
|
13
|
+
prompts: AbapDeployConfigQuestion[];
|
|
14
|
+
answers: Partial<AbapDeployConfigAnswers>;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Prompt for abap deploy config writer inputs.
|
|
18
|
+
*
|
|
19
|
+
* @param adapter - optionally provide references to a calling inquirer instance, this supports integration to Yeoman generators, for example
|
|
20
|
+
* @param promptOptions - options that can control some of the prompt behavior. See {@link AbapDeployConfigPromptOptions} for details
|
|
21
|
+
* @param logger - a logger compatible with the {@link Logger} interface
|
|
22
|
+
* @param isYUI - if true, the prompt is being called from the Yeoman UI extension host
|
|
23
|
+
* @returns the prompt answers
|
|
24
|
+
*/
|
|
25
|
+
declare function prompt(adapter: InquirerAdapter, promptOptions?: AbapDeployConfigPromptOptions, logger?: Logger, isYUI?: boolean): Promise<AbapDeployConfigAnswers>;
|
|
26
|
+
export { getPrompts, prompt, TargetSystemType, PackageInputChoices, TransportChoices, type InquirerAdapter, type AbapDeployConfigAnswers, type AbapDeployConfigPromptOptions };
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAK1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EACH,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,uBAAuB,EAE5B,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAChC,MAAM,SAAS,CAAC;AAGjB;;;;;;;GAOG;AACH,iBAAe,UAAU,CACrB,aAAa,CAAC,EAAE,6BAA6B,EAC7C,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,UAAQ,GACd,OAAO,CAAC;IACP,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7C,CAAC,CAUD;AAED;;;;;;;;GAQG;AACH,iBAAe,MAAM,CACjB,OAAO,EAAE,eAAe,EACxB,aAAa,CAAC,EAAE,6BAA6B,EAC7C,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,UAAQ,GACd,OAAO,CAAC,uBAAuB,CAAC,CAQlC;AAED,OAAO,EACH,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EACrC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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.TransportChoices = exports.PackageInputChoices = exports.prompt = exports.getPrompts = void 0;
|
|
7
|
+
const logger_1 = require("@sap-ux/logger");
|
|
8
|
+
const i18n_1 = require("./i18n");
|
|
9
|
+
const prompt_state_1 = require("./prompts/prompt-state");
|
|
10
|
+
const prompts_1 = require("./prompts");
|
|
11
|
+
const logger_helper_1 = __importDefault(require("./logger-helper"));
|
|
12
|
+
const types_1 = require("./types");
|
|
13
|
+
Object.defineProperty(exports, "PackageInputChoices", { enumerable: true, get: function () { return types_1.PackageInputChoices; } });
|
|
14
|
+
Object.defineProperty(exports, "TransportChoices", { enumerable: true, get: function () { return types_1.TransportChoices; } });
|
|
15
|
+
const utils_1 = require("./utils");
|
|
16
|
+
/**
|
|
17
|
+
* Get the inquirer prompts for abap deploy config.
|
|
18
|
+
*
|
|
19
|
+
* @param promptOptions - options that can control some of the prompt behavior. See {@link AbapDeployConfigPromptOptions} for details
|
|
20
|
+
* @param logger - a logger compatible with the {@link Logger} interface
|
|
21
|
+
* @param isYUI - if true, the prompt is being called from the Yeoman UI extension host
|
|
22
|
+
* @returns the prompts used to provide input for abap deploy config generation and a reference to the answers object which will be populated with the user's responses once `inquirer.prompt` returns
|
|
23
|
+
*/
|
|
24
|
+
async function getPrompts(promptOptions, logger, isYUI = false) {
|
|
25
|
+
await (0, i18n_1.initI18n)();
|
|
26
|
+
logger_helper_1.default.logger = logger ?? new logger_1.ToolsLogger({ logPrefix: '@sap-ux/abap-deploy-config-inquirer' });
|
|
27
|
+
prompt_state_1.PromptState.isYUI = isYUI;
|
|
28
|
+
return {
|
|
29
|
+
prompts: await (0, prompts_1.getAbapDeployConfigQuestions)(promptOptions),
|
|
30
|
+
// Return reference to derived answers object that will be populated with user responses (after prompting is complete)
|
|
31
|
+
answers: prompt_state_1.PromptState.abapDeployConfig
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
exports.getPrompts = getPrompts;
|
|
35
|
+
/**
|
|
36
|
+
* Prompt for abap deploy config writer inputs.
|
|
37
|
+
*
|
|
38
|
+
* @param adapter - optionally provide references to a calling inquirer instance, this supports integration to Yeoman generators, for example
|
|
39
|
+
* @param promptOptions - options that can control some of the prompt behavior. See {@link AbapDeployConfigPromptOptions} for details
|
|
40
|
+
* @param logger - a logger compatible with the {@link Logger} interface
|
|
41
|
+
* @param isYUI - if true, the prompt is being called from the Yeoman UI extension host
|
|
42
|
+
* @returns the prompt answers
|
|
43
|
+
*/
|
|
44
|
+
async function prompt(adapter, promptOptions, logger, isYUI = false) {
|
|
45
|
+
const abapDeployConfigPrompts = (await getPrompts(promptOptions, logger, isYUI)).prompts;
|
|
46
|
+
const answers = await adapter.prompt(abapDeployConfigPrompts);
|
|
47
|
+
// Add dervied service answers to the answers object
|
|
48
|
+
Object.assign(answers, prompt_state_1.PromptState.abapDeployConfig);
|
|
49
|
+
return (0, utils_1.reconcileAnswers)(answers);
|
|
50
|
+
}
|
|
51
|
+
exports.prompt = prompt;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAA0D;AAC1D,iCAAkC;AAClC,yDAAqD;AACrD,uCAAyD;AACzD,oEAA2C;AAE3C,mCAQiB;AA0Db,oGAjEA,2BAAmB,OAiEA;AACnB,iGAhEA,wBAAgB,OAgEA;AA1DpB,mCAA2C;AAE3C;;;;;;;GAOG;AACH,KAAK,UAAU,UAAU,CACrB,aAA6C,EAC7C,MAAe,EACf,KAAK,GAAG,KAAK;IAKb,MAAM,IAAA,eAAQ,GAAE,CAAC;IACjB,uBAAY,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,oBAAW,CAAC,EAAE,SAAS,EAAE,qCAAqC,EAAE,CAAC,CAAC;IACtG,0BAAW,CAAC,KAAK,GAAG,KAAK,CAAC;IAE1B,OAAO;QACH,OAAO,EAAE,MAAM,IAAA,sCAA4B,EAAC,aAAa,CAAC;QAC1D,sHAAsH;QACtH,OAAO,EAAE,0BAAW,CAAC,gBAAgB;KACxC,CAAC;AACN,CAAC;AA2BG,gCAAU;AAzBd;;;;;;;;GAQG;AACH,KAAK,UAAU,MAAM,CACjB,OAAwB,EACxB,aAA6C,EAC7C,MAAe,EACf,KAAK,GAAG,KAAK;IAEb,MAAM,uBAAuB,GAAG,CAAC,MAAM,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IACzF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAkC,uBAAuB,CAAC,CAAC;IAE/F,oDAAoD;IACpD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,0BAAW,CAAC,gBAAgB,CAAC,CAAC;IAErD,OAAO,IAAA,wBAAgB,EAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAIG,wBAAM"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"logger-helper.d.ts","sourceRoot":"","sources":["../src/logger-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC7B,OAAO,CAAC,MAAM,CAAC,OAAO,CAAiF;IAEvG;;;;OAIG;IACH,WAAkB,MAAM,IAAI,MAAM,CAEjC;IAED;;;;OAIG;IACH,WAAkB,MAAM,CAAC,KAAK,EAAE,MAAM,EAErC;CACJ"}
|
|
@@ -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/abap-deploy-config-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 @@
|
|
|
1
|
+
{"version":3,"file":"logger-helper.js","sourceRoot":"","sources":["../src/logger-helper.ts"],"names":[],"mappings":";;AAAA,2CAA0D;AAE1D;;GAEG;AACH,MAAqB,YAAY;IACrB,MAAM,CAAC,OAAO,GAAW,IAAI,oBAAW,CAAC,EAAE,SAAS,EAAE,qCAAqC,EAAE,CAAC,CAAC;IAEvG;;;;OAIG;IACI,MAAM,KAAK,MAAM;QACpB,OAAO,YAAY,CAAC,OAAO,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,MAAM,KAAK,MAAM,CAAC,KAAa;QAClC,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;IACjC,CAAC;;AAnBL,+BAoBC"}
|