This is an automated email from the ASF dual-hosted git repository. shuber pushed a commit to branch UNOMI-569-flatten-schemas in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 6b2928a647572b07a7f76e5621cfe046c242a899 Author: Serge Huber <[email protected]> AuthorDate: Wed May 25 19:11:34 2022 +0200 UNOMI-569 Flatten JSON Schemas & fix schema bugs - All schemas are now "flattened", meaning that each object is in a separate schema file (with a few exceptions) - Bug fixes in GraphQLSchemaProvider to detect loops in schemas - Fix events used in integration tests to avoid sending profile objects - Changed Event default initialization to avoid creating attributes when using default constructor - Added JAXBAnnotationModule in object mapper used in integration tests - Added system property to control logging in integration tests (to make it easier to see invalid schema logs that exist only in debug) - Fix deployment of test schemas in integration tests - --- api/src/main/java/org/apache/unomi/api/Event.java | 5 +- .../resources/META-INF/cxs/schemas/condition.json | 6 ++ .../META-INF/cxs/schemas/conditiontype.json | 6 ++ .../resources/META-INF/cxs/schemas/consent.json | 9 +- .../META-INF/cxs/schemas/consentType.json | 9 +- .../resources/META-INF/cxs/schemas/customitem.json | 9 +- .../cxs/schemas/customitem/properties.json | 14 +++ .../META-INF/cxs/schemas/customitems/page.json | 57 +---------- .../cxs/schemas/customitems/page/properties.json | 27 ++++++ .../customitems/page/properties/attributes.json | 15 +++ .../customitems/page/properties/pageInfo.json | 58 ++++++++++++ .../META-INF/cxs/schemas/customitems/site.json | 3 +- .../main/resources/META-INF/cxs/schemas/event.json | 9 ++ .../META-INF/cxs/schemas/events/form.json | 8 +- .../META-INF/cxs/schemas/events/goal.json | 13 +-- .../cxs/schemas/events/incrementInterest.json | 17 +--- .../events/incrementInterest/properties.json | 19 ++++ .../incrementInterest/properties/interests.json | 16 ++++ .../META-INF/cxs/schemas/events/modifyConsent.json | 12 +-- .../schemas/events/modifyConsent/properties.json | 18 ++++ .../cxs/schemas/events/profileDeleted.json | 19 ---- .../cxs/schemas/events/profileUpdated.json | 19 ---- .../META-INF/cxs/schemas/events/ruleFired.json | 30 ------ .../META-INF/cxs/schemas/events/search.json | 30 ------ .../cxs/schemas/events/sessionCreated.json | 30 ------ .../cxs/schemas/events/sessionReassigned.json | 30 ------ .../cxs/schemas/events/updateProperties.json | 12 +-- .../META-INF/cxs/schemas/events/view.json | 7 +- .../main/resources/META-INF/cxs/schemas/goal.json | 9 +- .../main/resources/META-INF/cxs/schemas/item.json | 11 ++- .../resources/META-INF/cxs/schemas/metadata.json | 9 +- .../META-INF/cxs/schemas/metadataitem.json | 9 +- .../resources/META-INF/cxs/schemas/parameter.json | 9 +- .../cxs/schemas/personalization/filter.json | 9 +- .../schemas/personalization/filter/properties.json | 13 +++ .../personalization/personalizationrequest.json | 9 +- .../personalizationrequest/strategyOptions.json | 13 +++ .../personalizedContent/properties.json | 13 +++ .../personalization/personalizedcontent.json | 9 +- .../cxs/schemas/personalization/target.json | 6 ++ .../resources/META-INF/cxs/schemas/profile.json | 7 +- .../resources/META-INF/cxs/schemas/session.json | 42 --------- .../META-INF/cxs/schemas/timestampeditem.json | 6 ++ .../META-INF/cxs/schemas/values/boolean.json | 7 ++ .../META-INF/cxs/schemas/values/date.json | 7 ++ .../META-INF/cxs/schemas/values/email.json | 7 ++ .../META-INF/cxs/schemas/values/integer.json | 7 ++ .../META-INF/cxs/schemas/values/long.json | 7 ++ .../resources/META-INF/cxs/schemas/values/set.json | 7 ++ .../META-INF/cxs/schemas/values/string.json | 7 ++ .../META-INF/cxs/schemas}/articleCompleted.json | 9 +- .../cxs/schemas/articleCompleted/properties.json | 22 +++++ .../resources/META-INF/cxs/schemas}/identify.json | 7 +- .../META-INF/cxs/schemas/identify/properties.json | 24 +++++ .../graphql/schema/GraphQLSchemaProvider.java | 31 ++++-- .../unomi/graphql/schema/json/JSONObjectType.java | 11 ++- .../apache/unomi/graphql/utils/EventBuilder.java | 2 +- .../test/java/org/apache/unomi/itests/BaseIT.java | 11 +++ .../test/java/org/apache/unomi/itests/BasicIT.java | 36 ++++++- .../org/apache/unomi/itests/ModifyConsentIT.java | 2 +- .../unomi/itests/PropertiesUpdateActionIT.java | 14 +-- .../src/test/resources/schemas/events/login.json | 13 ++- .../resources/schemas/events/test-event-type.json | 1 + .../actions/IncrementInterestAction.java | 2 +- .../baseplugin/actions/SetPropertyAction.java | 2 +- .../cxs/schemas/contextrequest/contextrequest.json | 8 +- .../contextrequest/contextrequestparams.json | 6 ++ .../cxs/schemas/contextrequest/source/source.json | 8 +- .../resources/META-INF/cxs/schemas/cookie.json | 6 ++ .../cxs/schemas/eventscollectorrequest.json | 13 +-- .../resources/META-INF/cxs/schemas}/login.json | 1 - .../META-INF/cxs/events/anonymizeProfile.json | 39 -------- .../META-INF/cxs/events/articleCompleted.json | 77 --------------- .../main/resources/META-INF/cxs/events/form.json | 77 --------------- .../main/resources/META-INF/cxs/events/goal.json | 83 ---------------- .../resources/META-INF/cxs/events/identify.json | 73 -------------- .../META-INF/cxs/events/incrementInterest.json | 49 ---------- .../main/resources/META-INF/cxs/events/login.json | 73 -------------- .../META-INF/cxs/events/modifyConsent.json | 105 --------------------- .../META-INF/cxs/events/profileDeleted.json | 39 -------- .../META-INF/cxs/events/profileUpdated.json | 39 -------- .../resources/META-INF/cxs/events/ruleFired.json | 91 ------------------ .../main/resources/META-INF/cxs/events/search.json | 53 ----------- .../META-INF/cxs/events/sessionCreated.json | 56 ----------- .../META-INF/cxs/events/sessionReassigned.json | 59 ------------ .../META-INF/cxs/events/updateProperties.json | 69 -------------- .../main/resources/META-INF/cxs/events/view.json | 77 --------------- 87 files changed, 579 insertions(+), 1439 deletions(-) diff --git a/api/src/main/java/org/apache/unomi/api/Event.java b/api/src/main/java/org/apache/unomi/api/Event.java index 45a129609..c12cb941b 100644 --- a/api/src/main/java/org/apache/unomi/api/Event.java +++ b/api/src/main/java/org/apache/unomi/api/Event.java @@ -73,7 +73,7 @@ public class Event extends Item implements TimestampedItem { private boolean persistent = true; - private transient Map<String, Object> attributes = new LinkedHashMap<>(); + private transient Map<String, Object> attributes; /** * Instantiates a new Event. @@ -168,7 +168,8 @@ public class Event extends Item implements TimestampedItem { this.properties = new HashMap<String, Object>(); - actionPostExecutors = new ArrayList<>(); + this.actionPostExecutors = new ArrayList<>(); + this.attributes = new LinkedHashMap<>(); } /** diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json index 71dbe421f..60eae3e8f 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/condition/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "condition", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Condition", "type": "object", "properties" : { diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json index 22e1ad0b2..ed18fabcb 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/conditiontype/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "conditionType", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "ConditionType", "type": "object", "properties" : { diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json index bb357fe64..557bb25fb 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/consent/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "consent", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Consent", "type": "object", "properties" : { @@ -21,5 +27,6 @@ "type" : "string", "format" : "date-time" } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json index 034a53121..995f77f9a 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/consentType/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "consentType", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "ConsentType", "type": "object", "properties" : { @@ -16,5 +22,6 @@ "description" : { "type" : ["null", "string"] } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json index 3ae685a1e..4098972f2 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/customitem/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "customItem", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "CustomItem", "type": "object", "allOf": [ @@ -13,8 +19,7 @@ "type" : "string" }, "properties" : { - "type" : "object", - "maxProperties": 50 + "$ref" : "https://unomi.apache.org/schemas/json/customitem/properties/1-0-0" } } } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem/properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem/properties.json new file mode 100644 index 000000000..ce8a96c21 --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem/properties.json @@ -0,0 +1,14 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/customitem/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "customItemProperties", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "CustomItemProperties", + "type": "object", + "properties": { + } +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json index fb2874f5a..e70789c8b 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json @@ -16,58 +16,9 @@ } ], "properties": { - "pageInfo": { - "type" : "object", - "properties" : { - "templateName": { - "type" : "string" - }, - "language": { - "type" : "string", - "maxLength": 5 - }, - "destinationURL": { - "type" : "string", - "format" : "uri" - }, - "categories": { - "type" : "array", - "items" : { "type" : "string"} - }, - "pageID": { - "type" : "string", - "pattern" : "^(\\w|[-_@\\.]){0,60}$" - }, - "nodeType": { - "type" : "string" - }, - "pagePath": { - "type" : "string" - }, - "pageName": { - "type" : "string" - }, - "referringURL": { - "type" : "string", - "format" : "uri" - }, - "tags": { - "type" : "array", - "items" : { "type" : "string" } - }, - "isContentTemplate": { - "type" : "boolean" - } - } - }, - "attributes": { - "type" : ["null", "object"] - }, - "consentTypes": { - "type" : ["null", "array"], - "items" : { - "$href" : "https://unomi.apache.org/schemas/json/consentType/1-0-0" - } + "properties" : { + "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/properties/1-0-0" } - } + }, + "unevaluatedProperties" : false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties.json new file mode 100644 index 000000000..083ba7bf9 --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties.json @@ -0,0 +1,27 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/customitems/page/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name":"pageProperties", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "PageProperties", + "type": "object", + "properties": { + "pageInfo": { + "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/properties/pageInfo/1-0-0" + }, + "attributes": { + "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/properties/attributes/1-0-0" + }, + "consentTypes": { + "type" : ["null", "array"], + "items" : { + "$ref" : "https://unomi.apache.org/schemas/json/consentType/1-0-0" + } + } + }, + "unevaluatedProperties" : false +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties/attributes.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties/attributes.json new file mode 100644 index 000000000..62d5cc22b --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties/attributes.json @@ -0,0 +1,15 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/customitems/page/properties/attributes/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self": { + "vendor": "org.apache.unomi", + "name": "attributes", + "format": "jsonschema", + "version": "1-0-0" + }, + "title": "Page Attributes", + "type": ["null", "object"], + "properties": { + }, + "unevaluatedProperties" : false +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties/pageInfo.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties/pageInfo.json new file mode 100644 index 000000000..a0f0b465b --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page/properties/pageInfo.json @@ -0,0 +1,58 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/customitems/page/properties/pageInfo/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self": { + "vendor": "org.apache.unomi", + "name": "pageInfo", + "format": "jsonschema", + "version": "1-0-0" + }, + "title": "PageInfo", + "type": "object", + "properties": { + "templateName": { + "type": "string" + }, + "language": { + "type": "string", + "maxLength": 5 + }, + "destinationURL": { + "type": "string", + "format": "uri" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "pageID": { + "type": "string", + "pattern": "^(\\w|[-_@\\.]){0,60}$" + }, + "nodeType": { + "type": "string" + }, + "pagePath": { + "type": "string" + }, + "pageName": { + "type": "string" + }, + "referringURL": { + "type": "string", + "format": "uri" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "isContentTemplate": { + "type": "boolean" + } + }, + "unevaluatedProperties" : false +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json index 2d67e7559..695b90cec 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json @@ -15,6 +15,5 @@ "$ref": "https://unomi.apache.org/schemas/json/customitem/1-0-0" } ], - "properties": { - } + "unevaluatedProperties" : false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json index 7c3b5bfd1..29fa59c8f 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/event/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "event", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Event", "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/timestampeditem/1-0-0" }], @@ -24,6 +30,9 @@ "sourceId" : { "type" : [ "string"], "pattern" : "^(\\w|[-_@\\.]){0,60}$" + }, + "persistent" : { + "type" : "boolean" } } } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json index e4c1575f2..0f162c015 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json @@ -12,16 +12,12 @@ "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { - "properties" : { - "type" : "object", - "unomiFormMappingLookup" : true, - "maxProperties": 50 - }, "source" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/site/1-0-0" }, "target" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" } - } + }, + "unevaluatedProperties" : false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json index 3c5a289ff..a1af65bb1 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json @@ -12,19 +12,12 @@ "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { - "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, "source" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" }, "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" + "$ref" : "https://unomi.apache.org/schemas/json/goal/1-0-0" } - } + }, + "unevaluatedProperties" : false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json index 8ae788cc9..39a9029d6 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json @@ -13,18 +13,9 @@ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, - "source" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" - }, - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" + "$ref" : "https://unomi.apache.org/schemas/json/events/incrementInterest/properties/1-0-0" } - } + }, + "$comment" : "TODO-interests as map must be refactored to use arrays before we can use unevaluatedProperties on this object", + "unevaluatedProperties" : false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/properties.json new file mode 100644 index 000000000..221ac420c --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/properties.json @@ -0,0 +1,19 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/events/incrementInterest/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "incrementInterestProperties", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "IncrementInterestProperties", + "type": "object", + "properties" : { + "interests" : { + "$ref" : "https://unomi.apache.org/schemas/json/events/incrementInterest/properties/interests/1-0-0" + } + }, + "$comment" : "TODO-interests as map must be refactored to use arrays before we can use unevaluatedProperties on this object", + "unevaluatedProperties" : false +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/properties/interests.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/properties/interests.json new file mode 100644 index 000000000..589e3c7a9 --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/properties/interests.json @@ -0,0 +1,16 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/events/incrementInterest/properties/interests/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "incrementInterestPropertiesInterests", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "IncrementInterestPropertiesInterests", + "type": "object", + "properties" : { + }, + "maxProperties" : 50, + "$comment" : "TODO-interests as map must be refactored to use arrays before we can use unevaluatedProperties on this object" +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json index 1f748e009..a04635ae2 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json @@ -13,18 +13,14 @@ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } + "$ref" : "https://unomi.apache.org/schemas/json/events/modifyConsent/properties/1-0-0" }, "source" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" }, "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" + "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" } - } + }, + "unevaluatedProperties" : false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/properties.json new file mode 100644 index 000000000..dec05c560 --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/properties.json @@ -0,0 +1,18 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/events/modifyConsent/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "modifyConsentProperties", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "ModifyConsentProperties", + "type": "object", + "properties" : { + "consent" : { + "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" + } + }, + "unevaluatedProperties": false +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileDeleted.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileDeleted.json deleted file mode 100644 index d6534d381..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileDeleted.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/events/profileDeleted/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "self":{ - "vendor":"org.apache.unomi", - "target" : "events", - "name": "profileDeleted", - "format":"jsonschema", - "version":"1-0-0" - }, - "title": "ProfileDeletedEvent", - "type": "object", - "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], - "properties" : { - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0" - } - } -} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileUpdated.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileUpdated.json deleted file mode 100644 index b936cddfe..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileUpdated.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/events/profileUpdated/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "self":{ - "vendor":"org.apache.unomi", - "target" : "events", - "name": "profileUpdated", - "format":"jsonschema", - "version":"1-0-0" - }, - "title": "ProfileUpdatedEvent", - "type": "object", - "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], - "properties" : { - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0" - } - } -} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/ruleFired.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/ruleFired.json deleted file mode 100644 index 615eb8149..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/ruleFired.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/events/ruleFired/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "self":{ - "vendor":"org.apache.unomi", - "target" : "events", - "name": "ruleFired", - "format":"jsonschema", - "version":"1-0-0" - }, - "title": "RuleFiredEvent", - "type": "object", - "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], - "properties" : { - "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, - "source" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" - }, - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" - } - } -} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/search.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/search.json deleted file mode 100644 index 4804547f4..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/search.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/events/search/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "self":{ - "vendor":"org.apache.unomi", - "target" : "events", - "name": "search", - "format":"jsonschema", - "version":"1-0-0" - }, - "title": "SearchEvent", - "type": "object", - "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], - "properties" : { - "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, - "source" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" - }, - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" - } - } -} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionCreated.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionCreated.json deleted file mode 100644 index 514967471..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionCreated.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/events/sessionCreated/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "self":{ - "vendor":"org.apache.unomi", - "target" : "events", - "name": "sessionCreated", - "format":"jsonschema", - "version":"1-0-0" - }, - "title": "SessionCreatedEvent", - "type": "object", - "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], - "properties" : { - "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, - "source" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" - }, - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" - } - } -} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionReassigned.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionReassigned.json deleted file mode 100644 index 7a7f338c0..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionReassigned.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/events/sessionReassigned/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "self":{ - "vendor":"org.apache.unomi", - "target" : "events", - "name": "sessionReassigned", - "format":"jsonschema", - "version":"1-0-0" - }, - "title": "SessionReassignedEvent", - "type": "object", - "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], - "properties" : { - "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, - "source" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" - }, - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" - } - } -} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json index 4cd408ed4..2c232184c 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json @@ -14,17 +14,7 @@ "properties" : { "properties" : { "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } - }, - "source" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" - }, - "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0" + "maxProperties": 50 } } } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json index 184044926..49683494b 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json @@ -12,15 +12,12 @@ "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { - "properties" : { - "type" : "object", - "maxProperties": 50 - }, "source" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/site/1-0-0" }, "target" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json index 57d922b74..e081a46b2 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/goal/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "goal", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Goal", "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/metadataitem/1-0-0" }], @@ -14,5 +20,6 @@ "campaignId" : { "type" : "string" } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json index c9b697b68..5c71db49b 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/item/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "item", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Item", "type": "object", "properties" : { @@ -21,11 +27,6 @@ "type" : ["null","integer"], "minimum" : 0, "description" : "The item's version number" - }, - "systemMetadata" : { - "type" : ["null","object"], - "description" : "Any system metadata for the item", - "maxProperties" : 50 } } } diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json index 03d4f7199..8fd863321 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/metadata/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "metadata", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Metadata", "type": "object", "properties" : { @@ -40,5 +46,6 @@ "readOnly" : { "type" : "boolean" } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json index fcdbe1cd2..4e1dd917c 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/metadataitem/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "metadataItem", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "MetadataItem", "type": "object", "allOf": [ @@ -10,5 +16,6 @@ "metadata" : { "$ref" : "https://unomi.apache.org/schemas/json/metadata/1-0-0" } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json index cba8c6d32..8fee7ea44 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/parameter/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "parameter", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Parameter", "type": "object", "properties" : { @@ -16,5 +22,6 @@ "defaultValue" : { "type" : "string" } - } + }, + "unevaluatedProperties": false } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json index 112be929e..fff1f39c6 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/personalization/filter/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "filter", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Filter", "type": "object", "properties": { @@ -14,8 +20,7 @@ "$ref": "https://unomi.apache.org/schemas/json/condition/1-0-0" }, "properties": { - "type": "object", - "maxProperties": 50 + "$ref" : "https://unomi.apache.org/schemas/json/personalization/filter/properties/1-0-0" } } } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter/properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter/properties.json new file mode 100644 index 000000000..25b41236e --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter/properties.json @@ -0,0 +1,13 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/personalization/filter/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "filterProperties", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "FilterProperties", + "type": "object", + "maxProperties": 50 +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json index 37e99f71c..0c2aaea6f 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/personalization/personalizedrequest/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "personalizationRequest", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "PersonalizationRequest", "type": "object", "properties": { @@ -11,8 +17,7 @@ "type" : "string" }, "strategyOptions" : { - "type": "object", - "maxProperties": 50 + "$ref" : "https://unomi.apache.org/schemas/json/personalization/personalizedrequest/strategyOptions/1-0-0" }, "contents" : { "type" : "array", diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest/strategyOptions.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest/strategyOptions.json new file mode 100644 index 000000000..26f8f2ad5 --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest/strategyOptions.json @@ -0,0 +1,13 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/personalization/personalizedrequest/strategyOptions/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "strategyOptions", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "StrategyOptions", + "type": "object", + "maxProperties": 50 +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedContent/properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedContent/properties.json new file mode 100644 index 000000000..5cafaf212 --- /dev/null +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedContent/properties.json @@ -0,0 +1,13 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/personalization/personalizedcontent/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "personalizedContentProperties", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "PersonalizedContentProperties", + "type": "object", + "maxProperties": 50 +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json index b8a29ef73..d6742f47a 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/personalization/personalizedcontent/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "personalizedContent", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "PersonalizedContent", "type": "object", "properties": { @@ -15,8 +21,7 @@ "maxProperties": 50 }, "properties": { - "type": "object", - "maxProperties": 50 + "$ref" : "https://unomi.apache.org/schemas/json/personalization/personalizedcontent/properties/1-0-0" } } } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json index 4de017a47..7fa09768f 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/personalization/target/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "target", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Target", "type": "object", "properties": { diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json index e32eef5cb..381b8b6eb 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/profile/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "profile", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Profile", "type": "object", "allOf": [ @@ -11,7 +17,6 @@ "properties": { "properties" : { "type" : "object", - "unomiPropertyTypes" : [ "profiles" ], "maxProperties": 50 }, "systemProperties" : { diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/session.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/session.json deleted file mode 100644 index 8f7b7673b..000000000 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/session.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$id": "https://unomi.apache.org/schemas/json/session/1-0-0", - "$schema": "https://json-schema.org/draft/2019-09/schema", - "title": "Session", - "type": "object", - "allOf": [ - { - "$ref": "https://unomi.apache.org/schemas/json/timestampeditem/1-0-0" - } - ], - "properties": { - "profileId" : { - "type" : "string" - }, - "profile" : { - "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0" - }, - "properties" : { - "type" : "object", - "unomiPropertyTypes" : [ "sessions" ], - "maxProperties": 50 - }, - "systemProperties" : { - "type" : "object", - "maxProperties": 50 - }, - "timeStamp" : { - "type" : "string", - "format" : "date-time" - }, - "lastEventDate" : { - "type" : "string", - "format" : "date-time" - }, - "size" : { - "type" : "integer" - }, - "duration" : { - "type" : "integer" - } - } -} diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json index b1e81567b..db8f078e2 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/timestampeditem/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "timestampedItem", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "TimestampedItem", "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0" }], diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json index 752057b41..18a440e0d 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/boolean/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "boolean", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Boolean", "type": "boolean" } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json index 2ad073966..d59e420e7 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/date/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "date", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Date", "type": "string", "format" : "date-time" diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json index d425eff2e..6d8eebe57 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/email/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "email", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Email", "type": "string", "format" : "email" diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json index b3c68a6c0..77017c3fb 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/integer/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "integer", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Integer", "type": "integer" } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json index 9eb7c8db9..e64d2764a 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/long/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "long", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Long", "type": "integer" } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json index 9f43666dd..2e7ac754f 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/set/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "set", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Set", "type": "object", "maxProperties": 50 diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json index f0b9c308f..40c44b3c9 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json +++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json @@ -1,6 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/values/string/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "target" : "values", + "name": "string", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "String", "type": "string" } \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/articleCompleted.json b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/articleCompleted.json similarity index 76% rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/articleCompleted.json rename to extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/articleCompleted.json index d493adf5e..3d034fd39 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/articleCompleted.json +++ b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/articleCompleted.json @@ -8,17 +8,12 @@ "format":"jsonschema", "version":"1-0-0" }, - "title": "AnonimyzeProfileEvent", + "title": "ArticleCompletedEvent", "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } + "$ref" : "https://unomi.apache.org/schemas/json/events/articleCompleted/properties/1-0-0" }, "source" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" diff --git a/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/articleCompleted/properties.json b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/articleCompleted/properties.json new file mode 100644 index 000000000..ab8b12d68 --- /dev/null +++ b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/articleCompleted/properties.json @@ -0,0 +1,22 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/events/articleCompleted/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self": { + "vendor": "org.apache.unomi", + "target": "events", + "name": "articleCompletedProperties", + "format": "jsonschema", + "version": "1-0-0" + }, + "title": "ArticleCompletedProperties", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "course": { + "type": "string" + } + } +} +} \ No newline at end of file diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/identify.json b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/identify.json similarity index 80% rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/identify.json rename to extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/identify.json index 657235b43..8375141e2 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/identify.json +++ b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/identify.json @@ -13,12 +13,7 @@ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { "properties" : { - "type" : "object", - "properties" : { - "consent" : { - "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0" - } - } + "$ref" : "https://unomi.apache.org/schemas/json/events/identify/properties/1-0-0" }, "source" : { "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0" diff --git a/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/identify/properties.json b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/identify/properties.json new file mode 100644 index 000000000..14279b280 --- /dev/null +++ b/extensions/web-tracker/wab/src/main/resources/META-INF/cxs/schemas/identify/properties.json @@ -0,0 +1,24 @@ +{ + "$id": "https://unomi.apache.org/schemas/json/events/identify/properties/1-0-0", + "$schema": "https://json-schema.org/draft/2019-09/schema", + "self": { + "vendor": "org.apache.unomi", + "target": "events", + "name": "identifyProperties", + "format": "jsonschema", + "version": "1-0-0" + }, + "title": "IdentifyProperties", + "type": "object", + "properties": { + "nickname": { + "type": "string" + }, + "favoriteCompiler": { + "type": "string" + }, + "industry": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java index 84b9ec8bc..a4b082d7d 100644 --- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java +++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java @@ -164,11 +164,16 @@ public class GraphQLSchemaProvider { Optional<JSONType> firstNonNullType = jsonTypes.stream().filter(jsonType -> !"null".equals(jsonType.getType())).findFirst(); if (firstNonNullType.isPresent()) { this.firstNonNullType = firstNonNullType.get(); + } else { + logger.warn("Couldn't find non null type for {} and types {}", name, jsonTypes); } } @Override public String getTypeId() { + if (firstNonNullType == null) { + return null; + } return firstNonNullType.getType(); } @@ -345,7 +350,7 @@ public class GraphQLSchemaProvider { final GraphQLInputObjectType objectType; if (!graphQLAnnotations.getContainer().getTypeRegistry().containsKey(typeName)) { - objectType = createDynamicEventInputType(new JSONTypeDefinitionType(unomiEventType.getName(), unomiEventType.getRootTypes())); + objectType = createDynamicEventInputType(new JSONTypeDefinitionType(unomiEventType.getName(), unomiEventType.getRootTypes()), new ArrayDeque<>()); } else { objectType = (GraphQLInputObjectType) getFromTypeRegistry(typeName); registerDynamicInputFields(typeName, objectType, new JSONTypeDefinitionType(unomiEventType.getName(), unomiEventType.getRootTypes()).getSubTypes()); @@ -525,15 +530,23 @@ public class GraphQLSchemaProvider { return null; } - private GraphQLInputObjectType createDynamicEventInputType(final DefinitionType eventType) { - return createDynamicInputType(UnomiToGraphQLConverter.convertEventType(eventType.getName()), eventType.getSubTypes(), true); + private GraphQLInputObjectType createDynamicEventInputType(final DefinitionType eventType, Deque<String> typeStack) { + return createDynamicInputType(UnomiToGraphQLConverter.convertEventType(eventType.getName()), eventType.getSubTypes(), true, typeStack); } - private GraphQLInputObjectType createDynamicSetInputType(final DefinitionType propertyType, final String parentName) { - return createDynamicInputType(parentName != null ? parentName : propertyType.getName(), propertyType.getSubTypes(), false); + private GraphQLInputObjectType createDynamicSetInputType(final DefinitionType propertyType, final String parentName, Deque<String> typeStack) { + return createDynamicInputType(parentName != null ? parentName : propertyType.getName(), propertyType.getSubTypes(), false, typeStack); } - private GraphQLInputObjectType createDynamicInputType(final String name, final List<DefinitionType> propertyTypes, final boolean isEvent) { + private GraphQLInputObjectType createDynamicInputType(final String name, + final List<DefinitionType> propertyTypes, + final boolean isEvent, + Deque<String> typeStack) { + if (typeStack.contains(name)) { + logger.error("Loop detected when creating dynamic input types {} !" , typeStack); + return null; + } + typeStack.push(name); final String typeName = StringUtils.capitalize(PropertyNameTranslator.translateFromUnomiToGraphQL(name)) + "Input"; final GraphQLInputObjectType.Builder dynamicTypeBuilder = GraphQLInputObjectType.newInputObject() @@ -554,7 +567,7 @@ public class GraphQLSchemaProvider { GraphQLInputType objectType; if (isSet) { - objectType = createDynamicSetInputType(childPropertyType, typeName + "_" + childPropertyName); + objectType = createDynamicSetInputType(childPropertyType, typeName + "_" + childPropertyName, typeStack); } else { objectType = (GraphQLInputType) UnomiToGraphQLConverter.convertPropertyType(childPropertyType.getTypeId()); } @@ -572,8 +585,10 @@ public class GraphQLSchemaProvider { fieldDefinitions.forEach(dynamicTypeBuilder::field); final GraphQLInputObjectType objectType = dynamicTypeBuilder.build(); registerInTypeRegistry(typeName, objectType); + typeStack.pop(); return objectType; } else { + typeStack.pop(); return null; } } @@ -597,7 +612,7 @@ public class GraphQLSchemaProvider { final String typeName = StringUtils.capitalize(propertyName) + "Input"; if (!graphQLAnnotations.getContainer().getTypeRegistry().containsKey(typeName)) { - final GraphQLInputObjectType inputType = createDynamicSetInputType(propertyType, null); + final GraphQLInputObjectType inputType = createDynamicSetInputType(propertyType, null, new ArrayDeque<>()); if (inputType != null) { fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField() .name(propertyName) diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java index be91e0a2b..ca5770454 100644 --- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java +++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java @@ -16,12 +16,17 @@ */ package org.apache.unomi.graphql.schema.json; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.HashMap; import java.util.List; import java.util.Map; public class JSONObjectType extends JSONType { + private static final Logger logger = LoggerFactory.getLogger(JSONTypeFactory.class); + Map<String, List<JSONType>> properties = new HashMap<>(); JSONType additionalProperties; Map<String, List<JSONType>> patternProperties = new HashMap<>(); @@ -35,7 +40,11 @@ public class JSONObjectType extends JSONType { Map<String, Object> propertiesTree = (Map<String, Object>) schemaTree.get("properties"); if (propertiesTree != null) { propertiesTree.entrySet().forEach(entry -> { - properties.put(entry.getKey(), jsonTypeFactory.getTypes((Map<String, Object>) entry.getValue())); + if (entry.getValue() instanceof Map) { + properties.put(entry.getKey(), jsonTypeFactory.getTypes((Map<String, Object>) entry.getValue())); + } else { + logger.error("Expected map type for property {}, instead found {}", entry.getKey(), entry.getValue().getClass()); + } }); } } diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java index 9c94efacc..b8948fe43 100644 --- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java +++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java @@ -69,7 +69,7 @@ public class EventBuilder { } public Event build() { - final Event event = new Event(eventType, null, profile, null, null, profile, new Date()); + final Event event = new Event(eventType, null, profile, null, null, null, new Date()); event.setPersistent(persistent); event.setProperty("targetId", profile.getItemId()); event.setProperty("targetType", Profile.ITEM_TYPE); diff --git a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java index 6a2591c40..c399c17ab 100644 --- a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java @@ -18,7 +18,9 @@ package org.apache.unomi.itests; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule; import org.apache.commons.io.IOUtils; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; @@ -118,6 +120,8 @@ public abstract class BaseIT { static { objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JaxbAnnotationModule()); + objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); } @@ -280,6 +284,13 @@ public abstract class BaseIT { LOGGER.warn("Unable to set jacoco agent as {} was not found", agentFile); } + String customLogging = System.getProperty("it.karaf.customLogging"); + if (customLogging != null) { + String[] customLoggingParts = customLogging.split(":"); + options.add(editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j2.logger.customLogging.name", customLoggingParts[0])); + options.add(editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j2.logger.customLogging.level", customLoggingParts[1])); + } + if (JavaVersionUtil.getMajorVersion() >= 9) { Option[] jdk9PlusOptions = new Option[]{ new VMOption("--add-reads=java.xml=java.logging"), diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java index b90c0b0ab..9606da312 100644 --- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java @@ -39,6 +39,7 @@ import org.apache.unomi.api.services.ProfileService; import org.apache.unomi.api.services.RulesService; import org.apache.unomi.itests.tools.httpclient.HttpClientThatWaitsForUnomi; import org.apache.unomi.persistence.spi.CustomObjectMapper; +import org.apache.unomi.schema.api.SchemaService; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -69,6 +70,7 @@ public class BasicIT extends BaseIT { private static final String SESSION_ID_4 = "aa3b04bd-8f4d-4a07-8e96-d33ffa04d3d4"; private static final String EVENT_TYPE_LOGIN = "login"; + private static final String EVENT_TYPE_LOGIN_SCHEMA = "schemas/events/login.json"; private static final String EVENT_TYPE_VIEW = "view"; private static final String TEST_SCOPE = "testScope"; @@ -98,6 +100,8 @@ public class BasicIT extends BaseIT { protected ProfileService profileService; @Inject @Filter(timeout = 600000) protected DefinitionsService definitionsService; + @Inject @Filter(timeout = 600000) + protected SchemaService schemaService; @Test public void testContextJS() throws IOException { @@ -149,6 +153,13 @@ public class BasicIT extends BaseIT { @Test public void testMultipleLoginOnSameBrowser() throws IOException, InterruptedException { LOGGER.info("Start test testMultipleLoginOnSameBrowser"); + + schemaService.saveSchema(resourceAsString(EVENT_TYPE_LOGIN_SCHEMA)); + keepTrying("Couldn't find login JSON schema", + () -> schemaService.getInstalledJsonSchemaIds(), + (schemaIds) -> (schemaIds.contains("https://unomi.apache.org/schemas/json/events/login/1-0-0")), + DEFAULT_TRYING_TIMEOUT, DEFAULT_TRYING_TRIES); + // Add login event condition ConditionType conditionType = CustomObjectMapper.getObjectMapper().readValue( new File("data/tmp/testLoginEventCondition.json").toURI().toURL(), ConditionType.class); @@ -269,6 +280,13 @@ public class BasicIT extends BaseIT { checkVisitor1ResponseProperties(profileVisitor1.getProperties()); Profile profileVisitor2 = profileService.load(profileIdVisitor2); checkVisitor2ResponseProperties(profileVisitor2.getProperties()); + + // cleanup schemas + schemaService.deleteSchema("https://unomi.apache.org/schemas/json/events/login/1-0-0"); + keepTrying("Should not find login JSON schema anymore", + () -> schemaService.getInstalledJsonSchemaIds(), + (schemaIds) -> (!schemaIds.contains("https://unomi.apache.org/schemas/json/events/login/1-0-0")), + DEFAULT_TRYING_TIMEOUT, DEFAULT_TRYING_TRIES); LOGGER.info("End test testMultipleLoginOnSameBrowser"); } @@ -278,8 +296,12 @@ public class BasicIT extends BaseIT { CustomItem loginEventTarget = new CustomItem(visitorId, ITEM_TYPE_VISITOR); loginEventTarget.setProperties(loginEventProperties); - Event loginEvent = new Event(EVENT_TYPE_LOGIN, null, new Profile(""), TEST_SCOPE, - null, loginEventTarget, new Date()); + // We use setters to avoid having auto-populated fields by the other event constructor methods. + Event loginEvent = new Event(); + loginEvent.setEventType(EVENT_TYPE_LOGIN); + loginEvent.setScope(TEST_SCOPE); + loginEvent.setTarget(loginEventTarget); + loginEvent.setTimeStamp(new Date()); ContextRequest contextRequest = new ContextRequest(); contextRequest.setSource(sourceSite); @@ -301,8 +323,14 @@ public class BasicIT extends BaseIT { customPageItem.setProperties(properties); - // Create page view event to mock a connection to a site - Event pageViewEvent = new Event(EVENT_TYPE_VIEW, null, new Profile(""), TEST_SCOPE, sourceSite, customPageItem, new Date()); + // Create page view event to mock a connection to a site. We use setters to avoid having auto-populated fields + Event pageViewEvent = new Event(); + pageViewEvent.setEventType(EVENT_TYPE_VIEW); + pageViewEvent.setSessionId(sessionId); + pageViewEvent.setScope(TEST_SCOPE); + pageViewEvent.setSource(sourceSite); + pageViewEvent.setTarget(customPageItem); + pageViewEvent.setTimeStamp(new Date()); // Initialize context like if you display the first page on the website ContextRequest contextRequest = new ContextRequest(); diff --git a/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java b/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java index 1ef7b80e7..1deb98cbe 100644 --- a/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java @@ -72,7 +72,7 @@ public class ModifyConsentIT extends BaseIT { Assert.assertNotNull(profile); Assert.assertEquals(0, profile.getConsents().size()); - Event modifyConsentEvent = new Event("modifyConsent", null, profile, null, null, profile, new Date()); + Event modifyConsentEvent = new Event("modifyConsent", null, profile, null, null, null, new Date()); modifyConsentEvent.setPersistent(false); ISO8601DateFormat dateFormat = new ISO8601DateFormat(); diff --git a/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java b/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java index 8dd022a68..4628332e2 100644 --- a/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java +++ b/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java @@ -97,7 +97,7 @@ public class PropertiesUpdateActionIT extends BaseIT { Profile profile = profileService.load(PROFILE_TARGET_TEST_ID); Assert.assertNull(profile.getProperty("firstName")); - Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); Map<String, Object> propertyToUpdate = new HashMap<>(); @@ -121,7 +121,7 @@ public class PropertiesUpdateActionIT extends BaseIT { Profile profileToUpdate = profileService.load(PROFILE_TEST_ID); Assert.assertNull(profileToUpdate.getProperty("firstName")); - Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); Map<String, Object> propertyToUpdate = new HashMap<>(); @@ -140,7 +140,7 @@ public class PropertiesUpdateActionIT extends BaseIT { public void testUpdateProperties_CurrentProfile_PROPS_TO_ADD() throws InterruptedException { Profile profile = profileService.load(PROFILE_TEST_ID); - Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); Map<String, Object> propertyToAdd = new HashMap<>(); @@ -169,7 +169,7 @@ public class PropertiesUpdateActionIT extends BaseIT { @Test public void testUpdateProperties_CurrentProfile_PROPS_TO_ADD_TO_SET() throws InterruptedException { Profile profile = profileService.load(PROFILE_TEST_ID); - Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); Map<String, Object> propertyToAddToSet = new HashMap<>(); @@ -196,7 +196,7 @@ public class PropertiesUpdateActionIT extends BaseIT { propertyToAddToSet.put("properties.prop1", "New property 1 bis"); propertyToAddToSet.put("properties.prop3", "New property 3 bis"); - updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_ADD_TO_SET, propertyToAddToSet); updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, PROFILE_TEST_ID); @@ -216,7 +216,7 @@ public class PropertiesUpdateActionIT extends BaseIT { @Test public void testUpdateProperties_CurrentProfile_PROPS_TO_DELETE() throws InterruptedException { Profile profile = profileService.load(PROFILE_TEST_ID); - Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); Map<String, Object> propertyToAdd = new HashMap<>(); @@ -242,7 +242,7 @@ public class PropertiesUpdateActionIT extends BaseIT { List<String> propertyToDelete = new ArrayList<>(); propertyToDelete.add("properties.prop1bis"); - updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date()); + updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date()); updateProperties.setPersistent(false); updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_DELETE, propertyToDelete); updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, PROFILE_TEST_ID); diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/anonymizeProfile.json b/itests/src/test/resources/schemas/events/login.json similarity index 57% rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/anonymizeProfile.json rename to itests/src/test/resources/schemas/events/login.json index bdfabc0fa..a1118ba1d 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/anonymizeProfile.json +++ b/itests/src/test/resources/schemas/events/login.json @@ -1,19 +1,24 @@ { - "$id": "https://unomi.apache.org/schemas/json/events/anonymizeProfile/1-0-0", + "$id": "https://unomi.apache.org/schemas/json/events/login/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", "self":{ "vendor":"org.apache.unomi", "target" : "events", - "name": "anonymizeProfile", + "name": "login", "format":"jsonschema", "version":"1-0-0" }, - "title": "AnonymizeProfileEvent", + "title": "LoginEvent", "type": "object", "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }], "properties" : { + "properties" : { + "type" : "object", + "maxProperties": 50 + }, "target" : { - "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0" + "type" : "object", + "maxProperties": 50 } } } \ No newline at end of file diff --git a/itests/src/test/resources/schemas/events/test-event-type.json b/itests/src/test/resources/schemas/events/test-event-type.json index 8d5a928a2..3a30f59d8 100644 --- a/itests/src/test/resources/schemas/events/test-event-type.json +++ b/itests/src/test/resources/schemas/events/test-event-type.json @@ -3,6 +3,7 @@ "$schema": "https://json-schema.org/draft/2019-09/schema", "self":{ "vendor":"org.apache.unomi", + "target":"events", "name":"testEventType", "format":"jsonschema", "target":"events", diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java index 0c2982362..3d76d1bee 100644 --- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java +++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java @@ -89,7 +89,7 @@ public class IncrementInterestAction implements ActionExecutor { final Map<String, Object> propertyToUpdate = new HashMap<>(); propertyToUpdate.put("properties.interests", profileInterestsMap); - final Event updatePropertiesEvent = new Event("updateProperties", null, profile, null, null, profile, new Date()); + final Event updatePropertiesEvent = new Event("updateProperties", null, profile, null, null, null, new Date()); updatePropertiesEvent.setProperty("update", propertyToUpdate); return eventService.send(updatePropertiesEvent); diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java index 23d2364b5..870159ed4 100644 --- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java +++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java @@ -62,7 +62,7 @@ public class SetPropertyAction implements ActionExecutor { Map<String, Object> propertyToUpdate = new HashMap<>(); propertyToUpdate.put(propertyName, propertyValue); - Event updateProperties = new Event("updateProperties", event.getSession(), event.getProfile(), event.getSourceId(), null, event.getProfile(), new Date()); + Event updateProperties = new Event("updateProperties", event.getSession(), event.getProfile(), event.getSourceId(), null, null, new Date()); updateProperties.setPersistent(false); updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_UPDATE, propertyToUpdate); diff --git a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json index 8284e73d1..880007751 100644 --- a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json +++ b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/contextrequest/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "contextRequest", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "ContextRequest", "type": "object", "properties": { @@ -28,7 +34,7 @@ "events": { "type": ["null", "array"], "items": { - "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" + "type": "object" } }, "filters": { diff --git a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json index 6e115f3cb..fe4a32896 100644 --- a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json +++ b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/contextrequestparams/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "contextRequestParams", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "ContextRequestParams", "type": "object", "properties": { diff --git a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json index 4265f70bc..9e451fb3a 100644 --- a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json +++ b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json @@ -1,7 +1,13 @@ { "$id": "https://unomi.apache.org/schemas/json/contextrequest/source/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", - "title": "Item", + "self":{ + "vendor":"org.apache.unomi", + "name": "source", + "format":"jsonschema", + "version":"1-0-0" + }, + "title": "Source", "type": "object", "properties" : { "itemId" : { diff --git a/rest/src/main/resources/META-INF/cxs/schemas/cookie.json b/rest/src/main/resources/META-INF/cxs/schemas/cookie.json index 1e82ada08..8b6d01f1a 100644 --- a/rest/src/main/resources/META-INF/cxs/schemas/cookie.json +++ b/rest/src/main/resources/META-INF/cxs/schemas/cookie.json @@ -1,6 +1,12 @@ { "$id": "https://unomi.apache.org/schemas/json/cookie/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "cookie", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "Cookie", "type": "object", "properties": { diff --git a/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json b/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json index 781ff2862..783e8d2b3 100644 --- a/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json +++ b/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json @@ -1,18 +1,19 @@ { "$id": "https://unomi.apache.org/schemas/json/eventscollectorrequest/1-0-0", "$schema": "https://json-schema.org/draft/2019-09/schema", + "self":{ + "vendor":"org.apache.unomi", + "name": "eventsCollectorRequest", + "format":"jsonschema", + "version":"1-0-0" + }, "title": "EventsCollectorRequest", "type": "object", - "allOf": [ - { - "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0" - } - ], "properties": { "events" : { "type": ["array"], "items": { - "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" + "type": "object" }, "minItems": 1 }, diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login.json b/samples/login-integration/src/main/resources/META-INF/cxs/schemas/login.json similarity index 93% rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login.json rename to samples/login-integration/src/main/resources/META-INF/cxs/schemas/login.json index f00ef5874..17b814235 100644 --- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login.json +++ b/samples/login-integration/src/main/resources/META-INF/cxs/schemas/login.json @@ -14,7 +14,6 @@ "properties" : { "properties" : { "type" : "object", - "unomiPropertyTypes" : [ "events" ], "maxProperties": 50 }, "target" : { diff --git a/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json b/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json deleted file mode 100644 index ef8dab271..000000000 --- a/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type" : "anonymizeProfile", - "propertyTypes" : [ - { - "itemId": "target", - "type": "set", - "childPropertyTypes": [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/articleCompleted.json b/services/src/main/resources/META-INF/cxs/events/articleCompleted.json deleted file mode 100644 index 9e316628e..000000000 --- a/services/src/main/resources/META-INF/cxs/events/articleCompleted.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "type" : "articleCompleted", - "propertyTypes" : [ - { - "itemId": "properties", - "type": "set" - }, - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/form.json b/services/src/main/resources/META-INF/cxs/events/form.json deleted file mode 100644 index 455116895..000000000 --- a/services/src/main/resources/META-INF/cxs/events/form.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "type" : "form", - "propertyTypes" : [ - { - "itemId": "properties", - "type": "set" - }, - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/goal.json b/services/src/main/resources/META-INF/cxs/events/goal.json deleted file mode 100644 index 11468cc55..000000000 --- a/services/src/main/resources/META-INF/cxs/events/goal.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type" : "goal", - "propertyTypes" : [ - { - "itemId" : "source", - "type": "set" - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "campaignId", - "type" : "string" - }, - { - "itemId" : "startEvent", - "type" : "set" - }, - { - "itemId" : "targetEvent", - "type" : "set" - }, - { - "itemId" : "metadata", - "type" : "set", - "childPropertyTypes" : [ - { - "itemId": "id", - "type": "string" - }, - { - "itemId": "name", - "type": "string" - }, - { - "itemId": "description", - "type": "string" - }, - { - "itemId": "scope", - "type": "string" - }, - { - "itemId": "tags", - "multivalued" : true, - "type": "string" - }, - { - "itemId": "enabled", - "type": "boolean" - }, - { - "itemId": "missingPlugins", - "type": "boolean" - }, - { - "itemId": "hidden", - "type": "boolean" - }, - { - "itemId": "readOnly", - "type": "boolean" - } - ] - } - ] - } - - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/identify.json b/services/src/main/resources/META-INF/cxs/events/identify.json deleted file mode 100644 index 1fb001de4..000000000 --- a/services/src/main/resources/META-INF/cxs/events/identify.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "type": "identify", - "propertyTypes": [ - { - "itemId": "properties", - "type": "set" - }, - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} diff --git a/services/src/main/resources/META-INF/cxs/events/incrementInterest.json b/services/src/main/resources/META-INF/cxs/events/incrementInterest.json deleted file mode 100644 index 8604990b9..000000000 --- a/services/src/main/resources/META-INF/cxs/events/incrementInterest.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "type" : "incrementInterest", - "propertyTypes" : [ - { - "itemId": "properties", - "type": "set", - "childPropertyTypes": [ - { - "itemId" : "interests", - "type" : "set" - } - ] - }, - { - "itemId": "target", - "type": "set", - "childPropertyTypes": [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/login.json b/services/src/main/resources/META-INF/cxs/events/login.json deleted file mode 100644 index 4e6625567..000000000 --- a/services/src/main/resources/META-INF/cxs/events/login.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "type": "login", - "propertyTypes": [ - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId": "target", - "type": "set", - "childPropertyTypes": [ - { - "itemId": "itemId", - "type": "string" - }, - { - "itemId": "itemType", - "type": "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId": "scope", - "type": "string" - }, - { - "itemId": "properties", - "type": "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} diff --git a/services/src/main/resources/META-INF/cxs/events/modifyConsent.json b/services/src/main/resources/META-INF/cxs/events/modifyConsent.json deleted file mode 100644 index 5eec0bfb5..000000000 --- a/services/src/main/resources/META-INF/cxs/events/modifyConsent.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "type" : "modifyConsent", - "propertyTypes" : [ - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId" : "target", - "type" : "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId" : "properties", - "type" : "set", - "childPropertyTypes" : [ - { - "itemId" : "consent", - "type" : "set", - "childPropertyTypes" : [ - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "typeIdentifier", - "type" : "string" - }, - { - "itemId" : "status", - "type" : "string" - }, - { - "itemId" : "statusDate", - "type" : "date" - }, - { - "itemId" : "revokeDate", - "type" : "date" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/profileDeleted.json b/services/src/main/resources/META-INF/cxs/events/profileDeleted.json deleted file mode 100644 index 62fed55ef..000000000 --- a/services/src/main/resources/META-INF/cxs/events/profileDeleted.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type" : "profileDeleted", - "propertyTypes" : [ - { - "itemId": "target", - "type": "set", - "childPropertyTypes": [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/profileUpdated.json b/services/src/main/resources/META-INF/cxs/events/profileUpdated.json deleted file mode 100644 index 78c675a26..000000000 --- a/services/src/main/resources/META-INF/cxs/events/profileUpdated.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "type": "profileUpdated", - "propertyTypes" : [ - { - "itemId": "target", - "type": "set", - "childPropertyTypes": [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} diff --git a/services/src/main/resources/META-INF/cxs/events/ruleFired.json b/services/src/main/resources/META-INF/cxs/events/ruleFired.json deleted file mode 100644 index 2a0f4c67b..000000000 --- a/services/src/main/resources/META-INF/cxs/events/ruleFired.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "type" : "ruleFired", - "propertyTypes" : [ - { - "itemId" : "source", - "type": "set" - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "linkedItems", - "type" : "string", - "multivalued" : true - }, - { - "itemId" : "priority", - "type" : "long" - }, - { - "itemId" : "raiseEventOnlyOnceForProfile", - "type" : "boolean" - }, - { - "itemId" : "raiseEventOnlyOnceForSession", - "type" : "boolean" - }, - { - "itemId" : "raiseEventOnlyOnce", - "type" : "boolean" - }, - { - "itemId" : "metadata", - "type" : "set", - "childPropertyTypes" : [ - { - "itemId": "id", - "type": "string" - }, - { - "itemId": "name", - "type": "string" - }, - { - "itemId": "description", - "type": "string" - }, - { - "itemId": "scope", - "type": "string" - }, - { - "itemId": "tags", - "multivalued" : true, - "type": "string" - }, - { - "itemId": "enabled", - "type": "boolean" - }, - { - "itemId": "missingPlugins", - "type": "boolean" - }, - { - "itemId": "hidden", - "type": "boolean" - }, - { - "itemId": "readOnly", - "type": "boolean" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/search.json b/services/src/main/resources/META-INF/cxs/events/search.json deleted file mode 100644 index 94fb45c12..000000000 --- a/services/src/main/resources/META-INF/cxs/events/search.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "type": "search", - "propertyTypes": [ - { - "itemId": "properties", - "type": "set", - "childPropertyTypes": [ - { - "itemId": "originForm", - "type": "string" - }, - { - "itemId": "language", - "type": "string" - }, - { - "itemId": "keyword", - "type": "string" - }, - { - "itemId": "origin", - "type": "string" - } - ] - }, - { - "itemId": "target", - "type": "set", - "childPropertyTypes": [ - { - "itemId": "itemId", - "type": "string" - }, - { - "itemId": "itemType", - "type": "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId": "scope", - "type": "string" - }, - { - "itemId": "properties", - "type": "set" - } - ] - } - ] -} diff --git a/services/src/main/resources/META-INF/cxs/events/sessionCreated.json b/services/src/main/resources/META-INF/cxs/events/sessionCreated.json deleted file mode 100644 index 0d2764724..000000000 --- a/services/src/main/resources/META-INF/cxs/events/sessionCreated.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type" : "sessionCreated", - "propertyTypes" : [ - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "profileId", - "type" : "string" - }, - { - "itemId" : "profile", - "type" : "set" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId" : "systemProperties", - "type" : "set" - }, - { - "itemId" : "lastEventDate", - "type" : "date" - }, - { - "itemId" : "size", - "type" : "long" - }, - { - "itemId" : "duration", - "type" : "long" - } - ] - } - - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json b/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json deleted file mode 100644 index d69801b5a..000000000 --- a/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "type" : "sessionReassigned", - "propertyTypes" : [ - { - "itemId" : "source", - "type": "set" - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "profileId", - "type" : "string" - }, - { - "itemId" : "profile", - "type" : "set" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId" : "systemProperties", - "type" : "set" - }, - { - "itemId" : "lastEventDate", - "type" : "date" - }, - { - "itemId" : "size", - "type" : "long" - }, - { - "itemId" : "duration", - "type" : "long" - } - ] - } - ] -} \ No newline at end of file diff --git a/services/src/main/resources/META-INF/cxs/events/updateProperties.json b/services/src/main/resources/META-INF/cxs/events/updateProperties.json deleted file mode 100644 index 2be02f4fa..000000000 --- a/services/src/main/resources/META-INF/cxs/events/updateProperties.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "updateProperties", - "propertyTypes" : [ - { - "itemId": "properties", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "targetId", - "type" : "string" - }, - { - "itemId" : "targetType", - "type" : "string" - }, - { - "itemId" : "add", - "type" : "set" - }, - { - "itemId" : "update", - "type" : "set" - }, - { - "itemId" : "delete", - "type" : "set" - } - ] - }, - { - "itemId": "target", - "type": "set" - }, - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} diff --git a/services/src/main/resources/META-INF/cxs/events/view.json b/services/src/main/resources/META-INF/cxs/events/view.json deleted file mode 100644 index a07398f92..000000000 --- a/services/src/main/resources/META-INF/cxs/events/view.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "type" : "view", - "propertyTypes" : [ - { - "itemId": "properties", - "type": "set" - }, - { - "itemId" : "source", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - }, - { - "itemId" : "target", - "type": "set", - "childPropertyTypes" : [ - { - "itemId" : "itemId", - "type" : "string" - }, - { - "itemId" : "itemType", - "type" : "string" - }, - { - "itemId" : "customItemType", - "type" : "string" - }, - { - "itemId" : "scope", - "type" : "string" - }, - { - "itemId" : "properties", - "type" : "set" - }, - { - "itemId": "version", - "type": "long" - }, - { - "itemId": "systemMetadata", - "type": "set" - } - ] - } - ] -} \ No newline at end of file
