Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBCOSS-298: Migration of Filesystem methods from cordova to capacitor #842

Merged
merged 11 commits into from
Feb 4, 2025
1 change: 1 addition & 0 deletions dist/1.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/content/impl/content-service-impl.d.ts
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ export declare class ContentServiceImpl implements ContentService, DownloadCompl
private handleUpdateSizeOnDeviceFail;
private get contentServiceDelegate();
downloadTranscriptFile(transcriptReq: any): Promise<string | undefined>;
createTranscriptDir(req: any, dataDirectory: any): Promise<string | void>;
createTranscriptDir(req: any, dataDirectory: any): Promise<string | undefined>;
downloadTranscript(downloadRequest: any): Observable<{
path: string;
}>;
4 changes: 3 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@project-sunbird/sunbird-sdk",
"version": "7.0.24",
"version": "7.0.26",
"description": "Heart of the sunbird mobile app.",
"main": "index.js",
"scripts": {
@@ -31,16 +31,16 @@
},
"peerDependencies": {
"@project-sunbird/client-services": "7.0.6",
"rxjs": ">=6",
"cordova-plugin-advanced-http": "^2.0.2",
"cordova-plugin-file": "8.0.1",
"cordova-plugin-android-downloadmanager": "git+https://github.com/Sunbird-Ed/sb-cordova-plugin-downloadmanager.git",
"cordova-plugin-awesome-shared-preferences": "^0.1.0",
"cordova-plugin-inappbrowser": "5.0.0",
"jjdltc-cordova-plugin-zip": "git+https://github.com/swayangjit/jjdltc-cordova-plugin-zip.git",
"rxjs": ">=6",
"sb-cordova-plugin-customtabs": "git+https://github.com/Sunbird-Ed/sb-cordova-plugin-customtabs.git",
"sb-cordova-plugin-db": "git+https://github.com/Sunbird-Ed/sb-cordova-plugin-db.git",
"jjdltc-cordova-plugin-zip": "git+https://github.com/swayangjit/jjdltc-cordova-plugin-zip.git",
"cordova-plugin-android-downloadmanager": "git+https://github.com/Sunbird-Ed/sb-cordova-plugin-downloadmanager.git",
"sb-cordova-plugin-utility": "git+https://github.com/Sunbird-Ed/sb-cordova-plugin-utility/tree/release-6.0.0"
"sb-cordova-plugin-utility": "git+https://github.com/Sunbird-Ed/sb-cordova-plugin-utility/tree/release-6.0.0",
"@capacitor/filesystem": "5.2.2"
},
"devDependencies": {
"@project-sunbird/client-services": "7.0.6",
6 changes: 6 additions & 0 deletions dist/services/file-path/file-path.enum.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export declare enum FilePaths {
DOCUMENTS = "documents",
CACHE = "cache",
ASSETS = "assets",
DATA = "data"
}
4 changes: 4 additions & 0 deletions dist/services/file-path/file-path.service.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { FilePaths } from './file-path.enum';
export declare class FilePathService {
static getFilePath(directory: FilePaths): Promise<string>;
}
76 changes: 63 additions & 13 deletions dist/util/file/def/file-service.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,71 @@
import { DirectoryEntry, Entry, FileEntry, Flags, IWriteOptions, Metadata, RemoveResult } from '../index';
import { FileInfo } from '@capacitor/filesystem';
import { DirectoryEntry, Flags, IWriteOptions, Metadata } from '../index';
export interface FileService {
readAsText(path: string, file: string): Promise<string>;
readAsBinaryString(path: string, file: string): Promise<string>;
readFileFromAssets(fileName: string): Promise<string>;
writeFile(path: string, fileName: string, text: string, options: IWriteOptions): Promise<string>;
createFile(path: string, fileName: string, replace: boolean): Promise<FileEntry>;
removeFile(path: string): Promise<RemoveResult>;
getFile(directoryEntry: DirectoryEntry, fileName: string, flags: Flags): Promise<FileEntry>;
createDir(path: string, replace: boolean): Promise<DirectoryEntry>;
listDir(directoryPath: string): Promise<Entry[]>;
removeDir(path: string, dirName: string): Promise<RemoveResult>;
removeRecursively(path: string): Promise<RemoveResult>;
copyDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<Entry>;
copyFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<Entry>;
writeFile(path: string, fileName: string, text: string, options: IWriteOptions): Promise<{
success: boolean;
}>;
createFile(path: string, fileName: string, replace: boolean): Promise<{
success: boolean;
uri: string;
}>;
removeFile(path: string): Promise<{
success: boolean;
}>;
getFile(directoryEntry: DirectoryEntry, fileName: string, flags: Flags): Promise<{
isFile: boolean;
isDirectory: boolean;
name: string;
fullPath: string;
nativeURL: string;
}>;
createDir(path: string, replace: boolean): Promise<{
isFile: boolean;
isDirectory: boolean;
name: string;
fullPath: string;
nativeURL: string;
}>;
listDir(directoryPath: string): Promise<{
isFile: boolean;
isDirectory: boolean;
name: FileInfo;
fullPath: string;
filesystem: string;
nativeURL: string;
remove?: () => Promise<void>;
}[]>;
removeDir(path: string, dirName: string): Promise<{
success: boolean;
}>;
removeRecursively(path: string): Promise<{
success: boolean;
}>;
copyDir(path: string, dirName: string, newPath: string, newDirName: string): Promise<{
isFile: boolean;
isDirectory: boolean;
name: string;
fullPath: string;
nativeURL: string;
}>;
copyFile(path: string, fileName: string, newPath: string, newFileName: string): Promise<{
isFile: boolean;
isDirectory: boolean;
name: string;
fullPath: string;
nativeURL: string;
}>;
getMetaData(path: string): Promise<Metadata>;
exists(path: string): Promise<Entry>;
getTempLocation(destinationPath: string): Promise<DirectoryEntry>;
exists(path: string): Promise<{
exists: boolean;
nativeURL?: string;
}>;
getTempLocation(destinationPath: string): Promise<{
path: string;
nativeURL: string;
}>;
getFreeDiskSpace(): Promise<number>;
getDirectorySize(path: string): Promise<number>;
}
Loading