ControlProxy/backend/yjs/ShanxiRegistry.yjs
2023-07-12 00:55:14 +08:00

80 lines
3.0 KiB
Plaintext

module ShanxiRegistry{
export function getAllRepoCount() {
return executeContract("Registry","getAllRepoCount",arg).result;
}
export function getAllDoCount() {
return executeContract("Registry","getAllDoCount",arg).result;
}
export function getAllSearchCount() {
return executeContract("Registry","getAllSearchCount",arg).result;
}
export function getIndexStatistics() {
return executeContract("Registry","getIndexStatistics",arg).result;
}
export function getRepoList() {
return executeContract("Registry","getRepoList",arg).result;
}
export function pingRepo() {
return executeContract("Registry","pingRepo",arg).result;
}
export function addRepoToRegistry() {
return executeContract("Registry","addRepoToRegistry",arg).result;
}
export function deleteRepoList() {
return executeContract("ControlProxy","deleteRepoList",arg).result;
}
export function listDataRequirements() {
return executeContract("Registry","listDataRequirements",arg).result;
}
export function createDataRequirements() {
return executeContract("Registry","createDataRequirements",arg).result;
}
export function issueDataRequirement() {
return executeContract("Registry","issueDataRequirement",arg).result;
}
export function updateDataRequirements() {
return executeContract("Registry","updateDataRequirements",arg).result;
}
export function getDataRequirement() {
return executeContract("Registry","getDataRequirement",arg).result;
}
export function deleteDataRequirements() {
return executeContract("Registry","deleteDataRequirements",arg).result;
}
export function getDoCount(arg) {
var ret = executeContract("Registry", "getDoCount", arg);
if (arg.indexOf("shanxi/Repository") != - 1)
ret.result.data.push({
"doId" : "shanxi/Repository", "count" : 3
});
return ret.result;
}
export function addSubRegistry() {
return executeContract("Registry","addSubRegistry",arg).result;
}
export function deleteSubRegistry() {
return executeContract("Registry","deleteSubRegistry",arg).result;
}
export function listSubRegistry() {
return executeContract("Registry","listSubRegistry",arg).result;
}
export function getRelationInfo() {
return executeContract("Registry","getRelationInfo",arg).result;
}
@ArgSchema({
"!params" : [{
"!type" : "string", "!keyword" : "integer"
}], "count" : "integer", "offset" : "integer"
})
export function search(arg) {
arg = convertArgToJson(arg);
var req = {"id":"","attributes":{},"body":""};
for (var i=0;i<arg.params.length;i++){
req.attributes[arg.params[i].type] = arg.params[i].keyword;
}
req.attributes["offset"] = arg.offset;
req.attributes["count"] = arg.count;
var res = executeContract("Registry", "search", arg);
return res.result;
}
}