{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$ref": "#/definitions/ResourceFile",
    "definitions": {
        "ResourceFile": {
            "type": "object",
            "properties": {
                "libraryVersion": {
                    "type": "number",
                    "description": "The library version of the currently present library",
                    "minimum": 1,
                    "default": 1
                },
                "trustToken": {
                    "type": "string",
                    "description": "The currently used trust token"
                },
                "notificationVapidCredentials": {
                    "type": "object",
                    "properties": {
                        "publicKey": {
                            "type": "string"
                        },
                        "privateKey": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "publicKey",
                        "privateKey"
                    ],
                    "additionalProperties": false,
                    "description": "The notification vapid credentials used to send push notifications"
                },
                "notificationSubscriptions": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/PushSubscription"
                    },
                    "description": "The active notification subscriptions with the server. This is used to send notifications to the client when the state changes"
                }
            },
            "required": [
                "libraryVersion"
            ],
            "additionalProperties": false,
            "description": "Persistent information, stored in a resource file"
        },
        "PushSubscription": {
            "type": "object",
            "properties": {
                "endpoint": {
                    "type": "string",
                    "description": "The Push Subscription Endpoint",
                    "minLength": 1
                },
                "expirationTime": {
                    "type": "number"
                },
                "keys": {
                    "type": "object",
                    "properties": {
                        "p256dh": {
                            "type": "string",
                            "minLength": 1
                        },
                        "auth": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "required": [
                        "p256dh",
                        "auth"
                    ],
                    "additionalProperties": false
                }
            },
            "required": [
                "endpoint",
                "keys"
            ],
            "additionalProperties": false,
            "description": "Expected data for a push subscription"
        }
    }
}
