Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
387 changes: 387 additions & 0 deletions contracts/schema/pocket-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pocketjs.dev/schema/pocket-3.json",
"title": "Pocket application manifest, format 3",
"type": "object",
"additionalProperties": false,
"required": [
"$schema",
"pocket",
"id",
"name",
"title",
"version",
"engine",
"app"
],
"properties": {
"$schema": {
"const": "https://pocketjs.dev/schema/pocket-3.json"
},
"pocket": {
"const": 3
},
"id": {
"type": "string",
"minLength": 3,
"pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"version": {
"type": "string",
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$"
},
"execution": {
"type": "object",
"additionalProperties": false,
"required": [
"classes"
],
"properties": {
"classes": {
"type": "array",
"items": {
"enum": [
"guest",
"aot"
]
},
"minItems": 1,
"uniqueItems": true
}
}
},
"engine": {
"type": "object",
"additionalProperties": false,
"required": [
"capabilities"
],
"properties": {
"capabilities": {
"type": "object",
"additionalProperties": false,
"required": [
"requires"
],
"properties": {
"requires": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$"
},
"minItems": 1,
"uniqueItems": true
},
"enhances": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$"
},
"uniqueItems": true
}
}
}
}
},
"app": {
"type": "object",
"additionalProperties": false,
"required": [
"entry",
"framework",
"viewport"
],
"properties": {
"entry": {
"type": "string",
"minLength": 1,
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+\\.tsx?$"
},
"output": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
},
"framework": {
"enum": [
"solid",
"vue-vapor",
"octane"
]
},
"companions": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
},
"uniqueItems": true
},
"viewport": {
"anyOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"logical",
"presentation"
],
"properties": {
"logical": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 2,
"maxItems": 2
},
"presentation": {
"enum": [
"fill",
"fit",
"integer-fit",
"native",
"stretch"
]
}
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"fixed": {
"type": "object",
"additionalProperties": false,
"required": [
"logical",
"presentation"
],
"properties": {
"logical": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 2,
"maxItems": 2
},
"presentation": {
"enum": [
"fill",
"fit",
"integer-fit",
"native",
"stretch"
]
}
}
},
"dynamic": {
"type": "object",
"additionalProperties": false,
"required": [
"default"
],
"properties": {
"default": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 2,
"maxItems": 2
},
"min": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 2,
"maxItems": 2
},
"max": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"minItems": 2,
"maxItems": 2
}
}
}
}
}
]
}
}
},
"permissions": {
"type": "object",
"additionalProperties": false,
"properties": {
"network": {
"type": "object",
"additionalProperties": false,
"properties": {
"connect": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"protocol",
"host",
"port"
],
"properties": {
"protocol": {
"enum": [
"http",
"https",
"ws",
"wss"
]
},
"host": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"port": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 65535
},
{
"type": "object",
"additionalProperties": false,
"required": [
"min",
"max"
],
"properties": {
"min": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"max": {
"type": "integer",
"minimum": 1,
"maximum": 65535
}
}
}
]
}
}
}
},
"listen": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"protocol",
"address",
"port"
],
"properties": {
"protocol": {
"enum": [
"http",
"https",
"ws",
"wss"
]
},
"address": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"port": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 65535
},
{
"type": "object",
"additionalProperties": false,
"required": [
"min",
"max"
],
"properties": {
"min": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"max": {
"type": "integer",
"minimum": 1,
"maximum": 65535
}
}
},
{
"const": "ephemeral"
}
]
}
}
}
},
"credentials": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
},
"uniqueItems": true
},
"localNetwork": {
"type": "boolean"
},
"insecureTransport": {
"type": "boolean"
},
"allowInvalidTlsForDevelopment": {
"type": "boolean"
}
}
}
}
}
}
}
Loading