Skip to content

Commit 107130a

Browse files
committed
Correcting metadata additions to DACP schemas
1 parent fd8a4e1 commit 107130a

15 files changed

Lines changed: 52 additions & 103 deletions

packages/fdc3-schema/generated/bridging/BridgingTypes.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ export interface BroadcastAgentRequestPayload {
594594
* The context object that is to be broadcast.
595595
*/
596596
context: Context;
597+
metadata: AppProvidableContextMetadata;
597598
}
598599

599600
/**
@@ -654,6 +655,15 @@ export interface Context {
654655
[property: string]: any;
655656
}
656657

658+
/**
659+
* Metadata that can be provided by an app as part of a broadcast, raise intent or open API
660+
* call.
661+
*/
662+
export interface AppProvidableContextMetadata {
663+
custom?: { [key: string]: any };
664+
traceId?: string;
665+
}
666+
657667
/**
658668
* Identifies the type of the message and it is typically set to the FDC3 function name that
659669
* the message relates to, e.g. 'findIntent', with 'Request' appended.
@@ -778,6 +788,7 @@ export interface BroadcastBridgeRequestPayload {
778788
* The context object that is to be broadcast.
779789
*/
780790
context: Context;
791+
metadata: AppProvidableContextMetadata;
781792
}
782793

