Extracted sharing API into own file

This commit is contained in:
Max Berger
2026-03-10 22:44:51 +01:00
parent d513efeaac
commit 011efdcc86
5 changed files with 358 additions and 334 deletions

View File

@@ -19,7 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { discover_server_features, get_collections } from "../api/api.js";
import { get_collections } from "../api/api.js";
import { discover_server_features } from "../api/sharing.js";
import { SERVER } from "../constants.js";
import { Collection, CollectionType } from "../models/collection.js";
import { bytesToHumanReadable } from "../utils/misc.js";

View File

@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { add_share_by_map, add_share_by_token, get_property_key } from "../api/api.js";
import { add_share_by_map, add_share_by_token, get_property_key } from "../api/sharing.js";
import { CollectionType } from "../models/collection.js";
import { ErrorHandler } from "../utils/error.js";
import { FormValidator, validate_href, validate_non_empty } from "../utils/form_validator.js";

View File

@@ -24,7 +24,7 @@ import {
delete_share_by_token,
reload_sharing_list,
server_features,
} from "../api/api.js";
} from "../api/sharing.js";
import { Collection } from "../models/collection.js";
import { ErrorHandler } from "../utils/error.js";
import { NewShareScene } from "./NewShareScene.js";
@@ -164,7 +164,7 @@ function update_share_list(user, password, collection, errorHandler) {
* @param {string} user
* @param {string} password
* @param {Collection} collection
* @param {import('../api/api.js').Share} share
* @param {import('../api/sharing.js').Share} share
* @param {HTMLElement} template
* @param {string} delete_label
* @param {function(string, string, string, function(?string):void):void} delete_action
@@ -219,7 +219,7 @@ function add_share_row_node(user, password, collection, share, template, delete_
* @param {string} user
* @param {string} password
* @param {Collection} collection
* @param {Array<import('../api/api.js').Share>} shares
* @param {Array<import('../api/sharing.js').Share>} shares
* @param {ErrorHandler} errorHandler
*/
function add_share_rows(user, password, collection, shares, errorHandler) {