"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadFilePublications = loadFilePublications;
var simpl_schema_1 = require("simpl-schema");
var file_collection_1 = require("../collections/file.collection");
function loadFilePublications(subscriptionManager) {
    subscriptionManager.publications({
        fileWithId: {
            function: function (id_file) {
                return file_collection_1.Files.findById(id_file);
            },
            check: new simpl_schema_1.default({
                id_file: {
                    type: String
                }
            }),
            collections: ['files']
        },
        filesIn: {
            function: function (id_files) {
                return file_collection_1.Files.find({ _id: { $in: id_files } }, { sort: { name: 1 } });
            },
            check: new simpl_schema_1.default({
                id_files: {
                    type: Array
                },
                'id_files.$': {
                    type: String
                }
            }),
            collections: ['files']
        }
    });
}

//# sourceMappingURL=files.js.map
