Import of the watch repository from Pebble

This commit is contained in:
Matthieu Jeanson 2024-12-12 16:43:03 -08:00 committed by Katharine Berry
commit 3b92768480
10334 changed files with 2564465 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema",
"description": "A project containing a Pebble application",
"type": "object",
"$ref": "file_types.json#/appinfo-json"
}

View file

@ -0,0 +1,76 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema for Attributes",
"description": "Schema for each type of valid attribute in Pebble projects",
"appKeys": {
"type": "object",
"patternProperties": {
"^\\w*$": { "$ref": "data_types.json#/UInt32" }
},
"additionalProperties": false
},
"capabilities": {
"type": "array",
"items": { "enum": ["location", "configurable", "health"] },
"uniqueItems": true
},
"messageKeys": {
"oneOf": [
{ "$ref": "attributes.json#/appKeys" },
{ "$ref": "data_types.json#/identifierArray" }
]
},
"resources": {
"type": "object",
"properties": {
"media": {
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "resource_types.json#/bitmap" },
{ "$ref": "resource_types.json#/deprecatedImageFormat" },
{ "$ref": "resource_types.json#/font" },
{ "$ref": "resource_types.json#/raw" }
]
},
"uniqueItems": true
},
"publishedMedia": {
"type": "array",
"items": {
"type": "object",
"oneOf": [
{ "$ref": "resource_types.json#/publishedMediaAlias" },
{ "$ref": "resource_types.json#/publishedMediaGlance" },
{ "$ref": "resource_types.json#/publishedMediaTimeline" }
]
},
"uniqueItems": true
}
},
"additionalProperties": false,
"dependencies": {
"publishedMedia": [ "media" ]
}
},
"sdkVersion": { "enum": [ "2", "3" ] },
"targetPlatforms": {
"type": "array",
"items": { "enum": [ "aplite", "basalt", "chalk", "diorite" ] },
"uniqueItems": true
},
"uuid": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"watchapp": {
"type": "object",
"properties": {
"watchface": { "type": "boolean" },
"hiddenApp": { "type": "boolean" },
"onlyShownOnCommunication": { "type": "boolean" }
},
"additionalProperties": false
}
}

View file

@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema for Types",
"description": "Schema for complex data types in Pebble projects",
"UInt8": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"UInt32": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"identifier": {
"type": "string",
"pattern": "^\\w*$"
},
"identifierArray": {
"type": "array",
"items": { "$ref": "#/identifier" }
},
"stringArray": {
"type": "array",
"items": { "type": "string" }
}
}

View file

@ -0,0 +1,67 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema for Project JSON Files",
"description": "Schema for supported JSON Pebble project files",
"package-json": {
"properties": {
"name": { "type": "string" },
"author": {
"description": "https://docs.npmjs.com/files/package.json#people-fields-author-contributors",
"oneOf": [
{
"type": "string",
"pattern": "^([^<(]+?)?[ \\\\t]*(?:<([^>(]+?)>)?[ \\\\t]*(?:\\\\(([^)]+?)\\\\)|$)"
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"url": { "type": "string" }
},
"additionalProperties": false
}
]
},
"version": { "type": "string" },
"keywords": { "$ref": "data_types.json#/stringArray" },
"private": { "type": "boolean" },
"dependencies": {
"type": "object",
"patternProperties": {
".": { "type": "string" }
},
"additionalProperties": false
},
"files": { "$ref": "data_types.json#/stringArray" },
"pebble": {
"type": "object",
"oneOf": [
{ "$ref": "project_types.json#/native-app" },
{ "$ref": "project_types.json#/rocky-app" },
{ "$ref": "project_types.json#/package" }
]
}
},
"required": [ "name", "author", "version", "pebble" ]
},
"appinfo-json": {
"properties": {
"uuid": { "$ref": "attributes.json#/uuid" },
"shortName": { "type": "string" },
"longName": { "type": "string" },
"companyName": { "type": "string" },
"versionCode": { "$ref": "data_types.json#/UInt8" },
"versionLabel": { "type": "string" },
"sdkVersion": { "$ref": "attributes.json#/sdkVersion" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" },
"watchapp": { "$ref": "attributes.json#/watchapp" },
"appKeys": { "$ref": "attributes.json#/appKeys" },
"resources": { "$ref": "attributes.json#/resources" },
"capabilities": { "$ref": "attributes.json#/capabilities" },
"enableMultiJS": { "type": "boolean" },
"projectType": { "enum": [ "native", "pebblejs" ] }
},
"required": ["uuid", "longName", "companyName", "versionLabel"]
}
}

