diff --git a/resources/output_schema.json b/resources/output_schema.json index 58bb9aa..36c2433 100644 --- a/resources/output_schema.json +++ b/resources/output_schema.json @@ -196,6 +196,10 @@ }, "docsUrl": { "type": "string" + }, + "restricted": { + "type": "boolean", + "default": false } }, "required": [ diff --git a/resources/schema.json b/resources/schema.json index d617b63..e9350f6 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -120,6 +120,11 @@ "docsUrl": { "type": "string", "description": "The url of the addon's documentation" + }, + "restricted": { + "type": "boolean", + "description": "Mark the restricted access to any of dependencies.", + "default": false } }, "additionalProperties": false, diff --git a/scripts/generate-index-json.ts b/scripts/generate-index-json.ts index 7de348f..f0c60ea 100644 --- a/scripts/generate-index-json.ts +++ b/scripts/generate-index-json.ts @@ -19,6 +19,7 @@ import type { Organization, Application, } from '../site/src/schema'; +import { appIndexSchema } from '../site/src/schema'; import { ParsedOrgFile, readOrgIndexFiles } from './orgFiles'; import { execSync } from 'child_process'; @@ -143,6 +144,8 @@ async function fetchRepoData( let docsUrl = app.docsUrl ?? await getReadmeUrl(orgId, app); + const restricted = app.restricted ? app.restricted : appIndexSchema.properties.apps.items.properties.restricted?.default; + console.log(colours.green(`Fetched data for ${orgId}/${app.name}`)); return { @@ -164,6 +167,7 @@ async function fetchRepoData( releases: app.releases, tags: app.tags, docsUrl: docsUrl, + restricted: restricted, }; } catch { throw new Error(`Failed to fetch data for ${orgId}/${app.name}`); diff --git a/site/src/schema.ts b/site/src/schema.ts index eff7d72..e37ae22 100644 --- a/site/src/schema.ts +++ b/site/src/schema.ts @@ -123,6 +123,11 @@ export const appMetadataSchema = { docsUrl: { type: 'string', description: `The url of the addon's documentation` + }, + restricted: { + type: 'boolean', + description: 'Mark the restricted access to any of dependencies.', + default: false } }, additionalProperties: false, @@ -215,6 +220,7 @@ export const appSchema = { lastUpdate: { type: 'string', format: 'date-time' }, apps: { type: 'string' }, docsUrl: { type: 'string' }, + restricted: { type: 'boolean', default: false }, }, required: [ 'id',