|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft-06/schema#", |
| 3 | + "title": "Modpm Manifest", |
| 4 | + "description": "Represents the manifest of installed packages in a given scope.", |
| 5 | + "type": "object", |
| 6 | + "properties": { |
| 7 | + "manifestVersion": { |
| 8 | + "const": 0, |
| 9 | + "description": "Manifest schema version." |
| 10 | + }, |
| 11 | + "packages": { |
| 12 | + "type": "array", |
| 13 | + "description": "Installed packages.", |
| 14 | + "items": { |
| 15 | + "$ref": "#/definitions/InstalledPackage" |
| 16 | + } |
| 17 | + } |
| 18 | + }, |
| 19 | + "required": ["manifestVersion", "packages"], |
| 20 | + "additionalProperties": false, |
| 21 | + "definitions": { |
| 22 | + "Dependency": { |
| 23 | + "type": "object", |
| 24 | + "description": "Represents a dependency of a specific package version. If version is specified, the dependency is on that specific version of the package only.", |
| 25 | + "properties": { |
| 26 | + "type": { |
| 27 | + "enum": ["required", "optional", "embedded", "incompatible"], |
| 28 | + "description": "Type of the dependency." |
| 29 | + }, |
| 30 | + "package": { |
| 31 | + "type": "string", |
| 32 | + "description": "ID of the dependency package." |
| 33 | + }, |
| 34 | + "version": { |
| 35 | + "type": "string", |
| 36 | + "description": "ID of the dependency version." |
| 37 | + } |
| 38 | + }, |
| 39 | + "required": ["type", "package"], |
| 40 | + "additionalProperties": false |
| 41 | + }, |
| 42 | + "File": { |
| 43 | + "type": "object", |
| 44 | + "description": "Represents a downloadable file associated with a specific version of a package.", |
| 45 | + "properties": { |
| 46 | + "hash": { |
| 47 | + "type": "string", |
| 48 | + "pattern": "^[\\da-f]{128}$", |
| 49 | + "description": "SHA-512 hash of the file." |
| 50 | + }, |
| 51 | + "url": { |
| 52 | + "type": "string", |
| 53 | + "description": "Direct download URL." |
| 54 | + }, |
| 55 | + "name": { |
| 56 | + "type": "string", |
| 57 | + "description": "Name of the file." |
| 58 | + }, |
| 59 | + "size": { |
| 60 | + "type": "number", |
| 61 | + "description": "Size of the file in bytes." |
| 62 | + } |
| 63 | + }, |
| 64 | + "required": ["hash", "url", "name", "size"], |
| 65 | + "additionalProperties": false |
| 66 | + }, |
| 67 | + "Version": { |
| 68 | + "type": "object", |
| 69 | + "description": "Represents a specific version of a package that can be installed.", |
| 70 | + "properties": { |
| 71 | + "id": { |
| 72 | + "type": "string", |
| 73 | + "description": "Unique ID of the version." |
| 74 | + }, |
| 75 | + "number": { |
| 76 | + "type": "string", |
| 77 | + "description": "Version number.", |
| 78 | + "examples": ["1.0.0"] |
| 79 | + }, |
| 80 | + "dependencies": { |
| 81 | + "type": "array", |
| 82 | + "description": "Dependencies required by this version.", |
| 83 | + "items": { |
| 84 | + "$ref": "#/definitions/Dependency" |
| 85 | + } |
| 86 | + }, |
| 87 | + "file": { |
| 88 | + "$ref": "#/definitions/File" |
| 89 | + } |
| 90 | + }, |
| 91 | + "required": ["id", "number", "dependencies", "file"], |
| 92 | + "additionalProperties": false |
| 93 | + }, |
| 94 | + "InstalledPackage": { |
| 95 | + "type": "object", |
| 96 | + "description": "Represents an installed package.", |
| 97 | + "properties": { |
| 98 | + "id": { |
| 99 | + "type": "string", |
| 100 | + "description": "Unique ID of the package." |
| 101 | + }, |
| 102 | + "slug": { |
| 103 | + "type": "string", |
| 104 | + "description": "Slug of the package." |
| 105 | + }, |
| 106 | + "name": { |
| 107 | + "type": "string", |
| 108 | + "description": "Name of the package." |
| 109 | + }, |
| 110 | + "path": { |
| 111 | + "type": "string", |
| 112 | + "description": "Path where the package is installed." |
| 113 | + }, |
| 114 | + "reason": { |
| 115 | + "enum": ["user", "dependency"], |
| 116 | + "description": "Reason why this package was installed." |
| 117 | + }, |
| 118 | + "version": { |
| 119 | + "$ref": "#/definitions/Version" |
| 120 | + } |
| 121 | + }, |
| 122 | + "required": ["id", "slug", "name", "path", "reason", "version"], |
| 123 | + "additionalProperties": false |
| 124 | + } |
| 125 | + } |
| 126 | +} |
0 commit comments