View file

@ -0,0 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema",
"description": "A project containing a Pebble application",
"type": "object",
"$ref": "file_types.json#/package-json"
}

View file

@ -0,0 +1,43 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema for Project Types",
"description": "Schema for each type of valid Pebble project",
"native-app": {
"properties": {
"displayName": { "type": "string" },
"uuid": { "$ref": "attributes.json#/uuid" },
"sdkVersion": { "$ref": "attributes.json#/sdkVersion" },
"projectType": { "enum": [ "native" ] },
"enableMultiJS": { "type": "boolean" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" },
"watchapp": { "$ref": "attributes.json#/watchapp" },
"capabilities": { "$ref": "attributes.json#/capabilities" },
"appKeys": { "$ref": "attributes.json#/appKeys" },
"messageKeys": { "$ref": "attributes.json#/messageKeys" }
},
"required": [ "displayName", "uuid", "sdkVersion" ]
},
"rocky-app": {
"properties": {
"displayName": { "type": "string" },
"uuid": { "$ref": "attributes.json#/uuid" },
"sdkVersion": { "$ref": "attributes.json#/sdkVersion" },
"projectType": { "enum": [ "rocky" ] },
"enableMultiJS": { "type": "boolean" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" },
"watchapp": { "$ref": "attributes.json#/watchapp" },
"capabilities": { "$ref": "attributes.json#/capabilities" }
},
"required": [ "displayName", "uuid", "sdkVersion", "projectType" ]
},
"package": {
"properties": {
"sdkVersion": { "$ref": "attributes.json#/sdkVersion" },
"projectType": { "enum": [ "package" ] },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" },
"capabilities": { "$ref": "attributes.json#/capabilities" },
"messageKeys": { "$ref": "attributes.json#/messageKeys" }
},
"required": [ "sdkVersion", "projectType" ]
}
}

View file

@ -0,0 +1,84 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Pebble JSON Schema for Resource Types",
"description": "Schema for each type of valid resource in Pebble projects",
"bitmap": {
"properties": {
"name": { "$ref": "data_types.json#/identifier" },
"type": { "enum": ["bitmap"] },
"file": { "type": "string" },
"menuIcon": { "type": "boolean" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" },
"storageFormat": { "enum": [ "pbi", "png" ] },
"memoryFormat": {
"enum": [
"Smallest",
"SmallestPalette",
"1Bit",
"8Bit",
"1BitPalette",
"2BitPalette",
"4BitPalette"
]
},
"spaceOptimization": { "enum": [ "storage", "memory" ] }
}
},
"deprecatedImageFormat": {
"properties": {
"name": { "$ref": "data_types.json#/identifier" },
"type": { "enum": ["png", "pbi", "pbi8", "png-trans"] },
"file": { "type": "string" },
"menuIcon": { "type": "boolean" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" }
},
"required": ["name", "type", "file"]
},
"font": {
"properties": {
"name": { "$ref": "data_types.json#/identifier" },
"type": { "enum": ["font"] },
"file": { "type": "string" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" },
"characterRegex": { "type": "string" }
},
"required": ["name", "type", "file"]
},
"raw": {
"properties": {
"name": { "$ref": "data_types.json#/identifier" },
"type": { "enum": ["raw"] },
"file": { "type": "string" },
"targetPlatforms": { "$ref": "attributes.json#/targetPlatforms" }
},
"required": ["name", "type", "file"]
},
"publishedMediaItem": {
"name": { "$ref": "data_types.json#/identifier" },
"id": { "$ref": "data_types.json#/UInt32" },
"alias": { "$ref": "data_types.json#/identifier" },
"glance": { "$ref": "data_types.json#/identifier" },
"timeline": {
"type": "object",
"properties": {
"tiny": { "$ref": "data_types.json#/identifier" },
"small": { "$ref": "data_types.json#/identifier" },
"large": { "$ref": "data_types.json#/identifier" }
},
"required": [ "tiny" ]
}
},
"publishedMediaAlias": {
"properties": { "$ref": "#/publishedMediaItem" },
"required": ["name", "id", "alias"]
},
"publishedMediaGlance": {
"properties": { "$ref": "#/publishedMediaItem" },
"required": ["name", "id", "glance"]
},
"publishedMediaTimeline": {
"properties": { "$ref": "#/publishedMediaItem" },
"required": ["name", "id", "timeline"]
}
}