-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store/cockpitApi: scan for blueprint files
Add an initial commit to scan a preset directory for user blueprint files. This makes use of the cockpit files api.
- Loading branch information
1 parent
d06346c
commit 5cca844
Showing
6 changed files
with
134 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
|
||
// TODO: maybe we should pull in the cockpit types here | ||
// and keep them in the project. Not ideal because it may | ||
// diverge, so we need to think about it. | ||
export interface UserInfo { | ||
home: string; | ||
} | ||
|
||
export default { | ||
user: (): Promise<UserInfo> => { | ||
return new Promise((resolve) => { | ||
resolve({ | ||
home: '', | ||
}); | ||
}); | ||
}, | ||
file: (path: string) => { | ||
return { | ||
read: (): Promise<string> => { | ||
return new Promise((resolve) => { | ||
resolve(''); | ||
}); | ||
}, | ||
close: () => {}, | ||
}; | ||
}, | ||
}; | ||
|
||
export interface FileInfo { | ||
entries?: Record<string, FileInfo>; | ||
} | ||
|
||
export const fsinfo = ( | ||
path: string, | ||
attributes: (keyof FileInfo)[], | ||
options: object | ||
): Promise<FileInfo> => { | ||
return new Promise((resolve) => { | ||
resolve({ | ||
entries: {}, | ||
}); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters