async list(request) {
    const index = request.getIndex();
    const from = request.getInteger("from", 0);
    const size = request.getInteger("size", 0);
    const type = request.getString("type", "all");

    if (!["all", "stored", "realtime"].includes(type)) {
      throw kerror.get(
        "api",
        "assert",
        "invalid_argument",
        '"all", "stored", "realtime"',
      );
    }

    if (request.input.args.type) {
      request.addDeprecation(
        "2.10.2",
        'The "type" argument and this route returning a list of realtime collections have both been deprecated since Kuzzle version 2.10.1. This feature might be removed in a future major version. To get a list of realtime collections, use this API action instead: "realtime:list".',
      );
    }

    let collections = [];

    if (type === "realtime" || type === "all") {
      const list = await this.ask("core:realtime:collections:get", index);
      collections = list.map((name) => ({ name, type: "realtime" }));
    }

    if (type !== "realtime") {
      const publicCollections = await this.ask(
        "core:storage:public:collection:list",
        index,
      );

      collections = collections.concat(
        publicCollections.map((name) => ({ name, type: "stored" })),
      );
    }

    collections.sort((a, b) => {
      if (a.name === b.name) {
        return 0;
      }
      return a.name < b.name ? -1 : 1;
    });

    return this._paginateCollections(from, size, { collections, type });
  }
@param {Request} request
@returns {Promise.<Object>}