async publish(resourceType, id, force, options) {
        const publishAPostBySchedulerToleranceInMinutes = config.get('times').publishAPostBySchedulerToleranceInMinutes;

        const result = await api[resourceType].read({id}, options);
        const preScheduledResource = result[resourceType][0];

        const publishedAtMoment = moment(preScheduledResource.published_at);

        if (publishedAtMoment.diff(moment(), 'minutes') > publishAPostBySchedulerToleranceInMinutes) {
            return Promise.reject(new errors.NotFoundError({message: messages.jobNotFound}));
        }

        if (publishedAtMoment.diff(moment(), 'minutes') < publishAPostBySchedulerToleranceInMinutes * -1 && force !== true) {
            return Promise.reject(new errors.NotFoundError({message: messages.jobPublishInThePast}));
        }

        const editedResource = {};
        editedResource[resourceType] = [{
            status: 'published',
            updated_at: moment(preScheduledResource.updated_at).toISOString(true)
        }];

        const editResult = await api[resourceType].edit(
            editedResource,
            _.pick(options, ['context', 'id', 'transacting', 'forUpdate'])
        );
        const scheduledResource = editResult[resourceType][0];

        return {scheduledResource, preScheduledResource};
    }
Publishes scheduled resource (a post or a page at the moment of writing)

@param {String} resourceType one of 'post' or 'page' resources
@param {String} id resource id
@param {Boolean} force force publish flag
@param {Object} options api query options
@returns {Promise<Object, Object>}