diff --git a/103120/examples/json/request1.json b/103120/examples/json/request1.json new file mode 100644 index 0000000000000000000000000000000000000000..71e5fa3eeaa27eaa677c9190235b23ce02b9cd68 --- /dev/null +++ b/103120/examples/json/request1.json @@ -0,0 +1,96 @@ +{ + "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", + "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", + "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation", + "Header": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e", + "Timestamp": "2015-09-01T12:00:00.000000Z", + "Version": { + "ETSIVersion": "V1.13.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "RequestPayload": { + "ActionRequests": { + "ActionRequest": [ + { + "ActionIdentifier": 0, + "CREATE": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject", + "ObjectIdentifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "auth:AuthorisationReference": "W000001", + "auth:AuthorisationTimespan": { + "auth:StartTime": "2015-09-01T12:00:00Z", + "auth:EndTime": "2015-12-01T12:00:00Z" + } + } + } + }, + { + "ActionIdentifier": 1, + "CREATE": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject", + "ObjectIdentifier": "2b36a78b-b628-416d-bd22-404e68a0cd36", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "AssociatedObjects": { + "AssociatedObject": [ + "7dbbc880-8750-4d3c-abe7-ea4a17646045" + ] + }, + "task:Reference": "LIID1", + "task:TargetIdentifier": { + "task:TargetIdentifierValues": { + "task:TargetIdentifierValue": [ + { + "task:FormatType": { + "task:FormatOwner": "ETSI", + "task:FormatName": "InternationalE164" + }, + "task:Value": "442079460223" + } + ] + } + }, + "task:DeliveryType": { + "common:Owner": "ETSI", + "common:Name": "TaskDeliveryType", + "common:Value": "IRIandCC" + }, + "task:DeliveryDetails": { + "task:DeliveryDestination": [ + { + "task:DeliveryAddress": { + "task:IPv4Address": "192.0.2.0" + } + } + ] + }, + "task:CSPID": { + "CountryCode": "XX", + "UniqueIdentifier": "RECVER01" + } + } + } + } + ] + } + } + } +} diff --git a/103120/examples/json/request2.json b/103120/examples/json/request2.json new file mode 100644 index 0000000000000000000000000000000000000000..476c15fa437343844d94b174b63c896756724fe6 --- /dev/null +++ b/103120/examples/json/request2.json @@ -0,0 +1,44 @@ +{ + "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", + "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", + "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation", + "Header": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "45002c1e-dc4a-470a-9152-8e752638c86c", + "Timestamp": "2015-09-01T12:01:00.000000Z", + "Version": { + "ETSIVersion": "V1.13.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "RequestPayload": { + "ActionRequests": { + "ActionRequest": [ + { + "ActionIdentifier": 0, + "GET": { + "Identifier": "2b36a78b-b628-416d-bd22-404e68a0cd36" + } + }, + { + "ActionIdentifier": 1, + "GET": { + "Identifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045" + } + } + ] + } + } + } +} diff --git a/103120/examples/json/response1.xml b/103120/examples/json/response1.xml new file mode 100644 index 0000000000000000000000000000000000000000..3a97690bca956abf6497632268257c3255ac8032 --- /dev/null +++ b/103120/examples/json/response1.xml @@ -0,0 +1,44 @@ +{ + "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", + "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", + "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation", + "Header": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e", + "Timestamp": "2015-09-01T12:00:01.000000Z", + "Version": { + "ETSIVersion": "V1.13.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "ResponsePayload": { + "ActionResponses": { + "ActionResponse": [ + { + "ActionIdentifier": 0, + "CREATEResponse": { + "Identifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045" + } + }, + { + "ActionIdentifier": 1, + "CREATEResponse": { + "Identifier": "2b36a78b-b628-416d-bd22-404e68a0cd36" + } + } + ] + } + } + } +} diff --git a/103120/examples/json/response2.xml b/103120/examples/json/response2.xml new file mode 100644 index 0000000000000000000000000000000000000000..829c8a7f1c93b836b655e60706a052513d319f04 --- /dev/null +++ b/103120/examples/json/response2.xml @@ -0,0 +1,118 @@ +{ + "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core", + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common", + "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task", + "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation", + "Header": { + "SenderIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR01" + }, + "ReceiverIdentifier": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "TransactionIdentifier": "45002c1e-dc4a-470a-9152-8e752638c86c", + "Timestamp": "2015-09-01T12:01:00.000000Z", + "Version": { + "ETSIVersion": "V1.13.1", + "NationalProfileOwner": "XX", + "NationalProfileVersion": "v1.0" + } + }, + "Payload": { + "ResponsePayload": { + "ActionResponses": { + "ActionResponse": [ + { + "ActionIdentifier": 0, + "GETResponse": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject", + "ObjectIdentifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "Generation": "1", + "LastChanged": "2015-09-01T12:00:00Z", + "auth:AuthorisationReference": "W000001", + "auth:AuthorisationStatus": { + "common:Owner": "ETSI", + "common:Name": "AuthorisationStatus", + "common:Value": "Invalid" + }, + "auth:AuthorisationTimespan": { + "auth:StartTime": "2015-09-01T12:00:00Z", + "auth:EndTime": "2015-12-01T12:00:00Z" + }, + "auth:AuthorisationInvalidReason": { + "ErrorCode": "3000", + "ErrorDescription": "The Authorisation is not associated with a valid Warrant Document Object" + } + } + } + }, + { + "ActionIdentifier": 0, + "GETResponse": { + "HI1Object": { + "@xsi:type": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject", + "ObjectIdentifier": "2b36a78b-b628-416d-bd22-404e68a0cd36", + "CountryCode": "XX", + "OwnerIdentifier": "ACTOR01", + "Generation": "1", + "AssociatedObjects": { + "AssociatedObject": [ + "7dbbc880-8750-4d3c-abe7-ea4a17646045" + ] + }, + "LastChanged": "2015-09-01T12:00:00Z", + "task:Reference": "LIID1", + "task:Status": { + "common:Owner": "ETSI", + "common:Name": "TaskStatus", + "common:Value": "Invalid" + }, + "task:TargetIdentifier": { + "task:TargetIdentifierValues": { + "task:TargetIdentifierValue": [ + { + "task:FormatType": { + "task:FormatOwner": "ETSI", + "task:FormatName": "InternationalE164" + }, + "task:Value": "442079460223" + } + ] + } + }, + "task:DeliveryType": { + "common:Owner": "ETSI", + "common:Name": "TaskDeliveryType", + "common:Value": "IRIandCC" + }, + "task:DeliveryDetails": { + "task:DeliveryDestination": [ + { + "task:DeliveryAddress": { + "task:IPv4Address": "192.0.2.0" + } + } + ] + }, + "task:CSPID": { + "CountryCode": "XX", + "UniqueIdentifier": "ACTOR02" + }, + "task:InvalidReason": { + "ErrorCode": "3000", + "ErrorDescription": "The associated Authorisation is in an Invalid state" + } + } + } + } + ] + } + } + } +} diff --git a/103120/examples/FooServiceSchema.xsd b/103120/examples/xml/FooServiceSchema.xsd similarity index 100% rename from 103120/examples/FooServiceSchema.xsd rename to 103120/examples/xml/FooServiceSchema.xsd diff --git a/103120/examples/example.key b/103120/examples/xml/example.key similarity index 100% rename from 103120/examples/example.key rename to 103120/examples/xml/example.key diff --git a/103120/examples/example.pem b/103120/examples/xml/example.pem similarity index 100% rename from 103120/examples/example.pem rename to 103120/examples/xml/example.pem diff --git a/103120/examples/mutliple-auth-example-request.xml b/103120/examples/xml/mutliple-auth-example-request.xml similarity index 100% rename from 103120/examples/mutliple-auth-example-request.xml rename to 103120/examples/xml/mutliple-auth-example-request.xml diff --git a/103120/examples/request1.xml b/103120/examples/xml/request1.xml similarity index 100% rename from 103120/examples/request1.xml rename to 103120/examples/xml/request1.xml diff --git a/103120/examples/request2.xml b/103120/examples/xml/request2.xml similarity index 100% rename from 103120/examples/request2.xml rename to 103120/examples/xml/request2.xml diff --git a/103120/examples/request3.xml b/103120/examples/xml/request3.xml similarity index 100% rename from 103120/examples/request3.xml rename to 103120/examples/xml/request3.xml diff --git a/103120/examples/request4.xml b/103120/examples/xml/request4.xml similarity index 100% rename from 103120/examples/request4.xml rename to 103120/examples/xml/request4.xml diff --git a/103120/examples/request5-Binary-Delivery.xml b/103120/examples/xml/request5-Binary-Delivery.xml similarity index 100% rename from 103120/examples/request5-Binary-Delivery.xml rename to 103120/examples/xml/request5-Binary-Delivery.xml diff --git a/103120/examples/request5-XML-Delivery.xml b/103120/examples/xml/request5-XML-Delivery.xml similarity index 100% rename from 103120/examples/request5-XML-Delivery.xml rename to 103120/examples/xml/request5-XML-Delivery.xml diff --git a/103120/examples/request6.xml b/103120/examples/xml/request6.xml similarity index 100% rename from 103120/examples/request6.xml rename to 103120/examples/xml/request6.xml diff --git a/103120/examples/request6_signed.xml b/103120/examples/xml/request6_signed.xml similarity index 100% rename from 103120/examples/request6_signed.xml rename to 103120/examples/xml/request6_signed.xml diff --git a/103120/examples/request7_TrafficPolicyObject.xml b/103120/examples/xml/request7_TrafficPolicyObject.xml similarity index 100% rename from 103120/examples/request7_TrafficPolicyObject.xml rename to 103120/examples/xml/request7_TrafficPolicyObject.xml diff --git a/103120/examples/response1.xml b/103120/examples/xml/response1.xml similarity index 100% rename from 103120/examples/response1.xml rename to 103120/examples/xml/response1.xml diff --git a/103120/examples/response2.xml b/103120/examples/xml/response2.xml similarity index 100% rename from 103120/examples/response2.xml rename to 103120/examples/xml/response2.xml diff --git a/103120/examples/response3.xml b/103120/examples/xml/response3.xml similarity index 100% rename from 103120/examples/response3.xml rename to 103120/examples/xml/response3.xml diff --git a/103120/examples/response4.xml b/103120/examples/xml/response4.xml similarity index 100% rename from 103120/examples/response4.xml rename to 103120/examples/xml/response4.xml diff --git a/103120/examples/response5.xml b/103120/examples/xml/response5.xml similarity index 100% rename from 103120/examples/response5.xml rename to 103120/examples/xml/response5.xml diff --git a/103120/examples/response6.xml b/103120/examples/xml/response6.xml similarity index 100% rename from 103120/examples/response6.xml rename to 103120/examples/xml/response6.xml diff --git a/103120/schema/json/TS_103_280.schema.json b/103120/schema/json/TS_103_280.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..02cd078e139e4896bad9cd8efcb2cfc7ae1a070a --- /dev/null +++ b/103120/schema/json/TS_103_280.schema.json @@ -0,0 +1,389 @@ +{ + "$id": "ts_103280_2017_07", + "$defs": { + "ShortString": { + "type": "string", + "maxLength": 255 + }, + "LongString": { + "type": "string", + "maxLength": 65535 + }, + "LIID": { + "type": "string", + "pattern": "^([!-~]{1,25})|([0-9a-f]{26,50})$" + }, + "UTCDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$" + }, + "UTCMicrosecondDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$" + }, + "QualifiedDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "QualifiedMicrosecondDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "InternationalE164": { + "type": "string", + "pattern": "^[0-9]{1,15}$" + }, + "IMSI": { + "type": "string", + "pattern": "^[0-9]{6,15}$" + }, + "IMEI": { + "type": "string", + "pattern": "^[0-9]{14}$" + }, + "IMEICheckDigit": { + "type": "string", + "pattern": "^[0-9]{15}$" + }, + "IMEISV": { + "type": "string", + "pattern": "^[0-9]{16}$" + }, + "IPv4Address": { + "type": "string", + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$" + }, + "IPv4CIDR": { + "type": "string", + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/([1-2]?[0-9]|3[0-2])$" + }, + "IPv6Address": { + "type": "string", + "pattern": "^([0-9a-f]{4}:){7}([0-9a-f]{4})$" + }, + "IPv6CIDR": { + "type": "string", + "pattern": "^([0-9a-f]{4}:){7}([0-9a-f]{4})/(([1-9][0-9]?)|(1[0-1][0-9])|(12[0-8]))$" + }, + "TCPPort": { + "type": "integer", + "exclusiveMinimum": 1, + "maximum": 65535 + }, + "UDPPort": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "MACAddress": { + "type": "string", + "pattern": "^([a-f0-9]{2}:){5}[a-f0-9]{2}$" + }, + "EmailAddress": { + "allOf": [ + { + "$ref": "#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^[a-zA-Z0-9\\.!#$%&'\\*\\+\\\\/=\\?\\^_`\\{\\|\\}~\\-]+@[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$" + } + ] + }, + "UUID": { + "type": "string", + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + }, + "ISOCountryCode": { + "type": "string", + "pattern": "^[A-Z]{2}$" + }, + "SIPURI": { + "type": "string", + "pattern": "^sips?:[a-zA-Z0-9!#$&-;=?-\\[\\]_~%]+$" + }, + "TELURI": { + "type": "string", + "pattern": "^tel:[a-zA-Z0-9!#$&-;=?-\\[\\]_~%]+$" + }, + "WGS84LatitudeDecimal": { + "type": "string", + "pattern": "^[NS][0-9]{2}\\.[0-9]{6}$" + }, + "WGS84LongitudeDecimal": { + "type": "string", + "pattern": "^[EW][0-9]{3}\\.[0-9]{6}$" + }, + "WGS84LatitudeAngular": { + "type": "string", + "pattern": "^[NS][0-9]{6}\\.[0-9]{2}$" + }, + "WGS84LongitudeAngular": { + "type": "string", + "pattern": "^[EW][0-9]{7}\\.[0-9]{2}$" + }, + "SUPIIMSI": { + "$ref": "#/$defs/IMSI" + }, + "SUPINAI": { + "$ref": "#/$defs/NAI" + }, + "SUCI": { + "type": "string", + "pattern": "^([a-fA-F0-9]{2})*$" + }, + "PEIIMEI": { + "$ref": "#/$defs/IMEI" + }, + "PEIIMEICheckDigit": { + "$ref": "#/$defs/IMEICheckDigit" + }, + "PEIIMEISV": { + "$ref": "#/$defs/IMEISV" + }, + "GPSIMSISDN": { + "type": "string", + "pattern": "^[0-9]{1,15}$" + }, + "GPSINAI": { + "$ref": "#/$defs/NAI" + }, + "NAI": { + "type": "string" + }, + "LDID": { + "type": "string", + "pattern": "^([A-Z]{2}-.+-.+)$" + }, + "InternationalizedEmailAddress": { + "allOf": [ + { + "$ref": "#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^.+@.+$" + } + ] + }, + "EUI64": { + "type": "string", + "pattern": "^([a-f0-9]{2}:){7}[a-f0-9]{2}$" + }, + "CGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{4}-[a-f0-9]{4}$" + }, + "ECGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{7}$" + }, + "NCGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{9}$" + }, + "ICCID": { + "type": "string", + "pattern": "^[0-9]{19,20}$" + }, + "IPProtocol": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "IPAddress": { + "oneOf": [ + { + "type": "object", + "properties": { + "etsi280:IPv4Address": { + "$ref": "#/$defs/IPv4Address" + } + }, + "required": [ + "etsi280:IPv4Address" + ] + }, + { + "type": "object", + "properties": { + "etsi280:IPv6Address": { + "$ref": "#/$defs/IPv6Address" + } + }, + "required": [ + "etsi280:IPv6Address" + ] + } + ] + }, + "IPCIDR": { + "oneOf": [ + { + "type": "object", + "properties": { + "etsi280:IPv4CIDR": { + "$ref": "#/$defs/IPv4CIDR" + } + }, + "required": [ + "etsi280:IPv4CIDR" + ] + }, + { + "type": "object", + "properties": { + "etsi280:IPv6CIDR": { + "$ref": "#/$defs/IPv6CIDR" + } + }, + "required": [ + "etsi280:IPv6CIDR" + ] + } + ] + }, + "TCPPortRange": { + "type": "object", + "properties": { + "etsi280:start": { + "$ref": "#/$defs/TCPPort" + }, + "etsi280:end": { + "$ref": "#/$defs/TCPPort" + } + }, + "required": [ + "etsi280:start", + "etsi280:end" + ] + }, + "UDPPortRange": { + "type": "object", + "properties": { + "etsi280:start": { + "$ref": "#/$defs/UDPPort" + }, + "etsi280:end": { + "$ref": "#/$defs/UDPPort" + } + }, + "required": [ + "etsi280:start", + "etsi280:end" + ] + }, + "Port": { + "oneOf": [ + { + "type": "object", + "properties": { + "etsi280:TCPPort": { + "$ref": "#/$defs/TCPPort" + } + }, + "required": [ + "etsi280:TCPPort" + ] + }, + { + "type": "object", + "properties": { + "etsi280:UDPPort": { + "$ref": "#/$defs/UDPPort" + } + }, + "required": [ + "etsi280:UDPPort" + ] + } + ] + }, + "PortRange": { + "oneOf": [ + { + "type": "object", + "properties": { + "etsi280:TCPPortRange": { + "$ref": "#/$defs/TCPPortRange" + } + }, + "required": [ + "etsi280:TCPPortRange" + ] + }, + { + "type": "object", + "properties": { + "etsi280:UDPPortRange": { + "$ref": "#/$defs/UDPPortRange" + } + }, + "required": [ + "etsi280:UDPPortRange" + ] + } + ] + }, + "IPAddressPort": { + "type": "object", + "properties": { + "etsi280:address": { + "$ref": "#/$defs/IPAddress" + }, + "etsi280:port": { + "$ref": "#/$defs/Port" + } + }, + "required": [ + "etsi280:address", + "etsi280:port" + ] + }, + "IPAddressPortRange": { + "type": "object", + "properties": { + "etsi280:address": { + "$ref": "#/$defs/IPAddress" + }, + "etsi280:portRange": { + "$ref": "#/$defs/PortRange" + } + }, + "required": [ + "etsi280:address", + "etsi280:portRange" + ] + }, + "WGS84CoordinateDecimal": { + "type": "object", + "properties": { + "etsi280:latitude": { + "$ref": "#/$defs/WGS84LatitudeDecimal" + }, + "etsi280:longitude": { + "$ref": "#/$defs/WGS84LongitudeDecimal" + } + }, + "required": [ + "etsi280:latitude", + "etsi280:longitude" + ] + }, + "WGS84CoordinateAngular": { + "type": "object", + "properties": { + "etsi280:latitude": { + "$ref": "#/$defs/WGS84LatitudeAngular" + }, + "etsi280:longitude": { + "$ref": "#/$defs/WGS84LongitudeAngular" + } + }, + "required": [ + "etsi280:latitude", + "etsi280:longitude" + ] + } + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Authorisation.schema.json b/103120/schema/json/ts_103120_Authorisation.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..1c9a68ff3b802d056ed59f805808d31b2fed2c8e --- /dev/null +++ b/103120/schema/json/ts_103120_Authorisation.schema.json @@ -0,0 +1,148 @@ +{ + "$id": "ts_103120_Authorisation_2020_09", + "$defs": { + "AuthorisationObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Authorisation}AuthorisationObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "auth:AuthorisationReference": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "auth:AuthorisationLegalType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "auth:AuthorisationPriority": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "auth:AuthorisationStatus": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "auth:AuthorisationDesiredStatus": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "auth:AuthorisationTimespan": { + "$ref": "#/$defs/AuthorisationTimespan" + }, + "auth:AuthorisationCSPID": { + "$ref": "#/$defs/AuthorisationCSPID" + }, + "auth:AuthorisationCreationTimestamp": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "auth:AuthorisationServedTimestamp": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "auth:AuthorisationTerminationTimestamp": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "auth:AuthorisationApprovalDetails": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/ApprovalDetails" + } + }, + "auth:AuthorisationInvalidReason": { + "$ref": "ts_103120_Core_2019_10#/$defs/ActionUnsuccesfulInformation" + }, + "auth:AuthorisationFlags": { + "$ref": "#/$defs/AuthorisationFlags" + }, + "auth:AuthorisationManualInformation": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "auth:NationalAuthorisationParameters": { + "$ref": "#/$defs/NationalAuthorisationParameters" + }, + "auth:AuthorisationJurisdiction": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "auth:AuthorisationTypeOfCase": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "auth:AuthorisationLegalEntity": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "AuthorisationFlags": { + "type": "object", + "properties": { + "auth:AuthorisationFlag": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "AuthorisationTimespan": { + "type": "object", + "properties": { + "auth:StartTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "auth:EndTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "AuthorisationCSPID": { + "type": "object", + "properties": { + "auth:CSPID": { + "type": "array", + "items": { + "$ref": "ts_103120_Core_2019_10#/$defs/EndpointID" + }, + "minItems": 1 + } + }, + "required": [] + }, + "NationalAuthorisationParameters": { + "type": "object", + "properties": { + "auth:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "auth:CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Common.schema.json b/103120/schema/json/ts_103120_Common.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..d11b4b4c22cbcf9a3c76619adf6a66da64e1ba8b --- /dev/null +++ b/103120/schema/json/ts_103120_Common.schema.json @@ -0,0 +1,164 @@ +{ + "$id": "ts_103120_Common_2016_02", + "$defs": { + "ETSIVersion": { + "allOf": [ + { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^V\\d+\\.\\d+\\.\\d+$" + } + ] + }, + "DictionaryEntry": { + "type": "object", + "properties": { + "common:Owner": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "common:Name": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "common:Value": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [ + "common:Owner", + "common:Name", + "common:Value" + ] + }, + "ApprovalDetails": { + "type": "object", + "properties": { + "common:ApprovalType": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "common:ApprovalDescription": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "common:ApprovalReference": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "common:ApproverDetails": { + "$ref": "#/$defs/ApproverDetails" + }, + "common:ApprovalTimestamp": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "common:ApprovalIsEmergency": { + "type": "boolean" + }, + "common:ApprovalDigitalSignature": { + "$ref": "#/$defs/ApprovalDigitalSignature" + }, + "common:ApprovalNationalDetails": { + "$ref": "#/$defs/ApprovalNationalDetails" + } + }, + "required": [] + }, + "ApproverDetails": { + "type": "object", + "properties": { + "common:ApproverName": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "common:ApproverRole": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "common:ApproverIdentity": { + "$ref": "#/$defs/ApproverIdentity" + }, + "common:ApproverContactDetails": { + "type": "array", + "items": { + "$ref": "#/$defs/ApproverContactDetails" + } + } + }, + "required": [] + }, + "ApproverIdentity": { + "oneOf": [ + { + "type": "object", + "properties": { + "common:NationalApproverIdentity": { + "$ref": "#/$defs/NationalApproverIdentity" + } + }, + "required": [ + "common:NationalApproverIdentity" + ] + } + ] + }, + "ApproverContactDetails": { + "type": "object", + "properties": { + "common:ApproverAlternateName": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "common:ApproverEmailAddress": { + "$ref": "ts_103280_2017_07#/$defs/InternationalizedEmailAddress" + }, + "common:ApproverPhoneNumber": { + "$ref": "ts_103280_2017_07#/$defs/InternationalE164" + } + }, + "required": [] + }, + "NationalApproverIdentity": { + "type": "object", + "properties": { + "common:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "common:CountryCode" + ] + }, + "ApprovalDigitalSignature": { + "oneOf": [ + { + "type": "object", + "properties": { + "common:NationalDigitalSignature": { + "$ref": "#/$defs/NationalDigitalSignature" + } + }, + "required": [ + "common:NationalDigitalSignature" + ] + } + ] + }, + "ApprovalNationalDetails": { + "type": "object", + "properties": { + "common:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "common:CountryCode" + ] + }, + "NationalDigitalSignature": { + "type": "object", + "properties": { + "common:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "common:CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Core.schema.json b/103120/schema/json/ts_103120_Core.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..f116d3150785b595ca9824a28421b730a2e4c6a9 --- /dev/null +++ b/103120/schema/json/ts_103120_Core.schema.json @@ -0,0 +1,590 @@ +{ + "$id": "ts_103120_Core_2019_10", + "$defs": { + "ObjectIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/UUID" + }, + "HI1Message": { + "type": "object", + "properties": { + "Header": { + "$ref": "#/$defs/MessageHeader" + }, + "Payload": { + "$ref": "#/$defs/MessagePayload" + }, + "Signature": {}, + "xmldsig:Signature": { + "$ref": "www.w3.org_2000_09_xmldsig##/$defs/SignatureType" + } + }, + "required": [ + "Header", + "Payload" + ] + }, + "MessageHeader": { + "type": "object", + "properties": { + "SenderIdentifier": { + "$ref": "#/$defs/EndpointID" + }, + "ReceiverIdentifier": { + "$ref": "#/$defs/EndpointID" + }, + "TransactionIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/UUID" + }, + "Timestamp": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedMicrosecondDateTime" + }, + "Version": { + "$ref": "#/$defs/Version" + } + }, + "required": [ + "SenderIdentifier", + "ReceiverIdentifier", + "TransactionIdentifier", + "Timestamp", + "Version" + ] + }, + "Version": { + "type": "object", + "properties": { + "ETSIVersion": { + "$ref": "ts_103120_Common_2016_02#/$defs/ETSIVersion" + }, + "NationalProfileOwner": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "NationalProfileVersion": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [ + "ETSIVersion", + "NationalProfileOwner", + "NationalProfileVersion" + ] + }, + "EndpointID": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "UniqueIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "CountryCode", + "UniqueIdentifier" + ] + }, + "MessagePayload": { + "oneOf": [ + { + "type": "object", + "properties": { + "RequestPayload": { + "$ref": "#/$defs/RequestPayload" + } + }, + "required": [ + "RequestPayload" + ] + }, + { + "type": "object", + "properties": { + "ResponsePayload": { + "$ref": "#/$defs/ResponsePayload" + } + }, + "required": [ + "ResponsePayload" + ] + } + ] + }, + "RequestPayload": { + "type": "object", + "properties": { + "ActionRequests": { + "$ref": "#/$defs/ActionRequests" + } + }, + "required": [ + "ActionRequests" + ] + }, + "ActionRequests": { + "type": "object", + "properties": { + "ActionRequest": { + "type": "array", + "items": { + "$ref": "#/$defs/ActionRequest" + }, + "minItems": 1 + } + }, + "required": [] + }, + "ResponsePayload": { + "oneOf": [ + { + "type": "object", + "properties": { + "ActionResponses": { + "$ref": "#/$defs/ActionResponses" + } + }, + "required": [ + "ActionResponses" + ] + }, + { + "type": "object", + "properties": { + "ErrorInformation": { + "$ref": "#/$defs/ActionUnsuccesfulInformation" + } + }, + "required": [ + "ErrorInformation" + ] + } + ] + }, + "ActionResponses": { + "type": "object", + "properties": { + "ActionResponse": { + "type": "array", + "items": { + "$ref": "#/$defs/ActionResponse" + }, + "minItems": 1 + } + }, + "required": [] + }, + "ActionRequest": { + "allOf": [ + { + "type": "object", + "properties": { + "ActionIdentifier": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "ActionIdentifier" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "GET": { + "$ref": "#/$defs/GETRequest" + } + }, + "required": [ + "GET" + ] + }, + { + "type": "object", + "properties": { + "CREATE": { + "$ref": "#/$defs/CREATERequest" + } + }, + "required": [ + "CREATE" + ] + }, + { + "type": "object", + "properties": { + "UPDATE": { + "$ref": "#/$defs/UPDATERequest" + } + }, + "required": [ + "UPDATE" + ] + }, + { + "type": "object", + "properties": { + "LIST": { + "$ref": "#/$defs/LISTRequest" + } + }, + "required": [ + "LIST" + ] + }, + { + "type": "object", + "properties": { + "DELIVER": { + "$ref": "#/$defs/DELIVERRequest" + } + }, + "required": [ + "DELIVER" + ] + } + ] + } + ] + }, + "ActionResponse": { + "allOf": [ + { + "type": "object", + "properties": { + "ActionIdentifier": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "ActionIdentifier" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "GETResponse": { + "$ref": "#/$defs/GETResponse" + } + }, + "required": [ + "GETResponse" + ] + }, + { + "type": "object", + "properties": { + "CREATEResponse": { + "$ref": "#/$defs/CREATEResponse" + } + }, + "required": [ + "CREATEResponse" + ] + }, + { + "type": "object", + "properties": { + "UPDATEResponse": { + "$ref": "#/$defs/UPDATEResponse" + } + }, + "required": [ + "UPDATEResponse" + ] + }, + { + "type": "object", + "properties": { + "LISTResponse": { + "$ref": "#/$defs/LISTResponse" + } + }, + "required": [ + "LISTResponse" + ] + }, + { + "type": "object", + "properties": { + "ErrorInformation": { + "$ref": "#/$defs/ActionUnsuccesfulInformation" + } + }, + "required": [ + "ErrorInformation" + ] + }, + { + "type": "object", + "properties": { + "DELIVERResponse": { + "$ref": "#/$defs/DELIVERResponse" + } + }, + "required": [ + "DELIVERResponse" + ] + } + ] + } + ] + }, + "GETRequest": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + } + }, + "required": [ + "Identifier" + ] + }, + "GETResponse": { + "type": "object", + "properties": { + "HI1Object": { + "$ref": "#/$defs/ConcreteHI1Object" + } + }, + "required": [ + "HI1Object" + ] + }, + "CREATERequest": { + "type": "object", + "properties": { + "HI1Object": { + "$ref": "#/$defs/ConcreteHI1Object" + } + }, + "required": [ + "HI1Object" + ] + }, + "CREATEResponse": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "HI1Object": { + "$ref": "#/$defs/ConcreteHI1Object" + } + }, + "required": [ + "Identifier" + ] + }, + "UPDATERequest": { + "type": "object", + "properties": { + "HI1Object": { + "$ref": "#/$defs/ConcreteHI1Object" + } + }, + "required": [ + "HI1Object" + ] + }, + "UPDATEResponse": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "HI1Object": { + "$ref": "#/$defs/ConcreteHI1Object" + } + }, + "required": [ + "Identifier" + ] + }, + "LISTRequest": { + "type": "object", + "properties": { + "ObjectType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "LISTResponse": { + "type": "object", + "properties": { + "ListResponseRecord": { + "type": "array", + "items": { + "$ref": "#/$defs/ListResponseRecord" + } + } + }, + "required": [] + }, + "ListResponseRecord": { + "type": "object", + "properties": { + "ObjectType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + } + }, + "required": [ + "ObjectType", + "Identifier", + "Generation" + ] + }, + "ActionUnsuccesfulInformation": { + "type": "object", + "properties": { + "ErrorCode": { + "type": "integer", + "minimum": 0 + }, + "ErrorDescription": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "ErrorCode", + "ErrorDescription" + ] + }, + "DELIVERRequest": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "HI1Object": { + "$ref": "#/$defs/ConcreteHI1Object" + } + }, + "required": [ + "Identifier", + "HI1Object" + ] + }, + "DELIVERResponse": { + "type": "object", + "properties": { + "Identifier": { + "$ref": "#/$defs/ObjectIdentifier" + } + }, + "required": [ + "Identifier" + ] + }, + "HI1Object": { + "type": "object", + "properties": { + "ObjectIdentifier": { + "$ref": "#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "#/$defs/NationalHandlingParameters" + } + }, + "required": [ + "ObjectIdentifier" + ] + }, + "AssociatedObjects": { + "type": "object", + "properties": { + "AssociatedObject": { + "type": "array", + "items": { + "$ref": "#/$defs/ObjectIdentifier" + } + } + }, + "required": [] + }, + "NationalHandlingParameters": { + "type": "object", + "properties": { + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "CountryCode" + ] + }, + "ConcreteHI1Object": { + "oneOf": [ + { + "$ref": "ts_103120_Authorisation_2020_09#/$defs/AuthorisationObject" + }, + { + "$ref": "ts_103120_Task_2020_09#/$defs/LITaskObject" + }, + { + "$ref": "ts_103120_Task_2020_09#/$defs/LDTaskObject" + }, + { + "$ref": "ts_103120_Document_2020_09#/$defs/DocumentObject" + }, + { + "$ref": "ts_103120_Notification_2016_02#/$defs/NotificationObject" + }, + { + "$ref": "ts_103120_Delivery_2019_10#/$defs/DeliveryObject" + }, + { + "$ref": "ts_103120_TrafficPolicy_2022_07#/$defs/TrafficPolicyObject" + } + ] + } + }, + "$ref": "#/$defs/HI1Message" +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Delivery.schema.json b/103120/schema/json/ts_103120_Delivery.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..9cfceae20965e9c5d0ac791a5937215f051be458 --- /dev/null +++ b/103120/schema/json/ts_103120_Delivery.schema.json @@ -0,0 +1,209 @@ +{ + "$id": "ts_103120_Delivery_2019_10", + "$defs": { + "DeliveryObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2019/10/Delivery}DeliveryObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "delivery:Reference": { + "$ref": "#/$defs/Reference" + }, + "delivery:DeliveryID": { + "$ref": "ts_103280_2017_07#/$defs/UUID" + }, + "delivery:SequenceNumber": { + "type": "integer", + "minimum": 0 + }, + "delivery:LastSequence": { + "type": "boolean" + }, + "delivery:Manifest": { + "$ref": "#/$defs/Manifest" + }, + "delivery:Delivery": { + "$ref": "#/$defs/Delivery" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "Reference": { + "oneOf": [ + { + "type": "object", + "properties": { + "delivery:LDID": { + "$ref": "ts_103280_2017_07#/$defs/LDID" + } + }, + "required": [ + "delivery:LDID" + ] + }, + { + "type": "object", + "properties": { + "delivery:LIID": { + "$ref": "ts_103280_2017_07#/$defs/LIID" + } + }, + "required": [ + "delivery:LIID" + ] + } + ] + }, + "Manifest": { + "oneOf": [ + { + "type": "object", + "properties": { + "delivery:Specification": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + } + }, + "required": [ + "delivery:Specification" + ] + }, + { + "type": "object", + "properties": { + "delivery:ExternalSchema": { + "$ref": "#/$defs/ExternalSchema" + } + }, + "required": [ + "delivery:ExternalSchema" + ] + } + ] + }, + "ExternalSchema": { + "type": "object", + "properties": { + "delivery:ManifestID": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "delivery:ManifestContents": { + "$ref": "#/$defs/ManifestContents" + } + }, + "required": [] + }, + "ManifestContents": { + "oneOf": [ + { + "type": "object", + "properties": { + "delivery:BinaryData": { + "$ref": "#/$defs/EmbeddedBinaryData" + } + }, + "required": [ + "delivery:BinaryData" + ] + }, + { + "type": "object", + "properties": { + "delivery:XMLSchema": { + "$ref": "#/$defs/SchemaContent" + } + }, + "required": [ + "delivery:XMLSchema" + ] + } + ] + }, + "SchemaContent": { + "type": "object", + "properties": { + "delivery:schema": {} + }, + "required": [ + "delivery:schema" + ] + }, + "Delivery": { + "oneOf": [ + { + "type": "object", + "properties": { + "delivery:BinaryData": { + "$ref": "#/$defs/EmbeddedBinaryData" + } + }, + "required": [ + "delivery:BinaryData" + ] + }, + { + "type": "object", + "properties": { + "delivery:XMLData": { + "$ref": "#/$defs/EmbeddedXMLData" + } + }, + "required": [ + "delivery:XMLData" + ] + } + ] + }, + "EmbeddedBinaryData": { + "type": "object", + "properties": { + "delivery:Data": { + "type": "string", + "pattern": "^[-A-Za-z0-9+/]*={0,3}$" + }, + "delivery:ContentType": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "delivery:Checksum": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "delivery:ChecksumType": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [ + "delivery:Data" + ] + }, + "EmbeddedXMLData": {} + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Document.schema.json b/103120/schema/json/ts_103120_Document.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..afeb421d2979523b7edd2f78e7682496ded5ccc0 --- /dev/null +++ b/103120/schema/json/ts_103120_Document.schema.json @@ -0,0 +1,148 @@ +{ + "$id": "ts_103120_Document_2020_09", + "$defs": { + "DocumentObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Document}DocumentObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "doc:DocumentReference": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "doc:DocumentName": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "doc:DocumentStatus": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "doc:DocumentDesiredStatus": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "doc:DocumentTimespan": { + "$ref": "#/$defs/DocumentTimespan" + }, + "doc:DocumentType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "doc:DocumentProperties": { + "$ref": "#/$defs/DocumentProperties" + }, + "doc:DocumentBody": { + "$ref": "#/$defs/DocumentBody" + }, + "doc:DocumentSignature": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/ApprovalDetails" + } + }, + "doc:DocumentInvalidReason": { + "$ref": "ts_103120_Core_2019_10#/$defs/ActionUnsuccesfulInformation" + }, + "doc:NationalDocumentParameters": { + "$ref": "#/$defs/NationalDocumentParameters" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "DocumentTimespan": { + "type": "object", + "properties": { + "doc:StartTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "doc:EndTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "DocumentProperties": { + "type": "object", + "properties": { + "doc:DocumentProperty": { + "type": "array", + "items": { + "$ref": "#/$defs/DocumentProperty" + } + } + }, + "required": [] + }, + "DocumentProperty": { + "type": "object", + "properties": { + "doc:PropertyType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "doc:PropertyValue": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "doc:PropertyType", + "doc:PropertyValue" + ] + }, + "DocumentBody": { + "type": "object", + "properties": { + "doc:Contents": { + "type": "string", + "pattern": "^[-A-Za-z0-9+/]*={0,3}$" + }, + "doc:ContentType": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "doc:Checksum": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "doc:ChecksumType": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [] + }, + "NationalDocumentParameters": { + "type": "object", + "properties": { + "doc:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "doc:CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Notification.schema.json b/103120/schema/json/ts_103120_Notification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..84fbf046ca455b5e49221c0c268d2d6c345d0cd2 --- /dev/null +++ b/103120/schema/json/ts_103120_Notification.schema.json @@ -0,0 +1,103 @@ +{ + "$id": "ts_103120_Notification_2016_02", + "$defs": { + "NotificationObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2016/02/Notification}NotificationObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "notification:NotificationDetails": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "notification:NotificationType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "notification:NewNotification": { + "type": "boolean" + }, + "notification:NotificationTimestamp": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "notification:StatusOfAssociatedObjects": { + "$ref": "#/$defs/ListOfAssociatedObjectStatus" + }, + "notification:NationalNotificationParameters": { + "$ref": "#/$defs/NationalNotificationParameters" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "ListOfAssociatedObjectStatus": { + "type": "object", + "properties": { + "notification:AssociatedObjectStatus": { + "type": "array", + "items": { + "$ref": "#/$defs/AssociatedObjectStatus" + }, + "minItems": 1 + } + }, + "required": [] + }, + "AssociatedObjectStatus": { + "type": "object", + "properties": { + "notification:AssociatedObject": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "notification:Status": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "notification:Details": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "notification:AssociatedObject", + "notification:Status" + ] + }, + "NationalNotificationParameters": { + "type": "object", + "properties": { + "notification:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "notification:CountryCode" + ] + } + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_Task.schema.json b/103120/schema/json/ts_103120_Task.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..24de4c578243b63aaebc0d85942b606b840cbf46 --- /dev/null +++ b/103120/schema/json/ts_103120_Task.schema.json @@ -0,0 +1,599 @@ +{ + "$id": "ts_103120_Task_2020_09", + "$defs": { + "LITaskObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LITaskObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "task:Reference": { + "$ref": "ts_103280_2017_07#/$defs/LIID" + }, + "task:Status": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:DesiredStatus": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:Timespan": { + "$ref": "#/$defs/TaskTimespan" + }, + "task:TargetIdentifier": { + "$ref": "#/$defs/TargetIdentifier" + }, + "task:DeliveryType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:DeliveryDetails": { + "$ref": "#/$defs/TaskDeliveryDetails" + }, + "task:ApprovalDetails": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/ApprovalDetails" + } + }, + "task:CSPID": { + "$ref": "ts_103120_Core_2019_10#/$defs/EndpointID" + }, + "task:HandlingProfile": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:InvalidReason": { + "$ref": "ts_103120_Core_2019_10#/$defs/ActionUnsuccesfulInformation" + }, + "task:Flags": { + "$ref": "#/$defs/TaskFlags" + }, + "task:NationalLITaskingParameters": { + "$ref": "#/$defs/NationalLITaskingParameters" + }, + "task:ListOfTrafficPolicyReferences": { + "$ref": "#/$defs/ListOfTrafficPolicyReferences" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "TaskTimespan": { + "type": "object", + "properties": { + "task:StartTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:EndTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:TerminationTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:ProvisioningTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:DeprovisioningTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + } + }, + "required": [] + }, + "TargetIdentifier": { + "type": "object", + "properties": { + "task:TargetIdentifierValues": { + "$ref": "#/$defs/TargetIdentifierValues" + }, + "task:ServiceType": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + } + }, + "required": [] + }, + "TargetIdentifierValues": { + "type": "object", + "properties": { + "task:TargetIdentifierValue": { + "type": "array", + "items": { + "$ref": "#/$defs/TargetIdentifierValue" + }, + "minItems": 1 + } + }, + "required": [] + }, + "TargetIdentifierValue": { + "type": "object", + "properties": { + "task:FormatType": { + "$ref": "#/$defs/FormatType" + }, + "task:Value": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "task:FormatType", + "task:Value" + ] + }, + "FormatType": { + "type": "object", + "properties": { + "task:FormatOwner": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "task:FormatName": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [ + "task:FormatOwner", + "task:FormatName" + ] + }, + "TaskDeliveryDetails": { + "type": "object", + "properties": { + "task:DeliveryDestination": { + "type": "array", + "items": { + "$ref": "#/$defs/DeliveryDestination" + }, + "minItems": 1 + } + }, + "required": [] + }, + "DeliveryDestination": { + "type": "object", + "properties": { + "task:DeliveryAddress": { + "$ref": "#/$defs/DeliveryAddress" + }, + "task:EncryptionDetails": { + "$ref": "#/$defs/NationalEncryptionDetails" + }, + "task:IRIorCC": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:HandoverFormat": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:DeliveryProfile": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:NationalDeliveryParameters": { + "$ref": "#/$defs/NationalDeliveryParameters" + } + }, + "required": [] + }, + "DeliveryAddress": { + "oneOf": [ + { + "type": "object", + "properties": { + "task:IPv4Address": { + "$ref": "ts_103280_2017_07#/$defs/IPv4Address" + } + }, + "required": [ + "task:IPv4Address" + ] + }, + { + "type": "object", + "properties": { + "task:IPv6Address": { + "$ref": "ts_103280_2017_07#/$defs/IPv6Address" + } + }, + "required": [ + "task:IPv6Address" + ] + }, + { + "type": "object", + "properties": { + "task:IPAddressPort": { + "$ref": "ts_103280_2017_07#/$defs/IPAddressPort" + } + }, + "required": [ + "task:IPAddressPort" + ] + }, + { + "type": "object", + "properties": { + "task:IPAddressPortRange": { + "$ref": "ts_103280_2017_07#/$defs/IPAddressPortRange" + } + }, + "required": [ + "task:IPAddressPortRange" + ] + }, + { + "type": "object", + "properties": { + "task:E164Number": { + "$ref": "ts_103280_2017_07#/$defs/InternationalE164" + } + }, + "required": [ + "task:E164Number" + ] + }, + { + "type": "object", + "properties": { + "task:FTPAddress": { + "type": "string" + } + }, + "required": [ + "task:FTPAddress" + ] + }, + { + "type": "object", + "properties": { + "task:URL": { + "type": "string" + } + }, + "required": [ + "task:URL" + ] + }, + { + "type": "object", + "properties": { + "task:FQDN": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "task:FQDN" + ] + }, + { + "type": "object", + "properties": { + "task:EmailAddress": { + "$ref": "ts_103280_2017_07#/$defs/EmailAddress" + } + }, + "required": [ + "task:EmailAddress" + ] + }, + { + "type": "object", + "properties": { + "task:EndpointID": { + "$ref": "ts_103120_Core_2019_10#/$defs/EndpointID" + } + }, + "required": [ + "task:EndpointID" + ] + }, + { + "type": "object", + "properties": { + "task:DeliveryInformationID": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "task:DeliveryInformationID" + ] + } + ] + }, + "TaskFlags": { + "type": "object", + "properties": { + "task:TaskFlag": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "NationalLITaskingParameters": { + "type": "object", + "properties": { + "task:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "task:CountryCode" + ] + }, + "NationalDeliveryParameters": { + "type": "object", + "properties": { + "task:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "task:CountryCode" + ] + }, + "NationalEncryptionDetails": { + "type": "object", + "properties": { + "task:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "task:CountryCode" + ] + }, + "LDTaskObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2020/09/Task}LDTaskObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "task:Reference": { + "$ref": "ts_103280_2017_07#/$defs/LDID" + }, + "task:Status": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:StatusReason": { + "$ref": "ts_103120_Core_2019_10#/$defs/ActionUnsuccesfulInformation" + }, + "task:DesiredStatus": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:RequestDetails": { + "$ref": "#/$defs/RequestDetails" + }, + "task:DeliveryDetails": { + "$ref": "#/$defs/LDDeliveryDetails" + }, + "task:ApprovalDetails": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/ApprovalDetails" + } + }, + "task:CSPID": { + "$ref": "ts_103120_Core_2019_10#/$defs/EndpointID" + }, + "task:HandlingProfile": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:Flags": { + "$ref": "#/$defs/LDTaskFlags" + }, + "task:NationalLDTaskingParameters": { + "$ref": "#/$defs/NationalLDTaskingParameters" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "RequestDetails": { + "type": "object", + "properties": { + "task:Type": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:StartTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:EndTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:ObservedTime": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "task:ObservedTimes": { + "type": "array", + "items": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + } + }, + "task:RequestValues": { + "$ref": "#/$defs/RequestValues" + }, + "task:Subtype": { + "$ref": "#/$defs/RequestSubtype" + } + }, + "required": [] + }, + "RequestValues": { + "type": "object", + "properties": { + "task:RequestValue": { + "type": "array", + "items": { + "$ref": "#/$defs/RequestValue" + }, + "minItems": 1 + } + }, + "required": [] + }, + "RequestValue": { + "type": "object", + "properties": { + "task:FormatType": { + "$ref": "#/$defs/FormatType" + }, + "task:Value": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + } + }, + "required": [ + "task:FormatType", + "task:Value" + ] + }, + "RequestSubtype": { + "type": "object", + "properties": { + "task:RequestSubtype": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "minItems": 1 + } + }, + "required": [] + }, + "LDDeliveryDetails": { + "type": "object", + "properties": { + "task:LDDeliveryDestination": { + "type": "array", + "items": { + "$ref": "#/$defs/LDDeliveryDestination" + }, + "minItems": 1 + } + }, + "required": [] + }, + "LDDeliveryDestination": { + "type": "object", + "properties": { + "task:DeliveryAddress": { + "$ref": "#/$defs/DeliveryAddress" + }, + "task:EncryptionDetails": { + "$ref": "#/$defs/NationalEncryptionDetails" + }, + "task:LDHandoverFormat": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:LDDeliveryProfile": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + }, + "task:NationalDeliveryParameters": { + "$ref": "#/$defs/NationalDeliveryParameters" + } + }, + "required": [] + }, + "LDTaskFlags": { + "type": "object", + "properties": { + "task:LDTaskFlag": { + "type": "array", + "items": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + } + } + }, + "required": [] + }, + "NationalLDTaskingParameters": { + "type": "object", + "properties": { + "task:CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + } + }, + "required": [ + "task:CountryCode" + ] + }, + "ListOfTrafficPolicyReferences": { + "type": "object", + "properties": { + "task:TrafficPolicyReference": { + "type": "array", + "items": { + "$ref": "#/$defs/TrafficPolicyReference" + }, + "minItems": 1 + } + }, + "required": [] + }, + "TrafficPolicyReference": { + "type": "object", + "properties": { + "task:Order": { + "type": "integer", + "minimum": 1 + }, + "task:ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + } + }, + "required": [] + } + } +} \ No newline at end of file diff --git a/103120/schema/json/ts_103120_TrafficPolicy.schema.json b/103120/schema/json/ts_103120_TrafficPolicy.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..1d9619e456ebd108829819edb66a613155ef640a --- /dev/null +++ b/103120/schema/json/ts_103120_TrafficPolicy.schema.json @@ -0,0 +1,198 @@ +{ + "$id": "ts_103120_TrafficPolicy_2022_07", + "$defs": { + "TrafficPolicyObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2022/07/TrafficPolicy}TrafficPolicyObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "tp:TrafficPolicyName": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "tp:TrafficRules": { + "$ref": "#/$defs/ListOfTrafficRuleReferences" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "ListOfTrafficRuleReferences": { + "type": "object", + "properties": { + "tp:TrafficRuleReference": { + "type": "array", + "items": { + "$ref": "#/$defs/TrafficRuleReference" + }, + "minItems": 1 + } + }, + "required": [] + }, + "TrafficRuleReference": { + "type": "object", + "properties": { + "tp:Order": { + "type": "integer", + "minimum": 1 + }, + "tp:ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + } + }, + "required": [ + "tp:Order", + "tp:ObjectIdentifier" + ] + }, + "TrafficRuleObject": { + "type": "object", + "properties": { + "@xsi:type": { + "type": "string", + "enum": "{http://uri.etsi.org/03120/common/2022/07/TrafficPolicy}TrafficRuleObject" + }, + "ObjectIdentifier": { + "$ref": "ts_103120_Core_2019_10#/$defs/ObjectIdentifier" + }, + "CountryCode": { + "$ref": "ts_103280_2017_07#/$defs/ISOCountryCode" + }, + "OwnerIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "Generation": { + "type": "integer", + "minimum": 0 + }, + "ExternalIdentifier": { + "$ref": "ts_103280_2017_07#/$defs/LongString" + }, + "AssociatedObjects": { + "$ref": "ts_103120_Core_2019_10#/$defs/AssociatedObjects" + }, + "LastChanged": { + "$ref": "ts_103280_2017_07#/$defs/QualifiedDateTime" + }, + "NationalHandlingParameters": { + "$ref": "ts_103120_Core_2019_10#/$defs/NationalHandlingParameters" + }, + "tp:Criteria": { + "$ref": "#/$defs/ListOfTrafficCriteria" + }, + "tp:Action": { + "$ref": "ts_103120_Common_2016_02#/$defs/DictionaryEntry" + } + }, + "required": [ + "@xsi:type", + "ObjectIdentifier" + ] + }, + "ListOfTrafficCriteria": { + "type": "object", + "properties": { + "tp:Criteria": { + "type": "array", + "items": { + "$ref": "#/$defs/TrafficCriteria" + }, + "minItems": 1 + } + }, + "required": [] + }, + "TrafficCriteria": { + "oneOf": [ + { + "type": "object", + "properties": { + "tp:IPPolicyCriteria": { + "$ref": "#/$defs/IPPolicyCriteria" + } + }, + "required": [ + "tp:IPPolicyCriteria" + ] + }, + { + "type": "object", + "properties": { + "tp:MobileAccessPolicyCriteria": { + "$ref": "#/$defs/MobileAccessPolicyCriteria" + } + }, + "required": [ + "tp:MobileAccessPolicyCriteria" + ] + } + ] + }, + "IPPolicyCriteria": { + "type": "object", + "properties": { + "tp:IPProtocol": { + "type": "integer", + "minimum": 0 + }, + "tp:SourceIPRange": { + "$ref": "ts_103280_2017_07#/$defs/IPCIDR" + }, + "tp:SourcePortRange": { + "$ref": "ts_103280_2017_07#/$defs/PortRange" + }, + "tp:DestinationIPRange": { + "$ref": "ts_103280_2017_07#/$defs/IPCIDR" + }, + "tp:DestinationPortRange": { + "$ref": "ts_103280_2017_07#/$defs/PortRange" + }, + "tp:BothDirections": { + "type": "boolean" + } + }, + "required": [] + }, + "MobileAccessPolicyCriteria": { + "type": "object", + "properties": { + "tp:APN": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + }, + "tp:DNN": { + "$ref": "ts_103280_2017_07#/$defs/ShortString" + } + }, + "required": [] + } + } +} \ No newline at end of file diff --git a/103120/schema/ts_103120_Authorisation.xsd b/103120/schema/xsd/ts_103120_Authorisation.xsd similarity index 100% rename from 103120/schema/ts_103120_Authorisation.xsd rename to 103120/schema/xsd/ts_103120_Authorisation.xsd diff --git a/103120/schema/ts_103120_Common.xsd b/103120/schema/xsd/ts_103120_Common.xsd similarity index 100% rename from 103120/schema/ts_103120_Common.xsd rename to 103120/schema/xsd/ts_103120_Common.xsd diff --git a/103120/schema/ts_103120_Core.xsd b/103120/schema/xsd/ts_103120_Core.xsd similarity index 100% rename from 103120/schema/ts_103120_Core.xsd rename to 103120/schema/xsd/ts_103120_Core.xsd diff --git a/103120/schema/ts_103120_Delivery.xsd b/103120/schema/xsd/ts_103120_Delivery.xsd similarity index 100% rename from 103120/schema/ts_103120_Delivery.xsd rename to 103120/schema/xsd/ts_103120_Delivery.xsd diff --git a/103120/schema/ts_103120_Document.xsd b/103120/schema/xsd/ts_103120_Document.xsd similarity index 100% rename from 103120/schema/ts_103120_Document.xsd rename to 103120/schema/xsd/ts_103120_Document.xsd diff --git a/103120/schema/ts_103120_Notification.xsd b/103120/schema/xsd/ts_103120_Notification.xsd similarity index 100% rename from 103120/schema/ts_103120_Notification.xsd rename to 103120/schema/xsd/ts_103120_Notification.xsd diff --git a/103120/schema/ts_103120_Task.xsd b/103120/schema/xsd/ts_103120_Task.xsd similarity index 100% rename from 103120/schema/ts_103120_Task.xsd rename to 103120/schema/xsd/ts_103120_Task.xsd diff --git a/103120/schema/ts_103120_TrafficPolicy.xsd b/103120/schema/xsd/ts_103120_TrafficPolicy.xsd similarity index 100% rename from 103120/schema/ts_103120_TrafficPolicy.xsd rename to 103120/schema/xsd/ts_103120_TrafficPolicy.xsd diff --git a/103280/TS_103_280.schema.json b/103280/TS_103_280.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..474b3ee7a0ac766d9b2772b7ba4c1de8a09f187e --- /dev/null +++ b/103280/TS_103_280.schema.json @@ -0,0 +1,389 @@ +{ + "$id": "ts_103280_2017_07", + "$defs": { + "ShortString": { + "type": "string", + "maxLength": 255 + }, + "LongString": { + "type": "string", + "maxLength": 65535 + }, + "LIID": { + "type": "string", + "pattern": "^([!-~]{1,25})|([0-9a-f]{26,50})$" + }, + "UTCDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$" + }, + "UTCMicrosecondDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$" + }, + "QualifiedDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "QualifiedMicrosecondDateTime": { + "type": "string", + "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}(Z|[+-][0-9]{2}:[0-9]{2})$" + }, + "InternationalE164": { + "type": "string", + "pattern": "^[0-9]{1,15}$" + }, + "IMSI": { + "type": "string", + "pattern": "^[0-9]{6,15}$" + }, + "IMEI": { + "type": "string", + "pattern": "^[0-9]{14}$" + }, + "IMEICheckDigit": { + "type": "string", + "pattern": "^[0-9]{15}$" + }, + "IMEISV": { + "type": "string", + "pattern": "^[0-9]{16}$" + }, + "IPv4Address": { + "type": "string", + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$" + }, + "IPv4CIDR": { + "type": "string", + "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/([1-2]?[0-9]|3[0-2])$" + }, + "IPv6Address": { + "type": "string", + "pattern": "^([0-9a-f]{4}:){7}([0-9a-f]{4})$" + }, + "IPv6CIDR": { + "type": "string", + "pattern": "^([0-9a-f]{4}:){7}([0-9a-f]{4})/(([1-9][0-9]?)|(1[0-1][0-9])|(12[0-8]))$" + }, + "TCPPort": { + "type": "integer", + "exclusiveMinimum": 1, + "maximum": 65535 + }, + "UDPPort": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "MACAddress": { + "type": "string", + "pattern": "^([a-f0-9]{2}:){5}[a-f0-9]{2}$" + }, + "EmailAddress": { + "allOf": [ + { + "$ref": "#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^[a-zA-Z0-9\\.!#$%&'\\*\\+\\\\/=\\?\\^_`\\{\\|\\}~\\-]+@[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$" + } + ] + }, + "UUID": { + "type": "string", + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$" + }, + "ISOCountryCode": { + "type": "string", + "pattern": "^[A-Z]{2}$" + }, + "SIPURI": { + "type": "string", + "pattern": "^sips?:[a-zA-Z0-9!#$&-;=?-\\[\\]_~%]+$" + }, + "TELURI": { + "type": "string", + "pattern": "^tel:[a-zA-Z0-9!#$&-;=?-\\[\\]_~%]+$" + }, + "WGS84LatitudeDecimal": { + "type": "string", + "pattern": "^[NS][0-9]{2}\\.[0-9]{6}$" + }, + "WGS84LongitudeDecimal": { + "type": "string", + "pattern": "^[EW][0-9]{3}\\.[0-9]{6}$" + }, + "WGS84LatitudeAngular": { + "type": "string", + "pattern": "^[NS][0-9]{6}\\.[0-9]{2}$" + }, + "WGS84LongitudeAngular": { + "type": "string", + "pattern": "^[EW][0-9]{7}\\.[0-9]{2}$" + }, + "SUPIIMSI": { + "$ref": "#/$defs/IMSI" + }, + "SUPINAI": { + "$ref": "#/$defs/NAI" + }, + "SUCI": { + "type": "string", + "pattern": "^([a-fA-F0-9]{2})*$" + }, + "PEIIMEI": { + "$ref": "#/$defs/IMEI" + }, + "PEIIMEICheckDigit": { + "$ref": "#/$defs/IMEICheckDigit" + }, + "PEIIMEISV": { + "$ref": "#/$defs/IMEISV" + }, + "GPSIMSISDN": { + "type": "string", + "pattern": "^[0-9]{1,15}$" + }, + "GPSINAI": { + "$ref": "#/$defs/NAI" + }, + "NAI": { + "type": "string" + }, + "LDID": { + "type": "string", + "pattern": "^([A-Z]{2}-.+-.+)$" + }, + "InternationalizedEmailAddress": { + "allOf": [ + { + "$ref": "#/$defs/ShortString" + }, + { + "type": "string", + "pattern": "^.+@.+$" + } + ] + }, + "EUI64": { + "type": "string", + "pattern": "^([a-f0-9]{2}:){7}[a-f0-9]{2}$" + }, + "CGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{4}-[a-f0-9]{4}$" + }, + "ECGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{7}$" + }, + "NCGI": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}-[a-f0-9]{9}$" + }, + "ICCID": { + "type": "string", + "pattern": "^[0-9]{19,20}$" + }, + "IPProtocol": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "IPAddress": { + "oneOf": [ + { + "type": "object", + "properties": { + "IPv4Address": { + "$ref": "#/$defs/IPv4Address" + } + }, + "required": [ + "IPv4Address" + ] + }, + { + "type": "object", + "properties": { + "IPv6Address": { + "$ref": "#/$defs/IPv6Address" + } + }, + "required": [ + "IPv6Address" + ] + } + ] + }, + "IPCIDR": { + "oneOf": [ + { + "type": "object", + "properties": { + "IPv4CIDR": { + "$ref": "#/$defs/IPv4CIDR" + } + }, + "required": [ + "IPv4CIDR" + ] + }, + { + "type": "object", + "properties": { + "IPv6CIDR": { + "$ref": "#/$defs/IPv6CIDR" + } + }, + "required": [ + "IPv6CIDR" + ] + } + ] + }, + "TCPPortRange": { + "type": "object", + "properties": { + "start": { + "$ref": "#/$defs/TCPPort" + }, + "end": { + "$ref": "#/$defs/TCPPort" + } + }, + "required": [ + "start", + "end" + ] + }, + "UDPPortRange": { + "type": "object", + "properties": { + "start": { + "$ref": "#/$defs/UDPPort" + }, + "end": { + "$ref": "#/$defs/UDPPort" + } + }, + "required": [ + "start", + "end" + ] + }, + "Port": { + "oneOf": [ + { + "type": "object", + "properties": { + "TCPPort": { + "$ref": "#/$defs/TCPPort" + } + }, + "required": [ + "TCPPort" + ] + }, + { + "type": "object", + "properties": { + "UDPPort": { + "$ref": "#/$defs/UDPPort" + } + }, + "required": [ + "UDPPort" + ] + } + ] + }, + "PortRange": { + "oneOf": [ + { + "type": "object", + "properties": { + "TCPPortRange": { + "$ref": "#/$defs/TCPPortRange" + } + }, + "required": [ + "TCPPortRange" + ] + }, + { + "type": "object", + "properties": { + "UDPPortRange": { + "$ref": "#/$defs/UDPPortRange" + } + }, + "required": [ + "UDPPortRange" + ] + } + ] + }, + "IPAddressPort": { + "type": "object", + "properties": { + "address": { + "$ref": "#/$defs/IPAddress" + }, + "port": { + "$ref": "#/$defs/Port" + } + }, + "required": [ + "address", + "port" + ] + }, + "IPAddressPortRange": { + "type": "object", + "properties": { + "address": { + "$ref": "#/$defs/IPAddress" + }, + "portRange": { + "$ref": "#/$defs/PortRange" + } + }, + "required": [ + "address", + "portRange" + ] + }, + "WGS84CoordinateDecimal": { + "type": "object", + "properties": { + "latitude": { + "$ref": "#/$defs/WGS84LatitudeDecimal" + }, + "longitude": { + "$ref": "#/$defs/WGS84LongitudeDecimal" + } + }, + "required": [ + "latitude", + "longitude" + ] + }, + "WGS84CoordinateAngular": { + "type": "object", + "properties": { + "latitude": { + "$ref": "#/$defs/WGS84LatitudeAngular" + }, + "longitude": { + "$ref": "#/$defs/WGS84LongitudeAngular" + } + }, + "required": [ + "latitude", + "longitude" + ] + } + } +} \ No newline at end of file diff --git a/testing/xsd_compile_targets.json b/testing/xsd_compile_targets.json index a1bde12e8cf2c0d58135e37cdd05317cc16e7a31..5e12fb4cac3027b38fc62e82b9e9e5bcf18934e3 100644 --- a/testing/xsd_compile_targets.json +++ b/testing/xsd_compile_targets.json @@ -30,21 +30,21 @@ ] }, { - "coreSchema" : "103120/schema/ts_103120_Core.xsd", + "coreSchema" : "103120/schema/xsd/ts_103120_Core.xsd", "supportingSchemas" : [ - "103120/schema/ts_103120_Authorisation.xsd", - "103120/schema/ts_103120_Common.xsd", - "103120/schema/ts_103120_Delivery.xsd", - "103120/schema/ts_103120_Document.xsd", - "103120/schema/ts_103120_Notification.xsd", - "103120/schema/ts_103120_Task.xsd", - "103120/schema/ts_103120_TrafficPolicy.xsd", + "103120/schema/xsd/ts_103120_Authorisation.xsd", + "103120/schema/xsd/ts_103120_Common.xsd", + "103120/schema/xsd/ts_103120_Delivery.xsd", + "103120/schema/xsd/ts_103120_Document.xsd", + "103120/schema/xsd/ts_103120_Notification.xsd", + "103120/schema/xsd/ts_103120_Task.xsd", + "103120/schema/xsd/ts_103120_TrafficPolicy.xsd", "103280/TS_103_280.xsd", "testing/deps/xmldsig/xmldsig-core-schema.xsd", - "103120/examples/FooServiceSchema.xsd" + "103120/examples/xml/FooServiceSchema.xsd" ], "exampleFiles" : [ - "103120/examples" + "103120/examples/xml" ] } ] \ No newline at end of file diff --git a/utils/translate/ChoiceMapping.py b/utils/translate/ChoiceMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..b477a3360e0a6a7b891f5854951eb4f37dce4b39 --- /dev/null +++ b/utils/translate/ChoiceMapping.py @@ -0,0 +1,47 @@ +import logging + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +from .TypeMapping import TypeMapping +from .ComplexTypeMapping import ComplexTypeMapping + +log = logging.getLogger() + +class ChoiceMapping(ComplexTypeMapping): + @classmethod + def process_choice(cls, choice: XsdGroup, current_ns : str, ns_to_id_map): + if choice.model != 'choice': + raise Exception(f"Wrong group type: {c.model}") + oneOf = [] + for c in choice.iter_model(): + if not (type(c) is XsdElement): + raise Exception (f"Non-element {c} encountered in choice {choice}") + element_name = c.local_name + if c.target_namespace in ns_to_id_map: + ns = ns_to_id_map[c.target_namespace] + if 'prefix' in ns: + element_name = ns['prefix'] + ":" + element_name + t = TypeMapping.get_type_from_elem(c, current_ns) + oneOf.append({ + "type" : "object", + "properties" : { + element_name : t + }, + "required" : [element_name] + }) + return oneOf + + def map(self, xst : BaseXsdType): + log.debug(f"Attempting mapping of {xst} to choice") + j = super().map(xst) + if j is None: + log.debug("Not a complex type, giving up") + return None + content = xst.content + if (content.model != 'choice'): + log.debug("Not a choice, giving up") + return None + return { 'oneOf' : ChoiceMapping.process_choice(content, xst.namespaces[''], self.ns_to_id_map)} diff --git a/utils/translate/ComplexTypeMapping.py b/utils/translate/ComplexTypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..e18190901be2c3e0695c00a772be5364cce591d1 --- /dev/null +++ b/utils/translate/ComplexTypeMapping.py @@ -0,0 +1,11 @@ +from xmlschema.validators.complex_types import * + +from .TypeMapping import TypeMapping + +class ComplexTypeMapping(TypeMapping): + def map(self, xst: BaseXsdType): + if not (type(xst) is XsdComplexType): + return None + return { + "type" : "object" + } diff --git a/utils/translate/SequenceMapping.py b/utils/translate/SequenceMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..4dc5c93e8a70c5a68cc753891032789d268c1be4 --- /dev/null +++ b/utils/translate/SequenceMapping.py @@ -0,0 +1,85 @@ +import logging + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +from .TypeMapping import TypeMapping +from .ChoiceMapping import ChoiceMapping +from .ComplexTypeMapping import ComplexTypeMapping + +log = logging.getLogger() + + +class SequenceMapping(ComplexTypeMapping): + def map(self, xst: BaseXsdType): + log.debug(f"Attempting mapping of {xst} to sequence") + j = super().map(xst) + if j is None: + log.debug("Not a complex type, giving up") + return None + content = xst.content + if (content.model != 'sequence'): + log.debug("Not a sequence, giving up") + return None + mapped_type = { + 'type' : 'object', + 'properties' : {}, + 'required' : [] + } + + # Not going to try and do all of this automatically for now + # Only make insert the xsiType parameter + if (xst.base_type): + # mapped_type['__DESCENDENT_OF__'] = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) + mapped_type['properties']['@xsi:type'] = { + "type" : "string", + "enum" : xst.name + } + mapped_type['required'].append('@xsi:type') + # if xst.abstract: + # mapped_type['__ABSTRACT__'] = True + # pass + + inner_choice = None + for c in list(content.iter_model()): + log.debug(f"Processing model item {c}") + if type(c) is XsdElement: + element_name = c.local_name + if c.target_namespace in self.ns_to_id_map: + ns = self.ns_to_id_map[c.target_namespace] + if 'prefix' in ns: + element_name = ns['prefix'] + ":" + element_name + if c.effective_max_occurs != 1: + mapped_type['properties'][element_name] = { + "type" : "array", + "items" : TypeMapping.get_type_from_elem(c, xst.namespaces['']) + } + if c.effective_max_occurs: + mapped_type['properties'][element_name]['maxItems'] = c.effective_max_occurs + if c.effective_min_occurs > 0: + mapped_type['properties'][element_name]['minItems'] = c.effective_min_occurs + else: + mapped_type['properties'][element_name] = TypeMapping.get_type_from_elem(c, xst.namespaces['']) + if c.effective_min_occurs == 1: + mapped_type['required'].append(element_name) + elif type(c) is XsdGroup: + if inner_choice: + raise Exception (f"Second group '{element_name}' encountered in {xst}") + if c.model != "choice": + raise Exception (f"Don't know what to do with inner group {c} in {xst} - not a choice") + inner_choice = ChoiceMapping.process_choice(c, xst.namespaces[''], self.ns_to_id_map) + elif type(c) is XsdAnyElement: + mapped_type = {} + else: + raise Exception(f"Unknown element type {c}") + if (inner_choice): + return { + 'allOf' : [ + mapped_type, + {'oneOf' : inner_choice} + ] + } + else: + return mapped_type diff --git a/utils/translate/SimpleTypeMapping.py b/utils/translate/SimpleTypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..2e60f9ca06b321a28992c2a32235707671f95735 --- /dev/null +++ b/utils/translate/SimpleTypeMapping.py @@ -0,0 +1,18 @@ +import logging + +from xmlschema.validators.complex_types import * +from xmlschema.validators.simple_types import XsdAtomicRestriction + +from .TypeMapping import TypeMapping + +log = logging.getLogger() + +class SimpleTypeMapping(TypeMapping): + def map(self, xst: BaseXsdType): + log.debug(f"Attempting mapping of {xst} to simple type") + if not (type(xst) is XsdAtomicRestriction): + log.debug("Type is not an XsdAtomicRestriction, giving up") + return None + return { + "$ref" : xst.base_type.name + } \ No newline at end of file diff --git a/utils/translate/TypeMapping.py b/utils/translate/TypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..e3daf622f8d8d6df3d22fde8376959b36b8c7f51 --- /dev/null +++ b/utils/translate/TypeMapping.py @@ -0,0 +1,70 @@ +import logging +from abc import ABC, abstractmethod + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +log = logging.getLogger() + +class TypeMapping(ABC): + ns_to_id_map = {} + + XSD_NS = "http://www.w3.org/2001/XMLSchema" + + XSD_TYPE_MAP = { + "string" : { "type" : "string" }, + "normalizedString" : { "type" : "string", "pattern" : "^[^\r\n\t]*$"}, + "dateTime" : { "type" : "string"}, + "token" : { "type" : "string", "pattern" : "^[^\r\n\t]*$"}, + "anyURI" : { "type" : "string" }, + + "integer" : { "type" : "integer"}, + "nonNegativeInteger" : { "type" : "integer", "minimum" : 0}, + "positiveInteger" : { "type" : "integer", "minimum" : 1}, + + "boolean" : { "type" : "boolean" }, + + "hexBinary" : { "type" : "string", "pattern" : "^([a-fA-F0-9]{2})*$"}, + "base64Binary" : { "type" : "string", "pattern" : "^[-A-Za-z0-9+/]*={0,3}$"}, + + "anyType" : {} + } + + @abstractmethod + def map(self, xst : BaseXsdType): + return None + + @classmethod + def extract_namespace(cls, qname: str): + match = re.search(r'^\{([^\{\}]+)\}(([^\{\}]+))$', qname) + if match is None: + return None + return match.group(1) + + @classmethod + def get_ref_for(cls, xsd_type: XsdType, current_ns : str): + ns = cls.extract_namespace(xsd_type.name) + if ns == current_ns: + return { "$ref" : f"#/$defs/{xsd_type.local_name}" } + else: + mapped_id = cls.ns_to_id_map[ns] + return { "$ref" : f"{mapped_id['id']}#/$defs/{xsd_type.local_name}"} + + @classmethod + def get_type_from_elem(cls, elem: XsdElement, current_ns : str): + ns = cls.extract_namespace(elem.type.name) + if (ns == TypeMapping.XSD_NS): + # this should be an XSD primitive type + return dict(TypeMapping.XSD_TYPE_MAP[elem.type.local_name]) + else: + return cls.get_ref_for(elem.type, current_ns) + + + + + + + + diff --git a/utils/translate/XSDNativeSimpleTypeMapping.py b/utils/translate/XSDNativeSimpleTypeMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..772ac10b308d4c2128bcf1bac3271117d9bbe80e --- /dev/null +++ b/utils/translate/XSDNativeSimpleTypeMapping.py @@ -0,0 +1,72 @@ +import logging + +from xmlschema.validators.simple_types import * +from xmlschema.validators.complex_types import * +from xmlschema.validators.groups import * +from xmlschema.validators.facets import * + +from .TypeMapping import TypeMapping +from .SimpleTypeMapping import SimpleTypeMapping + +log = logging.getLogger() + +class XSDNativeSimpleTypeMapping(SimpleTypeMapping): + + def map(self, xst: BaseXsdType): + log.debug(f"Attempting mapping of {xst} to XSD native type") + j = super().map(xst) + if j is None: + log.debug("Not a simple type, giving up") + return None + + mapped_type = TypeMapping.XSD_TYPE_MAP.get(xst.base_type.local_name) + parent_type = None + + if mapped_type is None: + ns = TypeMapping.extract_namespace(xst.base_type.name) + if ns == XSDNativeSimpleTypeMapping.XSD_NS: + print (xst) + print (xst.base_type) + raise Exception (f"No mapping for xs:{xst.base_type.local_name}") + if len(xst.facets) == 0: + mapped_type = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) + else: + parent_type = TypeMapping.get_ref_for(xst.base_type, xst.namespaces['']) + mapped_type = TypeMapping.XSD_TYPE_MAP.get(xst.root_type.local_name) + if mapped_type is None: + raise Exception (f"Could not find mapping for root type xs:{xst.root_type.local_name}") + + mapped_type = dict(mapped_type) + + for k, v in xst.facets.items(): + log.debug(f"Mapping facet {v}") + if type(v) is XsdMaxLengthFacet: + mapped_type['maxLength'] = v.value + continue + if type(v) is XsdMinLengthFacet: + mapped_type['minLength'] = v.value + continue + if type(v) is XsdPatternFacets: + if len(v.regexps) > 1: + raise Exception (f"Multiple patterns given in facet {v} of {xst}") + p = v.regexps[0] + if (not p.startswith('^')) and (not p.endswith('$')): + p = f"^{p}$" + mapped_type['pattern'] = p + continue + if type (v) is XsdMinInclusiveFacet: + mapped_type['minimum'] = v.value + continue + if type (v) is XsdMaxInclusiveFacet: + mapped_type['maximum'] = v.value + continue + if type (v) is XsdMinExclusiveFacet: + mapped_type['exclusiveMinimum'] = v.value + continue + if type (v) is XsdMaxExclusiveFacet: + mapped_type['exclusiveMaximum'] = v.value + continue + raise Exception (f"Unhandled facet {v}") + if parent_type: + return { 'allOf' : [parent_type, mapped_type] } + return mapped_type diff --git a/utils/translate/__init__.py b/utils/translate/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ba05008f9be181798aad7578d1cb1b75ee595f71 --- /dev/null +++ b/utils/translate/__init__.py @@ -0,0 +1,64 @@ +import logging + +from pathlib import Path +from xmlschema import * + +from .TypeMapping import * +from .XSDNativeSimpleTypeMapping import XSDNativeSimpleTypeMapping +from .ChoiceMapping import ChoiceMapping +from .SequenceMapping import SequenceMapping + + +log = logging.getLogger() + +mappings = [ + XSDNativeSimpleTypeMapping(), + ChoiceMapping(), + SequenceMapping(), +] + +def translate_schema (schema_path: str, ns_to_id_map: dict, schema_locations = []): + js = { + "$id" : "?", + "$defs" : {} + } + + logging.info(f"Translating schema {schema_path}") + xs = XMLSchema(schema_path, validation='lax', locations=schema_locations) + logging.info(f"Schema namespace: {xs.target_namespace}" ) + + schema_id = ns_to_id_map[xs.target_namespace]["id"] + js['$id'] = schema_id + + TypeMapping.ns_to_id_map = ns_to_id_map + + elementList = [] + for elementName, element in xs.elements.items(): + logging.info(f"Processing element {elementName} : {element}") + elementList.append(TypeMapping.get_ref_for(element.type, element.namespaces[''])) + if len(elementList) == 1: + js['$ref'] = elementList[0]['$ref'] + elif len(elementList) > 1: + js['oneOf'] = elementList + + descendent_types = {} + for type_name, xsd_type in xs.types.items(): + logging.info(f"Processing {type_name} : {xsd_type}") + + j = None + for mapping in mappings: + log.debug("\n----------------------------------------") + j = mapping.map(xsd_type) + if j is None: + continue + else: + break + if j is None: + raise Exception(f"Unmapped type {type_name} ({xsd_type})") + js["$defs"][xsd_type.local_name] = j + logging.debug (f"Mapped {type_name} to {j}") + + print (descendent_types) + return js + + diff --git a/utils/translate_spec.py b/utils/translate_spec.py new file mode 100644 index 0000000000000000000000000000000000000000..54ac5cd4417290c3bbd6700c9f7bf41feba19e60 --- /dev/null +++ b/utils/translate_spec.py @@ -0,0 +1,105 @@ +import json +import os +import logging +from pathlib import Path +import sys + +from xmlschema import * + +from translate import * + +logging.basicConfig(level = logging.INFO) + +def build_schema_locations (paths): + schema_locations = [] + for schemaFile in paths: + try: + xs = XMLSchema(schemaFile, validation='skip') + schema_locations.append((xs.target_namespace, str(Path(schemaFile).resolve()))) + logging.debug (" [ {0} -> {1} ]".format(xs.target_namespace, schemaFile)) + except XMLSchemaParseError as ex: + logging.debug (" [ {0} failed to parse: {1} ]".format(schemaFile, ex)) + return schema_locations + +def get_json(filename): + with open(filename) as f: + j = json.load(f) + return j + +def convert_ns_to_id (ns): + if ns.startswith('http://uri.etsi.org'): + c = ns.split("/") + return f"ts_1{c[3]}{'_' + c[7] if len(c) > 7 else ''}_{c[5]}_{c[6]}" + else: + return ns.replace("http://","").replace("/","_") + +def convert_xsd_to_filename (xsd): + f = Path(xsd) + return f.name.replace('.xsd', '.schema.json') + +if __name__ == "__main__": + if len(sys.argv) < 2: + logging.error ("Usage: translate_spec.py path_to_config_file") + exit(-1) + + config = get_json(sys.argv[1]) + + + logging.info("Bulding ns map...") + ns_map = {} + for location, settings in config['schemas'].items(): + xs = XMLSchema(location, validation='skip') + ns = xs.target_namespace + id = convert_ns_to_id(ns) + ns_map[ns] = { + "id" : id, + "location" : str(Path(location).resolve()) + } | settings + logging.debug(ns_map) + + logging.info("Building schema locations") + schema_locations = [(k, v["location"]) for k,v in ns_map.items()] + logging.debug(schema_locations) + + output_path = Path(config['output']) + if not output_path.exists(): + logging.info("Creating output directory") + os.mkdir(str(output_path)) + + logging.info("Translating schemas...") + json_schemas = {} + for schema_tuple in schema_locations: + logging.info(f" Translating {schema_tuple}") + if 'xmldsig' in (schema_tuple[1]): + # TODO - work out what to do here + logging.info(" Skipping XML Dsig...") + continue + js = translate_schema(schema_tuple[1], ns_map, schema_locations) + + # TODO - Special case, get rid of signature + if ns_map[schema_tuple[0]] == 'core.json': + js['$defs']['HI1Message']['properties'].pop('Signature') + js_path = output_path / convert_xsd_to_filename(schema_tuple[1]) + + # TODO - Special case - abstract HI1Object + if "Core" in schema_tuple[1]: + js["$defs"]['ConcreteHI1Object'] = { + 'oneOf' : [ + {'$ref' : 'ts_103120_Authorisation_2020_09#/$defs/AuthorisationObject'}, + {'$ref' : 'ts_103120_Task_2020_09#/$defs/LITaskObject'}, + {'$ref' : 'ts_103120_Task_2020_09#/$defs/LDTaskObject'}, + {'$ref' : 'ts_103120_Document_2020_09#/$defs/DocumentObject'}, + {'$ref' : 'ts_103120_Notification_2016_02#/$defs/NotificationObject'}, + {'$ref' : 'ts_103120_Delivery_2019_10#/$defs/DeliveryObject'}, + {'$ref' : 'ts_103120_TrafficPolicy_2022_07#/$defs/TrafficPolicyObject'}, + ] + } + + json_string = json.dumps(js, indent=2) + + if "Core" in schema_tuple[1]: + json_string = json_string.replace('"$ref": "#/$defs/HI1Object"', '"$ref": "#/$defs/ConcreteHI1Object"') + + with open(str(js_path), 'w') as f: + f.write(json_string) + json_schemas[js['$id']] = json.loads(json_string) diff --git a/utils/ts103120_config.json b/utils/ts103120_config.json new file mode 100644 index 0000000000000000000000000000000000000000..d21337616b4ad9abbaec83c2a06a149f9b89e1d5 --- /dev/null +++ b/utils/ts103120_config.json @@ -0,0 +1,36 @@ +{ + "schemas" : { + "./103120/schema/ts_103120_Authorisation.xsd" : { + "prefix" : "auth" + }, + "./103120/schema/ts_103120_Common.xsd" : { + "prefix" : "common" + }, + "./103120/schema/ts_103120_Core.xsd" : { + }, + "./103120/schema/ts_103120_Delivery.xsd" : { + "prefix" : "delivery" + }, + "./103120/schema/ts_103120_Document.xsd" : { + "prefix" : "doc" + }, + "./103120/schema/ts_103120_Notification.xsd" : { + "prefix" : "notification" + }, + "./103120/schema/ts_103120_Task.xsd" : { + "prefix" : "task" + }, + "./103120/schema/ts_103120_TrafficPolicy.xsd" : { + "prefix" : "tp" + }, + "./103280/TS_103_280.xsd" : { + "prefix" : "etsi280", + "skip" : true + }, + "./testing/deps/xmldsig/xmldsig-core-schema.xsd" : { + "prefix" : "xmldsig", + "skip" : true + } + }, + "output" : "./103120/schema/json/" +} \ No newline at end of file diff --git a/utils/validate.py b/utils/validate.py new file mode 100644 index 0000000000000000000000000000000000000000..17070bbbd1a96867c356331bcb7699cc652f034b --- /dev/null +++ b/utils/validate.py @@ -0,0 +1,120 @@ +import sys +from jsonschema import validate, RefResolver, Draft202012Validator +from jsonschema.exceptions import ValidationError +import json +from pathlib import Path +import logging +import argparse + + +def handle_uri(u): + print(u) + +def load_json(path : str): + with open(path) as f: + return json.load(f) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + + parser.add_argument('-s','--schemadir', action="append", help="Directory containing supporting schema files to use for validation") + parser.add_argument('-v', '--verbose', action="count", help="Verbose logging (can be specified multiple times)") + parser.add_argument('-i', '--input', type=argparse.FileType('r'), default=sys.stdin, help="Path to input file (if absent, stdin is used)") + parser.add_argument('schema', help="Primary schema to validate against") + + args = parser.parse_args() + + match args.verbose: + case v if v and v >= 2: + logging.basicConfig(level=logging.DEBUG) + case 1: + logging.basicConfig(level=logging.INFO) + case _: + logging.basicConfig(level=logging.WARNING) + + logging.debug(f"Arguments: {args}") + + instance_doc = json.loads(args.input.read()) + args.input.close() + main_schema = load_json(args.schema) + schema_dict = { main_schema['$id'] : main_schema } + + if args.schemadir: + schema_paths = [] + for d in args.schemadir: + logging.info(f"Searching {d}") + logging.info(list(Path(d).rglob("*.schema.json"))) + schema_paths += [f for f in Path(d).rglob("*.schema.json")] + logging.info(f"Schema files loaded: {schema_paths}") + + schemas_json = [json.load(p.open()) for p in schema_paths] + schema_dict = schema_dict | { s['$id'] : s for s in schemas_json } + + logging.info(f"Schema IDs loaded: {[k for k in schema_dict.keys()]}") + + logging.debug (f"Instance doc: {instance_doc}") + logging.debug (f"Main schema: {main_schema}") + + resolver = RefResolver(None, + referrer=None, + store=schema_dict) + + v = Draft202012Validator(main_schema, resolver=resolver) + try: + v.validate(instance_doc) + except ValidationError as ex: + # Any failure within the Payload element results in a failure against the oneOf constraint in the Payload element + # This isn't terribly helpful in working out what is actually wrong, so in this case we attempt an explicit + # validation against the relevant oneOf alternation to try and get a more useful validation error + if list(ex.schema_path) == ['properties', 'Payload', 'oneOf']: + logging.error ("Error detected validating payload oneOf - attempting explicit validation...") + try: + if 'RequestPayload' in instance_doc['Payload'].keys(): + request_fragment_schema = { "$ref" : "ts_103120_Core_2019_10#/$defs/RequestPayload" } + v = Draft202012Validator(request_fragment_schema, resolver=resolver) + v.validate(instance_doc['Payload']['RequestPayload']) + elif 'ResponsePayload' in instance_doc['Payload'].keys(): + request_fragment_schema = { "$ref" : "ts_103120_Core_2019_10#/$defs/ResponsePayload" } + v = Draft202012Validator(request_fragment_schema, resolver=resolver) + v.validate(instance_doc['Payload']['ResponsePayload']) + else: + logging.error("No RequestPayload or ResponsePayload found - is the Payload malformed?") + raise ex + except ValidationError as ex2: + # Similar to above, this is inner validation to try and get a more useful error in the event + # that something fails the verb oneOf constraint + logging.error("Error detected in ActionRequests/ActionResponses") + error_path = list(ex2.schema_path) + if error_path != ['properties', 'ActionRequests', 'properties', 'ActionRequest', 'items', 'allOf', 1, 'oneOf'] and error_path != ['properties', 'ActionResponses', 'properties', 'ActionResponse', 'items', 'allOf', 1, 'oneOf']: + logging.error("Error not in inner Request/Response allOf/oneOf constraint") + raise ex2 + j = ex2.instance + j.pop('ActionIdentifier') # Remove ActionIdentifier - one remaining key will be the verb + verb = list(j.keys())[0] + message = "Request" if error_path[1] == "ActionRequests" else "Response" + v = Draft202012Validator({"$ref" : f"ts_103120_Core_2019_10#/$defs/{verb}{message}"}, resolver=resolver) + try: + v.validate(j[verb]) + except ValidationError as ex3: + logging.error("Error detected in verb") + # The final level of validation is for the actual HI1Object validation + if list(ex3.schema_path) != ['properties', 'HI1Object', 'oneOf']: + logging.error("Error not inside HI1Object") + raise ex3 + object_type = ex3.instance['@xsi:type'].split('}')[-1] + object_ref = { + 'AuthorisationObject': 'ts_103120_Authorisation_2020_09#/$defs/AuthorisationObject', + 'LITaskObject': 'ts_103120_Task_2020_09#/$defs/LITaskObject', + 'LDTaskObject': 'ts_103120_Task_2020_09#/$defs/LDTaskObject', + 'DocumentObject': 'ts_103120_Document_2020_09#/$defs/DocumentObject', + 'NotificationObject': 'ts_103120_Notification_2016_02#/$defs/NotificationObject', + 'DeliveryObject': 'ts_103120_Delivery_2019_10#/$defs/DeliveryObject', + 'TrafficPolicyObject': 'ts_103120_TrafficPolicy_2022_07#/$defs/TrafficPolicyObject' + }[object_type] + v = Draft202012Validator({"$ref" : object_ref}, resolver=resolver) + v.validate(ex3.instance) + + exit(-1) + + + logging.info("Done") \ No newline at end of file diff --git a/utils/xml_to_json.py b/utils/xml_to_json.py new file mode 100644 index 0000000000000000000000000000000000000000..afc0f038776b044d335a968f03189b47a473d4c5 --- /dev/null +++ b/utils/xml_to_json.py @@ -0,0 +1,115 @@ +import sys +import logging +from pprint import pprint +import json +from pathlib import Path +import fileinput + +import xmltodict +import argparse + + +def extract_prefixes (d): + return { k.split(':')[1]: d[k] for k in d.keys() if k.startswith("@xmlns:") } + +def removePrefixes (o, prefixes): + if not isinstance(o, dict): return + replacements = [] + for k,v in o.items(): + if isinstance(v, dict): + removePrefixes(v, prefixes) + if isinstance(v, list): + for i in v: + removePrefixes(i, prefixes) + if ":" in k: + prefix = k.split(':')[0] + if (prefix) in prefixes: + new_key = k.split(':')[1] + replacements.append( (k, new_key) ) + for r in replacements: + o[r[1]] = o.pop(r[0]) + +object_namespaces = { + 'AuthorisationObject' : 'http://uri.etsi.org/03120/common/2020/09/Authorisation', + 'DeliveryObject' : 'http://uri.etsi.org/03120/common/2019/10/Delivery', + 'DocumentObject' : 'http://uri.etsi.org/03120/common/2020/09/Document', + 'NotificationObject' : 'http://uri.etsi.org/03120/common/2016/02/Notification', + 'LITaskObject' : 'http://uri.etsi.org/03120/common/2020/09/Task', + 'LDTaskObject' : 'http://uri.etsi.org/03120/common/2020/09/Task', + 'TrafficPolicyObject' : 'http://uri.etsi.org/03120/common/2022/07/TrafficPolicy', + 'TrafficRuleObject' : 'http://uri.etsi.org/03120/common/2022/07/TrafficPolicy' +} + +coerce_to_list = [ + 'auth:AuthorisationApprovalDetails', + 'auth:AuthorisationFlag', + 'auth:CSPID', + 'common:ApproverContactDetails', + 'ActionRequest', + 'ActionResponse', + 'ListResponseRecord', + 'AssociatedObject', + 'doc:DocumentSignature', + 'doc:DocumentProperty', + 'notification:AssociatedObjectStatus', + 'task:ApprovalDetails', + 'task:TargetIdentifierValue', + 'task:DeliveryDestination', + 'task:TaskFlag', + 'task:ApprovalDetails', + 'task:ObservedTimes', + 'task:RequestValue', + 'task:RequestSubtype', + 'task:LDDeliveryDestination', + 'task:LDTaskFlag', + 'task:TrafficPolicyReference', + 'tp:TrafficRuleReference', + 'tp:Criteria' +] + +coerce_to_int = [ + 'ActionIdentifier' +] + +def postprocessor (path, key, value): + if key == "@xsi:type": + object_name = value.split(":")[-1] + if object_name in object_namespaces.keys(): + value = "{" + object_namespaces[object_name] + "}" + object_name + return key, value + if key in coerce_to_int: + return key, int(value) + return key, value + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('-v', '--verbose', action='count', help='Verbose logging (can be specified multiple times)') + parser.add_argument('-i', '--input', type=argparse.FileType('r'), default=sys.stdin, help="Path to input file (if absent, stdin is used)") + args = parser.parse_args() + + match args.verbose: + case v if v and v >= 2: + logging.basicConfig(level=logging.DEBUG) + case 1: + logging.basicConfig(level=logging.INFO) + case _: + logging.basicConfig(level=logging.WARNING) + + logging.debug(f"Arguments: {args}") + + s = args.input.read() + args.input.close() + + logging.debug(s) + + d = xmltodict.parse(s, + force_list=tuple(coerce_to_list), + # process_namespaces=True, + # namespaces = namespace_prefixes, + postprocessor=postprocessor + )['HI1Message'] + + # prefixes = extract_prefixes(d) + # removePrefixes(d, prefixes) + + print(json.dumps(d, indent=2))