783794
/**
@@ -948,11 +959,6 @@ export interface OptionalFeatures {
948959
* feature is implemented by the Desktop Agent.
949960
*/
950961
DesktopAgentBridging: boolean;
951-
/**
952-
* Used to indicate whether the exposure of 'originating app metadata' for
953-
* context and intent messages is supported by the Desktop Agent.
954-
*/
955-
OriginatingAppMetadata: boolean;
956962
/**
957963
* Used to indicate whether the optional `fdc3.joinUserChannel`,
958964
* `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by
@@ -5105,6 +5111,7 @@ const typeMap: any = {
51055111
[
51065112
{ json: 'channelId', js: 'channelId', typ: '' },
51075113
{ json: 'context', js: 'context', typ: r('Context') },
5114+
{ json: 'metadata', js: 'metadata', typ: r('AppProvidableContextMetadata') },
51085115
],
51095116
false
51105117
),
@@ -5116,6 +5123,13 @@ const typeMap: any = {
51165123
],
51175124
'any'
51185125
),
5126+
AppProvidableContextMetadata: o(
5127+
[
5128+
{ json: 'custom', js: 'custom', typ: u(undefined, m('any')) },
5129+
{ json: 'traceId', js: 'traceId', typ: u(undefined, '') },
5130+
],
5131+
false
5132+
),
51195133
BroadcastBridgeRequest: o(
51205134
[
51215135
{ json: 'meta', js: 'meta', typ: r('BroadcastBridgeRequestMeta') },
@@ -5144,6 +5158,7 @@ const typeMap: any = {
51445158
[
51455159
{ json: 'channelId', js: 'channelId', typ: '' },
51465160
{ json: 'context', js: 'context', typ: r('Context') },
5161+
{ json: 'metadata', js: 'metadata', typ: r('AppProvidableContextMetadata') },
51475162
],
51485163
false
51495164
),
@@ -5217,7 +5232,6 @@ const typeMap: any = {
52175232
OptionalFeatures: o(
52185233
[
52195234
{ json: 'DesktopAgentBridging', js: 'DesktopAgentBridging', typ: true },
5220-
{ json: 'OriginatingAppMetadata', js: 'OriginatingAppMetadata', typ: true },
52215235
{ json: 'UserChannelMembershipAPIs', js: 'UserChannelMembershipAPIs', typ: true },
52225236
],
52235237
false

packages/fdc3-schema/schemas/api/addIntentListenerResponse.schema.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
}
2525
]
2626
},
27-
"metadata": {
28-
"$ref": "api.schema.json#/definitions/DesktopAgentProvidableContextMetadata"
29-
},
3027
"meta": true
3128
},
3229
"additionalProperties": false

packages/fdc3-schema/schemas/api/agentEvent.schema.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
"description": "The message payload contains details of the event that the app is being notified about.",
2828
"additionalProperties": true
2929
},
30-
"metadata": {
31-
"$ref": "api.schema.json#/definitions/DesktopAgentProvidableContextMetadata"
32-
},
3330
"meta": {
3431
"title": "Event Metadata",
3532
"description": "Metadata for messages sent by a Desktop Agent to an app notifying it of an event.",

packages/fdc3-schema/schemas/api/api.schema.json

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@
267267
"type"
268268
]
269269
},
270-
"ContextMetadataFields": {
271-
"description": "Metadata relating to a context or intent and context received through the\n`addContextListener` and `addIntentListener` functions.",
272-
"title": "ContextMetadataFields",
270+
"ContextMetadata": {
273271
"type": "object",
272+
"description": "Metadata relating to a broadcastEvent or intentEvent, which may include metadata provided by the Desktop Agent or the App that initiated the broadcast, raise intent or open request.",
273+
"title": "Context Metadata",
274274
"properties": {
275275
"source": {
276276
"$ref": "#/definitions/AppIdentifier",
@@ -295,39 +295,22 @@
295295
"description": "Custom metadata that can be used to provide additional information about the context or intent. This allows for individuals to use metadata fields that have yet to be standardized."
296296
}
297297
},
298-
"additionalProperties": false
299-
},
300-
"ContextMetadata": {
301-
"description": "Metadata relating to a context or intent and context received through the\n`addContextListener` and `addIntentListener` functions.",
302-
"title": "ContextMetadata",
303-
"allOf": [
304-
{
305-
"$ref": "#/definitions/ContextMetadataFields"
306-
}
307-
],
308-
"properties": {
309-
"source": true,
310-
"traceId": true,
311-
"timestamp": true,
312-
"custom": true
313-
},
314298
"required": [
315299
"source",
316-
"timestamp"
317-
]
300+
"timestamp",
301+
"traceId"
302+
],
303+
"additionalProperties": false
318304
},
319305
"AppProvidableContextMetadata": {
320-
"description": "Metadata that can be provided by an app.",
321-
"title": "AppProvidableContextMetadata",
322-
"allOf": [
323-
{
324-
"$ref": "#/definitions/ContextMetadataFields"
325-
}
326-
],
306+
"type": "object",
307+
"description": "Metadata that can be provided by an app as part of a broadcast, raise intent or open API call.",
308+
"title": "App Providable Context Metadata",
327309
"properties": {
328-
"traceId": true,
329-
"custom": true
330-
}
310+
"traceId": {"$ref": "#/definitions/ContextMetadata/properties/traceId"},
311+
"custom": {"$ref": "#/definitions/ContextMetadata/properties/custom"}
312+
},
313+
"additionalProperties": false
331314
},
332315
"DesktopAgentIdentifier": {
333316
"description": "Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios\nwhere a request needs to be directed to a Desktop Agent rather than a specific app, or a\nresponse message is returned by the Desktop Agent (or more specifically its resolver)\nrather than a specific app. Used as a substitute for `AppIdentifier` in cases where no\napp details are available or are appropriate.",
@@ -434,11 +417,6 @@
434417
"description": "Metadata indicating whether the Desktop Agent implements optional features of\nthe Desktop Agent API.",
435418
"type": "object",
436419
"properties": {
437-
"OriginatingAppMetadata": {
438-
"description": "Used to indicate whether the exposure of 'originating app metadata' for\ncontext and intent messages is supported by the Desktop Agent.",
439-
"type": "boolean",
440-
"title": "OriginatingAppMetadata"
441-
},
442420
"UserChannelMembershipAPIs": {
443421
"description": "Used to indicate whether the optional `fdc3.joinUserChannel`,\n`fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by\nthe Desktop Agent.",
444422
"type": "boolean",
@@ -453,7 +431,6 @@
453431
"additionalProperties": false,
454432
"required": [
455433
"DesktopAgentBridging",
456-
"OriginatingAppMetadata",
457434
"UserChannelMembershipAPIs"
458435
],
459436
"title": "optionalFeatures"

packages/fdc3-schema/schemas/api/broadcastEvent.schema.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"payload": {
1818
"$ref": "#/$defs/BroadcastEventPayload"
1919
},
20-
"metadata": {
21-
"$ref": "api.schema.json#/definitions/DesktopAgentProvidableContextMetadata"
22-
},
2320
"meta": true
2421
},
2522
"additionalProperties": false
@@ -51,10 +48,8 @@
5148
"title": "Context",
5249
"description": "The context object that was broadcast."
5350
},
54-
"originatingApp": {
55-
"title": "Originating AppIdentifier",
56-
"description": "Details of the application instance that broadcast the context.",
57-
"$ref": "api.schema.json#/definitions/AppIdentifier"
51+
"metadata": {
52+
"$ref": "api.schema.json#/definitions/ContextMetadata"
5853
}
5954
},
6055
"additionalProperties": false,

packages/fdc3-schema/schemas/api/broadcastRequest.schema.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"payload": {
1818
"$ref": "#/$defs/BroadcastRequestPayload"
1919
},
20-
"metadata": {
21-
"$ref": "api.schema.json#/definitions/AppProvidableContextMetadata"
22-
},
2320
"meta": true
2421
},
2522
"additionalProperties": false
@@ -43,12 +40,16 @@
4340
"$ref": "../context/context.schema.json",
4441
"title": "Context",
4542
"description": "The context object that is to be broadcast."
43+
},
44+
"metadata": {
45+
"$ref": "api.schema.json#/definitions/AppProvidableContextMetadata"
4646
}
4747
},
4848
"additionalProperties": false,
4949
"required": [
5050
"channelId",
51-
"context"
51+
"context",
52+
"metadata"
5253
]
5354
}
5455
}

packages/fdc3-schema/schemas/api/intentEvent.schema.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"payload": {
1818
"$ref": "#/$defs/IntentEventPayload"
1919
},
20-
"metadata": {
21-
"$ref": "api.schema.json#/definitions/DesktopAgentProvidableContextMetadata"
22-
},
2320
"meta": true
2421
},
2522
"additionalProperties": false
@@ -44,10 +41,8 @@
4441
"title": "Context",
4542
"description": "The context object passed with the raised intent."
4643
},
47-
"originatingApp": {
48-
"title": "Originating AppIdentifier",
49-
"description": "Details of the application instance that raised the intent.",
50-
"$ref": "api.schema.json#/definitions/AppIdentifier"
44+
"metadata": {
45+
"$ref": "api.schema.json#/definitions/ContextMetadata"
5146
},
5247
"raiseIntentRequestUuid": {
5348
"title": "raiseIntentRequest UUID",

packages/fdc3-schema/schemas/api/intentResultRequest.schema.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"payload": {
1818
"$ref": "#/$defs/IntentResultRequestPayload"
1919
},
20-
"metadata": {
21-
"$ref": "api.schema.json#/definitions/AppProvidableContextMetadata"
22-
},
2320
"meta": true
2421
},
2522
"additionalProperties": false

packages/fdc3-schema/schemas/api/openRequest.schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"payload": {
1818
"$ref": "#/$defs/OpenRequestPayload"
1919
},
20-
"metadata": {
21-
"$ref": "api.schema.json#/definitions/AppProvidableContextMetadata"
22-
},
2320
"meta": true
2421
},
2522
"additionalProperties": false
@@ -41,10 +38,13 @@
4138
"$ref": "../context/context.schema.json",
4239
"title": "Context",
4340
"description": "If a Context object is passed in, this object will be provided to the opened application via a contextListener. The Context argument is functionally equivalent to opening the target app with no context and broadcasting the context directly to it."
41+
},
42+
"metadata": {
43+
"$ref": "api.schema.json#/definitions/AppProvidableContextMetadata"
4444
}
4545
},
4646
"required": [
47-
"app"
47+
"app", "metadata"
4848
],
4949
"additionalProperties": false
5050
}

packages/fdc3-schema/schemas/api/privateChannelAddEventListenerResponse.schema.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
}
2525
]
2626
},
27-
"metadata": {
28-
"$ref": "api.schema.json#/definitions/DesktopAgentProvidableContextMetadata"
29-
},
3027
"meta": true
3128
},
3229
"additionalProperties": false

0 commit comments

Comments
 (0)