createCards(wekanCards, boardId) {
    const result = [];
    wekanCards.forEach(card => {
      const cardToCreate = {
        archived: card.archived,
        boardId,
        // very old boards won't have a creation activity so no creation date
        createdAt: this._now(this.createdAt.cards[card._id]),
        dateLastActivity: this._now(),
        description: card.description,
        listId: this.lists[card.listId],
        swimlaneId: this.swimlanes[card.swimlaneId],
        sort: card.sort,
        title: card.title,
        // we attribute the card to its creator if available
        userId: this._user(this.createdBy.cards[card._id]),
        isOvertime: card.isOvertime || false,
        startAt: card.startAt ? this._now(card.startAt) : null,
        dueAt: card.dueAt ? this._now(card.dueAt) : null,
        spentTime: card.spentTime || null,
      };
      // add labels
      if (card.labelIds) {
        cardToCreate.labelIds = card.labelIds.map(wekanId => {
          return this.labels[wekanId];
        });
      }
      // add members {
      if (card.members) {
        const wekanMembers = [];
        // we can't just map, as some members may not have been mapped
        card.members.forEach(sourceMemberId => {
          if (this.members[sourceMemberId]) {
            const wekanId = this.members[sourceMemberId];
            // we may map multiple Wekan members to the same wekan user
            // in which case we risk adding the same user multiple times
            if (!wekanMembers.find(wId => wId === wekanId)) {
              wekanMembers.push(wekanId);
            }
          }
          return true;
        });
        if (wekanMembers.length > 0) {
          cardToCreate.members = wekanMembers;
        }
      }
      // add assignees
      if (card.assignees) {
        const wekanAssignees = [];
        // we can't just map, as some members may not have been mapped
        card.assignees.forEach(sourceMemberId => {
          if (this.members[sourceMemberId]) {
            const wekanId = this.members[sourceMemberId];
            // we may map multiple Wekan members to the same wekan user
            // in which case we risk adding the same user multiple times
            if (!wekanAssignees.find(wId => wId === wekanId)) {
              wekanAssignees.push(wekanId);
            }
          }
          return true;
        });
        if (wekanAssignees.length > 0) {
          cardToCreate.assignees = wekanAssignees;
        }
      }
      // set color
      if (card.color) {
        cardToCreate.color = card.color;
      }

      // add custom fields
      if (card.customFields) {
        cardToCreate.customFields = card.customFields.map(field => {
          return {
            _id: this.customFields[field._id],
            value: field.value,
          };
        });
      }

      // insert card
      const cardId = Cards.direct.insert(cardToCreate);
      // keep track of Wekan id => Wekan id
      this.cards[card._id] = cardId;
      // // log activity
      // Activities.direct.insert({
      //   activityType: 'importCard',
      //   boardId,
      //   cardId,
      //   createdAt: this._now(),
      //   listId: cardToCreate.listId,
      //   source: {
      //     id: card._id,
      //     system: 'Wekan',
      //   },
      //   // we attribute the import to current user,
      //   // not the author of the original card
      //   userId: this._user(),
      // });
      // add comments
      const comments = this.comments[card._id];
      if (comments) {
        comments.forEach(comment => {
          const commentToCreate = {
            boardId,
            cardId,
            createdAt: this._now(comment.createdAt),
            text: comment.text,
            // we attribute the comment to the original author, default to current user
            userId: this._user(comment.userId),
          };
          // dateLastActivity will be set from activity insert, no need to
          // update it ourselves
          const commentId = CardComments.direct.insert(commentToCreate);
          this.commentIds[comment._id] = commentId;
          // Activities.direct.insert({
          //   activityType: 'addComment',
          //   boardId: commentToCreate.boardId,
          //   cardId: commentToCreate.cardId,
          //   commentId,
          //   createdAt: this._now(commentToCreate.createdAt),
          //   // we attribute the addComment (not the import)
          //   // to the original author - it is needed by some UI elements.
          //   userId: commentToCreate.userId,
          // });
        });
      }
      const attachments = this.attachments[card._id];
      const wekanCoverId = card.coverId;
      if (attachments && Meteor.isServer) {
        attachments.forEach(att => {
          const self = this;
          const opts = {
            type: att.type ? att.type : undefined,
            userId: self._user(att.userId),
            meta: {
              boardId,
              cardId,
              source: 'import',
            },
          };
          const cb = (error, fileObj) => {
            if (error) {
              throw error;
            }
            self.attachmentIds[att._id] = fileObj._id;
            if (wekanCoverId === att._id) {
              Cards.direct.update(cardId, {
                $set: { coverId: fileObj._id },
              });
            }
          };
          if (att.url) {
            Attachments.load(att.url, opts, cb, true);
          } else if (att.file) {
            Attachments.insert(att.file, opts, cb, true);
          }
        });
      }
      result.push(cardId);
    });
    return result;
  }
Create the Wekan cards corresponding to the supplied Wekan cards,
as well as all linked data: activities, comments, and attachments
@param wekanCards
@param boardId
@returns {Array}