Skip to content

Commit

Permalink
feat(operations-list-flow): list the given remote and path
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 21, 2020
1 parent 10ded57 commit 6bf2bcf
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/@dataflow/rclone/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './post-flow';
export * from './noop-auth-flow';
export * from './core-stats-flow';
export * from './list-remotes-flow';
export * from './operations-list-flow';
51 changes: 51 additions & 0 deletions src/app/@dataflow/rclone/operations-list-flow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { PostFlow } from './post-flow';
import { AjaxFlowInteralNode, CombErr } from '../core';
import { NavigationFLowOutNode, IRcloneServer } from '../extra';

export interface OperationsListFlowParmsNode {
fs: string;
remote: string;
opt?: {
recurse?: boolean;
noModTime?: boolean;
showEncrypted?: boolean;
showOrigIDs?: boolean;
showHash?: boolean;
};
}

export interface OperationsListFlowInNode extends NavigationFLowOutNode, IRcloneServer {}

export interface OperationsListFlowOutItemNode {
Path: string;
Name: string;
Size: number;
MimeType: string;
ModTime: string;
IsDir: false;
Hashes: {
MD5: string;
};
ID: string;
OrigID: string;
}

export interface OperationsListFlowOutNode {
list: OperationsListFlowOutItemNode[];
}

export abstract class OperationsListFlow extends PostFlow<
OperationsListFlowInNode,
OperationsListFlowOutNode,
OperationsListFlowParmsNode
> {
// public prerequest$: Observable<CombErr<OperationsListFlowInNode>>;
// protected params: OperationsListFlowParmsNode | ((pre: CombErr<OperationsListFlowInNode>) => OperationsListFlowParmsNode);
protected cmd: string = 'operations/list';
protected cacheSupport: boolean = true;
protected reconstructAjaxResult(x: AjaxFlowInteralNode): CombErr<OperationsListFlowOutNode> {
if (x[1].length !== 0) return [{}, x[1]] as any;
const rsp = x[0].ajaxRsp.response;
return [{ list: rsp['list'] }, []];
}
}

0 comments on commit 6bf2bcf

Please sign in to comment.