Skip to content

Commit e376a94

Browse files
julianna-ciqkriswest
authored andcommitted
Consolidate ContextMetadata definitions
1 parent 0fb3f6c commit e376a94

2 files changed

Lines changed: 44 additions & 29 deletions

File tree

packages/fdc3-schema/generated/api/BrowserTypes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6426,7 +6426,6 @@ const typeMap: any = {
64266426
RaiseIntentResponseType: ['raiseIntentResponse'],
64276427
RaiseIntentResultResponseType: ['raiseIntentResultResponse'],
64286428
};
6429-
64306429
export type AppRequestMessage =
64316430
| AddContextListenerRequest
64326431
| AddEventListenerRequest

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

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -267,51 +267,67 @@
267267
"type"
268268
]
269269
},
270-
"ContextMetadata": {
270+
"ContextMetadataFields": {
271271
"description": "Metadata relating to a context or intent and context received through the\n`addContextListener` and `addIntentListener` functions.",
272-
"title": "ContextMetadata",
272+
"title": "ContextMetadataFields",
273273
"type": "object",
274274
"properties": {
275275
"source": {
276276
"$ref": "#/definitions/AppIdentifier",
277277
"description": "Identifier for the app instance that sent the context and/or intent.",
278278
"title": "source"
279+
},
280+
"traceId": {
281+
"type": "string",
282+
"title": "traceId",
283+
"description": "A unique identifier for the context or intent that can be used to trace the context or intent through the system."
284+
},
285+
"timestamp": {
286+
"type": "string",
287+
"format": "date-time",
288+
"title": "timestamp",
289+
"description": "The timestamp when the context or intent was created, encoded according to [ISO 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator."
290+
},
291+
"custom": {
292+
"type": "object",
293+
"additionalProperties": true,
294+
"title": "custom",
295+
"description": "Custom metadata that can be used to provide additional information about the context or intent."
279296
}
280297
},
281-
"additionalProperties": false,
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+
},
282314
"required": [
283-
"source"
315+
"source",
316+
"timestamp"
284317
]
285318
},
286319
"AppProvidableContextMetadata": {
287320
"description": "Metadata that can be provided by an app.",
288321
"title": "AppProvidableContextMetadata",
289-
"type": "object",
290-
"properties": {
291-
"traceId": {
292-
"type": "string"
322+
"allOf": [
323+
{
324+
"$ref": "#/definitions/ContextMetadataFields"
293325
}
294-
},
295-
"additionalProperties": false
296-
},
297-
"DesktopAgentProvidableContextMetadata": {
298-
"description": "Metadata that can be provided by an app.",
299-
"title": "DesktopAgentProvidableContextMetadata",
300-
"type": "object",
326+
],
301327
"properties": {
302-
"traceId": {
303-
"type": "string"
304-
},
305-
"timestamp": {
306-
"type": "number"
307-
},
308-
"source": {
309-
"$ref": "#/definitions/AppIdentifier",
310-
"description": "Identifier for the source app instance",
311-
"title": "source"
312-
}
313-
},
314-
"additionalProperties": false
328+
"traceId": true,
329+
"custom": true
330+
}
315331
},
316332
"DesktopAgentIdentifier": {
317333
"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.",

0 commit comments

Comments
 (0)