{
    "id": "http://schemas.triniti.io/json-schema/triniti/news/mixin/article-stats/1-0-0.json#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "_id": {
            "type": "string",
            "pattern": "^[\\w\\/\\.:-]+$",
            "pbj": {
                "type": "identifier",
                "rule": "single",
                "overridable": true
            }
        },
        "status": {
            "type": "string",
            "default": "draft",
            "enum": [
                "unknown",
                "published",
                "scheduled",
                "pending",
                "draft",
                "expired",
                "archived",
                "deleted"
            ],
            "pbj": {
                "type": "string-enum",
                "rule": "single"
            }
        },
        "etag": {
            "type": "string",
            "pattern": "^[\\w\\.:-]+$",
            "pbj": {
                "type": "string",
                "rule": "single"
            }
        },
        "created_at": {
            "type": "string",
            "pattern": "^[1-9]{1}[0-9]{12,15}$",
            "pbj": {
                "type": "microtime",
                "rule": "single"
            }
        },
        "creator_ref": {
            "type": "object",
            "properties": {
                "curie": {
                    "type": "string",
                    "pattern": "^([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+)$",
                    "minLength": 0,
                    "maxLength": 146
                },
                "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9:_\\-]+$",
                    "minLength": 0,
                    "maxLength": 255
                },
                "tag": {
                    "type": "string",
                    "pattern": "^([\\w\\/-]|[\\w-][\\w\\/-]*[\\w-])$",
                    "minLength": 0,
                    "maxLength": 255
                }
            },
            "required": [
                "curie",
                "id"
            ],
            "additionalProperties": false,
            "description": "A fully qualified reference to what created this node. This is intentionally a message-ref and not a user id because it is often a program that creates nodes, not a user.",
            "pbj": {
                "type": "message-ref",
                "rule": "single"
            }
        },
        "updated_at": {
            "type": "string",
            "pattern": "^[1-9]{1}[0-9]{12,15}$",
            "pbj": {
                "type": "microtime",
                "rule": "single",
                "useTypeDefault": false
            }
        },
        "updater_ref": {
            "type": "object",
            "properties": {
                "curie": {
                    "type": "string",
                    "pattern": "^([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+)$",
                    "minLength": 0,
                    "maxLength": 146
                },
                "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9:_\\-]+$",
                    "minLength": 0,
                    "maxLength": 255
                },
                "tag": {
                    "type": "string",
                    "pattern": "^([\\w\\/-]|[\\w-][\\w\\/-]*[\\w-])$",
                    "minLength": 0,
                    "maxLength": 255
                }
            },
            "required": [
                "curie",
                "id"
            ],
            "additionalProperties": false,
            "description": "A fully qualified reference to what updated this node. This is intentionally a message-ref and not a user id because it is often a program that updates nodes, not a user. E.g. \"acme:iam:node:app:cli-scheduler\" or \"acme:iam:node:user:60c71df0-fda8-11e5-bfb9-30342d363854\"",
            "pbj": {
                "type": "message-ref",
                "rule": "single"
            }
        },
        "last_event_ref": {
            "type": "object",
            "properties": {
                "curie": {
                    "type": "string",
                    "pattern": "^([a-z0-9-]+):([a-z0-9\\.-]+):([a-z0-9-]+)?:([a-z0-9-]+)$",
                    "minLength": 0,
                    "maxLength": 146
                },
                "id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9:_\\-]+$",
                    "minLength": 0,
                    "maxLength": 255
                },
                "tag": {
                    "type": "string",
                    "pattern": "^([\\w\\/-]|[\\w-][\\w\\/-]*[\\w-])$",
                    "minLength": 0,
                    "maxLength": 255
                }
            },
            "required": [
                "curie",
                "id"
            ],
            "additionalProperties": false,
            "description": "A reference to the last event that changed the state of this node. E.g. \"acme:blog:event:article-published:60c71df0-fda8-11e5-bfb9-30342d363854\"",
            "pbj": {
                "type": "message-ref",
                "rule": "single"
            }
        },
        "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 255,
            "pbj": {
                "type": "string",
                "rule": "single"
            }
        },
        "comments": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "views": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "disqus_comments": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "disqus_dislikes": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "disqus_likes": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "fb_comments": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "fb_reactions": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "fb_shares": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "fb_engagement": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "description": "The sum of all fb_* metrics collected.",
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_entrances": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_entrance_rate": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_pageviews": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_unique_pageviews": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_time_on_page": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_avg_time_on_page": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_exits": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        },
        "ga_exit_rate": {
            "type": "integer",
            "default": 0,
            "minimum": 0,
            "maximum": 4294967295,
            "pbj": {
                "type": "int",
                "rule": "single"
            }
        }
    },
    "required": [
        "_id"
    ],
    "additionalProperties": true
}