pwabuilder-lib
Version:
PWA Builder Core Library
107 lines (103 loc) • 4.12 kB
JSON
{
"title": "JSON schema for Web Application manifest files (schema extensions)",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"mjs_access_whitelist": {
"description": "The mjs_access_whitelist member is an array of rules that indicates the type of access the URLs matching the rule should have.",
"type": "array",
"items": {
"$ref": "#/definitions/mjs_access_whitelist_rule"
}
},
"mjs_extended_scope": {
"description": "The mjs_extended_scope member is an array of rules that define the navigation scope of this web application's application context.",
"type": "array",
"items": {
"type": "string", "format": "uri"
}
},
"mjs_api_access": {
"description": "The mjs_api_whitelist member is an array of rules that indicates the type of access to the runtime API the URLs matching the rule should have.",
"type": "array",
"items": {
"$ref": "#/definitions/mjs_api_access_rule"
}
},
"mjs_import_scripts": {
"description": "The mjs_import_scripts member is an array of script files that will be loaded into the application.",
"type": "array",
"items": {
"$ref": "#/definitions/mjs_import_scripts_rule"
}
},
"mjs_cordova": {
"description": "Specify how to load the Cordova and plugin JavaScript files.",
"type": "object",
"properties": {
"plugin_mode" : {
"description" : "Defines where the Cordova and plugin JavaScript files are injected from.",
"enum" : [ "client", "server" ]
},
"base_url" : {
"description": "When pluginMode is configured as “server”, this property specifies the exact location in the server of the Cordova and plugin JavaScript files.",
"type" : "string",
"format" : "uri"
}
}
}
},
"definitions": {
"mjs_access_whitelist_rule": {
"type": "object",
"properties": {
"url": {
"description": "A string that represents the URL pattern for which the rule should be applied to.",
"type": "string",
"format": "uri"
},
"apiAccess" : {
"description": "A string that defines the type of access to the runtime API where the application is running.",
"enum": [ "none", "all", "allowForWebOnly" ]
}
}
},
"mjs_api_access_rule": {
"type": "object",
"properties": {
"match": {
"description": "A string or array of strings that represent the URL pattern(s) for which the rule should be applied to.",
"oneOf": [
{ "type": "string", "format": "uri" },
{ "type": "array", "items": { "type": "string", "format": "uri" } }
]
},
"platform" : {
"description": "Specifies the platforms for which the rule should be applied to.",
"type": "string"
},
"access" : {
"description": "Defines the type of access to the runtime API where the application is running. Could be extended in the future to accept other types for platforms with different access requirements.",
"type": "string"
}
}
},
"mjs_import_scripts_rule": {
"type": "object",
"properties": {
"src" : {
"description": "The URL where the custom script file is located. The source can be specified as a path of the script file in the app package, or as a full URL to retrieve the file from the server.",
"type": "string",
"format": "uri"
},
"match": {
"description": "A string or array of strings that represent the URL pattern(s) for which the script file should be loaded.",
"oneOf": [
{ "type": "string", "format": "uri" },
{ "type": "array", "items": { "type": "string", "format": "uri" } }
]
}
}
}
}
}