Skip to content

Commit

Permalink
Merge pull request #1177 from finos/1057-fix-implementationmetadata-defs
Browse files Browse the repository at this point in the history
Refine the varying schemas for ImplementationMetadata
  • Loading branch information
kriswest authored Apr 10, 2024
2 parents d525bd5 + 5e859ec commit 02a43a5
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 170 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

* Added missing `desktopAgent` field to ImplementationMetadata objects returned for all agents connect to a DesktopAgent bridge in Connection Step 6 connectAgentsUpdate messages and refined the schema used to collect this info in step 3 handshake. ([#1177](https://github.com/finos/FDC3/pull/1177))
* Removed the `version` field from `IntentResolution` as there are no version fields for intents in the FDC3 API definitions and hence the field has no purpose. ([#1170](https://github.com/finos/FDC3/pull/1170))

## [FDC3 Standard 2.1](https://github.com/finos/FDC3/compare/v2.0..v2.1) - 2023-09-13
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finos/fdc3",
"version": "2.1.0-beta.6",
"version": "2.1.0-beta.7",
"author": "Fintech Open Source Foundation (FINOS)",
"homepage": "https://fdc3.finos.org",
"repository": {
Expand Down
47 changes: 37 additions & 10 deletions schemas/api/api.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@
],
"type": "string"
},
"ImplementationMetadata": {
"BaseImplementationMetadata": {
"description": "Metadata relating to the FDC3 Desktop Agent implementation and its provider.",
"title": "ImplementationMetadata",
"title": "BaseImplementationMetadata",
"type": "object",
"properties": {
"fdc3Version": {
Expand Down Expand Up @@ -405,21 +405,48 @@
"UserChannelMembershipAPIs"
],
"title": "optionalFeatures"
},
"appMetadata": {
"$ref": "#/definitions/AppMetadata",
"description": "The calling application instance's own metadata, according to the Desktop Agent (MUST include at least the `appId` and `instanceId`).",
"title": "appMetadata"
}
},
"additionalProperties": false,
"required": [
"appMetadata",
"fdc3Version",
"optionalFeatures",
"provider"
]
},
"ImplementationMetadata": {
"description": "Includes Metadata for the current application.",
"title": "ImplementationMetadata",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/BaseImplementationMetadata"
},
{
"type": "object",
"properties": {
"appMetadata": {
"$ref": "#/definitions/AppMetadata",
"description": "The calling application instance's own metadata, according to the Desktop Agent (MUST include at least the `appId` and `instanceId`).",
"title": "appMetadata"
}
}
}
],
"properties": {
"fdc3Version": true,
"provider": true,
"providerVersion": true,
"optionalFeatures": true,
"appMetadata": true
},
"required": [
"fdc3Version",
"optionalFeatures",
"provider",
"appMetadata"
],
"additionalProperties": false
},
"IntentResolution": {
"description": "IntentResolution provides a standard format for data returned upon resolving an intent.\n\n```javascript\n//resolve a \"Chain\" type intent\nlet resolution = await agent.raiseIntent(\"intentName\", context);\n\n//resolve a \"Client-Service\" type intent with a data response or a Channel\nlet resolution = await agent.raiseIntent(\"intentName\", context);\ntry {\n\t const result = await resolution.getResult();\n if (result && result.broadcast) {\n console.log(`${resolution.source} returned a channel with id ${result.id}`);\n } else if (result){\n console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`);\n } else {\n console.error(`${resolution.source} didn't return data`\n }\n} catch(error) {\n console.error(`${resolution.source} returned an error: ${error}`);\n}\n\n// Use metadata about the resolving app instance to target a further intent\nawait agent.raiseIntent(\"intentName\", context, resolution.source);\n```",
"title": "IntentResolution",
Expand All @@ -443,4 +470,4 @@
]
}
}
}
}
58 changes: 0 additions & 58 deletions schemas/api/baseImplementationMetadata.schema.json

This file was deleted.

