diff --git a/src/Umbraco.Web.UI.Client/schemas/api/api.yml b/src/Umbraco.Web.UI.Client/schemas/api/api.yml index 974f5dc74a..a009719139 100644 --- a/src/Umbraco.Web.UI.Client/schemas/api/api.yml +++ b/src/Umbraco.Web.UI.Client/schemas/api/api.yml @@ -57,6 +57,22 @@ paths: application/json: schema: $ref: '#/components/schemas/ProblemDetails' + /manifests: + get: + operationId: Manifests + responses: + '200': + description: 200 response + content: + application/json: + schema: + $ref: '#/components/schemas/ManifestsResponse' + default: + description: default response + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' /server/status: get: operationId: GetStatus @@ -341,6 +357,99 @@ components: required: - user - telemetryLevel + ManifestStandardTypes: + type: string + enum: + - section + - propertyEditorUI + - dashboard + MetaSection: + type: object + properties: + pathname: + type: string + weight: + type: number + format: float + required: + - pathname + - weight + MetaPropertyEditorUI: + type: object + properties: + icon: + type: string + group: + type: string + required: + - icon + - group + MetaDashboard: + type: object + properties: + sections: + type: array + items: + type: string + pathname: + type: string + weight: + type: number + format: float + required: + - sections + - pathname + - weight + IManifestElement: + type: object + properties: + type: + $ref: '#/components/schemas/ManifestStandardTypes' + alias: + type: string + name: + type: string + js: + type: string + elementName: + type: string + meta: + oneOf: + - $ref: '#/components/schemas/MetaSection' + - $ref: '#/components/schemas/MetaPropertyEditorUI' + - $ref: '#/components/schemas/MetaDashboard' + required: + - type + - alias + - name + - js + - elementName + - meta + IManifestEntrypoint: + type: object + properties: + type: + type: string + enum: + - entrypoint + js: + type: string + required: + - type + - js + Manifest: + oneOf: + - $ref: '#/components/schemas/IManifestElement' + - $ref: '#/components/schemas/IManifestEntrypoint' + ManifestsResponse: + type: object + properties: + manifests: + type: array + items: + $ref: '#/components/schemas/Manifest' + required: + - manifests ServerStatus: type: string enum: diff --git a/src/Umbraco.Web.UI.Client/temp-schema-generator/api.ts b/src/Umbraco.Web.UI.Client/temp-schema-generator/api.ts index 51cdd0acc6..c7eb465583 100644 --- a/src/Umbraco.Web.UI.Client/temp-schema-generator/api.ts +++ b/src/Umbraco.Web.UI.Client/temp-schema-generator/api.ts @@ -1,4 +1,5 @@ import './installer'; +import './manifests'; import './server'; import './upgrader'; import './user'; diff --git a/src/Umbraco.Web.UI.Client/temp-schema-generator/manifests.ts b/src/Umbraco.Web.UI.Client/temp-schema-generator/manifests.ts new file mode 100644 index 0000000000..ce9319ece5 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/temp-schema-generator/manifests.ts @@ -0,0 +1,53 @@ +import { body, defaultResponse, endpoint, response } from '@airtasker/spot'; + +import { ProblemDetails } from './models'; + +@endpoint({ method: 'GET', path: '/manifests' }) +export class Manifests { + @response({ status: 200 }) + response(@body body: ManifestsResponse) {} + + @defaultResponse + default(@body body: ProblemDetails) {} +} + +export type Manifest = IManifestElement | IManifestEntrypoint; +export type ManifestStandardTypes = 'section' | 'propertyEditorUI' | 'dashboard'; + +export interface ManifestsResponse { + manifests: Manifest[]; +} + +export interface IManifest { + type: string; +} + +export interface MetaSection { + pathname: string; + weight: number; +} + +export interface MetaPropertyEditorUI { + icon: string; + group: string; +} + +export interface MetaDashboard { + sections: string[]; + pathname: string; + weight: number; +} + +export interface IManifestElement extends IManifest { + type: ManifestStandardTypes; + alias: string; + name: string; + js: string; + elementName: string; + meta: MetaSection | MetaPropertyEditorUI | MetaDashboard; +} + +export interface IManifestEntrypoint extends IManifest { + type: 'entrypoint'; + js: string; +}