1from pysearpc import searpc_func, SearpcError, NamedPipeClient 2 3class SeafServerThreadedRpcClient(NamedPipeClient): 4 5 def __init__(self, pipe_path): 6 NamedPipeClient.__init__(self, pipe_path, "seafserv-threaded-rpcserver") 7 8 # repo manipulation 9 @searpc_func("string", ["string", "string", "string", "string", "int"]) 10 def seafile_create_repo(name, desc, owner_email, passwd, enc_version): 11 pass 12 create_repo = seafile_create_repo 13 14 @searpc_func("string", ["string", "string", "string", "string", "string", "string", "string", "int"]) 15 def seafile_create_enc_repo(repo_id, name, desc, owner_email, magic, random_key, salt, enc_version): 16 pass 17 create_enc_repo = seafile_create_enc_repo 18 19 @searpc_func("object", ["string"]) 20 def seafile_get_repo(repo_id): 21 pass 22 get_repo = seafile_get_repo 23 24 @searpc_func("int", ["string"]) 25 def seafile_destroy_repo(repo_id): 26 pass 27 remove_repo = seafile_destroy_repo 28 29 @searpc_func("objlist", ["int", "int"]) 30 def seafile_get_repo_list(start, limit, order_by): 31 pass 32 get_repo_list = seafile_get_repo_list 33 34 @searpc_func("int64", []) 35 def seafile_count_repos(): 36 pass 37 count_repos = seafile_count_repos 38 39 @searpc_func("int", ["string", "string", "string", "string"]) 40 def seafile_edit_repo(repo_id, name, description, user): 41 pass 42 edit_repo = seafile_edit_repo 43 44 @searpc_func("int", ["string", "string"]) 45 def seafile_is_repo_owner(user_id, repo_id): 46 pass 47 is_repo_owner = seafile_is_repo_owner 48 49 @searpc_func("int", ["string", "string"]) 50 def seafile_set_repo_owner(email, repo_id): 51 pass 52 set_repo_owner = seafile_set_repo_owner 53 54 @searpc_func("string", ["string"]) 55 def seafile_get_repo_owner(repo_id): 56 pass 57 get_repo_owner = seafile_get_repo_owner 58 59 @searpc_func("objlist", []) 60 def seafile_get_orphan_repo_list(): 61 pass 62 get_orphan_repo_list = seafile_get_orphan_repo_list 63 64 @searpc_func("objlist", ["string", "int", "int", "int"]) 65 def seafile_list_owned_repos(user_id, ret_corrupted, start, limit): 66 pass 67 list_owned_repos = seafile_list_owned_repos 68 69 @searpc_func("objlist", ["string"]) 70 def seafile_search_repos_by_name(name): 71 pass 72 search_repos_by_name = seafile_search_repos_by_name 73 74 @searpc_func("int64", ["string"]) 75 def seafile_server_repo_size(repo_id): 76 pass 77 server_repo_size = seafile_server_repo_size 78 79 @searpc_func("int", ["string", "string"]) 80 def seafile_repo_set_access_property(repo_id, role): 81 pass 82 repo_set_access_property = seafile_repo_set_access_property 83 84 @searpc_func("string", ["string"]) 85 def seafile_repo_query_access_property(repo_id): 86 pass 87 repo_query_access_property = seafile_repo_query_access_property 88 89 @searpc_func("int", ["string", "string", "string"]) 90 def seafile_revert_on_server(repo_id, commit_id, user_name): 91 pass 92 revert_on_server = seafile_revert_on_server 93 94 @searpc_func("objlist", ["string", "string", "string"]) 95 def seafile_diff(): 96 pass 97 get_diff = seafile_diff 98 99 @searpc_func("int", ["string", "string", "string", "string", "string"]) 100 def seafile_post_file(repo_id, tmp_file_path, parent_dir, filename, user): 101 pass 102 post_file = seafile_post_file 103 104 @searpc_func("int", ["string", "string", "string", "string"]) 105 def seafile_post_dir(repo_id, parent_dir, new_dir_name, user): 106 pass 107 post_dir = seafile_post_dir 108 109 @searpc_func("int", ["string", "string", "string", "string"]) 110 def seafile_post_empty_file(repo_id, parent_dir, filename, user): 111 pass 112 post_empty_file = seafile_post_empty_file 113 114 @searpc_func("int", ["string", "string", "string", "string", "string", "string"]) 115 def seafile_put_file(repo_id, tmp_file_path, parent_dir, filename, user, head_id): 116 pass 117 put_file = seafile_put_file 118 119 @searpc_func("int", ["string", "string", "string", "string"]) 120 def seafile_del_file(repo_id, parent_dir, filename, user): 121 pass 122 del_file = seafile_del_file 123 124 @searpc_func("object", ["string", "string", "string", "string", "string", "string", "string", "int", "int"]) 125 def seafile_copy_file(src_repo, src_dir, src_filename, dst_repo, dst_dir, dst_filename, user, need_progress, synchronous): 126 pass 127 copy_file = seafile_copy_file 128 129 @searpc_func("object", ["string", "string", "string", "string", "string", "string", "int", "string", "int", "int"]) 130 def seafile_move_file(src_repo, src_dir, src_filename, dst_repo, dst_dir, dst_filename, replace, user, need_progress, synchronous): 131 pass 132 move_file = seafile_move_file 133 134 @searpc_func("int", ["string", "string", "string", "string", "string"]) 135 def seafile_rename_file(repo_id, parent_dir, oldname, newname, user): 136 pass 137 rename_file = seafile_rename_file 138 139 @searpc_func("int", ["string", "string"]) 140 def seafile_is_valid_filename(repo_id, filename): 141 pass 142 is_valid_filename = seafile_is_valid_filename 143 144 @searpc_func("object", ["string", "int", "string"]) 145 def seafile_get_commit(repo_id, version, commit_id): 146 pass 147 get_commit = seafile_get_commit 148 149 @searpc_func("string", ["string", "string", "int", "int"]) 150 def seafile_list_file_blocks(repo_id, file_id, offset, limit): 151 pass 152 list_file_blocks = seafile_list_file_blocks 153 154 @searpc_func("objlist", ["string", "string", "int", "int"]) 155 def seafile_list_dir(repo_id, dir_id, offset, limit): 156 pass 157 list_dir = seafile_list_dir 158 159 @searpc_func("objlist", ["string", "string", "sting", "string", "int", "int"]) 160 def list_dir_with_perm(repo_id, dir_path, dir_id, user, offset, limit): 161 pass 162 163 @searpc_func("int64", ["string", "int", "string"]) 164 def seafile_get_file_size(store_id, version, file_id): 165 pass 166 get_file_size = seafile_get_file_size 167 168 @searpc_func("int64", ["string", "int", "string"]) 169 def seafile_get_dir_size(store_id, version, dir_id): 170 pass 171 get_dir_size = seafile_get_dir_size 172 173 @searpc_func("objlist", ["string", "string", "string"]) 174 def seafile_list_dir_by_path(repo_id, commit_id, path): 175 pass 176 list_dir_by_path = seafile_list_dir_by_path 177 178 @searpc_func("string", ["string", "string", "string"]) 179 def seafile_get_dir_id_by_commit_and_path(repo_id, commit_id, path): 180 pass 181 get_dir_id_by_commit_and_path = seafile_get_dir_id_by_commit_and_path 182 183 @searpc_func("string", ["string", "string"]) 184 def seafile_get_file_id_by_path(repo_id, path): 185 pass 186 get_file_id_by_path = seafile_get_file_id_by_path 187 188 @searpc_func("string", ["string", "string"]) 189 def seafile_get_dir_id_by_path(repo_id, path): 190 pass 191 get_dir_id_by_path = seafile_get_dir_id_by_path 192 193 @searpc_func("string", ["string", "string", "string"]) 194 def seafile_get_file_id_by_commit_and_path(repo_id, commit_id, path): 195 pass 196 get_file_id_by_commit_and_path = seafile_get_file_id_by_commit_and_path 197 198 @searpc_func("object", ["string", "string"]) 199 def seafile_get_dirent_by_path(repo_id, commit_id, path): 200 pass 201 get_dirent_by_path = seafile_get_dirent_by_path 202 203 @searpc_func("objlist", ["string", "string", "string", "int"]) 204 def seafile_list_file_revisions(repo_id, commit_id, path, limit): 205 pass 206 list_file_revisions = seafile_list_file_revisions 207 208 @searpc_func("objlist", ["string", "string"]) 209 def seafile_calc_files_last_modified(repo_id, parent_dir, limit): 210 pass 211 calc_files_last_modified = seafile_calc_files_last_modified 212 213 @searpc_func("int", ["string", "string", "string", "string"]) 214 def seafile_revert_file(repo_id, commit_id, path, user): 215 pass 216 revert_file = seafile_revert_file 217 218 @searpc_func("string", ["string", "string"]) 219 def seafile_check_repo_blocks_missing(repo_id, blklist): 220 pass 221 check_repo_blocks_missing = seafile_check_repo_blocks_missing 222 223 @searpc_func("int", ["string", "string", "string", "string"]) 224 def seafile_revert_dir(repo_id, commit_id, path, user): 225 pass 226 revert_dir = seafile_revert_dir 227 228 @searpc_func("objlist", ["string", "int", "string", "string", "int"]) 229 def get_deleted(repo_id, show_days, path, scan_stat, limit): 230 pass 231 232 # share repo to user 233 @searpc_func("string", ["string", "string", "string", "string"]) 234 def seafile_add_share(repo_id, from_email, to_email, permission): 235 pass 236 add_share = seafile_add_share 237 238 @searpc_func("objlist", ["string", "string", "int", "int"]) 239 def seafile_list_share_repos(email, query_col, start, limit): 240 pass 241 list_share_repos = seafile_list_share_repos 242 243 @searpc_func("objlist", ["string", "string"]) 244 def seafile_list_repo_shared_to(from_user, repo_id): 245 pass 246 list_repo_shared_to = seafile_list_repo_shared_to 247 248 @searpc_func("string", ["string", "string", "string", "string", "string", "string"]) 249 def share_subdir_to_user(repo_id, path, owner, share_user, permission, passwd): 250 pass 251 252 @searpc_func("int", ["string", "string", "string", "string"]) 253 def unshare_subdir_for_user(repo_id, path, owner, share_user): 254 pass 255 256 @searpc_func("int", ["string", "string", "string", "string", "string"]) 257 def update_share_subdir_perm_for_user(repo_id, path, owner, share_user, permission): 258 pass 259 260 @searpc_func("object", ["string", "string", "string", "int"]) 261 def get_shared_repo_by_path(repo_id, path, shared_to, is_org): 262 pass 263 264 @searpc_func("objlist", ["int", "string", "string", "int", "int"]) 265 def seafile_list_org_share_repos(org_id, email, query_col, start, limit): 266 pass 267 list_org_share_repos = seafile_list_org_share_repos 268 269 @searpc_func("int", ["string", "string", "string"]) 270 def seafile_remove_share(repo_id, from_email, to_email): 271 pass 272 remove_share = seafile_remove_share 273 274 @searpc_func("int", ["string", "string", "string", "string"]) 275 def set_share_permission(repo_id, from_email, to_email, permission): 276 pass 277 278 # share repo to group 279 @searpc_func("int", ["string", "int", "string", "string"]) 280 def seafile_group_share_repo(repo_id, group_id, user_name, permisson): 281 pass 282 group_share_repo = seafile_group_share_repo 283 284 @searpc_func("int", ["string", "int", "string"]) 285 def seafile_group_unshare_repo(repo_id, group_id, user_name): 286 pass 287 group_unshare_repo = seafile_group_unshare_repo 288 289 @searpc_func("string", ["string"]) 290 def seafile_get_shared_groups_by_repo(repo_id): 291 pass 292 get_shared_groups_by_repo=seafile_get_shared_groups_by_repo 293 294 @searpc_func("objlist", ["string", "string"]) 295 def seafile_list_repo_shared_group(from_user, repo_id): 296 pass 297 list_repo_shared_group = seafile_list_repo_shared_group 298 299 @searpc_func("object", ["string", "string", "int", "int"]) 300 def get_group_shared_repo_by_path(repo_id, path, group_id, is_org): 301 pass 302 303 @searpc_func("objlist", ["string"]) 304 def get_group_repos_by_user (user): 305 pass 306 307 @searpc_func("objlist", ["string", "int"]) 308 def get_org_group_repos_by_user (user, org_id): 309 pass 310 311 @searpc_func("objlist", ["string", "string", "string"]) 312 def seafile_get_shared_users_for_subdir(repo_id, path, from_user): 313 pass 314 get_shared_users_for_subdir = seafile_get_shared_users_for_subdir 315 316 @searpc_func("objlist", ["string", "string", "string"]) 317 def seafile_get_shared_groups_for_subdir(repo_id, path, from_user): 318 pass 319 get_shared_groups_for_subdir = seafile_get_shared_groups_for_subdir 320 321 @searpc_func("string", ["string", "string", "string", "int", "string", "string"]) 322 def share_subdir_to_group(repo_id, path, owner, share_group, permission, passwd): 323 pass 324 325 @searpc_func("int", ["string", "string", "string", "int"]) 326 def unshare_subdir_for_group(repo_id, path, owner, share_group): 327 pass 328 329 @searpc_func("int", ["string", "string", "string", "int", "string"]) 330 def update_share_subdir_perm_for_group(repo_id, path, owner, share_group, permission): 331 pass 332 333 @searpc_func("string", ["int"]) 334 def seafile_get_group_repoids(group_id): 335 pass 336 get_group_repoids = seafile_get_group_repoids 337 338 @searpc_func("objlist", ["int"]) 339 def seafile_get_repos_by_group(group_id): 340 pass 341 get_repos_by_group = seafile_get_repos_by_group 342 343 @searpc_func("objlist", ["string"]) 344 def get_group_repos_by_owner(user_name): 345 pass 346 347 @searpc_func("string", ["string"]) 348 def get_group_repo_owner(repo_id): 349 pass 350 351 @searpc_func("int", ["int", "string"]) 352 def seafile_remove_repo_group(group_id, user_name): 353 pass 354 remove_repo_group = seafile_remove_repo_group 355 356 @searpc_func("int", ["int", "string", "string"]) 357 def set_group_repo_permission(group_id, repo_id, permission): 358 pass 359 360 # branch and commit 361 @searpc_func("objlist", ["string"]) 362 def seafile_branch_gets(repo_id): 363 pass 364 branch_gets = seafile_branch_gets 365 366 @searpc_func("objlist", ["string", "int", "int"]) 367 def seafile_get_commit_list(repo_id, offset, limit): 368 pass 369 get_commit_list = seafile_get_commit_list 370 371 372 ###### Token #################### 373 374 @searpc_func("int", ["string", "string", "string"]) 375 def seafile_set_repo_token(repo_id, email, token): 376 pass 377 set_repo_token = seafile_set_repo_token 378 379 @searpc_func("string", ["string", "string"]) 380 def seafile_get_repo_token_nonnull(repo_id, email): 381 """Get the token of the repo for the email user. If the token does not 382 exist, a new one is generated and returned. 383 384 """ 385 pass 386 get_repo_token_nonnull = seafile_get_repo_token_nonnull 387 388 389 @searpc_func("string", ["string", "string"]) 390 def seafile_generate_repo_token(repo_id, email): 391 pass 392 generate_repo_token = seafile_generate_repo_token 393 394 @searpc_func("int", ["string", "string"]) 395 def seafile_delete_repo_token(repo_id, token, user): 396 pass 397 delete_repo_token = seafile_delete_repo_token 398 399 @searpc_func("objlist", ["string"]) 400 def seafile_list_repo_tokens(repo_id): 401 pass 402 list_repo_tokens = seafile_list_repo_tokens 403 404 @searpc_func("objlist", ["string"]) 405 def seafile_list_repo_tokens_by_email(email): 406 pass 407 list_repo_tokens_by_email = seafile_list_repo_tokens_by_email 408 409 @searpc_func("int", ["string", "string"]) 410 def seafile_delete_repo_tokens_by_peer_id(email, user_id): 411 pass 412 delete_repo_tokens_by_peer_id = seafile_delete_repo_tokens_by_peer_id 413 414 @searpc_func("int", ["string"]) 415 def delete_repo_tokens_by_email(email): 416 pass 417 418 ###### quota ########## 419 @searpc_func("int64", ["string"]) 420 def seafile_get_user_quota_usage(user_id): 421 pass 422 get_user_quota_usage = seafile_get_user_quota_usage 423 424 @searpc_func("int64", ["string"]) 425 def seafile_get_user_share_usage(user_id): 426 pass 427 get_user_share_usage = seafile_get_user_share_usage 428 429 @searpc_func("int64", ["int"]) 430 def seafile_get_org_quota_usage(org_id): 431 pass 432 get_org_quota_usage = seafile_get_org_quota_usage 433 434 @searpc_func("int64", ["int", "string"]) 435 def seafile_get_org_user_quota_usage(org_id, user): 436 pass 437 get_org_user_quota_usage = seafile_get_org_user_quota_usage 438 439 @searpc_func("int", ["string", "int64"]) 440 def set_user_quota(user, quota): 441 pass 442 443 @searpc_func("int64", ["string"]) 444 def get_user_quota(user): 445 pass 446 447 @searpc_func("int", ["int", "int64"]) 448 def set_org_quota(org_id, quota): 449 pass 450 451 @searpc_func("int64", ["int"]) 452 def get_org_quota(org_id): 453 pass 454 455 @searpc_func("int", ["int", "string", "int64"]) 456 def set_org_user_quota(org_id, user, quota): 457 pass 458 459 @searpc_func("int64", ["int", "string"]) 460 def get_org_user_quota(org_id, user): 461 pass 462 463 @searpc_func("int", ["string", "int64"]) 464 def check_quota(repo_id, delta): 465 pass 466 467 @searpc_func("objlist", []) 468 def list_user_quota_usage(): 469 pass 470 471 # password management 472 @searpc_func("int", ["string", "string"]) 473 def seafile_check_passwd(repo_id, magic): 474 pass 475 check_passwd = seafile_check_passwd 476 477 @searpc_func("int", ["string", "string", "string"]) 478 def seafile_set_passwd(repo_id, user, passwd): 479 pass 480 set_passwd = seafile_set_passwd 481 482 @searpc_func("int", ["string", "string"]) 483 def seafile_unset_passwd(repo_id, user): 484 pass 485 unset_passwd = seafile_unset_passwd 486 487 # repo permission checking 488 @searpc_func("string", ["string", "string"]) 489 def check_permission(repo_id, user): 490 pass 491 492 # folder permission check 493 @searpc_func("string", ["string", "string", "string"]) 494 def check_permission_by_path(repo_id, path, user): 495 pass 496 497 # org repo 498 @searpc_func("string", ["string", "string", "string", "string", "string", "int", "int"]) 499 def seafile_create_org_repo(name, desc, user, passwd, magic, random_key, enc_version, org_id): 500 pass 501 create_org_repo = seafile_create_org_repo 502 503 @searpc_func("int", ["string"]) 504 def seafile_get_org_id_by_repo_id(repo_id): 505 pass 506 get_org_id_by_repo_id = seafile_get_org_id_by_repo_id 507 508 @searpc_func("objlist", ["int", "int", "int"]) 509 def seafile_get_org_repo_list(org_id, start, limit): 510 pass 511 get_org_repo_list = seafile_get_org_repo_list 512 513 @searpc_func("int", ["int"]) 514 def seafile_remove_org_repo_by_org_id(org_id): 515 pass 516 remove_org_repo_by_org_id = seafile_remove_org_repo_by_org_id 517 518 @searpc_func("objlist", ["int", "string"]) 519 def list_org_repos_by_owner(org_id, user): 520 pass 521 522 @searpc_func("string", ["string"]) 523 def get_org_repo_owner(repo_id): 524 pass 525 526 # org group repo 527 @searpc_func("int", ["string", "int", "int", "string", "string"]) 528 def add_org_group_repo(repo_id, org_id, group_id, owner, permission): 529 pass 530 531 @searpc_func("int", ["string", "int", "int"]) 532 def del_org_group_repo(repo_id, org_id, group_id): 533 pass 534 535 @searpc_func("string", ["int", "int"]) 536 def get_org_group_repoids(org_id, group_id): 537 pass 538 539 @searpc_func("string", ["int", "int", "string"]) 540 def get_org_group_repo_owner(org_id, group_id, repo_id): 541 pass 542 543 @searpc_func("objlist", ["int", "string"]) 544 def get_org_group_repos_by_owner(org_id, user): 545 pass 546 547 @searpc_func("string", ["int", "string"]) 548 def get_org_groups_by_repo(org_id, repo_id): 549 pass 550 551 @searpc_func("int", ["int", "int", "string", "string"]) 552 def set_org_group_repo_permission(org_id, group_id, repo_id, permission): 553 pass 554 555 # inner pub repo 556 @searpc_func("int", ["string", "string"]) 557 def set_inner_pub_repo(repo_id, permission): 558 pass 559 560 @searpc_func("int", ["string"]) 561 def unset_inner_pub_repo(repo_id): 562 pass 563 564 @searpc_func("objlist", []) 565 def list_inner_pub_repos(): 566 pass 567 568 @searpc_func("objlist", ["string"]) 569 def list_inner_pub_repos_by_owner(user): 570 pass 571 572 @searpc_func("int64", []) 573 def count_inner_pub_repos(): 574 pass 575 576 @searpc_func("int", ["string"]) 577 def is_inner_pub_repo(repo_id): 578 pass 579 580 # org inner pub repo 581 @searpc_func("int", ["int", "string", "string"]) 582 def set_org_inner_pub_repo(org_id, repo_id, permission): 583 pass 584 585 @searpc_func("int", ["int", "string"]) 586 def unset_org_inner_pub_repo(org_id, repo_id): 587 pass 588 589 @searpc_func("objlist", ["int"]) 590 def list_org_inner_pub_repos(org_id): 591 pass 592 593 @searpc_func("objlist", ["int", "string"]) 594 def list_org_inner_pub_repos_by_owner(org_id, user): 595 pass 596 597 @searpc_func("int", ["string", "int"]) 598 def set_repo_history_limit(repo_id, days): 599 pass 600 601 @searpc_func("int", ["string"]) 602 def get_repo_history_limit(repo_id): 603 pass 604 605 # virtual repo 606 @searpc_func("string", ["string", "string", "string", "string", "string", "string"]) 607 def create_virtual_repo(origin_repo_id, path, repo_name, repo_desc, owner, passwd=''): 608 pass 609 610 @searpc_func("objlist", ["string"]) 611 def get_virtual_repos_by_owner(owner): 612 pass 613 614 @searpc_func("object", ["string", "string", "string"]) 615 def get_virtual_repo(origin_repo, path, owner): 616 pass 617 618 # system default library 619 @searpc_func("string", []) 620 def get_system_default_repo_id(): 621 pass 622 623 # Change password 624 @searpc_func("int", ["string", "string", "string", "string"]) 625 def seafile_change_repo_passwd(repo_id, old_passwd, new_passwd, user): 626 pass 627 change_repo_passwd = seafile_change_repo_passwd 628 629 # Clean trash 630 @searpc_func("int", ["string", "int"]) 631 def clean_up_repo_history(repo_id, keep_days): 632 pass 633 634 # Trashed repos 635 @searpc_func("objlist", ["int", "int"]) 636 def get_trash_repo_list(start, limit): 637 pass 638 639 @searpc_func("int", ["string"]) 640 def del_repo_from_trash(repo_id): 641 pass 642 643 @searpc_func("int", ["string"]) 644 def restore_repo_from_trash(repo_id): 645 pass 646 647 @searpc_func("objlist", ["string"]) 648 def get_trash_repos_by_owner(owner): 649 pass 650 651 @searpc_func("int", []) 652 def empty_repo_trash(): 653 pass 654 655 @searpc_func("int", ["string"]) 656 def empty_repo_trash_by_owner(owner): 657 pass 658 659 @searpc_func("object", ["string"]) 660 def empty_repo_trash_by_owner(owner): 661 pass 662 663 @searpc_func("object", ["int", "string", "string"]) 664 def generate_magic_and_random_key(enc_version, repo_id, password): 665 pass 666 667 @searpc_func("int64", []) 668 def get_total_file_number(): 669 pass 670 671 @searpc_func("int64", []) 672 def get_total_storage(): 673 pass 674 675 @searpc_func("object", ["string", "string"]) 676 def get_file_count_info_by_path(repo_id, path): 677 pass 678 679 @searpc_func("string", ["string"]) 680 def get_trash_repo_owner(repo_id): 681 pass 682 683 @searpc_func("int64", ["string", "string"]) 684 def seafile_get_upload_tmp_file_offset(repo_id, file_path): 685 pass 686 get_upload_tmp_file_offset = seafile_get_upload_tmp_file_offset 687 688 @searpc_func("int", ["string", "string", "string", "string"]) 689 def seafile_mkdir_with_parents (repo_id, parent_dir, relative_path, username): 690 pass 691 mkdir_with_parents = seafile_mkdir_with_parents 692 693 @searpc_func("int", ["string", "string"]) 694 def get_server_config_int (group, key): 695 pass 696 697 @searpc_func("int", ["string", "string", "int"]) 698 def set_server_config_int (group, key, value): 699 pass 700 701 @searpc_func("int64", ["string", "string"]) 702 def get_server_config_int64 (group, key): 703 pass 704 705 @searpc_func("int", ["string", "string", "int64"]) 706 def set_server_config_int64 (group, key, value): 707 pass 708 709 @searpc_func("string", ["string", "string"]) 710 def get_server_config_string (group, key): 711 pass 712 713 @searpc_func("int", ["string", "string", "string"]) 714 def set_server_config_string (group, key, value): 715 pass 716 717 @searpc_func("int", ["string", "string"]) 718 def get_server_config_boolean (group, key): 719 pass 720 721 @searpc_func("int", ["string", "string", "int"]) 722 def set_server_config_boolean (group, key, value): 723 pass 724 725 @searpc_func("int", ["string", "int"]) 726 def repo_has_been_shared (repo_id, including_groups): 727 pass 728 729 @searpc_func("objlist", ["string"]) 730 def get_shared_users_by_repo (repo_id): 731 pass 732 733 @searpc_func("objlist", ["int", "string"]) 734 def org_get_shared_users_by_repo (org_id, repo_id): 735 pass 736 737 @searpc_func("string", ["string", "string", "string", "int"]) 738 def convert_repo_path(repo_id, path, user, is_org): 739 pass 740 741 # repo status 742 @searpc_func("int", ["string", "int"]) 743 def set_repo_status(repo_id, status): 744 pass 745 746 @searpc_func("int", ["string"]) 747 def get_repo_status(repo_id): 748 pass 749 750 # token for web access to repo 751 @searpc_func("string", ["string", "string", "string", "string", "int"]) 752 def seafile_web_get_access_token(repo_id, obj_id, op, username, use_onetime=1): 753 pass 754 web_get_access_token = seafile_web_get_access_token 755 756 @searpc_func("object", ["string"]) 757 def seafile_web_query_access_token(token): 758 pass 759 web_query_access_token = seafile_web_query_access_token 760 761 @searpc_func("string", ["string"]) 762 def seafile_query_zip_progress(token): 763 pass 764 query_zip_progress = seafile_query_zip_progress 765 766 @searpc_func("int", ["string"]) 767 def cancel_zip_task(token): 768 pass 769 770 ###### GC #################### 771 @searpc_func("int", []) 772 def seafile_gc(): 773 pass 774 gc = seafile_gc 775 776 @searpc_func("int", []) 777 def seafile_gc_get_progress(): 778 pass 779 gc_get_progress = seafile_gc_get_progress 780 781 # password management 782 @searpc_func("int", ["string", "string"]) 783 def seafile_is_passwd_set(repo_id, user): 784 pass 785 is_passwd_set = seafile_is_passwd_set 786 787 @searpc_func("object", ["string", "string"]) 788 def seafile_get_decrypt_key(repo_id, user): 789 pass 790 get_decrypt_key = seafile_get_decrypt_key 791 792 # Copy tasks 793 794 @searpc_func("object", ["string"]) 795 def get_copy_task(task_id): 796 pass 797 798 @searpc_func("int", ["string"]) 799 def cancel_copy_task(task_id): 800 pass 801 802 # event 803 @searpc_func("int", ["string", "string"]) 804 def publish_event(channel, content): 805 pass 806 807 @searpc_func("json", ["string"]) 808 def pop_event(channel): 809 pass 810 811 @searpc_func("objlist", ["string", "string"]) 812 def search_files(self, repo_id, search_str): 813 pass 814 815 #user management 816 @searpc_func("int", ["string", "string", "int", "int"]) 817 def add_emailuser(self, email, passwd, is_staff, is_active): 818 pass 819 820 @searpc_func("int", ["string", "string"]) 821 def remove_emailuser(self, source, email): 822 pass 823 824 @searpc_func("int", ["string", "string"]) 825 def validate_emailuser(self, email, passwd): 826 pass 827 828 @searpc_func("object", ["string"]) 829 def get_emailuser(self, email): 830 pass 831 832 @searpc_func("object", ["string"]) 833 def get_emailuser_with_import(self, email): 834 pass 835 836 @searpc_func("object", ["int"]) 837 def get_emailuser_by_id(self, user_id): 838 pass 839 840 @searpc_func("objlist", ["string", "int", "int", "string"]) 841 def get_emailusers(self, source, start, limit, status): 842 pass 843 844 @searpc_func("objlist", ["string", "string", "int", "int"]) 845 def search_emailusers(self, source, email_patt, start, limit): 846 pass 847 848 @searpc_func("objlist", ["string", "int", "int"]) 849 def search_ldapusers(self, keyword, start, limit): 850 pass 851 852 @searpc_func("int64", ["string"]) 853 def count_emailusers(self, source): 854 pass 855 856 @searpc_func("int64", ["string"]) 857 def count_inactive_emailusers(self, source): 858 pass 859 860 @searpc_func("objlist", ["string"]) 861 def filter_emailusers_by_emails(self): 862 pass 863 864 @searpc_func("int", ["string", "int", "string", "int", "int"]) 865 def update_emailuser(self, source, user_id, password, is_staff, is_active): 866 pass 867 868 @searpc_func("int", ["string", "string"]) 869 def update_role_emailuser(self, email, role): 870 pass 871 872 @searpc_func("objlist", []) 873 def get_superusers(self): 874 pass 875 876 @searpc_func("objlist", ["string", "string"]) 877 def get_emailusers_in_list(self, source, user_list): 878 pass 879 880 @searpc_func("int", ["string", "string"]) 881 def update_emailuser_id (self, old_email, new_email): 882 pass 883 884 #group management 885 @searpc_func("int", ["string", "string", "string", "int"]) 886 def create_group(self, group_name, user_name, gtype, parent_group_id): 887 pass 888 889 @searpc_func("int", ["int", "string", "string", "int"]) 890 def create_org_group(self, org_id, group_name, user_name, parent_group_id): 891 pass 892 893 @searpc_func("int", ["int"]) 894 def remove_group(self, group_id): 895 pass 896 897 @searpc_func("int", ["int", "string", "string"]) 898 def group_add_member(self, group_id, user_name, member_name): 899 pass 900 901 @searpc_func("int", ["int", "string", "string"]) 902 def group_remove_member(self, group_id, user_name, member_name): 903 pass 904 905 @searpc_func("int", ["int", "string"]) 906 def group_set_admin(self, group_id, member_name): 907 pass 908 909 @searpc_func("int", ["int", "string"]) 910 def group_unset_admin(self, group_id, member_name): 911 pass 912 913 @searpc_func("int", ["int", "string"]) 914 def set_group_name(self, group_id, group_name): 915 pass 916 917 @searpc_func("int", ["int", "string"]) 918 def quit_group(self, group_id, user_name): 919 pass 920 921 @searpc_func("objlist", ["string", "int"]) 922 def get_groups(self, user_name, return_ancestors): 923 pass 924 925 @searpc_func("objlist", []) 926 def list_all_departments(self): 927 pass 928 929 @searpc_func("objlist", ["int", "int", "string"]) 930 def get_all_groups(self, start, limit, source): 931 pass 932 933 @searpc_func("objlist", ["int"]) 934 def get_ancestor_groups(self, group_id): 935 pass 936 937 @searpc_func("objlist", ["int"]) 938 def get_top_groups(self, including_org): 939 pass 940 941 @searpc_func("objlist", ["int"]) 942 def get_child_groups(self, group_id): 943 pass 944 945 @searpc_func("objlist", ["int"]) 946 def get_descendants_groups(self, group_id): 947 pass 948 949 @searpc_func("object", ["int"]) 950 def get_group(self, group_id): 951 pass 952 953 @searpc_func("objlist", ["int"]) 954 def get_group_members(self, group_id): 955 pass 956 957 @searpc_func("objlist", ["int", "string"]) 958 def get_members_with_prefix(self, group_id, prefix): 959 pass 960 961 @searpc_func("int", ["int", "string", "int"]) 962 def check_group_staff(self, group_id, username, in_structure): 963 pass 964 965 @searpc_func("int", ["string"]) 966 def remove_group_user(self, username): 967 pass 968 969 @searpc_func("int", ["int", "string", "int"]) 970 def is_group_user(self, group_id, user, in_structure): 971 pass 972 973 @searpc_func("int", ["int", "string"]) 974 def set_group_creator(self, group_id, user_name): 975 pass 976 977 @searpc_func("objlist", ["string", "int", "int"]) 978 def search_groups(self, group_patt, start, limit): 979 pass 980 981 @searpc_func("objlist", ["string"]) 982 def get_groups_members(self, group_ids): 983 pass 984 #org management 985 @searpc_func("int", ["string", "string", "string"]) 986 def create_org(self, org_name, url_prefix, creator): 987 pass 988 989 @searpc_func("int", ["int"]) 990 def remove_org(self, org_id): 991 pass 992 993 @searpc_func("objlist", ["int", "int"]) 994 def get_all_orgs(self, start, limit): 995 pass 996 997 @searpc_func("int64", []) 998 def count_orgs(self): 999 pass 1000 1001 @searpc_func("object", ["string"]) 1002 def get_org_by_url_prefix(self, url_prefix): 1003 pass 1004 1005 @searpc_func("object", ["string"]) 1006 def get_org_by_id(self, org_id): 1007 pass 1008 1009 @searpc_func("int", ["int", "string", "int"]) 1010 def add_org_user(self, org_id, email, is_staff): 1011 pass 1012 1013 @searpc_func("int", ["int", "string"]) 1014 def remove_org_user(self, org_id, email): 1015 pass 1016 1017 @searpc_func("objlist", ["string"]) 1018 def get_orgs_by_user(self, email): 1019 pass 1020 1021 @searpc_func("objlist", ["string", "int", "int"]) 1022 def get_org_emailusers(self, url_prefix, start, limit): 1023 pass 1024 1025 @searpc_func("int", ["int", "int"]) 1026 def add_org_group(self, org_id, group_id): 1027 pass 1028 1029 @searpc_func("int", ["int", "int"]) 1030 def remove_org_group(self, org_id, group_id): 1031 pass 1032 1033 @searpc_func("int", ["int"]) 1034 def is_org_group(self, group_id): 1035 pass 1036 1037 @searpc_func("int", ["int"]) 1038 def get_org_id_by_group(self, group_id): 1039 pass 1040 1041 @searpc_func("objlist", ["int", "int", "int"]) 1042 def get_org_groups(self, org_id, start, limit): 1043 pass 1044 1045 @searpc_func("objlist", ["string", "int"]) 1046 def get_org_groups_by_user (self, user, org_id): 1047 pass 1048 1049 @searpc_func("objlist", ["int"]) 1050 def get_org_top_groups(self, org_id): 1051 pass 1052 1053 @searpc_func("int", ["int", "string"]) 1054 def org_user_exists(self, org_id, email): 1055 pass 1056 1057 @searpc_func("int", ["int", "string"]) 1058 def is_org_staff(self, org_id, user): 1059 pass 1060 1061 @searpc_func("int", ["int", "string"]) 1062 def set_org_staff(self, org_id, user): 1063 pass 1064 1065 @searpc_func("int", ["int", "string"]) 1066 def unset_org_staff(self, org_id, user): 1067 pass 1068 1069 @searpc_func("int", ["int", "string"]) 1070 def set_org_name(self, org_id, org_name): 1071 pass 1072 1073 @searpc_func("int", ["string", "string"]) 1074 def set_reference_id(self, primary_id, reference_id): 1075 pass 1076 1077 @searpc_func("string", ["string"]) 1078 def get_primary_id(self, email): 1079 pass 1080