generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathtypes.ts
More file actions
1306 lines (1163 loc) · 33.8 KB
/
types.ts
File metadata and controls
1306 lines (1163 loc) · 33.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import type { UI5FlexLayer, ManifestNamespace, Manifest, Package } from '@sap-ux/project-access';
import type { DestinationAbapTarget, UrlAbapTarget } from '@sap-ux/system-access';
import type { Adp, BspApp } from '@sap-ux/ui5-config';
import type { AxiosRequestConfig, KeyUserChangeContent, OperationsType } from '@sap-ux/axios-extension';
import type { Editor } from 'mem-fs-editor';
import type { Destination } from '@sap-ux/btp-utils';
import type { YUIQuestion } from '@sap-ux/inquirer-common';
import type AdmZip from 'adm-zip';
export interface DescriptorVariant {
layer: UI5FlexLayer;
reference: string;
id: string;
namespace: string;
content: DescriptorVariantContent[];
}
export interface DescriptorVariantContent {
changeType: string;
content: Record<string, unknown>;
texts?: string | { i18n?: string };
}
export interface ToolsSupport {
id: string;
version: string;
toolsId: string;
}
/**
* Reduce the options exposed as target configuration.
*/
type AbapTarget = DestinationAbapTarget | Pick<UrlAbapTarget, 'url' | 'client' | 'scp'>;
export interface AdpPreviewConfig {
target: AbapTarget;
/**
* If set to true then certification validation errors are ignored.
*/
ignoreCertErrors?: boolean;
/**
* For CF ADP projects: path to build output folder (e.g., 'dist') to serve resources directly.
*/
cfBuildPath?: string;
}
export interface OnpremApp {
/** Application variant id. */
id: string;
/** Reference associated with the ID of the base application. */
reference: string;
layer?: FlexLayer;
fioriId?: string;
ach?: string;
title?: string;
/** Optional: Application variant change content. */
content?: Content[];
/** Optional: Description about i18n.properties. */
i18nDescription?: string;
/** Optional: I18n resource models derived from the manifest. */
i18nModels?: ResourceModel[];
/** Optional: Application type derived from the manifest. */
appType?: ApplicationType;
/** The manifest of the application */
manifest?: Manifest;
}
export interface CloudApp extends OnpremApp {
/** bspName associated with the ABAP Cloud repository name of the base application. */
bspName: string;
/** Cloud app active languages. */
languages: Language[];
}
export type App = OnpremApp | CloudApp;
export type DeployConfig = Adp | BspApp;
export interface AdpWriterConfig {
app: App;
target: AbapTarget;
ui5?: {
minVersion?: string;
version?: string;
frameworkUrl?: string;
shouldSetMinVersion?: boolean;
};
package?: {
name?: string;
description?: string;
};
customConfig?: CustomConfig;
/**
* Optional: configuration for deployment to ABAP
*/
deploy?: DeployConfig;
options?: {
/**
* Optional: if set to true then the generated project will be recognized by the SAP Fiori tools
*/
fioriTools?: boolean;
/**
* Optional: if set to true then the generated project will support typescript
*/
enableTypeScript?: boolean;
/**
* Optional: path to the template files to be used for generation
*/
templatePathOverwrite?: string;
};
/**
* Optional: Key-user changes to be written to the project.
*/
keyUserChanges?: KeyUserChangeContent[];
}
/**
* Interface representing the answers collected from the configuration prompts of Adaptation Project generator.
*/
export interface ConfigAnswers {
system: string;
username: string;
password: string;
application: SourceApplication;
fioriId?: string;
ach?: string;
shouldCreateExtProject?: boolean;
}
export interface AttributesAnswers {
projectName: string;
title: string;
namespace: string;
targetFolder: string;
ui5Version: string;
enableTypeScript: boolean;
addDeployConfig?: boolean;
addFlpConfig?: boolean;
importKeyUserChanges?: boolean;
}
export interface SourceApplication {
id: string;
title: string;
ach: string;
registrationIds: string[];
fileType: string;
bspUrl: string;
bspName: string;
}
export interface FlexUISupportedSystem {
isUIFlex: boolean;
isOnPremise: boolean;
}
export interface UI5Version {
latest: VersionDetail;
[key: string]: VersionDetail;
}
export interface VersionDetail {
version: string;
support: string;
lts: boolean;
}
export interface TypesConfig {
typesPackage: string;
typesVersion: string;
}
export interface ResourceModel {
key: string;
path: string;
content?: string;
}
export interface SapModel {
type?: string;
uri?: string;
settings?: {
bundleName?: string;
};
}
export interface Endpoint extends Partial<Destination> {
Name: string;
Url?: string;
Client?: string;
Credentials?: { username?: string; password?: string };
UserDisplayName?: string;
Scp?: boolean;
}
export interface ChangeInboundNavigation {
/** Identifier for the inbound navigation. */
inboundId: string;
/** Title associated with the inbound navigation. */
title?: string;
/** Subtitle associated with the inbound navigation. */
subTitle?: string;
}
export interface NewInboundNavigation {
/** Represent business entities that reflect a specific scenario. */
semanticObject: string;
/** Operations which can be performed on a semantic object. */
action: string;
/** Defined instance of the semantic object (e.g. by specifying the employee ID). */
additionalParameters?: string;
/** Title associated with the inbound navigation. */
title: string;
/** Optional: Subtitle associated with the inbound navigation. */
subTitle?: string;
/** Icon associated with the inbound navigation. */
icon?: string;
}
export interface InternalInboundNavigation extends NewInboundNavigation {
/** Identifier for the inbound navigation. */
inboundId: string;
}
export interface Language {
sap: string;
i18n: string;
}
export interface ManifestAppdescr {
fileName: string;
layer: string;
fileType: string;
reference: string;
id: string;
namespace: string;
version: string;
content: Content[];
}
export interface Content {
changeType: string;
content: object;
texts?: object;
}
export interface CommonChangeProperties {
changeType: string;
reference: string;
namespace: string;
projectId: string;
moduleName: string;
support: {
generator: string;
sapui5Version: string;
command?: string;
};
originalLanguage: string;
layer: string;
fileType: string;
fileName: string;
texts: Record<string, unknown>;
}
export interface CommonAdditionalChangeInfoProperties {
templateName?: string;
targetAggregation?: string;
controlType?: string;
viewName?: string;
}
export interface ManifestChangeProperties {
fileName: string;
fileType: string;
namespace: string;
layer: string;
packageName: string;
reference: string;
support: { generator: string };
changeType: string;
creation: string;
content: object;
}
export interface AddXMLChange extends CommonChangeProperties {
changeType: 'addXML';
creation: string;
packageName: string;
content: {
targetAggregation: string;
index: number;
fragmentPath: string;
templateName?: string;
};
selector: {
id: string;
idIsLocal: boolean;
};
dependentSelector: Record<string, unknown>;
jsOnly: boolean;
}
export interface AppDescriptorV4Change<T = unknown> extends CommonChangeProperties {
changeType: 'appdescr_fe_changePageConfiguration';
content: {
entityPropertyChange: {
propertyPath: string;
operation: string;
propertyValue: string | boolean | number | T;
};
};
}
export interface CodeExtChange extends CommonChangeProperties {
changeType: 'codeExt';
content: {
codeRef: string;
};
selector: {
controllerName: string;
};
}
export interface AnnotationFileChange extends CommonChangeProperties {
changeType: 'appdescr_app_addAnnotationsToOData';
creation: string;
content: {
dataSourceId: string;
annotations: string[];
annotationsInsertPosition: 'END';
dataSource: {
[fileName: string]: {
uri: string;
type: 'ODataAnnotation';
};
};
};
}
export interface ParamCheck {
shouldApply: boolean;
value: string | undefined;
}
export interface ParameterOptions {
required: boolean;
filter?: Value;
defaultValue?: Value;
renameTo?: string;
}
export interface Value {
value: string;
format: string;
}
export interface Parameter {
[key: string]: ParameterOptions;
}
export type ParameterRules = {
/**
* Function that checks whether param has empty value, e.g parameter defined in the following format has empty value: param1=
*
* @param {string} param - param string
* @returns {ParamCheck} object which indicates if this rule should be applied and the parameter value
*/
isEmptyParam(param: string): ParamCheck;
/**
* Function that define whether param is mandatory, param which is placed inside () is not mandatory
*
* @param {string} param - param string
* @returns {boolean} whether param string is mandatory or not
*/
isMandatoryParam(param: string): boolean;
/**
* Function that checks whehter param has filter value, e.g parameter value placed inside <> indicates for filter value: param1=<value>
*
* @param {string} param - param string
* @returns {ParamCheck} object which indicates if this rule should be applied and the parameter value
*/
shouldHavеFilteredValue(param: string): ParamCheck;
/**
* Function that checks whether parameter has rename to value, e.g param1=>value
*
* @param {string} param - param string
* @returns {ParamCheck} object which indicates if this rule should be applied and the parameter value
*/
shouldRenameTo(param: string): ParamCheck;
/**
* Function thath checks whether parameter value should have reference as format value, e.g param1=%%value%%
*
* @param {string} param - param string
* @returns {ParamCheck} object which indicates if this rule should be applied and the parameter value
*/
isReference(param: string): ParamCheck;
};
export enum ApplicationType {
FIORI_ELEMENTS = 'FioriElements',
FIORI_ELEMENTS_OVP = 'FioriElementsOVP',
FREE_STYLE = 'FreeStyle',
NONE = ''
}
export const enum TemplateFileName {
Fragment = 'fragment.xml',
Controller = 'controller.ejs',
TSController = 'ts-controller.ejs',
Annotation = 'annotation.xml'
}
export const enum FlexLayer {
CUSTOMER_BASE = 'CUSTOMER_BASE',
VENDOR = 'VENDOR'
}
export const enum NamespacePrefix {
CUSTOMER = 'customer.',
EMPTY = ''
}
export const enum HttpStatusCodes {
OK = 200,
CREATED = 201,
NO_CONTENT = 204,
BAD_REQUEST = 400,
UNAUTHORIZED = 401,
FORBIDDEN = 403,
NOT_FOUND = 404,
METHOD_NOT_ALLOWED = 405,
CONFLICT = 409,
INTERNAL_SERVER_ERROR = 500,
NOT_IMPLEMETED = 501,
SERVICE_UNAVAILABLE = 503
}
export type NetworkError = { message?: string; name?: string; code?: string };
export type OperationType = 'read' | 'write' | 'delete';
/**
* Represents a constructor type that creates an instance of IWriter.
*
* @param fs - An instance of Editor used for file system operations.
* @param projectPath - The root path of the project.
* @returns An instance of IWriter for handling specific data writing operations.
*/
export type Writer = new (fs: Editor, projectPath: string) => IWriter<any>;
/**
* Generic interface for handling data associated with specific writer operations.
* Allows for the typing of data passed to IWriter implementations based on the change type.
*
* @template T - The subtype of ChangeType that specifies the kind of change and associated data.
*/
export type IWriterData<T extends ChangeType> = IWriter<GeneratorData<T>>;
/**
* Defines a generic interface for writer classes, specialized by the type of data they handle.
*
* @template T - The specific type of data the writer will handle, determined by the associated ChangeType.
*/
export interface IWriter<T> {
/**
* Writes the provided data to the project.
*
* @param data - The data needed for the writer function, specific to the type of change being made.
*/
write(data: T): Promise<void>;
}
/**
* Enumerates the types of changes that can be made, each representing a specific kind of modification.
*/
export const enum ChangeType {
ADD_NEW_MODEL = 'appdescr_ui5_addNewModel',
ADD_ANNOTATIONS_TO_ODATA = 'appdescr_app_addAnnotationsToOData',
CHANGE_DATA_SOURCE = 'appdescr_app_changeDataSource',
ADD_COMPONENT_USAGES = 'appdescr_ui5_addComponentUsages',
ADD_LIBRARY_REFERENCE = 'appdescr_ui5_addLibraries',
CHANGE_INBOUND = 'appdescr_app_changeInbound'
}
/**
* A mapping of ChangeType values to their respective change names.
*/
export const ChangeTypeMap: Record<ChangeType, string> = {
[ChangeType.ADD_NEW_MODEL]: 'addNewModel',
[ChangeType.ADD_ANNOTATIONS_TO_ODATA]: 'addAnnotationsToOData',
[ChangeType.CHANGE_DATA_SOURCE]: 'changeDataSource',
[ChangeType.ADD_COMPONENT_USAGES]: 'addComponentUsages',
[ChangeType.ADD_LIBRARY_REFERENCE]: 'addLibraries',
[ChangeType.CHANGE_INBOUND]: 'changeInbound'
} as const;
/**
* Maps a ChangeType to the corresponding data structure needed for that type of change.
* This conditional type ensures type safety by linking each change type with its relevant data model.
*
* @template T - A subtype of ChangeType indicating the specific type of change.
*/
export type GeneratorData<T extends ChangeType> = T extends ChangeType.ADD_ANNOTATIONS_TO_ODATA
? AnnotationsData
: T extends ChangeType.ADD_COMPONENT_USAGES
? ComponentUsagesData
: T extends ChangeType.ADD_LIBRARY_REFERENCE
? ComponentUsagesData
: T extends ChangeType.ADD_NEW_MODEL
? NewModelData
: T extends ChangeType.CHANGE_DATA_SOURCE
? DataSourceData
: T extends ChangeType.CHANGE_INBOUND
? InboundData
: never;
export interface AnnotationsData {
variant: DescriptorVariant;
/** Flag for differentiating the annotation creation call from CLI and from CPE */
isCommand: boolean;
annotation: {
/** Optional name of the annotation file. */
fileName?: string;
/** Data source associated with the annotation. */
dataSource: string;
/** Optional path to the annotation file. */
filePath?: string;
namespaces?: { namespace: string; alias: string }[];
serviceUrl?: string;
};
}
export const enum AnnotationFileSelectType {
ExistingFile = 1,
NewEmptyFile = 2
}
export interface ComponentUsagesDataBase {
variant: DescriptorVariant;
component: {
/** Indicates whether the component is loaded lazily. */
isLazy: string;
/** Unique ID for the component usage. */
usageId: string;
/** Name of the component. */
name: string;
/** Serialized data specific to the component. */
data: string;
/** Settings related to the component. */
settings: string;
};
}
export interface ComponentUsagesDataWithLibrary extends ComponentUsagesDataBase {
library: {
/** Reference to the component's library. */
reference: string;
/** Optional flag indicating if the library reference is lazy. */
referenceIsLazy: string;
};
}
export type ComponentUsagesData = ComponentUsagesDataBase | ComponentUsagesDataWithLibrary;
export type AddComponentUsageAnswersWithoutLibrary = {
/** Indicates whether a library reference should be added */
shouldAddLibrary: false;
};
export type addComponentUsageAnswersWithLibrary = {
/** Indicates whether a library reference should be added */
shouldAddLibrary: true;
/** Reference to the component's library. */
library: string;
/** Indicates whether the library reference is loaded lazily. */
libraryIsLazy: string;
};
export type AddComponentUsageAnswersBase = {
/** Indicates whether the component is loaded lazily. */
isLazy: string;
/** Unique ID for the component usage. */
usageId: string;
/** Name of the component. */
name: string;
/** Serialized data specific to the component. */
data: string;
/** Settings related to the component. */
settings: string;
};
export type AddComponentUsageAnswers = AddComponentUsageAnswersBase &
(AddComponentUsageAnswersWithoutLibrary | addComponentUsageAnswersWithLibrary);
export interface NewModelDataBase {
variant: DescriptorVariant;
service: {
/** Name of the OData service. */
name: string;
/** URI of the OData service. */
uri: string;
/** Name of the OData service model. */
modelName: string;
/** Version of OData used. */
version: string;
/** Settings for the OData service model. */
modelSettings?: string;
};
}
export interface NewModelDataWithAnnotations extends NewModelDataBase {
annotation: {
/** Name of the OData annotation data source. */
dataSourceName: string;
/** Optional URI of the OData annotation data source. */
dataSourceURI?: string;
/** Optional settings for the OData annotation. */
settings?: string;
};
}
export type NewModelData = NewModelDataBase | NewModelDataWithAnnotations;
export interface NewModelAnswersBase {
/** Name of the OData service. */
name: string;
/** URI of the OData service. */
uri: string;
/** Name of the OData service model. */
modelName: string;
/** Version of OData used. */
version: string;
/** Settings for the OData service model. */
modelSettings: string;
/** Name of the OData annotation data source. */
}
export interface NewModelAnswersWithAnnotations extends NewModelAnswersBase {
addAnnotationMode: true;
/** Name of the OData annotation data source. */
dataSourceName: string;
/** Optional URI of the OData annotation data source. */
dataSourceURI?: string;
/** Optional settings for the OData annotation. */
annotationSettings?: string;
}
export interface NewModelAnswersWithoutAnnotations extends NewModelAnswersBase {
addAnnotationMode: false;
}
export type NewModelAnswers = NewModelAnswersBase &
(NewModelAnswersWithAnnotations | NewModelAnswersWithoutAnnotations);
export interface DataSourceData {
variant: DescriptorVariant;
dataSources: Record<string, ManifestNamespace.DataSource>;
service: {
/** Data source identifier. */
id: string;
/** URI of the data source. */
uri: string;
/** Optional maximum age for the data source cache. */
maxAge?: number;
/** URI for the OData annotation source. */
annotationUri?: string;
};
}
export type RequireAtLeastOne<T> = {
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
}[keyof T];
export interface InboundChangeAnswersBase {
/** Title associated with the inbound navigation data. */
title: string;
/** Subtitle associated with the inbound navigation data. */
subtitle: string;
/** Icon associated with the inbound navigation data. */
icon: string;
}
export type InboundChangeAnswers = RequireAtLeastOne<InboundChangeAnswersBase>;
export interface InboundData {
/** Identifier for the inbound navigation data. */
inboundId: string;
variant: DescriptorVariant;
flp: RequireAtLeastOne<{
/** Title associated with the inbound navigation data. */
title: string;
/** Subtitle associated with the inbound navigation data. */
subtitle: string;
/** Icon associated with the inbound navigation data. */
icon: string;
}>;
}
export interface InboundContent {
inboundId: string;
entityPropertyChange: { propertyPath: string; operation: string; propertyValue: unknown }[];
}
export type DataSourceItem = {
uri?: string;
type: string;
settings: {
[key: string]: unknown;
};
};
export type PropertyValueType = 'boolean' | 'number' | 'string' | 'binding' | 'object';
export interface AdpProjectData {
path: string;
title: string;
namespace: string;
ui5Version: string;
name: string;
layer: UI5FlexLayer;
environment: string;
sourceSystem: string;
applicationIdx: string;
reference: string;
id: string;
}
export interface ChangeDataSourceAnswers {
/** Data Source identifier */
id: string;
/** Data Source URI */
uri: string;
/** Data Source Max Age */
maxAge?: number;
/** Data Source Annotation URI */
annotationUri?: string;
}
export interface AddAnnotationsAnswers {
/** Data Source identifier */
id: string;
/** Selected option for Annotation File */
fileSelectOption: number;
/** Annotation File path */
filePath?: string;
}
export type DataSource = ManifestNamespace.DataSource & { dataSourceName: string; annotations: string[] };
export interface CustomConfig {
adp: {
environment: OperationsType;
support: ToolsSupport;
};
}
export type CloudCustomTaskConfigTarget =
| DestinationAbapTarget
| (Pick<UrlAbapTarget, 'url' | 'client' | 'scp' | 'authenticationType'> & { ignoreCertErrors?: boolean });
export interface CloudCustomTaskConfig {
type: string;
appName: string | undefined;
languages: Language[];
target: AbapTarget;
}
export interface InboundChangeContentAddInboundId {
inbound: {
[inboundId: string]: AddInboundModel;
};
}
export interface AddInboundModel {
/** Represent business entities that reflect a specific scenario. */
semanticObject: string;
/** Operations which can be performed on a semantic object. */
action: string;
/** Title associated with the inbound navigation data. */
title: string;
/** Optional: Subtitle associated with the inbound navigation data. */
subTitle?: string;
/** Optional: Icon associated with the inbound navigation data. */
icon?: string;
signature: AddInboundSignitureModel;
}
export interface AddInboundSignitureModel {
parameters: InboundParameters;
//** Defined instance of the semantic object (e.g. by specifying the employee ID). */
additionalParameters: string;
}
export interface InboundParameters {
'sap-appvar-id'?: object;
'sap-priority'?: object;
}
export interface InboundChange {
inbound: {
[key: string]: {
/** Represent business entities that reflect a specific scenario. */
semanticObject: string;
/** Operations which can be performed on a semantic object. */
action: string;
/** Icon associated with the inbound navigation data. */
icon: string;
/** Title associated with the inbound navigation data. */
title: string;
/** Subtitle associated with the inbound navigation data. */
subTitle: string;
signature: {
parameters: object | string;
//** Defined instance of the semantic object (e.g. by specifying the employee ID). */
additionalParameters: 'allowed';
};
};
};
}
/**
* Route structure from xs-app.json
*/
export interface XsAppRoute {
source: string;
endpoint?: string;
[key: string]: unknown;
}
export interface XsApp {
welcomeFile?: string;
authenticationMethod?: string;
routes: XsAppRoute[];
}
export interface Uaa {
clientid: string;
clientsecret: string;
url: string;
}
export interface CfAppParams {
appName: string;
appVersion: string;
appHostId: string;
}
export interface AppParamsExtended extends CfAppParams {
spaceGuid: string;
}
export interface ServiceKeys {
credentials: {
[key: string]: any;
uaa: Uaa;
uri: string;
endpoints: any;
};
}
export interface ServiceInfo {
serviceKeys: ServiceKeys[];
serviceInstance: ServiceInstance;
}
export interface HTML5Content {
entries: AdmZip.IZipEntry[];
serviceInstanceGuid: string;
manifest: Manifest;
}
export interface ServiceInstance {
name: string;
guid: string;
}
export interface GetServiceInstanceParams {
spaceGuids?: string[];
planNames?: string[];
names: string[];
}
export interface BusinessServiceResource {
name: string;
label: string;
}
/**
* Cloud Foundry ADP UI5 YAML Types
*/
export interface UI5YamlCustomTaskConfiguration {
appHostId: string;
appName: string;
appVersion: string;
moduleName: string;
org: string;
space: string;
html5RepoRuntime: string;
sapCloudService: string;
serviceInstanceName: string;
serviceInstanceGuid: string;
}
export interface UI5YamlCustomTask {
name: string;
beforeTask?: string;
configuration: UI5YamlCustomTaskConfiguration;
}
export interface UI5YamlBuilder {
customTasks: UI5YamlCustomTask[];
}
export interface UI5YamlMetadata {
name: string;
}
export interface CfUI5Yaml {
specVersion: string;
type: string;
metadata: UI5YamlMetadata;
builder: UI5YamlBuilder;
}
/**
* Cloud Foundry ADP MTA YAML Types
*/
export interface MtaDestination {
Name: string;
ServiceInstanceName: string;
ServiceKeyName: string;
Authentication?: string;
'sap.cloud.service'?: string;
}
export interface MtaContentInstance {
destinations: MtaDestination[];
existing_destinations_policy?: string;
}
export interface MtaContent {
instance: MtaContentInstance;
}
export interface MtaServiceKey {
name: string;
}
export interface MtaParameters {
'service-key'?: MtaServiceKey;
'content-target'?: boolean;
content?: MtaContent;
'no-source'?: boolean;
'build-result'?: string;
requires?: MtaBuildRequire[];
builder?: string;
commands?: string[];
'supported-platforms'?: string[];
'disk-quota'?: string;
memory?: string;
service?: string;
'service-plan'?: string;
'service-name'?: string;
path?: string;
config?: Record<string, unknown>;
}
export interface MtaBuildRequire {
artifacts?: string[];
name: string;
'target-path'?: string;
}
export interface MtaRequire {
name: string;
parameters?: MtaParameters;
}
export interface MtaModule {
name: string;
type: string;
path?: string;
requires?: MtaRequire[];
'build-parameters'?: MtaParameters;
parameters?: MtaParameters;
}
export interface MtaResource {
name: string;
type: string;
parameters: MtaParameters;
}
export interface MtaYaml {
'_schema-version': string;
'ID': string;
'version': string;
builder?: {
customTasks?: {
configuration?: {
appHostId: string;
};
}[];
};