diff --git a/packages/consumption/src/consumption/ConsumptionCoreErrors.ts b/packages/consumption/src/consumption/ConsumptionCoreErrors.ts index 437997bf3..73ace7303 100644 --- a/packages/consumption/src/consumption/ConsumptionCoreErrors.ts +++ b/packages/consumption/src/consumption/ConsumptionCoreErrors.ts @@ -237,7 +237,7 @@ class Attributes { } public isNotRepositoryAttribute(attributeId: string | CoreId) { - return new CoreError("error.consumption.attributes.isNotRepositoryAttribute", `The attribute (id: ${attributeId}) is not a RepositoryAttribute.`); + return new CoreError("error.consumption.attributes.isNotRepositoryAttribute", `The Attribute (id: ${attributeId}) is not a RepositoryAttribute.`); } public isNotSharedAttribute(attributeId: string | CoreId) { diff --git a/packages/runtime/scripts/buildSchemas.mjs b/packages/runtime/scripts/buildSchemas.mjs index 232bb7ce7..4295dc8d4 100644 --- a/packages/runtime/scripts/buildSchemas.mjs +++ b/packages/runtime/scripts/buildSchemas.mjs @@ -1,32 +1,44 @@ +import * as content from "@nmshd/content"; import fs from "fs"; import * as tsj from "ts-json-schema-generator"; -const config = { +const runtimeConfig = { tsconfig: new URL("../tsconfig.json", import.meta.url).pathname, type: "*", extraTags: ["errorMessage"] }; +// use SchemaValidatableCreateRepositoryAttributeRequest instead of CreateRepositoryAttributeRequest +const useCaseSchemaDeclarations = getSchemaDeclarations(runtimeConfig, (x) => x.endsWith("Request") && x !== "CreateRepositoryAttributeRequest"); +const cleanUseCaseSchemaDeclarations = useCaseSchemaDeclarations.replaceAll("SchemaValidatable", ""); -const schemaGenerator = tsj.createGenerator(config); - -const requestTypes = schemaGenerator - .getRootNodes() - .map((x) => x.symbol.escapedName) - .filter((x) => x.endsWith("Request")); - -const schemaDeclarations = requestTypes - .map((type) => { - try { - const schema = schemaGenerator.createSchema(type); - return `export const ${type}: any = ${JSON.stringify(schema, undefined, 4)}`; - } catch (e) { - if (!(e instanceof tsj.NoRootTypeError)) throw e; - } - }) - .filter((s) => s) - .join("\n\n"); +const contentConfig = { + ...runtimeConfig, + tsconfig: new URL("../../content/tsconfig.json", import.meta.url).pathname +}; +const attributeValues = content.AttributeValues.Identity.TYPE_NAMES.map((x) => `${x}JSON`); +const attributeSchemaDeclarations = getSchemaDeclarations(contentConfig, (x) => attributeValues.includes(x)); +const cleanAttributeSchemaDeclarations = attributeSchemaDeclarations.replaceAll("JSON", ""); const outputPath = new URL("../src/useCases/common/Schemas.ts", import.meta.url).pathname; -fs.writeFile(outputPath, schemaDeclarations, (err) => { +fs.writeFile(outputPath, `${cleanUseCaseSchemaDeclarations}\n\n${cleanAttributeSchemaDeclarations}`, (err) => { if (err) throw err; }); + +function getSchemaDeclarations(tsconfig, filter) { + const schemaGenerator = tsj.createGenerator(tsconfig); + const types = schemaGenerator + .getRootNodes() + .map((x) => x.symbol.escapedName) + .filter(filter); + return types + .map((type) => { + try { + const schema = schemaGenerator.createSchema(type); + return `export const ${type}: any = ${JSON.stringify(schema, undefined, 4)}`; + } catch (e) { + if (!(e instanceof tsj.NoRootTypeError)) throw e; + } + }) + .filter((s) => s) + .join("\n\n"); +} diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index b4e81f05c..70ff06309 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -14933,13 +14933,12 @@ export const CreateRepositoryAttributeRequest: any = { "definitions": { "CreateRepositoryAttributeRequest": { "type": "object", + "additionalProperties": false, "properties": { "content": { "type": "object", "properties": { - "value": { - "$ref": "#/definitions/AttributeValues.Identity.Json" - }, + "value": {}, "tags": { "type": "array", "items": { @@ -14961,172 +14960,153 @@ export const CreateRepositoryAttributeRequest: any = { }, "required": [ "content" + ] + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } + } +} + +export const DeleteOwnSharedAttributeAndNotifyPeerRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteOwnSharedAttributeAndNotifyPeerRequest", + "definitions": { + "DeleteOwnSharedAttributeAndNotifyPeerRequest": { + "type": "object", + "properties": { + "attributeId": { + "$ref": "#/definitions/AttributeIdString" + } + }, + "required": [ + "attributeId" ], "additionalProperties": false }, - "AttributeValues.Identity.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AttributeValues.Identity.Editable.Json" - }, - { - "$ref": "#/definitions/AttributeValues.Identity.Uneditable.Json" + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + } + } +} + +export const DeletePeerSharedAttributeAndNotifyOwnerRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeletePeerSharedAttributeAndNotifyOwnerRequest", + "definitions": { + "DeletePeerSharedAttributeAndNotifyOwnerRequest": { + "type": "object", + "properties": { + "attributeId": { + "$ref": "#/definitions/AttributeIdString" } - ] + }, + "required": [ + "attributeId" + ], + "additionalProperties": false }, - "AttributeValues.Identity.Editable.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AffiliationJSON" - }, - { - "$ref": "#/definitions/BirthDateJSON" - }, - { - "$ref": "#/definitions/BirthNameJSON" - }, - { - "$ref": "#/definitions/BirthPlaceJSON" - }, - { - "$ref": "#/definitions/CitizenshipJSON" - }, - { - "$ref": "#/definitions/CommunicationLanguageJSON" - }, - { - "$ref": "#/definitions/DeliveryBoxAddressJSON" - }, - { - "$ref": "#/definitions/DisplayNameJSON" - }, - { - "$ref": "#/definitions/EMailAddressJSON" - }, - { - "$ref": "#/definitions/FaxNumberJSON" - }, - { - "$ref": "#/definitions/IdentityFileReferenceJSON" - }, - { - "$ref": "#/definitions/JobTitleJSON" - }, - { - "$ref": "#/definitions/NationalityJSON" - }, - { - "$ref": "#/definitions/PersonNameJSON" - }, - { - "$ref": "#/definitions/PhoneNumberJSON" - }, - { - "$ref": "#/definitions/PostOfficeBoxAddressJSON" - }, - { - "$ref": "#/definitions/PseudonymJSON" - }, - { - "$ref": "#/definitions/SexJSON" - }, - { - "$ref": "#/definitions/StreetAddressJSON" - }, - { - "$ref": "#/definitions/WebsiteJSON" + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + } + } +} + +export const DeleteRepositoryAttributeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteRepositoryAttributeRequest", + "definitions": { + "DeleteRepositoryAttributeRequest": { + "type": "object", + "properties": { + "attributeId": { + "$ref": "#/definitions/AttributeIdString" } - ] + }, + "required": [ + "attributeId" + ], + "additionalProperties": false }, - "AffiliationJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + } + } +} + +export const DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest", + "definitions": { + "DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Affiliation" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "organization": { - "type": "string" - }, - "role": { - "type": "string" - }, - "unit": { - "type": "string" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "@type", - "organization" + "relationshipId" ], "additionalProperties": false }, - "BirthDateJSON": { + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const DeleteThirdPartyRelationshipAttributeAndNotifyPeerRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteThirdPartyRelationshipAttributeAndNotifyPeerRequest", + "definitions": { + "DeleteThirdPartyRelationshipAttributeAndNotifyPeerRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthDate" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "day": { - "type": "number" - }, - "month": { - "type": "number" - }, - "year": { - "type": "number" + "attributeId": { + "$ref": "#/definitions/AttributeIdString" } }, "required": [ - "@type", - "day", - "month", - "year" + "attributeId" ], "additionalProperties": false }, - "BirthNameJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + } + } +} + +export const ExecuteIdentityAttributeQueryRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ExecuteIdentityAttributeQueryRequest", + "definitions": { + "ExecuteIdentityAttributeQueryRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthName" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "query": { + "$ref": "#/definitions/IdentityAttributeQueryJSON" } }, "required": [ - "@type", - "value" + "query" ], "additionalProperties": false }, - "BirthPlaceJSON": { + "IdentityAttributeQueryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "BirthPlace" + "const": "IdentityAttributeQuery" }, "@context": { "type": "string" @@ -15134,75 +15114,236 @@ export const CreateRepositoryAttributeRequest: any = { "@version": { "type": "string" }, - "city": { - "type": "string" - }, - "country": { - "type": "string" + "valueType": { + "$ref": "#/definitions/AttributeValues.Identity.TypeName" }, - "state": { - "type": "string" + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "validFrom": { + "type": "string" + }, + "validTo": { + "type": "string" } }, "required": [ "@type", - "city", - "country" + "valueType" ], "additionalProperties": false }, - "CitizenshipJSON": { + "AttributeValues.Identity.TypeName": { + "anyOf": [ + { + "$ref": "#/definitions/AttributeValues.Identity.Editable.TypeName" + }, + { + "$ref": "#/definitions/AttributeValues.Identity.Uneditable.TypeName" + } + ] + }, + "AttributeValues.Identity.Editable.TypeName": { + "type": "string", + "enum": [ + "Affiliation", + "BirthDate", + "BirthName", + "BirthPlace", + "Citizenship", + "CommunicationLanguage", + "DeliveryBoxAddress", + "DisplayName", + "EMailAddress", + "FaxNumber", + "IdentityFileReference", + "SchematizedXML", + "JobTitle", + "Nationality", + "PersonName", + "PhoneNumber", + "PostOfficeBoxAddress", + "Pseudonym", + "Sex", + "StreetAddress", + "Website" + ] + }, + "AttributeValues.Identity.Uneditable.TypeName": { + "type": "string", + "enum": [ + "AffiliationOrganization", + "AffiliationRole", + "AffiliationUnit", + "BirthCity", + "BirthCountry", + "BirthDay", + "BirthMonth", + "BirthState", + "BirthYear", + "City", + "Country", + "GivenName", + "HonorificPrefix", + "HonorificSuffix", + "HouseNumber", + "MiddleName", + "SchematizedXML", + "State", + "Street", + "Surname", + "ZipCode" + ] + } + } +} + +export const ExecuteIQLQueryRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ExecuteIQLQueryRequest", + "definitions": { + "ExecuteIQLQueryRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Citizenship" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "query": { + "type": "object", + "additionalProperties": false, + "properties": { + "@type": { + "type": "string", + "const": "IQLQuery" + }, + "queryString": { + "type": "string" + }, + "attributeCreationHints": { + "$ref": "#/definitions/IQLQueryCreationHintsJSON" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + } + }, + "required": [ + "queryString" + ] } }, "required": [ - "@type", - "value" + "query" ], "additionalProperties": false }, - "CommunicationLanguageJSON": { + "IQLQueryCreationHintsJSON": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "CommunicationLanguage" - }, - "@context": { - "type": "string" + "valueType": { + "$ref": "#/definitions/AttributeValues.Identity.TypeName" }, - "@version": { - "type": "string" + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "valueType" + ], + "additionalProperties": false + }, + "AttributeValues.Identity.TypeName": { + "anyOf": [ + { + "$ref": "#/definitions/AttributeValues.Identity.Editable.TypeName" }, - "value": { - "type": "string" + { + "$ref": "#/definitions/AttributeValues.Identity.Uneditable.TypeName" + } + ] + }, + "AttributeValues.Identity.Editable.TypeName": { + "type": "string", + "enum": [ + "Affiliation", + "BirthDate", + "BirthName", + "BirthPlace", + "Citizenship", + "CommunicationLanguage", + "DeliveryBoxAddress", + "DisplayName", + "EMailAddress", + "FaxNumber", + "IdentityFileReference", + "SchematizedXML", + "JobTitle", + "Nationality", + "PersonName", + "PhoneNumber", + "PostOfficeBoxAddress", + "Pseudonym", + "Sex", + "StreetAddress", + "Website" + ] + }, + "AttributeValues.Identity.Uneditable.TypeName": { + "type": "string", + "enum": [ + "AffiliationOrganization", + "AffiliationRole", + "AffiliationUnit", + "BirthCity", + "BirthCountry", + "BirthDay", + "BirthMonth", + "BirthState", + "BirthYear", + "City", + "Country", + "GivenName", + "HonorificPrefix", + "HonorificSuffix", + "HouseNumber", + "MiddleName", + "SchematizedXML", + "State", + "Street", + "Surname", + "ZipCode" + ] + } + } +} + +export const ExecuteRelationshipAttributeQueryRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ExecuteRelationshipAttributeQueryRequest", + "definitions": { + "ExecuteRelationshipAttributeQueryRequest": { + "type": "object", + "properties": { + "query": { + "$ref": "#/definitions/RelationshipAttributeQueryJSON" } }, "required": [ - "@type", - "value" + "query" ], "additionalProperties": false }, - "DeliveryBoxAddressJSON": { + "RelationshipAttributeQueryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "DeliveryBoxAddress" + "const": "RelationshipAttributeQuery" }, "@context": { "type": "string" @@ -15210,71 +15351,81 @@ export const CreateRepositoryAttributeRequest: any = { "@version": { "type": "string" }, - "recipient": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "deliveryBoxId": { - "type": "string" - }, - "zipCode": { + "key": { "type": "string" }, - "city": { + "owner": { "type": "string" }, - "country": { - "type": "string" + "attributeCreationHints": { + "$ref": "#/definitions/RelationshipAttributeCreationHintsJSON" }, - "phoneNumber": { + "validFrom": { "type": "string" }, - "state": { + "validTo": { "type": "string" } }, "required": [ "@type", - "city", - "country", - "deliveryBoxId", - "recipient", - "userId", - "zipCode" + "attributeCreationHints", + "key", + "owner" ], "additionalProperties": false }, - "DisplayNameJSON": { + "RelationshipAttributeCreationHintsJSON": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "DisplayName" - }, - "@context": { + "title": { "type": "string" }, - "@version": { - "type": "string" + "valueType": { + "$ref": "#/definitions/AttributeValues.Relationship.TypeName" }, - "value": { + "description": { "type": "string" + }, + "valueHints": { + "$ref": "#/definitions/ValueHintsJSON" + }, + "confidentiality": { + "$ref": "#/definitions/RelationshipAttributeConfidentiality" } }, "required": [ - "@type", - "value" + "title", + "valueType", + "confidentiality" ], "additionalProperties": false }, - "EMailAddressJSON": { + "AttributeValues.Relationship.TypeName": { + "type": "string", + "enum": [ + "ProprietaryBoolean", + "ProprietaryCountry", + "ProprietaryEMailAddress", + "ProprietaryFileReference", + "ProprietaryFloat", + "ProprietaryHEXColor", + "ProprietaryInteger", + "ProprietaryLanguage", + "ProprietaryPhoneNumber", + "ProprietaryString", + "ProprietaryURL", + "ProprietaryJSON", + "ProprietaryXML", + "Consent" + ] + }, + "ValueHintsJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "EMailAddress" + "const": "ValueHints" }, "@context": { "type": "string" @@ -15282,114 +15433,96 @@ export const CreateRepositoryAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "editHelp": { "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "FaxNumberJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "FaxNumber" }, - "@context": { - "type": "string" + "min": { + "type": "number" }, - "@version": { - "type": "string" + "max": { + "type": "number" }, - "value": { + "pattern": { "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "IdentityFileReferenceJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "IdentityFileReference" }, - "@context": { - "type": "string" + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/ValueHintsValueJSON" + } }, - "@version": { - "type": "string" + "defaultValue": { + "type": [ + "string", + "number", + "boolean" + ] }, - "value": { - "type": "string" + "propertyHints": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ValueHintsJSON" + } } }, "required": [ - "@type", - "value" + "@type" ], "additionalProperties": false }, - "JobTitleJSON": { + "ValueHintsValueJSON": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "JobTitle" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "key": { + "type": [ + "string", + "number", + "boolean" + ] }, - "value": { + "displayName": { "type": "string" } }, "required": [ - "@type", - "value" + "key", + "displayName" ], "additionalProperties": false }, - "NationalityJSON": { + "RelationshipAttributeConfidentiality": { + "type": "string", + "enum": [ + "public", + "private", + "protected" + ] + } + } +} + +export const ExecuteThirdPartyRelationshipAttributeQueryRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ExecuteThirdPartyRelationshipAttributeQueryRequest", + "definitions": { + "ExecuteThirdPartyRelationshipAttributeQueryRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Nationality" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "query": { + "$ref": "#/definitions/ThirdPartyRelationshipAttributeQueryJSON" } }, "required": [ - "@type", - "value" + "query" ], "additionalProperties": false }, - "PersonNameJSON": { + "ThirdPartyRelationshipAttributeQueryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "PersonName" + "const": "ThirdPartyRelationshipAttributeQuery" }, "@context": { "type": "string" @@ -15397,573 +15530,1191 @@ export const CreateRepositoryAttributeRequest: any = { "@version": { "type": "string" }, - "givenName": { + "key": { "type": "string" }, - "middleName": { - "type": "string" + "owner": { + "anyOf": [ + { + "$ref": "#/definitions/ThirdPartyRelationshipAttributeQueryOwner" + }, + { + "type": "string", + "const": "thirdParty" + }, + { + "type": "string", + "const": "recipient" + }, + { + "type": "string", + "const": "" + } + ] }, - "surname": { - "type": "string" + "thirdParty": { + "type": "array", + "items": { + "type": "string" + } }, - "honorificSuffix": { + "validFrom": { "type": "string" }, - "honorificPrefix": { + "validTo": { "type": "string" } }, "required": [ "@type", - "givenName", - "surname" + "key", + "owner", + "thirdParty" ], "additionalProperties": false }, - "PhoneNumberJSON": { + "ThirdPartyRelationshipAttributeQueryOwner": { + "type": "string", + "enum": [ + "thirdParty", + "recipient", + "" + ] + } + } +} + +export const GetAttributeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetAttributeRequest", + "definitions": { + "GetAttributeRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "PhoneNumber" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "id": { + "$ref": "#/definitions/AttributeIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "PostOfficeBoxAddressJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "PostOfficeBoxAddress" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "recipient": { - "type": "string" - }, - "boxId": { - "type": "string" - }, - "zipCode": { - "type": "string" - }, - "city": { - "type": "string" - }, - "country": { - "type": "string" - }, - "state": { - "type": "string" - } - }, - "required": [ - "@type", - "boxId", - "city", - "country", - "recipient", - "zipCode" - ], - "additionalProperties": false - }, - "PseudonymJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + } + } +} + +export const GetAttributesRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetAttributesRequest", + "definitions": { + "GetAttributesRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Pseudonym" - }, - "@context": { - "type": "string" + "query": { + "$ref": "#/definitions/GetAttributesRequestQuery" }, - "@version": { - "type": "string" + "onlyValid": { + "type": "boolean" }, - "value": { - "type": "string" + "hideTechnical": { + "type": "boolean" } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false }, - "SexJSON": { + "GetAttributesRequestQuery": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Sex" - }, - "@context": { + "createdAt": { "type": "string" }, - "@version": { - "type": "string" + "parentId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "value": { - "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "StreetAddressJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "StreetAddress" + "succeeds": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@context": { - "type": "string" + "succeededBy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@version": { + "isDefault": { "type": "string" }, - "recipient": { - "type": "string" + "content.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "street": { - "type": "string" + "content.tags": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "houseNo": { - "type": "string" + "content.owner": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "zipCode": { - "type": "string" + "content.validFrom": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "city": { - "type": "string" + "content.validTo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "country": { - "type": "string" + "content.key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "state": { + "content.isTechnical": { "type": "string" - } - }, - "required": [ - "@type", - "city", - "country", - "houseNo", - "recipient", - "street", - "zipCode" - ], - "additionalProperties": false - }, - "WebsiteJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "Website" }, - "@context": { - "type": "string" + "content.confidentiality": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "AttributeValues.Identity.Uneditable.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AffiliationOrganizationJSON" - }, - { - "$ref": "#/definitions/AffiliationRoleJSON" - }, - { - "$ref": "#/definitions/AffiliationUnitJSON" - }, - { - "$ref": "#/definitions/BirthCityJSON" - }, - { - "$ref": "#/definitions/BirthCountryJSON" - }, - { - "$ref": "#/definitions/BirthDayJSON" - }, - { - "$ref": "#/definitions/BirthMonthJSON" - }, - { - "$ref": "#/definitions/BirthStateJSON" - }, - { - "$ref": "#/definitions/BirthYearJSON" - }, - { - "$ref": "#/definitions/CityJSON" - }, - { - "$ref": "#/definitions/CountryJSON" - }, - { - "$ref": "#/definitions/GivenNameJSON" - }, - { - "$ref": "#/definitions/HonorificPrefixJSON" - }, - { - "$ref": "#/definitions/HonorificSuffixJSON" - }, - { - "$ref": "#/definitions/HouseNumberJSON" + "content.value.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/MiddleNameJSON" + "shareInfo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/SchematizedXMLJSON" + "shareInfo.requestReference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/StateJSON" + "shareInfo.notificationReference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/StreetJSON" + "shareInfo.peer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/SurnameJSON" + "shareInfo.sourceAttribute": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - { - "$ref": "#/definitions/ZipCodeJSON" - } - ] - }, - "AffiliationOrganizationJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "AffiliationOrganization" + "shareInfo.thirdPartyAddress": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@context": { - "type": "string" + "deletionInfo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@version": { - "type": "string" + "deletionInfo.deletionStatus": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "value": { - "type": "string" + "deletionInfo.deletionDate": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false - }, - "AffiliationRoleJSON": { + } + } +} + +export const GetOwnSharedAttributesRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetOwnSharedAttributesRequest", + "definitions": { + "GetOwnSharedAttributesRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "AffiliationRole" + "peer": { + "$ref": "#/definitions/AddressString" }, - "@context": { - "type": "string" + "onlyValid": { + "type": "boolean" }, - "@version": { - "type": "string" + "query": { + "$ref": "#/definitions/GetOwnSharedAttributeRequestQuery" }, - "value": { - "type": "string" + "hideTechnical": { + "type": "boolean" + }, + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" } }, "required": [ - "@type", - "value" + "peer" ], "additionalProperties": false }, - "AffiliationUnitJSON": { + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + }, + "GetOwnSharedAttributeRequestQuery": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "AffiliationUnit" - }, - "@context": { + "createdAt": { "type": "string" }, - "@version": { + "content.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.tags": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.validFrom": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.validTo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.isTechnical": { + "type": "string" + }, + "content.confidentiality": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.value.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.requestReference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.notificationReference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.sourceAttribute": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.thirdPartyAddress": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deletionInfo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deletionInfo.deletionStatus": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deletionInfo.deletionDate": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "additionalProperties": false + } + } +} + +export const GetPeerSharedAttributesRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetPeerSharedAttributesRequest", + "definitions": { + "GetPeerSharedAttributesRequest": { + "type": "object", + "properties": { + "peer": { + "$ref": "#/definitions/AddressString" + }, + "onlyValid": { + "type": "boolean" + }, + "query": { + "$ref": "#/definitions/GetPeerSharedAttributesRequestQuery" + }, + "hideTechnical": { + "type": "boolean" + }, + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" + } + }, + "required": [ + "peer" + ], + "additionalProperties": false + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + }, + "GetPeerSharedAttributesRequestQuery": { + "type": "object", + "properties": { + "createdAt": { + "type": "string" + }, + "content.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.tags": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.validFrom": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.validTo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.isTechnical": { "type": "string" }, - "value": { - "type": "string" + "content.confidentiality": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.value.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.requestReference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.notificationReference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "shareInfo.thirdPartyAddress": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deletionInfo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deletionInfo.deletionStatus": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "deletionInfo.deletionDate": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false - }, - "BirthCityJSON": { + } + } +} + +export const GetRepositoryAttributesRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetRepositoryAttributesRequest", + "definitions": { + "GetRepositoryAttributesRequest": { "type": "object", "properties": { - "value": { - "type": "string" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" }, - "@type": { - "type": "string", - "const": "BirthCity" + "query": { + "$ref": "#/definitions/GetRepositoryAttributesRequestQuery" } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false }, - "BirthCountryJSON": { + "GetRepositoryAttributesRequestQuery": { "type": "object", "properties": { - "value": { - "type": "string" - }, - "@context": { + "createdAt": { "type": "string" }, - "@version": { + "isDefault": { "type": "string" }, - "@type": { - "type": "string", - "const": "BirthCountry" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "BirthDayJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "BirthDay" + "content.tags": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@context": { - "type": "string" + "content.validFrom": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@version": { - "type": "string" + "content.validTo": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "value": { - "type": "number" + "content.value.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false - }, - "BirthMonthJSON": { + } + } +} + +export const GetSharedVersionsOfAttributeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetSharedVersionsOfAttributeRequest", + "definitions": { + "GetSharedVersionsOfAttributeRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthMonth" - }, - "@context": { - "type": "string" + "attributeId": { + "$ref": "#/definitions/AttributeIdString" }, - "@version": { - "type": "string" + "peers": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressString" + } }, - "value": { - "type": "number", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12 - ], - "description": "Month values: 1 (january) - 12 (december)" + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" } }, "required": [ - "@type", - "value" + "attributeId" ], "additionalProperties": false }, - "BirthStateJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + } + } +} + +export const GetVersionsOfAttributeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetVersionsOfAttributeRequest", + "definitions": { + "GetVersionsOfAttributeRequest": { "type": "object", "properties": { - "value": { - "type": "string" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "@type": { - "type": "string", - "const": "BirthState" + "attributeId": { + "$ref": "#/definitions/AttributeIdString" } }, "required": [ - "@type", - "value" + "attributeId" ], "additionalProperties": false }, - "BirthYearJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + } + } +} + +export const NotifyPeerAboutRepositoryAttributeSuccessionRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/NotifyPeerAboutRepositoryAttributeSuccessionRequest", + "definitions": { + "NotifyPeerAboutRepositoryAttributeSuccessionRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthYear" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "number" + "attributeId": { + "$ref": "#/definitions/AttributeIdString" + }, + "peer": { + "$ref": "#/definitions/AddressString" } }, "required": [ - "@type", - "value" + "attributeId", + "peer" ], "additionalProperties": false }, - "CityJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + } + } +} + +export const ShareRepositoryAttributeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ShareRepositoryAttributeRequest", + "definitions": { + "ShareRepositoryAttributeRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "City" + "attributeId": { + "$ref": "#/definitions/AttributeIdString" }, - "@context": { - "type": "string" + "peer": { + "$ref": "#/definitions/AddressString" }, - "@version": { - "type": "string" + "requestMetadata": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + } + }, + "additionalProperties": false }, - "value": { - "type": "string" + "requestItemMetadata": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "requireManualDecision": { + "type": "boolean" + } + }, + "additionalProperties": false } }, "required": [ - "@type", - "value" + "attributeId", + "peer" ], "additionalProperties": false }, - "CountryJSON": { + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } + } +} + +export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/SucceedRelationshipAttributeAndNotifyPeerRequest", + "definitions": { + "SucceedRelationshipAttributeAndNotifyPeerRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Country" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "predecessorId": { + "$ref": "#/definitions/AttributeIdString" }, - "value": { - "type": "string" + "successorContent": { + "type": "object", + "properties": { + "value": { + "$ref": "#/definitions/AttributeValues.Relationship.Json" + }, + "validFrom": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "validTo": { + "$ref": "#/definitions/ISO8601DateTimeString" + } + }, + "required": [ + "value" + ], + "additionalProperties": false } }, "required": [ - "@type", - "value" + "predecessorId", + "successorContent" ], "additionalProperties": false }, - "GivenNameJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "GivenName" + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" + }, + "AttributeValues.Relationship.Json": { + "anyOf": [ + { + "$ref": "#/definitions/ProprietaryBooleanJSON" }, - "@context": { - "type": "string" + { + "$ref": "#/definitions/ProprietaryCountryJSON" }, - "@version": { - "type": "string" + { + "$ref": "#/definitions/ProprietaryEMailAddressJSON" }, - "value": { - "type": "string" + { + "$ref": "#/definitions/ProprietaryFileReferenceJSON" + }, + { + "$ref": "#/definitions/ProprietaryFloatJSON" + }, + { + "$ref": "#/definitions/ProprietaryHEXColorJSON" + }, + { + "$ref": "#/definitions/ProprietaryIntegerJSON" + }, + { + "$ref": "#/definitions/ProprietaryLanguageJSON" + }, + { + "$ref": "#/definitions/ProprietaryPhoneNumberJSON" + }, + { + "$ref": "#/definitions/ProprietaryStringJSON" + }, + { + "$ref": "#/definitions/ProprietaryURLJSON" + }, + { + "$ref": "#/definitions/ProprietaryJSONJSON" + }, + { + "$ref": "#/definitions/ProprietaryXMLJSON" + }, + { + "$ref": "#/definitions/ConsentJSON" } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false + ] }, - "HonorificPrefixJSON": { + "ProprietaryBooleanJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "HonorificPrefix" + "const": "ProprietaryBoolean" }, "@context": { "type": "string" @@ -15972,90 +16723,98 @@ export const CreateRepositoryAttributeRequest: any = { "type": "string" }, "value": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "description": { "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "HonorificSuffixJSON": { + "ValueHintsOverrideJSON": { "type": "object", + "additionalProperties": false, "properties": { "@type": { "type": "string", - "const": "HonorificSuffix" + "const": "ValueHints" }, - "@context": { + "editHelp": { "type": "string" }, - "@version": { - "type": "string" + "min": { + "type": "number" }, - "value": { + "max": { + "type": "number" + }, + "pattern": { "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "HouseNumberJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "HouseNumber" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/ValueHintsValueJSON" + } + }, + "defaultValue": { + "type": [ + "string", + "number", + "boolean" + ] + }, + "propertyHints": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ValueHintsJSON" + } }, "@context": { "type": "string" }, "@version": { "type": "string" - }, - "value": { - "type": "string" } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false + } }, - "MiddleNameJSON": { + "ValueHintsValueJSON": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "MiddleName" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "key": { + "type": [ + "string", + "number", + "boolean" + ] }, - "value": { + "displayName": { "type": "string" } }, "required": [ - "@type", - "value" + "key", + "displayName" ], "additionalProperties": false }, - "SchematizedXMLJSON": { + "ValueHintsJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "SchematizedXML" + "const": "ValueHints" }, "@context": { "type": "string" @@ -16063,25 +16822,49 @@ export const CreateRepositoryAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "editHelp": { "type": "string" }, - "schemaURL": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "pattern": { "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/ValueHintsValueJSON" + } + }, + "defaultValue": { + "type": [ + "string", + "number", + "boolean" + ] + }, + "propertyHints": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ValueHintsJSON" + } } }, "required": [ - "@type", - "value" + "@type" ], "additionalProperties": false }, - "StateJSON": { + "ProprietaryCountryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "State" + "const": "ProprietaryCountry" }, "@context": { "type": "string" @@ -16091,43 +16874,30 @@ export const CreateRepositoryAttributeRequest: any = { }, "value": { "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "StreetJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "Street" }, - "@context": { + "title": { "type": "string" }, - "@version": { + "description": { "type": "string" }, - "value": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "SurnameJSON": { + "ProprietaryEMailAddressJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Surname" + "const": "ProprietaryEMailAddress" }, "@context": { "type": "string" @@ -16137,20 +16907,30 @@ export const CreateRepositoryAttributeRequest: any = { }, "value": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "ZipCodeJSON": { + "ProprietaryFileReferenceJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ZipCode" + "const": "ProprietaryFileReference" }, "@context": { "type": "string" @@ -16159,160 +16939,31 @@ export const CreateRepositoryAttributeRequest: any = { "type": "string" }, "value": { - "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - } - } -} - -export const DeleteOwnSharedAttributeAndNotifyPeerRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteOwnSharedAttributeAndNotifyPeerRequest", - "definitions": { - "DeleteOwnSharedAttributeAndNotifyPeerRequest": { - "type": "object", - "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" - } - }, - "required": [ - "attributeId" - ], - "additionalProperties": false - }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - } - } -} - -export const DeletePeerSharedAttributeAndNotifyOwnerRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeletePeerSharedAttributeAndNotifyOwnerRequest", - "definitions": { - "DeletePeerSharedAttributeAndNotifyOwnerRequest": { - "type": "object", - "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" - } - }, - "required": [ - "attributeId" - ], - "additionalProperties": false - }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - } - } -} - -export const DeleteRepositoryAttributeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteRepositoryAttributeRequest", - "definitions": { - "DeleteRepositoryAttributeRequest": { - "type": "object", - "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" - } - }, - "required": [ - "attributeId" - ], - "additionalProperties": false - }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - } - } -} - -export const DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest", - "definitions": { - "DeleteSharedAttributesForRejectedOrRevokedRelationshipRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const DeleteThirdPartyRelationshipAttributeAndNotifyPeerRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteThirdPartyRelationshipAttributeAndNotifyPeerRequest", - "definitions": { - "DeleteThirdPartyRelationshipAttributeAndNotifyPeerRequest": { - "type": "object", - "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" - } - }, - "required": [ - "attributeId" - ], - "additionalProperties": false - }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - } - } -} - -export const ExecuteIdentityAttributeQueryRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ExecuteIdentityAttributeQueryRequest", - "definitions": { - "ExecuteIdentityAttributeQueryRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/IdentityAttributeQueryJSON" + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ - "query" + "@type", + "title", + "value" ], "additionalProperties": false }, - "IdentityAttributeQueryJSON": { + "ProprietaryFloatJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "IdentityAttributeQuery" + "const": "ProprietaryFloat" }, "@context": { "type": "string" @@ -16320,236 +16971,98 @@ export const ExecuteIdentityAttributeQueryRequest: any = { "@version": { "type": "string" }, - "valueType": { - "$ref": "#/definitions/AttributeValues.Identity.TypeName" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } + "value": { + "type": "number" }, - "validFrom": { + "title": { "type": "string" }, - "validTo": { + "description": { "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "valueType" + "title", + "value" ], "additionalProperties": false }, - "AttributeValues.Identity.TypeName": { - "anyOf": [ - { - "$ref": "#/definitions/AttributeValues.Identity.Editable.TypeName" - }, - { - "$ref": "#/definitions/AttributeValues.Identity.Uneditable.TypeName" - } - ] - }, - "AttributeValues.Identity.Editable.TypeName": { - "type": "string", - "enum": [ - "Affiliation", - "BirthDate", - "BirthName", - "BirthPlace", - "Citizenship", - "CommunicationLanguage", - "DeliveryBoxAddress", - "DisplayName", - "EMailAddress", - "FaxNumber", - "IdentityFileReference", - "SchematizedXML", - "JobTitle", - "Nationality", - "PersonName", - "PhoneNumber", - "PostOfficeBoxAddress", - "Pseudonym", - "Sex", - "StreetAddress", - "Website" - ] - }, - "AttributeValues.Identity.Uneditable.TypeName": { - "type": "string", - "enum": [ - "AffiliationOrganization", - "AffiliationRole", - "AffiliationUnit", - "BirthCity", - "BirthCountry", - "BirthDay", - "BirthMonth", - "BirthState", - "BirthYear", - "City", - "Country", - "GivenName", - "HonorificPrefix", - "HonorificSuffix", - "HouseNumber", - "MiddleName", - "SchematizedXML", - "State", - "Street", - "Surname", - "ZipCode" - ] - } - } -} - -export const ExecuteIQLQueryRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ExecuteIQLQueryRequest", - "definitions": { - "ExecuteIQLQueryRequest": { + "ProprietaryHEXColorJSON": { "type": "object", "properties": { - "query": { - "type": "object", - "additionalProperties": false, - "properties": { - "@type": { - "type": "string", - "const": "IQLQuery" - }, - "queryString": { - "type": "string" - }, - "attributeCreationHints": { - "$ref": "#/definitions/IQLQueryCreationHintsJSON" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - } - }, - "required": [ - "queryString" - ] + "@type": { + "type": "string", + "const": "ProprietaryHEXColor" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ - "query" + "@type", + "title", + "value" ], "additionalProperties": false }, - "IQLQueryCreationHintsJSON": { + "ProprietaryIntegerJSON": { "type": "object", "properties": { - "valueType": { - "$ref": "#/definitions/AttributeValues.Identity.TypeName" + "@type": { + "type": "string", + "const": "ProprietaryInteger" }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "valueType" - ], - "additionalProperties": false - }, - "AttributeValues.Identity.TypeName": { - "anyOf": [ - { - "$ref": "#/definitions/AttributeValues.Identity.Editable.TypeName" + "@context": { + "type": "string" }, - { - "$ref": "#/definitions/AttributeValues.Identity.Uneditable.TypeName" - } - ] - }, - "AttributeValues.Identity.Editable.TypeName": { - "type": "string", - "enum": [ - "Affiliation", - "BirthDate", - "BirthName", - "BirthPlace", - "Citizenship", - "CommunicationLanguage", - "DeliveryBoxAddress", - "DisplayName", - "EMailAddress", - "FaxNumber", - "IdentityFileReference", - "SchematizedXML", - "JobTitle", - "Nationality", - "PersonName", - "PhoneNumber", - "PostOfficeBoxAddress", - "Pseudonym", - "Sex", - "StreetAddress", - "Website" - ] - }, - "AttributeValues.Identity.Uneditable.TypeName": { - "type": "string", - "enum": [ - "AffiliationOrganization", - "AffiliationRole", - "AffiliationUnit", - "BirthCity", - "BirthCountry", - "BirthDay", - "BirthMonth", - "BirthState", - "BirthYear", - "City", - "Country", - "GivenName", - "HonorificPrefix", - "HonorificSuffix", - "HouseNumber", - "MiddleName", - "SchematizedXML", - "State", - "Street", - "Surname", - "ZipCode" - ] - } - } -} - -export const ExecuteRelationshipAttributeQueryRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ExecuteRelationshipAttributeQueryRequest", - "definitions": { - "ExecuteRelationshipAttributeQueryRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/RelationshipAttributeQueryJSON" + "@version": { + "type": "string" + }, + "value": { + "type": "number" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ - "query" + "@type", + "title", + "value" ], "additionalProperties": false }, - "RelationshipAttributeQueryJSON": { + "ProprietaryLanguageJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "RelationshipAttributeQuery" + "const": "ProprietaryLanguage" }, "@context": { "type": "string" @@ -16557,81 +17070,65 @@ export const ExecuteRelationshipAttributeQueryRequest: any = { "@version": { "type": "string" }, - "key": { + "value": { "type": "string" }, - "owner": { + "title": { "type": "string" }, - "attributeCreationHints": { - "$ref": "#/definitions/RelationshipAttributeCreationHintsJSON" - }, - "validFrom": { + "description": { "type": "string" }, - "validTo": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "attributeCreationHints", - "key", - "owner" + "title", + "value" ], "additionalProperties": false }, - "RelationshipAttributeCreationHintsJSON": { + "ProprietaryPhoneNumberJSON": { "type": "object", "properties": { - "title": { + "@type": { + "type": "string", + "const": "ProprietaryPhoneNumber" + }, + "@context": { "type": "string" }, - "valueType": { - "$ref": "#/definitions/AttributeValues.Relationship.TypeName" + "@version": { + "type": "string" }, - "description": { + "value": { "type": "string" }, - "valueHints": { - "$ref": "#/definitions/ValueHintsJSON" + "title": { + "type": "string" }, - "confidentiality": { - "$ref": "#/definitions/RelationshipAttributeConfidentiality" + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ + "@type", "title", - "valueType", - "confidentiality" + "value" ], "additionalProperties": false }, - "AttributeValues.Relationship.TypeName": { - "type": "string", - "enum": [ - "ProprietaryBoolean", - "ProprietaryCountry", - "ProprietaryEMailAddress", - "ProprietaryFileReference", - "ProprietaryFloat", - "ProprietaryHEXColor", - "ProprietaryInteger", - "ProprietaryLanguage", - "ProprietaryPhoneNumber", - "ProprietaryString", - "ProprietaryURL", - "ProprietaryJSON", - "ProprietaryXML", - "Consent" - ] - }, - "ValueHintsJSON": { + "ProprietaryStringJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ValueHints" + "const": "ProprietaryString" }, "@context": { "type": "string" @@ -16639,96 +17136,93 @@ export const ExecuteRelationshipAttributeQueryRequest: any = { "@version": { "type": "string" }, - "editHelp": { + "value": { "type": "string" }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - }, - "pattern": { + "title": { "type": "string" }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/ValueHintsValueJSON" - } - }, - "defaultValue": { - "type": [ - "string", - "number", - "boolean" - ] + "description": { + "type": "string" }, - "propertyHints": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ValueHintsJSON" - } + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ - "@type" + "@type", + "title", + "value" ], "additionalProperties": false }, - "ValueHintsValueJSON": { + "ProprietaryURLJSON": { "type": "object", "properties": { - "key": { - "type": [ - "string", - "number", - "boolean" - ] + "@type": { + "type": "string", + "const": "ProprietaryURL" }, - "displayName": { + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ - "key", - "displayName" + "@type", + "title", + "value" ], "additionalProperties": false }, - "RelationshipAttributeConfidentiality": { - "type": "string", - "enum": [ - "public", - "private", - "protected" - ] - } - } -} - -export const ExecuteThirdPartyRelationshipAttributeQueryRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ExecuteThirdPartyRelationshipAttributeQueryRequest", - "definitions": { - "ExecuteThirdPartyRelationshipAttributeQueryRequest": { + "ProprietaryJSONJSON": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/ThirdPartyRelationshipAttributeQueryJSON" - } + "@type": { + "type": "string", + "const": "ProprietaryJSON" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "value": {} }, "required": [ - "query" + "@type", + "title", + "value" ], "additionalProperties": false }, - "ThirdPartyRelationshipAttributeQueryJSON": { + "ProprietaryXMLJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ThirdPartyRelationshipAttributeQuery" + "const": "ProprietaryXML" }, "@context": { "type": "string" @@ -16736,1191 +17230,858 @@ export const ExecuteThirdPartyRelationshipAttributeQueryRequest: any = { "@version": { "type": "string" }, - "key": { + "value": { "type": "string" }, - "owner": { - "anyOf": [ - { - "$ref": "#/definitions/ThirdPartyRelationshipAttributeQueryOwner" - }, - { - "type": "string", - "const": "thirdParty" - }, - { - "type": "string", - "const": "recipient" - }, - { - "type": "string", - "const": "" - } - ] + "title": { + "type": "string" }, - "thirdParty": { - "type": "array", - "items": { - "type": "string" - } + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" + }, + "schemaURL": { + "type": "string" + } + }, + "required": [ + "@type", + "title", + "value" + ], + "additionalProperties": false + }, + "ConsentJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" }, - "validFrom": { + "consent": { "type": "string" }, - "validTo": { + "link": { "type": "string" } }, "required": [ "@type", - "key", - "owner", - "thirdParty" + "consent" ], "additionalProperties": false }, - "ThirdPartyRelationshipAttributeQueryOwner": { + "ISO8601DateTimeString": { "type": "string", - "enum": [ - "thirdParty", - "recipient", - "" - ] + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" } } } -export const GetAttributeRequest: any = { +export const SucceedRepositoryAttributeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttributeRequest", + "$ref": "#/definitions/SucceedRepositoryAttributeRequest", "definitions": { - "GetAttributeRequest": { + "SucceedRepositoryAttributeRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/AttributeIdString" + "predecessorId": { + "type": "string" + }, + "successorContent": { + "type": "object", + "properties": { + "value": { + "$ref": "#/definitions/AttributeValues.Identity.Json" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "validFrom": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "validTo": { + "$ref": "#/definitions/ISO8601DateTimeString" + } + }, + "required": [ + "value" + ], + "additionalProperties": false } }, "required": [ - "id" + "predecessorId", + "successorContent" ], "additionalProperties": false }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - } - } -} - -export const GetAttributesRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttributesRequest", - "definitions": { - "GetAttributesRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/GetAttributesRequestQuery" - }, - "onlyValid": { - "type": "boolean" + "AttributeValues.Identity.Json": { + "anyOf": [ + { + "$ref": "#/definitions/AttributeValues.Identity.Editable.Json" }, - "hideTechnical": { - "type": "boolean" + { + "$ref": "#/definitions/AttributeValues.Identity.Uneditable.Json" } - }, - "additionalProperties": false + ] }, - "GetAttributesRequestQuery": { - "type": "object", - "properties": { - "createdAt": { - "type": "string" + "AttributeValues.Identity.Editable.Json": { + "anyOf": [ + { + "$ref": "#/definitions/AffiliationJSON" }, - "parentId": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/BirthDateJSON" }, - "succeeds": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/BirthNameJSON" }, - "succeededBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/BirthPlaceJSON" }, - "isDefault": { - "type": "string" + { + "$ref": "#/definitions/CitizenshipJSON" }, - "content.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/CommunicationLanguageJSON" }, - "content.tags": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/DeliveryBoxAddressJSON" }, - "content.owner": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/DisplayNameJSON" }, - "content.validFrom": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/EMailAddressJSON" }, - "content.validTo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/FaxNumberJSON" }, - "content.key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + { + "$ref": "#/definitions/IdentityFileReferenceJSON" + }, + { + "$ref": "#/definitions/JobTitleJSON" + }, + { + "$ref": "#/definitions/NationalityJSON" + }, + { + "$ref": "#/definitions/PersonNameJSON" + }, + { + "$ref": "#/definitions/PhoneNumberJSON" + }, + { + "$ref": "#/definitions/PostOfficeBoxAddressJSON" + }, + { + "$ref": "#/definitions/PseudonymJSON" + }, + { + "$ref": "#/definitions/SexJSON" + }, + { + "$ref": "#/definitions/StreetAddressJSON" + }, + { + "$ref": "#/definitions/WebsiteJSON" + } + ] + }, + "AffiliationJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "Affiliation" }, - "content.isTechnical": { + "@context": { "type": "string" }, - "content.confidentiality": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "content.value.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "organization": { + "type": "string" }, - "shareInfo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "role": { + "type": "string" }, - "shareInfo.requestReference": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "unit": { + "type": "string" + } + }, + "required": [ + "@type", + "organization" + ], + "additionalProperties": false + }, + "BirthDateJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "BirthDate" }, - "shareInfo.notificationReference": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "shareInfo.peer": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "shareInfo.sourceAttribute": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "day": { + "type": "number" }, - "shareInfo.thirdPartyAddress": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "month": { + "type": "number" }, - "deletionInfo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "year": { + "type": "number" + } + }, + "required": [ + "@type", + "day", + "month", + "year" + ], + "additionalProperties": false + }, + "BirthNameJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "BirthName" }, - "deletionInfo.deletionStatus": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "deletionInfo.deletionDate": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false - } - } -} - -export const GetOwnSharedAttributesRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetOwnSharedAttributesRequest", - "definitions": { - "GetOwnSharedAttributesRequest": { + }, + "BirthPlaceJSON": { "type": "object", "properties": { - "peer": { - "$ref": "#/definitions/AddressString" + "@type": { + "type": "string", + "const": "BirthPlace" }, - "onlyValid": { - "type": "boolean" + "@context": { + "type": "string" }, - "query": { - "$ref": "#/definitions/GetOwnSharedAttributeRequestQuery" + "@version": { + "type": "string" }, - "hideTechnical": { - "type": "boolean" + "city": { + "type": "string" }, - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "country": { + "type": "string" + }, + "state": { + "type": "string" + } + }, + "required": [ + "@type", + "city", + "country" + ], + "additionalProperties": false + }, + "CitizenshipJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "Citizenship" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "peer" + "@type", + "value" ], "additionalProperties": false }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - }, - "GetOwnSharedAttributeRequestQuery": { + "CommunicationLanguageJSON": { "type": "object", "properties": { - "createdAt": { - "type": "string" - }, - "content.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.tags": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.validFrom": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@type": { + "type": "string", + "const": "CommunicationLanguage" }, - "content.validTo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "content.key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "content.isTechnical": { + "value": { "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "DeliveryBoxAddressJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "DeliveryBoxAddress" }, - "content.confidentiality": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "content.value.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "shareInfo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "recipient": { + "type": "string" }, - "shareInfo.requestReference": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "userId": { + "type": "string" }, - "shareInfo.notificationReference": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "deliveryBoxId": { + "type": "string" }, - "shareInfo.sourceAttribute": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "zipCode": { + "type": "string" }, - "shareInfo.thirdPartyAddress": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "city": { + "type": "string" }, - "deletionInfo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "country": { + "type": "string" }, - "deletionInfo.deletionStatus": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "phoneNumber": { + "type": "string" }, - "deletionInfo.deletionDate": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "state": { + "type": "string" } }, + "required": [ + "@type", + "city", + "country", + "deliveryBoxId", + "recipient", + "userId", + "zipCode" + ], "additionalProperties": false - } - } -} - -export const GetPeerSharedAttributesRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetPeerSharedAttributesRequest", - "definitions": { - "GetPeerSharedAttributesRequest": { + }, + "DisplayNameJSON": { "type": "object", "properties": { - "peer": { - "$ref": "#/definitions/AddressString" - }, - "onlyValid": { - "type": "boolean" + "@type": { + "type": "string", + "const": "DisplayName" }, - "query": { - "$ref": "#/definitions/GetPeerSharedAttributesRequestQuery" + "@context": { + "type": "string" }, - "hideTechnical": { - "type": "boolean" + "@version": { + "type": "string" }, - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "value": { + "type": "string" } }, "required": [ - "peer" + "@type", + "value" ], "additionalProperties": false }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - }, - "GetPeerSharedAttributesRequestQuery": { + "EMailAddressJSON": { "type": "object", "properties": { - "createdAt": { - "type": "string" - }, - "content.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.tags": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.validFrom": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.validTo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@type": { + "type": "string", + "const": "EMailAddress" }, - "content.isTechnical": { + "@context": { "type": "string" }, - "content.confidentiality": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "content.value.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "FaxNumberJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "FaxNumber" }, - "shareInfo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "shareInfo.requestReference": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "shareInfo.notificationReference": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "IdentityFileReferenceJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "IdentityFileReference" }, - "shareInfo.thirdPartyAddress": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "deletionInfo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "deletionInfo.deletionStatus": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "JobTitleJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "JobTitle" }, - "deletionInfo.deletionDate": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false - } - } -} - -export const GetRepositoryAttributesRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRepositoryAttributesRequest", - "definitions": { - "GetRepositoryAttributesRequest": { + }, + "NationalityJSON": { "type": "object", "properties": { - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "@type": { + "type": "string", + "const": "Nationality" }, - "query": { - "$ref": "#/definitions/GetRepositoryAttributesRequestQuery" + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false }, - "GetRepositoryAttributesRequestQuery": { + "PersonNameJSON": { "type": "object", "properties": { - "createdAt": { + "@type": { + "type": "string", + "const": "PersonName" + }, + "@context": { "type": "string" }, - "isDefault": { + "@version": { "type": "string" }, - "content.tags": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "givenName": { + "type": "string" }, - "content.validFrom": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "middleName": { + "type": "string" }, - "content.validTo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "surname": { + "type": "string" }, - "content.value.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "honorificSuffix": { + "type": "string" + }, + "honorificPrefix": { + "type": "string" } }, + "required": [ + "@type", + "givenName", + "surname" + ], "additionalProperties": false - } - } -} - -export const GetSharedVersionsOfAttributeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSharedVersionsOfAttributeRequest", - "definitions": { - "GetSharedVersionsOfAttributeRequest": { + }, + "PhoneNumberJSON": { "type": "object", "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" + "@type": { + "type": "string", + "const": "PhoneNumber" }, - "peers": { - "type": "array", - "items": { - "$ref": "#/definitions/AddressString" - } + "@context": { + "type": "string" }, - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "attributeId" + "@type", + "value" ], "additionalProperties": false }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" + "PostOfficeBoxAddressJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "PostOfficeBoxAddress" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "recipient": { + "type": "string" + }, + "boxId": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { + "type": "string" + } + }, + "required": [ + "@type", + "boxId", + "city", + "country", + "recipient", + "zipCode" + ], + "additionalProperties": false }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const GetVersionsOfAttributeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetVersionsOfAttributeRequest", - "definitions": { - "GetVersionsOfAttributeRequest": { + "PseudonymJSON": { "type": "object", "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" + "@type": { + "type": "string", + "const": "Pseudonym" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "attributeId" + "@type", + "value" ], "additionalProperties": false }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - } - } -} - -export const NotifyPeerAboutRepositoryAttributeSuccessionRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/NotifyPeerAboutRepositoryAttributeSuccessionRequest", - "definitions": { - "NotifyPeerAboutRepositoryAttributeSuccessionRequest": { + "SexJSON": { "type": "object", "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" + "@type": { + "type": "string", + "const": "Sex" }, - "peer": { - "$ref": "#/definitions/AddressString" + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "attributeId", - "peer" + "@type", + "value" ], "additionalProperties": false }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const ShareRepositoryAttributeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ShareRepositoryAttributeRequest", - "definitions": { - "ShareRepositoryAttributeRequest": { + "StreetAddressJSON": { "type": "object", "properties": { - "attributeId": { - "$ref": "#/definitions/AttributeIdString" + "@type": { + "type": "string", + "const": "StreetAddress" }, - "peer": { - "$ref": "#/definitions/AddressString" + "@context": { + "type": "string" }, - "requestMetadata": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - } - }, - "additionalProperties": false + "@version": { + "type": "string" }, - "requestItemMetadata": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "requireManualDecision": { - "type": "boolean" - } - }, - "additionalProperties": false + "recipient": { + "type": "string" + }, + "street": { + "type": "string" + }, + "houseNo": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { + "type": "string" } }, "required": [ - "attributeId", - "peer" + "@type", + "city", + "country", + "houseNo", + "recipient", + "street", + "zipCode" ], "additionalProperties": false }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - } - } -} - -export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SucceedRelationshipAttributeAndNotifyPeerRequest", - "definitions": { - "SucceedRelationshipAttributeAndNotifyPeerRequest": { + "WebsiteJSON": { "type": "object", "properties": { - "predecessorId": { - "$ref": "#/definitions/AttributeIdString" + "@type": { + "type": "string", + "const": "Website" }, - "successorContent": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/AttributeValues.Relationship.Json" - }, - "validFrom": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "validTo": { - "$ref": "#/definitions/ISO8601DateTimeString" - } - }, - "required": [ - "value" - ], - "additionalProperties": false + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "predecessorId", - "successorContent" + "@type", + "value" ], "additionalProperties": false }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - }, - "AttributeValues.Relationship.Json": { + "AttributeValues.Identity.Uneditable.Json": { "anyOf": [ { - "$ref": "#/definitions/ProprietaryBooleanJSON" + "$ref": "#/definitions/AffiliationOrganizationJSON" }, { - "$ref": "#/definitions/ProprietaryCountryJSON" + "$ref": "#/definitions/AffiliationRoleJSON" }, { - "$ref": "#/definitions/ProprietaryEMailAddressJSON" + "$ref": "#/definitions/AffiliationUnitJSON" }, { - "$ref": "#/definitions/ProprietaryFileReferenceJSON" + "$ref": "#/definitions/BirthCityJSON" }, { - "$ref": "#/definitions/ProprietaryFloatJSON" + "$ref": "#/definitions/BirthCountryJSON" }, { - "$ref": "#/definitions/ProprietaryHEXColorJSON" + "$ref": "#/definitions/BirthDayJSON" }, { - "$ref": "#/definitions/ProprietaryIntegerJSON" + "$ref": "#/definitions/BirthMonthJSON" }, { - "$ref": "#/definitions/ProprietaryLanguageJSON" + "$ref": "#/definitions/BirthStateJSON" }, { - "$ref": "#/definitions/ProprietaryPhoneNumberJSON" + "$ref": "#/definitions/BirthYearJSON" }, { - "$ref": "#/definitions/ProprietaryStringJSON" + "$ref": "#/definitions/CityJSON" }, { - "$ref": "#/definitions/ProprietaryURLJSON" + "$ref": "#/definitions/CountryJSON" }, { - "$ref": "#/definitions/ProprietaryJSONJSON" + "$ref": "#/definitions/GivenNameJSON" }, { - "$ref": "#/definitions/ProprietaryXMLJSON" + "$ref": "#/definitions/HonorificPrefixJSON" }, { - "$ref": "#/definitions/ConsentJSON" + "$ref": "#/definitions/HonorificSuffixJSON" + }, + { + "$ref": "#/definitions/HouseNumberJSON" + }, + { + "$ref": "#/definitions/MiddleNameJSON" + }, + { + "$ref": "#/definitions/SchematizedXMLJSON" + }, + { + "$ref": "#/definitions/StateJSON" + }, + { + "$ref": "#/definitions/StreetJSON" + }, + { + "$ref": "#/definitions/SurnameJSON" + }, + { + "$ref": "#/definitions/ZipCodeJSON" } ] }, - "ProprietaryBooleanJSON": { + "AffiliationOrganizationJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "AffiliationOrganization" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "AffiliationRoleJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "AffiliationRole" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "AffiliationUnitJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryBoolean" + "const": "AffiliationUnit" }, "@context": { "type": "string" @@ -17929,98 +18090,67 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "boolean" - }, - "title": { - "type": "string" - }, - "description": { "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ValueHintsOverrideJSON": { + "BirthCityJSON": { "type": "object", - "additionalProperties": false, "properties": { - "@type": { - "type": "string", - "const": "ValueHints" - }, - "editHelp": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - }, - "pattern": { + "value": { "type": "string" }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/ValueHintsValueJSON" - } - }, - "defaultValue": { - "type": [ - "string", - "number", - "boolean" - ] - }, - "propertyHints": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ValueHintsJSON" - } - }, "@context": { "type": "string" }, "@version": { "type": "string" + }, + "@type": { + "type": "string", + "const": "BirthCity" } - } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false }, - "ValueHintsValueJSON": { + "BirthCountryJSON": { "type": "object", "properties": { - "key": { - "type": [ - "string", - "number", - "boolean" - ] + "value": { + "type": "string" }, - "displayName": { + "@context": { "type": "string" + }, + "@version": { + "type": "string" + }, + "@type": { + "type": "string", + "const": "BirthCountry" } }, "required": [ - "key", - "displayName" + "@type", + "value" ], "additionalProperties": false }, - "ValueHintsJSON": { + "BirthDayJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ValueHints" + "const": "BirthDay" }, "@context": { "type": "string" @@ -18028,49 +18158,22 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, - "editHelp": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { + "value": { "type": "number" - }, - "pattern": { - "type": "string" - }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/ValueHintsValueJSON" - } - }, - "defaultValue": { - "type": [ - "string", - "number", - "boolean" - ] - }, - "propertyHints": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ValueHintsJSON" - } } }, "required": [ - "@type" + "@type", + "value" ], "additionalProperties": false }, - "ProprietaryCountryJSON": { + "BirthMonthJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryCountry" + "const": "BirthMonth" }, "@context": { "type": "string" @@ -18078,32 +18181,60 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, + "value": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "description": "Month values: 1 (january) - 12 (december)" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "BirthStateJSON": { + "type": "object", + "properties": { "value": { "type": "string" }, - "title": { + "@context": { "type": "string" }, - "description": { + "@version": { "type": "string" }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" + "@type": { + "type": "string", + "const": "BirthState" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryEMailAddressJSON": { + "BirthYearJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryEMailAddress" + "const": "BirthYear" }, "@context": { "type": "string" @@ -18112,31 +18243,21 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" + "type": "number" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryFileReferenceJSON": { + "CityJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryFileReference" + "const": "City" }, "@context": { "type": "string" @@ -18146,30 +18267,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryFloatJSON": { + "CountryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryFloat" + "const": "Country" }, "@context": { "type": "string" @@ -18178,31 +18289,21 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "number" - }, - "title": { - "type": "string" - }, - "description": { "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryHEXColorJSON": { + "GivenNameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryHEXColor" + "const": "GivenName" }, "@context": { "type": "string" @@ -18212,30 +18313,43 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "HonorificPrefixJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "HonorificPrefix" }, - "title": { + "@context": { "type": "string" }, - "description": { + "@version": { "type": "string" }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" + "value": { + "type": "string" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryIntegerJSON": { + "HonorificSuffixJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryInteger" + "const": "HonorificSuffix" }, "@context": { "type": "string" @@ -18244,31 +18358,21 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "number" - }, - "title": { "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryLanguageJSON": { + "HouseNumberJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryLanguage" + "const": "HouseNumber" }, "@context": { "type": "string" @@ -18278,30 +18382,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryPhoneNumberJSON": { + "MiddleNameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryPhoneNumber" + "const": "MiddleName" }, "@context": { "type": "string" @@ -18311,30 +18405,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryStringJSON": { + "SchematizedXMLJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryString" + "const": "SchematizedXML" }, "@context": { "type": "string" @@ -18345,29 +18429,22 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "value": { "type": "string" }, - "title": { - "type": "string" - }, - "description": { + "schemaURL": { "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryURLJSON": { + "StateJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryURL" + "const": "State" }, "@context": { "type": "string" @@ -18377,30 +18454,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryJSONJSON": { + "StreetJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryJSON" + "const": "Street" }, "@context": { "type": "string" @@ -18408,27 +18475,22 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, - "title": { - "type": "string" - }, - "description": { + "value": { "type": "string" - }, - "value": {} + } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryXMLJSON": { + "SurnameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryXML" + "const": "Surname" }, "@context": { "type": "string" @@ -18438,32 +18500,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" - }, - "schemaURL": { - "type": "string" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ConsentJSON": { + "ZipCodeJSON": { "type": "object", "properties": { "@type": { - "type": "string" + "type": "string", + "const": "ZipCode" }, "@context": { "type": "string" @@ -18471,16 +18521,13 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, - "consent": { - "type": "string" - }, - "link": { + "value": { "type": "string" } }, "required": [ "@type", - "consent" + "value" ], "additionalProperties": false }, @@ -18492,1436 +18539,1698 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { } } -export const SucceedRepositoryAttributeRequest: any = { +export const ValidateIQLQueryRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SucceedRepositoryAttributeRequest", + "$ref": "#/definitions/ValidateIQLQueryRequest", "definitions": { - "SucceedRepositoryAttributeRequest": { + "ValidateIQLQueryRequest": { "type": "object", "properties": { - "predecessorId": { + "query": { + "$ref": "#/definitions/IQLQueryJSON" + } + }, + "required": [ + "query" + ], + "additionalProperties": false + }, + "IQLQueryJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "IQLQuery" + }, + "@context": { "type": "string" }, - "successorContent": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/AttributeValues.Identity.Json" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "validFrom": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "validTo": { - "$ref": "#/definitions/ISO8601DateTimeString" - } - }, - "required": [ - "value" - ], - "additionalProperties": false + "@version": { + "type": "string" + }, + "queryString": { + "type": "string" + }, + "attributeCreationHints": { + "$ref": "#/definitions/IQLQueryCreationHintsJSON" } }, "required": [ - "predecessorId", - "successorContent" + "@type", + "queryString" ], "additionalProperties": false }, - "AttributeValues.Identity.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AttributeValues.Identity.Editable.Json" + "IQLQueryCreationHintsJSON": { + "type": "object", + "properties": { + "valueType": { + "$ref": "#/definitions/AttributeValues.Identity.TypeName" }, - { - "$ref": "#/definitions/AttributeValues.Identity.Uneditable.Json" + "tags": { + "type": "array", + "items": { + "type": "string" + } } - ] + }, + "required": [ + "valueType" + ], + "additionalProperties": false }, - "AttributeValues.Identity.Editable.Json": { + "AttributeValues.Identity.TypeName": { "anyOf": [ { - "$ref": "#/definitions/AffiliationJSON" - }, - { - "$ref": "#/definitions/BirthDateJSON" - }, - { - "$ref": "#/definitions/BirthNameJSON" - }, - { - "$ref": "#/definitions/BirthPlaceJSON" - }, - { - "$ref": "#/definitions/CitizenshipJSON" - }, - { - "$ref": "#/definitions/CommunicationLanguageJSON" - }, - { - "$ref": "#/definitions/DeliveryBoxAddressJSON" - }, - { - "$ref": "#/definitions/DisplayNameJSON" - }, - { - "$ref": "#/definitions/EMailAddressJSON" - }, - { - "$ref": "#/definitions/FaxNumberJSON" - }, - { - "$ref": "#/definitions/IdentityFileReferenceJSON" - }, - { - "$ref": "#/definitions/JobTitleJSON" - }, - { - "$ref": "#/definitions/NationalityJSON" - }, - { - "$ref": "#/definitions/PersonNameJSON" - }, - { - "$ref": "#/definitions/PhoneNumberJSON" - }, - { - "$ref": "#/definitions/PostOfficeBoxAddressJSON" - }, - { - "$ref": "#/definitions/PseudonymJSON" - }, - { - "$ref": "#/definitions/SexJSON" - }, - { - "$ref": "#/definitions/StreetAddressJSON" + "$ref": "#/definitions/AttributeValues.Identity.Editable.TypeName" }, { - "$ref": "#/definitions/WebsiteJSON" + "$ref": "#/definitions/AttributeValues.Identity.Uneditable.TypeName" } ] }, - "AffiliationJSON": { + "AttributeValues.Identity.Editable.TypeName": { + "type": "string", + "enum": [ + "Affiliation", + "BirthDate", + "BirthName", + "BirthPlace", + "Citizenship", + "CommunicationLanguage", + "DeliveryBoxAddress", + "DisplayName", + "EMailAddress", + "FaxNumber", + "IdentityFileReference", + "SchematizedXML", + "JobTitle", + "Nationality", + "PersonName", + "PhoneNumber", + "PostOfficeBoxAddress", + "Pseudonym", + "Sex", + "StreetAddress", + "Website" + ] + }, + "AttributeValues.Identity.Uneditable.TypeName": { + "type": "string", + "enum": [ + "AffiliationOrganization", + "AffiliationRole", + "AffiliationUnit", + "BirthCity", + "BirthCountry", + "BirthDay", + "BirthMonth", + "BirthState", + "BirthYear", + "City", + "Country", + "GivenName", + "HonorificPrefix", + "HonorificSuffix", + "HouseNumber", + "MiddleName", + "SchematizedXML", + "State", + "Street", + "Surname", + "ZipCode" + ] + } + } +} + +export const CreateDraftRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateDraftRequest", + "definitions": { + "CreateDraftRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Affiliation" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "organization": { - "type": "string" - }, - "role": { - "type": "string" - }, - "unit": { + "content": {}, + "type": { "type": "string" } }, "required": [ - "@type", - "organization" + "content" ], "additionalProperties": false - }, - "BirthDateJSON": { + } + } +} + +export const DeleteDraftRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteDraftRequest", + "definitions": { + "DeleteDraftRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthDate" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "day": { - "type": "number" - }, - "month": { - "type": "number" - }, - "year": { - "type": "number" + "id": { + "$ref": "#/definitions/LocalDraftIdString" } }, "required": [ - "@type", - "day", - "month", - "year" + "id" ], "additionalProperties": false }, - "BirthNameJSON": { + "LocalDraftIdString": { + "type": "string", + "pattern": "LCLDRF[A-Za-z0-9]{14}" + } + } +} + +export const GetDraftRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetDraftRequest", + "definitions": { + "GetDraftRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthName" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "id": { + "$ref": "#/definitions/LocalDraftIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "BirthPlaceJSON": { + "LocalDraftIdString": { + "type": "string", + "pattern": "LCLDRF[A-Za-z0-9]{14}" + } + } +} + +export const GetDraftsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetDraftsRequest", + "definitions": { + "GetDraftsRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthPlace" - }, - "@context": { - "type": "string" + "query": { + "$ref": "#/definitions/GetDraftsQuery" + } + }, + "additionalProperties": false + }, + "GetDraftsQuery": { + "type": "object", + "properties": { + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@version": { - "type": "string" + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "city": { - "type": "string" + "lastModifiedAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "additionalProperties": false + } + } +} + +export const UpdateDraftRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateDraftRequest", + "definitions": { + "UpdateDraftRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/LocalDraftIdString" }, - "country": { - "type": "string" + "content": {} + }, + "required": [ + "id", + "content" + ], + "additionalProperties": false + }, + "LocalDraftIdString": { + "type": "string", + "pattern": "LCLDRF[A-Za-z0-9]{14}" + } + } +} + +export const DeleteIdentityMetadataRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteIdentityMetadataRequest", + "definitions": { + "DeleteIdentityMetadataRequest": { + "type": "object", + "properties": { + "reference": { + "$ref": "#/definitions/AddressString" }, - "state": { + "key": { "type": "string" } }, "required": [ - "@type", - "city", - "country" + "reference" ], "additionalProperties": false }, - "CitizenshipJSON": { + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + } + } +} + +export const GetIdentityMetadataRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetIdentityMetadataRequest", + "definitions": { + "GetIdentityMetadataRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Citizenship" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "reference": { + "$ref": "#/definitions/AddressString" }, - "value": { + "key": { "type": "string" } }, "required": [ - "@type", - "value" + "reference" ], "additionalProperties": false }, - "CommunicationLanguageJSON": { + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + } + } +} + +export const UpsertIdentityMetadataRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpsertIdentityMetadataRequest", + "definitions": { + "UpsertIdentityMetadataRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "CommunicationLanguage" - }, - "@context": { - "type": "string" + "reference": { + "$ref": "#/definitions/AddressString" }, - "@version": { + "key": { "type": "string" }, - "value": { - "type": "string" - } + "value": {} }, "required": [ - "@type", + "reference", "value" ], "additionalProperties": false }, - "DeliveryBoxAddressJSON": { + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + } + } +} + +export const GetNotificationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetNotificationRequest", + "definitions": { + "GetNotificationRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "DeliveryBoxAddress" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "recipient": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "deliveryBoxId": { - "type": "string" - }, - "zipCode": { - "type": "string" - }, - "city": { - "type": "string" - }, - "country": { - "type": "string" - }, - "phoneNumber": { - "type": "string" - }, - "state": { - "type": "string" + "id": { + "$ref": "#/definitions/NotificationIdString" } }, "required": [ - "@type", - "city", - "country", - "deliveryBoxId", - "recipient", - "userId", - "zipCode" + "id" ], "additionalProperties": false }, - "DisplayNameJSON": { + "NotificationIdString": { + "type": "string", + "pattern": "NOT[A-Za-z0-9]{17}" + } + } +} + +export const GetNotificationsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetNotificationsRequest", + "definitions": { + "GetNotificationsRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "DisplayName" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "query": { + "$ref": "#/definitions/GetNotificationsRequestQuery" } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false }, - "EMailAddressJSON": { + "GetNotificationsRequestQuery": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + } +} + +export const ProcessNotificationByIdRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ProcessNotificationByIdRequest", + "definitions": { + "ProcessNotificationByIdRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "EMailAddress" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "notificationId": { + "$ref": "#/definitions/NotificationIdString" } }, "required": [ - "@type", - "value" + "notificationId" ], "additionalProperties": false }, - "FaxNumberJSON": { + "NotificationIdString": { + "type": "string", + "pattern": "NOT[A-Za-z0-9]{17}" + } + } +} + +export const ReceivedNotificationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ReceivedNotificationRequest", + "definitions": { + "ReceivedNotificationRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "FaxNumber" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "messageId": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "@type", - "value" + "messageId" ], "additionalProperties": false }, - "IdentityFileReferenceJSON": { + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + } + } +} + +export const SentNotificationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/SentNotificationRequest", + "definitions": { + "SentNotificationRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "IdentityFileReference" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "messageId": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "@type", - "value" + "messageId" ], "additionalProperties": false }, - "JobTitleJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "JobTitle" - }, - "@context": { + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + } + } +} + +export const CreateSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateSettingRequest", + "definitions": { + "CreateSettingRequest": { + "type": "object", + "properties": { + "key": { "type": "string" }, - "@version": { - "type": "string" + "value": {}, + "reference": { + "$ref": "#/definitions/GenericIdString" }, - "value": { - "type": "string" + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] + }, + "succeedsAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "succeedsItem": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "@type", + "key", "value" ], "additionalProperties": false }, - "NationalityJSON": { + "GenericIdString": { + "type": "string", + "pattern": "[A-Za-z0-9]{20}" + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "LocalSettingIdString": { + "type": "string", + "pattern": "LCLSET[A-Za-z0-9]{14}" + } + } +} + +export const DeleteSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteSettingRequest", + "definitions": { + "DeleteSettingRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Nationality" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "id": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "PersonNameJSON": { + "LocalSettingIdString": { + "type": "string", + "pattern": "LCLSET[A-Za-z0-9]{14}" + } + } +} + +export const GetSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetSettingRequest", + "definitions": { + "GetSettingRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "PersonName" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "givenName": { - "type": "string" - }, - "middleName": { - "type": "string" - }, - "surname": { - "type": "string" - }, - "honorificSuffix": { - "type": "string" - }, - "honorificPrefix": { - "type": "string" + "id": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "@type", - "givenName", - "surname" + "id" ], "additionalProperties": false }, - "PhoneNumberJSON": { + "LocalSettingIdString": { + "type": "string", + "pattern": "LCLSET[A-Za-z0-9]{14}" + } + } +} + +export const GetSettingByKeyRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetSettingByKeyRequest", + "definitions": { + "GetSettingByKeyRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "PhoneNumber" - }, - "@context": { + "key": { "type": "string" }, - "@version": { + "reference": { "type": "string" }, - "value": { - "type": "string" + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] } }, "required": [ - "@type", - "value" + "key" ], "additionalProperties": false - }, - "PostOfficeBoxAddressJSON": { + } + } +} + +export const GetSettingsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetSettingsRequest", + "definitions": { + "GetSettingsRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "PostOfficeBoxAddress" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "recipient": { - "type": "string" - }, - "boxId": { - "type": "string" - }, - "zipCode": { - "type": "string" - }, - "city": { - "type": "string" - }, - "country": { - "type": "string" - }, - "state": { - "type": "string" + "query": { + "$ref": "#/definitions/GetSettingsQuery" } }, - "required": [ - "@type", - "boxId", - "city", - "country", - "recipient", - "zipCode" - ], "additionalProperties": false }, - "PseudonymJSON": { + "GetSettingsQuery": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Pseudonym" + "key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@context": { - "type": "string" + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "@version": { - "type": "string" + "reference": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "succeedsItem": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "value": { - "type": "string" + "succeedsAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false - }, - "SexJSON": { + } + } +} + +export const UpdateSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateSettingRequest", + "definitions": { + "UpdateSettingRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Sex" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "id": { + "$ref": "#/definitions/LocalSettingIdString" }, - "value": { - "type": "string" - } + "value": {} }, "required": [ - "@type", + "id", "value" ], "additionalProperties": false }, - "StreetAddressJSON": { + "LocalSettingIdString": { + "type": "string", + "pattern": "LCLSET[A-Za-z0-9]{14}" + } + } +} + +export const UpsertSettingByKeyRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpsertSettingByKeyRequest", + "definitions": { + "UpsertSettingByKeyRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "StreetAddress" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "recipient": { - "type": "string" - }, - "street": { - "type": "string" - }, - "houseNo": { - "type": "string" - }, - "zipCode": { - "type": "string" - }, - "city": { + "key": { "type": "string" }, - "country": { - "type": "string" + "value": {}, + "reference": { + "$ref": "#/definitions/GenericIdString" }, - "state": { - "type": "string" - } - }, - "required": [ - "@type", - "city", - "country", - "houseNo", - "recipient", - "street", - "zipCode" - ], - "additionalProperties": false - }, - "WebsiteJSON": { - "type": "object", - "properties": { - "@type": { + "scope": { "type": "string", - "const": "Website" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "enum": [ + "Identity", + "Device", + "Relationship" + ] } }, "required": [ - "@type", + "key", "value" ], "additionalProperties": false }, - "AttributeValues.Identity.Uneditable.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AffiliationOrganizationJSON" - }, - { - "$ref": "#/definitions/AffiliationRoleJSON" - }, - { - "$ref": "#/definitions/AffiliationUnitJSON" - }, - { - "$ref": "#/definitions/BirthCityJSON" - }, - { - "$ref": "#/definitions/BirthCountryJSON" - }, - { - "$ref": "#/definitions/BirthDayJSON" - }, - { - "$ref": "#/definitions/BirthMonthJSON" - }, - { - "$ref": "#/definitions/BirthStateJSON" - }, - { - "$ref": "#/definitions/BirthYearJSON" - }, - { - "$ref": "#/definitions/CityJSON" - }, - { - "$ref": "#/definitions/CountryJSON" - }, - { - "$ref": "#/definitions/GivenNameJSON" - }, - { - "$ref": "#/definitions/HonorificPrefixJSON" - }, - { - "$ref": "#/definitions/HonorificSuffixJSON" - }, - { - "$ref": "#/definitions/HouseNumberJSON" - }, - { - "$ref": "#/definitions/MiddleNameJSON" - }, - { - "$ref": "#/definitions/SchematizedXMLJSON" - }, - { - "$ref": "#/definitions/StateJSON" - }, - { - "$ref": "#/definitions/StreetJSON" - }, - { - "$ref": "#/definitions/SurnameJSON" - }, - { - "$ref": "#/definitions/ZipCodeJSON" - } - ] - }, - "AffiliationOrganizationJSON": { + "GenericIdString": { + "type": "string", + "pattern": "[A-Za-z0-9]{20}" + } + } +} + +export const DownloadFileRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DownloadFileRequest", + "definitions": { + "DownloadFileRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "AffiliationOrganization" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "id": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "AffiliationRoleJSON": { + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const LoadItemFromTruncatedReferenceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/LoadItemFromTruncatedReferenceRequest", + "definitions": { + "LoadItemFromTruncatedReferenceRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "AffiliationRole" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "reference": { + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" + }, + { + "$ref": "#/definitions/FileReferenceString" + }, + { + "$ref": "#/definitions/RelationshipTemplateReferenceString" + } + ] }, - "value": { + "password": { "type": "string" } }, "required": [ - "@type", - "value" + "reference" ], "additionalProperties": false }, - "AffiliationUnitJSON": { + "TokenReferenceString": { + "type": "string", + "pattern": "VE9L.{84}" + }, + "FileReferenceString": { + "type": "string", + "pattern": "RklM.{84}" + }, + "RelationshipTemplateReferenceString": { + "type": "string", + "pattern": "UkxU.{84}" + } + } +} + +export const RegisterPushNotificationTokenRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RegisterPushNotificationTokenRequest", + "definitions": { + "RegisterPushNotificationTokenRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "AffiliationUnit" - }, - "@context": { + "handle": { "type": "string" }, - "@version": { + "platform": { "type": "string" }, - "value": { + "appId": { "type": "string" + }, + "environment": { + "type": "string", + "enum": [ + "Development", + "Production" + ] } }, "required": [ - "@type", - "value" + "handle", + "platform", + "appId" ], "additionalProperties": false - }, - "BirthCityJSON": { + } + } +} + +export const GetIdentityDeletionProcessRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetIdentityDeletionProcessRequest", + "definitions": { + "GetIdentityDeletionProcessRequest": { "type": "object", "properties": { - "value": { - "type": "string" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "@type": { - "type": "string", - "const": "BirthCity" + "id": { + "$ref": "#/definitions/IdentityDeletionProcessIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "BirthCountryJSON": { + "IdentityDeletionProcessIdString": { + "type": "string", + "pattern": "IDP[A-Za-z0-9]{17}" + } + } +} + +export const InitiateIdentityDeletionProcessRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/InitiateIdentityDeletionProcessRequest", + "definitions": { + "InitiateIdentityDeletionProcessRequest": { "type": "object", "properties": { - "value": { - "type": "string" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "@type": { - "type": "string", - "const": "BirthCountry" + "lengthOfGracePeriodInDays": { + "type": "number" } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false - }, - "BirthDayJSON": { + } + } +} + +export const DownloadAttachmentRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DownloadAttachmentRequest", + "definitions": { + "DownloadAttachmentRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "BirthDay" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "id": { + "$ref": "#/definitions/MessageIdString" }, - "value": { - "type": "number" + "attachmentId": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "@type", - "value" + "id", + "attachmentId" ], "additionalProperties": false }, - "BirthMonthJSON": { + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const CreateRelationshipChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateRelationshipChallengeRequest", + "definitions": { + "CreateRelationshipChallengeRequest": { "type": "object", "properties": { - "@type": { + "challengeType": { "type": "string", - "const": "BirthMonth" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "const": "Relationship" }, - "value": { - "type": "number", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12 - ], - "description": "Month values: 1 (january) - 12 (december)" + "relationship": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "@type", - "value" + "challengeType", + "relationship" ], "additionalProperties": false }, - "BirthStateJSON": { + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const isCreateRelationshipChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/isCreateRelationshipChallengeRequest", + "definitions": { + "isCreateRelationshipChallengeRequest": { + "$comment": "(value: any) => value is CreateRelationshipChallengeRequest", "type": "object", "properties": { - "value": { - "type": "string" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "@type": { + "namedArgs": { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false + } + } + } + } +} + +export const CreateIdentityChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateIdentityChallengeRequest", + "definitions": { + "CreateIdentityChallengeRequest": { + "type": "object", + "properties": { + "challengeType": { "type": "string", - "const": "BirthState" + "const": "Identity" + } + }, + "required": [ + "challengeType" + ], + "additionalProperties": false + } + } +} + +export const isCreateIdentityChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/isCreateIdentityChallengeRequest", + "definitions": { + "isCreateIdentityChallengeRequest": { + "$comment": "(value: any) => value is CreateIdentityChallengeRequest", + "type": "object", + "properties": { + "namedArgs": { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "BirthYearJSON": { + } + } + } +} + +export const CreateDeviceChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateDeviceChallengeRequest", + "definitions": { + "CreateDeviceChallengeRequest": { "type": "object", "properties": { - "@type": { + "challengeType": { "type": "string", - "const": "BirthYear" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "number" + "const": "Device" } }, "required": [ - "@type", - "value" + "challengeType" ], "additionalProperties": false - }, - "CityJSON": { + } + } +} + +export const isCreateDeviceChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/isCreateDeviceChallengeRequest", + "definitions": { + "isCreateDeviceChallengeRequest": { + "$comment": "(value: any) => value is CreateDeviceChallengeRequest", "type": "object", "properties": { - "@type": { - "type": "string", - "const": "City" - }, - "@context": { - "type": "string" + "namedArgs": { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false + } + } + } + } +} + +export const CreateChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateChallengeRequest", + "definitions": { + "CreateChallengeRequest": { + "anyOf": [ + { + "$ref": "#/definitions/CreateRelationshipChallengeRequest" }, - "@version": { - "type": "string" + { + "$ref": "#/definitions/CreateIdentityChallengeRequest" }, - "value": { - "type": "string" + { + "$ref": "#/definitions/CreateDeviceChallengeRequest" } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false + ] }, - "CountryJSON": { + "CreateRelationshipChallengeRequest": { "type": "object", "properties": { - "@type": { + "challengeType": { "type": "string", - "const": "Country" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "const": "Relationship" }, - "value": { - "type": "string" + "relationship": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "@type", - "value" + "challengeType", + "relationship" ], "additionalProperties": false }, - "GivenNameJSON": { + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + }, + "CreateIdentityChallengeRequest": { "type": "object", "properties": { - "@type": { + "challengeType": { "type": "string", - "const": "GivenName" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "const": "Identity" } }, "required": [ - "@type", - "value" + "challengeType" ], "additionalProperties": false }, - "HonorificPrefixJSON": { + "CreateDeviceChallengeRequest": { "type": "object", "properties": { - "@type": { + "challengeType": { "type": "string", - "const": "HonorificPrefix" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "const": "Device" } }, "required": [ - "@type", - "value" + "challengeType" ], "additionalProperties": false - }, - "HonorificSuffixJSON": { + } + } +} + +export const ValidateChallengeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ValidateChallengeRequest", + "definitions": { + "ValidateChallengeRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "HonorificSuffix" - }, - "@context": { - "type": "string" - }, - "@version": { + "challengeString": { "type": "string" }, - "value": { + "signature": { "type": "string" } }, "required": [ - "@type", - "value" + "challengeString", + "signature" ], "additionalProperties": false - }, - "HouseNumberJSON": { + } + } +} + +export const CreateDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateDeviceRequest", + "definitions": { + "CreateDeviceRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "HouseNumber" - }, - "@context": { + "name": { "type": "string" }, - "@version": { + "description": { "type": "string" }, - "value": { - "type": "string" + "isAdmin": { + "type": "boolean" } }, - "required": [ - "@type", - "value" - ], "additionalProperties": false - }, - "MiddleNameJSON": { + } + } +} + +export const CreateDeviceOnboardingTokenRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateDeviceOnboardingTokenRequest", + "definitions": { + "CreateDeviceOnboardingTokenRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "MiddleName" + "id": { + "$ref": "#/definitions/DeviceIdString" }, - "@context": { - "type": "string" + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" }, - "@version": { + "profileName": { "type": "string" }, - "value": { - "type": "string" + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, - "required": [ - "@type", - "value" + "required": [ + "id" ], "additionalProperties": false }, - "SchematizedXMLJSON": { + "DeviceIdString": { + "type": "string", + "pattern": "DVC[A-Za-z0-9]{17}" + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } + } +} + +export const DeleteDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DeleteDeviceRequest", + "definitions": { + "DeleteDeviceRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "SchematizedXML" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" - }, - "schemaURL": { - "type": "string" + "id": { + "$ref": "#/definitions/DeviceIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "StateJSON": { + "DeviceIdString": { + "type": "string", + "pattern": "DVC[A-Za-z0-9]{17}" + } + } +} + +export const GetDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetDeviceRequest", + "definitions": { + "GetDeviceRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "State" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "id": { + "$ref": "#/definitions/DeviceIdString" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "StreetJSON": { + "DeviceIdString": { + "type": "string", + "pattern": "DVC[A-Za-z0-9]{17}" + } + } +} + +export const GetDeviceOnboardingInfoRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetDeviceOnboardingInfoRequest", + "definitions": { + "GetDeviceOnboardingInfoRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Street" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" + "id": { + "$ref": "#/definitions/GenericIdString" }, - "value": { + "profileName": { "type": "string" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "SurnameJSON": { + "GenericIdString": { + "type": "string", + "pattern": "[A-Za-z0-9]{20}" + } + } +} + +export const SetCommunicationLanguageRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/SetCommunicationLanguageRequest", + "definitions": { + "SetCommunicationLanguageRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "Surname" - }, - "@context": { - "type": "string" - }, - "@version": { - "type": "string" - }, - "value": { - "type": "string" + "communicationLanguage": { + "$ref": "#/definitions/LanguageISO639" } }, "required": [ - "@type", - "value" + "communicationLanguage" ], "additionalProperties": false }, - "ZipCodeJSON": { + "LanguageISO639": { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu" + ] + } + } +} + +export const UpdateDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateDeviceRequest", + "definitions": { + "UpdateDeviceRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "ZipCode" - }, - "@context": { - "type": "string" + "id": { + "$ref": "#/definitions/DeviceIdString" }, - "@version": { + "name": { "type": "string" }, - "value": { + "description": { "type": "string" } }, "required": [ - "@type", - "value" + "id" ], "additionalProperties": false }, - "ISO8601DateTimeString": { + "DeviceIdString": { "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + "pattern": "DVC[A-Za-z0-9]{17}" } } } -export const ValidateIQLQueryRequest: any = { +export const CreateQRCodeForFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ValidateIQLQueryRequest", + "$ref": "#/definitions/CreateQRCodeForFileRequest", "definitions": { - "ValidateIQLQueryRequest": { + "CreateQRCodeForFileRequest": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/IQLQueryJSON" + "fileId": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "query" + "fileId" ], "additionalProperties": false }, - "IQLQueryJSON": { + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const CreateTokenForFileRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateTokenForFileRequest", + "definitions": { + "CreateTokenForFileRequest": { "type": "object", "properties": { - "@type": { - "type": "string", - "const": "IQLQuery" - }, - "@context": { - "type": "string" + "fileId": { + "$ref": "#/definitions/FileIdString" }, - "@version": { - "type": "string" + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" }, - "queryString": { - "type": "string" + "ephemeral": { + "type": "boolean" }, - "attributeCreationHints": { - "$ref": "#/definitions/IQLQueryCreationHintsJSON" - } - }, - "required": [ - "@type", - "queryString" - ], - "additionalProperties": false - }, - "IQLQueryCreationHintsJSON": { - "type": "object", - "properties": { - "valueType": { - "$ref": "#/definitions/AttributeValues.Identity.TypeName" + "forIdentity": { + "$ref": "#/definitions/AddressString" }, - "tags": { - "type": "array", - "items": { - "type": "string" - } + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "valueType" + "fileId" ], "additionalProperties": false }, - "AttributeValues.Identity.TypeName": { - "anyOf": [ - { - "$ref": "#/definitions/AttributeValues.Identity.Editable.TypeName" - }, - { - "$ref": "#/definitions/AttributeValues.Identity.Uneditable.TypeName" - } - ] - }, - "AttributeValues.Identity.Editable.TypeName": { + "FileIdString": { "type": "string", - "enum": [ - "Affiliation", - "BirthDate", - "BirthName", - "BirthPlace", - "Citizenship", - "CommunicationLanguage", - "DeliveryBoxAddress", - "DisplayName", - "EMailAddress", - "FaxNumber", - "IdentityFileReference", - "SchematizedXML", - "JobTitle", - "Nationality", - "PersonName", - "PhoneNumber", - "PostOfficeBoxAddress", - "Pseudonym", - "Sex", - "StreetAddress", - "Website" - ] + "pattern": "FIL[A-Za-z0-9]{17}" }, - "AttributeValues.Identity.Uneditable.TypeName": { + "ISO8601DateTimeString": { "type": "string", - "enum": [ - "AffiliationOrganization", - "AffiliationRole", - "AffiliationUnit", - "BirthCity", - "BirthCountry", - "BirthDay", - "BirthMonth", - "BirthState", - "BirthYear", - "City", - "Country", - "GivenName", - "HonorificPrefix", - "HonorificSuffix", - "HouseNumber", - "MiddleName", - "SchematizedXML", - "State", - "Street", - "Surname", - "ZipCode" - ] - } - } -} - -export const CreateDraftRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDraftRequest", - "definitions": { - "CreateDraftRequest": { - "type": "object", - "properties": { - "content": {}, - "type": { - "type": "string" - } - }, - "required": [ - "content" - ], - "additionalProperties": false + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const DeleteDraftRequest: any = { +export const CreateTokenQRCodeForFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteDraftRequest", + "$ref": "#/definitions/CreateTokenQRCodeForFileRequest", "definitions": { - "DeleteDraftRequest": { + "CreateTokenQRCodeForFileRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/LocalDraftIdString" + "fileId": { + "$ref": "#/definitions/FileIdString" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "id" + "fileId" ], "additionalProperties": false }, - "LocalDraftIdString": { + "FileIdString": { "type": "string", - "pattern": "LCLDRF[A-Za-z0-9]{14}" + "pattern": "FIL[A-Za-z0-9]{17}" + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetDraftRequest: any = { +export const GetFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetDraftRequest", + "$ref": "#/definitions/GetFileRequest", "definitions": { - "GetDraftRequest": { + "GetFileRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/LocalDraftIdString" + "$ref": "#/definitions/FileIdString" } }, "required": [ @@ -19929,30 +20238,33 @@ export const GetDraftRequest: any = { ], "additionalProperties": false }, - "LocalDraftIdString": { + "FileIdString": { "type": "string", - "pattern": "LCLDRF[A-Za-z0-9]{14}" + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetDraftsRequest: any = { +export const GetFilesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetDraftsRequest", + "$ref": "#/definitions/GetFilesRequest", "definitions": { - "GetDraftsRequest": { + "GetFilesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetDraftsQuery" + "$ref": "#/definitions/GetFilesQuery" + }, + "ownerRestriction": { + "$ref": "#/definitions/OwnerRestriction" } }, "additionalProperties": false }, - "GetDraftsQuery": { + "GetFilesQuery": { "type": "object", "properties": { - "type": { + "createdAt": { "anyOf": [ { "type": "string" @@ -19965,7 +20277,7 @@ export const GetDraftsRequest: any = { } ] }, - "createdAt": { + "createdBy": { "anyOf": [ { "type": "string" @@ -19978,7 +20290,7 @@ export const GetDraftsRequest: any = { } ] }, - "lastModifiedAt": { + "createdByDevice": { "anyOf": [ { "type": "string" @@ -19990,386 +20302,375 @@ export const GetDraftsRequest: any = { } } ] - } - }, - "additionalProperties": false - } - } -} - -export const UpdateDraftRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateDraftRequest", - "definitions": { - "UpdateDraftRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/LocalDraftIdString" }, - "content": {} - }, - "required": [ - "id", - "content" - ], - "additionalProperties": false - }, - "LocalDraftIdString": { - "type": "string", - "pattern": "LCLDRF[A-Za-z0-9]{14}" - } - } -} - -export const DeleteIdentityMetadataRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteIdentityMetadataRequest", - "definitions": { - "DeleteIdentityMetadataRequest": { - "type": "object", - "properties": { - "reference": { - "$ref": "#/definitions/AddressString" + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "key": { - "type": "string" - } - }, - "required": [ - "reference" - ], - "additionalProperties": false - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const GetIdentityMetadataRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetIdentityMetadataRequest", - "definitions": { - "GetIdentityMetadataRequest": { - "type": "object", - "properties": { - "reference": { - "$ref": "#/definitions/AddressString" + "expiresAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "key": { - "type": "string" - } - }, - "required": [ - "reference" - ], - "additionalProperties": false - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const UpsertIdentityMetadataRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpsertIdentityMetadataRequest", - "definitions": { - "UpsertIdentityMetadataRequest": { - "type": "object", - "properties": { - "reference": { - "$ref": "#/definitions/AddressString" + "filename": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "key": { - "type": "string" + "filesize": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "value": {} - }, - "required": [ - "reference", - "value" - ], - "additionalProperties": false - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const GetNotificationRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetNotificationRequest", - "definitions": { - "GetNotificationRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/NotificationIdString" + "mimetype": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "isOwn": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] } }, - "required": [ - "id" - ], "additionalProperties": false }, - "NotificationIdString": { + "OwnerRestriction": { "type": "string", - "pattern": "NOT[A-Za-z0-9]{17}" + "enum": [ + "o", + "p" + ] } } } -export const GetNotificationsRequest: any = { +export const GetOrLoadFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetNotificationsRequest", + "$ref": "#/definitions/GetOrLoadFileRequest", "definitions": { - "GetNotificationsRequest": { + "GetOrLoadFileRequest": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/GetNotificationsRequestQuery" - } - }, - "additionalProperties": false - }, - "GetNotificationsRequestQuery": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" + "reference": { + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" + }, + { + "$ref": "#/definitions/FileReferenceString" } - } - ] - } - } - } -} - -export const ProcessNotificationByIdRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ProcessNotificationByIdRequest", - "definitions": { - "ProcessNotificationByIdRequest": { - "type": "object", - "properties": { - "notificationId": { - "$ref": "#/definitions/NotificationIdString" + ] + }, + "password": { + "type": "string" } }, "required": [ - "notificationId" + "reference" ], - "additionalProperties": false + "additionalProperties": false, + "errorMessage": "token / file reference invalid" }, - "NotificationIdString": { + "TokenReferenceString": { "type": "string", - "pattern": "NOT[A-Za-z0-9]{17}" - } - } -} - -export const ReceivedNotificationRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ReceivedNotificationRequest", - "definitions": { - "ReceivedNotificationRequest": { - "type": "object", - "properties": { - "messageId": { - "$ref": "#/definitions/MessageIdString" - } - }, - "required": [ - "messageId" - ], - "additionalProperties": false + "pattern": "VE9L.{84}" }, - "MessageIdString": { + "FileReferenceString": { "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" + "pattern": "RklM.{84}" } } } -export const SentNotificationRequest: any = { +export const UploadOwnFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SentNotificationRequest", + "$ref": "#/definitions/UploadOwnFileRequest", "definitions": { - "SentNotificationRequest": { + "UploadOwnFileRequest": { "type": "object", "properties": { - "messageId": { - "$ref": "#/definitions/MessageIdString" + "content": { + "type": "object", + "properties": { + "BYTES_PER_ELEMENT": { + "type": "number" + }, + "buffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + } + }, + "required": [ + "byteLength" + ], + "additionalProperties": false + }, + "byteLength": { + "type": "number" + }, + "byteOffset": { + "type": "number" + }, + "length": { + "type": "number" + } + }, + "required": [ + "BYTES_PER_ELEMENT", + "buffer", + "byteLength", + "byteOffset", + "length" + ], + "additionalProperties": { + "type": "number" + } + }, + "filename": { + "type": "string" + }, + "mimetype": { + "type": "string" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" } }, "required": [ - "messageId" + "content", + "filename", + "mimetype" ], "additionalProperties": false }, - "MessageIdString": { + "ISO8601DateTimeString": { "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" } } } -export const CreateSettingRequest: any = { +export const UploadOwnFileValidatableRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateSettingRequest", + "$ref": "#/definitions/UploadOwnFileValidatableRequest", "definitions": { - "CreateSettingRequest": { + "UploadOwnFileValidatableRequest": { "type": "object", "properties": { - "key": { + "filename": { "type": "string" }, - "value": {}, - "reference": { - "$ref": "#/definitions/GenericIdString" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" - ] + "mimetype": { + "type": "string" }, - "succeedsAt": { + "expiresAt": { "$ref": "#/definitions/ISO8601DateTimeString" }, - "succeedsItem": { - "$ref": "#/definitions/LocalSettingIdString" + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "content": { + "type": "object" } }, "required": [ - "key", - "value" + "content", + "filename", + "mimetype" ], "additionalProperties": false }, - "GenericIdString": { - "type": "string", - "pattern": "[A-Za-z0-9]{20}" - }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "LocalSettingIdString": { - "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const DeleteSettingRequest: any = { +export const CreateIdentityRecoveryKitRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteSettingRequest", + "$ref": "#/definitions/CreateIdentityRecoveryKitRequest", "definitions": { - "DeleteSettingRequest": { + "CreateIdentityRecoveryKitRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/LocalSettingIdString" + "profileName": { + "type": "string" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "id" + "profileName", + "passwordProtection" ], "additionalProperties": false - }, - "LocalSettingIdString": { - "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const GetSettingRequest: any = { +export const GetAttachmentMetadataRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingRequest", + "$ref": "#/definitions/GetAttachmentMetadataRequest", "definitions": { - "GetSettingRequest": { + "GetAttachmentMetadataRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/LocalSettingIdString" + "$ref": "#/definitions/MessageIdString" + }, + "attachmentId": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "id" + "id", + "attachmentId" ], "additionalProperties": false }, - "LocalSettingIdString": { + "MessageIdString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "pattern": "MSG[A-Za-z0-9]{17}" + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetSettingByKeyRequest: any = { +export const GetMessageRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingByKeyRequest", + "$ref": "#/definitions/GetMessageRequest", "definitions": { - "GetSettingByKeyRequest": { + "GetMessageRequest": { "type": "object", "properties": { - "key": { - "type": "string" - }, - "reference": { - "type": "string" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" - ] + "id": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "key" + "id" ], "additionalProperties": false + }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const GetSettingsRequest: any = { +export const GetMessagesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingsRequest", + "$ref": "#/definitions/GetMessagesRequest", "definitions": { - "GetSettingsRequest": { + "GetMessagesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetSettingsQuery" + "$ref": "#/definitions/GetMessagesQuery" } }, "additionalProperties": false }, - "GetSettingsQuery": { + "GetMessagesQuery": { "type": "object", "properties": { - "key": { + "createdBy": { "anyOf": [ { "type": "string" @@ -20382,7 +20683,7 @@ export const GetSettingsRequest: any = { } ] }, - "scope": { + "createdByDevice": { "anyOf": [ { "type": "string" @@ -20395,7 +20696,7 @@ export const GetSettingsRequest: any = { } ] }, - "reference": { + "createdAt": { "anyOf": [ { "type": "string" @@ -20408,7 +20709,7 @@ export const GetSettingsRequest: any = { } ] }, - "createdAt": { + "content.@type": { "anyOf": [ { "type": "string" @@ -20421,7 +20722,7 @@ export const GetSettingsRequest: any = { } ] }, - "succeedsItem": { + "content.body": { "anyOf": [ { "type": "string" @@ -20434,7 +20735,72 @@ export const GetSettingsRequest: any = { } ] }, - "succeedsAt": { + "content.subject": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "attachments": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "recipients.address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "recipients.relationshipId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "wasReadAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "participant": { "anyOf": [ { "type": "string" @@ -20453,83 +20819,84 @@ export const GetSettingsRequest: any = { } } -export const UpdateSettingRequest: any = { +export const MarkMessageAsReadRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateSettingRequest", + "$ref": "#/definitions/MarkMessageAsReadRequest", "definitions": { - "UpdateSettingRequest": { + "MarkMessageAsReadRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/LocalSettingIdString" - }, - "value": {} + "$ref": "#/definitions/MessageIdString" + } }, "required": [ - "id", - "value" + "id" ], "additionalProperties": false }, - "LocalSettingIdString": { + "MessageIdString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const UpsertSettingByKeyRequest: any = { +export const MarkMessageAsUnreadRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpsertSettingByKeyRequest", + "$ref": "#/definitions/MarkMessageAsUnreadRequest", "definitions": { - "UpsertSettingByKeyRequest": { + "MarkMessageAsUnreadRequest": { "type": "object", "properties": { - "key": { - "type": "string" - }, - "value": {}, - "reference": { - "$ref": "#/definitions/GenericIdString" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" - ] + "id": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "key", - "value" + "id" ], "additionalProperties": false }, - "GenericIdString": { + "MessageIdString": { "type": "string", - "pattern": "[A-Za-z0-9]{20}" + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const DownloadFileRequest: any = { +export const SendMessageRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DownloadFileRequest", + "$ref": "#/definitions/SendMessageRequest", "definitions": { - "DownloadFileRequest": { + "SendMessageRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/FileIdString" + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressString" + }, + "minItems": 1 + }, + "content": {}, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/FileIdString" + } } }, "required": [ - "id" + "recipients", + "content" ], "additionalProperties": false }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + }, "FileIdString": { "type": "string", "pattern": "FIL[A-Za-z0-9]{17}" @@ -20537,172 +20904,167 @@ export const DownloadFileRequest: any = { } } -export const LoadItemFromTruncatedReferenceRequest: any = { +export const AcceptRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadItemFromTruncatedReferenceRequest", + "$ref": "#/definitions/AcceptRelationshipRequest", "definitions": { - "LoadItemFromTruncatedReferenceRequest": { + "AcceptRelationshipRequest": { "type": "object", "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/FileReferenceString" - }, - { - "$ref": "#/definitions/RelationshipTemplateReferenceString" - } - ] - }, - "password": { - "type": "string" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const AcceptRelationshipReactivationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/AcceptRelationshipReactivationRequest", + "definitions": { + "AcceptRelationshipReactivationRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "reference" + "relationshipId" ], "additionalProperties": false }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" - }, - "FileReferenceString": { - "type": "string", - "pattern": "RklM.{84}" - }, - "RelationshipTemplateReferenceString": { + "RelationshipIdString": { "type": "string", - "pattern": "UkxU.{84}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const RegisterPushNotificationTokenRequest: any = { +export const CanCreateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RegisterPushNotificationTokenRequest", + "$ref": "#/definitions/CanCreateRelationshipRequest", "definitions": { - "RegisterPushNotificationTokenRequest": { + "CanCreateRelationshipRequest": { "type": "object", "properties": { - "handle": { - "type": "string" - }, - "platform": { - "type": "string" - }, - "appId": { - "type": "string" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" }, - "environment": { - "type": "string", - "enum": [ - "Development", - "Production" - ] - } + "creationContent": {} }, "required": [ - "handle", - "platform", - "appId" + "templateId" ], "additionalProperties": false + }, + "RelationshipTemplateIdString": { + "type": "string", + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const GetIdentityDeletionProcessRequest: any = { +export const CreateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetIdentityDeletionProcessRequest", + "$ref": "#/definitions/CreateRelationshipRequest", "definitions": { - "GetIdentityDeletionProcessRequest": { + "CreateRelationshipRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/IdentityDeletionProcessIdString" - } + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" + }, + "creationContent": {} }, "required": [ - "id" + "templateId", + "creationContent" ], "additionalProperties": false }, - "IdentityDeletionProcessIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "IDP[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const InitiateIdentityDeletionProcessRequest: any = { +export const DecomposeRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/InitiateIdentityDeletionProcessRequest", + "$ref": "#/definitions/DecomposeRelationshipRequest", "definitions": { - "InitiateIdentityDeletionProcessRequest": { + "DecomposeRelationshipRequest": { "type": "object", "properties": { - "lengthOfGracePeriodInDays": { - "type": "number" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, + "required": [ + "relationshipId" + ], "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const DownloadAttachmentRequest: any = { +export const GetAttributesForRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DownloadAttachmentRequest", + "$ref": "#/definitions/GetAttributesForRelationshipRequest", "definitions": { - "DownloadAttachmentRequest": { + "GetAttributesForRelationshipRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/MessageIdString" + "$ref": "#/definitions/RelationshipIdString" }, - "attachmentId": { - "$ref": "#/definitions/FileIdString" + "hideTechnical": { + "type": "boolean" + }, + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" } }, "required": [ - "id", - "attachmentId" + "id" ], "additionalProperties": false }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - }, - "FileIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateRelationshipChallengeRequest: any = { +export const GetRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateRelationshipChallengeRequest", + "$ref": "#/definitions/GetRelationshipRequest", "definitions": { - "CreateRelationshipChallengeRequest": { + "GetRelationshipRequest": { "type": "object", "properties": { - "challengeType": { - "type": "string", - "const": "Relationship" - }, - "relationship": { + "id": { "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "challengeType", - "relationship" + "id" ], "additionalProperties": false }, @@ -20713,248 +21075,330 @@ export const CreateRelationshipChallengeRequest: any = { } } -export const isCreateRelationshipChallengeRequest: any = { +export const GetRelationshipByAddressRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateRelationshipChallengeRequest", + "$ref": "#/definitions/GetRelationshipByAddressRequest", "definitions": { - "isCreateRelationshipChallengeRequest": { - "$comment": "(value: any) => value is CreateRelationshipChallengeRequest", + "GetRelationshipByAddressRequest": { "type": "object", "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false + "address": { + "$ref": "#/definitions/AddressString" } - } + }, + "required": [ + "address" + ], + "additionalProperties": false + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const CreateIdentityChallengeRequest: any = { +export const GetRelationshipsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateIdentityChallengeRequest", + "$ref": "#/definitions/GetRelationshipsRequest", "definitions": { - "CreateIdentityChallengeRequest": { + "GetRelationshipsRequest": { "type": "object", "properties": { - "challengeType": { - "type": "string", - "const": "Identity" + "query": { + "$ref": "#/definitions/GetRelationshipsQuery" + } + }, + "additionalProperties": false + }, + "GetRelationshipsQuery": { + "type": "object", + "properties": { + "peer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "template.id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] } }, - "required": [ - "challengeType" - ], "additionalProperties": false } } } -export const isCreateIdentityChallengeRequest: any = { +export const RejectRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateIdentityChallengeRequest", + "$ref": "#/definitions/RejectRelationshipRequest", "definitions": { - "isCreateIdentityChallengeRequest": { - "$comment": "(value: any) => value is CreateIdentityChallengeRequest", + "RejectRelationshipRequest": { "type": "object", "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } - } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateDeviceChallengeRequest: any = { +export const RejectRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDeviceChallengeRequest", + "$ref": "#/definitions/RejectRelationshipReactivationRequest", "definitions": { - "CreateDeviceChallengeRequest": { + "RejectRelationshipReactivationRequest": { "type": "object", "properties": { - "challengeType": { - "type": "string", - "const": "Device" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "challengeType" + "relationshipId" ], "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const isCreateDeviceChallengeRequest: any = { +export const RequestRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateDeviceChallengeRequest", + "$ref": "#/definitions/RequestRelationshipReactivationRequest", "definitions": { - "isCreateDeviceChallengeRequest": { - "$comment": "(value: any) => value is CreateDeviceChallengeRequest", + "RequestRelationshipReactivationRequest": { "type": "object", "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } - } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateChallengeRequest: any = { +export const RevokeRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateChallengeRequest", + "$ref": "#/definitions/RevokeRelationshipRequest", "definitions": { - "CreateChallengeRequest": { - "anyOf": [ - { - "$ref": "#/definitions/CreateRelationshipChallengeRequest" - }, - { - "$ref": "#/definitions/CreateIdentityChallengeRequest" - }, - { - "$ref": "#/definitions/CreateDeviceChallengeRequest" - } - ] - }, - "CreateRelationshipChallengeRequest": { + "RevokeRelationshipRequest": { "type": "object", "properties": { - "challengeType": { - "type": "string", - "const": "Relationship" - }, - "relationship": { + "relationshipId": { "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "challengeType", - "relationship" + "relationshipId" ], "additionalProperties": false }, "RelationshipIdString": { "type": "string", "pattern": "REL[A-Za-z0-9]{17}" - }, - "CreateIdentityChallengeRequest": { + } + } +} + +export const RevokeRelationshipReactivationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RevokeRelationshipReactivationRequest", + "definitions": { + "RevokeRelationshipReactivationRequest": { "type": "object", "properties": { - "challengeType": { - "type": "string", - "const": "Identity" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "challengeType" + "relationshipId" ], "additionalProperties": false }, - "CreateDeviceChallengeRequest": { + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const TerminateRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/TerminateRelationshipRequest", + "definitions": { + "TerminateRelationshipRequest": { "type": "object", "properties": { - "challengeType": { - "type": "string", - "const": "Device" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "challengeType" + "relationshipId" ], "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const ValidateChallengeRequest: any = { +export const CreateOwnRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ValidateChallengeRequest", + "$ref": "#/definitions/CreateOwnRelationshipTemplateRequest", "definitions": { - "ValidateChallengeRequest": { + "CreateOwnRelationshipTemplateRequest": { "type": "object", "properties": { - "challengeString": { - "type": "string" + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" }, - "signature": { - "type": "string" + "content": {}, + "maxNumberOfAllocations": { + "type": "number", + "minimum": 1 + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "challengeString", - "signature" + "expiresAt", + "content" ], "additionalProperties": false + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const CreateDeviceRequest: any = { +export const CreateQRCodeForOwnTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDeviceRequest", + "$ref": "#/definitions/CreateQRCodeForOwnTemplateRequest", "definitions": { - "CreateDeviceRequest": { + "CreateQRCodeForOwnTemplateRequest": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "isAdmin": { - "type": "boolean" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" } }, + "required": [ + "templateId" + ], "additionalProperties": false + }, + "RelationshipTemplateIdString": { + "type": "string", + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const CreateDeviceOnboardingTokenRequest: any = { +export const CreateTokenForOwnTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDeviceOnboardingTokenRequest", + "$ref": "#/definitions/CreateTokenForOwnTemplateRequest", "definitions": { - "CreateDeviceOnboardingTokenRequest": { + "CreateTokenForOwnTemplateRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" }, "expiresAt": { "$ref": "#/definitions/ISO8601DateTimeString" }, - "profileName": { - "type": "string" + "ephemeral": { + "type": "boolean" + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" }, "passwordProtection": { "type": "object", "properties": { "password": { - "type": "string" + "type": "string", + "minLength": 1 }, "passwordIsPin": { "type": "boolean", @@ -20968,80 +21412,90 @@ export const CreateDeviceOnboardingTokenRequest: any = { } }, "required": [ - "id" + "templateId" ], "additionalProperties": false }, - "DeviceIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - } - } -} - -export const DeleteDeviceRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteDeviceRequest", - "definitions": { - "DeleteDeviceRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" - } - }, - "required": [ - "id" - ], - "additionalProperties": false }, - "DeviceIdString": { + "AddressString": { "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetDeviceRequest: any = { +export const CreateTokenQRCodeForOwnTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetDeviceRequest", + "$ref": "#/definitions/CreateTokenQRCodeForOwnTemplateRequest", "definitions": { - "GetDeviceRequest": { + "CreateTokenQRCodeForOwnTemplateRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "id" + "templateId" ], "additionalProperties": false }, - "DeviceIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetDeviceOnboardingInfoRequest: any = { +export const GetRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetDeviceOnboardingInfoRequest", + "$ref": "#/definitions/GetRelationshipTemplateRequest", "definitions": { - "GetDeviceOnboardingInfoRequest": { + "GetRelationshipTemplateRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/GenericIdString" - }, - "profileName": { - "type": "string" + "$ref": "#/definitions/RelationshipTemplateIdString" } }, "required": [ @@ -21049,282 +21503,209 @@ export const GetDeviceOnboardingInfoRequest: any = { ], "additionalProperties": false }, - "GenericIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "[A-Za-z0-9]{20}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const SetCommunicationLanguageRequest: any = { +export const GetRelationshipTemplatesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SetCommunicationLanguageRequest", + "$ref": "#/definitions/GetRelationshipTemplatesRequest", "definitions": { - "SetCommunicationLanguageRequest": { + "GetRelationshipTemplatesRequest": { "type": "object", "properties": { - "communicationLanguage": { - "$ref": "#/definitions/LanguageISO639" + "query": { + "$ref": "#/definitions/GetRelationshipTemplatesQuery" + }, + "ownerRestriction": { + "$ref": "#/definitions/OwnerRestriction" } - }, - "required": [ - "communicationLanguage" - ], - "additionalProperties": false - }, - "LanguageISO639": { - "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yo", - "za", - "zh", - "zu" - ] - } - } -} - -export const UpdateDeviceRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateDeviceRequest", - "definitions": { - "UpdateDeviceRequest": { + }, + "additionalProperties": false + }, + "GetRelationshipTemplatesQuery": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" + "isOwn": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "name": { - "type": "string" + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "description": { - "type": "string" + "expiresAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdBy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdByDevice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "maxNumberOfAllocations": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "forIdentity": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "passwordProtection": { + "type": "string", + "enum": [ + "", + "!" + ] + }, + "passwordProtection.password": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "passwordProtection.passwordIsPin": { + "type": "string", + "enum": [ + "true", + "!" + ] } }, - "required": [ - "id" - ], "additionalProperties": false }, - "DeviceIdString": { + "OwnerRestriction": { "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" + "enum": [ + "o", + "p" + ] } } } -export const CreateQRCodeForFileRequest: any = { +export const LoadPeerRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateQRCodeForFileRequest", + "$ref": "#/definitions/LoadPeerRelationshipTemplateRequest", "definitions": { - "CreateQRCodeForFileRequest": { + "LoadPeerRelationshipTemplateRequest": { "type": "object", "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" + "reference": { + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" + }, + { + "$ref": "#/definitions/RelationshipTemplateReferenceString" + } + ] + }, + "password": { + "type": "string" } }, "required": [ - "fileId" + "reference" ], - "additionalProperties": false + "additionalProperties": false, + "errorMessage": "token / relationship template reference invalid" }, - "FileIdString": { + "TokenReferenceString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "VE9L.{84}" + }, + "RelationshipTemplateReferenceString": { + "type": "string", + "pattern": "UkxU.{84}" } } } -export const CreateTokenForFileRequest: any = { +export const CreateOwnTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenForFileRequest", + "$ref": "#/definitions/CreateOwnTokenRequest", "definitions": { - "CreateTokenForFileRequest": { + "CreateOwnTokenRequest": { "type": "object", "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" - }, + "content": {}, "expiresAt": { "$ref": "#/definitions/ISO8601DateTimeString" }, @@ -21353,14 +21734,12 @@ export const CreateTokenForFileRequest: any = { } }, "required": [ - "fileId" + "content", + "expiresAt", + "ephemeral" ], "additionalProperties": false }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" - }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", @@ -21373,70 +21752,38 @@ export const CreateTokenForFileRequest: any = { } } -export const CreateTokenQRCodeForFileRequest: any = { +export const GetQRCodeForTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenQRCodeForFileRequest", + "$ref": "#/definitions/GetQRCodeForTokenRequest", "definitions": { - "CreateTokenQRCodeForFileRequest": { + "GetQRCodeForTokenRequest": { "type": "object", "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "forIdentity": { - "$ref": "#/definitions/AddressString" - }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "id": { + "$ref": "#/definitions/TokenIdString" } }, "required": [ - "fileId" + "id" ], "additionalProperties": false }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { + "TokenIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetFileRequest: any = { +export const GetTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetFileRequest", + "$ref": "#/definitions/GetTokenRequest", "definitions": { - "GetFileRequest": { + "GetTokenRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/FileIdString" + "$ref": "#/definitions/TokenIdString" } }, "required": [ @@ -21444,22 +21791,22 @@ export const GetFileRequest: any = { ], "additionalProperties": false }, - "FileIdString": { + "TokenIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetFilesRequest: any = { +export const GetTokensRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetFilesRequest", + "$ref": "#/definitions/GetTokensRequest", "definitions": { - "GetFilesRequest": { + "GetTokensRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetFilesQuery" + "$ref": "#/definitions/GetTokensQuery" }, "ownerRestriction": { "$ref": "#/definitions/OwnerRestriction" @@ -21467,7 +21814,7 @@ export const GetFilesRequest: any = { }, "additionalProperties": false }, - "GetFilesQuery": { + "GetTokensQuery": { "type": "object", "properties": { "createdAt": { @@ -21509,19 +21856,6 @@ export const GetFilesRequest: any = { } ] }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, "expiresAt": { "anyOf": [ { @@ -21535,20 +21869,7 @@ export const GetFilesRequest: any = { } ] }, - "filename": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "filesize": { + "forIdentity": { "anyOf": [ { "type": "string" @@ -21561,20 +21882,14 @@ export const GetFilesRequest: any = { } ] }, - "mimetype": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } + "passwordProtection": { + "type": "string", + "enum": [ + "", + "!" ] }, - "title": { + "passwordProtection.password": { "anyOf": [ { "type": "string" @@ -21587,17 +21902,11 @@ export const GetFilesRequest: any = { } ] }, - "isOwn": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } + "passwordProtection.passwordIsPin": { + "type": "string", + "enum": [ + "true", + "!" ] } }, @@ -21613,1548 +21922,1383 @@ export const GetFilesRequest: any = { } } -export const GetOrLoadFileRequest: any = { +export const LoadPeerTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetOrLoadFileRequest", + "$ref": "#/definitions/LoadPeerTokenRequest", "definitions": { - "GetOrLoadFileRequest": { + "LoadPeerTokenRequest": { "type": "object", "properties": { "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/FileReferenceString" - } - ] + "$ref": "#/definitions/TokenReferenceString" + }, + "ephemeral": { + "type": "boolean" }, "password": { "type": "string" } }, "required": [ - "reference" + "reference", + "ephemeral" ], "additionalProperties": false, - "errorMessage": "token / file reference invalid" + "errorMessage": "token reference invalid" }, "TokenReferenceString": { "type": "string", "pattern": "VE9L.{84}" - }, - "FileReferenceString": { - "type": "string", - "pattern": "RklM.{84}" } } } -export const UploadOwnFileRequest: any = { +export const City: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UploadOwnFileRequest", + "$ref": "#/definitions/City", "definitions": { - "UploadOwnFileRequest": { + "City": { "type": "object", "properties": { - "content": { - "type": "object", - "properties": { - "BYTES_PER_ELEMENT": { - "type": "number" - }, - "buffer": { - "type": "object", - "properties": { - "byteLength": { - "type": "number" - } - }, - "required": [ - "byteLength" - ], - "additionalProperties": false - }, - "byteLength": { - "type": "number" - }, - "byteOffset": { - "type": "number" - }, - "length": { - "type": "number" - } - }, - "required": [ - "BYTES_PER_ELEMENT", - "buffer", - "byteLength", - "byteOffset", - "length" - ], - "additionalProperties": { - "type": "number" - } + "@type": { + "type": "string", + "const": "City" }, - "filename": { + "@context": { "type": "string" }, - "mimetype": { + "@version": { "type": "string" }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + } + } +} + +export const Country: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/Country", + "definitions": { + "Country": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "Country" }, - "title": { + "@context": { "type": "string" }, - "description": { + "@version": { + "type": "string" + }, + "value": { "type": "string" } }, "required": [ - "content", - "filename", - "mimetype" + "@type", + "value" + ], + "additionalProperties": false + } + } +} + +export const CommunicationLanguage: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CommunicationLanguage", + "definitions": { + "CommunicationLanguage": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "CommunicationLanguage" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + } + } +} + +export const EMailAddress: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/EMailAddress", + "definitions": { + "EMailAddress": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "EMailAddress" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + } + } +} + +export const FaxNumber: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/FaxNumber", + "definitions": { + "FaxNumber": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "FaxNumber" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" ], "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" } } } -export const UploadOwnFileValidatableRequest: any = { +export const PhoneNumber: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UploadOwnFileValidatableRequest", + "$ref": "#/definitions/PhoneNumber", "definitions": { - "UploadOwnFileValidatableRequest": { + "PhoneNumber": { "type": "object", "properties": { - "filename": { - "type": "string" + "@type": { + "type": "string", + "const": "PhoneNumber" }, - "mimetype": { + "@context": { "type": "string" }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "title": { + "@version": { "type": "string" }, - "description": { + "value": { "type": "string" - }, - "content": { - "type": "object" } }, "required": [ - "content", - "filename", - "mimetype" + "@type", + "value" ], "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" } } } -export const CreateIdentityRecoveryKitRequest: any = { +export const Website: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateIdentityRecoveryKitRequest", + "$ref": "#/definitions/Website", "definitions": { - "CreateIdentityRecoveryKitRequest": { + "Website": { "type": "object", "properties": { - "profileName": { + "@type": { + "type": "string", + "const": "Website" + }, + "@context": { "type": "string" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "profileName", - "passwordProtection" + "@type", + "value" ], "additionalProperties": false } } } -export const GetAttachmentMetadataRequest: any = { +export const State: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttachmentMetadataRequest", + "$ref": "#/definitions/State", "definitions": { - "GetAttachmentMetadataRequest": { + "State": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "@type": { + "type": "string", + "const": "State" }, - "attachmentId": { - "$ref": "#/definitions/FileIdString" + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "id", - "attachmentId" + "@type", + "value" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetMessageRequest: any = { +export const ZipCode: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetMessageRequest", + "$ref": "#/definitions/ZipCode", "definitions": { - "GetMessageRequest": { + "ZipCode": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "@type": { + "type": "string", + "const": "ZipCode" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const GetMessagesRequest: any = { +export const DeliveryBoxAddress: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetMessagesRequest", + "$ref": "#/definitions/DeliveryBoxAddress", "definitions": { - "GetMessagesRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/GetMessagesQuery" - } - }, - "additionalProperties": false - }, - "GetMessagesQuery": { + "DeliveryBoxAddress": { "type": "object", "properties": { - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@type": { + "type": "string", + "const": "DeliveryBoxAddress" }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" }, - "content.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "recipient": { + "type": "string" }, - "content.body": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "userId": { + "type": "string" }, - "content.subject": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "deliveryBoxId": { + "type": "string" }, - "attachments": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "zipCode": { + "type": "string" }, - "recipients.address": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "city": { + "type": "string" }, - "recipients.relationshipId": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "country": { + "type": "string" }, - "wasReadAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "phoneNumber": { + "type": "string" }, - "participant": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "state": { + "type": "string" } }, + "required": [ + "@type", + "city", + "country", + "deliveryBoxId", + "recipient", + "userId", + "zipCode" + ], "additionalProperties": false } } } -export const MarkMessageAsReadRequest: any = { +export const HouseNumber: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MarkMessageAsReadRequest", + "$ref": "#/definitions/HouseNumber", "definitions": { - "MarkMessageAsReadRequest": { + "HouseNumber": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "@type": { + "type": "string", + "const": "HouseNumber" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const MarkMessageAsUnreadRequest: any = { +export const PostOfficeBoxAddress: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MarkMessageAsUnreadRequest", + "$ref": "#/definitions/PostOfficeBoxAddress", "definitions": { - "MarkMessageAsUnreadRequest": { + "PostOfficeBoxAddress": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "@type": { + "type": "string", + "const": "PostOfficeBoxAddress" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "recipient": { + "type": "string" + }, + "boxId": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { + "type": "string" } }, "required": [ - "id" + "@type", + "boxId", + "city", + "country", + "recipient", + "zipCode" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const SendMessageRequest: any = { +export const Street: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SendMessageRequest", + "$ref": "#/definitions/Street", "definitions": { - "SendMessageRequest": { + "Street": { "type": "object", "properties": { - "recipients": { - "type": "array", - "items": { - "$ref": "#/definitions/AddressString" - }, - "minItems": 1 + "@type": { + "type": "string", + "const": "Street" }, - "content": {}, - "attachments": { - "type": "array", - "items": { - "$ref": "#/definitions/FileIdString" - } + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "recipients", - "content" + "@type", + "value" ], "additionalProperties": false - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const AcceptRelationshipRequest: any = { +export const StreetAddress: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/AcceptRelationshipRequest", + "$ref": "#/definitions/StreetAddress", "definitions": { - "AcceptRelationshipRequest": { + "StreetAddress": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "StreetAddress" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "recipient": { + "type": "string" + }, + "street": { + "type": "string" + }, + "houseNo": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { + "type": "string" } }, "required": [ - "relationshipId" + "@type", + "city", + "country", + "houseNo", + "recipient", + "street", + "zipCode" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const AcceptRelationshipReactivationRequest: any = { +export const AffiliationOrganization: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/AcceptRelationshipReactivationRequest", + "$ref": "#/definitions/AffiliationOrganization", "definitions": { - "AcceptRelationshipReactivationRequest": { + "AffiliationOrganization": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "AffiliationOrganization" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "relationshipId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CanCreateRelationshipRequest: any = { +export const AffiliationRole: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CanCreateRelationshipRequest", + "$ref": "#/definitions/AffiliationRole", "definitions": { - "CanCreateRelationshipRequest": { + "AffiliationRole": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "@type": { + "type": "string", + "const": "AffiliationRole" }, - "creationContent": {} + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } }, "required": [ - "templateId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const CreateRelationshipRequest: any = { +export const AffiliationUnit: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateRelationshipRequest", + "$ref": "#/definitions/AffiliationUnit", "definitions": { - "CreateRelationshipRequest": { + "AffiliationUnit": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "@type": { + "type": "string", + "const": "AffiliationUnit" }, - "creationContent": {} + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" + } }, "required": [ - "templateId", - "creationContent" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const DecomposeRelationshipRequest: any = { +export const Affiliation: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DecomposeRelationshipRequest", + "$ref": "#/definitions/Affiliation", "definitions": { - "DecomposeRelationshipRequest": { + "Affiliation": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "Affiliation" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "organization": { + "type": "string" + }, + "role": { + "type": "string" + }, + "unit": { + "type": "string" } }, "required": [ - "relationshipId" + "@type", + "organization" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetAttributesForRelationshipRequest: any = { +export const BirthCity: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttributesForRelationshipRequest", + "$ref": "#/definitions/BirthCity", "definitions": { - "GetAttributesForRelationshipRequest": { + "BirthCity": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/RelationshipIdString" + "value": { + "type": "string" }, - "hideTechnical": { - "type": "boolean" + "@context": { + "type": "string" }, - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "@version": { + "type": "string" + }, + "@type": { + "type": "string", + "const": "BirthCity" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetRelationshipRequest: any = { +export const BirthCountry: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipRequest", + "$ref": "#/definitions/BirthCountry", "definitions": { - "GetRelationshipRequest": { + "BirthCountry": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/RelationshipIdString" + "value": { + "type": "string" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "@type": { + "type": "string", + "const": "BirthCountry" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetRelationshipByAddressRequest: any = { +export const BirthDay: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipByAddressRequest", + "$ref": "#/definitions/BirthDay", "definitions": { - "GetRelationshipByAddressRequest": { + "BirthDay": { "type": "object", "properties": { - "address": { - "$ref": "#/definitions/AddressString" + "@type": { + "type": "string", + "const": "BirthDay" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "number" } }, "required": [ - "address" + "@type", + "value" ], "additionalProperties": false - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetRelationshipsRequest: any = { +export const BirthMonth: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipsRequest", + "$ref": "#/definitions/BirthMonth", "definitions": { - "GetRelationshipsRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/GetRelationshipsQuery" - } - }, - "additionalProperties": false - }, - "GetRelationshipsQuery": { + "BirthMonth": { "type": "object", "properties": { - "peer": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@type": { + "type": "string", + "const": "BirthMonth" }, - "status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "template.id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@version": { + "type": "string" + }, + "value": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "description": "Month values: 1 (january) - 12 (december)" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false } } } -export const RejectRelationshipRequest: any = { +export const BirthYear: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RejectRelationshipRequest", + "$ref": "#/definitions/BirthYear", "definitions": { - "RejectRelationshipRequest": { + "BirthYear": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "BirthYear" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "number" } }, "required": [ - "relationshipId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const RejectRelationshipReactivationRequest: any = { +export const BirthDate: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RejectRelationshipReactivationRequest", + "$ref": "#/definitions/BirthDate", "definitions": { - "RejectRelationshipReactivationRequest": { + "BirthDate": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "BirthDate" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "day": { + "type": "number" + }, + "month": { + "type": "number" + }, + "year": { + "type": "number" } }, "required": [ - "relationshipId" + "@type", + "day", + "month", + "year" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const RequestRelationshipReactivationRequest: any = { +export const BirthState: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RequestRelationshipReactivationRequest", + "$ref": "#/definitions/BirthState", "definitions": { - "RequestRelationshipReactivationRequest": { + "BirthState": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "value": { + "type": "string" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "@type": { + "type": "string", + "const": "BirthState" } }, "required": [ - "relationshipId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const RevokeRelationshipRequest: any = { +export const BirthPlace: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RevokeRelationshipRequest", + "$ref": "#/definitions/BirthPlace", "definitions": { - "RevokeRelationshipRequest": { + "BirthPlace": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "BirthPlace" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { + "type": "string" } }, "required": [ - "relationshipId" + "@type", + "city", + "country" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const RevokeRelationshipReactivationRequest: any = { +export const DisplayName: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RevokeRelationshipReactivationRequest", + "$ref": "#/definitions/DisplayName", "definitions": { - "RevokeRelationshipReactivationRequest": { + "DisplayName": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "DisplayName" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "relationshipId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const TerminateRelationshipRequest: any = { +export const IdentityFileReference: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/TerminateRelationshipRequest", + "$ref": "#/definitions/IdentityFileReference", "definitions": { - "TerminateRelationshipRequest": { + "IdentityFileReference": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "@type": { + "type": "string", + "const": "IdentityFileReference" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "relationshipId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateOwnRelationshipTemplateRequest: any = { +export const SchematizedXML: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateOwnRelationshipTemplateRequest", + "$ref": "#/definitions/SchematizedXML", "definitions": { - "CreateOwnRelationshipTemplateRequest": { + "SchematizedXML": { "type": "object", "properties": { - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "@type": { + "type": "string", + "const": "SchematizedXML" }, - "content": {}, - "maxNumberOfAllocations": { - "type": "number", - "minimum": 1 + "@context": { + "type": "string" }, - "forIdentity": { - "$ref": "#/definitions/AddressString" + "@version": { + "type": "string" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "value": { + "type": "string" + }, + "schemaURL": { + "type": "string" } }, "required": [ - "expiresAt", - "content" + "@type", + "value" ], "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const CreateQRCodeForOwnTemplateRequest: any = { +export const BirthName: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateQRCodeForOwnTemplateRequest", + "$ref": "#/definitions/BirthName", "definitions": { - "CreateQRCodeForOwnTemplateRequest": { + "BirthName": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "@type": { + "type": "string", + "const": "BirthName" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "templateId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const CreateTokenForOwnTemplateRequest: any = { +export const GivenName: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenForOwnTemplateRequest", + "$ref": "#/definitions/GivenName", "definitions": { - "CreateTokenForOwnTemplateRequest": { + "GivenName": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "@type": { + "type": "string", + "const": "GivenName" }, - "ephemeral": { - "type": "boolean" + "@context": { + "type": "string" }, - "forIdentity": { - "$ref": "#/definitions/AddressString" + "@version": { + "type": "string" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "value": { + "type": "string" } }, "required": [ - "templateId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const CreateTokenQRCodeForOwnTemplateRequest: any = { +export const HonorificPrefix: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenQRCodeForOwnTemplateRequest", + "$ref": "#/definitions/HonorificPrefix", "definitions": { - "CreateTokenQRCodeForOwnTemplateRequest": { + "HonorificPrefix": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "@type": { + "type": "string", + "const": "HonorificPrefix" }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "@context": { + "type": "string" }, - "forIdentity": { - "$ref": "#/definitions/AddressString" + "@version": { + "type": "string" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "value": { + "type": "string" } }, "required": [ - "templateId" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetRelationshipTemplateRequest: any = { +export const HonorificSuffix: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipTemplateRequest", + "$ref": "#/definitions/HonorificSuffix", "definitions": { - "GetRelationshipTemplateRequest": { + "HonorificSuffix": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "@type": { + "type": "string", + "const": "HonorificSuffix" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const GetRelationshipTemplatesRequest: any = { +export const MiddleName: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipTemplatesRequest", + "$ref": "#/definitions/MiddleName", "definitions": { - "GetRelationshipTemplatesRequest": { + "MiddleName": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/GetRelationshipTemplatesQuery" + "@type": { + "type": "string", + "const": "MiddleName" }, - "ownerRestriction": { - "$ref": "#/definitions/OwnerRestriction" + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false - }, - "GetRelationshipTemplatesQuery": { + } + } +} + +export const Surname: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/Surname", + "definitions": { + "Surname": { "type": "object", "properties": { - "isOwn": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "expiresAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "maxNumberOfAllocations": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "forIdentity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "passwordProtection": { + "@type": { "type": "string", - "enum": [ - "", - "!" - ] + "const": "Surname" }, - "passwordProtection.password": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "passwordProtection.passwordIsPin": { - "type": "string", - "enum": [ - "true", - "!" - ] + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false - }, - "OwnerRestriction": { - "type": "string", - "enum": [ - "o", - "p" - ] } } } -export const LoadPeerRelationshipTemplateRequest: any = { +export const PersonName: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadPeerRelationshipTemplateRequest", + "$ref": "#/definitions/PersonName", "definitions": { - "LoadPeerRelationshipTemplateRequest": { + "PersonName": { "type": "object", "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/RelationshipTemplateReferenceString" - } - ] + "@type": { + "type": "string", + "const": "PersonName" }, - "password": { + "@context": { "type": "string" - } - }, - "required": [ - "reference" - ], - "additionalProperties": false, - "errorMessage": "token / relationship template reference invalid" - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" - }, - "RelationshipTemplateReferenceString": { - "type": "string", - "pattern": "UkxU.{84}" + }, + "@version": { + "type": "string" + }, + "givenName": { + "type": "string" + }, + "middleName": { + "type": "string" + }, + "surname": { + "type": "string" + }, + "honorificSuffix": { + "type": "string" + }, + "honorificPrefix": { + "type": "string" + } + }, + "required": [ + "@type", + "givenName", + "surname" + ], + "additionalProperties": false } } } -export const CreateOwnTokenRequest: any = { +export const Pseudonym: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateOwnTokenRequest", + "$ref": "#/definitions/Pseudonym", "definitions": { - "CreateOwnTokenRequest": { + "Pseudonym": { "type": "object", "properties": { - "content": {}, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "@type": { + "type": "string", + "const": "Pseudonym" }, - "ephemeral": { - "type": "boolean" + "@context": { + "type": "string" }, - "forIdentity": { - "$ref": "#/definitions/AddressString" + "@version": { + "type": "string" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "value": { + "type": "string" } }, "required": [ - "content", - "expiresAt", - "ephemeral" + "@type", + "value" ], "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetQRCodeForTokenRequest: any = { +export const Citizenship: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetQRCodeForTokenRequest", + "$ref": "#/definitions/Citizenship", "definitions": { - "GetQRCodeForTokenRequest": { + "Citizenship": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/TokenIdString" + "@type": { + "type": "string", + "const": "Citizenship" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "TokenIdString": { - "type": "string", - "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetTokenRequest: any = { +export const JobTitle: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetTokenRequest", + "$ref": "#/definitions/JobTitle", "definitions": { - "GetTokenRequest": { + "JobTitle": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/TokenIdString" + "@type": { + "type": "string", + "const": "JobTitle" + }, + "@context": { + "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, "required": [ - "id" + "@type", + "value" ], "additionalProperties": false - }, - "TokenIdString": { - "type": "string", - "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetTokensRequest: any = { +export const Nationality: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetTokensRequest", + "$ref": "#/definitions/Nationality", "definitions": { - "GetTokensRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/GetTokensQuery" - }, - "ownerRestriction": { - "$ref": "#/definitions/OwnerRestriction" - } - }, - "additionalProperties": false - }, - "GetTokensQuery": { + "Nationality": { "type": "object", "properties": { - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "expiresAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "forIdentity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "passwordProtection": { + "@type": { "type": "string", - "enum": [ - "", - "!" - ] + "const": "Nationality" }, - "passwordProtection.password": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "@context": { + "type": "string" }, - "passwordProtection.passwordIsPin": { - "type": "string", - "enum": [ - "true", - "!" - ] + "@version": { + "type": "string" + }, + "value": { + "type": "string" } }, + "required": [ + "@type", + "value" + ], "additionalProperties": false - }, - "OwnerRestriction": { - "type": "string", - "enum": [ - "o", - "p" - ] } } } -export const LoadPeerTokenRequest: any = { +export const Sex: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadPeerTokenRequest", + "$ref": "#/definitions/Sex", "definitions": { - "LoadPeerTokenRequest": { + "Sex": { "type": "object", "properties": { - "reference": { - "$ref": "#/definitions/TokenReferenceString" + "@type": { + "type": "string", + "const": "Sex" }, - "ephemeral": { - "type": "boolean" + "@context": { + "type": "string" }, - "password": { + "@version": { + "type": "string" + }, + "value": { "type": "string" } }, "required": [ - "reference", - "ephemeral" + "@type", + "value" ], - "additionalProperties": false, - "errorMessage": "token reference invalid" - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" + "additionalProperties": false } } } \ No newline at end of file diff --git a/packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts b/packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts index 71454e05b..ad82dd4e5 100644 --- a/packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts +++ b/packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts @@ -1,25 +1,64 @@ -import { Result } from "@js-soft/ts-utils"; +import { ApplicationError, Result } from "@js-soft/ts-utils"; import { AttributesController, CreateRepositoryAttributeParams } from "@nmshd/consumption"; import { AttributeValues } from "@nmshd/content"; import { AccountController } from "@nmshd/transport"; import { Inject } from "@nmshd/typescript-ioc"; import _ from "lodash"; import { LocalAttributeDTO } from "../../../types"; -import { flattenObject, ISO8601DateTimeString, RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; +import { flattenObject, ISO8601DateTimeString, RuntimeErrors, SchemaRepository, SchemaValidator, UseCase, ValidationFailure, ValidationResult } from "../../common"; +import { IValidator } from "../../common/validation/IValidator"; import { AttributeMapper } from "./AttributeMapper"; -export interface CreateRepositoryAttributeRequest { +interface AbstractCreateRepositoryAttributeRequest { content: { - value: AttributeValues.Identity.Json; + value: T; tags?: string[]; validFrom?: ISO8601DateTimeString; validTo?: ISO8601DateTimeString; }; } -class Validator extends SchemaValidator { - public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("CreateRepositoryAttributeRequest")); +export interface CreateRepositoryAttributeRequest extends AbstractCreateRepositoryAttributeRequest {} + +export interface SchemaValidatableCreateRepositoryAttributeRequest extends AbstractCreateRepositoryAttributeRequest {} + +class Validator implements IValidator { + public constructor(@Inject private readonly schemaRepository: SchemaRepository) {} + + public validate(value: CreateRepositoryAttributeRequest): Promise | ValidationResult { + const requestSchemaValidator = new SchemaValidator(this.schemaRepository.getSchema("CreateRepositoryAttributeRequest")); + const requestValidationResult = requestSchemaValidator.validate(value); + if (requestValidationResult.isInvalid()) return requestValidationResult; + + const attributeType = value.content.value["@type"]; + if (!AttributeValues.Identity.TYPE_NAMES.includes(attributeType)) { + const attributeTypeValidationResult = new ValidationResult(); + + attributeTypeValidationResult.addFailure( + new ValidationFailure( + RuntimeErrors.general.invalidPropertyValue("content.value.@type must match one of the allowed Attribute value types for IdentityAttributes"), + "@type" + ) + ); + return attributeTypeValidationResult; + } + + const attributeContentSchemaValidator = new SchemaValidator(this.schemaRepository.getSchema(attributeType)); + const attributeContentValidationResult = attributeContentSchemaValidator.validate(value.content.value); + return Validator.addPrefixToErrorMessagesOfResult(`${attributeType} :: `, attributeContentValidationResult); + } + + private static addPrefixToErrorMessagesOfResult(prefix: string, validationResult: ValidationResult): ValidationResult { + if (validationResult.isValid()) return validationResult; + + const failures = validationResult.getFailures(); + const failuresWithPrefix = failures.map( + (failure) => new ValidationFailure(new ApplicationError(failure.error.code, `${prefix}${failure.error.message}`, failure.error.data), failure.propertyName) + ); + + const validationResultWithPrefix = new ValidationResult(); + validationResultWithPrefix.addFailures(failuresWithPrefix); + return validationResultWithPrefix; } } diff --git a/packages/runtime/test/consumption/attributes.test.ts b/packages/runtime/test/consumption/attributes.test.ts index 06579755c..b86671e49 100644 --- a/packages/runtime/test/consumption/attributes.test.ts +++ b/packages/runtime/test/consumption/attributes.test.ts @@ -736,6 +736,100 @@ describe(CreateRepositoryAttributeUseCase.name, () => { expect(attribute.isDefault).toBeUndefined(); }); + describe("validation errors for the attribute content", () => { + test("should not create a number as GivenName", async () => { + const request: CreateRepositoryAttributeRequest = { + content: { + value: { + "@type": "GivenName", + value: 5 + }, + tags: ["tag1", "tag2"] + } as any + }; + const result = await services1.consumption.attributes.createRepositoryAttribute(request); + expect(result.error.message).toBe("GivenName :: value must be string"); + expect(result.error.code).toBe("error.runtime.validation.invalidPropertyValue"); + }); + + test("should not create a string as year of BirthDate", async () => { + const request: CreateRepositoryAttributeRequest = { + content: { + value: { + "@type": "BirthDate", + day: 5, + month: 5, + year: "a-string" + }, + tags: ["tag1", "tag2"] + } as any + }; + const result = await services1.consumption.attributes.createRepositoryAttribute(request); + expect(result.error.message).toBe("BirthDate :: year must be number"); + expect(result.error.code).toBe("error.runtime.validation.invalidPropertyValue"); + }); + + test("should not create a BirthDate with a missing year", async () => { + const request: CreateRepositoryAttributeRequest = { + content: { + value: { + "@type": "BirthDate", + day: 5, + month: 5 + }, + tags: ["tag1", "tag2"] + } as any + }; + const result = await services1.consumption.attributes.createRepositoryAttribute(request); + expect(result.error.message).toBe("BirthDate :: must have required property 'year'"); + expect(result.error.code).toBe("error.runtime.validation.invalidPropertyValue"); + }); + + test("should not create 14 as BirthMonth", async () => { + const request: CreateRepositoryAttributeRequest = { + content: { + value: { + "@type": "BirthMonth", + value: 14 + }, + tags: ["tag1", "tag2"] + } as any + }; + const result = await services1.consumption.attributes.createRepositoryAttribute(request); + expect(result.error.message).toBe("BirthMonth :: value must be equal to one of the allowed values"); + expect(result.error.code).toBe("error.runtime.validation.invalidPropertyValue"); + }); + + test("should not accept an additional property", async () => { + const request: CreateRepositoryAttributeRequest = { + content: { + value: { + "@type": "GivenName", + value: "aGivenName", + additionalProperty: 1 + }, + tags: ["tag1", "tag2"] + } as any + }; + const result = await services1.consumption.attributes.createRepositoryAttribute(request); + expect(result.error.message).toBe("GivenName :: must NOT have additional properties"); + expect(result.error.code).toBe("error.runtime.validation.invalidPropertyValue"); + }); + + test("should not accept an invalid @type", async () => { + const request: CreateRepositoryAttributeRequest = { + content: { + value: { + "@type": "invalid-type" + } + } + } as any; + const result = await services1.consumption.attributes.createRepositoryAttribute(request); + expect(result.error.message).toBe("content.value.@type must match one of the allowed Attribute value types for IdentityAttributes"); + expect(result.error.code).toBe("error.runtime.validation.invalidPropertyValue"); + }); + }); + test("should not create a duplicate RepositoryAttribute", async () => { const request: CreateRepositoryAttributeRequest = { content: {