@sap/artifact-management-types 1.44.0 → 1.45.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/package.json +2 -2
- package/src/plugins/abap/index.d.ts +3 -0
- package/src/plugins/abap/readers/AbapModuleReader.d.ts +33 -0
- package/src/plugins/abap/readers/AbapProjectReader.d.ts +9 -0
- package/src/plugins/abap/utils/AbapReaderUtil.d.ts +22 -0
- package/src/plugins/abap/utils/FioriUiForAbapUtil.d.ts +23 -0
- package/src/plugins/cap/readers/CapModuleReader.d.ts +1 -1
- package/src/plugins/cap/util/CapLogicUtil.d.ts +42 -0
- package/src/plugins/cap/util/ItemUtil.d.ts +1 -0
- package/src/plugins/cap/util/PathUtil.d.ts +1 -0
- package/src/project-api/ProjectEntityInstance.d.ts +2 -1
- package/src/project-api/ProjectModulesInstance.d.ts +4 -1
- package/src/project-api/VSCodeWorkspace.d.ts +3 -20
- package/src/project-api/WorkspaceImpl.d.ts +2 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/artifact-management-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.1",
|
|
4
4
|
"description": "Type signatures for artifact management",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"main": "./src/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"pack": "npm run modify-types-import && npm pack"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@sap/artifact-management-base-types": "1.
|
|
13
|
+
"@sap/artifact-management-base-types": "1.45.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"gulp": "4.0.2"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ProjectFileSystem, Item, ModuleType, ModuleData, ProjectEntityReaderReadOptions, KeyIn, ItemDetailInfoOptions, ProjectContext } from '@sap/artifact-management-base-types';
|
|
2
|
+
import { ItemFilter } from '@sap/artifact-management-base/types';
|
|
3
|
+
import CapModuleReader from '../../cap/readers/CapModuleReader';
|
|
4
|
+
interface AbapItemReaderContext {
|
|
5
|
+
withDetailInfo?: boolean;
|
|
6
|
+
filter?: ItemFilter;
|
|
7
|
+
}
|
|
8
|
+
export default class AbapModuleReader extends CapModuleReader {
|
|
9
|
+
getType(): KeyIn<typeof ModuleType>;
|
|
10
|
+
matchConditions: {
|
|
11
|
+
requiredFilePatterns: string[];
|
|
12
|
+
};
|
|
13
|
+
itemTags: string[];
|
|
14
|
+
tags: string[];
|
|
15
|
+
itemReaders: {
|
|
16
|
+
matchConditions: {
|
|
17
|
+
requiredFilePatterns: string[];
|
|
18
|
+
};
|
|
19
|
+
types: string[];
|
|
20
|
+
tags: string[];
|
|
21
|
+
read: (options: ProjectEntityReaderReadOptions) => Promise<Item[]>;
|
|
22
|
+
detailInfo: (fs: ProjectFileSystem, ref: string, options?: ItemDetailInfoOptions | undefined) => Promise<Item | undefined>;
|
|
23
|
+
}[];
|
|
24
|
+
read({ fs }: {
|
|
25
|
+
fs: ProjectFileSystem;
|
|
26
|
+
}): Promise<ModuleData | undefined>;
|
|
27
|
+
prepareItemReaderContext(fs: ProjectFileSystem, context: ProjectContext): Promise<AbapItemReaderContext | undefined>;
|
|
28
|
+
private provideFromCsn;
|
|
29
|
+
private getAbapServicesItems;
|
|
30
|
+
private createItems;
|
|
31
|
+
private processCsnFile;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DetectionMechanism, KeyIn, ProjectData, ProjectReader, ProjectReaderOptions, ProjectType } from '@sap/artifact-management-base-types';
|
|
2
|
+
export default class AbapProjectReader extends ProjectReader {
|
|
3
|
+
constructor();
|
|
4
|
+
getType(): KeyIn<typeof ProjectType>;
|
|
5
|
+
getDetectionMechanism(): DetectionMechanism;
|
|
6
|
+
moduleSearchPattern(): Promise<string[]>;
|
|
7
|
+
tags: string[];
|
|
8
|
+
read({ fs, matchedFiles }: ProjectReaderOptions): Promise<ProjectData | undefined>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CDSDefinition, Item, LinkType } from '@sap/artifact-management-base-types';
|
|
2
|
+
export interface EntityRefInfo {
|
|
3
|
+
ref: string;
|
|
4
|
+
path: string;
|
|
5
|
+
name: string;
|
|
6
|
+
prefixRef: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DependItem {
|
|
9
|
+
item: Item;
|
|
10
|
+
linkType: LinkType;
|
|
11
|
+
}
|
|
12
|
+
export declare function fillAbapServiceItemInfo(serviceItem: Item, service: CDSDefinition): Item;
|
|
13
|
+
export declare function filterMatchedFiles(matchedFiles: Record<string, string[]>, csnFilter?: string[]): string[];
|
|
14
|
+
export declare function fillServices(services: CDSDefinition[], csnFile: string, itemTags: string[], items: Map<string, Item>): void;
|
|
15
|
+
export declare function fillEntities(entities: CDSDefinition[], csnFile: string, itemTags: string[], items: Map<string, Item>): void;
|
|
16
|
+
export declare function processEntityItems(entities: CDSDefinition[], items: Map<string, Item>): void;
|
|
17
|
+
export declare function processDependencies(entity: CDSDefinition, entityItem: Item, items: Map<string, Item>, prefixRef: string): void;
|
|
18
|
+
export declare function addLinksToEntity(entityItem: Item, dependItems: DependItem[]): void;
|
|
19
|
+
export declare function fillCompositions(entity: CDSDefinition, entityItem: Item, items: Map<string, Item>): void;
|
|
20
|
+
export declare function processAssociations(entity: CDSDefinition, entityItem: Item): void;
|
|
21
|
+
export declare function getAbapEntityRef(name: string): EntityRefInfo;
|
|
22
|
+
export declare function getEntityTypeByPath(path: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Item, ProjectData, ProjectFileSystem, VSCodeFileSystem } from '@sap/artifact-management-base-types';
|
|
2
|
+
interface AppGenInfoItem {
|
|
3
|
+
serviceNameCsn: string;
|
|
4
|
+
csnName: string;
|
|
5
|
+
packageUri: string;
|
|
6
|
+
}
|
|
7
|
+
interface AppGenInfo {
|
|
8
|
+
abapCSN: AppGenInfoItem[];
|
|
9
|
+
}
|
|
10
|
+
interface AppGenInfoFile {
|
|
11
|
+
externalParameters: AppGenInfo;
|
|
12
|
+
}
|
|
13
|
+
export declare type ServiceItemsMap = Map<string, Item[]>;
|
|
14
|
+
export declare function isAppGenInfoItem(obj: any): obj is AppGenInfoItem;
|
|
15
|
+
export declare function filterValidAppGenInfoItems(items: any[]): AppGenInfoItem[];
|
|
16
|
+
export declare function parseAppGenInfoContent(fileContent: AppGenInfoFile): AppGenInfoFile;
|
|
17
|
+
export declare function isFioriUiForAbap(fioriProjectPath: string): any;
|
|
18
|
+
export declare function initFioriUiItem(projectInfo: ProjectData): Item;
|
|
19
|
+
export declare function updateUiItem(UiItem: Item, serviceItem: Item): void;
|
|
20
|
+
export declare function updateUiItems(appGenInfoFile: AppGenInfoFile, serviceCsnsMap: ServiceItemsMap, projectFs: ProjectFileSystem | VSCodeFileSystem, fioriUiItem: Item): void;
|
|
21
|
+
export declare function createUiItemsForAbap(projectInfo: ProjectData, serviceItemsMap: ServiceItemsMap, projectFs: ProjectFileSystem | VSCodeFileSystem): Item | undefined;
|
|
22
|
+
export declare function fetchUiAndUpdateUiProject(projectFs: ProjectFileSystem, serviceItemsMap: ServiceItemsMap): Promise<Item[]>;
|
|
23
|
+
export {};
|
|
@@ -37,7 +37,7 @@ export default class CapModuleReader extends ModuleReader {
|
|
|
37
37
|
provideFromCds({ fs, matchedFiles, context }: ProjectEntityReaderReadOptions): Promise<Item[]>;
|
|
38
38
|
detailInfo(fs: ProjectFileSystem, ref: string, options?: ItemDetailInfoOptions): Promise<Item | undefined>;
|
|
39
39
|
readCSV({ fs, matchedFiles }: ProjectEntityReaderReadOptions): Promise<Item[]>;
|
|
40
|
-
readApplicationLogic({ fs, matchedFiles }: ProjectEntityReaderReadOptions): Promise<Item[]>;
|
|
40
|
+
readApplicationLogic({ fs, matchedFiles, context }: ProjectEntityReaderReadOptions): Promise<Item[]>;
|
|
41
41
|
private addUnboundFunctionItems;
|
|
42
42
|
private addUnboundActionItems;
|
|
43
43
|
private addEventItems;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
export declare type PhaseType = 'before' | 'on' | 'after';
|
|
3
|
+
export declare const phases: string[];
|
|
4
|
+
export declare const EVENT_UNDEFINED = "__undefined__";
|
|
5
|
+
export declare const DEFAULT_INDENT = 4;
|
|
6
|
+
export interface LogicTarget {
|
|
7
|
+
service: string;
|
|
8
|
+
entity?: string;
|
|
9
|
+
action?: string;
|
|
10
|
+
externalService?: string;
|
|
11
|
+
externalServiceEvent?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Event {
|
|
14
|
+
name: string;
|
|
15
|
+
phase: PhaseType;
|
|
16
|
+
}
|
|
17
|
+
export interface ApplicationLogic {
|
|
18
|
+
name: string;
|
|
19
|
+
displayName?: string;
|
|
20
|
+
legacy?: boolean;
|
|
21
|
+
compatible?: boolean;
|
|
22
|
+
description?: string;
|
|
23
|
+
target: LogicTarget;
|
|
24
|
+
draft?: boolean;
|
|
25
|
+
code?: string;
|
|
26
|
+
events: Event[];
|
|
27
|
+
}
|
|
28
|
+
export declare const rectifyEvent: (name: string) => string;
|
|
29
|
+
export default class ServiceScript {
|
|
30
|
+
private readonly serviceContent;
|
|
31
|
+
private raw;
|
|
32
|
+
constructor(serviceContent: string);
|
|
33
|
+
private tryParseScript;
|
|
34
|
+
private getServices;
|
|
35
|
+
list(): Promise<ApplicationLogic[]>;
|
|
36
|
+
}
|
|
37
|
+
interface ServiceDefinition {
|
|
38
|
+
name?: string;
|
|
39
|
+
node: t.Node;
|
|
40
|
+
}
|
|
41
|
+
export declare function parseServiceDefinitions(ast: t.File | t.Program): ServiceDefinition[];
|
|
42
|
+
export {};
|
|
@@ -15,6 +15,7 @@ export default class ItemUtil {
|
|
|
15
15
|
static addLink(entity: Item, target: any, linkType: LinkType, serviceRefs: {
|
|
16
16
|
[key: string]: string;
|
|
17
17
|
}): void;
|
|
18
|
+
static addCapLinksToAppLogicItem(fs: ProjectFileSystem, file: string, capApi: CapApi, items: Item[], tags: any[]): Promise<void>;
|
|
18
19
|
static addLinksToAppLogicItem(fs: ProjectFileSystem, file: string, capApi: CapApi, logicItem: Item): Promise<void>;
|
|
19
20
|
static addLinksToJavaAppLogicItem(fs: ProjectFileSystem, file: string, capApi: CapApi, logicItem: Item): Promise<void>;
|
|
20
21
|
private static addLinksToAppLogicItemWithEntity;
|
|
@@ -29,9 +29,10 @@ export default class ProjectEntityInstance<T> extends EventEmitter {
|
|
|
29
29
|
* of "getChildCache()".
|
|
30
30
|
*
|
|
31
31
|
*/
|
|
32
|
-
protected getChildCached<Child>({ name, load }: {
|
|
32
|
+
protected getChildCached<Child>({ name, load, extraKey }: {
|
|
33
33
|
name: string;
|
|
34
34
|
load: () => Promise<Child>;
|
|
35
|
+
extraKey?: string;
|
|
35
36
|
}): Promise<Child>;
|
|
36
37
|
/**
|
|
37
38
|
* Get data of an entity
|
|
@@ -16,10 +16,13 @@ export default class ProjectModulesInstance extends ProjectEntityInstance<string
|
|
|
16
16
|
loadModuleDirectories(): Promise<LoadResult<string[]>>;
|
|
17
17
|
loadModuleInstances(directoryPaths: string[]): Promise<ModuleInstance[]>;
|
|
18
18
|
getModules(): Promise<ModuleData[]>;
|
|
19
|
-
readDeep(withDetailInfo?: boolean): Promise<Project | undefined>;
|
|
19
|
+
readDeep(withDetailInfo?: boolean, filter?: ItemFilter): Promise<Project | undefined>;
|
|
20
20
|
getModuleDirectories(): Promise<string[]>;
|
|
21
21
|
getModuleInstances(): Promise<ModuleInstance[]>;
|
|
22
22
|
readItems(filter?: ItemFilter, withDetailInfo?: boolean): Promise<Item[]>;
|
|
23
|
+
private filterMatching;
|
|
24
|
+
private assembleItemsMap;
|
|
25
|
+
private addReverseLinks;
|
|
23
26
|
private getItemsFilteredByTags;
|
|
24
27
|
detailInfo(type: KeyIn<typeof ItemType>, ref: string, entityPath?: string, options?: ItemDetailInfoOptions): Promise<Item | undefined>;
|
|
25
28
|
}
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import { FSWatcher } from 'fs';
|
|
3
|
-
import { Event, Uri, WorkspaceFolder, WorkspaceFoldersChangeEvent, FileSystem } from 'vscode';
|
|
4
|
-
import { IPluginManager, KeyIn, Tag } from '@sap/artifact-management-base-types';
|
|
1
|
+
import { IPluginManager, KeyIn, Tag, VSCodeApi } from '@sap/artifact-management-base-types';
|
|
5
2
|
import ProjectApi from './ProjectApi';
|
|
6
3
|
import WorkspaceApi from './WorkspaceApi';
|
|
7
|
-
export interface VSCodeWorksapceLike {
|
|
8
|
-
workspaceFolders: readonly WorkspaceFolder[] | undefined;
|
|
9
|
-
onDidChangeWorkspaceFolders: Event<WorkspaceFoldersChangeEvent>;
|
|
10
|
-
workspaceFile: Uri | undefined;
|
|
11
|
-
fs: FileSystem;
|
|
12
|
-
}
|
|
13
|
-
export interface VSCodeUriLike {
|
|
14
|
-
file(path: string): Uri;
|
|
15
|
-
}
|
|
16
|
-
export interface VSCodeLike {
|
|
17
|
-
Uri: VSCodeUriLike;
|
|
18
|
-
workspace: VSCodeWorksapceLike;
|
|
19
|
-
}
|
|
20
4
|
export default class VSCodeWorkspace implements WorkspaceApi {
|
|
21
|
-
workspaceFolders: readonly WorkspaceFolder[] | undefined;
|
|
22
|
-
workspaceWatcher?: FSWatcher;
|
|
23
5
|
workspaceChangeHandler?: (event: string, folders: any[]) => void;
|
|
24
6
|
private watch?;
|
|
25
7
|
private readModuleAsProject;
|
|
26
8
|
private vscode;
|
|
27
9
|
private readers;
|
|
28
|
-
constructor(
|
|
10
|
+
constructor(vscodeParam: VSCodeApi, readModuleAsProject: boolean);
|
|
29
11
|
private getSubFolders;
|
|
30
12
|
getProjects(tag?: KeyIn<typeof Tag>, path?: string, shallow?: boolean): Promise<ProjectApi[]>;
|
|
31
13
|
getProject(path: string, useHeadlessGenerator?: boolean): Promise<ProjectApi>;
|
|
@@ -38,4 +20,5 @@ export default class VSCodeWorkspace implements WorkspaceApi {
|
|
|
38
20
|
onWorkspaceChanged(handler: (event: string, folders: string[]) => void): void;
|
|
39
21
|
private getRootPath;
|
|
40
22
|
getPluginManager(): IPluginManager;
|
|
23
|
+
private resolvePath;
|
|
41
24
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { IPluginManager, KeyIn, Tag } from '@sap/artifact-management-base-types';
|
|
1
|
+
import { IPluginManager, KeyIn, Tag, VSCodeApi } from '@sap/artifact-management-base-types';
|
|
2
2
|
import ProjectApi from './ProjectApi';
|
|
3
3
|
import WorkspaceApi from './WorkspaceApi';
|
|
4
|
-
import { VSCodeLike } from './VSCodeWorkspace';
|
|
5
|
-
export { VSCodeLike };
|
|
6
4
|
export default class WorkspaceImpl implements WorkspaceApi {
|
|
7
5
|
private api;
|
|
8
|
-
constructor(pathOrWorkspace: string |
|
|
6
|
+
constructor(pathOrWorkspace: string | VSCodeApi, readModuleAsProject?: boolean);
|
|
9
7
|
getProjects(tag?: KeyIn<typeof Tag>, path?: string, shallow?: boolean): Promise<ProjectApi[]>;
|
|
10
8
|
getProject(path: string, useHeadlessGenerator?: boolean): Promise<ProjectApi>;
|
|
11
9
|
getProjectUris(): Promise<string[]>;
|