Skip to content

Commit

Permalink
Align intent and application definition between schemas
Browse files Browse the repository at this point in the history
Fixes #19 and #156
  • Loading branch information
rikoe committed Jan 22, 2020
1 parent 0c13bf3 commit f3d4269
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 45 deletions.
38 changes: 32 additions & 6 deletions src/api/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AppMetadata>;
intent: Intent;
apps: Array<Application>;
}

/**
* 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<AppImage>;
icons?: Array<Icon>;
intents?: Array<Intent>;
customConfig?: Array<{name: string, value: string}>;
}

interface AppImage {
url: string;
}

interface Icon {
icon: string;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/intents/Intent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 0 additions & 38 deletions src/intents/intent.ts

This file was deleted.

0 comments on commit f3d4269

Please sign in to comment.