From 097910aaa98918f7acf4096e10c5f6d487873dc8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 06:40:53 +0000 Subject: [PATCH] fix(openapi): sync with openapi definition --- openapi.json | 178 +++++++++++++++++++++++++++++--------------- types/api.d.ts | 198 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 307 insertions(+), 69 deletions(-) diff --git a/openapi.json b/openapi.json index 372e950..b7ffd79 100644 --- a/openapi.json +++ b/openapi.json @@ -343,6 +343,66 @@ "license_allow_list" ] }, + "LicenseAllowList": { + "type": "object", + "additionalProperties": false, + "description": "", + "properties": { + "allowedApprovalSources": { + "type": "array", + "items": { + "type": "string", + "description": "", + "default": "" + } + }, + "allowedFamilies": { + "type": "array", + "items": { + "type": "string", + "description": "", + "default": "" + } + }, + "allowedTiers": { + "type": "array", + "items": { + "type": "string", + "description": "", + "default": "" + } + }, + "allowedStrings": { + "type": "array", + "items": { + "type": "string", + "description": "", + "default": "" + } + }, + "allowedPURLs": { + "type": "array", + "items": { + "type": "string", + "description": "", + "default": "" + } + }, + "focusAlertsHere": { + "type": "boolean", + "default": false, + "description": "" + } + }, + "required": [ + "allowedApprovalSources", + "allowedFamilies", + "allowedPURLs", + "allowedStrings", + "allowedTiers", + "focusAlertsHere" + ] + }, "CDXManifestSchema": { "type": "object", "additionalProperties": false, @@ -1186,66 +1246,6 @@ "purl" ] }, - "LicenseAllowList": { - "type": "object", - "additionalProperties": false, - "description": "", - "properties": { - "allowedApprovalSources": { - "type": "array", - "items": { - "type": "string", - "description": "", - "default": "" - } - }, - "allowedFamilies": { - "type": "array", - "items": { - "type": "string", - "description": "", - "default": "" - } - }, - "allowedTiers": { - "type": "array", - "items": { - "type": "string", - "description": "", - "default": "" - } - }, - "allowedStrings": { - "type": "array", - "items": { - "type": "string", - "description": "", - "default": "" - } - }, - "allowedPURLs": { - "type": "array", - "items": { - "type": "string", - "description": "", - "default": "" - } - }, - "focusAlertsHere": { - "type": "boolean", - "default": false, - "description": "" - } - }, - "required": [ - "allowedApprovalSources", - "allowedFamilies", - "allowedPURLs", - "allowedStrings", - "allowedTiers", - "focusAlertsHere" - ] - }, "CDXComponentSchema": { "type": "object", "additionalProperties": false, @@ -7535,6 +7535,64 @@ "x-readme": {} } }, + "/saturate-license-policy": { + "post": { + "tags": [ + "Packages" + ], + "summary": "Saturate License Policy (Beta)", + "operationId": "saturateLicensePolicy", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LicenseAllowList" + } + } + }, + "required": false + }, + "security": [ + { + "basicAuth": [ + "packages:list" + ] + } + ], + "description": "Get the \"saturated\" version of a license policy's allow list, filling in the entire set of allowed\nlicense data. For example, the saturated form of a license allow list which only specifies that\nlicenses in the tier \"maximal copyleft\" are allowed is shown below (note the expanded `allowedStrings` property):\n\n```json\n{\n \"allowedApprovalSources\": [],\n \"allowedFamilies\": [],\n \"allowedTiers\": [\n \"maximal copyleft\"\n ],\n \"allowedStrings\": [\n \"Parity-6.0.0\",\n \"QPL-1.0-INRIA-2004\",\n \"QPL-1.0\",\n \"RPL-1.1\",\n \"RPL-1.5\"\n ],\n \"allowedPURLs\": [],\n \"focusAlertsHere\": false\n}\n``` \n\nThis may be helpful for users who want to compose more complex sets of allowed license data via \nthe \"allowedStrings\" property, or for users who want to know more about the contents of a particular\nlicense group (family, tier, or approval source).\n\n## Allow List Schema\n\n```json\n```\n\nwhere\n\nPermissiveTier ::= \"model permissive\" | \"gold\" | \"silver\" | \"bronze\" | \"lead\"\nCopyleftTier ::= \"maximal copyleft\" | \"network copyleft\" | \"strong copyleft\" | \"weak copyleft\"\n\n## Return Value\n\nThe returned value has the same shape as a license allow list:\n\n```json\n{\n allowedApprovalSources?: Array<\"fsf\" | \"osi\">,\n allowedFamilies?: Array<\"copyleft\" | \"permissive\">,\n allowedTiers?: Array,\n allowedStrings?: Array\n allowedPURLs?: Array\n focusAlertsHere?: boolean\n}\n```\n\nwhere\n\nPermissiveTier ::= \"model permissive\" | \"gold\" | \"silver\" | \"bronze\" | \"lead\"\nCopyleftTier ::= \"maximal copyleft\" | \"network copyleft\" | \"strong copyleft\" | \"weak copyleft\"\n\nreaders can learn more about [copyleft tiers](https://blueoakcouncil.org/copyleft) and [permissive tiers](https://blueoakcouncil.org/list) by reading the linked resources.\n\n### Example request bodies:\n```json\n{\n \"allowedApprovalSources\": [\"fsf\"],\n \"allowedPURLs\": [],\n \"allowedFamilies\": [\"copyleft\"],\n \"allowedTiers\": [\"model permissive\"],\n \"allowedStrings\": [\"License :: OSI Approved :: BSD License\"],\n \"focusAlertsHere\": false\n}\n```\n\nThis endpoint consumes 100 units of your quota.\n\nThis endpoint requires the following org token scopes:\n- packages:list", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LicenseAllowList" + } + } + }, + "description": "Saturated License Allow List" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + }, + "500": { + "$ref": "#/components/responses/SocketInternalServerError" + } + }, + "x-readme": {} + } + }, "/orgs/{org_slug}/audit-log": { "get": { "tags": [ diff --git a/types/api.d.ts b/types/api.d.ts index 54d62a8..286a835 100644 --- a/types/api.d.ts +++ b/types/api.d.ts @@ -157,6 +157,87 @@ export interface paths { */ post: operations["licensePolicy"]; }; + "/saturate-license-policy": { + /** + * Saturate License Policy (Beta) + * @description Get the "saturated" version of a license policy's allow list, filling in the entire set of allowed + * license data. For example, the saturated form of a license allow list which only specifies that + * licenses in the tier "maximal copyleft" are allowed is shown below (note the expanded `allowedStrings` property): + * + * ```json + * { + * "allowedApprovalSources": [], + * "allowedFamilies": [], + * "allowedTiers": [ + * "maximal copyleft" + * ], + * "allowedStrings": [ + * "Parity-6.0.0", + * "QPL-1.0-INRIA-2004", + * "QPL-1.0", + * "RPL-1.1", + * "RPL-1.5" + * ], + * "allowedPURLs": [], + * "focusAlertsHere": false + * } + * ``` + * + * This may be helpful for users who want to compose more complex sets of allowed license data via + * the "allowedStrings" property, or for users who want to know more about the contents of a particular + * license group (family, tier, or approval source). + * + * ## Allow List Schema + * + * ```json + * ``` + * + * where + * + * PermissiveTier ::= "model permissive" | "gold" | "silver" | "bronze" | "lead" + * CopyleftTier ::= "maximal copyleft" | "network copyleft" | "strong copyleft" | "weak copyleft" + * + * ## Return Value + * + * The returned value has the same shape as a license allow list: + * + * ```json + * { + * allowedApprovalSources?: Array<"fsf" | "osi">, + * allowedFamilies?: Array<"copyleft" | "permissive">, + * allowedTiers?: Array, + * allowedStrings?: Array + * allowedPURLs?: Array + * focusAlertsHere?: boolean + * } + * ``` + * + * where + * + * PermissiveTier ::= "model permissive" | "gold" | "silver" | "bronze" | "lead" + * CopyleftTier ::= "maximal copyleft" | "network copyleft" | "strong copyleft" | "weak copyleft" + * + * readers can learn more about [copyleft tiers](https://blueoakcouncil.org/copyleft) and [permissive tiers](https://blueoakcouncil.org/list) by reading the linked resources. + * + * ### Example request bodies: + * ```json + * { + * "allowedApprovalSources": ["fsf"], + * "allowedPURLs": [], + * "allowedFamilies": ["copyleft"], + * "allowedTiers": ["model permissive"], + * "allowedStrings": ["License :: OSI Approved :: BSD License"], + * "focusAlertsHere": false + * } + * ``` + * + * This endpoint consumes 100 units of your quota. + * + * This endpoint requires the following org token scopes: + * - packages:list + */ + post: operations["saturateLicensePolicy"]; + }; "/orgs/{org_slug}/audit-log": { /** * Get Audit Log Events @@ -614,6 +695,15 @@ export interface components { components: components["schemas"]["SocketBatchPURLRequest"][]; license_allow_list: components["schemas"]["LicenseAllowList"]; }; + LicenseAllowList: { + allowedApprovalSources: string[]; + allowedFamilies: string[]; + allowedTiers: string[]; + allowedStrings: string[]; + allowedPURLs: string[]; + /** @default false */ + focusAlertsHere: boolean; + }; CDXManifestSchema: { /** @default CycloneDX */ bomFormat: string; @@ -840,15 +930,6 @@ export interface components { /** @default */ purl: string; }; - LicenseAllowList: { - allowedApprovalSources: string[]; - allowedFamilies: string[]; - allowedTiers: string[]; - allowedStrings: string[]; - allowedPURLs: string[]; - /** @default false */ - focusAlertsHere: boolean; - }; CDXComponentSchema: { /** @default */ author?: string; @@ -2632,6 +2713,105 @@ export interface operations { 500: components["responses"]["SocketInternalServerError"]; }; }; + /** + * Saturate License Policy (Beta) + * @description Get the "saturated" version of a license policy's allow list, filling in the entire set of allowed + * license data. For example, the saturated form of a license allow list which only specifies that + * licenses in the tier "maximal copyleft" are allowed is shown below (note the expanded `allowedStrings` property): + * + * ```json + * { + * "allowedApprovalSources": [], + * "allowedFamilies": [], + * "allowedTiers": [ + * "maximal copyleft" + * ], + * "allowedStrings": [ + * "Parity-6.0.0", + * "QPL-1.0-INRIA-2004", + * "QPL-1.0", + * "RPL-1.1", + * "RPL-1.5" + * ], + * "allowedPURLs": [], + * "focusAlertsHere": false + * } + * ``` + * + * This may be helpful for users who want to compose more complex sets of allowed license data via + * the "allowedStrings" property, or for users who want to know more about the contents of a particular + * license group (family, tier, or approval source). + * + * ## Allow List Schema + * + * ```json + * ``` + * + * where + * + * PermissiveTier ::= "model permissive" | "gold" | "silver" | "bronze" | "lead" + * CopyleftTier ::= "maximal copyleft" | "network copyleft" | "strong copyleft" | "weak copyleft" + * + * ## Return Value + * + * The returned value has the same shape as a license allow list: + * + * ```json + * { + * allowedApprovalSources?: Array<"fsf" | "osi">, + * allowedFamilies?: Array<"copyleft" | "permissive">, + * allowedTiers?: Array, + * allowedStrings?: Array + * allowedPURLs?: Array + * focusAlertsHere?: boolean + * } + * ``` + * + * where + * + * PermissiveTier ::= "model permissive" | "gold" | "silver" | "bronze" | "lead" + * CopyleftTier ::= "maximal copyleft" | "network copyleft" | "strong copyleft" | "weak copyleft" + * + * readers can learn more about [copyleft tiers](https://blueoakcouncil.org/copyleft) and [permissive tiers](https://blueoakcouncil.org/list) by reading the linked resources. + * + * ### Example request bodies: + * ```json + * { + * "allowedApprovalSources": ["fsf"], + * "allowedPURLs": [], + * "allowedFamilies": ["copyleft"], + * "allowedTiers": ["model permissive"], + * "allowedStrings": ["License :: OSI Approved :: BSD License"], + * "focusAlertsHere": false + * } + * ``` + * + * This endpoint consumes 100 units of your quota. + * + * This endpoint requires the following org token scopes: + * - packages:list + */ + saturateLicensePolicy: { + requestBody?: { + content: { + "application/json": components["schemas"]["LicenseAllowList"]; + }; + }; + responses: { + /** @description Saturated License Allow List */ + 200: { + content: { + "application/json": components["schemas"]["LicenseAllowList"]; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + 500: components["responses"]["SocketInternalServerError"]; + }; + }; /** * Get Audit Log Events * @description Paginated list of audit log events.