seafile-js 0.2.237 → 0.2.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +64 -0
- package/lib/seafile-api.js +0 -573
- package/package.json +6 -6
- package/.eslintrc.js +0 -31
- package/coverage/clover.xml +0 -1726
- package/coverage/coverage-final.json +0 -2
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -116
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/seafile-api.js.html +0 -11371
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -2973
- package/test/config.json +0 -7
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es6": true
|
|
5
|
+
},
|
|
6
|
+
"extends": ["react-app", "eslint:recommended"],
|
|
7
|
+
"parser": "@babel/eslint-parser",
|
|
8
|
+
"parserOptions": {
|
|
9
|
+
"babelOptions": {
|
|
10
|
+
"presets": [
|
|
11
|
+
["babel-preset-react-app",false],
|
|
12
|
+
"babel-preset-react-app/prod"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"ecmaFeatures": {
|
|
16
|
+
"experimentalObjectRestSpread": true,
|
|
17
|
+
"jsx": true
|
|
18
|
+
},
|
|
19
|
+
"sourceType": "module"
|
|
20
|
+
},
|
|
21
|
+
"plugins": ["react"],
|
|
22
|
+
"rules": {
|
|
23
|
+
// enbale console.log
|
|
24
|
+
"no-console": "off",
|
|
25
|
+
// enable declare variable in if
|
|
26
|
+
"no-cond-assign": "off",
|
|
27
|
+
// enable declare variable width var
|
|
28
|
+
"no-var": "off",
|
|
29
|
+
// enable declare in case
|
|
30
|
+
"no-case-declarations": "off",
|
|
31
|
+
// enable redeclare variable
|
|
32
|
+
"no-redeclare": "off",
|
|
33
|
+
"indent": ["warn", 2, {
|
|
34
|
+
"SwitchCase": 1,
|
|
35
|
+
"ignoreComments": false
|
|
36
|
+
}],
|
|
37
|
+
"linebreak-style": ["warn", "unix"],
|
|
38
|
+
"quotes": ["warn", "single"],
|
|
39
|
+
"semi": ["warn", "always"],
|
|
40
|
+
"no-unreachable": "warn",
|
|
41
|
+
"no-class-assign": "warn",
|
|
42
|
+
"no-unused-vars": "warn",
|
|
43
|
+
"no-useless-escape": "off",
|
|
44
|
+
"no-irregular-whitespace": "warn",
|
|
45
|
+
"no-trailing-spaces": "warn",
|
|
46
|
+
"react/jsx-indent": ["warn", 2],
|
|
47
|
+
"eol-last": "error",
|
|
48
|
+
"space-before-function-paren": ["warn", {"named": "never"}],
|
|
49
|
+
"array-bracket-spacing": ["warn", "never"],
|
|
50
|
+
"object-curly-spacing": ["warn", "always"],
|
|
51
|
+
"spaced-comment": "warn",
|
|
52
|
+
"keyword-spacing": ["warn", {"before": true}],
|
|
53
|
+
"space-infix-ops": "error",
|
|
54
|
+
"key-spacing": ["error", { "beforeColon": false }],
|
|
55
|
+
"arrow-spacing": ["error", { "before": true, "after": true }],
|
|
56
|
+
"comma-spacing": ["error", { "before": false, "after": true }],
|
|
57
|
+
"no-duplicate-imports": "error",
|
|
58
|
+
"one-var": ["error", "never"],
|
|
59
|
+
"brace-style": "error",
|
|
60
|
+
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1 }],
|
|
61
|
+
"no-multi-spaces": "error",
|
|
62
|
+
"react/jsx-closing-tag-location": "error"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/lib/seafile-api.js
CHANGED
|
@@ -1946,579 +1946,6 @@ var SeafileAPI = exports.SeafileAPI = /*#__PURE__*/function () {
|
|
|
1946
1946
|
var url = this.server + '/api2/repos/' + repoID + '/dir/metadata/?p=' + encodeURIComponent(dirPath);
|
|
1947
1947
|
return this.req.get(url);
|
|
1948
1948
|
}
|
|
1949
|
-
}, {
|
|
1950
|
-
key: "orgAdminGetOrgInfo",
|
|
1951
|
-
value: function orgAdminGetOrgInfo() {
|
|
1952
|
-
var url = this.server + '/api/v2.1/org/admin/info/';
|
|
1953
|
-
return this.req.get(url);
|
|
1954
|
-
}
|
|
1955
|
-
}, {
|
|
1956
|
-
key: "orgAdminGetSysSettingInfo",
|
|
1957
|
-
value: function orgAdminGetSysSettingInfo(orgID) {
|
|
1958
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/web-settings/';
|
|
1959
|
-
return this.req.get(url);
|
|
1960
|
-
}
|
|
1961
|
-
}, {
|
|
1962
|
-
key: "orgAdminSetSysSettingInfo",
|
|
1963
|
-
value: function orgAdminSetSysSettingInfo(orgID, key, value) {
|
|
1964
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/web-settings/';
|
|
1965
|
-
var formData = new _formData["default"]();
|
|
1966
|
-
formData.append(key, value);
|
|
1967
|
-
return this.req.put(url, formData);
|
|
1968
|
-
}
|
|
1969
|
-
}, {
|
|
1970
|
-
key: "orgAdminUpdateName",
|
|
1971
|
-
value: function orgAdminUpdateName(orgID, orgName) {
|
|
1972
|
-
var url = this.server + '/api/v2.1/org/admin/info/';
|
|
1973
|
-
var form = new _formData["default"]();
|
|
1974
|
-
form.append('org_name', orgName);
|
|
1975
|
-
return this.req.put(url, form);
|
|
1976
|
-
}
|
|
1977
|
-
}, {
|
|
1978
|
-
key: "orgAdminSetOrgUserDefaultQuota",
|
|
1979
|
-
value: function orgAdminSetOrgUserDefaultQuota(orgID, quota) {
|
|
1980
|
-
var url = this.server + '/api/v2.1/org/admin/info/';
|
|
1981
|
-
var form = new _formData["default"]();
|
|
1982
|
-
form.append('user_default_quota', quota);
|
|
1983
|
-
return this.req.put(url, form);
|
|
1984
|
-
}
|
|
1985
|
-
}, {
|
|
1986
|
-
key: "orgAdminUpdateLogo",
|
|
1987
|
-
value: function orgAdminUpdateLogo(orgID, file) {
|
|
1988
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/logo/';
|
|
1989
|
-
var form = new _formData["default"]();
|
|
1990
|
-
form.append('file', file);
|
|
1991
|
-
return this._sendPostRequest(url, form);
|
|
1992
|
-
}
|
|
1993
|
-
}, {
|
|
1994
|
-
key: "orgAdminGetSamlConfig",
|
|
1995
|
-
value: function orgAdminGetSamlConfig(orgID) {
|
|
1996
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/saml-config/';
|
|
1997
|
-
return this.req.get(url);
|
|
1998
|
-
}
|
|
1999
|
-
}, {
|
|
2000
|
-
key: "orgAdminUpdateSamlConfig",
|
|
2001
|
-
value: function orgAdminUpdateSamlConfig(orgID, metadataUrl, domain, idpCertificate) {
|
|
2002
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/saml-config/';
|
|
2003
|
-
var formData = new _formData["default"]();
|
|
2004
|
-
if (metadataUrl) {
|
|
2005
|
-
formData.append('metadata_url', metadataUrl);
|
|
2006
|
-
}
|
|
2007
|
-
if (domain) {
|
|
2008
|
-
formData.append('domain', domain);
|
|
2009
|
-
}
|
|
2010
|
-
if (idpCertificate) {
|
|
2011
|
-
formData.append('idp_certificate', idpCertificate);
|
|
2012
|
-
}
|
|
2013
|
-
return this.req.put(url, formData);
|
|
2014
|
-
}
|
|
2015
|
-
}, {
|
|
2016
|
-
key: "orgAdminVerifyDomain",
|
|
2017
|
-
value: function orgAdminVerifyDomain(orgID, domain) {
|
|
2018
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/verify-domain/';
|
|
2019
|
-
var data = {
|
|
2020
|
-
domain: domain
|
|
2021
|
-
};
|
|
2022
|
-
return this.req.put(url, data);
|
|
2023
|
-
}
|
|
2024
|
-
}, {
|
|
2025
|
-
key: "orgAdminStatisticFiles",
|
|
2026
|
-
value: function orgAdminStatisticFiles(orgID, startTime, endTime, groupBy) {
|
|
2027
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/statistics/file-operations/';
|
|
2028
|
-
var params = {
|
|
2029
|
-
start: startTime,
|
|
2030
|
-
end: endTime,
|
|
2031
|
-
group_by: groupBy
|
|
2032
|
-
};
|
|
2033
|
-
return this.req.get(url, {
|
|
2034
|
-
params: params
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
}, {
|
|
2038
|
-
key: "orgAdminStatisticStorages",
|
|
2039
|
-
value: function orgAdminStatisticStorages(orgID, startTime, endTime, groupBy) {
|
|
2040
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/statistics/total-storage/';
|
|
2041
|
-
var params = {
|
|
2042
|
-
start: startTime,
|
|
2043
|
-
end: endTime,
|
|
2044
|
-
group_by: groupBy
|
|
2045
|
-
};
|
|
2046
|
-
return this.req.get(url, {
|
|
2047
|
-
params: params
|
|
2048
|
-
});
|
|
2049
|
-
}
|
|
2050
|
-
}, {
|
|
2051
|
-
key: "orgAdminStatisticActiveUsers",
|
|
2052
|
-
value: function orgAdminStatisticActiveUsers(orgID, startTime, endTime, groupBy) {
|
|
2053
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/statistics/active-users/';
|
|
2054
|
-
var params = {
|
|
2055
|
-
start: startTime,
|
|
2056
|
-
end: endTime,
|
|
2057
|
-
group_by: groupBy
|
|
2058
|
-
};
|
|
2059
|
-
return this.req.get(url, {
|
|
2060
|
-
params: params
|
|
2061
|
-
});
|
|
2062
|
-
}
|
|
2063
|
-
}, {
|
|
2064
|
-
key: "orgAdminStatisticSystemTraffic",
|
|
2065
|
-
value: function orgAdminStatisticSystemTraffic(orgID, startTime, endTime, groupBy) {
|
|
2066
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/statistics/system-traffic/';
|
|
2067
|
-
var params = {
|
|
2068
|
-
start: startTime,
|
|
2069
|
-
end: endTime,
|
|
2070
|
-
group_by: groupBy
|
|
2071
|
-
};
|
|
2072
|
-
return this.req.get(url, {
|
|
2073
|
-
params: params
|
|
2074
|
-
});
|
|
2075
|
-
}
|
|
2076
|
-
}, {
|
|
2077
|
-
key: "orgAdminListUserTraffic",
|
|
2078
|
-
value: function orgAdminListUserTraffic(orgID, month, page, perPage, orderBy) {
|
|
2079
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/statistics/user-traffic/';
|
|
2080
|
-
var params = {
|
|
2081
|
-
month: month,
|
|
2082
|
-
page: page,
|
|
2083
|
-
per_page: perPage,
|
|
2084
|
-
order_by: orderBy
|
|
2085
|
-
};
|
|
2086
|
-
return this.req.get(url, {
|
|
2087
|
-
params: params
|
|
2088
|
-
});
|
|
2089
|
-
}
|
|
2090
|
-
}, {
|
|
2091
|
-
key: "orgAdminListDevices",
|
|
2092
|
-
value: function orgAdminListDevices(orgID, platform, page, per_page) {
|
|
2093
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/devices/';
|
|
2094
|
-
var params = {
|
|
2095
|
-
platform: platform,
|
|
2096
|
-
page: page,
|
|
2097
|
-
per_page: per_page
|
|
2098
|
-
};
|
|
2099
|
-
return this.req.get(url, {
|
|
2100
|
-
params: params
|
|
2101
|
-
});
|
|
2102
|
-
}
|
|
2103
|
-
}, {
|
|
2104
|
-
key: "orgAdminUnlinkDevice",
|
|
2105
|
-
value: function orgAdminUnlinkDevice(orgID, platform, deviceID, user, wipeDevice) {
|
|
2106
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/devices/';
|
|
2107
|
-
var params = {
|
|
2108
|
-
wipe_device: wipeDevice ? 'true' : 'false',
|
|
2109
|
-
platform: platform,
|
|
2110
|
-
device_id: deviceID,
|
|
2111
|
-
user: user
|
|
2112
|
-
};
|
|
2113
|
-
return this.req["delete"](url, {
|
|
2114
|
-
data: params
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
}, {
|
|
2118
|
-
key: "orgAdminListDevicesErrors",
|
|
2119
|
-
value: function orgAdminListDevicesErrors(orgID, page, per_page) {
|
|
2120
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/devices-errors/';
|
|
2121
|
-
var params = {
|
|
2122
|
-
page: page,
|
|
2123
|
-
per_page: per_page
|
|
2124
|
-
};
|
|
2125
|
-
return this.req.get(url, {
|
|
2126
|
-
params: params
|
|
2127
|
-
});
|
|
2128
|
-
}
|
|
2129
|
-
}, {
|
|
2130
|
-
key: "orgAdminClearDeviceErrors",
|
|
2131
|
-
value: function orgAdminClearDeviceErrors(orgID) {
|
|
2132
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/devices-errors/';
|
|
2133
|
-
return this.req["delete"](url);
|
|
2134
|
-
}
|
|
2135
|
-
}, {
|
|
2136
|
-
key: "orgAdminListOrgUsers",
|
|
2137
|
-
value: function orgAdminListOrgUsers(orgID, isStaff, page, sortBy, sortOrder) {
|
|
2138
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/';
|
|
2139
|
-
var params = {
|
|
2140
|
-
is_staff: isStaff,
|
|
2141
|
-
page: page
|
|
2142
|
-
};
|
|
2143
|
-
if (sortBy) {
|
|
2144
|
-
params.order_by = sortBy;
|
|
2145
|
-
params.direction = sortOrder;
|
|
2146
|
-
}
|
|
2147
|
-
return this.req.get(url, {
|
|
2148
|
-
params: params
|
|
2149
|
-
});
|
|
2150
|
-
}
|
|
2151
|
-
}, {
|
|
2152
|
-
key: "orgAdminSearchUser",
|
|
2153
|
-
value: function orgAdminSearchUser(orgID, query) {
|
|
2154
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/search-user/';
|
|
2155
|
-
var params = {
|
|
2156
|
-
query: query
|
|
2157
|
-
};
|
|
2158
|
-
return this.req.get(url, {
|
|
2159
|
-
params: params
|
|
2160
|
-
});
|
|
2161
|
-
}
|
|
2162
|
-
}, {
|
|
2163
|
-
key: "orgAdminGetOrgUserBesharedRepos",
|
|
2164
|
-
value: function orgAdminGetOrgUserBesharedRepos(orgID, email) {
|
|
2165
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/beshared-repos/';
|
|
2166
|
-
return this.req.get(url);
|
|
2167
|
-
}
|
|
2168
|
-
}, {
|
|
2169
|
-
key: "orgAdminGetOrgUserOwnedRepos",
|
|
2170
|
-
value: function orgAdminGetOrgUserOwnedRepos(orgID, email) {
|
|
2171
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/repos/';
|
|
2172
|
-
return this.req.get(url);
|
|
2173
|
-
}
|
|
2174
|
-
}, {
|
|
2175
|
-
key: "orgAdminGetOrgUserInfo",
|
|
2176
|
-
value: function orgAdminGetOrgUserInfo(orgID, email) {
|
|
2177
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2178
|
-
return this.req.get(url);
|
|
2179
|
-
}
|
|
2180
|
-
}, {
|
|
2181
|
-
key: "orgAdminSetOrgUserName",
|
|
2182
|
-
value: function orgAdminSetOrgUserName(orgID, email, name) {
|
|
2183
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2184
|
-
var data = {
|
|
2185
|
-
name: name
|
|
2186
|
-
};
|
|
2187
|
-
return this.req.put(url, data);
|
|
2188
|
-
}
|
|
2189
|
-
}, {
|
|
2190
|
-
key: "orgAdminSetOrgUserContactEmail",
|
|
2191
|
-
value: function orgAdminSetOrgUserContactEmail(orgID, email, contactEmail) {
|
|
2192
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2193
|
-
var data = {
|
|
2194
|
-
contact_email: contactEmail
|
|
2195
|
-
};
|
|
2196
|
-
return this.req.put(url, data);
|
|
2197
|
-
}
|
|
2198
|
-
}, {
|
|
2199
|
-
key: "orgAdminSetOrgUserQuota",
|
|
2200
|
-
value: function orgAdminSetOrgUserQuota(orgID, email, quota) {
|
|
2201
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2202
|
-
var data = {
|
|
2203
|
-
quota_total: quota
|
|
2204
|
-
};
|
|
2205
|
-
return this.req.put(url, data);
|
|
2206
|
-
}
|
|
2207
|
-
}, {
|
|
2208
|
-
key: "orgAdminDeleteOrgUser",
|
|
2209
|
-
value: function orgAdminDeleteOrgUser(orgID, email) {
|
|
2210
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2211
|
-
return this.req["delete"](url);
|
|
2212
|
-
}
|
|
2213
|
-
}, {
|
|
2214
|
-
key: "orgAdminResetOrgUserPassword",
|
|
2215
|
-
value: function orgAdminResetOrgUserPassword(orgID, email) {
|
|
2216
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/set-password/';
|
|
2217
|
-
return this.req.put(url);
|
|
2218
|
-
}
|
|
2219
|
-
}, {
|
|
2220
|
-
key: "orgAdminChangeOrgUserStatus",
|
|
2221
|
-
value: function orgAdminChangeOrgUserStatus(orgID, email, isActive) {
|
|
2222
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2223
|
-
var form = new _formData["default"]();
|
|
2224
|
-
form.append('is_active', isActive);
|
|
2225
|
-
return this.req.put(url, form);
|
|
2226
|
-
}
|
|
2227
|
-
}, {
|
|
2228
|
-
key: "orgAdminAddOrgUser",
|
|
2229
|
-
value: function orgAdminAddOrgUser(orgID, email, name, password) {
|
|
2230
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/';
|
|
2231
|
-
var form = new _formData["default"]();
|
|
2232
|
-
form.append('email', email);
|
|
2233
|
-
form.append('name', name);
|
|
2234
|
-
form.append('password', password);
|
|
2235
|
-
return this._sendPostRequest(url, form);
|
|
2236
|
-
}
|
|
2237
|
-
}, {
|
|
2238
|
-
key: "orgAdminImportUsersViaFile",
|
|
2239
|
-
value: function orgAdminImportUsersViaFile(orgID, file) {
|
|
2240
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/import-users/';
|
|
2241
|
-
var formData = new _formData["default"]();
|
|
2242
|
-
formData.append('file', file);
|
|
2243
|
-
return this._sendPostRequest(url, formData);
|
|
2244
|
-
}
|
|
2245
|
-
}, {
|
|
2246
|
-
key: "orgAdminInviteOrgUsers",
|
|
2247
|
-
value: function orgAdminInviteOrgUsers(orgID, email) {
|
|
2248
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/invite-users/';
|
|
2249
|
-
var form = new _formData["default"]();
|
|
2250
|
-
if (Array.isArray(email)) {
|
|
2251
|
-
email.forEach(function (item) {
|
|
2252
|
-
form.append('email', item);
|
|
2253
|
-
});
|
|
2254
|
-
} else {
|
|
2255
|
-
form.append('email', email);
|
|
2256
|
-
}
|
|
2257
|
-
return this._sendPostRequest(url, form);
|
|
2258
|
-
}
|
|
2259
|
-
}, {
|
|
2260
|
-
key: "orgAdminSetOrgAdmin",
|
|
2261
|
-
value: function orgAdminSetOrgAdmin(orgID, email, isStaff) {
|
|
2262
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/users/' + encodeURIComponent(email) + '/';
|
|
2263
|
-
var form = new _formData["default"]();
|
|
2264
|
-
form.append('is_staff', isStaff);
|
|
2265
|
-
return this.req.put(url, form);
|
|
2266
|
-
}
|
|
2267
|
-
}, {
|
|
2268
|
-
key: "orgAdminListOrgGroups",
|
|
2269
|
-
value: function orgAdminListOrgGroups(orgID, page) {
|
|
2270
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/?page=' + page;
|
|
2271
|
-
return this.req.get(url);
|
|
2272
|
-
}
|
|
2273
|
-
}, {
|
|
2274
|
-
key: "orgAdminSearchGroup",
|
|
2275
|
-
value: function orgAdminSearchGroup(orgID, query) {
|
|
2276
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/search-group/';
|
|
2277
|
-
var params = {
|
|
2278
|
-
query: query
|
|
2279
|
-
};
|
|
2280
|
-
return this.req.get(url, {
|
|
2281
|
-
params: params
|
|
2282
|
-
});
|
|
2283
|
-
}
|
|
2284
|
-
}, {
|
|
2285
|
-
key: "orgAdminGetGroup",
|
|
2286
|
-
value: function orgAdminGetGroup(orgID, groupID) {
|
|
2287
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/';
|
|
2288
|
-
return this.req.get(url);
|
|
2289
|
-
}
|
|
2290
|
-
}, {
|
|
2291
|
-
key: "orgAdminDeleteOrgGroup",
|
|
2292
|
-
value: function orgAdminDeleteOrgGroup(orgID, groupID) {
|
|
2293
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/';
|
|
2294
|
-
return this.req["delete"](url);
|
|
2295
|
-
}
|
|
2296
|
-
}, {
|
|
2297
|
-
key: "orgAdminListDepartments",
|
|
2298
|
-
value: function orgAdminListDepartments(orgID) {
|
|
2299
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/departments/';
|
|
2300
|
-
return this.req.get(url);
|
|
2301
|
-
}
|
|
2302
|
-
}, {
|
|
2303
|
-
key: "orgAdminListOrgRepos",
|
|
2304
|
-
value: function orgAdminListOrgRepos(orgID, page, perPage, orderBy) {
|
|
2305
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/repos/';
|
|
2306
|
-
var params = {
|
|
2307
|
-
page: page,
|
|
2308
|
-
per_page: perPage
|
|
2309
|
-
};
|
|
2310
|
-
if (orderBy) {
|
|
2311
|
-
params.order_by = orderBy;
|
|
2312
|
-
}
|
|
2313
|
-
return this.req.get(url, {
|
|
2314
|
-
params: params
|
|
2315
|
-
});
|
|
2316
|
-
}
|
|
2317
|
-
}, {
|
|
2318
|
-
key: "orgAdminDeleteOrgRepo",
|
|
2319
|
-
value: function orgAdminDeleteOrgRepo(orgID, repoID) {
|
|
2320
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/repos/' + repoID + '/';
|
|
2321
|
-
return this.req["delete"](url);
|
|
2322
|
-
}
|
|
2323
|
-
}, {
|
|
2324
|
-
key: "orgAdminTransferOrgRepo",
|
|
2325
|
-
value: function orgAdminTransferOrgRepo(orgID, repoID, email) {
|
|
2326
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/repos/' + repoID + '/';
|
|
2327
|
-
var form = new _formData["default"]();
|
|
2328
|
-
form.append('email', email);
|
|
2329
|
-
return this.req.put(url, form);
|
|
2330
|
-
}
|
|
2331
|
-
}, {
|
|
2332
|
-
key: "orgAdminListTrashRepos",
|
|
2333
|
-
value: function orgAdminListTrashRepos(orgID, page, perPage) {
|
|
2334
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/trash-libraries/';
|
|
2335
|
-
var params = {
|
|
2336
|
-
page: page,
|
|
2337
|
-
per_page: perPage
|
|
2338
|
-
};
|
|
2339
|
-
return this.req.get(url, {
|
|
2340
|
-
params: params
|
|
2341
|
-
});
|
|
2342
|
-
}
|
|
2343
|
-
}, {
|
|
2344
|
-
key: "orgAdminDeleteTrashRepo",
|
|
2345
|
-
value: function orgAdminDeleteTrashRepo(orgID, repoID) {
|
|
2346
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/trash-libraries/' + repoID + '/';
|
|
2347
|
-
return this.req["delete"](url);
|
|
2348
|
-
}
|
|
2349
|
-
}, {
|
|
2350
|
-
key: "orgAdminRestoreTrashRepo",
|
|
2351
|
-
value: function orgAdminRestoreTrashRepo(orgID, repoID) {
|
|
2352
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/trash-libraries/' + repoID + '/';
|
|
2353
|
-
return this.req.put(url);
|
|
2354
|
-
}
|
|
2355
|
-
}, {
|
|
2356
|
-
key: "orgAdminCleanTrashRepo",
|
|
2357
|
-
value: function orgAdminCleanTrashRepo(orgID) {
|
|
2358
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/trash-libraries/';
|
|
2359
|
-
return this.req["delete"](url);
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
// org links
|
|
2363
|
-
}, {
|
|
2364
|
-
key: "orgAdminListOrgLinks",
|
|
2365
|
-
value: function orgAdminListOrgLinks(page) {
|
|
2366
|
-
var url = this.server + '/api/v2.1/org/admin/links/?page=' + page;
|
|
2367
|
-
return this.req.get(url);
|
|
2368
|
-
}
|
|
2369
|
-
}, {
|
|
2370
|
-
key: "orgAdminDeleteOrgLink",
|
|
2371
|
-
value: function orgAdminDeleteOrgLink(token) {
|
|
2372
|
-
var url = this.server + '/api/v2.1/org/admin/links/' + token + '/';
|
|
2373
|
-
return this.req["delete"](url);
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
// org depart group
|
|
2377
|
-
}, {
|
|
2378
|
-
key: "orgAdminListDepartGroups",
|
|
2379
|
-
value: function orgAdminListDepartGroups(orgID) {
|
|
2380
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/address-book/groups/';
|
|
2381
|
-
return this.req.get(url);
|
|
2382
|
-
}
|
|
2383
|
-
}, {
|
|
2384
|
-
key: "orgAdminListGroupInfo",
|
|
2385
|
-
value: function orgAdminListGroupInfo(orgID, groupID, showAncestors) {
|
|
2386
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/address-book/groups/' + groupID + '/?return_ancestors=' + showAncestors;
|
|
2387
|
-
return this.req.get(url);
|
|
2388
|
-
}
|
|
2389
|
-
}, {
|
|
2390
|
-
key: "orgAdminAddDepartGroup",
|
|
2391
|
-
value: function orgAdminAddDepartGroup(orgID, parentGroup, groupName, groupOwner, groupStaff) {
|
|
2392
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/address-book/groups/';
|
|
2393
|
-
var form = new _formData["default"]();
|
|
2394
|
-
form.append('parent_group', parentGroup);
|
|
2395
|
-
form.append('group_name', groupName);
|
|
2396
|
-
if (groupOwner) {
|
|
2397
|
-
form.append('group_owner', groupOwner);
|
|
2398
|
-
}
|
|
2399
|
-
if (groupStaff) {
|
|
2400
|
-
form.append('group_staff', groupStaff.join(','));
|
|
2401
|
-
}
|
|
2402
|
-
return this._sendPostRequest(url, form);
|
|
2403
|
-
}
|
|
2404
|
-
}, {
|
|
2405
|
-
key: "orgAdminUpdateDepartGroup",
|
|
2406
|
-
value: function orgAdminUpdateDepartGroup(orgID, groupID, groupName) {
|
|
2407
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/address-book/groups/' + groupID + '/';
|
|
2408
|
-
var form = new _formData["default"]();
|
|
2409
|
-
form.append('group_name', groupName);
|
|
2410
|
-
return this.req.put(url, form);
|
|
2411
|
-
}
|
|
2412
|
-
}, {
|
|
2413
|
-
key: "orgAdminDeleteDepartGroup",
|
|
2414
|
-
value: function orgAdminDeleteDepartGroup(orgID, groupID) {
|
|
2415
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/address-book/groups/' + groupID + '/';
|
|
2416
|
-
return this.req["delete"](url);
|
|
2417
|
-
}
|
|
2418
|
-
}, {
|
|
2419
|
-
key: "orgAdminSetGroupQuota",
|
|
2420
|
-
value: function orgAdminSetGroupQuota(orgID, groupID, quota) {
|
|
2421
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/';
|
|
2422
|
-
var form = new _formData["default"]();
|
|
2423
|
-
form.append('quota', quota);
|
|
2424
|
-
return this.req.put(url, form);
|
|
2425
|
-
}
|
|
2426
|
-
}, {
|
|
2427
|
-
key: "orgAdminListGroupRepos",
|
|
2428
|
-
value: function orgAdminListGroupRepos(orgID, groupID) {
|
|
2429
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/libraries/';
|
|
2430
|
-
return this.req.get(url);
|
|
2431
|
-
}
|
|
2432
|
-
}, {
|
|
2433
|
-
key: "orgAdminAddDepartmentRepo",
|
|
2434
|
-
value: function orgAdminAddDepartmentRepo(orgID, groupID, repoName) {
|
|
2435
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/group-owned-libraries/';
|
|
2436
|
-
var form = new _formData["default"]();
|
|
2437
|
-
form.append('repo_name', repoName);
|
|
2438
|
-
return this._sendPostRequest(url, form);
|
|
2439
|
-
}
|
|
2440
|
-
}, {
|
|
2441
|
-
key: "orgAdminDeleteDepartmentRepo",
|
|
2442
|
-
value: function orgAdminDeleteDepartmentRepo(orgID, groupID, repoID) {
|
|
2443
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/group-owned-libraries/' + repoID + '/';
|
|
2444
|
-
return this.req["delete"](url);
|
|
2445
|
-
}
|
|
2446
|
-
}, {
|
|
2447
|
-
key: "orgAdminListGroupMembers",
|
|
2448
|
-
value: function orgAdminListGroupMembers(orgID, groupID) {
|
|
2449
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/members/';
|
|
2450
|
-
return this.req.get(url);
|
|
2451
|
-
}
|
|
2452
|
-
}, {
|
|
2453
|
-
key: "orgAdminDeleteGroupMember",
|
|
2454
|
-
value: function orgAdminDeleteGroupMember(orgID, groupID, userEmail) {
|
|
2455
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/members/' + encodeURIComponent(userEmail) + '/';
|
|
2456
|
-
return this.req["delete"](url);
|
|
2457
|
-
}
|
|
2458
|
-
}, {
|
|
2459
|
-
key: "orgAdminAddGroupMember",
|
|
2460
|
-
value: function orgAdminAddGroupMember(orgID, groupID, userEmail) {
|
|
2461
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/members/';
|
|
2462
|
-
var form = new _formData["default"]();
|
|
2463
|
-
form.append('email', userEmail);
|
|
2464
|
-
return this._sendPostRequest(url, form);
|
|
2465
|
-
}
|
|
2466
|
-
}, {
|
|
2467
|
-
key: "orgAdminSetGroupMemberRole",
|
|
2468
|
-
value: function orgAdminSetGroupMemberRole(orgID, groupID, userEmail, isAdmin) {
|
|
2469
|
-
var url = this.server + '/api/v2.1/org/' + orgID + '/admin/groups/' + groupID + '/members/' + encodeURIComponent(userEmail) + '/';
|
|
2470
|
-
var form = new _formData["default"]();
|
|
2471
|
-
form.append('is_admin', isAdmin);
|
|
2472
|
-
return this.req.put(url, form);
|
|
2473
|
-
}
|
|
2474
|
-
|
|
2475
|
-
// org admin logs
|
|
2476
|
-
}, {
|
|
2477
|
-
key: "orgAdminListFileAudit",
|
|
2478
|
-
value: function orgAdminListFileAudit(email, repoID, page) {
|
|
2479
|
-
var url = this.server + '/api/v2.1/org/admin/logs/file-access/?page=' + page;
|
|
2480
|
-
if (email) {
|
|
2481
|
-
url = url + '&email=' + encodeURIComponent(email);
|
|
2482
|
-
}
|
|
2483
|
-
if (repoID) {
|
|
2484
|
-
url = url + '&repo_id=' + repoID;
|
|
2485
|
-
}
|
|
2486
|
-
return this.req.get(url);
|
|
2487
|
-
}
|
|
2488
|
-
}, {
|
|
2489
|
-
key: "orgAdminListFileUpdate",
|
|
2490
|
-
value: function orgAdminListFileUpdate(email, repoID, page) {
|
|
2491
|
-
var url = this.server + '/api/v2.1/org/admin/logs/file-update/?page=' + page;
|
|
2492
|
-
if (email) {
|
|
2493
|
-
url = url + '&email=' + encodeURIComponent(email);
|
|
2494
|
-
}
|
|
2495
|
-
if (repoID) {
|
|
2496
|
-
url = url + '&repo_id=' + repoID;
|
|
2497
|
-
}
|
|
2498
|
-
return this.req.get(url);
|
|
2499
|
-
}
|
|
2500
|
-
}, {
|
|
2501
|
-
key: "orgAdminListPermAudit",
|
|
2502
|
-
value: function orgAdminListPermAudit(email, repoID, page) {
|
|
2503
|
-
var url = this.server + '/api/v2.1/org/admin/logs/repo-permission/?page=' + page;
|
|
2504
|
-
if (email) {
|
|
2505
|
-
url = url + '&email=' + encodeURIComponent(email);
|
|
2506
|
-
}
|
|
2507
|
-
if (repoID) {
|
|
2508
|
-
url = url + '&repo_id=' + repoID;
|
|
2509
|
-
}
|
|
2510
|
-
return this.req.get(url);
|
|
2511
|
-
}
|
|
2512
|
-
}, {
|
|
2513
|
-
key: "orgAdminGetFileUpdateDetail",
|
|
2514
|
-
value: function orgAdminGetFileUpdateDetail(repoID, commitID) {
|
|
2515
|
-
var url = this.server + '/ajax/repo/' + repoID + '/history/changes/?commit_id=' + commitID;
|
|
2516
|
-
return this.req.get(url, {
|
|
2517
|
-
headers: {
|
|
2518
|
-
'X-Requested-With': 'XMLHttpRequest'
|
|
2519
|
-
}
|
|
2520
|
-
});
|
|
2521
|
-
}
|
|
2522
1949
|
}, {
|
|
2523
1950
|
key: "markdownLint",
|
|
2524
1951
|
value: function markdownLint(slateValue) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seafile-js",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.239",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "lib/seafile-api.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"axios": "^1.
|
|
8
|
-
"form-data": "4.0.
|
|
7
|
+
"axios": "^1.15.0",
|
|
8
|
+
"form-data": "^4.0.4"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "jest --env=node --colors --coverage",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@babel/cli": "7.22.15",
|
|
19
|
-
"@babel/core": "
|
|
19
|
+
"@babel/core": "7.22.17",
|
|
20
|
+
"@babel/eslint-parser": "7.22.15",
|
|
20
21
|
"@babel/preset-env": "^7.26.0",
|
|
21
|
-
"
|
|
22
|
-
"eslint": "^9.13.0",
|
|
22
|
+
"eslint": "8.49.0",
|
|
23
23
|
"jest": "^29.7.0"
|
|
24
24
|
}
|
|
25
25
|
}
|