UNPKG

dt-app

Version:

The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.

118 lines (117 loc) 4.05 kB
/** * Core manifest type definitions for Dynatrace Application development via the Wave CLI. * * This file contains two principal interfaces: * - DynatraceApplicationManifest: The shape of an application's manifest (authoring time) * - AppManifestSchema: A JSON Schema representation meta-structure used internally * * Notes: * - Keep property names in sync between DynatraceApplicationManifest and any generation logic. * - When extending the manifest, always add accompanying documentation here to keep the contract clear. */ import type { ActionManifest, CSPAppDirectives, DocumentsManifest, DocumentTypesManifest, FunctionManifest, OAuthScope, SettingsManifest } from '../utils/config/cli-options'; import type { IntentsDeclarations } from './intents'; import type { UiCommands } from './ui-commands'; export type DynatracePlatformDependency = { name: string; version: string; }; export type DynatraceDependency = DynatracePlatformDependency & { packageJsonDep?: string; path?: string; }; export type AppIcon = { /** Path to the custom app icon relative to the app bundle root */ name: 'icon.svg' | 'icon.png'; /** Whether the app icon has been automatically generated */ generated: boolean; }; /** * Interface defining the manifest structure. * @internal */ export interface DynatraceApplicationManifest { /** App id */ id: string; /** App name */ name: string; /** App description */ description: string; /** App version */ version: string; /** Metadata of all Dynatrace packages that contain a dynatrace-metadata.json */ dependencies?: DynatracePlatformDependency[]; /** Hide in App Launcher */ hidden?: boolean; /** Intent capabilities */ intents?: IntentsDeclarations; /** Action capabilities */ actions?: ActionManifest[]; /** App widget settings */ settings?: SettingsManifest; /** Function capabilities */ functions?: Record<string, FunctionManifest>; /** App documents */ documents?: DocumentsManifest; /** App document types */ 'document-types'?: DocumentTypesManifest; /** Page tokens */ pageTokens?: Record<string, string>; /** App icon options */ icon: AppIcon; /** * Represents a custom set of directives for the app * The value holds the actual directive. * For every directive there needs to be a comment provided that explains why this directive is necessary. */ csp?: CSPAppDirectives; /** * The list of authentication scopes your app needs. */ scopes: OAuthScope[]; /** * The "SemVer" version of the app bundle. */ 'app-bundle-version'?: string; /** * App ui Commands. */ uiCommands?: UiCommands; } /** * JSON Schema wrapper describing the expected structure of the Dynatrace application manifest. * This is NOT the manifest itself, but the schema metadata used for validation / generation. */ export interface AppManifestSchema { /** * JSON Schema URI identifying the draft / meta schema used (e.g. "https://json-schema.org/draft/2020-12/schema"). */ $schema: string; /** * Unique identifier of this schema resource (used for $ref resolution / tooling). */ $id: string; /** * Root JSON type of the manifest document. Should always be 'object'. */ type: string; /** * JSON Schema property definitions keyed by the known manifest fields. * Each value is itself a (partial) JSON Schema fragment describing that field. */ properties: { [K in keyof DynatraceApplicationManifest]?: unknown; }; /** * The currently supported highest app bundle version that this CLI understands. */ 'current-app-bundle-version': string; /** * Whether additional (undeclared) properties are permitted in the manifest (normally false). */ additionalProperties: boolean; /** * List of manifest fields that must be present for a valid manifest. */ required: string[]; }