From c46965f422574836b3de2073135e83e7356f1871 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 7 Jul 2023 18:17:39 +0300 Subject: [PATCH 01/23] First pass at defining context types for order, trade and product (which is used to help define the other types) --- src/context/ContextTypes.ts | 173 +++++++++++++++++++++++- src/context/schemas/order.schema.json | 71 ++++++++++ src/context/schemas/product.schema.json | 37 +++++ src/context/schemas/trade.schema.json | 61 +++++++++ 4 files changed, 341 insertions(+), 1 deletion(-) create mode 100644 src/context/schemas/order.schema.json create mode 100644 src/context/schemas/product.schema.json create mode 100644 src/context/schemas/trade.schema.json diff --git a/src/context/ContextTypes.ts b/src/context/ContextTypes.ts index b02c22a60..27327cc19 100644 --- a/src/context/ContextTypes.ts +++ b/src/context/ContextTypes.ts @@ -1,6 +1,6 @@ // To parse this data: // -// import { Convert, Chart, ChatInitSettings, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Nothing, Organization, Portfolio, Position, TimeRange, Valuation } from "./file"; +// import { Convert, Chart, ChatInitSettings, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Nothing, Order, Organization, Portfolio, Position, Product, TimeRange, Trade, Valuation } from "./file"; // // const chart = Convert.toChart(json); // const chatInitSettings = Convert.toChatInitSettings(json); @@ -13,10 +13,13 @@ // const instrument = Convert.toInstrument(json); // const instrumentList = Convert.toInstrumentList(json); // const nothing = Convert.toNothing(json); +// const order = Convert.toOrder(json); // const organization = Convert.toOrganization(json); // const portfolio = Convert.toPortfolio(json); // const position = Convert.toPosition(json); +// const product = Convert.toProduct(json); // const timeRange = Convert.toTimeRange(json); +// const trade = Convert.toTrade(json); // const valuation = Convert.toValuation(json); // // These functions will throw an error if the JSON doesn't @@ -237,6 +240,67 @@ export interface Nothing { [property: string]: any; } +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface Order { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: OrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the order. + */ + name?: string; + type: string; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface OrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + */ +export interface ProductObject { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the product. + */ + name?: string; + type: string; + instrument?: InstrumentElement; + [property: string]: any; +} + export interface Organization { id: OrganizationID; type: string; @@ -277,6 +341,28 @@ export interface Position { [property: string]: any; } +/** + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + */ +export interface Product { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the product. + */ + name?: string; + type: string; + instrument?: InstrumentElement; + [property: string]: any; +} + export interface TimeRange { endTime?: Date; startTime?: Date; @@ -286,6 +372,30 @@ export interface TimeRange { [property: string]: any; } +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + */ +export interface Trade { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the order. + */ + name?: string; + product: ProductObject; + type: string; + [property: string]: any; +} + export interface Valuation { CURRENCY_ISOCODE: string; expiryTime?: Date; @@ -389,6 +499,14 @@ export class Convert { return JSON.stringify(uncast(value, r('Nothing')), null, 2); } + public static toOrder(json: string): Order { + return cast(JSON.parse(json), r('Order')); + } + + public static orderToJson(value: Order): string { + return JSON.stringify(uncast(value, r('Order')), null, 2); + } + public static toOrganization(json: string): Organization { return cast(JSON.parse(json), r('Organization')); } @@ -413,6 +531,14 @@ export class Convert { return JSON.stringify(uncast(value, r('Position')), null, 2); } + public static toProduct(json: string): Product { + return cast(JSON.parse(json), r('Product')); + } + + public static productToJson(value: Product): string { + return JSON.stringify(uncast(value, r('Product')), null, 2); + } + public static toTimeRange(json: string): TimeRange { return cast(JSON.parse(json), r('TimeRange')); } @@ -421,6 +547,14 @@ export class Convert { return JSON.stringify(uncast(value, r('TimeRange')), null, 2); } + public static toTrade(json: string): Trade { + return cast(JSON.parse(json), r('Trade')); + } + + public static tradeToJson(value: Trade): string { + return JSON.stringify(uncast(value, r('Trade')), null, 2); + } + public static toValuation(json: string): Valuation { return cast(JSON.parse(json), r('Valuation')); } @@ -819,6 +953,25 @@ const typeMap: any = { ], 'any' ), + Order: o( + [ + { json: 'details', js: 'details', typ: u(undefined, r('OrderDetails')) }, + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: '' }, + ], + 'any' + ), + OrderDetails: o([{ json: 'product', js: 'product', typ: u(undefined, r('ProductObject')) }], 'any'), + ProductObject: o( + [ + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: '' }, + { json: 'instrument', js: 'instrument', typ: u(undefined, r('InstrumentElement')) }, + ], + 'any' + ), Organization: o( [ { json: 'id', js: 'id', typ: r('OrganizationID') }, @@ -864,6 +1017,15 @@ const typeMap: any = { ], 'any' ), + Product: o( + [ + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: '' }, + { json: 'instrument', js: 'instrument', typ: u(undefined, r('InstrumentElement')) }, + ], + 'any' + ), TimeRange: o( [ { json: 'endTime', js: 'endTime', typ: u(undefined, Date) }, @@ -874,6 +1036,15 @@ const typeMap: any = { ], 'any' ), + Trade: o( + [ + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'product', js: 'product', typ: r('ProductObject') }, + { json: 'type', js: 'type', typ: '' }, + ], + 'any' + ), Valuation: o( [ { json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: '' }, diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json new file mode 100644 index 000000000..c3fa3e0d0 --- /dev/null +++ b/src/context/schemas/order.schema.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "type": "object", + "title": "Order", + "description": "@experimental context type representing an order. To be used with OMS and EMS systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future.", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Order Identifiers", + "description": "One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the order." + }, + "details": { + "type": "object", + "title": "Order Details", + "description": "Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context", + "properties": { + "product": { + "$ref": "product.schema.json" + } + }, + "additionalProperties": true + } + }, + "required": [ + "id" + ], + "additionalProperties": true, + "examples": [ + { + "type": "fdc3.order", + "name": "...", + "id": { + "myOMS": "12345", + }, + "details": { + "product": { + "type": "myFirm.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } + }, + { + "type": "fdc3.order", + "id": { + "myOMS": "ABC123" + } + } + ] +} \ No newline at end of file diff --git a/src/context/schemas/product.schema.json b/src/context/schemas/product.schema.json new file mode 100644 index 000000000..fbf2435aa --- /dev/null +++ b/src/context/schemas/product.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/product.schema.json", + "type": "object", + "title": "Product", + "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.", + "allOf": [ + { + "$ref": "context.schema.json#" + },{ + "type": "object", + "properties": { + "type": { + "const": "fdc3.product" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Product Identifiers", + "description": "One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the product." + }, + "instrument": { + "$ref": "instrument.schema.json" + } + }, + "required": ["type","id"], + "additionalProperties": true + } + ] +} \ No newline at end of file diff --git a/src/context/schemas/trade.schema.json b/src/context/schemas/trade.schema.json new file mode 100644 index 000000000..155e34883 --- /dev/null +++ b/src/context/schemas/trade.schema.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/trade.schema.json", + "type": "object", + "title": "Trade", + "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.trade" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Trade Identifiers", + "description": "One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the order." + }, + "product": { + "$ref": "product.schema.json" + } + }, + "required": [ + "id", "product" + ], + "additionalProperties": true, + "examples": [ + { + "type": "fdc3.trade", + "name": "...", + "id": { + "myEMS": "12345", + }, + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + }, + { + "type": "fdc3.trade", + "id": { + "myEMS": "ABC123" + } + } + ] +} \ No newline at end of file From 1b4312d40b3377c7a7f124b398f6d86db4c48698 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 7 Jul 2023 18:23:22 +0300 Subject: [PATCH 02/23] corrections to exmples --- src/context/schemas/order.schema.json | 4 ++-- src/context/schemas/product.schema.json | 11 +++++++++++ src/context/schemas/trade.schema.json | 8 +------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json index c3fa3e0d0..21b2aec36 100644 --- a/src/context/schemas/order.schema.json +++ b/src/context/schemas/order.schema.json @@ -47,11 +47,11 @@ "type": "fdc3.order", "name": "...", "id": { - "myOMS": "12345", + "myOMS": "12345" }, "details": { "product": { - "type": "myFirm.product", + "type": "fdc3.product", "instrument": { "type": "fdc3.instrument", "id": { diff --git a/src/context/schemas/product.schema.json b/src/context/schemas/product.schema.json index fbf2435aa..de68054ad 100644 --- a/src/context/schemas/product.schema.json +++ b/src/context/schemas/product.schema.json @@ -33,5 +33,16 @@ "required": ["type","id"], "additionalProperties": true } + ], + "examples": [ + { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } ] } \ No newline at end of file diff --git a/src/context/schemas/trade.schema.json b/src/context/schemas/trade.schema.json index 155e34883..b50b8ec0c 100644 --- a/src/context/schemas/trade.schema.json +++ b/src/context/schemas/trade.schema.json @@ -39,7 +39,7 @@ "type": "fdc3.trade", "name": "...", "id": { - "myEMS": "12345", + "myEMS": "12345" }, "product": { "type": "fdc3.product", @@ -50,12 +50,6 @@ } } } - }, - { - "type": "fdc3.trade", - "id": { - "myEMS": "ABC123" - } } ] } \ No newline at end of file From e57be07d41c46dd0455af55e698f9d26389a77d0 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 7 Jul 2023 18:30:47 +0300 Subject: [PATCH 03/23] adding OrderList and TradeList types --- src/context/ContextTypes.ts | 150 +++++++++++++++++++++- src/context/schemas/orderList.schema.json | 16 +++ src/context/schemas/tradeList.schema.json | 16 +++ 3 files changed, 177 insertions(+), 5 deletions(-) create mode 100644 src/context/schemas/orderList.schema.json create mode 100644 src/context/schemas/tradeList.schema.json diff --git a/src/context/ContextTypes.ts b/src/context/ContextTypes.ts index 27327cc19..1f0323fa9 100644 --- a/src/context/ContextTypes.ts +++ b/src/context/ContextTypes.ts @@ -1,6 +1,6 @@ // To parse this data: // -// import { Convert, Chart, ChatInitSettings, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Nothing, Order, Organization, Portfolio, Position, Product, TimeRange, Trade, Valuation } from "./file"; +// import { Convert, Chart, ChatInitSettings, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, Valuation } from "./file"; // // const chart = Convert.toChart(json); // const chatInitSettings = Convert.toChatInitSettings(json); @@ -14,12 +14,14 @@ // const instrumentList = Convert.toInstrumentList(json); // const nothing = Convert.toNothing(json); // const order = Convert.toOrder(json); +// const orderList = Convert.toOrderList(json); // const organization = Convert.toOrganization(json); // const portfolio = Convert.toPortfolio(json); // const position = Convert.toPosition(json); // const product = Convert.toProduct(json); // const timeRange = Convert.toTimeRange(json); // const trade = Convert.toTrade(json); +// const tradeList = Convert.toTradeList(json); // const valuation = Convert.toValuation(json); // // These functions will throw an error if the JSON doesn't @@ -256,7 +258,7 @@ export interface Order { * Optional additional details about the order, which may include a product element that is * an, as yet undefined but extensible, Context */ - details?: OrderDetails; + details?: PurpleOrderDetails; /** * One or more identifiers that refer to the order in an OMS, EMS or related system. * Specific key names for systems are expected to be standardized in future. @@ -274,7 +276,7 @@ export interface Order { * Optional additional details about the order, which may include a product element that is * an, as yet undefined but extensible, Context */ -export interface OrderDetails { +export interface PurpleOrderDetails { product?: ProductObject; [property: string]: any; } @@ -301,6 +303,56 @@ export interface ProductObject { [property: string]: any; } +/** + * @experimental A list of orders + */ +export interface OrderList { + orders: OrderElement[]; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface OrderElement { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: FluffyOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the order. + */ + name?: string; + type: string; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface FluffyOrderDetails { + product?: ProductObject; + [property: string]: any; +} + export interface Organization { id: OrganizationID; type: string; @@ -396,6 +448,41 @@ export interface Trade { [property: string]: any; } +/** + * @experimental A list of trades. + */ +export interface TradeList { + trades: TradeElement[]; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + */ +export interface TradeElement { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the order. + */ + name?: string; + product: ProductObject; + type: string; + [property: string]: any; +} + export interface Valuation { CURRENCY_ISOCODE: string; expiryTime?: Date; @@ -507,6 +594,14 @@ export class Convert { return JSON.stringify(uncast(value, r('Order')), null, 2); } + public static toOrderList(json: string): OrderList { + return cast(JSON.parse(json), r('OrderList')); + } + + public static orderListToJson(value: OrderList): string { + return JSON.stringify(uncast(value, r('OrderList')), null, 2); + } + public static toOrganization(json: string): Organization { return cast(JSON.parse(json), r('Organization')); } @@ -555,6 +650,14 @@ export class Convert { return JSON.stringify(uncast(value, r('Trade')), null, 2); } + public static toTradeList(json: string): TradeList { + return cast(JSON.parse(json), r('TradeList')); + } + + public static tradeListToJson(value: TradeList): string { + return JSON.stringify(uncast(value, r('TradeList')), null, 2); + } + public static toValuation(json: string): Valuation { return cast(JSON.parse(json), r('Valuation')); } @@ -955,14 +1058,14 @@ const typeMap: any = { ), Order: o( [ - { json: 'details', js: 'details', typ: u(undefined, r('OrderDetails')) }, + { json: 'details', js: 'details', typ: u(undefined, r('PurpleOrderDetails')) }, { json: 'id', js: 'id', typ: m('') }, { json: 'name', js: 'name', typ: u(undefined, '') }, { json: 'type', js: 'type', typ: '' }, ], 'any' ), - OrderDetails: o([{ json: 'product', js: 'product', typ: u(undefined, r('ProductObject')) }], 'any'), + PurpleOrderDetails: o([{ json: 'product', js: 'product', typ: u(undefined, r('ProductObject')) }], 'any'), ProductObject: o( [ { json: 'id', js: 'id', typ: m('') }, @@ -972,6 +1075,25 @@ const typeMap: any = { ], 'any' ), + OrderList: o( + [ + { json: 'orders', js: 'orders', typ: a(r('OrderElement')) }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + OrderElement: o( + [ + { json: 'details', js: 'details', typ: u(undefined, r('FluffyOrderDetails')) }, + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: '' }, + ], + 'any' + ), + FluffyOrderDetails: o([{ json: 'product', js: 'product', typ: u(undefined, r('ProductObject')) }], 'any'), Organization: o( [ { json: 'id', js: 'id', typ: r('OrganizationID') }, @@ -1045,6 +1167,24 @@ const typeMap: any = { ], 'any' ), + TradeList: o( + [ + { json: 'trades', js: 'trades', typ: a(r('TradeElement')) }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + TradeElement: o( + [ + { json: 'id', js: 'id', typ: m('') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'product', js: 'product', typ: r('ProductObject') }, + { json: 'type', js: 'type', typ: '' }, + ], + 'any' + ), Valuation: o( [ { json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: '' }, diff --git a/src/context/schemas/orderList.schema.json b/src/context/schemas/orderList.schema.json new file mode 100644 index 000000000..0e10694b6 --- /dev/null +++ b/src/context/schemas/orderList.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/orderList.schema.json", + "type": "object", + "title": "OrderList", + "description": "@experimental A list of orders", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.orderList" }, + "orders": { + "type": "array", + "items": { "$ref": "order.schema.json#" } + } + }, + "required": ["type", "orders"] +} diff --git a/src/context/schemas/tradeList.schema.json b/src/context/schemas/tradeList.schema.json new file mode 100644 index 000000000..c69d8d7b5 --- /dev/null +++ b/src/context/schemas/tradeList.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/tradeList.schema.json", + "type": "object", + "title": "TradeList", + "description": "@experimental A list of trades.", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.tradeList" }, + "trades": { + "type": "array", + "items": { "$ref": "trade.schema.json#" } + } + }, + "required": ["type", "trades"] +} From 1e29ee9526904561b4e1fc57ae77dfd618f88f32 Mon Sep 17 00:00:00 2001 From: Kris West Date: Tue, 18 Jul 2023 19:21:29 +0100 Subject: [PATCH 04/23] Adding markdown docs for experimental types --- docs/context/ref/Order.md | 69 +++++++++++++++++ docs/context/ref/OrderList.md | 58 ++++++++++++++ docs/context/ref/Product.md | 53 +++++++++++++ docs/context/ref/Trade.md | 60 +++++++++++++++ docs/context/ref/TradeList.md | 77 +++++++++++++++++++ docs/context/spec.md | 8 ++ src/context/schemas/order.schema.json | 4 +- src/context/schemas/trade.schema.json | 4 +- website/sidebars.json | 5 ++ website/static/schemas/next/chart.schema.json | 5 +- website/static/schemas/next/order.schema.json | 71 +++++++++++++++++ .../static/schemas/next/orderList.schema.json | 16 ++++ .../static/schemas/next/product.schema.json | 48 ++++++++++++ website/static/schemas/next/trade.schema.json | 55 +++++++++++++ .../static/schemas/next/tradeList.schema.json | 16 ++++ 15 files changed, 544 insertions(+), 5 deletions(-) create mode 100644 docs/context/ref/Order.md create mode 100644 docs/context/ref/OrderList.md create mode 100644 docs/context/ref/Product.md create mode 100644 docs/context/ref/Trade.md create mode 100644 docs/context/ref/TradeList.md create mode 100644 website/static/schemas/next/order.schema.json create mode 100644 website/static/schemas/next/orderList.schema.json create mode 100644 website/static/schemas/next/product.schema.json create mode 100644 website/static/schemas/next/trade.schema.json create mode 100644 website/static/schemas/next/tradeList.schema.json diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md new file mode 100644 index 000000000..60df034e2 --- /dev/null +++ b/docs/context/ref/Order.md @@ -0,0 +1,69 @@ +--- +id: Order +sidebar_label: Order +title: Order +hide_title: true +--- +# `Order` + +[`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing an order. To be used with OMS and EMS systems. + +This type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future. require not just a single trade, but multiple. + +## Type + +`fdc3.order` + +## Schema + + + +## Details + +| Property | Type | Required | Details | +|--------------|------------|----------|---------------------------| +| `type` | string | Yes | `'fdc3.order'` | +| `id` | object | Yes | One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future. E.g.:`{ myOMS: '12345' }` | +| `name` | string | No | An optional human-readable summary of the order. | +| `details` | object | No | Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context | +| `details.product` | Product | No | The product that the order relates to | + +## Examples + +```js +const order1 = { + "type": "fdc3.order", + "name": "...", + "id": { + "myOMS": "12345" + }, + "details": { + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } +}; +``` + +```js +const order2 = { + "type": "fdc3.order", + "id": { + "myOMS": "ABC123" + } +}; +``` + +## See Also + +Other Types + +- [OrderList](OrderList) +- [Product](Product) +- [Trade](Trade) diff --git a/docs/context/ref/OrderList.md b/docs/context/ref/OrderList.md new file mode 100644 index 000000000..e48294ce8 --- /dev/null +++ b/docs/context/ref/OrderList.md @@ -0,0 +1,58 @@ +--- +id: OrderList +sidebar_label: OrderList +title: OrderList +hide_title: true +--- +# `OrderList` + +[`@experimental`](/docs/fdc3-compliance#experimental-features) A list of orders. Use this type for use cases that require not just a single order, but multiple. + +Notes: + +- The OrderList schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired. + +## Type + +`fdc3.orderList` + +## Schema + + + +## Details + +| Property | Type | Required | Example Value | +|--------------|------------|----------|---------------------------| +| `type` | string | Yes | `'fdc3.orderList'` | +| `id` | object | No | `{ listId: '1234' }` | +| `name` | string | No | `'Today's orders'` | +| `orders` | Trade[] | Yes | `[order1, order2]` | + +## Example + +```js +const orderList = { + type: "fdc3.orderList", + orders: [ + { + "type": "fdc3.order", + "id": { + "myOMS": "ABC123" + } + }, + { + "type": "fdc3.order", + "id": { + "myOMS": "DEF456" + } + } + ] +}; +``` + +## See Also + +Other Types + +- [Order](Order) diff --git a/docs/context/ref/Product.md b/docs/context/ref/Product.md new file mode 100644 index 000000000..7d20dc52d --- /dev/null +++ b/docs/context/ref/Product.md @@ -0,0 +1,53 @@ +--- +id: Product +sidebar_label: Product +title: Product +hide_title: true +--- +# `Product` + +[`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field. + +Notes: + +- The Product schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired. + +## Type + +`fdc3.product` + +## Schema + + + +## Details + +| Property | Type | Required | Example Value | +|--------------|------------|----------|---------------------------| +| `type` | string | Yes | `'fdc3.product'` | +| `id` | object | Yes | One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future. | +| `name` | string | No | A human-readable summary of the product. | +| `instrument` | Product[] | No | A financial instrument that relates to the definition of this product. | + +## Example + +```js +const product = { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } +}; +``` + +## See Also + +Other Types + +- [Instrument](Instrument) +- [ProductList](ProductList) +- [Order](Order) +- [Trade](Trade) diff --git a/docs/context/ref/Trade.md b/docs/context/ref/Trade.md new file mode 100644 index 000000000..de95133c6 --- /dev/null +++ b/docs/context/ref/Trade.md @@ -0,0 +1,60 @@ +--- +id: Trade +sidebar_label: Trade +title: Trade +hide_title: true +--- +# `Trade` + +[`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing a trade. To be used with execution systems. + +This type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future. + +Notes: + +- The Trade schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired. + +## Type + +`fdc3.trade` + +## Schema + + + +## Details + +| Property | Type | Required | Details | +|--------------|------------|----------|---------------------------| +| `type` | string | Yes | `'fdc3.trade'` | +| `id` | object | Yes | One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future. | +| `name` | string | No | A human-readable summary of the trade, e.g. `'100 TSLA @ 290.85 USD'` | +| `product` | Product | Yes | A tradeable product | + +## Example + +```js +const trade = { + "type": "fdc3.trade", + "name": "...", + "id": { + "myEMS": "12345" + }, + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } +}; +``` + +## See Also + +Other Types + +- [Product](Product) +- [TradeList](TradeList) diff --git a/docs/context/ref/TradeList.md b/docs/context/ref/TradeList.md new file mode 100644 index 000000000..02324c712 --- /dev/null +++ b/docs/context/ref/TradeList.md @@ -0,0 +1,77 @@ +--- +id: TradeList +sidebar_label: TradeList +title: TradeList +hide_title: true +--- +# `TradeList` + +[`@experimental`](/docs/fdc3-compliance#experimental-features) A list of trades. Use this type for use cases that require not just a single trade, but multiple. + +Notes: + +- The TradeList schema does not explicitly include identifiers in the id section, as there is not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired. + +## Type + +`fdc3.tradeList` + +## Schema + + + +## Details + +| Property | Type | Required | Example Value | +|--------------|------------|----------|---------------------------| +| `type` | string | Yes | `'fdc3.tradeList'` | +| `id` | object | No | `{ listId: '1234' }` | +| `name` | string | No | `'Today's trades'` | +| `trades` | Trade[] | Yes | `[trade1, trade2]` | + +## Example + +```js +const tradeList = { + type: "fdc3.tradeList", + trades: [ + { + "type": "fdc3.trade", + "name": "...", + "id": { + "myEMS": "12345" + }, + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + }, + { + "type": "fdc3.trade", + "id": { + "myEMS": "67890" + }, + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "TSLA" + } + } + } + } + ] +}; +``` + +## See Also + +Other Types + +- [Trade](Trade) diff --git a/docs/context/spec.md b/docs/context/spec.md index c471fecda..ea54a0eeb 100644 --- a/docs/context/spec.md +++ b/docs/context/spec.md @@ -184,6 +184,14 @@ The following are standard FDC3 context types: - [`fdc3.transactionResult`](ref/TransactionResult) ([schema](/schemas/next/transactionresult.schema.json)) - [`fdc3.valuation`](ref/Valuation) ([schema](/schemas/next/valuation.schema.json)) +The following are [`@experimental`](/docs/fdc3-compliance#experimental-features) types, which are in the process of being defined: + +- [`fdc3.order`](ref/Order) ([schema](/schemas/next/order.schema.json)) +- [`fdc3.orderList`](ref/OrderList) ([schema](/schemas/next/orderList.schema.json)) +- [`fdc3.product`](ref/Product) ([schema](/schemas/next/product.schema.json)) +- [`fdc3.trade`](ref/Trade) ([schema](/schemas/next/trade.schema.json)) +- [`fdc3.tradeList`](ref/TradeList) ([schema](/schemas/next/tradeList.schema.json)) + ### Examples The below examples show how the base context data interface can be used to define specific context data objects. diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json index 21b2aec36..4f4d8530c 100644 --- a/src/context/schemas/order.schema.json +++ b/src/context/schemas/order.schema.json @@ -24,7 +24,7 @@ "name": { "type": "string", "title": "Name", - "description": "A human-readable summary of the order." + "description": "An optional human-readable summary of the order." }, "details": { "type": "object", @@ -39,7 +39,7 @@ } }, "required": [ - "id" + "type", "id" ], "additionalProperties": true, "examples": [ diff --git a/src/context/schemas/trade.schema.json b/src/context/schemas/trade.schema.json index b50b8ec0c..27fecf8bd 100644 --- a/src/context/schemas/trade.schema.json +++ b/src/context/schemas/trade.schema.json @@ -24,14 +24,14 @@ "name": { "type": "string", "title": "Name", - "description": "A human-readable summary of the order." + "description": "A human-readable summary of the trade." }, "product": { "$ref": "product.schema.json" } }, "required": [ - "id", "product" + "type", "id", "product" ], "additionalProperties": true, "examples": [ diff --git a/website/sidebars.json b/website/sidebars.json index b07f5048a..efa171248 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -78,11 +78,16 @@ "context/ref/Interaction", "context/ref/Message", "context/ref/Nothing", + "context/ref/Order", + "context/ref/OrderList", "context/ref/Organization", "context/ref/Portfolio", "context/ref/Position", + "context/ref/Product", "context/ref/ChatSearchCriteria", "context/ref/TimeRange", + "context/ref/Trade", + "context/ref/TradeList", "context/ref/TransactionResult", "context/ref/Valuation" ] diff --git a/website/static/schemas/next/chart.schema.json b/website/static/schemas/next/chart.schema.json index ab541e70c..9a913f1ce 100644 --- a/website/static/schemas/next/chart.schema.json +++ b/website/static/schemas/next/chart.schema.json @@ -20,7 +20,10 @@ "enum": [ "line", "bar", "stacked-bar", "mountain", "candle", "pie", "scatter", "histogram", "heatmap", "custom"] }, "otherConfig": { - "type": "object" + "type": "array", + "items": { + "$ref": "context.schema.json#" + } } }, "required": ["instruments"] diff --git a/website/static/schemas/next/order.schema.json b/website/static/schemas/next/order.schema.json new file mode 100644 index 000000000..4f4d8530c --- /dev/null +++ b/website/static/schemas/next/order.schema.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "type": "object", + "title": "Order", + "description": "@experimental context type representing an order. To be used with OMS and EMS systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future.", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Order Identifiers", + "description": "One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "An optional human-readable summary of the order." + }, + "details": { + "type": "object", + "title": "Order Details", + "description": "Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context", + "properties": { + "product": { + "$ref": "product.schema.json" + } + }, + "additionalProperties": true + } + }, + "required": [ + "type", "id" + ], + "additionalProperties": true, + "examples": [ + { + "type": "fdc3.order", + "name": "...", + "id": { + "myOMS": "12345" + }, + "details": { + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } + }, + { + "type": "fdc3.order", + "id": { + "myOMS": "ABC123" + } + } + ] +} \ No newline at end of file diff --git a/website/static/schemas/next/orderList.schema.json b/website/static/schemas/next/orderList.schema.json new file mode 100644 index 000000000..0e10694b6 --- /dev/null +++ b/website/static/schemas/next/orderList.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/orderList.schema.json", + "type": "object", + "title": "OrderList", + "description": "@experimental A list of orders", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.orderList" }, + "orders": { + "type": "array", + "items": { "$ref": "order.schema.json#" } + } + }, + "required": ["type", "orders"] +} diff --git a/website/static/schemas/next/product.schema.json b/website/static/schemas/next/product.schema.json new file mode 100644 index 000000000..de68054ad --- /dev/null +++ b/website/static/schemas/next/product.schema.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/product.schema.json", + "type": "object", + "title": "Product", + "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.", + "allOf": [ + { + "$ref": "context.schema.json#" + },{ + "type": "object", + "properties": { + "type": { + "const": "fdc3.product" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Product Identifiers", + "description": "One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the product." + }, + "instrument": { + "$ref": "instrument.schema.json" + } + }, + "required": ["type","id"], + "additionalProperties": true + } + ], + "examples": [ + { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + ] +} \ No newline at end of file diff --git a/website/static/schemas/next/trade.schema.json b/website/static/schemas/next/trade.schema.json new file mode 100644 index 000000000..27fecf8bd --- /dev/null +++ b/website/static/schemas/next/trade.schema.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/trade.schema.json", + "type": "object", + "title": "Trade", + "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.trade" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Trade Identifiers", + "description": "One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the trade." + }, + "product": { + "$ref": "product.schema.json" + } + }, + "required": [ + "type", "id", "product" + ], + "additionalProperties": true, + "examples": [ + { + "type": "fdc3.trade", + "name": "...", + "id": { + "myEMS": "12345" + }, + "product": { + "type": "fdc3.product", + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } + ] +} \ No newline at end of file diff --git a/website/static/schemas/next/tradeList.schema.json b/website/static/schemas/next/tradeList.schema.json new file mode 100644 index 000000000..c69d8d7b5 --- /dev/null +++ b/website/static/schemas/next/tradeList.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/tradeList.schema.json", + "type": "object", + "title": "TradeList", + "description": "@experimental A list of trades.", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.tradeList" }, + "trades": { + "type": "array", + "items": { "$ref": "trade.schema.json#" } + } + }, + "required": ["type", "trades"] +} From 59ef08a5cc10d1b0a63c2d4cf115a69c833e5dde Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:10:37 +0100 Subject: [PATCH 05/23] Update product.schema.json - add id to example --- website/static/schemas/next/product.schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/website/static/schemas/next/product.schema.json b/website/static/schemas/next/product.schema.json index de68054ad..577465eef 100644 --- a/website/static/schemas/next/product.schema.json +++ b/website/static/schemas/next/product.schema.json @@ -37,6 +37,9 @@ "examples": [ { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { @@ -45,4 +48,4 @@ } } ] -} \ No newline at end of file +} From c2e1592add7f22b2d582668683d45c7c0b8fa18c Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:11:51 +0100 Subject: [PATCH 06/23] Update trade.schema.json - add id to product example --- src/context/schemas/trade.schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/context/schemas/trade.schema.json b/src/context/schemas/trade.schema.json index 27fecf8bd..1748a8f86 100644 --- a/src/context/schemas/trade.schema.json +++ b/src/context/schemas/trade.schema.json @@ -43,6 +43,9 @@ }, "product": { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { @@ -52,4 +55,4 @@ } } ] -} \ No newline at end of file +} From 1ac641e25a0470b6d3e9e28f8adf61a030fe67cb Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:12:37 +0100 Subject: [PATCH 07/23] Update order.schema.json - add id to product example --- src/context/schemas/order.schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json index 4f4d8530c..e1880c7bf 100644 --- a/src/context/schemas/order.schema.json +++ b/src/context/schemas/order.schema.json @@ -52,6 +52,9 @@ "details": { "product": { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { @@ -68,4 +71,4 @@ } } ] -} \ No newline at end of file +} From 2f44d72b0aecdde6f12df0066c5726ff3b85dd8f Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:13:38 +0100 Subject: [PATCH 08/23] Update Product.md - add id to product example --- docs/context/ref/Product.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/context/ref/Product.md b/docs/context/ref/Product.md index 7d20dc52d..533829b38 100644 --- a/docs/context/ref/Product.md +++ b/docs/context/ref/Product.md @@ -34,11 +34,14 @@ Notes: ```js const product = { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { - "type": "fdc3.instrument", - "id": { - "ticker": "MSFT" - } + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } } }; ``` From a1aca4f183ab2c0cc2e5afafa784acc8a4fbc75c Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:14:09 +0100 Subject: [PATCH 09/23] Update Trade.md - add id to product example --- docs/context/ref/Trade.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/context/ref/Trade.md b/docs/context/ref/Trade.md index de95133c6..ed2a4a0ab 100644 --- a/docs/context/ref/Trade.md +++ b/docs/context/ref/Trade.md @@ -42,7 +42,10 @@ const trade = { }, "product": { "type": "fdc3.product", - "instrument": { + "id": { + "productId": "ABC123" + }, + "instrument": { "type": "fdc3.instrument", "id": { "ticker": "MSFT" From e6ff515f828774f0451416eb3981e92fedf30c43 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:14:50 +0100 Subject: [PATCH 10/23] Update Order.md - add id to product example --- docs/context/ref/Order.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md index 60df034e2..28079b452 100644 --- a/docs/context/ref/Order.md +++ b/docs/context/ref/Order.md @@ -40,6 +40,9 @@ const order1 = { "details": { "product": { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { From 4ca3b885bcadf4ef4114744c85249337c3bae3f7 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:15:59 +0100 Subject: [PATCH 11/23] Update TradeList.md - add id to product example --- docs/context/ref/TradeList.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/context/ref/TradeList.md b/docs/context/ref/TradeList.md index 02324c712..ce4871e08 100644 --- a/docs/context/ref/TradeList.md +++ b/docs/context/ref/TradeList.md @@ -43,6 +43,10 @@ const tradeList = { }, "product": { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, + "instrument": { "type": "fdc3.instrument", "id": { @@ -58,6 +62,9 @@ const tradeList = { }, "product": { "type": "fdc3.product", + "id": { + "productId": "DEF456" + }, "instrument": { "type": "fdc3.instrument", "id": { From 0880e25dd80842b101498821c6fc7a131c5d1f31 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:17:30 +0100 Subject: [PATCH 12/23] Update order.schema.json - fixing indentation --- src/context/schemas/order.schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json index e1880c7bf..fdfdd3888 100644 --- a/src/context/schemas/order.schema.json +++ b/src/context/schemas/order.schema.json @@ -52,9 +52,9 @@ "details": { "product": { "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { From cc339c493c32a9780b90b25a1cbf64c0b167025f Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:18:12 +0100 Subject: [PATCH 13/23] Update trade.schema.json - fix indentation --- src/context/schemas/trade.schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context/schemas/trade.schema.json b/src/context/schemas/trade.schema.json index 1748a8f86..21ee894ea 100644 --- a/src/context/schemas/trade.schema.json +++ b/src/context/schemas/trade.schema.json @@ -43,9 +43,9 @@ }, "product": { "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { From eea68441d0cd340a91e7f300bce7d6b01dfdd1f3 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:19:09 +0100 Subject: [PATCH 14/23] Update TradeList.md - remove extraneous newline --- docs/context/ref/TradeList.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/context/ref/TradeList.md b/docs/context/ref/TradeList.md index ce4871e08..053ac8a48 100644 --- a/docs/context/ref/TradeList.md +++ b/docs/context/ref/TradeList.md @@ -46,7 +46,6 @@ const tradeList = { "id": { "productId": "ABC123" }, - "instrument": { "type": "fdc3.instrument", "id": { From 0bf50658d7b6aa754bc924401a114c9ac90fc20d Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:20:17 +0100 Subject: [PATCH 15/23] Update product.schema.json - adding id to product example --- src/context/schemas/product.schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/context/schemas/product.schema.json b/src/context/schemas/product.schema.json index de68054ad..e0293464e 100644 --- a/src/context/schemas/product.schema.json +++ b/src/context/schemas/product.schema.json @@ -37,6 +37,9 @@ "examples": [ { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { @@ -45,4 +48,4 @@ } } ] -} \ No newline at end of file +} From da596f92b314c140e1d867cc45fa5cad4335442e Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 24 Jul 2023 15:22:42 +0100 Subject: [PATCH 16/23] copying schemas to website --- website/static/schemas/next/order.schema.json | 5 ++++- website/static/schemas/next/product.schema.json | 6 +++--- website/static/schemas/next/trade.schema.json | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/website/static/schemas/next/order.schema.json b/website/static/schemas/next/order.schema.json index 4f4d8530c..fdfdd3888 100644 --- a/website/static/schemas/next/order.schema.json +++ b/website/static/schemas/next/order.schema.json @@ -52,6 +52,9 @@ "details": { "product": { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { @@ -68,4 +71,4 @@ } } ] -} \ No newline at end of file +} diff --git a/website/static/schemas/next/product.schema.json b/website/static/schemas/next/product.schema.json index 577465eef..e0293464e 100644 --- a/website/static/schemas/next/product.schema.json +++ b/website/static/schemas/next/product.schema.json @@ -37,9 +37,9 @@ "examples": [ { "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { diff --git a/website/static/schemas/next/trade.schema.json b/website/static/schemas/next/trade.schema.json index 27fecf8bd..21ee894ea 100644 --- a/website/static/schemas/next/trade.schema.json +++ b/website/static/schemas/next/trade.schema.json @@ -43,6 +43,9 @@ }, "product": { "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, "instrument": { "type": "fdc3.instrument", "id": { @@ -52,4 +55,4 @@ } } ] -} \ No newline at end of file +} From 23fd549a1290426d09126456c0cb66b524d7b06c Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 10:48:44 +0100 Subject: [PATCH 17/23] corrections from meeting review --- docs/context/ref/Order.md | 14 +++++++------- docs/context/ref/Product.md | 2 +- docs/context/ref/Trade.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md index 28079b452..8589dc727 100644 --- a/docs/context/ref/Order.md +++ b/docs/context/ref/Order.md @@ -20,13 +20,13 @@ This type currently only defines a required `id` field, which should provide a r ## Details -| Property | Type | Required | Details | -|--------------|------------|----------|---------------------------| -| `type` | string | Yes | `'fdc3.order'` | -| `id` | object | Yes | One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future. E.g.:`{ myOMS: '12345' }` | -| `name` | string | No | An optional human-readable summary of the order. | -| `details` | object | No | Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context | -| `details.product` | Product | No | The product that the order relates to | +| Property | Type | Required | Details | +|-------------------|------------|----------|---------------------------| +| `type` | string | Yes | `'fdc3.order'` | +| `id` | object | Yes | One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future. E.g.:`{ myOMS: '12345' }` | +| `name` | string | No | An optional human-readable summary of the order. | +| `details` | object | No | Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context | +| `details.product` | Product | No | The product that the order relates to | ## Examples diff --git a/docs/context/ref/Product.md b/docs/context/ref/Product.md index 533829b38..e09e31f44 100644 --- a/docs/context/ref/Product.md +++ b/docs/context/ref/Product.md @@ -27,7 +27,7 @@ Notes: | `type` | string | Yes | `'fdc3.product'` | | `id` | object | Yes | One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future. | | `name` | string | No | A human-readable summary of the product. | -| `instrument` | Product[] | No | A financial instrument that relates to the definition of this product. | +| `instrument` | Instrument | No | A financial instrument that relates to the definition of this product. | ## Example diff --git a/docs/context/ref/Trade.md b/docs/context/ref/Trade.md index ed2a4a0ab..e6756c0b7 100644 --- a/docs/context/ref/Trade.md +++ b/docs/context/ref/Trade.md @@ -45,7 +45,7 @@ const trade = { "id": { "productId": "ABC123" }, - "instrument": { + "instrument": { "type": "fdc3.instrument", "id": { "ticker": "MSFT" From cb15df6f11bcd825eae98a216b8eaa0521783e96 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 10:49:21 +0100 Subject: [PATCH 18/23] Apply suggestions from code review Co-authored-by: Hugh Troeger --- docs/context/ref/Order.md | 2 +- docs/context/ref/Product.md | 2 +- docs/context/ref/Trade.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md index 8589dc727..73f94d7fc 100644 --- a/docs/context/ref/Order.md +++ b/docs/context/ref/Order.md @@ -8,7 +8,7 @@ hide_title: true [`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing an order. To be used with OMS and EMS systems. -This type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future. require not just a single trade, but multiple. +This type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human-readable `name` field to be used to summarize the order, and an optional `details` field that may be used to provide additional detail about the order, including a Context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as an unspecified Context type, but both `details` and `details.product` are expected to be standardized in the future. ## Type diff --git a/docs/context/ref/Product.md b/docs/context/ref/Product.md index e09e31f44..d7fb4619a 100644 --- a/docs/context/ref/Product.md +++ b/docs/context/ref/Product.md @@ -6,7 +6,7 @@ hide_title: true --- # `Product` -[`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field. +[`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing a tradable product. To be used with OMS and EMS systems. This type is currently only loosely defined as an extensible context object, with an optional instrument field. Notes: diff --git a/docs/context/ref/Trade.md b/docs/context/ref/Trade.md index e6756c0b7..e518f97ab 100644 --- a/docs/context/ref/Trade.md +++ b/docs/context/ref/Trade.md @@ -8,7 +8,7 @@ hide_title: true [`@experimental`](/docs/fdc3-compliance#experimental-features) context type representing a trade. To be used with execution systems. -This type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future. +This type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as an unspecified Context type, but `product` is expected to be standardized in future. Notes: From 95ad9f03e919482f062bccdcb23cc9e05a15f548 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 11:13:32 +0100 Subject: [PATCH 19/23] Adding new schemas back in after merge, copy to website, regenerating types and correcting schema id in message schema --- schemas/context/action.schema.json | 2 +- schemas/context/message.schema.json | 2 +- schemas/context/order.schema.json | 74 +++ schemas/context/orderList.schema.json | 16 + schemas/context/product.schema.json | 51 ++ schemas/context/trade.schema.json | 58 ++ schemas/context/tradeList.schema.json | 16 + src/context/ContextTypes.ts | 569 ++++++++++++++++-- ...raiseIntentResultAgentResponse.schema.json | 8 +- .../schemas/next/context/order.schema.json | 2 +- .../next/context/orderList.schema.json | 2 +- .../schemas/next/context/product.schema.json | 2 +- .../schemas/next/context/trade.schema.json | 2 +- .../next/context/tradeList.schema.json | 2 +- 14 files changed, 750 insertions(+), 56 deletions(-) create mode 100644 schemas/context/order.schema.json create mode 100644 schemas/context/orderList.schema.json create mode 100644 schemas/context/product.schema.json create mode 100644 schemas/context/trade.schema.json create mode 100644 schemas/context/tradeList.schema.json diff --git a/schemas/context/action.schema.json b/schemas/context/action.schema.json index 388eb5073..a985015a7 100644 --- a/schemas/context/action.schema.json +++ b/schemas/context/action.schema.json @@ -11,7 +11,7 @@ }, "intent": { "type": "string", - "$comment": "Should reference an intent type name, such as those defined in the FDC3 Standard'" + "description": "A reference an intent type name, such as those defined in the FDC3 Standard" }, "context": { "type": "object", diff --git a/schemas/context/message.schema.json b/schemas/context/message.schema.json index 9f69e5b3f..9d2050b7b 100644 --- a/schemas/context/message.schema.json +++ b/schemas/context/message.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/context/message.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/message.schema.json", "type": "object", "title": "Message", "allOf": [{ "$ref": "context.schema.json#" }], diff --git a/schemas/context/order.schema.json b/schemas/context/order.schema.json new file mode 100644 index 000000000..baa8381b9 --- /dev/null +++ b/schemas/context/order.schema.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/order.schema.json", + "type": "object", + "title": "Order", + "description": "@experimental context type representing an order. To be used with OMS and EMS systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future.", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Order Identifiers", + "description": "One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "An optional human-readable summary of the order." + }, + "details": { + "type": "object", + "title": "Order Details", + "description": "Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context", + "properties": { + "product": { + "$ref": "product.schema.json" + } + }, + "additionalProperties": true + } + }, + "required": [ + "type", "id" + ], + "additionalProperties": true, + "examples": [ + { + "type": "fdc3.order", + "name": "...", + "id": { + "myOMS": "12345" + }, + "details": { + "product": { + "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } + }, + { + "type": "fdc3.order", + "id": { + "myOMS": "ABC123" + } + } + ] +} diff --git a/schemas/context/orderList.schema.json b/schemas/context/orderList.schema.json new file mode 100644 index 000000000..bfc532e32 --- /dev/null +++ b/schemas/context/orderList.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/orderList.schema.json", + "type": "object", + "title": "OrderList", + "description": "@experimental A list of orders", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.orderList" }, + "orders": { + "type": "array", + "items": { "$ref": "order.schema.json#" } + } + }, + "required": ["type", "orders"] +} diff --git a/schemas/context/product.schema.json b/schemas/context/product.schema.json new file mode 100644 index 000000000..a1571d4f9 --- /dev/null +++ b/schemas/context/product.schema.json @@ -0,0 +1,51 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/product.schema.json", + "type": "object", + "title": "Product", + "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.", + "allOf": [ + { + "$ref": "context.schema.json#" + },{ + "type": "object", + "properties": { + "type": { + "const": "fdc3.product" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Product Identifiers", + "description": "One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the product." + }, + "instrument": { + "$ref": "instrument.schema.json" + } + }, + "required": ["type","id"], + "additionalProperties": true + } + ], + "examples": [ + { + "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + ] +} diff --git a/schemas/context/trade.schema.json b/schemas/context/trade.schema.json new file mode 100644 index 000000000..10a108c31 --- /dev/null +++ b/schemas/context/trade.schema.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/trade.schema.json", + "type": "object", + "title": "Trade", + "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.trade" + }, + "id": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "title": "Trade Identifiers", + "description": "One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." + }, + "name": { + "type": "string", + "title": "Name", + "description": "A human-readable summary of the trade." + }, + "product": { + "$ref": "product.schema.json" + } + }, + "required": [ + "type", "id", "product" + ], + "additionalProperties": true, + "examples": [ + { + "type": "fdc3.trade", + "name": "...", + "id": { + "myEMS": "12345" + }, + "product": { + "type": "fdc3.product", + "id": { + "productId": "ABC123" + }, + "instrument": { + "type": "fdc3.instrument", + "id": { + "ticker": "MSFT" + } + } + } + } + ] +} diff --git a/schemas/context/tradeList.schema.json b/schemas/context/tradeList.schema.json new file mode 100644 index 000000000..49d8b0d27 --- /dev/null +++ b/schemas/context/tradeList.schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/context/tradeList.schema.json", + "type": "object", + "title": "TradeList", + "description": "@experimental A list of trades.", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.tradeList" }, + "trades": { + "type": "array", + "items": { "$ref": "trade.schema.json#" } + } + }, + "required": ["type", "trades"] +} diff --git a/src/context/ContextTypes.ts b/src/context/ContextTypes.ts index ae40a775f..61fb74cf9 100644 --- a/src/context/ContextTypes.ts +++ b/src/context/ContextTypes.ts @@ -1,9 +1,13 @@ // To parse this data: // -// import { Convert, Chart, ChatInitSettings, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, Valuation } from "./file"; +// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; // +// const action = Convert.toAction(json); // const chart = Convert.toChart(json); // const chatInitSettings = Convert.toChatInitSettings(json); +// const chatMessage = Convert.toChatMessage(json); +// const chatRoom = Convert.toChatRoom(json); +// const chatSearchCriteria = Convert.toChatSearchCriteria(json); // const contact = Convert.toContact(json); // const contactList = Convert.toContactList(json); // const context = Convert.toContext(json); @@ -12,6 +16,8 @@ // const email = Convert.toEmail(json); // const instrument = Convert.toInstrument(json); // const instrumentList = Convert.toInstrumentList(json); +// const interaction = Convert.toInteraction(json); +// const message = Convert.toMessage(json); // const nothing = Convert.toNothing(json); // const order = Convert.toOrder(json); // const orderList = Convert.toOrderList(json); @@ -22,14 +28,43 @@ // const timeRange = Convert.toTimeRange(json); // const trade = Convert.toTrade(json); // const tradeList = Convert.toTradeList(json); +// const transactionResult = Convert.toTransactionResult(json); // const valuation = Convert.toValuation(json); // // These functions will throw an error if the JSON doesn't // match the expected interface, even if the JSON is valid. +export interface Action { + app?: ActionApp; + context: ActionContext; + customConfig?: { [key: string]: any }; + /** + * A reference an intent type name, such as those defined in the FDC3 Standard + */ + intent?: string; + title: string; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export interface ActionApp { + appId: string; + instanceId?: string; + [property: string]: any; +} + +export interface ActionContext { + id?: { [key: string]: any }; + name?: string; + type: string; + [property: string]: any; +} + export interface Chart { instruments: InstrumentElement[]; - otherConfig?: OtherConfigElement[]; + otherConfig?: ContextElement[]; range?: TimeRangeObject; style?: Style; type: string; @@ -40,7 +75,7 @@ export interface Chart { export interface InstrumentElement { id: PurpleID; - market?: PurpleMarket; + market?: OrganizationMarket; type: string; name?: string; [property: string]: any; @@ -59,7 +94,7 @@ export interface PurpleID { [property: string]: any; } -export interface PurpleMarket { +export interface OrganizationMarket { BBG?: string; COUNTRY_ISOALPHA2?: string; MIC?: string; @@ -67,7 +102,7 @@ export interface PurpleMarket { [property: string]: any; } -export interface OtherConfigElement { +export interface ContextElement { id?: { [key: string]: any }; name?: string; type: string; @@ -98,10 +133,12 @@ export enum Style { export interface ChatInitSettings { chatName?: string; - initMessage?: string; members?: ContactListObject; - options?: any; - type: any; + message?: MessageObject | string; + options?: Options; + type: string; + id?: { [key: string]: any }; + name?: string; [property: string]: any; } @@ -126,14 +163,131 @@ export interface FluffyID { [property: string]: any; } -export interface Contact { +export interface MessageObject { + entities?: { [key: string]: PurpleAction }; + text?: PurpleText; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export interface PurpleAction { + app?: EntityApp; + context?: EntityContext; + customConfig?: { [key: string]: any }; + /** + * A reference an intent type name, such as those defined in the FDC3 Standard + */ + intent?: string; + title?: string; + type: any; + id?: { [key: string]: any }; + name?: string; + data?: PurpleData; + [property: string]: any; +} + +export interface EntityApp { + appId: string; + instanceId?: string; + [property: string]: any; +} + +export interface EntityContext { + id?: { [key: string]: any }; + name?: string; + type: string; + [property: string]: any; +} + +export interface PurpleData { + dataUri: string; + name: string; + [property: string]: any; +} + +export interface PurpleText { + 'text/markdown'?: string; + 'text/plain'?: string; + [property: string]: any; +} + +export interface Options { + allowAddUser?: boolean; + allowHistoryBrowsing?: boolean; + allowMessageCopy?: boolean; + groupRecipients?: boolean; + isPublic?: boolean; + [property: string]: any; +} + +export interface ChatMessage { + chatRoom: ChatRoomObject; + message: MessageObject; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export interface ChatRoomObject { + id: { [key: string]: any }; + name?: string; + providerName: string; + type: string; + url?: string; + [property: string]: any; +} + +export interface ChatRoom { + id: { [key: string]: any }; + name?: string; + providerName: string; + type: string; + url?: string; + [property: string]: any; +} + +export interface ChatSearchCriteria { + criteria: Array; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export interface OrganizationObject { id: TentacledID; + market?: OrganizationMarket; type: string; name?: string; [property: string]: any; } export interface TentacledID { + BBG?: string; + CUSIP?: string; + FDS_ID?: string; + FIGI?: string; + ISIN?: string; + PERMID?: string; + RIC?: string; + SEDOL?: string; + ticker?: string; + LEI?: string; + email?: string; + [property: string]: any; +} + +export interface Contact { + id: StickyID; + type: string; + name?: string; + [property: string]: any; +} + +export interface StickyID { email?: string; FDS_ID?: string; [property: string]: any; @@ -206,14 +360,14 @@ export interface RecipientsID { } export interface Instrument { - id: StickyID; - market?: FluffyMarket; + id: IndigoID; + market?: PurpleMarket; type: string; name?: string; [property: string]: any; } -export interface StickyID { +export interface IndigoID { BBG?: string; CUSIP?: string; FDS_ID?: string; @@ -226,7 +380,7 @@ export interface StickyID { [property: string]: any; } -export interface FluffyMarket { +export interface PurpleMarket { BBG?: string; COUNTRY_ISOALPHA2?: string; MIC?: string; @@ -243,14 +397,53 @@ export interface InstrumentList { } export interface Interaction { - id?: { [key: string]: string }; - type: string; - participants: ContactList; - timeRange: TimeRange; - interactionType: ('Instant Message' | 'Email' | 'Call' | 'Meeting') | string; description: string; - initiator?: Contact; + initiator?: ContactElement; + interactionType: string; origin?: string; + participants: ContactListObject; + timeRange: TimeRangeObject; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export interface Message { + entities?: { [key: string]: FluffyAction }; + text?: FluffyText; + type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export interface FluffyAction { + app?: EntityApp; + context?: EntityContext; + customConfig?: { [key: string]: any }; + /** + * A reference an intent type name, such as those defined in the FDC3 Standard + */ + intent?: string; + title?: string; + type: any; + id?: { [key: string]: any }; + name?: string; + data?: FluffyData; + [property: string]: any; +} + +export interface FluffyData { + dataUri: string; + name: string; + [property: string]: any; +} + +export interface FluffyText { + 'text/markdown'?: string; + 'text/plain'?: string; + [property: string]: any; } export interface Nothing { @@ -283,7 +476,7 @@ export interface Order { */ id: { [key: string]: string }; /** - * A human-readable summary of the order. + * An optional human-readable summary of the order. */ name?: string; type: string; @@ -355,7 +548,7 @@ export interface OrderElement { */ id: { [key: string]: string }; /** - * A human-readable summary of the order. + * An optional human-readable summary of the order. */ name?: string; type: string; @@ -372,13 +565,13 @@ export interface FluffyOrderDetails { } export interface Organization { - id: OrganizationID; + id: IndecentID; type: string; name?: string; [property: string]: any; } -export interface OrganizationID { +export interface IndecentID { FDS_ID?: string; LEI?: string; PERMID?: string; @@ -458,7 +651,7 @@ export interface Trade { */ id: { [key: string]: string }; /** - * A human-readable summary of the order. + * A human-readable summary of the trade. */ name?: string; product: ProductObject; @@ -493,7 +686,7 @@ export interface TradeElement { */ id: { [key: string]: string }; /** - * A human-readable summary of the order. + * A human-readable summary of the trade. */ name?: string; product: ProductObject; @@ -501,9 +694,20 @@ export interface TradeElement { [property: string]: any; } -export interface ChatSearchCriteria { - criteria: (Instrument | Organization | Contact | string)[]; +export interface TransactionResult { + context?: ContextElement; + status: Status; type: string; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +export enum Status { + Created = 'Created', + Deleted = 'Deleted', + Failed = 'Failed', + Updated = 'Updated', } export interface Valuation { @@ -518,16 +722,17 @@ export interface Valuation { [property: string]: any; } -export interface TransactionResult { - status: ('Created' | 'Deleted' | 'Updated' | 'Failed') | string; - type: string; - context?: Context; - message?: string; -} - // Converts JSON strings to/from your types // and asserts the results of JSON.parse at runtime export class Convert { + public static toAction(json: string): Action { + return cast(JSON.parse(json), r('Action')); + } + + public static actionToJson(value: Action): string { + return JSON.stringify(uncast(value, r('Action')), null, 2); + } + public static toChart(json: string): Chart { return cast(JSON.parse(json), r('Chart')); } @@ -544,6 +749,30 @@ export class Convert { return JSON.stringify(uncast(value, r('ChatInitSettings')), null, 2); } + public static toChatMessage(json: string): ChatMessage { + return cast(JSON.parse(json), r('ChatMessage')); + } + + public static chatMessageToJson(value: ChatMessage): string { + return JSON.stringify(uncast(value, r('ChatMessage')), null, 2); + } + + public static toChatRoom(json: string): ChatRoom { + return cast(JSON.parse(json), r('ChatRoom')); + } + + public static chatRoomToJson(value: ChatRoom): string { + return JSON.stringify(uncast(value, r('ChatRoom')), null, 2); + } + + public static toChatSearchCriteria(json: string): ChatSearchCriteria { + return cast(JSON.parse(json), r('ChatSearchCriteria')); + } + + public static chatSearchCriteriaToJson(value: ChatSearchCriteria): string { + return JSON.stringify(uncast(value, r('ChatSearchCriteria')), null, 2); + } + public static toContact(json: string): Contact { return cast(JSON.parse(json), r('Contact')); } @@ -608,6 +837,22 @@ export class Convert { return JSON.stringify(uncast(value, r('InstrumentList')), null, 2); } + public static toInteraction(json: string): Interaction { + return cast(JSON.parse(json), r('Interaction')); + } + + public static interactionToJson(value: Interaction): string { + return JSON.stringify(uncast(value, r('Interaction')), null, 2); + } + + public static toMessage(json: string): Message { + return cast(JSON.parse(json), r('Message')); + } + + public static messageToJson(value: Message): string { + return JSON.stringify(uncast(value, r('Message')), null, 2); + } + public static toNothing(json: string): Nothing { return cast(JSON.parse(json), r('Nothing')); } @@ -688,6 +933,14 @@ export class Convert { return JSON.stringify(uncast(value, r('TradeList')), null, 2); } + public static toTransactionResult(json: string): TransactionResult { + return cast(JSON.parse(json), r('TransactionResult')); + } + + public static transactionResultToJson(value: TransactionResult): string { + return JSON.stringify(uncast(value, r('TransactionResult')), null, 2); + } + public static toValuation(json: string): Valuation { return cast(JSON.parse(json), r('Valuation')); } @@ -864,10 +1117,38 @@ function r(name: string) { } const typeMap: any = { + Action: o( + [ + { json: 'app', js: 'app', typ: u(undefined, r('ActionApp')) }, + { json: 'context', js: 'context', typ: r('ActionContext') }, + { json: 'customConfig', js: 'customConfig', typ: u(undefined, m('any')) }, + { json: 'intent', js: 'intent', typ: u(undefined, '') }, + { json: 'title', js: 'title', typ: '' }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + ActionApp: o( + [ + { json: 'appId', js: 'appId', typ: '' }, + { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') }, + ], + 'any' + ), + ActionContext: o( + [ + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: '' }, + ], + 'any' + ), Chart: o( [ { json: 'instruments', js: 'instruments', typ: a(r('InstrumentElement')) }, - { json: 'otherConfig', js: 'otherConfig', typ: u(undefined, a(r('OtherConfigElement'))) }, + { json: 'otherConfig', js: 'otherConfig', typ: u(undefined, a(r('ContextElement'))) }, { json: 'range', js: 'range', typ: u(undefined, r('TimeRangeObject')) }, { json: 'style', js: 'style', typ: u(undefined, r('Style')) }, { json: 'type', js: 'type', typ: '' }, @@ -879,7 +1160,7 @@ const typeMap: any = { InstrumentElement: o( [ { json: 'id', js: 'id', typ: r('PurpleID') }, - { json: 'market', js: 'market', typ: u(undefined, r('PurpleMarket')) }, + { json: 'market', js: 'market', typ: u(undefined, r('OrganizationMarket')) }, { json: 'type', js: 'type', typ: '' }, { json: 'name', js: 'name', typ: u(undefined, '') }, ], @@ -899,7 +1180,7 @@ const typeMap: any = { ], 'any' ), - PurpleMarket: o( + OrganizationMarket: o( [ { json: 'BBG', js: 'BBG', typ: u(undefined, '') }, { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u(undefined, '') }, @@ -908,7 +1189,7 @@ const typeMap: any = { ], 'any' ), - OtherConfigElement: o( + ContextElement: o( [ { json: 'id', js: 'id', typ: u(undefined, m('any')) }, { json: 'name', js: 'name', typ: u(undefined, '') }, @@ -929,10 +1210,12 @@ const typeMap: any = { ChatInitSettings: o( [ { json: 'chatName', js: 'chatName', typ: u(undefined, '') }, - { json: 'initMessage', js: 'initMessage', typ: u(undefined, '') }, { json: 'members', js: 'members', typ: u(undefined, r('ContactListObject')) }, - { json: 'options', js: 'options', typ: u(undefined, 'any') }, - { json: 'type', js: 'type', typ: 'any' }, + { json: 'message', js: 'message', typ: u(undefined, u(r('MessageObject'), '')) }, + { json: 'options', js: 'options', typ: u(undefined, r('Options')) }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, ], 'any' ), @@ -960,15 +1243,142 @@ const typeMap: any = { ], 'any' ), - Contact: o( + MessageObject: o( + [ + { json: 'entities', js: 'entities', typ: u(undefined, m(r('PurpleAction'))) }, + { json: 'text', js: 'text', typ: u(undefined, r('PurpleText')) }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + PurpleAction: o( + [ + { json: 'app', js: 'app', typ: u(undefined, r('EntityApp')) }, + { json: 'context', js: 'context', typ: u(undefined, r('EntityContext')) }, + { json: 'customConfig', js: 'customConfig', typ: u(undefined, m('any')) }, + { json: 'intent', js: 'intent', typ: u(undefined, '') }, + { json: 'title', js: 'title', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: 'any' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'data', js: 'data', typ: u(undefined, r('PurpleData')) }, + ], + 'any' + ), + EntityApp: o( + [ + { json: 'appId', js: 'appId', typ: '' }, + { json: 'instanceId', js: 'instanceId', typ: u(undefined, '') }, + ], + 'any' + ), + EntityContext: o( + [ + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: '' }, + ], + 'any' + ), + PurpleData: o( + [ + { json: 'dataUri', js: 'dataUri', typ: '' }, + { json: 'name', js: 'name', typ: '' }, + ], + 'any' + ), + PurpleText: o( + [ + { json: 'text/markdown', js: 'text/markdown', typ: u(undefined, '') }, + { json: 'text/plain', js: 'text/plain', typ: u(undefined, '') }, + ], + 'any' + ), + Options: o( + [ + { json: 'allowAddUser', js: 'allowAddUser', typ: u(undefined, true) }, + { json: 'allowHistoryBrowsing', js: 'allowHistoryBrowsing', typ: u(undefined, true) }, + { json: 'allowMessageCopy', js: 'allowMessageCopy', typ: u(undefined, true) }, + { json: 'groupRecipients', js: 'groupRecipients', typ: u(undefined, true) }, + { json: 'isPublic', js: 'isPublic', typ: u(undefined, true) }, + ], + 'any' + ), + ChatMessage: o( + [ + { json: 'chatRoom', js: 'chatRoom', typ: r('ChatRoomObject') }, + { json: 'message', js: 'message', typ: r('MessageObject') }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + ChatRoomObject: o( + [ + { json: 'id', js: 'id', typ: m('any') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'providerName', js: 'providerName', typ: '' }, + { json: 'type', js: 'type', typ: '' }, + { json: 'url', js: 'url', typ: u(undefined, '') }, + ], + 'any' + ), + ChatRoom: o( + [ + { json: 'id', js: 'id', typ: m('any') }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'providerName', js: 'providerName', typ: '' }, + { json: 'type', js: 'type', typ: '' }, + { json: 'url', js: 'url', typ: u(undefined, '') }, + ], + 'any' + ), + ChatSearchCriteria: o( + [ + { json: 'criteria', js: 'criteria', typ: a(u(r('OrganizationObject'), '')) }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + OrganizationObject: o( [ { json: 'id', js: 'id', typ: r('TentacledID') }, + { json: 'market', js: 'market', typ: u(undefined, r('OrganizationMarket')) }, { json: 'type', js: 'type', typ: '' }, { json: 'name', js: 'name', typ: u(undefined, '') }, ], 'any' ), TentacledID: o( + [ + { json: 'BBG', js: 'BBG', typ: u(undefined, '') }, + { json: 'CUSIP', js: 'CUSIP', typ: u(undefined, '') }, + { json: 'FDS_ID', js: 'FDS_ID', typ: u(undefined, '') }, + { json: 'FIGI', js: 'FIGI', typ: u(undefined, '') }, + { json: 'ISIN', js: 'ISIN', typ: u(undefined, '') }, + { json: 'PERMID', js: 'PERMID', typ: u(undefined, '') }, + { json: 'RIC', js: 'RIC', typ: u(undefined, '') }, + { json: 'SEDOL', js: 'SEDOL', typ: u(undefined, '') }, + { json: 'ticker', js: 'ticker', typ: u(undefined, '') }, + { json: 'LEI', js: 'LEI', typ: u(undefined, '') }, + { json: 'email', js: 'email', typ: u(undefined, '') }, + ], + 'any' + ), + Contact: o( + [ + { json: 'id', js: 'id', typ: r('StickyID') }, + { json: 'type', js: 'type', typ: '' }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + StickyID: o( [ { json: 'email', js: 'email', typ: u(undefined, '') }, { json: 'FDS_ID', js: 'FDS_ID', typ: u(undefined, '') }, @@ -1047,14 +1457,14 @@ const typeMap: any = { ), Instrument: o( [ - { json: 'id', js: 'id', typ: r('StickyID') }, - { json: 'market', js: 'market', typ: u(undefined, r('FluffyMarket')) }, + { json: 'id', js: 'id', typ: r('IndigoID') }, + { json: 'market', js: 'market', typ: u(undefined, r('PurpleMarket')) }, { json: 'type', js: 'type', typ: '' }, { json: 'name', js: 'name', typ: u(undefined, '') }, ], 'any' ), - StickyID: o( + IndigoID: o( [ { json: 'BBG', js: 'BBG', typ: u(undefined, '') }, { json: 'CUSIP', js: 'CUSIP', typ: u(undefined, '') }, @@ -1068,7 +1478,7 @@ const typeMap: any = { ], 'any' ), - FluffyMarket: o( + PurpleMarket: o( [ { json: 'BBG', js: 'BBG', typ: u(undefined, '') }, { json: 'COUNTRY_ISOALPHA2', js: 'COUNTRY_ISOALPHA2', typ: u(undefined, '') }, @@ -1086,6 +1496,58 @@ const typeMap: any = { ], 'any' ), + Interaction: o( + [ + { json: 'description', js: 'description', typ: '' }, + { json: 'initiator', js: 'initiator', typ: u(undefined, r('ContactElement')) }, + { json: 'interactionType', js: 'interactionType', typ: '' }, + { json: 'origin', js: 'origin', typ: u(undefined, '') }, + { json: 'participants', js: 'participants', typ: r('ContactListObject') }, + { json: 'timeRange', js: 'timeRange', typ: r('TimeRangeObject') }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + Message: o( + [ + { json: 'entities', js: 'entities', typ: u(undefined, m(r('FluffyAction'))) }, + { json: 'text', js: 'text', typ: u(undefined, r('FluffyText')) }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), + FluffyAction: o( + [ + { json: 'app', js: 'app', typ: u(undefined, r('EntityApp')) }, + { json: 'context', js: 'context', typ: u(undefined, r('EntityContext')) }, + { json: 'customConfig', js: 'customConfig', typ: u(undefined, m('any')) }, + { json: 'intent', js: 'intent', typ: u(undefined, '') }, + { json: 'title', js: 'title', typ: u(undefined, '') }, + { json: 'type', js: 'type', typ: 'any' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + { json: 'data', js: 'data', typ: u(undefined, r('FluffyData')) }, + ], + 'any' + ), + FluffyData: o( + [ + { json: 'dataUri', js: 'dataUri', typ: '' }, + { json: 'name', js: 'name', typ: '' }, + ], + 'any' + ), + FluffyText: o( + [ + { json: 'text/markdown', js: 'text/markdown', typ: u(undefined, '') }, + { json: 'text/plain', js: 'text/plain', typ: u(undefined, '') }, + ], + 'any' + ), Nothing: o( [ { json: 'type', js: 'type', typ: '' }, @@ -1134,13 +1596,13 @@ const typeMap: any = { FluffyOrderDetails: o([{ json: 'product', js: 'product', typ: u(undefined, r('ProductObject')) }], 'any'), Organization: o( [ - { json: 'id', js: 'id', typ: r('OrganizationID') }, + { json: 'id', js: 'id', typ: r('IndecentID') }, { json: 'type', js: 'type', typ: '' }, { json: 'name', js: 'name', typ: u(undefined, '') }, ], 'any' ), - OrganizationID: o( + IndecentID: o( [ { json: 'FDS_ID', js: 'FDS_ID', typ: u(undefined, '') }, { json: 'LEI', js: 'LEI', typ: u(undefined, '') }, @@ -1223,6 +1685,16 @@ const typeMap: any = { ], 'any' ), + TransactionResult: o( + [ + { json: 'context', js: 'context', typ: u(undefined, r('ContextElement')) }, + { json: 'status', js: 'status', typ: r('Status') }, + { json: 'type', js: 'type', typ: '' }, + { json: 'id', js: 'id', typ: u(undefined, m('any')) }, + { json: 'name', js: 'name', typ: u(undefined, '') }, + ], + 'any' + ), Valuation: o( [ { json: 'CURRENCY_ISOCODE', js: 'CURRENCY_ISOCODE', typ: '' }, @@ -1237,4 +1709,5 @@ const typeMap: any = { 'any' ), Style: ['bar', 'candle', 'custom', 'heatmap', 'histogram', 'line', 'mountain', 'pie', 'scatter', 'stacked-bar'], + Status: ['Created', 'Deleted', 'Failed', 'Updated'], }; diff --git a/website/static/schemas/next/bridging/raiseIntentResultAgentResponse.schema.json b/website/static/schemas/next/bridging/raiseIntentResultAgentResponse.schema.json index 4768d58f5..e5b8b36c7 100644 --- a/website/static/schemas/next/bridging/raiseIntentResultAgentResponse.schema.json +++ b/website/static/schemas/next/bridging/raiseIntentResultAgentResponse.schema.json @@ -27,7 +27,7 @@ "properties": { "intentResult": { "title": "IntentResult", - "oneOf": [ + "anyOf": [ { "type": "object", "title": "IntentResult Context", @@ -49,6 +49,12 @@ }, "required": ["channel"], "additionalProperties": false + }, + { + "type": "object", + "title": "IntentResult Void", + "properties": {}, + "additionalProperties": false } ] } diff --git a/website/static/schemas/next/context/order.schema.json b/website/static/schemas/next/context/order.schema.json index fdfdd3888..baa8381b9 100644 --- a/website/static/schemas/next/context/order.schema.json +++ b/website/static/schemas/next/context/order.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/order.schema.json", "type": "object", "title": "Order", "description": "@experimental context type representing an order. To be used with OMS and EMS systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future.", diff --git a/website/static/schemas/next/context/orderList.schema.json b/website/static/schemas/next/context/orderList.schema.json index 0e10694b6..bfc532e32 100644 --- a/website/static/schemas/next/context/orderList.schema.json +++ b/website/static/schemas/next/context/orderList.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/orderList.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/orderList.schema.json", "type": "object", "title": "OrderList", "description": "@experimental A list of orders", diff --git a/website/static/schemas/next/context/product.schema.json b/website/static/schemas/next/context/product.schema.json index e0293464e..a1571d4f9 100644 --- a/website/static/schemas/next/context/product.schema.json +++ b/website/static/schemas/next/context/product.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/product.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/product.schema.json", "type": "object", "title": "Product", "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.", diff --git a/website/static/schemas/next/context/trade.schema.json b/website/static/schemas/next/context/trade.schema.json index 21ee894ea..10a108c31 100644 --- a/website/static/schemas/next/context/trade.schema.json +++ b/website/static/schemas/next/context/trade.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/trade.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/trade.schema.json", "type": "object", "title": "Trade", "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.", diff --git a/website/static/schemas/next/context/tradeList.schema.json b/website/static/schemas/next/context/tradeList.schema.json index c69d8d7b5..49d8b0d27 100644 --- a/website/static/schemas/next/context/tradeList.schema.json +++ b/website/static/schemas/next/context/tradeList.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/tradeList.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/tradeList.schema.json", "type": "object", "title": "TradeList", "description": "@experimental A list of trades.", From e2353b241970a717ea56704d5656887f6947ac59 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 11:16:03 +0100 Subject: [PATCH 20/23] removing extra copy of schemas in website --- .../schemas/next/context/action.schema.json | 2 +- .../schemas/next/context/message.schema.json | 2 +- website/static/schemas/next/order.schema.json | 74 ------------------- .../static/schemas/next/orderList.schema.json | 16 ---- .../static/schemas/next/product.schema.json | 51 ------------- website/static/schemas/next/trade.schema.json | 58 --------------- .../static/schemas/next/tradeList.schema.json | 16 ---- 7 files changed, 2 insertions(+), 217 deletions(-) delete mode 100644 website/static/schemas/next/order.schema.json delete mode 100644 website/static/schemas/next/orderList.schema.json delete mode 100644 website/static/schemas/next/product.schema.json delete mode 100644 website/static/schemas/next/trade.schema.json delete mode 100644 website/static/schemas/next/tradeList.schema.json diff --git a/website/static/schemas/next/context/action.schema.json b/website/static/schemas/next/context/action.schema.json index 388eb5073..a985015a7 100644 --- a/website/static/schemas/next/context/action.schema.json +++ b/website/static/schemas/next/context/action.schema.json @@ -11,7 +11,7 @@ }, "intent": { "type": "string", - "$comment": "Should reference an intent type name, such as those defined in the FDC3 Standard'" + "description": "A reference an intent type name, such as those defined in the FDC3 Standard" }, "context": { "type": "object", diff --git a/website/static/schemas/next/context/message.schema.json b/website/static/schemas/next/context/message.schema.json index 9f69e5b3f..9d2050b7b 100644 --- a/website/static/schemas/next/context/message.schema.json +++ b/website/static/schemas/next/context/message.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/context/message.schema.json", + "$id": "https://fdc3.finos.org/schemas/next/context/message.schema.json", "type": "object", "title": "Message", "allOf": [{ "$ref": "context.schema.json#" }], diff --git a/website/static/schemas/next/order.schema.json b/website/static/schemas/next/order.schema.json deleted file mode 100644 index fdfdd3888..000000000 --- a/website/static/schemas/next/order.schema.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", - "type": "object", - "title": "Order", - "description": "@experimental context type representing an order. To be used with OMS and EMS systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the order in one or more systems, an optional human readable `name` field to be used to summarize the order and an optional `details` field that may be used to provide additional detail about the order, including a context representing a `product`, which may be extended with arbitrary properties. The `details.product` field is currently typed as a unspecified Context type, but both `details` and `details.product` are expected to be standardized in future.", - "allOf": [ - { - "$ref": "context.schema.json#" - } - ], - "properties": { - "type": { - "const": "fdc3.order" - }, - "id": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Order Identifiers", - "description": "One or more identifiers that refer to the order in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." - }, - "name": { - "type": "string", - "title": "Name", - "description": "An optional human-readable summary of the order." - }, - "details": { - "type": "object", - "title": "Order Details", - "description": "Optional additional details about the order, which may include a product element that is an, as yet undefined but extensible, Context", - "properties": { - "product": { - "$ref": "product.schema.json" - } - }, - "additionalProperties": true - } - }, - "required": [ - "type", "id" - ], - "additionalProperties": true, - "examples": [ - { - "type": "fdc3.order", - "name": "...", - "id": { - "myOMS": "12345" - }, - "details": { - "product": { - "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, - "instrument": { - "type": "fdc3.instrument", - "id": { - "ticker": "MSFT" - } - } - } - } - }, - { - "type": "fdc3.order", - "id": { - "myOMS": "ABC123" - } - } - ] -} diff --git a/website/static/schemas/next/orderList.schema.json b/website/static/schemas/next/orderList.schema.json deleted file mode 100644 index 0e10694b6..000000000 --- a/website/static/schemas/next/orderList.schema.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/orderList.schema.json", - "type": "object", - "title": "OrderList", - "description": "@experimental A list of orders", - "allOf": [{ "$ref": "context.schema.json#" }], - "properties": { - "type": { "const": "fdc3.orderList" }, - "orders": { - "type": "array", - "items": { "$ref": "order.schema.json#" } - } - }, - "required": ["type", "orders"] -} diff --git a/website/static/schemas/next/product.schema.json b/website/static/schemas/next/product.schema.json deleted file mode 100644 index e0293464e..000000000 --- a/website/static/schemas/next/product.schema.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/product.schema.json", - "type": "object", - "title": "Product", - "description": "@experimental context type representing a tradable product. To be used with OMS and EMS systems.\n\nThis type is currently only loosely defined as an extensible context object, with an optional instrument field.", - "allOf": [ - { - "$ref": "context.schema.json#" - },{ - "type": "object", - "properties": { - "type": { - "const": "fdc3.product" - }, - "id": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Product Identifiers", - "description": "One or more identifiers that refer to the product. Specific key names for systems are expected to be standardized in future." - }, - "name": { - "type": "string", - "title": "Name", - "description": "A human-readable summary of the product." - }, - "instrument": { - "$ref": "instrument.schema.json" - } - }, - "required": ["type","id"], - "additionalProperties": true - } - ], - "examples": [ - { - "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, - "instrument": { - "type": "fdc3.instrument", - "id": { - "ticker": "MSFT" - } - } - } - ] -} diff --git a/website/static/schemas/next/trade.schema.json b/website/static/schemas/next/trade.schema.json deleted file mode 100644 index 21ee894ea..000000000 --- a/website/static/schemas/next/trade.schema.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/trade.schema.json", - "type": "object", - "title": "Trade", - "description": "@experimental context type representing a trade. To be used with execution systems.\n\nThis type currently only defines a required `id` field, which should provide a reference to the trade in one or more systems, an optional human readable `name` field to be used to summarize the trade and a required `product` field that may be used to provide additional detail about the trade, which is currently typed as a unspecified Context type, but `product` is expected to be standardized in future.", - "allOf": [ - { - "$ref": "context.schema.json#" - } - ], - "properties": { - "type": { - "const": "fdc3.trade" - }, - "id": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "title": "Trade Identifiers", - "description": "One or more identifiers that refer to the trade in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future." - }, - "name": { - "type": "string", - "title": "Name", - "description": "A human-readable summary of the trade." - }, - "product": { - "$ref": "product.schema.json" - } - }, - "required": [ - "type", "id", "product" - ], - "additionalProperties": true, - "examples": [ - { - "type": "fdc3.trade", - "name": "...", - "id": { - "myEMS": "12345" - }, - "product": { - "type": "fdc3.product", - "id": { - "productId": "ABC123" - }, - "instrument": { - "type": "fdc3.instrument", - "id": { - "ticker": "MSFT" - } - } - } - } - ] -} diff --git a/website/static/schemas/next/tradeList.schema.json b/website/static/schemas/next/tradeList.schema.json deleted file mode 100644 index c69d8d7b5..000000000 --- a/website/static/schemas/next/tradeList.schema.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://fdc3.finos.org/schemas/next/tradeList.schema.json", - "type": "object", - "title": "TradeList", - "description": "@experimental A list of trades.", - "allOf": [{ "$ref": "context.schema.json#" }], - "properties": { - "type": { "const": "fdc3.tradeList" }, - "trades": { - "type": "array", - "items": { "$ref": "trade.schema.json#" } - } - }, - "required": ["type", "trades"] -} From 32bef7120f33e688b0d81e6ab038ccff80e79979 Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 11:29:59 +0100 Subject: [PATCH 21/23] correcting links to new schemas --- docs/context/ref/Order.md | 2 +- docs/context/ref/OrderList.md | 2 +- docs/context/ref/Product.md | 2 +- docs/context/ref/Trade.md | 2 +- docs/context/ref/TradeList.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md index 73f94d7fc..1ec05f05e 100644 --- a/docs/context/ref/Order.md +++ b/docs/context/ref/Order.md @@ -16,7 +16,7 @@ This type currently only defines a required `id` field, which should provide a r ## Schema - + ## Details diff --git a/docs/context/ref/OrderList.md b/docs/context/ref/OrderList.md index e48294ce8..2c5d49d26 100644 --- a/docs/context/ref/OrderList.md +++ b/docs/context/ref/OrderList.md @@ -18,7 +18,7 @@ Notes: ## Schema - + ## Details diff --git a/docs/context/ref/Product.md b/docs/context/ref/Product.md index d7fb4619a..12bf12661 100644 --- a/docs/context/ref/Product.md +++ b/docs/context/ref/Product.md @@ -18,7 +18,7 @@ Notes: ## Schema - + ## Details diff --git a/docs/context/ref/Trade.md b/docs/context/ref/Trade.md index e518f97ab..052ef156e 100644 --- a/docs/context/ref/Trade.md +++ b/docs/context/ref/Trade.md @@ -20,7 +20,7 @@ Notes: ## Schema - + ## Details diff --git a/docs/context/ref/TradeList.md b/docs/context/ref/TradeList.md index 053ac8a48..7f965fec8 100644 --- a/docs/context/ref/TradeList.md +++ b/docs/context/ref/TradeList.md @@ -18,7 +18,7 @@ Notes: ## Schema - + ## Details From ca80b00f583a3e16b051133e23c703dc3e04a95f Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 11:51:16 +0100 Subject: [PATCH 22/23] Correct links in markdown docs --- docs/context/ref/Product.md | 1 - docs/context/spec.md | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/context/ref/Product.md b/docs/context/ref/Product.md index 12bf12661..e36185eb2 100644 --- a/docs/context/ref/Product.md +++ b/docs/context/ref/Product.md @@ -51,6 +51,5 @@ const product = { Other Types - [Instrument](Instrument) -- [ProductList](ProductList) - [Order](Order) - [Trade](Trade) diff --git a/docs/context/spec.md b/docs/context/spec.md index 41e4cb803..3dbc21c83 100644 --- a/docs/context/spec.md +++ b/docs/context/spec.md @@ -186,11 +186,11 @@ The following are standard FDC3 context types: The following are [`@experimental`](/docs/fdc3-compliance#experimental-features) types, which are in the process of being defined: -- [`fdc3.order`](ref/Order) ([schema](/schemas/next/order.schema.json)) -- [`fdc3.orderList`](ref/OrderList) ([schema](/schemas/next/orderList.schema.json)) -- [`fdc3.product`](ref/Product) ([schema](/schemas/next/product.schema.json)) -- [`fdc3.trade`](ref/Trade) ([schema](/schemas/next/trade.schema.json)) -- [`fdc3.tradeList`](ref/TradeList) ([schema](/schemas/next/tradeList.schema.json)) +- [`fdc3.order`](ref/Order) ([schema](/schemas/next/context/order.schema.json)) +- [`fdc3.orderList`](ref/OrderList) ([schema](/schemas/next/context/orderList.schema.json)) +- [`fdc3.product`](ref/Product) ([schema](/schemas/next/context/product.schema.json)) +- [`fdc3.trade`](ref/Trade) ([schema](/schemas/next/context/trade.schema.json)) +- [`fdc3.tradeList`](ref/TradeList) ([schema](/schemas/next/context/tradeList.schema.json)) ### Examples From b8fdbfc8b256e334f4f4f1715262e5b996db356b Mon Sep 17 00:00:00 2001 From: Kris West Date: Fri, 28 Jul 2023 12:12:09 +0100 Subject: [PATCH 23/23] Changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb16c9a4..c776628d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Added a `ViewChat` Intent to be used when a user wants to open an existing chat room. ([#796](https://github.com/finos/FDC3/pull/796)) * Added a `ViewMessages` intent to be used when a user wants to search and see a list of messages. ([#797](https://github.com/finos/FDC3/pull/797)) * Added a context type representing a ChatSearchCriteria (`fdc3.chat.searchCriteria`). ([#797](https://github.com/finos/FDC3/pull/797)) -* Added an indication that applications, that can be launched to receive intents or context via a raised intent or open with context, SHOULD add their context or intent listeners via the API within 15 seconds, and that Desktop Agents MUST allow at least a 15 second timeout for them to do so, and MAY set a longer timeout ([#987](https://github.com/finos/FDC3/pull/987)) +* Added an indication that applications, that can be launched to receive intents or context via a raised intent or open with context, SHOULD add their context or intent listeners via the API within 15 seconds, and that Desktop Agents MUST allow at least a 15 second timeout for them to do so, and MAY set a longer timeout +* Added experimental `Order`, `OrderList`, `Product`, `Trade` & `TradeList` context types. ([#1021](https://github.com/finos/FDC3/pull/1021)) ### Changed