|
| 1 | +module.exports = { |
| 2 | + type: 'object', |
| 3 | + required: ['name', 'uniqueClass', 'image', 'bgColor', 'libs'], |
| 4 | + properties: { |
| 5 | + name: { |
| 6 | + type: 'string', |
| 7 | + minLength: 1, |
| 8 | + }, |
| 9 | + uniqueClass: { |
| 10 | + type: 'string', |
| 11 | + minLength: 1, |
| 12 | + // Not entirely correct, but good enough |
| 13 | + pattern: /[a-zA-Z_][\w\-]*/ |
| 14 | + }, |
| 15 | + image: { |
| 16 | + type: 'string', |
| 17 | + minLength: 1, |
| 18 | + pattern: /\/img\/.*/ |
| 19 | + }, |
| 20 | + bgColor: { |
| 21 | + type: 'string', |
| 22 | + minLength: 1 |
| 23 | + }, |
| 24 | + libs: { |
| 25 | + type: 'array', |
| 26 | + uniqueItems: true, |
| 27 | + items: { |
| 28 | + type: 'object', |
| 29 | + required: ['minimumVersion', 'support', 'authorUrl', 'authorName', |
| 30 | + 'gitHubRepoPath', 'repoUrl', 'installCommandHtml'], |
| 31 | + properties: { |
| 32 | + minimumVersion: { |
| 33 | + type: ['null', 'string'], |
| 34 | + minLength: 1 |
| 35 | + }, |
| 36 | + authorUrl: { |
| 37 | + type: ['null', 'string'], |
| 38 | + minLength: 1, |
| 39 | + // Format validator fails on null values, sigh. |
| 40 | + //format: 'url' |
| 41 | + }, |
| 42 | + authorName: { |
| 43 | + type: 'string', |
| 44 | + minLength: 1 |
| 45 | + }, |
| 46 | + gitHubRepoPath: { |
| 47 | + type: ['null', 'string'], |
| 48 | + minLength: 1, |
| 49 | + // Not entirely correct, but good enough |
| 50 | + pattern: /.*\/.*/ |
| 51 | + }, |
| 52 | + repoUrl: { |
| 53 | + type: 'string', |
| 54 | + minLength: 1, |
| 55 | + format: 'url' |
| 56 | + }, |
| 57 | + installCommandHtml: { |
| 58 | + type: 'string', |
| 59 | + minLength: 1 |
| 60 | + }, |
| 61 | + support: { |
| 62 | + type: 'object', |
| 63 | + required: ['sign', 'verify', 'iss', 'sub', 'aud', 'exp', 'nbf', |
| 64 | + 'iat', 'jti', 'hs256', 'hs384', 'hs512', 'rs256', |
| 65 | + 'rs384', 'rs512', 'es256', 'es384', 'es512'], |
| 66 | + properties: { |
| 67 | + sign: { type: 'boolean' }, |
| 68 | + verify: { type: 'boolean' }, |
| 69 | + iss: { type: 'boolean' }, |
| 70 | + sub: { type: 'boolean' }, |
| 71 | + aud: { type: 'boolean' }, |
| 72 | + exp: { type: 'boolean' }, |
| 73 | + nbf: { type: 'boolean' }, |
| 74 | + iat: { type: 'boolean' }, |
| 75 | + jti: { type: 'boolean' }, |
| 76 | + hs256: { type: 'boolean' }, |
| 77 | + hs384: { type: 'boolean' }, |
| 78 | + hs512: { type: 'boolean' }, |
| 79 | + rs256: { type: 'boolean' }, |
| 80 | + rs384: { type: 'boolean' }, |
| 81 | + rs512: { type: 'boolean' }, |
| 82 | + es256: { type: 'boolean' }, |
| 83 | + es384: { type: 'boolean' }, |
| 84 | + es512: { type: 'boolean' }, |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + } |
| 91 | +}; |
0 commit comments