ControlProxy/backend/yjs/ShanxiRegistry.yjs

80 lines
3.2 KiB
Plaintext
Raw Normal View History

2023-07-11 14:57:57 +00:00
module ShanxiRegistry{
export function getAllRepoCount() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getAllRepoCount",arg).result;
2023-07-11 14:57:57 +00:00
}
export function getAllDoCount() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getAllDoCount",arg).result;
2023-07-11 14:57:57 +00:00
}
export function getAllSearchCount() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getAllSearchCount",arg).result;
2023-07-11 14:57:57 +00:00
}
export function getIndexStatistics() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getIndexStatistics",arg).result;
2023-07-11 14:57:57 +00:00
}
export function getRepoList() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getRepoList",arg).result;
2023-07-11 14:57:57 +00:00
}
export function pingRepo() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","pingRepo",arg).result;
2023-07-11 14:57:57 +00:00
}
export function addRepoToRegistry() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","addRepoToRegistry",arg).result;
2023-07-11 14:57:57 +00:00
}
export function deleteRepoList() {
return executeContract("ControlProxy","deleteRepoList",arg).result;
}
export function listDataRequirements() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","listDataRequirements",arg).result;
2023-07-11 14:57:57 +00:00
}
export function createDataRequirements() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","createDataRequirements",arg).result;
2023-07-11 14:57:57 +00:00
}
export function issueDataRequirement() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","issueDataRequirement",arg).result;
2023-07-11 14:57:57 +00:00
}
export function updateDataRequirements() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","updateDataRequirements",arg).result;
2023-07-11 14:57:57 +00:00
}
export function getDataRequirement() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getDataRequirement",arg).result;
2023-07-11 14:57:57 +00:00
}
export function deleteDataRequirements() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","deleteDataRequirements",arg).result;
2023-07-11 14:57:57 +00:00
}
2023-07-11 16:55:14 +00:00
export function getDoCount(arg) {
2023-07-23 18:05:09 +00:00
var ret = executeContract("ShanxiRegistry", "getDoCount", arg);
2023-07-11 16:55:14 +00:00
if (arg.indexOf("shanxi/Repository") != - 1)
ret.result.data.push({
"doId" : "shanxi/Repository", "count" : 3
});
return ret.result;
2023-07-11 14:57:57 +00:00
}
export function addSubRegistry() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","addSubRegistry",arg).result;
2023-07-11 14:57:57 +00:00
}
export function deleteSubRegistry() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","deleteSubRegistry",arg).result;
2023-07-11 14:57:57 +00:00
}
export function listSubRegistry() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","listSubRegistry",arg).result;
2023-07-11 14:57:57 +00:00
}
export function getRelationInfo() {
2023-07-23 18:05:09 +00:00
return executeContract("ShanxiRegistry","getRelationInfo",arg).result;
2023-07-11 14:57:57 +00:00
}
2023-07-11 16:55:14 +00:00
@ArgSchema({
"!params" : [{
"!type" : "string", "!keyword" : "integer"
}], "count" : "integer", "offset" : "integer"
})
export function search(arg) {
2023-07-11 14:57:57 +00:00
arg = convertArgToJson(arg);
2023-07-11 16:55:14 +00:00
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;
2023-07-23 18:05:09 +00:00
var res = executeContract("ShanxiRegistry", "search", arg);
2023-07-11 14:57:57 +00:00
return res.result;
}
}