From f3d4269abf1ba03b55b2590616c256e72e0a848c Mon Sep 17 00:00:00 2001 From: Riko Eksteen Date: Wed, 22 Jan 2020 22:19:13 +0000 Subject: [PATCH] Align intent and application definition between schemas Fixes #19 and #156 --- src/api/interface.ts | 38 ++++++++++++++++++++++++++++++++------ src/intents/Intent.yaml | 2 +- src/intents/intent.ts | 38 -------------------------------------- 3 files changed, 33 insertions(+), 45 deletions(-) delete mode 100644 src/intents/intent.ts diff --git a/src/api/interface.ts b/src/api/interface.ts index 4ce1411ba..1c2e89789 100644 --- a/src/api/interface.ts +++ b/src/api/interface.ts @@ -21,24 +21,50 @@ enum ResolveError { /** * Intent descriptor */ -interface IntentMetadata { +interface Intent { + + // The name of the intent, default naming convention is UpperCamelCase name: string; - displayName: string; + + // An optional display name for the intent, "name" will be used if left empty + displayName?: string; + + // A list of the contexts the intent accepts. This will typically be a set of namespaced context types, e.g. "fdc3.contact" + contexts?: string[] + + // Custom configuration for the intent that may be required for a particular desktop agent. + customConfig?: object; } /** * An interface that relates an intent to apps */ interface AppIntent { - intent: IntentMetadata; - apps: Array; + intent: Intent; + apps: Array; } /** - * App metadata is Desktop Agent specific - but should support a name property. + * App definition as provided by the application directory */ -interface AppMetadata { +interface Application { + appId: string; name: string; + title?: string; + tooltip?: string; + description?: string; + images?: Array; + icons?: Array; + intents?: Array; + customConfig?: Array<{name: string, value: string}>; +} + +interface AppImage { + url: string; +} + +interface Icon { + icon: string; } /** diff --git a/src/intents/Intent.yaml b/src/intents/Intent.yaml index a489918c0..f7ad43660 100644 --- a/src/intents/Intent.yaml +++ b/src/intents/Intent.yaml @@ -22,7 +22,7 @@ Intent: type: string description: The contexts the intent accepts. This will typically be a set of namespaced context types, e.g. - "org.symphony.contact" + "fdc3.contact" customConfig: type: object description: Custom configuration for the intent diff --git a/src/intents/intent.ts b/src/intents/intent.ts deleted file mode 100644 index 70d57bdd2..000000000 --- a/src/intents/intent.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright 2019 FINOS FDC3 contributors - see NOTICE file - */ - -/* -* Intent schema -*/ - -interface Intent { - /* - * The name of the intent, default nameing convention is UpperCamelCase - */ - name:string; - /* - * An optional display name for the intent, "name" will be used if left empty - */ - displayName? : string; - /* - * A list of the contexts the intent accepts. This will typically be a set of namespaced context types, e.g. "org.symphony.contact" - */ - contexts?: string[] - /* - * Custom configuration for the intent that may be required for a particular desktop agent. - */ - customConfig?: Object; -} - -/* -* Application schema, to be used in the AppDirectory for apps declaring supported intents -* The full application definiton will be extended with properties defined in the AppDirectory WG -*/ -interface Application { - /* - * List of the intents the application supports - */ - intents:Intent[]; -} \ No newline at end of file