56 changes: 50 additions & 6 deletions schemas/bridging/common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,21 @@
},
"ErrorMessages": {
"oneOf": [
{ "$ref": "../api/api.schema.json#/definitions/ChannelError" },
{ "$ref": "../api/api.schema.json#/definitions/OpenError" },
{ "$ref": "../api/api.schema.json#/definitions/ResolveError" },
{ "$ref": "../api/api.schema.json#/definitions/ResultError" },
{ "$ref": "../api/api.schema.json#/definitions/BridgingError" }
{
"$ref": "../api/api.schema.json#/definitions/ChannelError"
},
{
"$ref": "../api/api.schema.json#/definitions/OpenError"
},
{
"$ref": "../api/api.schema.json#/definitions/ResolveError"
},
{
"$ref": "../api/api.schema.json#/definitions/ResultError"
},
{
"$ref": "../api/api.schema.json#/definitions/BridgingError"
}
]
},
"BridgeResponseErrorDetails": {
Expand All @@ -120,6 +130,40 @@
"onUnsubscribe",
"onDisconnect"
]
},
"DesktopAgentImplementationMetadata": {
"description": "Includes the name assigned to the Desktop Agent by the Bridge.",
"title": "DesktopAgentImplementationMetadata",
"type": "object",
"allOf": [
{
"$ref": "../api/api.schema.json#/definitions/BaseImplementationMetadata"
},
{
"type": "object",
"properties": {
"desktopAgent": {
"description": "Used in Desktop Agent Bridging to attribute or target a message to a particular Desktop Agent.",
"type": "string",
"title": "desktopAgent"
}
}
}
],
"properties": {
"fdc3Version": true,
"provider": true,
"providerVersion": true,
"optionalFeatures": true,
"desktopAgent": true
},
"required": [
"fdc3Version",
"optionalFeatures",
"provider",
"desktopAgent"
],
"additionalProperties": false
}
}
}
}
46 changes: 37 additions & 9 deletions schemas/bridging/connectionStep3Handshake.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"$defs": {
"ConnectionStep3HandshakeBase": {
"type":"object",
"type": "object",
"title": "ConnectionStep3Handshake",
"description": "Handshake message sent by the Desktop Agent to the Bridge (including requested name, channel state and authentication data)",
"properties": {
Expand All @@ -26,9 +26,26 @@
"type": "object",
"properties": {
"implementationMetadata": {
"title": "Desktop Agent ImplementationMetadata",
"title": "Connecting Agent ImplementationMetadata",
"description": "Desktop Agent ImplementationMetadata trying to connect to the bridge.",
"$ref": "../api/baseImplementationMetadata.schema.json"
"type": "object",
"allOf": [
{
"$ref": "../api/api.schema.json#/definitions/BaseImplementationMetadata"
}
],
"properties": {
"fdc3Version": true,
"provider": true,
"providerVersion": true,
"optionalFeatures": true
},
"required": [
"fdc3Version",
"optionalFeatures",
"provider"
],
"additionalProperties": false
},
"requestedName": {
"title": "Requested name",
Expand All @@ -42,9 +59,9 @@
"additionalProperties": {
"title": "Channel ",
"type": "array",
"items": {
"$ref": "../context/context.schema.json"
}
"items": {
"$ref": "../context/context.schema.json"
}
}
},
"authToken": {
Expand All @@ -53,7 +70,11 @@
}
},
"additionalProperties": false,
"required": ["implementationMetadata", "requestedName", "channelsState"]
"required": [
"implementationMetadata",
"requestedName",
"channelsState"
]
},
"meta": {
"title": "Connection Step 3 Metadata",
Expand All @@ -67,10 +88,17 @@
}
},
"additionalProperties": false,
"required": ["requestUuid", "timestamp"]
"required": [
"requestUuid",
"timestamp"
]
}
},
"required": ["type", "payload", "meta"],
"required": [
"type",
"payload",
"meta"
],
"additionalProperties": false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"type": "array",
"description": "Desktop Agent Bridge implementation metadata of all connected agents.",
"items": {
"$ref": "../api/baseImplementationMetadata.schema.json"
"$ref": "common.schema.json#/$defs/DesktopAgentImplementationMetadata"
}
},
"channelsState": {
Expand Down
Loading

0 comments on commit 02a43a5

Please sign in to comment.