UNPKG

1.3 kBJavaScriptView Raw
1var e=require("dr-js/library/node/module/Option/preset")
2var t=require("../library/feature/Explorer/task/pathAction")
3const{pickOneOf:a,parseCompact:o,parseCompactList:l}=e.Preset
4const i=o("node-auth-file/SP,O",l("node-auth-key/SS,O",["node-file-upload,nfu/T",l("file-upload-server-url/SS","file-upload-key/SS","file-upload-path/SP")],["node-file-download,nfd/T",l("file-download-server-url/SS","file-download-key/SS","file-download-path/SP")],["node-path-action,npa/T",l("path-action-server-url/SS",["path-action-type",a(Object.values(t.PATH_ACTION_TYPE))],"path-action-key/SS,O","path-action-key-to/SS,O","path-action-name-list/AS,O")]))
5exports.ExplorerClientFormatConfig=i
6exports.getExplorerClientOption=({tryGet:e,getFirst:t,tryGetFirst:a})=>Object.assign({authFile:a("node-auth-file"),authKey:a("node-auth-key")},e("node-file-upload")?{fileInputPath:t("file-upload-path"),key:t("file-upload-key"),urlFileUpload:t("file-upload-server-url")}:null,{},e("node-file-download")?{fileOutputPath:t("file-download-path"),key:t("file-download-key"),urlFileDownload:t("file-download-server-url")}:null,{},e("node-path-action")?{nameList:e("path-action-name-list"),actionType:t("path-action-type"),key:a("path-action-key"),keyTo:a("path-action-key-to"),urlPathAction:t("path-action-server-url")}:null)